qumra-engine 1.0.52 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see bundle.cjs.js.LICENSE.txt */
2
- (()=>{var t={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:G(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function G(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,G,_,A,F,T,C,P,N,I,U,q,D,z,X,$,K,R,W,Y,B,H,J,M;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(G in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(G,f[G]);for(_ in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(_,p[_]);return A=h(S),y("lang",A.language),F="".concat(O,"://").concat(n.get("host")).concat(A.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),q=U.getDevice(),D=U.getOS(),z=q.type||"desktop",X="".concat(D.name," ").concat(D.version),console.log("🚀 ~ return ~ fullUrl:",F),$="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),K={"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":X,"X-Timezone":I},R={headers:K},r.next=30,fetch($,R);case 30:return W=r.sent,(Y=W.headers.getSetCookie())&&Y.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=35,W.json();case 35:for(M in B=r.sent,H=B.global,J=B.context,H)Object.hasOwnProperty.call(H,M)&&y(M,H[M]);J.page?i.render(J.page.fileName,{global:H,context:J}):i.render("404",{global:H,context:J});case 39:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{"use strict";t.exports=require("dinero.js")},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},426:t=>{"use strict";t.exports=require("ua-parser-js")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},e={},r=function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(99);module.exports=r})();
2
+ (()=>{var t={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:A(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=G(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function G(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,G(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,A,G,_,F,T,C,P,N,I,U,q,D,z,X,$,K,R,W,Y,B,H,J,M,V;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(A in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(A,f[A]);for(G in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(G,p[G]);return _=h(S),y("lang",_.language),F="".concat(O,"://").concat(n.get("host")).concat(_.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),q=U.getDevice(),D=U.getOS(),z=q.type||"desktop",X="".concat(D.name," ").concat(D.version),console.log("🚀 ~ return ~ fullUrl:",F),$="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),K=n.cookies.token,R={Authorization:K,"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":X,"X-Timezone":I},W={headers:R},r.next=31,fetch($,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(V in H=r.sent,J=H.global,M=H.context,J)Object.hasOwnProperty.call(J,V)&&y(V,J[V]);M.page?i.render(M.page.fileName,{global:J,context:M}):i.render("404",{global:J,context:M});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{"use strict";t.exports=require("dinero.js")},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},426:t=>{"use strict";t.exports=require("ua-parser-js")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},e={},r=function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(99);module.exports=r})();
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see bundle.esm.js.LICENSE.txt */
2
- import{createRequire as t}from"node:module";var e={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:G(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function G(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,G,_,A,F,T,C,P,N,I,U,D,q,z,R,X,$,K,W,Y,B,H,J,M;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(G in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(G,f[G]);for(_ in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(_,p[_]);return A=h(S),y("lang",A.language),F="".concat(O,"://").concat(n.get("host")).concat(A.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),D=U.getDevice(),q=U.getOS(),z=D.type||"desktop",R="".concat(q.name," ").concat(q.version),console.log("🚀 ~ return ~ fullUrl:",F),X="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),$={"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":R,"X-Timezone":I},K={headers:$},r.next=30,fetch(X,K);case 30:return W=r.sent,(Y=W.headers.getSetCookie())&&Y.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=35,W.json();case 35:for(M in B=r.sent,H=B.global,J=B.context,H)Object.hasOwnProperty.call(H,M)&&y(M,H[M]);J.page?i.render(J.page.fileName,{global:H,context:J}):i.render("404",{global:H,context:J});case 39:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{t.exports=require("dinero.js")},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},426:t=>{t.exports=require("ua-parser-js")},896:e=>{e.exports=t(import.meta.url)("fs")},928:e=>{e.exports=t(import.meta.url)("path")}},r={};!function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}(99);
2
+ import{createRequire as t}from"node:module";var e={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:A(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=G(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function G(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,G(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,A,G,_,F,T,C,P,N,I,U,D,q,z,R,X,$,K,W,Y,B,H,J,M,V;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(A in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(A,f[A]);for(G in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(G,p[G]);return _=h(S),y("lang",_.language),F="".concat(O,"://").concat(n.get("host")).concat(_.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),D=U.getDevice(),q=U.getOS(),z=D.type||"desktop",R="".concat(q.name," ").concat(q.version),console.log("🚀 ~ return ~ fullUrl:",F),X="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),$=n.cookies.token,K={Authorization:$,"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":R,"X-Timezone":I},W={headers:K},r.next=31,fetch(X,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(V in H=r.sent,J=H.global,M=H.context,J)Object.hasOwnProperty.call(J,V)&&y(V,J[V]);M.page?i.render(M.page.fileName,{global:J,context:M}):i.render("404",{global:J,context:M});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{t.exports=require("dinero.js")},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},426:t=>{t.exports=require("ua-parser-js")},896:e=>{e.exports=t(import.meta.url)("fs")},928:e=>{e.exports=t(import.meta.url)("path")}},r={};!function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}(99);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qumra-engine",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "module": "dist/bundle.esm.js",
6
6
  "scripts": {