recaho-print-react 0.0.136 → 0.0.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/recaho-print-react.js +209 -192
- package/dist/recaho-print-react.umd.cjs +7 -7
- package/package.json +3 -3
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xr;function si(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=xe,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function _(g){if(g===null||typeof g!="object")return null;var M=x&&g[x]||g[v];return typeof M=="function"?M:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(g){{for(var M=arguments.length,C=new Array(M>1?M-1:0),N=1;N<M;N++)C[N-1]=arguments[N];w("error",g,C)}}function w(g,M,C){{var N=E.ReactDebugCurrentFrame,Y=N.getStackAddendum();Y!==""&&(M+="%s",C=C.concat([Y]));var V=C.map(function(R){return String(R)});V.unshift("Warning: "+M),Function.prototype.apply.call(console[g],console,V)}}var D=!1,$=!1,P=!1,Z=!1,ne=!1,te;te=Symbol.for("react.module.reference");function le(g){return!!(typeof g=="string"||typeof g=="function"||g===r||g===a||ne||g===i||g===l||g===c||Z||g===m||D||$||P||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===h||g.$$typeof===u||g.$$typeof===f||g.$$typeof===o||g.$$typeof===te||g.getModuleId!==void 0))}function Se(g,M,C){var N=g.displayName;if(N)return N;var Y=M.displayName||M.name||"";return Y!==""?C+"("+Y+")":C}function Q(g){return g.displayName||"Context"}function J(g){if(g==null)return null;if(typeof g.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case f:var M=g;return Q(M)+".Consumer";case u:var C=g;return Q(C._context)+".Provider";case o:return Se(g,g.render,"ForwardRef");case h:var N=g.displayName||null;return N!==null?N:J(g.type)||"Memo";case p:{var Y=g,V=Y._payload,R=Y._init;try{return J(R(V))}catch{return null}}}return null}var G=Object.assign,de=0,W,X,
|
|
17
|
+
*/var xr;function si(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=xe,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function _(g){if(g===null||typeof g!="object")return null;var M=x&&g[x]||g[v];return typeof M=="function"?M:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(g){{for(var M=arguments.length,C=new Array(M>1?M-1:0),N=1;N<M;N++)C[N-1]=arguments[N];w("error",g,C)}}function w(g,M,C){{var N=E.ReactDebugCurrentFrame,Y=N.getStackAddendum();Y!==""&&(M+="%s",C=C.concat([Y]));var V=C.map(function(R){return String(R)});V.unshift("Warning: "+M),Function.prototype.apply.call(console[g],console,V)}}var D=!1,$=!1,P=!1,Z=!1,ne=!1,te;te=Symbol.for("react.module.reference");function le(g){return!!(typeof g=="string"||typeof g=="function"||g===r||g===a||ne||g===i||g===l||g===c||Z||g===m||D||$||P||typeof g=="object"&&g!==null&&(g.$$typeof===p||g.$$typeof===h||g.$$typeof===u||g.$$typeof===f||g.$$typeof===o||g.$$typeof===te||g.getModuleId!==void 0))}function Se(g,M,C){var N=g.displayName;if(N)return N;var Y=M.displayName||M.name||"";return Y!==""?C+"("+Y+")":C}function Q(g){return g.displayName||"Context"}function J(g){if(g==null)return null;if(typeof g.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case f:var M=g;return Q(M)+".Consumer";case u:var C=g;return Q(C._context)+".Provider";case o:return Se(g,g.render,"ForwardRef");case h:var N=g.displayName||null;return N!==null?N:J(g.type)||"Memo";case p:{var Y=g,V=Y._payload,R=Y._init;try{return J(R(V))}catch{return null}}}return null}var G=Object.assign,de=0,W,X,st,nt,Ot,rt,Mt;function ee(){}ee.__reactDisabledLog=!0;function be(){{if(de===0){W=console.log,X=console.info,st=console.warn,nt=console.error,Ot=console.group,rt=console.groupCollapsed,Mt=console.groupEnd;var g={configurable:!0,enumerable:!0,value:ee,writable:!0};Object.defineProperties(console,{info:g,log:g,warn:g,error:g,group:g,groupCollapsed:g,groupEnd:g})}de++}}function pt(){{if(de--,de===0){var g={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},g,{value:W}),info:G({},g,{value:X}),warn:G({},g,{value:st}),error:G({},g,{value:nt}),group:G({},g,{value:Ot}),groupCollapsed:G({},g,{value:rt}),groupEnd:G({},g,{value:Mt})})}de<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var y=E.ReactCurrentDispatcher,d;function O(g,M,C){{if(d===void 0)try{throw Error()}catch(Y){var N=Y.stack.trim().match(/\n( *(at )?)/);d=N&&N[1]||""}return`
|
|
18
18
|
`+d+g}}var j=!1,I;{var U=typeof WeakMap=="function"?WeakMap:Map;I=new U}function b(g,M){if(!g||j)return"";{var C=I.get(g);if(C!==void 0)return C}var N;j=!0;var Y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var V;V=y.current,y.current=null,be();try{if(M){var R=function(){throw Error()};if(Object.defineProperty(R.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(R,[])}catch(ke){N=ke}Reflect.construct(g,[],R)}else{try{R.call()}catch(ke){N=ke}g.call(R.prototype)}}else{try{throw Error()}catch(ke){N=ke}g()}}catch(ke){if(ke&&N&&typeof ke.stack=="string"){for(var T=ke.stack.split(`
|
|
19
19
|
`),ge=N.stack.split(`
|
|
20
20
|
`),pe=T.length-1,Ne=ge.length-1;pe>=1&&Ne>=0&&T[pe]!==ge[Ne];)Ne--;for(;pe>=1&&Ne>=0;pe--,Ne--)if(T[pe]!==ge[Ne]){if(pe!==1||Ne!==1)do if(pe--,Ne--,Ne<0||T[pe]!==ge[Ne]){var we=`
|
|
21
|
-
`+T[pe].replace(" at new "," at ");return g.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",g.displayName)),typeof g=="function"&&I.set(g,we),we}while(pe>=1&&Ne>=0);break}}}finally{j=!1,y.current=V,pt(),Error.prepareStackTrace=Y}var Zt=g?g.displayName||g.name:"",Et=Zt?O(Zt):"";return typeof g=="function"&&I.set(g,Et),Et}function F(g,M,C){return b(g,!1)}function z(g){var M=g.prototype;return!!(M&&M.isReactComponent)}function he(g,M,C){if(g==null)return"";if(typeof g=="function")return b(g,z(g));if(typeof g=="string")return O(g);switch(g){case l:return O("Suspense");case c:return O("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case o:return F(g.render);case h:return he(g.type,M,C);case p:{var N=g,Y=N._payload,V=N._init;try{return he(V(Y),M,C)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,He={},Le=E.ReactDebugCurrentFrame;function Oe(g){if(g){var M=g._owner,C=he(g.type,g._source,M?M.type:null);Le.setExtraStackFrame(C)}else Le.setExtraStackFrame(null)}function De(g,M,C,N,Y){{var V=Function.call.bind(Ae);for(var R in g)if(V(g,R)){var T=void 0;try{if(typeof g[R]!="function"){var ge=Error((N||"React class")+": "+C+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}T=g[R](M,R,N,C,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){T=pe}T&&!(T instanceof Error)&&(Oe(Y),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",C,R,typeof T),Oe(null)),T instanceof Error&&!(T.message in He)&&(He[T.message]=!0,Oe(Y),S("Failed %s type: %s",C,T.message),Oe(null))}}}var
|
|
21
|
+
`+T[pe].replace(" at new "," at ");return g.displayName&&we.includes("<anonymous>")&&(we=we.replace("<anonymous>",g.displayName)),typeof g=="function"&&I.set(g,we),we}while(pe>=1&&Ne>=0);break}}}finally{j=!1,y.current=V,pt(),Error.prepareStackTrace=Y}var Zt=g?g.displayName||g.name:"",Et=Zt?O(Zt):"";return typeof g=="function"&&I.set(g,Et),Et}function F(g,M,C){return b(g,!1)}function z(g){var M=g.prototype;return!!(M&&M.isReactComponent)}function he(g,M,C){if(g==null)return"";if(typeof g=="function")return b(g,z(g));if(typeof g=="string")return O(g);switch(g){case l:return O("Suspense");case c:return O("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case o:return F(g.render);case h:return he(g.type,M,C);case p:{var N=g,Y=N._payload,V=N._init;try{return he(V(Y),M,C)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,He={},Le=E.ReactDebugCurrentFrame;function Oe(g){if(g){var M=g._owner,C=he(g.type,g._source,M?M.type:null);Le.setExtraStackFrame(C)}else Le.setExtraStackFrame(null)}function De(g,M,C,N,Y){{var V=Function.call.bind(Ae);for(var R in g)if(V(g,R)){var T=void 0;try{if(typeof g[R]!="function"){var ge=Error((N||"React class")+": "+C+" type `"+R+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[R]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}T=g[R](M,R,N,C,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){T=pe}T&&!(T instanceof Error)&&(Oe(Y),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",C,R,typeof T),Oe(null)),T instanceof Error&&!(T.message in He)&&(He[T.message]=!0,Oe(Y),S("Failed %s type: %s",C,T.message),Oe(null))}}}var Ke=Array.isArray;function yt(g){return Ke(g)}function K(g){{var M=typeof Symbol=="function"&&Symbol.toStringTag,C=M&&g[Symbol.toStringTag]||g.constructor.name||"Object";return C}}function At(g){try{return at(g),!1}catch{return!0}}function at(g){return""+g}function gs(g){if(At(g))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",K(g)),at(g)}var xs=E.ReactCurrentOwner,an={key:!0,ref:!0,__self:!0,__source:!0},Ns,js;function ln(g){if(Ae.call(g,"ref")){var M=Object.getOwnPropertyDescriptor(g,"ref").get;if(M&&M.isReactWarning)return!1}return g.ref!==void 0}function on(g){if(Ae.call(g,"key")){var M=Object.getOwnPropertyDescriptor(g,"key").get;if(M&&M.isReactWarning)return!1}return g.key!==void 0}function cn(g,M){typeof g.ref=="string"&&xs.current}function dn(g,M){{var C=function(){Ns||(Ns=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};C.isReactWarning=!0,Object.defineProperty(g,"key",{get:C,configurable:!0})}}function hn(g,M){{var C=function(){js||(js=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",M))};C.isReactWarning=!0,Object.defineProperty(g,"ref",{get:C,configurable:!0})}}var un=function(g,M,C,N,Y,V,R){var T={$$typeof:t,type:g,key:M,ref:C,props:R,_owner:V};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Y}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function mn(g,M,C,N,Y){{var V,R={},T=null,ge=null;C!==void 0&&(gs(C),T=""+C),on(M)&&(gs(M.key),T=""+M.key),ln(M)&&(ge=M.ref,cn(M,Y));for(V in M)Ae.call(M,V)&&!an.hasOwnProperty(V)&&(R[V]=M[V]);if(g&&g.defaultProps){var pe=g.defaultProps;for(V in pe)R[V]===void 0&&(R[V]=pe[V])}if(T||ge){var Ne=typeof g=="function"?g.displayName||g.name||"Unknown":g;T&&dn(R,Ne),ge&&hn(R,Ne)}return un(g,T,ge,Y,N,xs.current,R)}}var qt=E.ReactCurrentOwner,vs=E.ReactDebugCurrentFrame;function gt(g){if(g){var M=g._owner,C=he(g.type,g._source,M?M.type:null);vs.setExtraStackFrame(C)}else vs.setExtraStackFrame(null)}var Kt;Kt=!1;function Qt(g){return typeof g=="object"&&g!==null&&g.$$typeof===t}function _s(){{if(qt.current){var g=J(qt.current.type);if(g)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+g+"`."}return""}}function fn(g){return""}var bs={};function pn(g){{var M=_s();if(!M){var C=typeof g=="string"?g:g.displayName||g.name;C&&(M=`
|
|
24
24
|
|
|
@@ -32,17 +32,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
32
32
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
33
33
|
//! license : MIT
|
|
34
34
|
//! momentjs.com
|
|
35
|
-
var vr;function L(){return vr.apply(null,arguments)}function li(e){vr=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function bt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(oe(e,t))return!1;return!0}function Ee(e){return e===void 0}function
|
|
35
|
+
var vr;function L(){return vr.apply(null,arguments)}function li(e){vr=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function bt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _n(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(oe(e,t))return!1;return!0}function Ee(e){return e===void 0}function it(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ts(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function _r(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function xt(e,t){for(var n in t)oe(t,n)&&(e[n]=t[n]);return oe(t,"toString")&&(e.toString=t.toString),oe(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Qe(e,t,n,r){return Kr(e,t,n,r,!0).utc()}function oi(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function se(e){return e._pf==null&&(e._pf=oi()),e._pf}var bn;Array.prototype.some?bn=Array.prototype.some:bn=function(e){var t=Object(this),n=t.length>>>0,r;for(r=0;r<n;r++)if(r in t&&e.call(this,t[r],r,t))return!0;return!1};function Sn(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=se(e),n=bn.call(t.parsedDateParts,function(i){return i!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function Os(e){var t=Qe(NaN);return e!=null?xt(se(t),e):se(t).userInvalidated=!0,t}var br=L.momentProperties=[],Tn=!1;function wn(e,t){var n,r,i,a=br.length;if(Ee(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Ee(t._i)||(e._i=t._i),Ee(t._f)||(e._f=t._f),Ee(t._l)||(e._l=t._l),Ee(t._strict)||(e._strict=t._strict),Ee(t._tzm)||(e._tzm=t._tzm),Ee(t._isUTC)||(e._isUTC=t._isUTC),Ee(t._offset)||(e._offset=t._offset),Ee(t._pf)||(e._pf=se(t)),Ee(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=br[n],i=t[r],Ee(i)||(e[r]=i);return e}function ss(e){wn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Tn===!1&&(Tn=!0,L.updateOffset(this),Tn=!1)}function We(e){return e instanceof ss||e!=null&&e._isAMomentObject!=null}function Sr(e){L.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Ye(e,t){var n=!0;return xt(function(){if(L.deprecationHandler!=null&&L.deprecationHandler(null,e),n){var r=[],i,a,u,f=arguments.length;for(a=0;a<f;a++){if(i="",typeof arguments[a]=="object"){i+=`
|
|
36
36
|
[`+a+"] ";for(u in arguments[0])oe(arguments[0],u)&&(i+=u+": "+arguments[0][u]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}Sr(e+`
|
|
37
37
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
38
|
-
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Tr={};function wr(e,t){L.deprecationHandler!=null&&L.deprecationHandler(e,t),Tr[e]||(Sr(t),Tr[e]=!0)}L.suppressDeprecationWarnings=!1,L.deprecationHandler=null;function Qe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ci(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Qe(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function In(e,t){var n=xt({},e),r;for(r in t)oe(t,r)&&(bt(e[r])&&bt(t[r])?(n[r]={},xt(n[r],e[r]),xt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&bt(e[r])&&(n[r]=xt({},n[r]));return n}function Cn(e){e!=null&&this.set(e)}var On;Object.keys?On=Object.keys:On=function(e){var t,n=[];for(t in e)oe(e,t)&&n.push(t);return n};var di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function hi(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Qe(r)?r.call(t,n):r}function Ze(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Mn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,An={},Lt={};function q(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Lt[e]=i),t&&(Lt[t[0]]=function(){return Ze(i.apply(this,arguments),t[1],t[2])}),n&&(Lt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ui(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function mi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Lt[t[n]]?t[n]=Lt[t[n]]:t[n]=ui(t[n]);return function(i){var a="",u;for(u=0;u<r;u++)a+=Qe(t[u])?t[u].call(i,e):t[u];return a}}function As(e,t){return e.isValid()?(t=Ir(t,e.localeData()),An[t]=An[t]||mi(t),An[t](e)):e.localeData().invalidDate()}function Ir(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var fi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function pi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Mn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var yi="Invalid date";function gi(){return this._invalidDate}var xi="%d",Ni=/\d{1,2}/;function ji(e){return this._ordinal.replace("%d",e)}var vi={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function _i(e,t,n,r){var i=this._relativeTime[n];return Qe(i)?i(e,t,n,r):i.replace(/%d/i,e)}function bi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Qe(n)?n(t):n.replace(/%s/i,t)}var Cr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ue(e){return typeof e=="string"?Cr[e]||Cr[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=Ue(r),n&&(t[n]=e[r]));return t}var Si={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ti(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Si[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Or=/\d/,Pe=/\d\d/,Mr=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,me=/\d\d?/,Ar=/\d\d\d\d?/,Er=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,kt=/\d+/,ks=/[+-]?\d+/,wi=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ii=/[+-]?\d+(\.\d{1,3})?/,ns=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function H(e,t,n){Fs[e]=Qe(t)?t:function(r,i){return r&&n?n:t}}function Ci(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Oi(e))}function Oi(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $e(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function re(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=$e(t)),n}var Pn={};function ue(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(a,u){u[t]=re(a)}),i=e.length,n=0;n<i;n++)Pn[e[n]]=r}function rs(e,t){ue(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Mi(e,t,n){t!=null&&oe(Pn,e)&&Pn[e](t,n._a,n,e)}function Ds(e){return e%4===0&&e%100!==0||e%400===0}var Ce=0,lt=1,Je=2,Te=3,ze=4,ot=5,St=6,Ai=7,Ei=8;q("Y",0,0,function(){var e=this.year();return e<=9999?Ze(e,4):"+"+e}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),H("Y",ks),H("YY",me,Pe),H("YYYY",Ln,Rn),H("YYYYY",Ls,Es),H("YYYYYY",Ls,Es),ue(["YYYYY","YYYYYY"],Ce),ue("YYYY",function(e,t){t[Ce]=e.length===2?L.parseTwoDigitYear(e):re(e)}),ue("YY",function(e,t){t[Ce]=L.parseTwoDigitYear(e)}),ue("Y",function(e,t){t[Ce]=parseInt(e,10)});function as(e){return Ds(e)?366:365}L.parseTwoDigitYear=function(e){return re(e)+(re(e)>68?1900:2e3)};var Rr=Ft("FullYear",!0);function Ri(){return Ds(this.year())}function Ft(e,t){return function(n){return n!=null?(Lr(this,e,n),L.updateOffset(this,t),this):is(this,e)}}function is(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Lr(e,t,n){var r,i,a,u,f;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,u=e.month(),f=e.date(),f=f===29&&u===1&&!Ds(a)?28:f,i?r.setUTCFullYear(a,u,f):r.setFullYear(a,u,f)}}function Li(e){return e=Ue(e),Qe(this[e])?this[e]():this}function ki(e,t){if(typeof e=="object"){e=En(e);var n=Ti(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Ue(e),Qe(this[e]))return this[e](t);return this}function Pi(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Fn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Pi(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),q("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("M",me,Pt),H("MM",me,Pe),H("MMM",function(e,t){return t.monthsShortRegex(e)}),H("MMMM",function(e,t){return t.monthsRegex(e)}),ue(["M","MM"],function(e,t){t[lt]=re(e)-1}),ue(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[lt]=i:se(n).invalidMonth=e});var Fi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Di=ns,Yi=ns;function Ui(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function $i(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Hi(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Ke([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:null):(i=je.call(this._longMonthsParse,u),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:(i=je.call(this._longMonthsParse,u),i!==-1?i:null)):(i=je.call(this._longMonthsParse,u),i!==-1?i:(i=je.call(this._shortMonthsParse,u),i!==-1?i:null))}function Bi(e,t,n){var r,i,a;if(this._monthsParseExact)return Hi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Ke([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Fr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=re(t);else if(t=e.localeData().monthsParse(t),!at(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Fn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Dr(e){return e!=null?(Fr(this,e),L.updateOffset(this,!0),this):is(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Yr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Di),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Yr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Yi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Yr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,u,f;for(i=0;i<12;i++)a=Ke([2e3,i]),u=it(this.monthsShort(a,"")),f=it(this.months(a,"")),t.push(u),n.push(f),r.push(f),r.push(u);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Vi(e,t,n,r,i,a,u){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,r,i,a,u),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,r,i,a,u),f}function ls(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ys(e,t,n){var r=7+t-n,i=(7+ls(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Ur(e,t,n,r,i){var a=(7+n-r)%7,u=Ys(e,r,i),f=1+7*(t-1)+a+u,o,l;return f<=0?(o=e-1,l=as(o)+f):f>as(e)?(o=e+1,l=f-as(e)):(o=e,l=f),{year:o,dayOfYear:l}}function os(e,t,n){var r=Ys(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,u;return i<1?(u=e.year()-1,a=i+ct(u,t,n)):i>ct(e.year(),t,n)?(a=i-ct(e.year(),t,n),u=e.year()+1):(u=e.year(),a=i),{week:a,year:u}}function ct(e,t,n){var r=Ys(e,t,n),i=Ys(e+1,t,n);return(as(e)-r+i)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),H("w",me,Pt),H("ww",me,Pe),H("W",me,Pt),H("WW",me,Pe),rs(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=re(e)});function qi(e){return os(e,this._week.dow,this._week.doy).week}var Ki={dow:0,doy:6};function Qi(){return this._week.dow}function Zi(){return this._week.doy}function Ji(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Xi(e){var t=os(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),H("d",me),H("e",me),H("E",me),H("dd",function(e,t){return t.weekdaysMinRegex(e)}),H("ddd",function(e,t){return t.weekdaysShortRegex(e)}),H("dddd",function(e,t){return t.weekdaysRegex(e)}),rs(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:se(n).invalidWeekday=e}),rs(["d","e","E"],function(e,t,n,r){t[r]=re(e)});function el(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function tl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var sl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$r="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),nl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rl=ns,al=ns,il=ns;function ll(e,t){var n=Be(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Dn(n,this._week.dow):e?n[e.day()]:n}function ol(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function cl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function dl(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Ke([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1||(i=je.call(this._shortWeekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null))}function hl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return dl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Ke([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ul(e){if(!this.isValid())return e!=null?this:NaN;var t=is(this,"Day");return e!=null?(e=el(e,this.localeData()),this.add(e-t,"d")):t}function ml(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function fl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=tl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function pl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=rl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=al),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=il),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],i=[],a,u,f,o,l;for(a=0;a<7;a++)u=Ke([2e3,1]).day(a),f=it(this.weekdaysMin(u,"")),o=it(this.weekdaysShort(u,"")),l=it(this.weekdays(u,"")),t.push(f),n.push(o),r.push(l),i.push(f),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Un(){return this.hours()%12||12}function xl(){return this.hours()||24}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Un),q("k",["kk",2],0,xl),q("hmm",0,0,function(){return""+Un.apply(this)+Ze(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Un.apply(this)+Ze(this.minutes(),2)+Ze(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+Ze(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+Ze(this.minutes(),2)+Ze(this.seconds(),2)});function Hr(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Hr("a",!0),Hr("A",!1);function Br(e,t){return t._meridiemParse}H("a",Br),H("A",Br),H("H",me,kn),H("h",me,Pt),H("k",me,Pt),H("HH",me,Pe),H("hh",me,Pe),H("kk",me,Pe),H("hmm",Ar),H("hmmss",Er),H("Hmm",Ar),H("Hmmss",Er),ue(["H","HH"],Te),ue(["k","kk"],function(e,t,n){var r=re(e);t[Te]=r===24?0:r}),ue(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ue(["h","hh"],function(e,t,n){t[Te]=re(e),se(n).bigHour=!0}),ue("hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r)),se(n).bigHour=!0}),ue("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r,2)),t[ot]=re(e.substr(i)),se(n).bigHour=!0}),ue("Hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r))}),ue("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r,2)),t[ot]=re(e.substr(i))});function Nl(e){return(e+"").toLowerCase().charAt(0)==="p"}var jl=/[ap]\.?m?\.?/i,vl=Ft("Hours",!0);function _l(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:di,longDateFormat:fi,invalidDate:yi,ordinal:xi,dayOfMonthOrdinalParse:Ni,relativeTime:vi,months:Fi,monthsShort:kr,week:Ki,weekdays:sl,weekdaysMin:nl,weekdaysShort:$r,meridiemParse:jl},ye={},cs={},ds;function bl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function zr(e){return e&&e.toLowerCase().replace("_","-")}function Sl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=zr(e[t]).split("-"),n=a.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Us(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&bl(a,r)>=n-1)break;n--}t++}return ds}function Tl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(ye[e]===void 0&&typeof module<"u"&&module&&module.exports&&Tl(e))try{t=ds._abbr,n=require,n("./locale/"+e),Nt(t)}catch{ye[e]=null}return ye[e]}function Nt(e,t){var n;return e&&(Ee(t)?n=dt(e):n=$n(e,t),n?ds=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ds._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,ye[e]!=null)wr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ye[e]._config;else if(t.parentLocale!=null)if(ye[t.parentLocale]!=null)r=ye[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return cs[t.parentLocale]||(cs[t.parentLocale]=[]),cs[t.parentLocale].push({name:e,config:t}),null;return ye[e]=new Cn(In(r,t)),cs[e]&&cs[e].forEach(function(i){$n(i.name,i.config)}),Nt(e),ye[e]}else return delete ye[e],null}function wl(e,t){if(t!=null){var n,r,i=Wr;ye[e]!=null&&ye[e].parentLocale!=null?ye[e].set(In(ye[e]._config,t)):(r=Us(e),r!=null&&(i=r._config),t=In(i,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=ye[e],ye[e]=n),Nt(e)}else ye[e]!=null&&(ye[e].parentLocale!=null?(ye[e]=ye[e].parentLocale,e===Nt()&&Nt(e)):ye[e]!=null&&delete ye[e]);return ye[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ds;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Sl(e)}function Il(){return On(ye)}function Hn(e){var t,n=e._a;return n&&se(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[Je]<1||n[Je]>Fn(n[Ce],n[lt])?Je:n[Te]<0||n[Te]>24||n[Te]===24&&(n[ze]!==0||n[ot]!==0||n[St]!==0)?Te:n[ze]<0||n[ze]>59?ze:n[ot]<0||n[ot]>59?ot:n[St]<0||n[St]>999?St:-1,se(e)._overflowDayOfYear&&(t<Ce||t>Je)&&(t=Je),se(e)._overflowWeeks&&t===-1&&(t=Ai),se(e)._overflowWeekday&&t===-1&&(t=Ei),se(e).overflow=t),e}var Cl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ol=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ml=/Z|[+-]\d\d(?::?\d\d)?/,$s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Al=/^\/?Date\((-?\d+)/i,El=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Rl={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Gr(e){var t,n,r=e._i,i=Cl.exec(r)||Ol.exec(r),a,u,f,o,l=$s.length,c=Bn.length;if(i){for(se(e).iso=!0,t=0,n=l;t<n;t++)if($s[t][1].exec(i[1])){u=$s[t][0],a=$s[t][2]!==!1;break}if(u==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(i[3])){f=(i[2]||" ")+Bn[t][0];break}if(f==null){e._isValid=!1;return}}if(!a&&f!=null){e._isValid=!1;return}if(i[4])if(Ml.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=u+(f||"")+(o||""),zn(e)}else e._isValid=!1}function Ll(e,t,n,r,i,a){var u=[kl(e),kr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&u.push(parseInt(a,10)),u}function kl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Pl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fl(e,t,n){if(e){var r=$r.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return se(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dl(e,t,n){if(e)return Rl[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Vr(e){var t=El.exec(Pl(e._i)),n;if(t){if(n=Ll(t[4],t[3],t[2],t[5],t[6],t[7]),!Fl(t[1],n,e))return;e._a=n,e._tzm=Dl(t[8],t[9],t[10]),e._d=ls.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),se(e).rfc2822=!0}else e._isValid=!1}function Yl(e){var t=Al.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Gr(e),e._isValid===!1)delete e._isValid;else return;if(Vr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:L.createFromInputFallback(e)}L.createFromInputFallback=Ye("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Dt(e,t,n){return e??t??n}function Ul(e){var t=new Date(L.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Wn(e){var t,n,r=[],i,a,u;if(!e._d){for(i=Ul(e),e._w&&e._a[Je]==null&&e._a[lt]==null&&$l(e),e._dayOfYear!=null&&(u=Dt(e._a[Ce],i[Ce]),(e._dayOfYear>as(u)||e._dayOfYear===0)&&(se(e)._overflowDayOfYear=!0),n=ls(u,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[Je]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Te]===24&&e._a[ze]===0&&e._a[ot]===0&&e._a[St]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?ls:Vi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Te]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(se(e).weekdayMismatch=!0)}}function $l(e){var t,n,r,i,a,u,f,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,u=4,n=Dt(t.GG,e._a[Ce],os(fe(),1,4).year),r=Dt(t.W,1),i=Dt(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,u=e._locale._week.doy,l=os(fe(),a,u),n=Dt(t.gg,e._a[Ce],l.year),r=Dt(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>ct(n,a,u)?se(e)._overflowWeeks=!0:o!=null?se(e)._overflowWeekday=!0:(f=Ur(n,r,i,a,u),e._a[Ce]=f.year,e._dayOfYear=f.dayOfYear)}L.ISO_8601=function(){},L.RFC_2822=function(){};function zn(e){if(e._f===L.ISO_8601){Gr(e);return}if(e._f===L.RFC_2822){Vr(e);return}e._a=[],se(e).empty=!0;var t=""+e._i,n,r,i,a,u,f=t.length,o=0,l,c;for(i=Ir(e._f,e._locale).match(Mn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ci(a,e))||[])[0],r&&(u=t.substr(0,t.indexOf(r)),u.length>0&&se(e).unusedInput.push(u),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Lt[a]?(r?se(e).empty=!1:se(e).unusedTokens.push(a),Mi(a,r,e)):e._strict&&!r&&se(e).unusedTokens.push(a);se(e).charsLeftOver=f-o,t.length>0&&se(e).unusedInput.push(t),e._a[Te]<=12&&se(e).bigHour===!0&&e._a[Te]>0&&(se(e).bigHour=void 0),se(e).parsedDateParts=e._a.slice(0),se(e).meridiem=e._meridiem,e._a[Te]=Hl(e._locale,e._a[Te],e._meridiem),l=se(e).era,l!==null&&(e._a[Ce]=e._locale.erasConvertYear(l,e._a[Ce])),Wn(e),Hn(e)}function Hl(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Bl(e){var t,n,r,i,a,u,f=!1,o=e._f.length;if(o===0){se(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,u=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],zn(t),Sn(t)&&(u=!0),a+=se(t).charsLeftOver,a+=se(t).unusedTokens.length*10,se(t).score=a,f?a<r&&(r=a,n=t):(r==null||a<r||u)&&(r=a,n=t,u&&(f=!0));xt(e,n||t)}function Wl(e){if(!e._d){var t=En(e._i),n=t.day===void 0?t.date:t.day;e._a=_r([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Wn(e)}}function zl(e){var t=new ss(Hn(qr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function qr(e){var t=e._i,n=e._f;return e._locale=e._locale||dt(e._l),t===null||n===void 0&&t===""?Os({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),We(t)?new ss(Hn(t)):(ts(t)?e._d=t:Be(n)?Bl(e):n?zn(e):Gl(e),Sn(e)||(e._d=null),e))}function Gl(e){var t=e._i;Ee(t)?e._d=new Date(L.now()):ts(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Yl(e):Be(t)?(e._a=_r(t.slice(0),function(n){return parseInt(n,10)}),Wn(e)):bt(t)?Wl(e):at(t)?e._d=new Date(t):L.createFromInputFallback(e)}function Kr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(bt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,zl(a)}function fe(e,t,n,r){return Kr(e,t,n,r,!1)}var Vl=Ye("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),ql=Ye("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Qr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return fe();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Kl(){var e=[].slice.call(arguments,0);return Qr("isBefore",e)}function Ql(){var e=[].slice.call(arguments,0);return Qr("isAfter",e)}var Zl=function(){return Date.now?Date.now():+new Date},hs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Jl(e){var t,n=!1,r,i=hs.length;for(t in e)if(oe(e,t)&&!(je.call(hs,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[hs[r]]){if(n)return!1;parseFloat(e[hs[r]])!==re(e[hs[r]])&&(n=!0)}return!0}function Xl(){return this._isValid}function eo(){return Ge(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,u=t.day||0,f=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Jl(t),this._milliseconds=+c+l*1e3+o*6e4+f*1e3*60*60,this._days=+u+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Bs(e){return e instanceof Hs}function Gn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function to(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,u;for(u=0;u<r;u++)re(e[u])!==re(t[u])&&a++;return a+i}function Zr(e,t){q(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Ze(~~(n/60),2)+t+Ze(~~n%60,2)})}Zr("Z",":"),Zr("ZZ",""),H("Z",Ps),H("ZZ",Ps),ue(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var so=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(so)||["-",0,0],a=+(i[1]*60)+re(i[2]),a===0?0:i[0]==="+"?a:-a)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(We(e)||ts(e)?e.valueOf():fe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),L.updateOffset(n,!1),n):fe(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}L.updateOffset=function(){};function no(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Vn(Ps,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Kn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ta(this,Ge(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,L.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ro(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ao(e){return this.utcOffset(0,e)}function io(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function lo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(wi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function oo(e){return this.isValid()?(e=e?fe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function co(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ho(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=qr(e),e._a?(t=e._isUTC?Ke(e._a):fe(e._a),this._isDSTShifted=this.isValid()&&to(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function uo(){return this.isValid()?!this._isUTC:!1}function mo(){return this.isValid()?this._isUTC:!1}function Jr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,po=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ge(e,t){var n=e,r=null,i,a,u;return Bs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:at(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:re(r[Je])*i,h:re(r[Te])*i,m:re(r[ze])*i,s:re(r[ot])*i,ms:re(Gn(r[St]*1e3))*i}):(r=po.exec(e))?(i=r[1]==="-"?-1:1,n={y:Tt(r[2],i),M:Tt(r[3],i),w:Tt(r[4],i),d:Tt(r[5],i),h:Tt(r[6],i),m:Tt(r[7],i),s:Tt(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=yo(fe(n.from),fe(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),a=new Hs(n),Bs(e)&&oe(e,"_locale")&&(a._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(a._isValid=e._isValid),a}Ge.fn=Hs.prototype,Ge.invalid=eo;function Tt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function yo(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=Xr(e,t):(n=Xr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ea(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(wr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=Ge(n,r),ta(this,i,e),this}}function ta(e,t,n,r){var i=t._milliseconds,a=Gn(t._days),u=Gn(t._months);e.isValid()&&(r=r??!0,u&&Fr(e,is(e,"Month")+u*n),a&&Lr(e,"Date",is(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&L.updateOffset(e,a||u))}var go=ea(1,"add"),xo=ea(-1,"subtract");function sa(e){return typeof e=="string"||e instanceof String}function No(e){return We(e)||ts(e)||sa(e)||at(e)||vo(e)||jo(e)||e===null||e===void 0}function jo(e){var t=bt(e)&&!_n(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,u=r.length;for(i=0;i<u;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function vo(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&sa(e)}).length===0),t&&n}function _o(e){var t=bt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function bo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function So(e,t){arguments.length===1&&(arguments[0]?No(arguments[0])?(e=arguments[0],t=void 0):_o(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||fe(),r=qn(n,this).startOf("day"),i=L.calendarFormat(this,r)||"sameElse",a=t&&(Qe(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,fe(n)))}function To(){return new ss(this)}function wo(e,t){var n=We(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Io(e,t){var n=We(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Co(e,t,n,r){var i=We(e)?e:fe(e),a=We(t)?t:fe(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Oo(e,t){var n=We(e)?e:fe(e),r;return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Mo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Ao(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Eo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Ue(t),t){case"year":a=Ws(this,r)/12;break;case"month":a=Ws(this,r);break;case"quarter":a=Ws(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:$e(a)}function Ws(e,t){if(e.date()<t.date())return-Ws(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}L.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",L.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ro(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Lo(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Qe(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function Po(e){e||(e=this.isUtc()?L.defaultFormatUtc:L.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Fo(e,t){return this.isValid()&&(We(e)&&e.isValid()||fe(e).isValid())?Ge({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.from(fe(),e)}function Yo(e,t){return this.isValid()&&(We(e)&&e.isValid()||fe(e).isValid())?Ge({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Uo(e){return this.to(fe(),e)}function na(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var ra=Ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function aa(){return this._locale}var zs=1e3,Yt=60*zs,Gs=60*Yt,ia=(365*400+97)*24*Gs;function Ut(e,t){return(e%t+t)%t}function la(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ia:new Date(e,t,n).valueOf()}function oa(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ia:Date.UTC(e,t,n)}function $o(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ut(t+(this._isUTC?0:this.utcOffset()*Yt),Gs);break;case"minute":t=this._d.valueOf(),t-=Ut(t,Yt);break;case"second":t=this._d.valueOf(),t-=Ut(t,zs);break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Ho(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Gs-Ut(t+(this._isUTC?0:this.utcOffset()*Yt),Gs)-1;break;case"minute":t=this._d.valueOf(),t+=Yt-Ut(t,Yt)-1;break;case"second":t=this._d.valueOf(),t+=zs-Ut(t,zs)-1;break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Bo(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Go(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Vo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function Ko(){return Sn(this)}function Qo(){return xt({},se(this))}function Zo(){return se(this).overflow}function Jo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}q("N",0,0,"eraAbbr"),q("NN",0,0,"eraAbbr"),q("NNN",0,0,"eraAbbr"),q("NNNN",0,0,"eraName"),q("NNNNN",0,0,"eraNarrow"),q("y",["y",1],"yo","eraYear"),q("y",["yy",2],0,"eraYear"),q("y",["yyy",3],0,"eraYear"),q("y",["yyyy",4],0,"eraYear"),H("N",Qn),H("NN",Qn),H("NNN",Qn),H("NNNN",cc),H("NNNNN",dc),ue(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?se(n).era=i:se(n).invalidEra=e}),H("y",kt),H("yy",kt),H("yyy",kt),H("yyyy",kt),H("yo",hc),ue(["y","yy","yyy","yyyy"],Ce),ue(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ce]=n._locale.eraYearOrdinalParse(e,i):t[Ce]=parseInt(e,10)});function Xo(e,t){var n,r,i,a=this._eras||dt("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=L(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=L(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function ec(e,t,n){var r,i,a=this.eras(),u,f,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(u=a[r].name.toUpperCase(),f=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return a[r];break;case"NNNN":if(u===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([u,f,o].indexOf(e)>=0)return a[r]}function tc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?L(e.since).year():L(e.since).year()+(t-e.offset)*n}function sc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function rc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function ac(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-L(i[e].since).year())*n+i[e].offset;return this.year()}function ic(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function lc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function oc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function cc(e,t){return t.erasNameRegex(e)}function dc(e,t){return t.erasNarrowRegex(e)}function hc(e,t){return t._eraYearOrdinalRegex||kt}function Zn(){var e=[],t=[],n=[],r=[],i,a,u,f,o,l=this.eras();for(i=0,a=l.length;i<a;++i)u=it(l[i].name),f=it(l[i].abbr),o=it(l[i].narrow),t.push(u),e.push(f),n.push(o),r.push(u),r.push(f),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Vs(e,t){q(0,[e,e.length],0,t)}Vs("gggg","weekYear"),Vs("ggggg","weekYear"),Vs("GGGG","isoWeekYear"),Vs("GGGGG","isoWeekYear"),H("G",ks),H("g",ks),H("GG",me,Pe),H("gg",me,Pe),H("GGGG",Ln,Rn),H("gggg",Ln,Rn),H("GGGGG",Ls,Es),H("ggggg",Ls,Es),rs(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=re(e)}),rs(["gg","GG"],function(e,t,n,r){t[r]=L.parseTwoDigitYear(e)});function uc(e){return ca.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function mc(e){return ca.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function fc(){return ct(this.year(),1,4)}function pc(){return ct(this.isoWeekYear(),1,4)}function yc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function gc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function ca(e,t,n,r,i){var a;return e==null?os(this,r,i).year:(a=ct(e,r,i),t>a&&(t=a),xc.call(this,e,t,n,r,i))}function xc(e,t,n,r,i){var a=Ur(e,t,n,r,i),u=ls(a.year,0,a.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}q("Q",0,"Qo","quarter"),H("Q",Or),ue("Q",function(e,t){t[lt]=(re(e)-1)*3});function Nc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}q("D",["DD",2],"Do","date"),H("D",me,Pt),H("DD",me,Pe),H("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ue(["D","DD"],Je),ue("Do",function(e,t){t[Je]=re(e.match(me)[0])});var da=Ft("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),H("DDD",Rs),H("DDDD",Mr),ue(["DDD","DDDD"],function(e,t,n){n._dayOfYear=re(e)});function jc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}q("m",["mm",2],0,"minute"),H("m",me,kn),H("mm",me,Pe),ue(["m","mm"],ze);var vc=Ft("Minutes",!1);q("s",["ss",2],0,"second"),H("s",me,kn),H("ss",me,Pe),ue(["s","ss"],ot);var _c=Ft("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return this.millisecond()*10}),q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),H("S",Rs,Or),H("SS",Rs,Pe),H("SSS",Rs,Mr);var jt,ha;for(jt="SSSS";jt.length<=9;jt+="S")H(jt,kt);function bc(e,t){t[St]=re(("0."+e)*1e3)}for(jt="S";jt.length<=9;jt+="S")ue(jt,bc);ha=Ft("Milliseconds",!1),q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");function Sc(){return this._isUTC?"UTC":""}function Tc(){return this._isUTC?"Coordinated Universal Time":""}var A=ss.prototype;A.add=go,A.calendar=So,A.clone=To,A.diff=Eo,A.endOf=Ho,A.format=Po,A.from=Fo,A.fromNow=Do,A.to=Yo,A.toNow=Uo,A.get=Li,A.invalidAt=Zo,A.isAfter=wo,A.isBefore=Io,A.isBetween=Co,A.isSame=Oo,A.isSameOrAfter=Mo,A.isSameOrBefore=Ao,A.isValid=Ko,A.lang=ra,A.locale=na,A.localeData=aa,A.max=ql,A.min=Vl,A.parsingFlags=Qo,A.set=ki,A.startOf=$o,A.subtract=xo,A.toArray=Go,A.toObject=Vo,A.toDate=zo,A.toISOString=Lo,A.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(A[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),A.toJSON=qo,A.toString=Ro,A.unix=Wo,A.valueOf=Bo,A.creationData=Jo,A.eraName=sc,A.eraNarrow=nc,A.eraAbbr=rc,A.eraYear=ac,A.year=Rr,A.isLeapYear=Ri,A.weekYear=uc,A.isoWeekYear=mc,A.quarter=A.quarters=Nc,A.month=Dr,A.daysInMonth=Wi,A.week=A.weeks=Ji,A.isoWeek=A.isoWeeks=Xi,A.weeksInYear=yc,A.weeksInWeekYear=gc,A.isoWeeksInYear=fc,A.isoWeeksInISOWeekYear=pc,A.date=da,A.day=A.days=ul,A.weekday=ml,A.isoWeekday=fl,A.dayOfYear=jc,A.hour=A.hours=vl,A.minute=A.minutes=vc,A.second=A.seconds=_c,A.millisecond=A.milliseconds=ha,A.utcOffset=no,A.utc=ao,A.local=io,A.parseZone=lo,A.hasAlignedHourOffset=oo,A.isDST=co,A.isLocal=uo,A.isUtcOffset=mo,A.isUtc=Jr,A.isUTC=Jr,A.zoneAbbr=Sc,A.zoneName=Tc,A.dates=Ye("dates accessor is deprecated. Use date instead.",da),A.months=Ye("months accessor is deprecated. Use month instead",Dr),A.years=Ye("years accessor is deprecated. Use year instead",Rr),A.zone=Ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ro),A.isDSTShifted=Ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ho);function wc(e){return fe(e*1e3)}function Ic(){return fe.apply(null,arguments).parseZone()}function ua(e){return e}var ce=Cn.prototype;ce.calendar=hi,ce.longDateFormat=pi,ce.invalidDate=gi,ce.ordinal=ji,ce.preparse=ua,ce.postformat=ua,ce.relativeTime=_i,ce.pastFuture=bi,ce.set=ci,ce.eras=Xo,ce.erasParse=ec,ce.erasConvertYear=tc,ce.erasAbbrRegex=lc,ce.erasNameRegex=ic,ce.erasNarrowRegex=oc,ce.months=Ui,ce.monthsShort=$i,ce.monthsParse=Bi,ce.monthsRegex=Gi,ce.monthsShortRegex=zi,ce.week=qi,ce.firstDayOfYear=Zi,ce.firstDayOfWeek=Qi,ce.weekdays=ll,ce.weekdaysMin=cl,ce.weekdaysShort=ol,ce.weekdaysParse=hl,ce.weekdaysRegex=pl,ce.weekdaysShortRegex=yl,ce.weekdaysMinRegex=gl,ce.isPM=Nl,ce.meridiem=_l;function qs(e,t,n,r){var i=dt(),a=Ke().set(r,t);return i[n](a,e)}function ma(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=qs(e,r,n,"month");return i}function Jn(e,t,n,r){typeof e=="boolean"?(at(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,at(t)&&(n=t,t=void 0),t=t||"");var i=dt(),a=e?i._week.dow:0,u,f=[];if(n!=null)return qs(t,(n+a)%7,r,"day");for(u=0;u<7;u++)f[u]=qs(t,(u+a)%7,r,"day");return f}function Cc(e,t){return ma(e,t,"months")}function Oc(e,t){return ma(e,t,"monthsShort")}function Mc(e,t,n){return Jn(e,t,n,"weekdays")}function Ac(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysMin")}Nt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=re(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),L.lang=Ye("moment.lang is deprecated. Use moment.locale instead.",Nt),L.langData=Ye("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Rc(){var e=this._data;return this._milliseconds=ht(this._milliseconds),this._days=ht(this._days),this._months=ht(this._months),e.milliseconds=ht(e.milliseconds),e.seconds=ht(e.seconds),e.minutes=ht(e.minutes),e.hours=ht(e.hours),e.months=ht(e.months),e.years=ht(e.years),this}function fa(e,t,n,r){var i=Ge(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Lc(e,t){return fa(this,e,t,1)}function kc(e,t){return fa(this,e,t,-1)}function pa(e){return e<0?Math.floor(e):Math.ceil(e)}function Pc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,u,f,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=pa(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=$e(e/1e3),r.seconds=i%60,a=$e(i/60),r.minutes=a%60,u=$e(a/60),r.hours=u%24,t+=$e(u/24),o=$e(ya(t)),n+=o,t-=pa(Xn(o)),f=$e(n/12),n%=12,r.days=t,r.months=n,r.years=f,this}function ya(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Fc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Ue(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ya(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Xn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function ut(e){return function(){return this.as(e)}}var ga=ut("ms"),Dc=ut("s"),Yc=ut("m"),Uc=ut("h"),$c=ut("d"),Hc=ut("w"),Bc=ut("M"),Wc=ut("Q"),zc=ut("y"),Gc=ga;function Vc(){return Ge(this)}function qc(e){return e=Ue(e),this.isValid()?this[e+"s"]():NaN}function wt(e){return function(){return this.isValid()?this._data[e]:NaN}}var Kc=wt("milliseconds"),Qc=wt("seconds"),Zc=wt("minutes"),Jc=wt("hours"),Xc=wt("days"),ed=wt("months"),td=wt("years");function sd(){return $e(this.days()/7)}var mt=Math.round,$t={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function rd(e,t,n,r){var i=Ge(e).abs(),a=mt(i.as("s")),u=mt(i.as("m")),f=mt(i.as("h")),o=mt(i.as("d")),l=mt(i.as("M")),c=mt(i.as("w")),h=mt(i.as("y")),p=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||u<=1&&["m"]||u<n.m&&["mm",u]||f<=1&&["h"]||f<n.h&&["hh",f]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),p=p||l<=1&&["M"]||l<n.M&&["MM",l]||h<=1&&["y"]||["yy",h],p[2]=t,p[3]=+e>0,p[4]=r,nd.apply(null,p)}function ad(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function id(e,t){return $t[e]===void 0?!1:t===void 0?$t[e]:($t[e]=t,e==="s"&&($t.ss=t-1),!0)}function ld(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$t,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},$t,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=rd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var er=Math.abs;function Ht(e){return(e>0)-(e<0)||+e}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var e=er(this._milliseconds)/1e3,t=er(this._days),n=er(this._months),r,i,a,u,f=this.asSeconds(),o,l,c,h;return f?(r=$e(e/60),i=$e(r/60),e%=60,r%=60,a=$e(n/12),n%=12,u=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",l=Ht(this._months)!==Ht(f)?"-":"",c=Ht(this._days)!==Ht(f)?"-":"",h=Ht(this._milliseconds)!==Ht(f)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(e?h+u+"S":"")):"P0D"}var ae=Hs.prototype;ae.isValid=Xl,ae.abs=Rc,ae.add=Lc,ae.subtract=kc,ae.as=Fc,ae.asMilliseconds=ga,ae.asSeconds=Dc,ae.asMinutes=Yc,ae.asHours=Uc,ae.asDays=$c,ae.asWeeks=Hc,ae.asMonths=Bc,ae.asQuarters=Wc,ae.asYears=zc,ae.valueOf=Gc,ae._bubble=Pc,ae.clone=Vc,ae.get=qc,ae.milliseconds=Kc,ae.seconds=Qc,ae.minutes=Zc,ae.hours=Jc,ae.days=Xc,ae.weeks=sd,ae.months=ed,ae.years=td,ae.humanize=ld,ae.toISOString=Ks,ae.toString=Ks,ae.toJSON=Ks,ae.locale=na,ae.localeData=aa,ae.toIsoString=Ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ae.lang=ra,q("X",0,0,"unix"),q("x",0,0,"valueOf"),H("x",ks),H("X",Ii),ue("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),ue("x",function(e,t,n){n._d=new Date(re(e))});//! moment.js
|
|
39
|
-
L.version="2.30.1",li(fe),L.fn=A,L.min=Kl,L.max=Ql,L.now=Zl,L.utc=
|
|
38
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Tr={};function wr(e,t){L.deprecationHandler!=null&&L.deprecationHandler(e,t),Tr[e]||(Sr(t),Tr[e]=!0)}L.suppressDeprecationWarnings=!1,L.deprecationHandler=null;function Ze(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ci(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Ze(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function In(e,t){var n=xt({},e),r;for(r in t)oe(t,r)&&(bt(e[r])&&bt(t[r])?(n[r]={},xt(n[r],e[r]),xt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&bt(e[r])&&(n[r]=xt({},n[r]));return n}function Cn(e){e!=null&&this.set(e)}var On;Object.keys?On=Object.keys:On=function(e){var t,n=[];for(t in e)oe(e,t)&&n.push(t);return n};var di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function hi(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Ze(r)?r.call(t,n):r}function Je(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Mn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,An={},Lt={};function q(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Lt[e]=i),t&&(Lt[t[0]]=function(){return Je(i.apply(this,arguments),t[1],t[2])}),n&&(Lt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ui(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function mi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Lt[t[n]]?t[n]=Lt[t[n]]:t[n]=ui(t[n]);return function(i){var a="",u;for(u=0;u<r;u++)a+=Ze(t[u])?t[u].call(i,e):t[u];return a}}function As(e,t){return e.isValid()?(t=Ir(t,e.localeData()),An[t]=An[t]||mi(t),An[t](e)):e.localeData().invalidDate()}function Ir(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var fi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function pi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Mn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var yi="Invalid date";function gi(){return this._invalidDate}var xi="%d",Ni=/\d{1,2}/;function ji(e){return this._ordinal.replace("%d",e)}var vi={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function _i(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function bi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var Cr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Ue(e){return typeof e=="string"?Cr[e]||Cr[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=Ue(r),n&&(t[n]=e[r]));return t}var Si={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ti(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Si[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Or=/\d/,Pe=/\d\d/,Mr=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,me=/\d\d?/,Ar=/\d\d\d\d?/,Er=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,kt=/\d+/,ks=/[+-]?\d+/,wi=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ii=/[+-]?\d+(\.\d{1,3})?/,ns=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Pt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function H(e,t,n){Fs[e]=Ze(t)?t:function(r,i){return r&&n?n:t}}function Ci(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Oi(e))}function Oi(e){return lt(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function lt(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $e(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function re(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=$e(t)),n}var Pn={};function ue(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),it(t)&&(r=function(a,u){u[t]=re(a)}),i=e.length,n=0;n<i;n++)Pn[e[n]]=r}function rs(e,t){ue(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Mi(e,t,n){t!=null&&oe(Pn,e)&&Pn[e](t,n._a,n,e)}function Ds(e){return e%4===0&&e%100!==0||e%400===0}var Ce=0,ot=1,Xe=2,Te=3,ze=4,ct=5,St=6,Ai=7,Ei=8;q("Y",0,0,function(){var e=this.year();return e<=9999?Je(e,4):"+"+e}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),H("Y",ks),H("YY",me,Pe),H("YYYY",Ln,Rn),H("YYYYY",Ls,Es),H("YYYYYY",Ls,Es),ue(["YYYYY","YYYYYY"],Ce),ue("YYYY",function(e,t){t[Ce]=e.length===2?L.parseTwoDigitYear(e):re(e)}),ue("YY",function(e,t){t[Ce]=L.parseTwoDigitYear(e)}),ue("Y",function(e,t){t[Ce]=parseInt(e,10)});function as(e){return Ds(e)?366:365}L.parseTwoDigitYear=function(e){return re(e)+(re(e)>68?1900:2e3)};var Rr=Ft("FullYear",!0);function Ri(){return Ds(this.year())}function Ft(e,t){return function(n){return n!=null?(Lr(this,e,n),L.updateOffset(this,t),this):is(this,e)}}function is(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Lr(e,t,n){var r,i,a,u,f;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,u=e.month(),f=e.date(),f=f===29&&u===1&&!Ds(a)?28:f,i?r.setUTCFullYear(a,u,f):r.setFullYear(a,u,f)}}function Li(e){return e=Ue(e),Ze(this[e])?this[e]():this}function ki(e,t){if(typeof e=="object"){e=En(e);var n=Ti(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Ue(e),Ze(this[e]))return this[e](t);return this}function Pi(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Fn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Pi(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),q("MMMM",0,0,function(e){return this.localeData().months(this,e)}),H("M",me,Pt),H("MM",me,Pe),H("MMM",function(e,t){return t.monthsShortRegex(e)}),H("MMMM",function(e,t){return t.monthsRegex(e)}),ue(["M","MM"],function(e,t){t[ot]=re(e)-1}),ue(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[ot]=i:se(n).invalidMonth=e});var Fi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Di=ns,Yi=ns;function Ui(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function $i(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Hi(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Qe([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:null):(i=je.call(this._longMonthsParse,u),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,u),i!==-1?i:(i=je.call(this._longMonthsParse,u),i!==-1?i:null)):(i=je.call(this._longMonthsParse,u),i!==-1?i:(i=je.call(this._shortMonthsParse,u),i!==-1?i:null))}function Bi(e,t,n){var r,i,a;if(this._monthsParseExact)return Hi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Qe([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Fr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=re(t);else if(t=e.localeData().monthsParse(t),!it(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Fn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Dr(e){return e!=null?(Fr(this,e),L.updateOffset(this,!0),this):is(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Yr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Di),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Yr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Yi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Yr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,u,f;for(i=0;i<12;i++)a=Qe([2e3,i]),u=lt(this.monthsShort(a,"")),f=lt(this.months(a,"")),t.push(u),n.push(f),r.push(f),r.push(u);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Vi(e,t,n,r,i,a,u){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,r,i,a,u),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,r,i,a,u),f}function ls(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ys(e,t,n){var r=7+t-n,i=(7+ls(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Ur(e,t,n,r,i){var a=(7+n-r)%7,u=Ys(e,r,i),f=1+7*(t-1)+a+u,o,l;return f<=0?(o=e-1,l=as(o)+f):f>as(e)?(o=e+1,l=f-as(e)):(o=e,l=f),{year:o,dayOfYear:l}}function os(e,t,n){var r=Ys(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,u;return i<1?(u=e.year()-1,a=i+dt(u,t,n)):i>dt(e.year(),t,n)?(a=i-dt(e.year(),t,n),u=e.year()+1):(u=e.year(),a=i),{week:a,year:u}}function dt(e,t,n){var r=Ys(e,t,n),i=Ys(e+1,t,n);return(as(e)-r+i)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),H("w",me,Pt),H("ww",me,Pe),H("W",me,Pt),H("WW",me,Pe),rs(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=re(e)});function qi(e){return os(e,this._week.dow,this._week.doy).week}var Ki={dow:0,doy:6};function Qi(){return this._week.dow}function Zi(){return this._week.doy}function Ji(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Xi(e){var t=os(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}q("d",0,"do","day"),q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),H("d",me),H("e",me),H("E",me),H("dd",function(e,t){return t.weekdaysMinRegex(e)}),H("ddd",function(e,t){return t.weekdaysShortRegex(e)}),H("dddd",function(e,t){return t.weekdaysRegex(e)}),rs(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:se(n).invalidWeekday=e}),rs(["d","e","E"],function(e,t,n,r){t[r]=re(e)});function el(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function tl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Dn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var sl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$r="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),nl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rl=ns,al=ns,il=ns;function ll(e,t){var n=Be(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Dn(n,this._week.dow):e?n[e.day()]:n}function ol(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function cl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function dl(e,t,n){var r,i,a,u=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Qe([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,u),i!==-1||(i=je.call(this._shortWeekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._minWeekdaysParse,u),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,u),i!==-1||(i=je.call(this._weekdaysParse,u),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,u),i!==-1?i:null))}function hl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return dl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Qe([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ul(e){if(!this.isValid())return e!=null?this:NaN;var t=is(this,"Day");return e!=null?(e=el(e,this.localeData()),this.add(e-t,"d")):t}function ml(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function fl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=tl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function pl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=rl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=al),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=il),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],i=[],a,u,f,o,l;for(a=0;a<7;a++)u=Qe([2e3,1]).day(a),f=lt(this.weekdaysMin(u,"")),o=lt(this.weekdaysShort(u,"")),l=lt(this.weekdays(u,"")),t.push(f),n.push(o),r.push(l),i.push(f),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Un(){return this.hours()%12||12}function xl(){return this.hours()||24}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,Un),q("k",["kk",2],0,xl),q("hmm",0,0,function(){return""+Un.apply(this)+Je(this.minutes(),2)}),q("hmmss",0,0,function(){return""+Un.apply(this)+Je(this.minutes(),2)+Je(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+Je(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+Je(this.minutes(),2)+Je(this.seconds(),2)});function Hr(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Hr("a",!0),Hr("A",!1);function Br(e,t){return t._meridiemParse}H("a",Br),H("A",Br),H("H",me,kn),H("h",me,Pt),H("k",me,Pt),H("HH",me,Pe),H("hh",me,Pe),H("kk",me,Pe),H("hmm",Ar),H("hmmss",Er),H("Hmm",Ar),H("Hmmss",Er),ue(["H","HH"],Te),ue(["k","kk"],function(e,t,n){var r=re(e);t[Te]=r===24?0:r}),ue(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ue(["h","hh"],function(e,t,n){t[Te]=re(e),se(n).bigHour=!0}),ue("hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r)),se(n).bigHour=!0}),ue("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r,2)),t[ct]=re(e.substr(i)),se(n).bigHour=!0}),ue("Hmm",function(e,t,n){var r=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r))}),ue("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Te]=re(e.substr(0,r)),t[ze]=re(e.substr(r,2)),t[ct]=re(e.substr(i))});function Nl(e){return(e+"").toLowerCase().charAt(0)==="p"}var jl=/[ap]\.?m?\.?/i,vl=Ft("Hours",!0);function _l(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:di,longDateFormat:fi,invalidDate:yi,ordinal:xi,dayOfMonthOrdinalParse:Ni,relativeTime:vi,months:Fi,monthsShort:kr,week:Ki,weekdays:sl,weekdaysMin:nl,weekdaysShort:$r,meridiemParse:jl},ye={},cs={},ds;function bl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function zr(e){return e&&e.toLowerCase().replace("_","-")}function Sl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=zr(e[t]).split("-"),n=a.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Us(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&bl(a,r)>=n-1)break;n--}t++}return ds}function Tl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(ye[e]===void 0&&typeof module<"u"&&module&&module.exports&&Tl(e))try{t=ds._abbr,n=require,n("./locale/"+e),Nt(t)}catch{ye[e]=null}return ye[e]}function Nt(e,t){var n;return e&&(Ee(t)?n=ht(e):n=$n(e,t),n?ds=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ds._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,ye[e]!=null)wr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ye[e]._config;else if(t.parentLocale!=null)if(ye[t.parentLocale]!=null)r=ye[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return cs[t.parentLocale]||(cs[t.parentLocale]=[]),cs[t.parentLocale].push({name:e,config:t}),null;return ye[e]=new Cn(In(r,t)),cs[e]&&cs[e].forEach(function(i){$n(i.name,i.config)}),Nt(e),ye[e]}else return delete ye[e],null}function wl(e,t){if(t!=null){var n,r,i=Wr;ye[e]!=null&&ye[e].parentLocale!=null?ye[e].set(In(ye[e]._config,t)):(r=Us(e),r!=null&&(i=r._config),t=In(i,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=ye[e],ye[e]=n),Nt(e)}else ye[e]!=null&&(ye[e].parentLocale!=null?(ye[e]=ye[e].parentLocale,e===Nt()&&Nt(e)):ye[e]!=null&&delete ye[e]);return ye[e]}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ds;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Sl(e)}function Il(){return On(ye)}function Hn(e){var t,n=e._a;return n&&se(e).overflow===-2&&(t=n[ot]<0||n[ot]>11?ot:n[Xe]<1||n[Xe]>Fn(n[Ce],n[ot])?Xe:n[Te]<0||n[Te]>24||n[Te]===24&&(n[ze]!==0||n[ct]!==0||n[St]!==0)?Te:n[ze]<0||n[ze]>59?ze:n[ct]<0||n[ct]>59?ct:n[St]<0||n[St]>999?St:-1,se(e)._overflowDayOfYear&&(t<Ce||t>Xe)&&(t=Xe),se(e)._overflowWeeks&&t===-1&&(t=Ai),se(e)._overflowWeekday&&t===-1&&(t=Ei),se(e).overflow=t),e}var Cl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ol=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ml=/Z|[+-]\d\d(?::?\d\d)?/,$s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Al=/^\/?Date\((-?\d+)/i,El=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Rl={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Gr(e){var t,n,r=e._i,i=Cl.exec(r)||Ol.exec(r),a,u,f,o,l=$s.length,c=Bn.length;if(i){for(se(e).iso=!0,t=0,n=l;t<n;t++)if($s[t][1].exec(i[1])){u=$s[t][0],a=$s[t][2]!==!1;break}if(u==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(i[3])){f=(i[2]||" ")+Bn[t][0];break}if(f==null){e._isValid=!1;return}}if(!a&&f!=null){e._isValid=!1;return}if(i[4])if(Ml.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=u+(f||"")+(o||""),zn(e)}else e._isValid=!1}function Ll(e,t,n,r,i,a){var u=[kl(e),kr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&u.push(parseInt(a,10)),u}function kl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Pl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fl(e,t,n){if(e){var r=$r.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return se(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dl(e,t,n){if(e)return Rl[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Vr(e){var t=El.exec(Pl(e._i)),n;if(t){if(n=Ll(t[4],t[3],t[2],t[5],t[6],t[7]),!Fl(t[1],n,e))return;e._a=n,e._tzm=Dl(t[8],t[9],t[10]),e._d=ls.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),se(e).rfc2822=!0}else e._isValid=!1}function Yl(e){var t=Al.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Gr(e),e._isValid===!1)delete e._isValid;else return;if(Vr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:L.createFromInputFallback(e)}L.createFromInputFallback=Ye("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Dt(e,t,n){return e??t??n}function Ul(e){var t=new Date(L.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Wn(e){var t,n,r=[],i,a,u;if(!e._d){for(i=Ul(e),e._w&&e._a[Xe]==null&&e._a[ot]==null&&$l(e),e._dayOfYear!=null&&(u=Dt(e._a[Ce],i[Ce]),(e._dayOfYear>as(u)||e._dayOfYear===0)&&(se(e)._overflowDayOfYear=!0),n=ls(u,0,e._dayOfYear),e._a[ot]=n.getUTCMonth(),e._a[Xe]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Te]===24&&e._a[ze]===0&&e._a[ct]===0&&e._a[St]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?ls:Vi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Te]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(se(e).weekdayMismatch=!0)}}function $l(e){var t,n,r,i,a,u,f,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,u=4,n=Dt(t.GG,e._a[Ce],os(fe(),1,4).year),r=Dt(t.W,1),i=Dt(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,u=e._locale._week.doy,l=os(fe(),a,u),n=Dt(t.gg,e._a[Ce],l.year),r=Dt(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>dt(n,a,u)?se(e)._overflowWeeks=!0:o!=null?se(e)._overflowWeekday=!0:(f=Ur(n,r,i,a,u),e._a[Ce]=f.year,e._dayOfYear=f.dayOfYear)}L.ISO_8601=function(){},L.RFC_2822=function(){};function zn(e){if(e._f===L.ISO_8601){Gr(e);return}if(e._f===L.RFC_2822){Vr(e);return}e._a=[],se(e).empty=!0;var t=""+e._i,n,r,i,a,u,f=t.length,o=0,l,c;for(i=Ir(e._f,e._locale).match(Mn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ci(a,e))||[])[0],r&&(u=t.substr(0,t.indexOf(r)),u.length>0&&se(e).unusedInput.push(u),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Lt[a]?(r?se(e).empty=!1:se(e).unusedTokens.push(a),Mi(a,r,e)):e._strict&&!r&&se(e).unusedTokens.push(a);se(e).charsLeftOver=f-o,t.length>0&&se(e).unusedInput.push(t),e._a[Te]<=12&&se(e).bigHour===!0&&e._a[Te]>0&&(se(e).bigHour=void 0),se(e).parsedDateParts=e._a.slice(0),se(e).meridiem=e._meridiem,e._a[Te]=Hl(e._locale,e._a[Te],e._meridiem),l=se(e).era,l!==null&&(e._a[Ce]=e._locale.erasConvertYear(l,e._a[Ce])),Wn(e),Hn(e)}function Hl(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Bl(e){var t,n,r,i,a,u,f=!1,o=e._f.length;if(o===0){se(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,u=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],zn(t),Sn(t)&&(u=!0),a+=se(t).charsLeftOver,a+=se(t).unusedTokens.length*10,se(t).score=a,f?a<r&&(r=a,n=t):(r==null||a<r||u)&&(r=a,n=t,u&&(f=!0));xt(e,n||t)}function Wl(e){if(!e._d){var t=En(e._i),n=t.day===void 0?t.date:t.day;e._a=_r([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Wn(e)}}function zl(e){var t=new ss(Hn(qr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function qr(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),t===null||n===void 0&&t===""?Os({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),We(t)?new ss(Hn(t)):(ts(t)?e._d=t:Be(n)?Bl(e):n?zn(e):Gl(e),Sn(e)||(e._d=null),e))}function Gl(e){var t=e._i;Ee(t)?e._d=new Date(L.now()):ts(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Yl(e):Be(t)?(e._a=_r(t.slice(0),function(n){return parseInt(n,10)}),Wn(e)):bt(t)?Wl(e):it(t)?e._d=new Date(t):L.createFromInputFallback(e)}function Kr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(bt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,zl(a)}function fe(e,t,n,r){return Kr(e,t,n,r,!1)}var Vl=Ye("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),ql=Ye("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=fe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Qr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return fe();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Kl(){var e=[].slice.call(arguments,0);return Qr("isBefore",e)}function Ql(){var e=[].slice.call(arguments,0);return Qr("isAfter",e)}var Zl=function(){return Date.now?Date.now():+new Date},hs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Jl(e){var t,n=!1,r,i=hs.length;for(t in e)if(oe(e,t)&&!(je.call(hs,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[hs[r]]){if(n)return!1;parseFloat(e[hs[r]])!==re(e[hs[r]])&&(n=!0)}return!0}function Xl(){return this._isValid}function eo(){return Ge(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,u=t.day||0,f=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Jl(t),this._milliseconds=+c+l*1e3+o*6e4+f*1e3*60*60,this._days=+u+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ht(),this._bubble()}function Bs(e){return e instanceof Hs}function Gn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function to(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,u;for(u=0;u<r;u++)re(e[u])!==re(t[u])&&a++;return a+i}function Zr(e,t){q(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Je(~~(n/60),2)+t+Je(~~n%60,2)})}Zr("Z",":"),Zr("ZZ",""),H("Z",Ps),H("ZZ",Ps),ue(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var so=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(so)||["-",0,0],a=+(i[1]*60)+re(i[2]),a===0?0:i[0]==="+"?a:-a)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(We(e)||ts(e)?e.valueOf():fe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),L.updateOffset(n,!1),n):fe(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}L.updateOffset=function(){};function no(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=Vn(Ps,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Kn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ta(this,Ge(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,L.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ro(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ao(e){return this.utcOffset(0,e)}function io(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function lo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(wi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function oo(e){return this.isValid()?(e=e?fe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function co(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ho(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=qr(e),e._a?(t=e._isUTC?Qe(e._a):fe(e._a),this._isDSTShifted=this.isValid()&&to(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function uo(){return this.isValid()?!this._isUTC:!1}function mo(){return this.isValid()?this._isUTC:!1}function Jr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,po=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ge(e,t){var n=e,r=null,i,a,u;return Bs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:it(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:re(r[Xe])*i,h:re(r[Te])*i,m:re(r[ze])*i,s:re(r[ct])*i,ms:re(Gn(r[St]*1e3))*i}):(r=po.exec(e))?(i=r[1]==="-"?-1:1,n={y:Tt(r[2],i),M:Tt(r[3],i),w:Tt(r[4],i),d:Tt(r[5],i),h:Tt(r[6],i),m:Tt(r[7],i),s:Tt(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=yo(fe(n.from),fe(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),a=new Hs(n),Bs(e)&&oe(e,"_locale")&&(a._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(a._isValid=e._isValid),a}Ge.fn=Hs.prototype,Ge.invalid=eo;function Tt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function yo(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=Xr(e,t):(n=Xr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ea(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(wr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=Ge(n,r),ta(this,i,e),this}}function ta(e,t,n,r){var i=t._milliseconds,a=Gn(t._days),u=Gn(t._months);e.isValid()&&(r=r??!0,u&&Fr(e,is(e,"Month")+u*n),a&&Lr(e,"Date",is(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&L.updateOffset(e,a||u))}var go=ea(1,"add"),xo=ea(-1,"subtract");function sa(e){return typeof e=="string"||e instanceof String}function No(e){return We(e)||ts(e)||sa(e)||it(e)||vo(e)||jo(e)||e===null||e===void 0}function jo(e){var t=bt(e)&&!_n(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,u=r.length;for(i=0;i<u;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function vo(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!it(r)&&sa(e)}).length===0),t&&n}function _o(e){var t=bt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||oe(e,a);return t&&n}function bo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function So(e,t){arguments.length===1&&(arguments[0]?No(arguments[0])?(e=arguments[0],t=void 0):_o(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||fe(),r=qn(n,this).startOf("day"),i=L.calendarFormat(this,r)||"sameElse",a=t&&(Ze(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,fe(n)))}function To(){return new ss(this)}function wo(e,t){var n=We(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Io(e,t){var n=We(e)?e:fe(e);return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Co(e,t,n,r){var i=We(e)?e:fe(e),a=We(t)?t:fe(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Oo(e,t){var n=We(e)?e:fe(e),r;return this.isValid()&&n.isValid()?(t=Ue(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Mo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Ao(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Eo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Ue(t),t){case"year":a=Ws(this,r)/12;break;case"month":a=Ws(this,r);break;case"quarter":a=Ws(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:$e(a)}function Ws(e,t){if(e.date()<t.date())return-Ws(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}L.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",L.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ro(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Lo(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?As(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ze(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",As(n,"Z")):As(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function Po(e){e||(e=this.isUtc()?L.defaultFormatUtc:L.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Fo(e,t){return this.isValid()&&(We(e)&&e.isValid()||fe(e).isValid())?Ge({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.from(fe(),e)}function Yo(e,t){return this.isValid()&&(We(e)&&e.isValid()||fe(e).isValid())?Ge({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Uo(e){return this.to(fe(),e)}function na(e){var t;return e===void 0?this._locale._abbr:(t=ht(e),t!=null&&(this._locale=t),this)}var ra=Ye("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function aa(){return this._locale}var zs=1e3,Yt=60*zs,Gs=60*Yt,ia=(365*400+97)*24*Gs;function Ut(e,t){return(e%t+t)%t}function la(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ia:new Date(e,t,n).valueOf()}function oa(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ia:Date.UTC(e,t,n)}function $o(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ut(t+(this._isUTC?0:this.utcOffset()*Yt),Gs);break;case"minute":t=this._d.valueOf(),t-=Ut(t,Yt);break;case"second":t=this._d.valueOf(),t-=Ut(t,zs);break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Ho(e){var t,n;if(e=Ue(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Gs-Ut(t+(this._isUTC?0:this.utcOffset()*Yt),Gs)-1;break;case"minute":t=this._d.valueOf(),t+=Yt-Ut(t,Yt)-1;break;case"second":t=this._d.valueOf(),t+=zs-Ut(t,zs)-1;break}return this._d.setTime(t),L.updateOffset(this,!0),this}function Bo(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Go(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Vo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function Ko(){return Sn(this)}function Qo(){return xt({},se(this))}function Zo(){return se(this).overflow}function Jo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}q("N",0,0,"eraAbbr"),q("NN",0,0,"eraAbbr"),q("NNN",0,0,"eraAbbr"),q("NNNN",0,0,"eraName"),q("NNNNN",0,0,"eraNarrow"),q("y",["y",1],"yo","eraYear"),q("y",["yy",2],0,"eraYear"),q("y",["yyy",3],0,"eraYear"),q("y",["yyyy",4],0,"eraYear"),H("N",Qn),H("NN",Qn),H("NNN",Qn),H("NNNN",cc),H("NNNNN",dc),ue(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?se(n).era=i:se(n).invalidEra=e}),H("y",kt),H("yy",kt),H("yyy",kt),H("yyyy",kt),H("yo",hc),ue(["y","yy","yyy","yyyy"],Ce),ue(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ce]=n._locale.eraYearOrdinalParse(e,i):t[Ce]=parseInt(e,10)});function Xo(e,t){var n,r,i,a=this._eras||ht("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=L(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=L(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function ec(e,t,n){var r,i,a=this.eras(),u,f,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(u=a[r].name.toUpperCase(),f=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return a[r];break;case"NNNN":if(u===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([u,f,o].indexOf(e)>=0)return a[r]}function tc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?L(e.since).year():L(e.since).year()+(t-e.offset)*n}function sc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function rc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function ac(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-L(i[e].since).year())*n+i[e].offset;return this.year()}function ic(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function lc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function oc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function cc(e,t){return t.erasNameRegex(e)}function dc(e,t){return t.erasNarrowRegex(e)}function hc(e,t){return t._eraYearOrdinalRegex||kt}function Zn(){var e=[],t=[],n=[],r=[],i,a,u,f,o,l=this.eras();for(i=0,a=l.length;i<a;++i)u=lt(l[i].name),f=lt(l[i].abbr),o=lt(l[i].narrow),t.push(u),e.push(f),n.push(o),r.push(u),r.push(f),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Vs(e,t){q(0,[e,e.length],0,t)}Vs("gggg","weekYear"),Vs("ggggg","weekYear"),Vs("GGGG","isoWeekYear"),Vs("GGGGG","isoWeekYear"),H("G",ks),H("g",ks),H("GG",me,Pe),H("gg",me,Pe),H("GGGG",Ln,Rn),H("gggg",Ln,Rn),H("GGGGG",Ls,Es),H("ggggg",Ls,Es),rs(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=re(e)}),rs(["gg","GG"],function(e,t,n,r){t[r]=L.parseTwoDigitYear(e)});function uc(e){return ca.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function mc(e){return ca.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function fc(){return dt(this.year(),1,4)}function pc(){return dt(this.isoWeekYear(),1,4)}function yc(){var e=this.localeData()._week;return dt(this.year(),e.dow,e.doy)}function gc(){var e=this.localeData()._week;return dt(this.weekYear(),e.dow,e.doy)}function ca(e,t,n,r,i){var a;return e==null?os(this,r,i).year:(a=dt(e,r,i),t>a&&(t=a),xc.call(this,e,t,n,r,i))}function xc(e,t,n,r,i){var a=Ur(e,t,n,r,i),u=ls(a.year,0,a.dayOfYear);return this.year(u.getUTCFullYear()),this.month(u.getUTCMonth()),this.date(u.getUTCDate()),this}q("Q",0,"Qo","quarter"),H("Q",Or),ue("Q",function(e,t){t[ot]=(re(e)-1)*3});function Nc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}q("D",["DD",2],"Do","date"),H("D",me,Pt),H("DD",me,Pe),H("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ue(["D","DD"],Xe),ue("Do",function(e,t){t[Xe]=re(e.match(me)[0])});var da=Ft("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),H("DDD",Rs),H("DDDD",Mr),ue(["DDD","DDDD"],function(e,t,n){n._dayOfYear=re(e)});function jc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}q("m",["mm",2],0,"minute"),H("m",me,kn),H("mm",me,Pe),ue(["m","mm"],ze);var vc=Ft("Minutes",!1);q("s",["ss",2],0,"second"),H("s",me,kn),H("ss",me,Pe),ue(["s","ss"],ct);var _c=Ft("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return this.millisecond()*10}),q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),H("S",Rs,Or),H("SS",Rs,Pe),H("SSS",Rs,Mr);var jt,ha;for(jt="SSSS";jt.length<=9;jt+="S")H(jt,kt);function bc(e,t){t[St]=re(("0."+e)*1e3)}for(jt="S";jt.length<=9;jt+="S")ue(jt,bc);ha=Ft("Milliseconds",!1),q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");function Sc(){return this._isUTC?"UTC":""}function Tc(){return this._isUTC?"Coordinated Universal Time":""}var A=ss.prototype;A.add=go,A.calendar=So,A.clone=To,A.diff=Eo,A.endOf=Ho,A.format=Po,A.from=Fo,A.fromNow=Do,A.to=Yo,A.toNow=Uo,A.get=Li,A.invalidAt=Zo,A.isAfter=wo,A.isBefore=Io,A.isBetween=Co,A.isSame=Oo,A.isSameOrAfter=Mo,A.isSameOrBefore=Ao,A.isValid=Ko,A.lang=ra,A.locale=na,A.localeData=aa,A.max=ql,A.min=Vl,A.parsingFlags=Qo,A.set=ki,A.startOf=$o,A.subtract=xo,A.toArray=Go,A.toObject=Vo,A.toDate=zo,A.toISOString=Lo,A.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(A[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),A.toJSON=qo,A.toString=Ro,A.unix=Wo,A.valueOf=Bo,A.creationData=Jo,A.eraName=sc,A.eraNarrow=nc,A.eraAbbr=rc,A.eraYear=ac,A.year=Rr,A.isLeapYear=Ri,A.weekYear=uc,A.isoWeekYear=mc,A.quarter=A.quarters=Nc,A.month=Dr,A.daysInMonth=Wi,A.week=A.weeks=Ji,A.isoWeek=A.isoWeeks=Xi,A.weeksInYear=yc,A.weeksInWeekYear=gc,A.isoWeeksInYear=fc,A.isoWeeksInISOWeekYear=pc,A.date=da,A.day=A.days=ul,A.weekday=ml,A.isoWeekday=fl,A.dayOfYear=jc,A.hour=A.hours=vl,A.minute=A.minutes=vc,A.second=A.seconds=_c,A.millisecond=A.milliseconds=ha,A.utcOffset=no,A.utc=ao,A.local=io,A.parseZone=lo,A.hasAlignedHourOffset=oo,A.isDST=co,A.isLocal=uo,A.isUtcOffset=mo,A.isUtc=Jr,A.isUTC=Jr,A.zoneAbbr=Sc,A.zoneName=Tc,A.dates=Ye("dates accessor is deprecated. Use date instead.",da),A.months=Ye("months accessor is deprecated. Use month instead",Dr),A.years=Ye("years accessor is deprecated. Use year instead",Rr),A.zone=Ye("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ro),A.isDSTShifted=Ye("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ho);function wc(e){return fe(e*1e3)}function Ic(){return fe.apply(null,arguments).parseZone()}function ua(e){return e}var ce=Cn.prototype;ce.calendar=hi,ce.longDateFormat=pi,ce.invalidDate=gi,ce.ordinal=ji,ce.preparse=ua,ce.postformat=ua,ce.relativeTime=_i,ce.pastFuture=bi,ce.set=ci,ce.eras=Xo,ce.erasParse=ec,ce.erasConvertYear=tc,ce.erasAbbrRegex=lc,ce.erasNameRegex=ic,ce.erasNarrowRegex=oc,ce.months=Ui,ce.monthsShort=$i,ce.monthsParse=Bi,ce.monthsRegex=Gi,ce.monthsShortRegex=zi,ce.week=qi,ce.firstDayOfYear=Zi,ce.firstDayOfWeek=Qi,ce.weekdays=ll,ce.weekdaysMin=cl,ce.weekdaysShort=ol,ce.weekdaysParse=hl,ce.weekdaysRegex=pl,ce.weekdaysShortRegex=yl,ce.weekdaysMinRegex=gl,ce.isPM=Nl,ce.meridiem=_l;function qs(e,t,n,r){var i=ht(),a=Qe().set(r,t);return i[n](a,e)}function ma(e,t,n){if(it(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=qs(e,r,n,"month");return i}function Jn(e,t,n,r){typeof e=="boolean"?(it(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,it(t)&&(n=t,t=void 0),t=t||"");var i=ht(),a=e?i._week.dow:0,u,f=[];if(n!=null)return qs(t,(n+a)%7,r,"day");for(u=0;u<7;u++)f[u]=qs(t,(u+a)%7,r,"day");return f}function Cc(e,t){return ma(e,t,"months")}function Oc(e,t){return ma(e,t,"monthsShort")}function Mc(e,t,n){return Jn(e,t,n,"weekdays")}function Ac(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysMin")}Nt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=re(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),L.lang=Ye("moment.lang is deprecated. Use moment.locale instead.",Nt),L.langData=Ye("moment.langData is deprecated. Use moment.localeData instead.",ht);var ut=Math.abs;function Rc(){var e=this._data;return this._milliseconds=ut(this._milliseconds),this._days=ut(this._days),this._months=ut(this._months),e.milliseconds=ut(e.milliseconds),e.seconds=ut(e.seconds),e.minutes=ut(e.minutes),e.hours=ut(e.hours),e.months=ut(e.months),e.years=ut(e.years),this}function fa(e,t,n,r){var i=Ge(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Lc(e,t){return fa(this,e,t,1)}function kc(e,t){return fa(this,e,t,-1)}function pa(e){return e<0?Math.floor(e):Math.ceil(e)}function Pc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,u,f,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=pa(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=$e(e/1e3),r.seconds=i%60,a=$e(i/60),r.minutes=a%60,u=$e(a/60),r.hours=u%24,t+=$e(u/24),o=$e(ya(t)),n+=o,t-=pa(Xn(o)),f=$e(n/12),n%=12,r.days=t,r.months=n,r.years=f,this}function ya(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Fc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Ue(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ya(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Xn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function mt(e){return function(){return this.as(e)}}var ga=mt("ms"),Dc=mt("s"),Yc=mt("m"),Uc=mt("h"),$c=mt("d"),Hc=mt("w"),Bc=mt("M"),Wc=mt("Q"),zc=mt("y"),Gc=ga;function Vc(){return Ge(this)}function qc(e){return e=Ue(e),this.isValid()?this[e+"s"]():NaN}function wt(e){return function(){return this.isValid()?this._data[e]:NaN}}var Kc=wt("milliseconds"),Qc=wt("seconds"),Zc=wt("minutes"),Jc=wt("hours"),Xc=wt("days"),ed=wt("months"),td=wt("years");function sd(){return $e(this.days()/7)}var ft=Math.round,$t={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function rd(e,t,n,r){var i=Ge(e).abs(),a=ft(i.as("s")),u=ft(i.as("m")),f=ft(i.as("h")),o=ft(i.as("d")),l=ft(i.as("M")),c=ft(i.as("w")),h=ft(i.as("y")),p=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||u<=1&&["m"]||u<n.m&&["mm",u]||f<=1&&["h"]||f<n.h&&["hh",f]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),p=p||l<=1&&["M"]||l<n.M&&["MM",l]||h<=1&&["y"]||["yy",h],p[2]=t,p[3]=+e>0,p[4]=r,nd.apply(null,p)}function ad(e){return e===void 0?ft:typeof e=="function"?(ft=e,!0):!1}function id(e,t){return $t[e]===void 0?!1:t===void 0?$t[e]:($t[e]=t,e==="s"&&($t.ss=t-1),!0)}function ld(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=$t,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},$t,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=rd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var er=Math.abs;function Ht(e){return(e>0)-(e<0)||+e}function Ks(){if(!this.isValid())return this.localeData().invalidDate();var e=er(this._milliseconds)/1e3,t=er(this._days),n=er(this._months),r,i,a,u,f=this.asSeconds(),o,l,c,h;return f?(r=$e(e/60),i=$e(r/60),e%=60,r%=60,a=$e(n/12),n%=12,u=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",l=Ht(this._months)!==Ht(f)?"-":"",c=Ht(this._days)!==Ht(f)?"-":"",h=Ht(this._milliseconds)!==Ht(f)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?h+i+"H":"")+(r?h+r+"M":"")+(e?h+u+"S":"")):"P0D"}var ae=Hs.prototype;ae.isValid=Xl,ae.abs=Rc,ae.add=Lc,ae.subtract=kc,ae.as=Fc,ae.asMilliseconds=ga,ae.asSeconds=Dc,ae.asMinutes=Yc,ae.asHours=Uc,ae.asDays=$c,ae.asWeeks=Hc,ae.asMonths=Bc,ae.asQuarters=Wc,ae.asYears=zc,ae.valueOf=Gc,ae._bubble=Pc,ae.clone=Vc,ae.get=qc,ae.milliseconds=Kc,ae.seconds=Qc,ae.minutes=Zc,ae.hours=Jc,ae.days=Xc,ae.weeks=sd,ae.months=ed,ae.years=td,ae.humanize=ld,ae.toISOString=Ks,ae.toString=Ks,ae.toJSON=Ks,ae.locale=na,ae.localeData=aa,ae.toIsoString=Ye("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ae.lang=ra,q("X",0,0,"unix"),q("x",0,0,"valueOf"),H("x",ks),H("X",Ii),ue("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),ue("x",function(e,t,n){n._d=new Date(re(e))});//! moment.js
|
|
39
|
+
L.version="2.30.1",li(fe),L.fn=A,L.min=Kl,L.max=Ql,L.now=Zl,L.utc=Qe,L.unix=wc,L.months=Cc,L.isDate=ts,L.locale=Nt,L.invalid=Os,L.duration=Ge,L.isMoment=We,L.weekdays=Mc,L.parseZone=Ic,L.localeData=ht,L.isDuration=Bs,L.monthsShort=Oc,L.weekdaysMin=Ec,L.defineLocale=$n,L.updateLocale=wl,L.locales=Il,L.weekdaysShort=Ac,L.normalizeUnits=Ue,L.relativeTimeRounding=ad,L.relativeTimeThreshold=id,L.calendarFormat=bo,L.prototype=A,L.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const vt=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Ve=e=>{if(!e)return"";e=e.toLowerCase();let t=e.split(" ");for(let n=0;n<t.length;n++)t[n]=t[n].charAt(0).toUpperCase()+t[n].slice(1);return t.join(" ")},us=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},od=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},cd=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Qs={exports:{}};/*! @preserve
|
|
40
40
|
* numeral.js
|
|
41
41
|
* version : 2.0.6
|
|
42
42
|
* author : Adam Draper
|
|
43
43
|
* license : MIT
|
|
44
44
|
* http://adamwdraper.github.com/Numeral-js/
|
|
45
|
-
*/var dd=Qs.exports,xa;function hd(){return xa||(xa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(dd,function(){var t,n,r="2.0.6",i={},a={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,h,p,m;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(h in i)if(m=typeof i[h].regexps.unformat=="function"?i[h].regexps.unformat():i[h].regexps.unformat,m&&l.match(m)){p=i[h].unformat;break}p=p||t._.stringToNumber,c=p(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,h){var p=a[t.options.currentLocale],m=!1,x=!1,v=0,_="",E=1e12,S=1e9,w=1e6,D=1e3,$="",P=!1,Z,ne,te,le,Se,Q,J;if(l=l||0,ne=Math.abs(l),t._.includes(c,"(")?(m=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Se=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(Z=c.match(/a(k|m|b|t)?/),Z=Z?Z[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),ne>=E&&!Z||Z==="t"?(_+=p.abbreviations.trillion,l=l/E):ne<E&&ne>=S&&!Z||Z==="b"?(_+=p.abbreviations.billion,l=l/S):ne<S&&ne>=w&&!Z||Z==="m"?(_+=p.abbreviations.million,l=l/w):(ne<w&&ne>=D&&!Z||Z==="k")&&(_+=p.abbreviations.thousand,l=l/D)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),te=l.toString().split(".")[0],le=c.split(".")[1],Q=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,le?(t._.includes(le,"[")?(le=le.replace("]",""),le=le.split("["),$=t._.toFixed(l,le[0].length+le[1].length,h,le[1].length)):$=t._.toFixed(l,le.length,h),te=$.split(".")[0],t._.includes($,".")?$=p.delimiters.decimal+$.split(".")[1]:$="",x&&Number($.slice(1))===0&&($="")):te=t._.toFixed(l,0,h),_&&!Z&&Number(te)>=1e3&&_!==p.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case p.abbreviations.thousand:_=p.abbreviations.million;break;case p.abbreviations.million:_=p.abbreviations.billion;break;case p.abbreviations.billion:_=p.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),P=!0),te.length<v)for(var G=v-te.length;G>0;G--)te="0"+te;return Q>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),c.indexOf(".")===0&&(te=""),J=te+$+(_||""),m?J=(m&&P?"(":"")+J+(m&&P?")":""):Se>=0?J=Se===0?(P?"-":"+")+J:J+(P?"-":"+"):P&&(J="-"+J),J},stringToNumber:function(l){var c=a[f.currentLocale],h=l,p={thousand:3,million:6,billion:9,trillion:12},m,x,v;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(m in p)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[m]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){x*=Math.pow(10,p[m]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,h){return l.slice(0,h)+c+l.slice(h)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var h=Object(l),p=h.length>>>0,m=0,x;if(arguments.length===3)x=arguments[2];else{for(;m<p&&!(m in h);)m++;if(m>=p)throw new TypeError("Reduce of empty array with no initial value");x=h[m++]}for(;m<p;m++)m in h&&(x=c(x,h[m],m,h));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,h){var p=n.multiplier(h);return c>p?c:p},1)},toFixed:function(l,c,h,p){var m=l.toString().split("."),x=c-(p||0),v,_,E,S;return m.length===2?v=Math.min(Math.max(m[1].length,x),c):v=x,E=Math.pow(10,v),S=(h(l+"e+"+v)/E).toFixed(v),p>c-v&&(_=new RegExp("\\.?0{1,"+(p-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in u)f[l]=u[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,h){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=h,h},t.validate=function(l,c){var h,p,m,x,v,_,E,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return m=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?p="\\.":p=E.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==m)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(p+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(h),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var h=this._value,p=l||f.defaultFormat,m,x,v;if(c=c||Math.round,h===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(h===null&&f.nullFormat!==null)x=f.nullFormat;else{for(m in i)if(p.match(i[m].regexps.format)){v=i[m].format;break}v=v||t._.numberToFormat,x=v(h,p,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,x,v){return p+Math.round(c*m)}return this._value=n.reduce([this._value,l],h,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,x,v){return p-Math.round(c*m)}return this._value=n.reduce([l],h,Math.round(this._value*c))/c,this},multiply:function(l){function c(h,p,m,x){var v=n.correctionFactor(h,p);return Math.round(h*v)*Math.round(p*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(h,p,m,x){var v=n.correctionFactor(h,p);return Math.round(h*v)/Math.round(p*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,h){var p=t._.includes(c," BPS")?" ":"",m;return l=l*1e4,c=c.replace(/\s?BPS/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"BPS"),m=m.join("")):m=m+p+"BPS",m},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=l.suffixes.concat(c.suffixes.filter(function(m){return l.suffixes.indexOf(m)<0})),p=h.join("|");p="("+p.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(p)},format:function(m,x,v){var _,E=t._.includes(x,"ib")?c:l,S=t._.includes(x," b")||t._.includes(x," ib")?" ":"",w,D,$;for(x=x.replace(/\s?i?b/,""),w=0;w<=E.suffixes.length;w++)if(D=Math.pow(E.base,w),$=Math.pow(E.base,w+1),m===null||m===0||m>=D&&m<$){S+=E.suffixes[w],D>0&&(m=m/D);break}return _=t._.numberToFormat(m,x,v),_+S},unformat:function(m){var x=t._.stringToNumber(m),v,_;if(x){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(m,l.suffixes[v])){_=Math.pow(l.base,v);break}if(t._.includes(m,c.suffixes[v])){_=Math.pow(c.base,v);break}}x*=_||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,v,_;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,h),l>=0?(m.before=m.before.replace(/[\-\(]/,""),m.after=m.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(m.before,"-")&&!t._.includes(m.before,"(")&&(m.before="-"+m.before),_=0;_<m.before.length;_++)switch(v=m.before[_],v){case"$":x=t._.insert(x,p.currency.symbol,_);break;case" ":x=t._.insert(x," ",_+p.currency.symbol.length-1);break}for(_=m.after.length-1;_>=0;_--)switch(v=m.after[_],v){case"$":x=_===m.after.length-1?x+p.currency.symbol:t._.insert(x,p.currency.symbol,-(m.after.length-(1+_)));break;case" ":x=_===m.after.length-1?x+" ":t._.insert(x," ",-(m.after.length-(1+_)+p.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,h){var p,m=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=m.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),p=t._.numberToFormat(Number(x[0]),c,h),p+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),h=Number(c[0]),p=Number(c[1]);p=t._.includes(l,"e-")?p*=-1:p;function m(x,v,_,E){var S=t._.correctionFactor(x,v),w=x*S*(v*S)/(S*S);return w}return t._.reduce([h,Math.pow(10,p)],m,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=p.ordinal(l),m=t._.numberToFormat(l,c,h),m+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,h){var p=t._.includes(c," %")?" ":"",m;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"%"),m=m.join("")):m=m+p+"%",m},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,h){var p=Math.floor(l/60/60),m=Math.floor((l-p*60*60)/60),x=Math.round(l-p*60*60-m*60);return p+":"+(m<10?"0"+m:m)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),h=0;return c.length===3?(h=h+Number(c[0])*60*60,h=h+Number(c[1])*60,h=h+Number(c[2])):c.length===2&&(h=h+Number(c[0])*60,h=h+Number(c[1])),Number(h)}})}(),t})}(Qs)),Qs.exports}var ud=hd();const Zs=yr(ud),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),Xe=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),md={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:Xe},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Me=(e,t)=>{const n=md[`_${Bt[t].minimumFractionDigits??2}`].roundUpto;return n(e)},Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Bt={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function Na(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Zs(e).format("0,00.000");default:return Zs(e).format("0,00.00")}}function fd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(p){if(p<10)return t[p];if(p<20)return n[p-11];{const m=p%10,x=Math.floor(p/10);return`${r[x]}${m?" "+t[m]:""}`}}function a(p){var m=p.toString(),x,v,_,E,S,w,D,$,P,Z,ne,te,le="and";if(m=m.replace(/[, ]/g,""),parseInt(m)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],E=m.length,w=[];E>0;)S=E,w.push(m.slice(E=Math.max(0,E-3),S));if(D=w.length,D>_.length)return"";for(te=[],Z=0;Z<D;Z++)$=parseInt(w[Z]),$&&(P=w[Z].split("").reverse().map(parseFloat),P[1]===1&&(P[0]+=10),(ne=_[Z])&&te.push(ne),(ne=x[P[0]])&&te.push(ne),(ne=v[P[1]])&&te.push(ne),(P[0]||P[1])&&(P[2]||Z+1>D)&&te.push(le),(ne=x[P[2]])&&te.push(ne+" Hundred"));return te.reverse().join(" ")}const[u,f]=e.toString().split("."),o=a(parseInt(u,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${Me(e||0,t)}`:`${Bt[t].symbol} ${Me(e||0,t)}`},B=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${Na(e||0,t)}`:`${Bt[t].symbol} ${Na(e||0,t)}`},tr=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(u=>{var f;(f=u.discounts)==null||f.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(u=>{const f=`${u[t]}`;n[f]?(n[f].amt+=u.amt,n[f].taxAmt+=u.taxAmt):n[f]={amt:u.amt,chargeType:u.chargeType?u.chargeType:u.type,defaultSelcted:u.defaultSelcted,rate:u.rate,tax:u.tax,taxAmt:u.taxAmt,name:u.name,type:u.type}})}),Object.values(n)},rr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ms(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function yd(e,t,n,r,i){const a=ms("1",e),u=ms("2",t),f=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,u,f,o,l]);return c.toString("base64")}const gd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),xd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},fs=tr(),Nd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),u=Math.floor(t%3600/60),f=`${a} hr ${u} min`;return f}else return r},jd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=us(i,"internalName");let u;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(u=a[f],n.push({displayName:u?u.displayName:Ve(f.replace("_"," ")),value:Xe(e.paymentModes[f])}));return n},vd=(e,t)=>e>0&&t>0?e/t:0;function Wt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var u=i.toDataURL("image/png");t(u)},r.onerror=i=>{t(null)}}catch{t(null)}})}const Xs=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return!0},ar=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},ir=(e,t)=>{var c,h,p,m;let n,r,i,a,u;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],u=0;u<n.addons.length;u++)a=n.addons[u],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(h=f[r].addons)!=null&&h.length&&((p=n.addons)!=null&&p.length)){const v=us(n.addons,"serviceId"),_=[];let E;for(let S=0;S<f[r].addons.length;S++)a=f[r].addons[S],(m=v[a.serviceId])!=null&&m.serviceId&&(E=v[a.serviceId],a.sub_total+=E.sub_total??0),_.push(a);f[r].addons=_}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},en=e=>{var f;let t,n,r,i,a={},u=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),u+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),u+=r.taxAmt);return{obj:Object.values(a),sum:u}},lr=(e,t,n)=>{var a,u,f,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=Xs((u=t.siteSetting)==null?void 0:u.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return Xs((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=Xs((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var E;const{usersObj:r,stationList:i}=n;let a={},u,f;const{cancelledKOT:o,onlyCancelledItems:l,kotStatus:c="KOT_GENERATED"}=n,h=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=vt(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(f=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{u=S.services.sort(w=>w.status==="CANCELLED"?-1:0),u.forEach((w,D)=>{var Q,J,G;let $=w.station?w.station.split("::"):"",P=$&&$.length>1?$[1]:$[0],Z=e.tableNo?e.tableNo.split("::"):null,ne=Z&&Z.length>0?Z[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?ne:e.orderFrom,le;(Q=r==null?void 0:r[S.createdBy])!=null&&Q.name&&(le=r[S.createdBy].name);let Se=!1;(o||P&&w.status==c)&&(Se=!0),Se&&or(P,i)&&(a[P]||(a[P]={},a[P].station=P,a[P].services=[],a[P].tableName=te,a[P].customerName=e.name==t.companyName?null:e.name,a[P].time=L().format("DD-MM-YYYY hh:mm a"),a[P].type=e.orderFrom,a[P].subOrderFrom=e.subOrderFrom,a[P].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,a[P].orderId=new Set([a[P].orderId]),a[P].instruction=e.instruction,a[P].orderSource=e.orderSource,a[P].deliveryTimestamp=e.deliveryTimestamp?L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,a[P].aggregatorOrderId=e.externalOrderId,a[P].otp=e.otp,a[P].totalQty=0,a[P].tokenId=e.tokenId,a[P].kotId=w.kotId?new Set([w.kotId]):null,a[P].waiterName=e.waiterName,a[P].duplicate=o,a[P].createdBy=le,a[P].zomatoInstant=h,f&&(a[P].customFields=f),l&&(a[P].onlyCancelledItems=l),e.preparationTime&&(a[P].prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),a[P]?(a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.isUrgent&&w.instruction?`(URGENT -${w.instruction})`:w.instruction?`(${w.instruction})`:w.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:w.isUrgent,index:D,status:w.status,addons:w.addons}),a[P].totalQty+=ve(w.qty),(J=a[P].kotId)==null||J.add(w.kotId),e.externalOrderId||e.offlineOrderId||(G=a[P].orderId)==null||G.add(S.subOrderId)):(a[P]=[],a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.instruction?w.instruction:"",subOrderId:S.subOrderId,index:D,status:w.status}),a[P].totalQty+=ve(w.qty)))})});let p={},m="2INCH";tr();let x,v=[],_={};for(const S in a)if(Object.hasOwnProperty.call(a,S)){const w=a[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==w.station.toUpperCase()&&(x=fs=="Android OS"?D:D.value??void 0,m=D.paperSize?D.paperSize:t.printerSize,v.push({printer:x,paperSize:m}))}),v.length==0&&v.push({printer:x,paperSize:t.printerSize||m});for(let D=0;D<w.services.length;D++){let $=w.services[D],P=e.orderList.find(ne=>ne.subOrderId==$.subOrderId),Z=p[$.subOrderId];P&&(Z?Z.services.push(P.services[$.index]):(p[$.subOrderId]={},p[$.subOrderId].subOrderId=P.subOrderId,p[$.subOrderId].services=[P.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],x=null}for(const S in p)Object.hasOwnProperty.call(p,S)&&p[S];return{obj:a,paperSize:m,printer:x,printersMap:_}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let u="2INCH",f,o=[],l,c;const h=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let p=vt(e.customFeilds,"INSTRUCTION","customType");p!=null&&p.customValue&&(c=[{customName:p.customName,customValue:p.customValue}])}for(let p=0;p<t.packagingSlipPrinters.length;p++)if(l=t.packagingSlipPrinters[p],l.label==e.subOrderFrom&&(f=fs=="Android OS"?l:l.value??void 0,u=l.paperSize?l.paperSize:u,l.paperSize)){let m,x,v,_,E,S={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:L().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:h},w={},D=!1,$,P=0;for(e.preparationTime&&(S.prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(m=e.orderList[v],_=0;_<m.services.length;_++)x=m.services[_],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},D=!1,x.status===r&&((a=l.stations)!=null&&a.length?($=od(l.stations),$[x.station]&&(D=!0)):D=!0),D&&x.kotId&&x.station&&(E=x.station.split("::")[1],P+=x.qty,w[`${E}/${x.kotId}`]?w[`${E}/${x.kotId}`].push(x):w[`${E}/${x.kotId}`]=[x]);Object.keys(w).length&&(S.services=w,S.totalQty=Xe(P),o.push({printer:f,paperSize:u,obj:S}))}return{printers:o}}catch(u){console.log(u)}},Sd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let h=(c=l.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[l.kotId]=l.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,h,p={},m=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],m.push(o.tableNo),c=0;c<o.ids.length;c++)h=o.ids[c],p[h]=h;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],p[o.id]&&o.orderList.forEach(v=>{v.services.forEach(_=>{var E;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let S=(E=_.station.split("::"))==null?void 0:E[1];S&&or(S,n.stationList)&&(r[S]?r[S].activeKots[_.kotId]=_.kotId:r[S]={from:m,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,u=[],f={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?fs=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,u.push({printer:a,paperSize:i}))}),u.length==0&&u.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=u,u=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var w,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:u,rangeDate:f}=t,o={},l;const c=!!vt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...P}=i;i={...P,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let h=c&&(n==null?void 0:n.length)&&n.some($=>$.slugName==="online-menu")&&e.isAggregatorEnabled==!0,p=h?r.aggregator_collection:void 0,m=h?r.zomato_collection:void 0,x=h?r.swiggy_collection:void 0,v=c?Nd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const P in $)P.endsWith("collection")?l[es(P)]=Xe($[P]):l[es(P)]=$[P]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((w=Object.keys(r.itemTypeList))!=null&&w.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=u;return f.toDate!==f.fromDate&&(E=`${rr(f.fromDate)} - ${rr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:Xe(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:p,zomato_aggregator_collection:m,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:Xe(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((D=a.DEBIT)!=null&&D.total)?Xe(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?Xe(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?Xe(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:E,id:Math.random(),otherFields:{salesCollection:i.salesCollection?Xe(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var h,p,m;const{invoiceFormat:a,userData:u}=n;let f,o,l=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let J=0;J<e.appliedDiscounts.length;J++)f=e.appliedDiscounts[J],c+=f.discountAmt}const x=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((p=e.customFeilds)!=null&&p.length){const J=vt(e.customFeilds,"INSTRUCTION","customType");J!=null&&J.customValue&&(l=[{customName:J.customName,customValue:J.customValue}])}f={};let v=(m=t==null?void 0:t.footerAddress)!=null&&m.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",E=t.footerAddress.city?t.footerAddress.city:"",S=t.footerAddress.zip?t.footerAddress.zip:"",w=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:w,companyContact:t.contactNumber,companyEmail:t.contactEmail},Z={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ne={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),le={...e,companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},Se=null,Q=null;a.companyLogo&&(Se=await Wt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(Q=await Wt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(J=>{J.services.forEach(async(G,de)=>{var tt,st;let W="kitchen",X=e.tableName?e.tableName:e.orderFrom;W&&(f[W]||(f[W]={},f[W].station=W,f[W].services=[],f[W].tableName=X,f[W].customerName=e.name,f[W].time=L.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[W].type=e.orderFrom,f[W].orderId=e.orderId,f[W].instruction=e.instruction,f[W].totalQty=0,f[W].tokenId=e.tokenId,f[W].orderSource=e.orderSource,f[W].aggregatorOrderId=e.externalOrderId,f[W].otp=e.otp,f[W].paymentState=e.paymentState,f[W].discountAmt=c,f[W].otherCharges=e.otherCharges,f[W].taxAmt=e.taxAmt,f[W].customFeilds=l,f[W].curr=t.curr??"INR",f[W].zomatoInstant=x),f[W]?(o={serviceName:G.serviceName,qty:G.qty,instruction:G.isUrgent&&G.instruction?`(URGENT -${G.instruction})`:G.instruction?`(${G.instruction})`:G.isUrgent?"(URGENT)":"",subOrderId:J.subOrderId,isUrgent:G.isUrgent,index:de},(tt=G.addons)!=null&&tt.length&&(o.addons=G.addons),f[W].services.push(o),f[W].totalQty+=G.qty):(f[W]=[],f[W].services.push({serviceName:G.serviceName,qty:G.qty,instruction:G.instruction?G.instruction:"",subOrderId:J.subOrderId,index:de}),f[W].totalQty+=G.qty),f[W]={...f[W],companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},f[W].domain=a.siteURL,f[W].paymentMethods=a.paymentMode?le.paymentMethods:null,f[W].companyInfo.companyName=a.companyName,f[W].companyInfo.companyEmail=a.email,f[W].companyInfo.companyAddress=a.address,f[W].companyInfo.companyContact=a.mobile,f[W].tokenId=a.token?le.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(le.upiId=a.upiId),f[W].gstNo=a.gst?le.gst:null,f[W].footerMessage=a.footerMessage,f[W].orderFrom=(st=e.subOrderFrom)==null?void 0:st.toUpperCase(),f[W].fssai=t.fssai,f[W].vatNo=t.vatNo,f[W].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[W].disabledPoweredBy=t.disabledPoweredBy===!0,f[W].printTime=L().format("DD-MM-YYYY hh:mm A"),f[W].printedBy=u.userRole=="admin"?"Admin":u.name,e.deliveryTimestamp&&(f[W].deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[W].itemInstructionOnBill=a.itemInstructionOnBill,f[W]={...f[W],companyLogo:Se,companyQrCode:Q})})});for(const J in f)if(Object.hasOwnProperty.call(f,J)){const G=f[J];try{let de=t.printerSize??"2inch";r(new Object({obj:new Object({...G,paperSize:de}),orderList:e.orderList}));return}catch(de){console.log(de)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let p=0;p<e[h].orderList.length;p++)t.push(e[h].orderList[p]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let p=0;p<t[h].services.length;p++)t[h].services[p].status!="CANCELLED"&&t[h].services[p].status!="RETURNED"&&t[h].services[p].status!="SHIFTED"&&n.push(t[h].services[p]);let r={},i=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let p=0;p<n[h].addons.length;p++){let m={...n[h].addons[p]};m.qty=n[h].qty,i.push(m)}n.forEach(h=>{let{attachedCat:p,serviceId:m}=h;r[p]||(r[p]=[]);let x=r[p].findIndex(v=>v.serviceId===m);x!==-1?r[p][x].qty=r[p][x].qty+h.qty:r[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const a=Object.keys(r).sort(),u={};a.forEach(h=>{u[h]=r[h]});for(let h in u)u[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));let f={Category:u},o={};i.forEach(h=>{let{attachedAddonCat:p,serviceId:m}=h;o[p]||(o[p]=[]);let x=o[p].findIndex(v=>v.serviceId===m);x!==-1?o[p][x].qty=o[p][x].qty+h.qty:o[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const l=Object.keys(o).sort(),c={};l.forEach(h=>{c[h]=o[h]});for(let h in c)c[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));return f.Addon=c,f},ja={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},va=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ja[t]?ja[t]:"SGST"},_a=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c,h,p;try{const{invoiceFormat:m,custName:x,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let w=E==null?void 0:E.userRole;if(E.userRole=="admin"?w="ADMIN":w=E==null?void 0:E.name,!(S!=null&&S.length))return;let D=t.printerSize,$=lr(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});D=$?(u=$[0])!=null&&u.paperSize?(f=$[0])==null?void 0:f.paperSize:D||"2INCH":D;let P=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",Z=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",ne=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",le=(P!=""?P+",":"")+(Z!=""?Z+",":"")+(ne!=""?ne+",":"")+(te!=""?te+",":""),Se=t.gstNo,Q={companyName:t.companyName,companyAddress:le,companyContact:t.contactNumber,companyEmail:t.contactEmail},G={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},de={custName:m&&m.custName?x==t.companyName?null:x:null,custAddress:m&&m.custAddress&&_||null,custContact:m&&m.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},W=Js(t.curr),X={...e,companyInfo:Q,orderInfo:G,customerInfo:de,gst:Se,curr:W};if(m){if(X.domain=m.siteURL,X.paymentMethods=m.paymentMode?X.paymentMethods:null,X.companyInfo.companyName=m.companyName,X.companyInfo.companyEmail=m.email,X.companyInfo.companyAddress=m.address,X.companyInfo.companyContact=m.mobile,X.customerInfo.custName=m.custName?x:null,X.tokenId=m.token?X.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(X.upiId=m.upiId),X.gstNo=m.gst?X.gst:null,X.footerMessage=m.footerMessage,X.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),X.fssai=t.fssai,X.vatNo=t.vatNo,X.invoiceType=t.invoiceType,X.taxLabel=va(t),X.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,X.disabledPoweredBy=t.disabledPoweredBy===!0,X.printTime=L().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(X.deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),X.itemInstructionOnBill=m.itemInstructionOnBill,X.printHSNCodeOnBill=m.printHSNCodeOnBill,X.noOfInvoice=m.noOfInvoice,X.printby=w,X.newFormat=!0,!(m.itemInstructionOnBill||m.printHSNCodeOnBill)&&((l=X.itemList)!=null&&l.length)){let ee;for(let be=0;be<X.itemList.length;be++)ee=X.itemList[be],ee.instruction&&delete ee.instruction,ee.hsnCode&&delete ee.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(X.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let tt=[];if((h=e.customFeilds)!=null&&h.length){let ee;for(let be=0;be<e.customFeilds.length;be++)ee=e.customFeilds[be],ee!=null&&ee.customValue&&((p=ee.availability)!=null&&p.includes("BILL"))&&tt.push({customName:ee.customName,customValue:ee.customValue});X.customFields=tt}let st=null,Ot=null;m.companyLogo&&(st=await Wt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(Ot=await Wt(`https://${m.qrcode.bucket}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let nt={};(function(){let ee,be,pt=0,y=0,d=0,O=0,j=0,I=0,U=0,b=0,F=[],z=[],he=0,Ae;if(D==="A4"||D==="A5"){for(be=0;be<S.length;be++)ee=S[be],y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0),he+=ee.qty;let He=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(He);let{obj:Oe,sum:De}=en(S);nt={itemList:ir(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Oe,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+De),qty:he}}else{let{obj:He}=en(S);for(X.taxation=He,be=0;be<S.length;be++)ee=S[be],ee.taxType==="VAT"?(z.push(ee),b+=ee.sub_total,I+=ee.afterdiscAmt,j+=ee.afterdiscAmt+(ee.total_charges??0),U+=ee.afterdiscAmt+(ee.total_charges??0)):(F.push(ee),y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0));if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:qe}=en(F);nt.GST={itemList:ir(F,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(F,"name"),taxation:De,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+qe)}}if(z.length){let Le=sr(z,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:qe}=en(z);nt.VAT={itemList:ir(z,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(z,"name"),taxation:De,subTotal:ve(b),afterDisc:ve(I),afterCharges:ve(j),total:ve(U+qe)}}}})(),X.distributedData=nt;let Mt={obj:X,companyLogo:st,companyQrCode:Ot,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c;try{const{invoiceFormat:h,custName:p,custMobile:m,custAddress:x,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",w=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(w!=""?w+",":""),$=t.gstNo,P={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},ne={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?L.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},te={custName:h&&h.custName?p==t.companyName?null:p:null,custAddress:h&&h.custAddress&&x||null,custContact:h&&h.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},le=Js(t.curr),Se="",Q={...e,companyInfo:P,orderInfo:ne,customerInfo:te,gst:$,curr:le};if(h){if(Q.domain=h.siteURL,Q.paymentMethods=h.paymentMode?Q.paymentMethods:null,Q.companyInfo.companyName=h.companyName,Q.companyInfo.companyEmail=h.email,Q.companyInfo.companyAddress=h.address,Q.companyInfo.companyContact=h.mobile,Q.customerInfo.custName=h.custName?p:null,Q.tokenId=h.token?Q.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Q.upiId=h.upiId),Q.gstNo=h.gst?Q.gst:null,Q.footerMessage=h.footerMessage,Q.orderFrom=(u=v.subOrderFrom)==null?void 0:u.toUpperCase(),Q.fssai=t.fssai,Q.vatNo=t.vatNo,Q.taxLabel=va(t),Q.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Q.disabledPoweredBy=t.disabledPoweredBy===!0,Q.printTime=L().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Q.deliveryTimestamp=L.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Q.itemInstructionOnBill=h.itemInstructionOnBill,Q.printHSNCodeOnBill=h.printHSNCodeOnBill,Q.noOfInvoice=h.noOfInvoice,Q.area=v.area,Q.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((f=Q.itemList)!=null&&f.length)){let G;for(let de=0;de<Q.itemList.length;de++)G=Q.itemList[de],G.instruction&&delete G.instruction,G.hsnCode&&delete G.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(Q.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let J=[];if((l=v.customFeilds)!=null&&l.length){let G;for(let de=0;de<v.customFeilds.length;de++)G=v.customFeilds[de],G!=null&&G.customValue&&((c=G.availability)!=null&&c.includes("BILL"))&&J.push({customName:G.customName,customValue:G.customValue});Q.customFields=J}if(t&&t.isOld&&t.isOld==!0){let G=null,de=null;h.companyLogo&&(G=await Wt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(de=await Wt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let W={obj:Q,companyLogo:G,companyQrCode:de,paperSize:t.printerSize,Name:a};r(W)}}}catch(h){console.log("err",h)}}),Od=(e,t)=>new Promise(async(n,r)=>{var w;let i;(w=t.siteLogo)!=null&&w.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",u=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(u!=""?u+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],h,p=0,m=0,x=0,v=[],_,E;const S=us(t.paymentModes??defaultPaymentModes,"internalName");for(let D=0;D<e.length;D++)for(h=e[D],c.push({date:h.date,orderId:h.orderId,finalAmount:h.finalAmount}),p+=h.finalAmount,m+=h.paidAmt,x+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:L.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:ve(E.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:p,totalPaid:m,totalPayable:x,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Md=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await _a({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),ba=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},or=(e,t)=>{var r,i;if(!(t!=null&&t.length))return!0;let n=t.findIndex(a=>a.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(i=t[n])==null?void 0:i.printKot};function Ad(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _t(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let zt=null;function Sa(e={}){return zt||(e.includeStyleProperties?(zt=e.includeStyleProperties,zt):(zt=_t(window.getComputedStyle(document.documentElement)),zt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Ld(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function Ta(e,t={}){const n=t.width||Rd(e),r=t.height||Ld(e);return{width:n,height:r}}function kd(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Fe=16384;function Pd(e){(e.width>Fe||e.height>Fe)&&(e.width>Fe&&e.height>Fe?e.width>e.height?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe):e.width>Fe?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Fd(i)}const Re=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Re(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return Sa(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function wa(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const u=Ed();try{t.className=`${t.className} ${u}`}catch{return}const f=document.createElement("style");f.appendChild($d(u,n,i,r)),t.appendChild(f)}function Hd(e,t,n){wa(e,t,":before",n),wa(e,t,":after",n)}const Ia="application/font-woff",Ca="image/jpeg",Bd={woff:Ia,woff2:Ia,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ca,jpeg:Ca,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cr(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Oa(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,u)=>{const f=new FileReader;f.onerror=u,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){u(o)}},f.readAsDataURL(i)})}const hr={};function Vd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ur(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Oa(e,n.fetchRequestInit,({res:u,result:f})=>(t||(t=u.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;a&&(u=typeof a=="string"?a:a.message),u&&console.warn(u)}return hr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),u=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,u==null||u.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return sn(f)}const n=e.poster,r=cr(n),i=await ur(n,r,t);return sn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return Re(e,HTMLCanvasElement)?qd(e):Re(e,HTMLVideoElement)?Kd(e,t):Re(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Ma(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ma=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Ma(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=_t(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=_t(e.contentDocument.body.childNodes):a=_t(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Re(e,HTMLVideoElement)||await a.reduce((u,f)=>u.then(()=>nn(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Sa(n).forEach(a=>{let u=i.getPropertyValue(a);a==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&a==="display"&&u==="inline"&&(u="block"),a==="d"&&t.getAttribute("d")&&(u=`path(${t.getAttribute("d")})`),r.setProperty(a,u,i.getPropertyPriority(a))})}function th(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return Re(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await nn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",u=document.createElementNS(a,"svg");u.setAttribute("xmlns",a),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const f=document.createElementNS(a,"defs");u.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(u)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Aa=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Aa,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,u=cr(t);let f;return i||(f=await ur(a,u,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ea(e){return e.search(Aa)!==-1}async function Ra(e,t,n){if(!Ea(e))return e;const r=dh(e,n);return oh(r).reduce((a,u)=>a.then(f=>ch(f,u,t,n)),Promise.resolve(r))}async function Gt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ra(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Gt("background",e,t)||await Gt("background-image",e,t),await Gt("mask",e,t)||await Gt("-webkit-mask",e,t)||await Gt("mask-image",e,t)||await Gt("-webkit-mask-image",e,t)}async function uh(e,t){const n=Re(e,HTMLImageElement);if(!(n&&!dr(e.src))&&!(Re(e,SVGImageElement)&&!dr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ur(r,cr(r),t);await new Promise((a,u)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){u(l)}}:u;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=_t(e.childNodes).map(i=>La(i,t));await Promise.all(r).then(()=>e)}async function La(e,t){Re(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const ka={};async function Pa(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Fa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async u=>{let f=u.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Oa(f,t.fetchRequestInit,({result:o})=>(n=n.replace(u,`url(${o})`),[u,o]))});return Promise.all(a).then(()=>n)}function Da(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(u,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{_t(i.cssRules||[]).forEach((a,u)=>{if(a.type===CSSRule.IMPORT_RULE){let f=u+1;const o=a.href,l=Pa(o).then(c=>Fa(c,t)).then(c=>Da(c).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?f+=1:i.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:h,error:p})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const u=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(Pa(i.href).then(f=>Fa(f,t)).then(f=>Da(f).forEach(o=>{u.insertRule(o,u.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{_t(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ea(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_t(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Ya(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Ya(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Ya(a.style.fontFamily))).map(a=>{const u=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ra(a.cssText,u,t)}))).join(`
|
|
45
|
+
*/var dd=Qs.exports,xa;function hd(){return xa||(xa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(dd,function(){var t,n,r="2.0.6",i={},a={},u={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:u.currentLocale,zeroFormat:u.zeroFormat,nullFormat:u.nullFormat,defaultFormat:u.defaultFormat,scalePercentBy100:u.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,h,p,m;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(h in i)if(m=typeof i[h].regexps.unformat=="function"?i[h].regexps.unformat():i[h].regexps.unformat,m&&l.match(m)){p=i[h].unformat;break}p=p||t._.stringToNumber,c=p(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,h){var p=a[t.options.currentLocale],m=!1,x=!1,v=0,_="",E=1e12,S=1e9,w=1e6,D=1e3,$="",P=!1,Z,ne,te,le,Se,Q,J;if(l=l||0,ne=Math.abs(l),t._.includes(c,"(")?(m=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Se=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(Z=c.match(/a(k|m|b|t)?/),Z=Z?Z[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),ne>=E&&!Z||Z==="t"?(_+=p.abbreviations.trillion,l=l/E):ne<E&&ne>=S&&!Z||Z==="b"?(_+=p.abbreviations.billion,l=l/S):ne<S&&ne>=w&&!Z||Z==="m"?(_+=p.abbreviations.million,l=l/w):(ne<w&&ne>=D&&!Z||Z==="k")&&(_+=p.abbreviations.thousand,l=l/D)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),te=l.toString().split(".")[0],le=c.split(".")[1],Q=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,le?(t._.includes(le,"[")?(le=le.replace("]",""),le=le.split("["),$=t._.toFixed(l,le[0].length+le[1].length,h,le[1].length)):$=t._.toFixed(l,le.length,h),te=$.split(".")[0],t._.includes($,".")?$=p.delimiters.decimal+$.split(".")[1]:$="",x&&Number($.slice(1))===0&&($="")):te=t._.toFixed(l,0,h),_&&!Z&&Number(te)>=1e3&&_!==p.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case p.abbreviations.thousand:_=p.abbreviations.million;break;case p.abbreviations.million:_=p.abbreviations.billion;break;case p.abbreviations.billion:_=p.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),P=!0),te.length<v)for(var G=v-te.length;G>0;G--)te="0"+te;return Q>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),c.indexOf(".")===0&&(te=""),J=te+$+(_||""),m?J=(m&&P?"(":"")+J+(m&&P?")":""):Se>=0?J=Se===0?(P?"-":"+")+J:J+(P?"-":"+"):P&&(J="-"+J),J},stringToNumber:function(l){var c=a[f.currentLocale],h=l,p={thousand:3,million:6,billion:9,trillion:12},m,x,v;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(m in p)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[m]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){x*=Math.pow(10,p[m]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,h){return l.slice(0,h)+c+l.slice(h)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var h=Object(l),p=h.length>>>0,m=0,x;if(arguments.length===3)x=arguments[2];else{for(;m<p&&!(m in h);)m++;if(m>=p)throw new TypeError("Reduce of empty array with no initial value");x=h[m++]}for(;m<p;m++)m in h&&(x=c(x,h[m],m,h));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,h){var p=n.multiplier(h);return c>p?c:p},1)},toFixed:function(l,c,h,p){var m=l.toString().split("."),x=c-(p||0),v,_,E,S;return m.length===2?v=Math.min(Math.max(m[1].length,x),c):v=x,E=Math.pow(10,v),S=(h(l+"e+"+v)/E).toFixed(v),p>c-v&&(_=new RegExp("\\.?0{1,"+(p-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in u)f[l]=u[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,h){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=h,h},t.validate=function(l,c){var h,p,m,x,v,_,E,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return m=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?p="\\.":p=E.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==m)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(p+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(h),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(_)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var h=this._value,p=l||f.defaultFormat,m,x,v;if(c=c||Math.round,h===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(h===null&&f.nullFormat!==null)x=f.nullFormat;else{for(m in i)if(p.match(i[m].regexps.format)){v=i[m].format;break}v=v||t._.numberToFormat,x=v(h,p,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,x,v){return p+Math.round(c*m)}return this._value=n.reduce([this._value,l],h,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function h(p,m,x,v){return p-Math.round(c*m)}return this._value=n.reduce([l],h,Math.round(this._value*c))/c,this},multiply:function(l){function c(h,p,m,x){var v=n.correctionFactor(h,p);return Math.round(h*v)*Math.round(p*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(h,p,m,x){var v=n.correctionFactor(h,p);return Math.round(h*v)/Math.round(p*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,h){var p=t._.includes(c," BPS")?" ":"",m;return l=l*1e4,c=c.replace(/\s?BPS/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"BPS"),m=m.join("")):m=m+p+"BPS",m},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},h=l.suffixes.concat(c.suffixes.filter(function(m){return l.suffixes.indexOf(m)<0})),p=h.join("|");p="("+p.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(p)},format:function(m,x,v){var _,E=t._.includes(x,"ib")?c:l,S=t._.includes(x," b")||t._.includes(x," ib")?" ":"",w,D,$;for(x=x.replace(/\s?i?b/,""),w=0;w<=E.suffixes.length;w++)if(D=Math.pow(E.base,w),$=Math.pow(E.base,w+1),m===null||m===0||m>=D&&m<$){S+=E.suffixes[w],D>0&&(m=m/D);break}return _=t._.numberToFormat(m,x,v),_+S},unformat:function(m){var x=t._.stringToNumber(m),v,_;if(x){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(m,l.suffixes[v])){_=Math.pow(l.base,v);break}if(t._.includes(m,c.suffixes[v])){_=Math.pow(c.base,v);break}}x*=_||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,v,_;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,h),l>=0?(m.before=m.before.replace(/[\-\(]/,""),m.after=m.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(m.before,"-")&&!t._.includes(m.before,"(")&&(m.before="-"+m.before),_=0;_<m.before.length;_++)switch(v=m.before[_],v){case"$":x=t._.insert(x,p.currency.symbol,_);break;case" ":x=t._.insert(x," ",_+p.currency.symbol.length-1);break}for(_=m.after.length-1;_>=0;_--)switch(v=m.after[_],v){case"$":x=_===m.after.length-1?x+p.currency.symbol:t._.insert(x,p.currency.symbol,-(m.after.length-(1+_)));break;case" ":x=_===m.after.length-1?x+" ":t._.insert(x," ",-(m.after.length-(1+_)+p.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,h){var p,m=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=m.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),p=t._.numberToFormat(Number(x[0]),c,h),p+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),h=Number(c[0]),p=Number(c[1]);p=t._.includes(l,"e-")?p*=-1:p;function m(x,v,_,E){var S=t._.correctionFactor(x,v),w=x*S*(v*S)/(S*S);return w}return t._.reduce([h,Math.pow(10,p)],m,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,h){var p=t.locales[t.options.currentLocale],m,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=p.ordinal(l),m=t._.numberToFormat(l,c,h),m+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,h){var p=t._.includes(c," %")?" ":"",m;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),m=t._.numberToFormat(l,c,h),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"%"),m=m.join("")):m=m+p+"%",m},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,h){var p=Math.floor(l/60/60),m=Math.floor((l-p*60*60)/60),x=Math.round(l-p*60*60-m*60);return p+":"+(m<10?"0"+m:m)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),h=0;return c.length===3?(h=h+Number(c[0])*60*60,h=h+Number(c[1])*60,h=h+Number(c[2])):c.length===2&&(h=h+Number(c[0])*60,h=h+Number(c[1])),Number(h)}})}(),t})}(Qs)),Qs.exports}var ud=hd();const Zs=yr(ud),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),md={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:et},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Me=(e,t)=>{const n=md[`_${Bt[t].minimumFractionDigits??2}`].roundUpto;return n(e)},Js=e=>({INR:"Rs",USD:"USD",GBP:"GBP",AED:"AE",ZMW:"ZM",SAR:"SAR",QAR:"QAR",BHD:"BHD",NPR:"NPR",KWD:"KWD",OMR:"OMR",KES:"KES",SGD:"SGD",MVR:"MVR",IDR:"IDR",THB:"THB",MYR:"MYR",TZS:"TZS",BWP:"BWP"})[e]||"Rs",Bt={USD:{symbol:"$"},EUR:{symbol:"€"},GBP:{symbol:"£"},AED:{symbol:"AE",contactValidation:8},JPY:{symbol:"¥"},AUD:{symbol:"A$"},CAD:{symbol:"CA$",contactValidation:7},INR:{symbol:"₹",round:Math.round},CNY:{symbol:"CN¥",contactValidation:8},BRL:{symbol:"R$",contactValidation:9},QAR:{symbol:"QAR",contactValidation:8},SAR:{symbol:"SAR",contactValidation:7},BHD:{symbol:"BHD",minimumFractionDigits:3,contactValidation:7},NPR:{symbol:"NPR",contactValidation:10},KWD:{symbol:"KWD",minimumFractionDigits:3,contactValidation:8},ZMW:{symbol:"ZK",contactValidation:9},OMR:{symbol:"OMR",minimumFractionDigits:3,contactValidation:8},KES:{symbol:"KSh",contactValidation:9},SGD:{symbol:"S$",contactValidation:9},MVR:{symbol:"MVR",contactValidation:7,displayType:"code"},IDR:{symbol:"Rp",contactValidation:13,displayType:"code",round:Math.round},THB:{symbol:"฿",contactValidation:8,displayType:"code"},MYR:{symbol:"RM",displayType:"code"},PKR:{symbol:"₨",round:Math.round},GHS:{symbol:"₵",contactValidation:9},LKR:{symbol:"₨",displayType:"code"},TZS:{symbol:"TZS",contactValidation:9},BWP:{symbol:"P",contactValidation:8,displayType:"code"}};function Na(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Zs(e).format("0,00.000");default:return Zs(e).format("0,00.00")}}function fd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(p){if(p<10)return t[p];if(p<20)return n[p-11];{const m=p%10,x=Math.floor(p/10);return`${r[x]}${m?" "+t[m]:""}`}}function a(p){var m=p.toString(),x,v,_,E,S,w,D,$,P,Z,ne,te,le="and";if(m=m.replace(/[, ]/g,""),parseInt(m)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],_=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],E=m.length,w=[];E>0;)S=E,w.push(m.slice(E=Math.max(0,E-3),S));if(D=w.length,D>_.length)return"";for(te=[],Z=0;Z<D;Z++)$=parseInt(w[Z]),$&&(P=w[Z].split("").reverse().map(parseFloat),P[1]===1&&(P[0]+=10),(ne=_[Z])&&te.push(ne),(ne=x[P[0]])&&te.push(ne),(ne=v[P[1]])&&te.push(ne),(P[0]||P[1])&&(P[2]||Z+1>D)&&te.push(le),(ne=x[P[2]])&&te.push(ne+" Hundred"));return te.reverse().join(" ")}const[u,f]=e.toString().split("."),o=a(parseInt(u,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const ie=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${Me(e||0,t)}`:`${Bt[t].symbol} ${Me(e||0,t)}`},B=(e,t)=>{var n;return((n=Bt[t])==null?void 0:n.displayType)=="code"?`${t} ${Na(e||0,t)}`:`${Bt[t].symbol} ${Na(e||0,t)}`},tr=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(u=>{var f;(f=u.discounts)==null||f.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(u=>{const f=`${u[t]}`;n[f]?(n[f].amt+=u.amt,n[f].taxAmt+=u.taxAmt):n[f]={amt:u.amt,chargeType:u.chargeType?u.chargeType:u.type,defaultSelcted:u.defaultSelcted,rate:u.rate,tax:u.tax,taxAmt:u.taxAmt,name:u.name,type:u.type}})}),Object.values(n)},rr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ms(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function yd(e,t,n,r,i){const a=ms("1",e),u=ms("2",t),f=ms("3",n),o=ms("4",r),l=ms("5",i);var c=Buffer.concat([a,u,f,o,l]);return c.toString("base64")}const gd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),xd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},fs=tr(),Nd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),u=Math.floor(t%3600/60),f=`${a} hr ${u} min`;return f}else return r},jd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=us(i,"internalName");let u;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(u=a[f],n.push({displayName:u?u.displayName:Ve(f.replace("_"," ")),value:et(e.paymentModes[f])}));return n},vd=(e,t)=>e>0&&t>0?e/t:0;function Wt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var u=i.toDataURL("image/png");t(u)},r.onerror=i=>{t(null)}}catch{t(null)}})}const Xs=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return!0},ar=e=>{let t={},n;for(let r=0;r<e.length;r++)switch(n=e[r],n.type){case"ORDER_DISCOUNT":t.ORDER_DISCOUNT=[n];break;case"DISCOUNT_ITEMS":t.DISCOUNT_ITEMS?t.DISCOUNT_ITEMS.push(n):t.DISCOUNT_ITEMS=[n];break;case"CATEGORY_DISCOUNT":t.CATEGORY_DISCOUNT?t.CATEGORY_DISCOUNT.push(n):t.CATEGORY_DISCOUNT=[n];break;case"ITEM_DISCOUNT":t.ITEM_DISCOUNT?t.ITEM_DISCOUNT.push(n):t.ITEM_DISCOUNT=[n];break;case"COUPON_DISCOUNT":t.COUPON_DISCOUNT=[n];break;case"SEGMENT_DISCOUNT":t.SEGMENT_DISCOUNT=[n];break}return t},ir=(e,t)=>{var c,h,p,m;let n,r,i,a,u;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],u=0;u<n.addons.length;u++)a=n.addons[u],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(h=f[r].addons)!=null&&h.length&&((p=n.addons)!=null&&p.length)){const v=us(n.addons,"serviceId"),_=[];let E;for(let S=0;S<f[r].addons.length;S++)a=f[r].addons[S],(m=v[a.serviceId])!=null&&m.serviceId&&(E=v[a.serviceId],a.sub_total+=E.sub_total??0),_.push(a);f[r].addons=_}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},en=e=>{var f;let t,n,r,i,a={},u=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),u+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),u+=r.taxAmt);return{obj:Object.values(a),sum:u}},lr=(e,t,n)=>{var a,u,f,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=Xs((u=t.siteSetting)==null?void 0:u.packagingSlipPrinters,i,"value");if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return Xs((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=Xs((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(fs=="Android OS"){let c=l&&l.length>0?l.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(h=>h.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var E;const{usersObj:r,stationList:i}=n;let a={},u,f;const{cancelledKOT:o,onlyCancelledItems:l,kotStatus:c="KOT_GENERATED"}=n,h=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=vt(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(f=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{u=S.services.sort(w=>w.status==="CANCELLED"?-1:0),u.forEach((w,D)=>{var Q,J,G;let $=w.station?w.station.split("::"):"",P=$&&$.length>1?$[1]:$[0],Z=e.tableNo?e.tableNo.split("::"):null,ne=Z&&Z.length>0?Z[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?ne:e.orderFrom,le;(Q=r==null?void 0:r[S.createdBy])!=null&&Q.name&&(le=r[S.createdBy].name);let Se=!1;(o||P&&w.status==c)&&(Se=!0),Se&&or(P,i)&&(a[P]||(a[P]={},a[P].station=P,a[P].services=[],a[P].tableName=te,a[P].customerName=e.name==t.companyName?null:e.name,a[P].time=L().format("DD-MM-YYYY hh:mm a"),a[P].type=e.orderFrom,a[P].subOrderFrom=e.subOrderFrom,a[P].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,a[P].orderId=new Set([a[P].orderId]),a[P].instruction=e.instruction,a[P].orderSource=e.orderSource,a[P].deliveryTimestamp=e.deliveryTimestamp?L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,a[P].aggregatorOrderId=e.externalOrderId,a[P].otp=e.otp,a[P].totalQty=0,a[P].tokenId=e.tokenId,a[P].kotId=w.kotId?new Set([w.kotId]):null,a[P].waiterName=e.waiterName,a[P].duplicate=o,a[P].createdBy=le,a[P].zomatoInstant=h,f&&(a[P].customFields=f),l&&(a[P].onlyCancelledItems=l),e.preparationTime&&(a[P].prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),a[P]?(a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.isUrgent&&w.instruction?`(URGENT -${w.instruction})`:w.instruction?`(${w.instruction})`:w.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:w.isUrgent,index:D,status:w.status,addons:w.addons}),a[P].totalQty+=ve(w.qty),(J=a[P].kotId)==null||J.add(w.kotId),e.externalOrderId||e.offlineOrderId||(G=a[P].orderId)==null||G.add(S.subOrderId)):(a[P]=[],a[P].services.push({serviceName:w.serviceName,qty:w.qty,instruction:w.instruction?w.instruction:"",subOrderId:S.subOrderId,index:D,status:w.status}),a[P].totalQty+=ve(w.qty)))})});let p={},m="2INCH";tr();let x,v=[],_={};for(const S in a)if(Object.hasOwnProperty.call(a,S)){const w=a[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==w.station.toUpperCase()&&(x=fs=="Android OS"?D:D.value??void 0,m=D.paperSize?D.paperSize:t.printerSize,v.push({printer:x,paperSize:m}))}),v.length==0&&v.push({printer:x,paperSize:t.printerSize||m});for(let D=0;D<w.services.length;D++){let $=w.services[D],P=e.orderList.find(ne=>ne.subOrderId==$.subOrderId),Z=p[$.subOrderId];P&&(Z?Z.services.push(P.services[$.index]):(p[$.subOrderId]={},p[$.subOrderId].subOrderId=P.subOrderId,p[$.subOrderId].services=[P.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],x=null}for(const S in p)Object.hasOwnProperty.call(p,S)&&p[S];return{obj:a,paperSize:m,printer:x,printersMap:_}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let u="2INCH",f,o=[],l,c;const h=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let p=vt(e.customFeilds,"INSTRUCTION","customType");p!=null&&p.customValue&&(c=[{customName:p.customName,customValue:p.customValue}])}for(let p=0;p<t.packagingSlipPrinters.length;p++)if(l=t.packagingSlipPrinters[p],l.label==e.subOrderFrom&&(f=fs=="Android OS"?l:l.value??void 0,u=l.paperSize?l.paperSize:u,l.paperSize)){let m,x,v,_,E,S={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:L().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:h},w={},D=!1,$,P=0;for(e.preparationTime&&(S.prepareBy=L().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(m=e.orderList[v],_=0;_<m.services.length;_++)x=m.services[_],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},D=!1,x.status===r&&((a=l.stations)!=null&&a.length?($=od(l.stations),$[x.station]&&(D=!0)):D=!0),D&&x.kotId&&x.station&&(E=x.station.split("::")[1],P+=x.qty,w[`${E}/${x.kotId}`]?w[`${E}/${x.kotId}`].push(x):w[`${E}/${x.kotId}`]=[x]);Object.keys(w).length&&(S.services=w,S.totalQty=et(P),o.push({printer:f,paperSize:u,obj:S}))}return{printers:o}}catch(u){console.log(u)}},Sd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let h=(c=l.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[l.kotId]=l.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,h,p={},m=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],m.push(o.tableNo),c=0;c<o.ids.length;c++)h=o.ids[c],p[h]=h;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],p[o.id]&&o.orderList.forEach(v=>{v.services.forEach(_=>{var E;if((_.status==="KOT_GENERATED"||_.status==="IN_PROCESS")&&_.station){let S=(E=_.station.split("::"))==null?void 0:E[1];S&&or(S,n.stationList)&&(r[S]?r[S].activeKots[_.kotId]=_.kotId:r[S]={from:m,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let i="2INCH",a,u=[],f={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?fs=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,u.push({printer:a,paperSize:i}))}),u.length==0&&u.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=u,u=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var w,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:u,rangeDate:f}=t,o={},l;const c=!!vt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...P}=i;i={...P,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let h=c&&(n==null?void 0:n.length)&&n.some($=>$.slugName==="online-menu")&&e.isAggregatorEnabled==!0,p=h?r.aggregator_collection:void 0,m=h?r.zomato_collection:void 0,x=h?r.swiggy_collection:void 0,v=c?Nd(r.avgTableTime):void 0;l={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const P in $)P.endsWith("collection")?l[es(P)]=et($[P]):l[es(P)]=$[P]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((w=Object.keys(r.itemTypeList))!=null&&w.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=u;return f.toDate!==f.fromDate&&(E=`${rr(f.fromDate)} - ${rr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:et(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:p,zomato_aggregator_collection:m,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((D=a.DEBIT)!=null&&D.total)?et(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?et(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?et(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:E,id:Math.random(),otherFields:{salesCollection:i.salesCollection?et(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var h,p,m;const{invoiceFormat:a,userData:u}=n;let f,o,l=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let J=0;J<e.appliedDiscounts.length;J++)f=e.appliedDiscounts[J],c+=f.discountAmt}const x=vt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((p=e.customFeilds)!=null&&p.length){const J=vt(e.customFeilds,"INSTRUCTION","customType");J!=null&&J.customValue&&(l=[{customName:J.customName,customValue:J.customValue}])}f={};let v=(m=t==null?void 0:t.footerAddress)!=null&&m.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",_=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",E=t.footerAddress.city?t.footerAddress.city:"",S=t.footerAddress.zip?t.footerAddress.zip:"",w=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:w,companyContact:t.contactNumber,companyEmail:t.contactEmail},Z={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ne={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),le={...e,companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},Se=null,Q=null;a.companyLogo&&(Se=await Wt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(Q=await Wt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(J=>{J.services.forEach(async(G,de)=>{var st,nt;let W="kitchen",X=e.tableName?e.tableName:e.orderFrom;W&&(f[W]||(f[W]={},f[W].station=W,f[W].services=[],f[W].tableName=X,f[W].customerName=e.name,f[W].time=L.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[W].type=e.orderFrom,f[W].orderId=e.orderId,f[W].instruction=e.instruction,f[W].totalQty=0,f[W].tokenId=e.tokenId,f[W].orderSource=e.orderSource,f[W].aggregatorOrderId=e.externalOrderId,f[W].otp=e.otp,f[W].paymentState=e.paymentState,f[W].discountAmt=c,f[W].otherCharges=e.otherCharges,f[W].taxAmt=e.taxAmt,f[W].customFeilds=l,f[W].curr=t.curr??"INR",f[W].zomatoInstant=x),f[W]?(o={serviceName:G.serviceName,qty:G.qty,instruction:G.isUrgent&&G.instruction?`(URGENT -${G.instruction})`:G.instruction?`(${G.instruction})`:G.isUrgent?"(URGENT)":"",subOrderId:J.subOrderId,isUrgent:G.isUrgent,index:de},(st=G.addons)!=null&&st.length&&(o.addons=G.addons),f[W].services.push(o),f[W].totalQty+=G.qty):(f[W]=[],f[W].services.push({serviceName:G.serviceName,qty:G.qty,instruction:G.instruction?G.instruction:"",subOrderId:J.subOrderId,index:de}),f[W].totalQty+=G.qty),f[W]={...f[W],companyInfo:$,orderInfo:Z,customerInfo:ne,gst:D,curr:te},f[W].domain=a.siteURL,f[W].paymentMethods=a.paymentMode?le.paymentMethods:null,f[W].companyInfo.companyName=a.companyName,f[W].companyInfo.companyEmail=a.email,f[W].companyInfo.companyAddress=a.address,f[W].companyInfo.companyContact=a.mobile,f[W].tokenId=a.token?le.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(le.upiId=a.upiId),f[W].gstNo=a.gst?le.gst:null,f[W].footerMessage=a.footerMessage,f[W].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),f[W].fssai=t.fssai,f[W].vatNo=t.vatNo,f[W].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[W].disabledPoweredBy=t.disabledPoweredBy===!0,f[W].printTime=L().format("DD-MM-YYYY hh:mm A"),f[W].printedBy=u.userRole=="admin"?"Admin":u.name,e.deliveryTimestamp&&(f[W].deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[W].itemInstructionOnBill=a.itemInstructionOnBill,f[W]={...f[W],companyLogo:Se,companyQrCode:Q})})});for(const J in f)if(Object.hasOwnProperty.call(f,J)){const G=f[J];try{let de=t.printerSize??"2inch";r(new Object({obj:new Object({...G,paperSize:de}),orderList:e.orderList}));return}catch(de){console.log(de)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let p=0;p<e[h].orderList.length;p++)t.push(e[h].orderList[p]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let p=0;p<t[h].services.length;p++)t[h].services[p].status!="CANCELLED"&&t[h].services[p].status!="RETURNED"&&t[h].services[p].status!="SHIFTED"&&n.push(t[h].services[p]);let r={},i=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let p=0;p<n[h].addons.length;p++){let m={...n[h].addons[p]};m.qty=n[h].qty,i.push(m)}n.forEach(h=>{let{attachedCat:p,serviceId:m}=h;r[p]||(r[p]=[]);let x=r[p].findIndex(v=>v.serviceId===m);x!==-1?r[p][x].qty=r[p][x].qty+h.qty:r[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const a=Object.keys(r).sort(),u={};a.forEach(h=>{u[h]=r[h]});for(let h in u)u[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));let f={Category:u},o={};i.forEach(h=>{let{attachedAddonCat:p,serviceId:m}=h;o[p]||(o[p]=[]);let x=o[p].findIndex(v=>v.serviceId===m);x!==-1?o[p][x].qty=o[p][x].qty+h.qty:o[p].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const l=Object.keys(o).sort(),c={};l.forEach(h=>{c[h]=o[h]});for(let h in c)c[h].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));return f.Addon=c,f},ja={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},va=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ja[t]?ja[t]:"SGST"},_a=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c,h,p;try{const{invoiceFormat:m,custName:x,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let w=E==null?void 0:E.userRole;if(E.userRole=="admin"?w="ADMIN":w=E==null?void 0:E.name,!(S!=null&&S.length))return;let D=t.printerSize,$=lr(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});D=$?(u=$[0])!=null&&u.paperSize?(f=$[0])==null?void 0:f.paperSize:D||"2INCH":D;let P=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",Z=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",ne=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",le=(P!=""?P+",":"")+(Z!=""?Z+",":"")+(ne!=""?ne+",":"")+(te!=""?te+",":""),Se=t.gstNo,Q={companyName:t.companyName,companyAddress:le,companyContact:t.contactNumber,companyEmail:t.contactEmail},G={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?L.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},de={custName:m&&m.custName?x==t.companyName?null:x:null,custAddress:m&&m.custAddress&&_||null,custContact:m&&m.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},W=Js(t.curr),X={...e,companyInfo:Q,orderInfo:G,customerInfo:de,gst:Se,curr:W};if(m){if(X.domain=m.siteURL,X.paymentMethods=m.paymentMode?X.paymentMethods:null,X.companyInfo.companyName=m.companyName,X.companyInfo.companyEmail=m.email,X.companyInfo.companyAddress=m.address,X.companyInfo.companyContact=m.mobile,X.customerInfo.custName=m.custName?x:null,X.tokenId=m.token?X.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(X.upiId=m.upiId),X.gstNo=m.gst?X.gst:null,X.footerMessage=m.footerMessage,X.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),X.fssai=t.fssai,X.vatNo=t.vatNo,X.invoiceType=t.invoiceType,X.taxLabel=va(t),X.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,X.disabledPoweredBy=t.disabledPoweredBy===!0,X.printTime=L().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(X.deliveryTimestamp=L.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),X.itemInstructionOnBill=m.itemInstructionOnBill,X.printHSNCodeOnBill=m.printHSNCodeOnBill,X.noOfInvoice=m.noOfInvoice,X.printby=w,X.newFormat=!0,!(m.itemInstructionOnBill||m.printHSNCodeOnBill)&&((l=X.itemList)!=null&&l.length)){let ee;for(let be=0;be<X.itemList.length;be++)ee=X.itemList[be],ee.instruction&&delete ee.instruction,ee.hsnCode&&delete ee.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(X.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let st=[];if((h=e.customFeilds)!=null&&h.length){let ee;for(let be=0;be<e.customFeilds.length;be++)ee=e.customFeilds[be],ee!=null&&ee.customValue&&((p=ee.availability)!=null&&p.includes("BILL"))&&st.push({customName:ee.customName,customValue:ee.customValue});X.customFields=st}let nt=null,Ot=null;m.companyLogo&&(nt=await Wt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(Ot=await Wt(`https://${m.qrcode.bucket}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let rt={};(function(){let ee,be,pt=0,y=0,d=0,O=0,j=0,I=0,U=0,b=0,F=[],z=[],he=0,Ae;if(D==="A4"||D==="A5"){for(be=0;be<S.length;be++)ee=S[be],y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0),he+=ee.qty;let He=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(He);let{obj:Oe,sum:De}=en(S);rt={itemList:ir(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Oe,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+De),qty:he}}else{let{obj:He}=en(S);for(X.taxation=He,be=0;be<S.length;be++)ee=S[be],ee.taxType==="VAT"?(z.push(ee),b+=ee.sub_total,I+=ee.afterdiscAmt,j+=ee.afterdiscAmt+(ee.total_charges??0),U+=ee.afterdiscAmt+(ee.total_charges??0)):(F.push(ee),y+=ee.sub_total,d+=ee.afterdiscAmt,O+=ee.afterdiscAmt+(ee.total_charges??0),pt+=ee.afterdiscAmt+(ee.total_charges??0));if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:Ke}=en(F);rt.GST={itemList:ir(F,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(F,"name"),taxation:De,subTotal:ve(y),afterDisc:ve(d),afterCharges:ve(O),total:ve(pt+Ke)}}if(z.length){let Le=sr(z,"discountName",{separateItemsDisc:!0});const Oe=ar(Le);let{obj:De,sum:Ke}=en(z);rt.VAT={itemList:ir(z,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Oe,charges:nr(z,"name"),taxation:De,subTotal:ve(b),afterDisc:ve(I),afterCharges:ve(j),total:ve(U+Ke)}}}})(),X.distributedData=rt;let Mt={obj:X,companyLogo:nt,companyQrCode:Ot,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var u,f,o,l,c;try{const{invoiceFormat:h,custName:p,custMobile:m,custAddress:x,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",w=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(w!=""?w+",":""),$=t.gstNo,P={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},ne={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?L.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},te={custName:h&&h.custName?p==t.companyName?null:p:null,custAddress:h&&h.custAddress&&x||null,custContact:h&&h.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},le=Js(t.curr),Se="",Q={...e,companyInfo:P,orderInfo:ne,customerInfo:te,gst:$,curr:le};if(h){if(Q.domain=h.siteURL,Q.paymentMethods=h.paymentMode?Q.paymentMethods:null,Q.companyInfo.companyName=h.companyName,Q.companyInfo.companyEmail=h.email,Q.companyInfo.companyAddress=h.address,Q.companyInfo.companyContact=h.mobile,Q.customerInfo.custName=h.custName?p:null,Q.tokenId=h.token?Q.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Q.upiId=h.upiId),Q.gstNo=h.gst?Q.gst:null,Q.footerMessage=h.footerMessage,Q.orderFrom=(u=v.subOrderFrom)==null?void 0:u.toUpperCase(),Q.fssai=t.fssai,Q.vatNo=t.vatNo,Q.taxLabel=va(t),Q.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Q.disabledPoweredBy=t.disabledPoweredBy===!0,Q.printTime=L().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Q.deliveryTimestamp=L.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Q.itemInstructionOnBill=h.itemInstructionOnBill,Q.printHSNCodeOnBill=h.printHSNCodeOnBill,Q.noOfInvoice=h.noOfInvoice,Q.area=v.area,Q.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((f=Q.itemList)!=null&&f.length)){let G;for(let de=0;de<Q.itemList.length;de++)G=Q.itemList[de],G.instruction&&delete G.instruction,G.hsnCode&&delete G.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(Q.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let J=[];if((l=v.customFeilds)!=null&&l.length){let G;for(let de=0;de<v.customFeilds.length;de++)G=v.customFeilds[de],G!=null&&G.customValue&&((c=G.availability)!=null&&c.includes("BILL"))&&J.push({customName:G.customName,customValue:G.customValue});Q.customFields=J}if(t&&t.isOld&&t.isOld==!0){let G=null,de=null;h.companyLogo&&(G=await Wt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(de=await Wt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let W={obj:Q,companyLogo:G,companyQrCode:de,paperSize:t.printerSize,Name:a};r(W)}}}catch(h){console.log("err",h)}}),Od=(e,t)=>new Promise(async(n,r)=>{var w;let i;(w=t.siteLogo)!=null&&w.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",u=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(u!=""?u+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],h,p=0,m=0,x=0,v=[],_,E;const S=us(t.paymentModes??defaultPaymentModes,"internalName");for(let D=0;D<e.length;D++)for(h=e[D],c.push({date:h.date,orderId:h.orderId,finalAmount:h.finalAmount}),p+=h.finalAmount,m+=h.paidAmt,x+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:L.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:ve(E.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:p,totalPaid:m,totalPayable:x,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Md=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await _a({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),ba=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},or=(e,t)=>{var r,i;if(!(t!=null&&t.length))return!0;let n=t.findIndex(a=>a.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(i=t[n])==null?void 0:i.printKot};function Ad(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function _t(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let zt=null;function Sa(e={}){return zt||(e.includeStyleProperties?(zt=e.includeStyleProperties,zt):(zt=_t(window.getComputedStyle(document.documentElement)),zt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function Ld(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function Ta(e,t={}){const n=t.width||Rd(e),r=t.height||Ld(e);return{width:n,height:r}}function kd(){let e,t;try{t=process}catch{}const n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Fe=16384;function Pd(e){(e.width>Fe||e.height>Fe)&&(e.width>Fe&&e.height>Fe?e.width>e.height?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe):e.width>Fe?(e.height*=Fe/e.width,e.width=Fe):(e.width*=Fe/e.height,e.height=Fe))}function sn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Fd(i)}const Re=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Re(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return Sa(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function wa(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const u=Ed();try{t.className=`${t.className} ${u}`}catch{return}const f=document.createElement("style");f.appendChild($d(u,n,i,r)),t.appendChild(f)}function Hd(e,t,n){wa(e,t,":before",n),wa(e,t,":after",n)}const Ia="application/font-woff",Ca="image/jpeg",Bd={woff:Ia,woff2:Ia,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ca,jpeg:Ca,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cr(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Oa(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,u)=>{const f=new FileReader;f.onerror=u,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){u(o)}},f.readAsDataURL(i)})}const hr={};function Vd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ur(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Oa(e,n.fetchRequestInit,({res:u,result:f})=>(t||(t=u.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;a&&(u=typeof a=="string"?a:a.message),u&&console.warn(u)}return hr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),u=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,u==null||u.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return sn(f)}const n=e.poster,r=cr(n),i=await ur(n,r,t);return sn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await nn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return Re(e,HTMLCanvasElement)?qd(e):Re(e,HTMLVideoElement)?Kd(e,t):Re(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Ma(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ma=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Ma(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=_t(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=_t(e.contentDocument.body.childNodes):a=_t(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Re(e,HTMLVideoElement)||await a.reduce((u,f)=>u.then(()=>nn(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Sa(n).forEach(a=>{let u=i.getPropertyValue(a);a==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&a==="display"&&u==="inline"&&(u="block"),a==="d"&&t.getAttribute("d")&&(u=`path(${t.getAttribute("d")})`),r.setProperty(a,u,i.getPropertyPriority(a))})}function th(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return Re(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await nn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",u=document.createElementNS(a,"svg");u.setAttribute("xmlns",a),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const f=document.createElementNS(a,"defs");u.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(u)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Aa=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Aa,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,u=cr(t);let f;return i||(f=await ur(a,u,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ea(e){return e.search(Aa)!==-1}async function Ra(e,t,n){if(!Ea(e))return e;const r=dh(e,n);return oh(r).reduce((a,u)=>a.then(f=>ch(f,u,t,n)),Promise.resolve(r))}async function Gt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ra(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Gt("background",e,t)||await Gt("background-image",e,t),await Gt("mask",e,t)||await Gt("-webkit-mask",e,t)||await Gt("mask-image",e,t)||await Gt("-webkit-mask-image",e,t)}async function uh(e,t){const n=Re(e,HTMLImageElement);if(!(n&&!dr(e.src))&&!(Re(e,SVGImageElement)&&!dr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ur(r,cr(r),t);await new Promise((a,u)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){u(l)}}:u;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=_t(e.childNodes).map(i=>La(i,t));await Promise.all(r).then(()=>e)}async function La(e,t){Re(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const ka={};async function Pa(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Fa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async u=>{let f=u.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Oa(f,t.fetchRequestInit,({result:o})=>(n=n.replace(u,`url(${o})`),[u,o]))});return Promise.all(a).then(()=>n)}function Da(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(u,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{_t(i.cssRules||[]).forEach((a,u)=>{if(a.type===CSSRule.IMPORT_RULE){let f=u+1;const o=a.href,l=Pa(o).then(c=>Fa(c,t)).then(c=>Da(c).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?f+=1:i.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:h,error:p})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const u=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(Pa(i.href).then(f=>Fa(f,t)).then(f=>Da(f).forEach(o=>{u.insertRule(o,u.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{_t(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ea(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_t(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Ya(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Ya(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Ya(a.style.fontFamily))).map(a=>{const u=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ra(a.cssText,u,t)}))).join(`
|
|
46
46
|
`)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ua(e,t={}){const{width:n,height:r}=Ta(e,t),i=await nn(e,t,!0);return await jh(i,t),await La(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Ta(e,t),i=await Ua(e,t),a=await sn(i),u=document.createElement("canvas"),f=u.getContext("2d"),o=t.pixelRatio||kd(),l=t.canvasWidth||n,c=t.canvasHeight||r;return u.width=l*o,u.height=c*o,t.skipAutoScale||Pd(u),u.style.width=`${l}`,u.style.height=`${c}`,t.backgroundColor&&(f.fillStyle=t.backgroundColor,f.fillRect(0,0,u.width,u.height)),f.drawImage(a,0,0,u.width,u.height),u}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,rn=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Ba=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ps=(e,t)=>{for(var n in t||(t={}))$a.call(t,n)&&Ba(e,n,t[n]);if(rn)for(var n of rn(t))Ha.call(t,n)&&Ba(e,n,t[n]);return e},mr=(e,t)=>{var n={};for(var r in e)$a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rn)for(var r of rn(e))t.indexOf(r)<0&&Ha.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
47
47
|
* @license QR Code generator library (TypeScript)
|
|
48
48
|
* Copyright (c) Project Nayuki.
|
|
@@ -51,4 +51,4 @@ L.version="2.30.1",li(fe),L.fn=A,L.min=Kl,L.max=Ql,L.now=Zl,L.utc=Ke,L.unix=wc,L
|
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Wa={L:Vt.QrCode.Ecc.LOW,M:Vt.QrCode.Ecc.MEDIUM,Q:Vt.QrCode.Ecc.QUARTILE,H:Vt.QrCode.Ecc.HIGH},za=128,Ga="L",Va="#FFFFFF",qa="#000000",Ka=!1,fr=4,Sh=.1;function Qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(u,f){if(!u&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!u)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}u&&a===null&&(a=f)})}),n.join("")}function Za(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Ja(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,u=Math.floor(t*Sh),f=a/t,o=(r.width||u)*f,l=(r.height||u)*f,c=r.x==null?e.length/2-o/2:r.x*f,h=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(h),v=Math.ceil(o+c-m),_=Math.ceil(l+h-x);p={x:m,y:x,w:v,h:_}}return{x:c,y:h,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=l==null?void 0:l.src,p=xe.useRef(null),m=xe.useRef(null),[x,v]=xe.useState(!1);xe.useEffect(()=>{if(p.current!=null){const S=p.current,w=S.getContext("2d");if(!w)return;let D=Vt.QrCode.encodeText(n,Wa[i]).getModules();const $=f?fr:0,P=D.length+$*2,Z=Ja(D,r,f,l),ne=m.current,te=Z!=null&&ne!==null&&ne.complete&&ne.naturalHeight!==0&&ne.naturalWidth!==0;te&&Z.excavation!=null&&(D=Za(D,Z.excavation));const le=window.devicePixelRatio||1;S.height=S.width=r*le;const Se=r/P*le;w.scale(Se,Se),w.fillStyle=a,w.fillRect(0,0,P,P),w.fillStyle=u,Th?w.fill(new Path2D(Qa(D,$))):D.forEach(function(Q,J){Q.forEach(function(G,de){G&&w.fillRect(de+$,J+$,1,1)})}),te&&w.drawImage(ne,Z.x+$,Z.y+$,Z.w,Z.h)}}),xe.useEffect(()=>{v(!1)},[h]);const _=ps({height:r,width:r},o);let E=null;return h!=null&&(E=xe.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ps({style:_,height:r,width:r,ref:p},c)),E)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Vt.QrCode.encodeText(n,Wa[i]).getModules();const h=f?fr:0,p=c.length+h*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=xe.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none"}));const v=Qa(c,h);return xe.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:u,d:v,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ps({},r)):xe.createElement(wh,ps({},r))};const ys=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},k=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Ct=tr(),_e="normal-class";(Ct=="Android OS"||Ct==="iOS")&&(_e="bold-class");const et=e=>{var nt,Mt,ee,be,pt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:u,type:f}=e.printerDataObject,o=((Mt=(nt=e.value)==null?void 0:nt.settingData)==null?void 0:Mt.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(u,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const h=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(pt=c[0])==null?void 0:pt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(y){const d=Math.abs(parseFloat(y));return m(d)}function m(y){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(y).format("0,00.000");default:return Zs(y).format("0,00.00")}}xe.useEffect(()=>{E()},[e.newId]);const x=()=>new Promise(async(y,d)=>{if(Ct=="Android OS"||Ct==="iOS"){let O=await _h(n.current);if(O){const j=await _(O);y(j)}}else{let O=await Ua(n.current);O&&y(O)}}),v=()=>new Promise(async(y,d)=>{const O=await x();y(O)}),_=y=>new Promise((d,O)=>{let j=new Image;j.src=y,j.onload=()=>{let I=document.createElement("canvas");const U=600,b=j.height;let F=j.width,z=j.height;F>z?F>U&&(z*=U/F,F=U):z>b&&(F*=b/z,z=b),I.width=F,I.height=z,I.getContext("2d").drawImage(j,0,0,F,z),d(I.toDataURL())}}),E=async()=>{if(n&&n.current){const y=await v();e.onImageGenerated(y)}},S=y=>{let d=new Array;for(const O in y.menusCollection)O.endsWith("collection")||(y.menusCollection[`${O}_collection`]||y.menusCollection[O])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.replace("_"," ")}(${y.menusCollection[O]}):`}),s.jsx("span",{children:ie(y.menusCollection[`${O}_collection`],o)}),s.jsx("span",{children:m(ys(y.salesCollection.totalCollection,y.menusCollection[`${O}_collection`]??0))+"%"})]}));return y.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${y.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(y.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${y.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${y.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.swiggy_aggregator_collection,o)})]})),d},w=y=>{let d=new Array,O=new Object;for(let j=0;j<y.todayCollection.length;j++)O=y.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.displayName}:`}),s.jsx("span",{children:ie(O.value,o)}),s.jsx("span",{children:m(ys(y.totalCollection,O.value))+"%"})]}));return d},D=(y,d,O,j,I={})=>{let U=y.includes("upi://");const b=`upi://pay?pa=${y}&pn=${O}&cu=INR&am=${j}&tr=${d}`;return s.jsx(Xa,{value:U?y:b,renderAs:"canvas",size:I.size??250})},$=(y,d)=>{var U,b;let O=0;if((U=d.taxObj)!=null&&U.VAT.length){let F,z,he;for(z=0;z<((b=d.taxObj)==null?void 0:b.VAT.length);z++){F=d.taxObj.VAT[z];for(he in F)O+=ve(F[he])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:y,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:O},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:I,renderAs:"canvas",size:250})},P=y=>{const d=[];return(y.totalBalanceAmt||y.refundAmt||y.writeOffAmt||y.rewardAmt||y.cashCard)&&(d.push(s.jsx("hr",{})),y.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(y.rewardAmt,o)})]})),y.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:ie(y.totalBalanceAmt,o)})]})),y.writeOffAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:ie(y.writeOffAmt,o)})]})),y.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:ie(y.refundAmt,o)})]})),y.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:ie(y.cashCard,o)})]}))),d},Z=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].slugName===y)return d[O]}return!1},ne=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].itemType===y)return d[O]}return!1},te=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=y=>y.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${y.discountValue}${Oh[y.discountType]}`,Se=y=>{const d=new Array;if(y&&Object.keys(y).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const O in y)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${te[O]}:`}),s.jsx("span",{children:ie(y[O].total,o)})]})),O&&Object.keys(O).length!==0)for(const j in y[O])j!=="total"&&y[O][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:ie(y[O][j],o)})]}))}return d},Q=(y,d)=>{let O=!1;y.totalValue&&(O=Object.keys(y.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),y.totalValue&&(Object.keys(y.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",O&&s.jsx("div",{className:"space-2rem"})]})]})}),y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]})]}):""})):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},J=(y,d,{labels:O,doMultipleTax:j,type:I})=>{var b,F,z,he,Ae,He,Le,Oe,De,qe,yt;const U=y.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList.map(K=>{var At;return s.jsxs("div",{style:K.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[K.status==="RETURNED"?"(R) ":"",K.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:K.serviceRate?p(K.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:K.sub_total?m(K.sub_total):""})]}),K.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",K.hsnCode]}),(At=K.addons)!=null&&At.length?K.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",rt.qty*K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",K.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+K.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(b=U.DISCOUNT_ITEMS)!=null&&b.length?U.DISCOUNT_ITEMS.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:le(K)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(F=U.CATEGORY_DISCOUNT)!=null&&F.length?U.CATEGORY_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(z=U.ITEM_DISCOUNT)!=null&&z.length?U.ITEM_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+es(K.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(Ae=(he=U.SEGMENT_DISCOUNT)==null?void 0:he[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${U.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+U.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+U.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Le=(He=U.COUPON_DISCOUNT)==null?void 0:He[0])!=null&&Le.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${U.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${U.COUPON_DISCOUNT[0].discountValue}${U.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.COUPON_DISCOUNT[0].discountAmt)})]}):"",(De=(Oe=U.ORDER_DISCOUNT)==null?void 0:Oe[0])!=null&&De.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(U.ORDER_DISCOUNT[0].discountValue)?`@${U.ORDER_DISCOUNT[0].discountValue}${U.ORDER_DISCOUNT[0].discountType=="RELATIVE"||U.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y&&y.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(qe=y.charges)!=null&&qe.length?y.charges.map(K=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${K.name.toLowerCase()}`]??K.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt+K.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt)})]})})):"",y.subTotal!==y.afterCharges&&y.afterCharges!==y.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y.subTotal!==y.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((yt=y.taxation)!=null&&yt.length)?y.taxation.map(K=>{if(K.taxAmt)return K.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:"@"+K.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},G=(y,d)=>{var U,b;let O=!1;const j=y.distributedData;return y.distributedData&&(O=Object.keys(y.distributedData).length>1),s.jsxs(s.Fragment,{children:[((U=j.GST)==null?void 0:U.itemList)&&J(j.GST,y,{labels:d,doMultipleTax:O,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&J(j.VAT,y,{labels:d,doMultipleTax:O,type:"VAT"})]})},de=y=>{const d=y.services,O=Object.keys(y.services),j=O.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&O.map((U,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[U.toUpperCase(),":"]})}),d[U].map(F=>{var z;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:F.qty})]}),((z=F.addons)==null?void 0:z.length)&&F.addons.map(he=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=he.serviceName)==null?void 0:Ae.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},W=y=>{const d=y.slice(0,-4),O=y.slice(-4);return{firstDigits:d,last4Dgits:O}},X=(y,d,O,j={})=>{const I=Object.keys(d??{});let U=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),y&&I.length){U.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${O.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",O,":"]}),s.jsx("span",{children:ie(y,o)})]})]}));for(let z=0;z<I.length;z++)b=I[z],d[b]&&U.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(d[b],o)}),j.action==="addCharges"?s.jsx("span",{children:m(ys(y,d[b]))+"%"}):""]}));U.push(s.jsx("hr",{}))}return U},tt=y=>{const d=Object.keys(y.Category),O=Object.keys(y.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((I,U)=>{const b=y.Category[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=d.length-1&&s.jsx("hr",{})]})]}))}),O.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),O.forEach((I,U)=>{const b=y.Addon[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=O.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},st=y=>{var O;const d={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((O=y==null?void 0:y.customBillLabels)!=null&&O.length){let j;for(let I=0;I<y.customBillLabels.length;I++)j=y.customBillLabels[I],d[j.defaultName]=j.displayName}return d},Ot=(y,d,O,j)=>{var z,he,Ae,He,Le,Oe,De,qe,yt,K,At,rt,gs,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,qt,vs,gt,Kt,Qt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,g,M;const I=st(r.customLabelsMap),U=us(xd(r.paymentModes),"internalName"),b=C=>{var N;return(N=U[C])!=null&&N.displayName?U[C].displayName.toUpperCase():C};if(y==="BILL"){let C;if(l==="A4"||l==="A5"){let N={...d},Y=0,V=N.distributedData;const R=V.discounts;C=s.jsx("div",{className:`invoiceContainer main-div ${k[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:O&&s.jsx("img",{src:O,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((z=N.customFields)==null?void 0:z.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(he=N.customFields)!=null&&he.length?N.customFields.map(T=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[T.customName,": ",T.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:N.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[N.itemList.map(T=>{var Ne;let ge="",pe=[];return Y++,pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:ge,children:[s.jsx("td",{className:"text-align-left",children:T.serviceRate?Y:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:T.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:T.qty}),s.jsx("td",{className:"text-align-right",children:T.serviceRate?B(T.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:T.sub_total?B(T.sub_total,o):""})]}),T.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+T.instruction+")"})]})]})),(Ne=T.addons)!=null&&Ne.length&&T.addons.map(we=>{pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",we.serviceName.toUpperCase()]}),s.jsx("td",{children:we.qty*T.qty})]}),we.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+we.instruction+")"})]})]}))}),pe}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Y} Items and ${ve(V.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(Me(N.finalAmount,o).toFixed(Bt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||((Ae=d.splitDetails)==null?void 0:Ae.length)==0)(s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:B(V.subTotal,o)})]}),(He=R==null?void 0:R.DISCOUNT_ITEMS)!=null&&He.length?R.DISCOUNT_ITEMS.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:le(T)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Le=R==null?void 0:R.CATEGORY_DISCOUNT)!=null&&Le.length?R.CATEGORY_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Oe=R==null?void 0:R.ITEM_DISCOUNT)!=null&&Oe.length?R.ITEM_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(qe=(De=R==null?void 0:R.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&qe.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${R.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+R.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+R.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(K=(yt=R==null?void 0:R.COUPON_DISCOUNT)==null?void 0:yt[0])!=null&&K.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${R.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${R.COUPON_DISCOUNT[0].discountValue}${R.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(rt=(At=R==null?void 0:R.ORDER_DISCOUNT)==null?void 0:At[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(R.ORDER_DISCOUNT[0].discountValue)?`@${R.ORDER_DISCOUNT[0].discountValue}${R.ORDER_DISCOUNT[0].discountType=="RELATIVE"||R.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(gs=V.charges)!=null&&gs.length?V.charges.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${T.name.toLowerCase()}`]??T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.amt,o)})]})):"",V.subTotal!==V.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(V.afterCharges,o)})]}):"",(xs=V.taxation)!=null&&xs.length?V.taxation.map(T=>T.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+T.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.finalAmount,o)})]}),(an=d==null?void 0:d.custoutStandingData)!=null&&an.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B((Ns=N==null?void 0:N.custoutStandingData)==null?void 0:Ns.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.grandTotal+((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.rewardAmt,o)})]}):"",(ln=d.paymentMethods)!=null&&ln.length?d.paymentMethods.map(T=>{var ge;if(T.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(ge=T.paymentMode)==null?void 0:ge.toLowerCase()}`]??b(T.paymentMode)??"CASH"}}),s.jsx("span",{children:T.isRefund?"(Refund)":""})]}),T.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+B(T.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.paidAmt,o)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(d.balanceAmt,o)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(on=d.splitDetails)!=null&&on.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+T.amount})]}))]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else C=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),vt(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(cn=d.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?G(d,I):Q(d,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=d.custoutStandingData)!=null&&dn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount)})]}),(un=d.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+m(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var Y;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Y=N.paymentMode)==null?void 0:Y.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+m(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+m(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+(((mn=d==null?void 0:d.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-d.rewardAmt)})]})}):"",Ch((qt=d.convertedCurrValue)==null?void 0:qt.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${B(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:d.curr+" "+m(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(vs=d.splitDetails)!=null&&vs.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((gt=d.taxation)!=null&>.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Ct==="Android OS"||Ct==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt,o)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt,o)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||((Kt=d.splitDetails)==null?void 0:Kt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),$(r.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return C}else if(y==="PRINT_DASHBOARD"&&d.salesCollection){const C=d.salesCollection.totalDiscountAmt?ys(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=L().format("DD/MM/YYYY LT");const Y=(Qt=d.monthTillDateSalesColl)!=null&&Qt.totalDiscountAmt?ys(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${F}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:d.selectedDate})]}),s.jsx("hr",{}),d.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.monthTillDateSalesColl.totalDiscountAmt,o)}${Y?`(${m(Y)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.salesCollection.totalDiscountAmt,o)}${C?`(${m(C)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(N,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),X(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),X(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),X(d.otherFields.totalTax,d.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:d.salesCollection.totalOrders})]}),S(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:X(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:d.averageCollection.avgTableTime})]}):"",d.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:ie(d.averageCollection.avgorderValue,o)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:ie(d.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:ie(d.totalCollection,o)})]}),w(d)]}),P(d.averageCollection),d.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:ie(d.otherFields.salesCollection,o)})]}),d.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:ie(d.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Se(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ct=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(y==="AGGREGATOR_BILL"){let C;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",C.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((_s=a.services)==null?void 0:_s.length)&&a.services.map(Y=>{var V;return s.jsxs("div",{style:Y.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:Y.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Y.qty})]}),((V=Y.addons)==null?void 0:V.length)&&Y.addons.map(R=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(R.serviceName)})),Y.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Y.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:ie(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Y=>{if(Y.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Y.name}),s.jsx("h5",{children:a.curr+" "+m(Y.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Y=>{let V=new Array;for(const R in Y)if(Y[R]&&Y[R]!=0){let T=R/2;V.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",T]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",T,"%"]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]})]}))}return V})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(fn=a.customFeilds)==null?void 0:fn.map(Y=>s.jsx("h4",{className:"left-align-entity",children:Y.customName+": "+Y.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(y==="UPDATE_TABLE"){let C="";return a.action==="SWITCH_TABLE"?C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=h.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(pn=a.from)==null?void 0:pn.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Ts=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(yn=e.tableData[a.to[0]])==null?void 0:yn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(gn=h.Table)==null?void 0:gn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(ws=a.from)==null?void 0:ws.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(xn=(Is=e.tableData[a.to[0]])==null?void 0:Is.attachedArea)==null?void 0:xn.toUpperCase()} - ${(Nn=e.tableData[a.to[0]])==null?void 0:Nn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),C}else if(y==="COUNTER_OPERATION"){let C;return l=="2INCH"||l=="1.8INCH"?C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",B(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",B(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",B(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",B(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}):C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",B(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",B(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",B(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",B(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",B(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",B(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",B(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",B(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",B(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",B(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",B(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}),C}else if(y==="ITEMWISE_SALES_COUNTER"){let C,{counterDetails:N}=e.printerDataObject;return C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),tt(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),C}else if(y==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:C}=e.printerDataObject;return getRechargeDetails(C)}else if(y==="PACKAGING_SLIP"){let C,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(C=W(d.aggregatorOrderId));const Y=d.services;for(let R in Y)N+=Y[R].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+d.waiterName})]}),de(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(jn=d.customFields)==null?void 0:jn.map(R=>s.jsx("h4",{className:"left-align-entity",children:R.customName+": "+R.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(y==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.finalAmount)})]})},N.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(vn=a.transactions)!=null&&vn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.amount)})]})},N.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let C,N=0,Y,V;for(let T=0;T<(((g=a.services)==null?void 0:g.length)||0);T++)V=a.services[T],V.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=V.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",N||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(T=>(T.status==="CANCELLED"?Y=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}):Y=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}),s.jsx("div",{children:Y}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-N)]})]}),(M=a.customFields)==null?void 0:M.map(T=>s.jsx("h4",{className:"left-align-entity",children:T.customName+": "+T.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:k[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Mh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var u,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((u=n[e.primaryWaiter])==null?void 0:u.name)||null);const{obj:c,printersMap:h}=_d(e,t,r);let p=[],m=[];const x=[];if(ba(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(w=>{x.push(s.jsx(et,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{p.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),w()},additionalActions:r},v.newId+"::"+E.printer))});m.push(S)})}),l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{m.push(new Promise(E=>{x.push(s.jsx(et,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}x.length&&ft("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Ah=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let u=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),h=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(v=>{const _=s.jsx(et,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:us(a,"typeValue"),onImageGenerated:E=>{u.push({paperSize:x.paperSize,printer:x.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});h.length&&ft("root1",h),await Promise.all(f.map(p=>new Promise(p)))}r(u)}catch(a){i(a)}}),Eh=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(et,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});ft("root1",o)}),n(a)}catch(i){r(i)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let u=[];await new Promise(o=>{const l=s.jsx(et,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});ft("root1",l)}),r(u)}catch(a){i(a)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),u=[];await new Promise(o=>{const l=s.jsx(et,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});ft("root1",l)}),r(u)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let u=await Id(e);if(u&&Object.keys(u.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(h=>{const p=s.jsx(et,{printerDataObject:{staticDataKOT:u,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});ft("root1",p)}),i(l)}else i([])}catch(u){a(u)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let u=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(et,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:u,settingData:t,onImageGenerated:h=>{f.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),l()},additionalActions:n});ft("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var u;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(u=l[0])==null?void 0:u.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(et,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});ft("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const u=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=cd(l.invoiceFormats,"createdAt")[0],h=await Md(c);await new Promise(m=>{const x=s.jsx(et,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:h.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});u.push(x)})}}u.length&&ft("root1",u),r(f)}catch(u){i(u)}}),ft=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ie.counterDetailsPrint=Ph,Ie.handleAggregatorBillPrint=Rh,Ie.handleBillPrint=Lh,Ie.handleDashboardPrint=Eh,Ie.handleItemWisePrint=kh,Ie.handleKOTPrint=Mh,Ie.handleOldBillPrints=Dh,Ie.handleSummaryPrint=Fh,Ie.handleUpdateTablePrint=Ah,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Wa={L:Vt.QrCode.Ecc.LOW,M:Vt.QrCode.Ecc.MEDIUM,Q:Vt.QrCode.Ecc.QUARTILE,H:Vt.QrCode.Ecc.HIGH},za=128,Ga="L",Va="#FFFFFF",qa="#000000",Ka=!1,fr=4,Sh=.1;function Qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(u,f){if(!u&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!u)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}u&&a===null&&(a=f)})}),n.join("")}function Za(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Ja(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,u=Math.floor(t*Sh),f=a/t,o=(r.width||u)*f,l=(r.height||u)*f,c=r.x==null?e.length/2-o/2:r.x*f,h=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(h),v=Math.ceil(o+c-m),_=Math.ceil(l+h-x);p={x:m,y:x,w:v,h:_}}return{x:c,y:h,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=l==null?void 0:l.src,p=xe.useRef(null),m=xe.useRef(null),[x,v]=xe.useState(!1);xe.useEffect(()=>{if(p.current!=null){const S=p.current,w=S.getContext("2d");if(!w)return;let D=Vt.QrCode.encodeText(n,Wa[i]).getModules();const $=f?fr:0,P=D.length+$*2,Z=Ja(D,r,f,l),ne=m.current,te=Z!=null&&ne!==null&&ne.complete&&ne.naturalHeight!==0&&ne.naturalWidth!==0;te&&Z.excavation!=null&&(D=Za(D,Z.excavation));const le=window.devicePixelRatio||1;S.height=S.width=r*le;const Se=r/P*le;w.scale(Se,Se),w.fillStyle=a,w.fillRect(0,0,P,P),w.fillStyle=u,Th?w.fill(new Path2D(Qa(D,$))):D.forEach(function(Q,J){Q.forEach(function(G,de){G&&w.fillRect(de+$,J+$,1,1)})}),te&&w.drawImage(ne,Z.x+$,Z.y+$,Z.w,Z.h)}}),xe.useEffect(()=>{v(!1)},[h]);const _=ps({height:r,width:r},o);let E=null;return h!=null&&(E=xe.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ps({style:_,height:r,width:r,ref:p},c)),E)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Vt.QrCode.encodeText(n,Wa[i]).getModules();const h=f?fr:0,p=c.length+h*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=xe.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none"}));const v=Qa(c,h);return xe.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:u,d:v,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ps({},r)):xe.createElement(wh,ps({},r))};const ys=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},k=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Ct=tr(),_e="normal-class";(Ct=="Android OS"||Ct==="iOS")&&(_e="bold-class");const qe=e=>{var rt,Mt,ee,be,pt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:u,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(u,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const h=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(pt=c[0])==null?void 0:pt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(y){const d=Math.abs(parseFloat(y));return m(d)}function m(y){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(y).format("0,00.000");default:return Zs(y).format("0,00.00")}}xe.useEffect(()=>{E()},[e.newId]);const x=()=>new Promise(async(y,d)=>{if(Ct=="Android OS"||Ct==="iOS"){let O=await _h(n.current);if(O){const j=await _(O);y(j)}}else{let O=await Ua(n.current);O&&y(O)}}),v=()=>new Promise(async(y,d)=>{const O=await x();y(O)}),_=y=>new Promise((d,O)=>{let j=new Image;j.src=y,j.onload=()=>{let I=document.createElement("canvas");const U=600,b=j.height;let F=j.width,z=j.height;F>z?F>U&&(z*=U/F,F=U):z>b&&(F*=b/z,z=b),I.width=F,I.height=z,I.getContext("2d").drawImage(j,0,0,F,z),d(I.toDataURL())}}),E=async()=>{if(n&&n.current){const y=await v();e.onImageGenerated(y)}},S=y=>{let d=new Array;for(const O in y.menusCollection)O.endsWith("collection")||(y.menusCollection[`${O}_collection`]||y.menusCollection[O])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.replace("_"," ")}(${y.menusCollection[O]}):`}),s.jsx("span",{children:ie(y.menusCollection[`${O}_collection`],o)}),s.jsx("span",{children:m(ys(y.salesCollection.totalCollection,y.menusCollection[`${O}_collection`]??0))+"%"})]}));return y.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${y.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(y.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${y.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${y.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.swiggy_aggregator_collection,o)})]})),d},w=y=>{let d=new Array,O=new Object;for(let j=0;j<y.todayCollection.length;j++)O=y.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.displayName}:`}),s.jsx("span",{children:ie(O.value,o)}),s.jsx("span",{children:m(ys(y.totalCollection,O.value))+"%"})]}));return d},D=(y,d,O,j,I={})=>{let U=y.includes("upi://");const b=`upi://pay?pa=${y}&pn=${O}&cu=INR&am=${j}&tr=${d}`;return s.jsx(Xa,{value:U?y:b,renderAs:"canvas",size:I.size??250})},$=(y,d)=>{var U,b;let O=0;if((U=d.taxObj)!=null&&U.VAT.length){let F,z,he;for(z=0;z<((b=d.taxObj)==null?void 0:b.VAT.length);z++){F=d.taxObj.VAT[z];for(he in F)O+=ve(F[he])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:y,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:O},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:I,renderAs:"canvas",size:250})},P=y=>{const d=[];return(y.totalBalanceAmt||y.refundAmt||y.writeOffAmt||y.rewardAmt||y.cashCard)&&(d.push(s.jsx("hr",{})),y.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(y.rewardAmt,o)})]})),y.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:ie(y.totalBalanceAmt,o)})]})),y.writeOffAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:ie(y.writeOffAmt,o)})]})),y.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:ie(y.refundAmt,o)})]})),y.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:ie(y.cashCard,o)})]}))),d},Z=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].slugName===y)return d[O]}return!1},ne=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].itemType===y)return d[O]}return!1},te=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=y=>y.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${y.discountValue}${Oh[y.discountType]}`,Se=y=>{const d=new Array;if(y&&Object.keys(y).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const O in y)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${te[O]}:`}),s.jsx("span",{children:ie(y[O].total,o)})]})),O&&Object.keys(O).length!==0)for(const j in y[O])j!=="total"&&y[O][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:ie(y[O][j],o)})]}))}return d},Q=(y,d)=>{let O=!1;y.totalValue&&(O=Object.keys(y.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),y.totalValue&&(Object.keys(y.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",O&&s.jsx("div",{className:"space-2rem"})]})]})}),y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]})]}):""})):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},J=(y,d,{labels:O,doMultipleTax:j,type:I})=>{var b,F,z,he,Ae,He,Le,Oe,De,Ke,yt;const U=y.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList.map(K=>{var At;return s.jsxs("div",{style:K.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[K.status==="RETURNED"?"(R) ":"",K.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:K.serviceRate?p(K.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:K.sub_total?m(K.sub_total):""})]}),K.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",K.hsnCode]}),(At=K.addons)!=null&&At.length?K.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",at.qty*K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",K.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+K.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(b=U.DISCOUNT_ITEMS)!=null&&b.length?U.DISCOUNT_ITEMS.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:le(K)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(F=U.CATEGORY_DISCOUNT)!=null&&F.length?U.CATEGORY_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(z=U.ITEM_DISCOUNT)!=null&&z.length?U.ITEM_DISCOUNT.map(K=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+es(K.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(Ae=(he=U.SEGMENT_DISCOUNT)==null?void 0:he[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${U.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+U.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+U.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Le=(He=U.COUPON_DISCOUNT)==null?void 0:He[0])!=null&&Le.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${U.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${U.COUPON_DISCOUNT[0].discountValue}${U.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.COUPON_DISCOUNT[0].discountAmt)})]}):"",(De=(Oe=U.ORDER_DISCOUNT)==null?void 0:Oe[0])!=null&&De.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(U.ORDER_DISCOUNT[0].discountValue)?`@${U.ORDER_DISCOUNT[0].discountValue}${U.ORDER_DISCOUNT[0].discountType=="RELATIVE"||U.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y&&y.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Ke=y.charges)!=null&&Ke.length?y.charges.map(K=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${K.name.toLowerCase()}`]??K.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt+K.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt)})]})})):"",y.subTotal!==y.afterCharges&&y.afterCharges!==y.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y.subTotal!==y.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((yt=y.taxation)!=null&&yt.length)?y.taxation.map(K=>{if(K.taxAmt)return K.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:"@"+K.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},G=(y,d)=>{var U,b;let O=!1;const j=y.distributedData;return y.distributedData&&(O=Object.keys(y.distributedData).length>1),s.jsxs(s.Fragment,{children:[((U=j.GST)==null?void 0:U.itemList)&&J(j.GST,y,{labels:d,doMultipleTax:O,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&J(j.VAT,y,{labels:d,doMultipleTax:O,type:"VAT"})]})},de=y=>{const d=y.services,O=Object.keys(y.services),j=O.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&O.map((U,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[U.toUpperCase(),":"]})}),d[U].map(F=>{var z;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:F.qty})]}),((z=F.addons)==null?void 0:z.length)&&F.addons.map(he=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=he.serviceName)==null?void 0:Ae.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},W=y=>{const d=y.slice(0,-4),O=y.slice(-4);return{firstDigits:d,last4Dgits:O}},X=(y,d,O,j={})=>{const I=Object.keys(d??{});let U=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),y&&I.length){U.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${O.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",O,":"]}),s.jsx("span",{children:ie(y,o)})]})]}));for(let z=0;z<I.length;z++)b=I[z],d[b]&&U.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(d[b],o)}),j.action==="addCharges"?s.jsx("span",{children:m(ys(y,d[b]))+"%"}):""]}));U.push(s.jsx("hr",{}))}return U},st=y=>{const d=Object.keys(y.Category),O=Object.keys(y.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((I,U)=>{const b=y.Category[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=d.length-1&&s.jsx("hr",{})]})]}))}),O.length>0&&(j.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),O.forEach((I,U)=>{const b=y.Addon[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=O.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=y=>{var O;const d={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((O=y==null?void 0:y.customBillLabels)!=null&&O.length){let j;for(let I=0;I<y.customBillLabels.length;I++)j=y.customBillLabels[I],d[j.defaultName]=j.displayName}return d},Ot=(y,d,O,j)=>{var z,he,Ae,He,Le,Oe,De,Ke,yt,K,At,at,gs,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,qt,vs,gt,Kt,Qt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,g,M;const I=nt(r.customLabelsMap),U=us(xd(r.paymentModes),"internalName"),b=C=>{var N;return(N=U[C])!=null&&N.displayName?U[C].displayName.toUpperCase():C};if(y==="BILL"){let C;if(l==="A4"||l==="A5"){let N={...d},Y=0,V=N.distributedData;const R=V.discounts;C=s.jsx("div",{className:`invoiceContainer main-div ${k[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:O&&s.jsx("img",{src:O,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((z=N.customFields)==null?void 0:z.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(he=N.customFields)!=null&&he.length?N.customFields.map(T=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[T.customName,": ",T.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:N.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[N.itemList.map(T=>{var Ne;let ge="",pe=[];return Y++,pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:ge,children:[s.jsx("td",{className:"text-align-left",children:T.serviceRate?Y:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:T.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:T.qty}),s.jsx("td",{className:"text-align-right",children:T.serviceRate?B(T.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:T.sub_total?B(T.sub_total,o):""})]}),T.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+T.instruction+")"})]})]})),(Ne=T.addons)!=null&&Ne.length&&T.addons.map(we=>{pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",we.serviceName.toUpperCase()]}),s.jsx("td",{children:we.qty*T.qty})]}),we.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+we.instruction+")"})]})]}))}),pe}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Y} Items and ${ve(V.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(Me(N.finalAmount,o).toFixed(Bt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||((Ae=d.splitDetails)==null?void 0:Ae.length)==0)(s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:B(V.subTotal,o)})]}),(He=R==null?void 0:R.DISCOUNT_ITEMS)!=null&&He.length?R.DISCOUNT_ITEMS.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:le(T)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Le=R==null?void 0:R.CATEGORY_DISCOUNT)!=null&&Le.length?R.CATEGORY_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Oe=R==null?void 0:R.ITEM_DISCOUNT)!=null&&Oe.length?R.ITEM_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Ke=(De=R==null?void 0:R.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&Ke.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${R.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+R.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+R.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(K=(yt=R==null?void 0:R.COUPON_DISCOUNT)==null?void 0:yt[0])!=null&&K.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${R.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${R.COUPON_DISCOUNT[0].discountValue}${R.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(at=(At=R==null?void 0:R.ORDER_DISCOUNT)==null?void 0:At[0])!=null&&at.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(R.ORDER_DISCOUNT[0].discountValue)?`@${R.ORDER_DISCOUNT[0].discountValue}${R.ORDER_DISCOUNT[0].discountType=="RELATIVE"||R.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(gs=V.charges)!=null&&gs.length?V.charges.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${T.name.toLowerCase()}`]??T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.amt,o)})]})):"",V.subTotal!==V.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(V.afterCharges,o)})]}):"",(xs=V.taxation)!=null&&xs.length?V.taxation.map(T=>T.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+T.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.finalAmount,o)})]}),(an=d==null?void 0:d.custoutStandingData)!=null&&an.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B((Ns=N==null?void 0:N.custoutStandingData)==null?void 0:Ns.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.grandTotal+((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.rewardAmt,o)})]}):"",(ln=d.paymentMethods)!=null&&ln.length?d.paymentMethods.map(T=>{var ge;if(T.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(ge=T.paymentMode)==null?void 0:ge.toLowerCase()}`]??b(T.paymentMode)??"CASH"}}),s.jsx("span",{children:T.isRefund?"(Refund)":""})]}),T.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+B(T.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.paidAmt,o)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(d.balanceAmt,o)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(on=d.splitDetails)!=null&&on.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+T.amount})]}))]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else C=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),vt(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(cn=d.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?G(d,I):Q(d,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=d.custoutStandingData)!=null&&dn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount)})]}),(un=d.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+m(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var Y;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Y=N.paymentMode)==null?void 0:Y.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+m(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+m(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+(((mn=d==null?void 0:d.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-d.rewardAmt)})]})}):"",Ch((qt=d.convertedCurrValue)==null?void 0:qt.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${B(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:d.curr+" "+m(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(vs=d.splitDetails)!=null&&vs.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((gt=d.taxation)!=null&>.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Ct==="Android OS"||Ct==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt,o)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt,o)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||((Kt=d.splitDetails)==null?void 0:Kt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),$(r.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return C}else if(y==="PRINT_DASHBOARD"&&d.salesCollection){const C=d.salesCollection.totalDiscountAmt?ys(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=L().format("DD/MM/YYYY LT");const Y=(Qt=d.monthTillDateSalesColl)!=null&&Qt.totalDiscountAmt?ys(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${F}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:d.selectedDate})]}),s.jsx("hr",{}),d.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.monthTillDateSalesColl.totalDiscountAmt,o)}${Y?`(${m(Y)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:ie(d.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.salesCollection.totalDiscountAmt,o)}${C?`(${m(C)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:ie(N,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),X(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),X(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),X(d.otherFields.totalTax,d.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:ie(d.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:d.salesCollection.totalOrders})]}),S(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:X(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:d.averageCollection.avgTableTime})]}):"",d.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:ie(d.averageCollection.avgorderValue,o)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:ie(d.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:ie(d.totalCollection,o)})]}),w(d)]}),P(d.averageCollection),d.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:ie(d.otherFields.salesCollection,o)})]}),d.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:ie(d.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Se(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ct=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(y==="AGGREGATOR_BILL"){let C;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",C.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((_s=a.services)==null?void 0:_s.length)&&a.services.map(Y=>{var V;return s.jsxs("div",{style:Y.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:Y.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Y.qty})]}),((V=Y.addons)==null?void 0:V.length)&&Y.addons.map(R=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(R.serviceName)})),Y.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Y.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:ie(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Y=>{if(Y.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Y.name}),s.jsx("h5",{children:a.curr+" "+m(Y.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Y=>{let V=new Array;for(const R in Y)if(Y[R]&&Y[R]!=0){let T=R/2;V.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",T]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",T,"%"]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]})]}))}return V})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(fn=a.customFeilds)==null?void 0:fn.map(Y=>s.jsx("h4",{className:"left-align-entity",children:Y.customName+": "+Y.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(y==="UPDATE_TABLE"){let C="";return a.action==="SWITCH_TABLE"?C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=h.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(pn=a.from)==null?void 0:pn.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Ts=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(yn=e.tableData[a.to[0]])==null?void 0:yn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):C=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(gn=h.Table)==null?void 0:gn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(ws=a.from)==null?void 0:ws.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(xn=(Is=e.tableData[a.to[0]])==null?void 0:Is.attachedArea)==null?void 0:xn.toUpperCase()} - ${(Nn=e.tableData[a.to[0]])==null?void 0:Nn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),C}else if(y==="COUNTER_OPERATION"){let C;return l=="2INCH"||l=="1.8INCH"?C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",B(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",B(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",B(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",B(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}):C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",B(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",B(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",B(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",B(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",B(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",B(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",B(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",B(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",B(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",B(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",B(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",B(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(N=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:B(a.TotalDenomationsAmount,o)})]})]})}),C}else if(y==="ITEMWISE_SALES_COUNTER"){let C,{counterDetails:N}=e.printerDataObject;return C=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),C}else if(y==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:C}=e.printerDataObject;return getRechargeDetails(C)}else if(y==="PACKAGING_SLIP"){let C,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(C=W(d.aggregatorOrderId));const Y=d.services;for(let R in Y)N+=Y[R].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+d.waiterName})]}),de(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(jn=d.customFields)==null?void 0:jn.map(R=>s.jsx("h4",{className:"left-align-entity",children:R.customName+": "+R.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(y==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.finalAmount)})]})},N.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(vn=a.transactions)!=null&&vn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.amount)})]})},N.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let C,N=0,Y,V;for(let T=0;T<(((g=a.services)==null?void 0:g.length)||0);T++)V=a.services[T],V.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=V.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",N||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(T=>(T.status==="CANCELLED"?Y=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}):Y=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}),s.jsx("div",{children:Y}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-N)]})]}),(M=a.customFields)==null?void 0:M.map(T=>s.jsx("h4",{className:"left-align-entity",children:T.customName+": "+T.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:k[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Mh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var u,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((u=n[e.primaryWaiter])==null?void 0:u.name)||null);const{obj:c,printersMap:h}=_d(e,t,r);let p=[],m=[];const x=[];if(ba(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(w=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{p.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),w()},additionalActions:r},v.newId+"::"+E.printer))});m.push(S)})}),l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{m.push(new Promise(E=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}x.length&&tt("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Ah=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let u=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),h=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:us(a,"typeValue"),onImageGenerated:E=>{u.push({paperSize:x.paperSize,printer:x.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});h.length&&tt("root1",h),await Promise.all(f.map(p=>new Promise(p)))}r(u)}catch(a){i(a)}}),Eh=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});tt("root1",o)}),n(a)}catch(i){r(i)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let u=[];await new Promise(o=>{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});tt("root1",l)}),r(u)}catch(a){i(a)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),u=[];await new Promise(o=>{if(n.isSplitBill&&a.obj.splitDetails&&a.obj.splitDetails.length)for(let l=0;l<a.obj.splitDetails.length;l++){const c=a.obj.splitDetails[l];let h=JSON.parse(JSON.stringify(a));h.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t});tt(p)}else{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});tt("root1",l)}}),r(u)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let u=await Id(e);if(u&&Object.keys(u.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(h=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:u,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});tt("root1",p)}),i(l)}else i([])}catch(u){a(u)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let u=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:u,settingData:t,onImageGenerated:h=>{f.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),l()},additionalActions:n});tt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var u;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(u=l[0])==null?void 0:u.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(qe,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});tt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const u=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=cd(l.invoiceFormats,"createdAt")[0],h=await Md(c);await new Promise(m=>{const x=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:h.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});u.push(x)})}}u.length&&tt("root1",u),r(f)}catch(u){i(u)}}),tt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ie.counterDetailsPrint=Ph,Ie.handleAggregatorBillPrint=Rh,Ie.handleBillPrint=Lh,Ie.handleDashboardPrint=Eh,Ie.handleItemWisePrint=kh,Ie.handleKOTPrint=Mh,Ie.handleOldBillPrints=Dh,Ie.handleSummaryPrint=Fh,Ie.handleUpdateTablePrint=Ah,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
|