recaho-print-react 0.0.154 → 0.0.156
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 +338 -316
- package/dist/recaho-print-react.umd.cjs +13 -13
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(we,ge){typeof exports=="object"&&typeof module<"u"?ge(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ge):(we=typeof globalThis<"u"?globalThis:we||self,ge(we["recaho-print-react"]={},we.React,we.ReactDOM))})(this,function(we,ge,si){"use strict";function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cs={exports:{}},
|
|
1
|
+
(function(we,ge){typeof exports=="object"&&typeof module<"u"?ge(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ge):(we=typeof globalThis<"u"?globalThis:we||self,ge(we["recaho-print-react"]={},we.React,we.ReactDOM))})(this,function(we,ge,si){"use strict";function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cs={exports:{}},es={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var gr;function ni(){if(gr)return
|
|
9
|
+
*/var gr;function ni(){if(gr)return es;gr=1;var e=ge,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(m,u,i){var c,h={},f=null,y=null;i!==void 0&&(f=""+i),u.key!==void 0&&(f=""+u.key),u.ref!==void 0&&(y=u.ref);for(c in u)r.call(u,c)&&!o.hasOwnProperty(c)&&(h[c]=u[c]);if(m&&m.defaultProps)for(c in u=m.defaultProps,u)h[c]===void 0&&(h[c]=u[c]);return{$$typeof:t,type:m,key:f,ref:y,props:h,_owner:l.current}}return es.Fragment=n,es.jsx=a,es.jsxs=a,es}var ts={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,41 +14,41 @@
|
|
|
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 ri(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=ge,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),m=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function _(x){if(x===null||typeof x!="object")return null;var O=p&&x[p]||x[v];return typeof O=="function"?O:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(x){{for(var O=arguments.length,U=new Array(O>1?O-1:0),P=1;P<O;P++)U[P-1]=arguments[P];T("error",x,U)}}function T(x,O,U){{var P=E.ReactDebugCurrentFrame,N=P.getStackAddendum();N!==""&&(O+="%s",U=U.concat([N]));var H=U.map(function(W){return String(W)});H.unshift("Warning: "+O),Function.prototype.apply.call(console[x],console,H)}}var D=!1,$=!1,k=!1,J=!1,re=!1,te;te=Symbol.for("react.module.reference");function de(x){return!!(typeof x=="string"||typeof x=="function"||x===r||x===o||re||x===l||x===i||x===c||J||x===y||D||$||k||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===h||x.$$typeof===a||x.$$typeof===m||x.$$typeof===u||x.$$typeof===te||x.getModuleId!==void 0))}function be(x,O,U){var P=x.displayName;if(P)return P;var N=O.displayName||O.name||"";return N!==""?U+"("+N+")":U}function Z(x){return x.displayName||"Context"}function X(x){if(x==null)return null;if(typeof x.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case l:return"StrictMode";case i:return"Suspense";case c:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case m:var O=x;return Z(O)+".Consumer";case a:var U=x;return Z(U._context)+".Provider";case u:return be(x,x.render,"ForwardRef");case h:var P=x.displayName||null;return P!==null?P:X(x.type)||"Memo";case f:{var N=x,H=N._payload,W=N._init;try{return X(W(H))}catch{return null}}}return null}var
|
|
17
|
+
*/var xr;function ri(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=ge,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),m=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),p=Symbol.iterator,v="@@iterator";function _(x){if(x===null||typeof x!="object")return null;var O=p&&x[p]||x[v];return typeof O=="function"?O:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(x){{for(var O=arguments.length,U=new Array(O>1?O-1:0),P=1;P<O;P++)U[P-1]=arguments[P];T("error",x,U)}}function T(x,O,U){{var P=E.ReactDebugCurrentFrame,N=P.getStackAddendum();N!==""&&(O+="%s",U=U.concat([N]));var H=U.map(function(W){return String(W)});H.unshift("Warning: "+O),Function.prototype.apply.call(console[x],console,H)}}var D=!1,$=!1,k=!1,J=!1,re=!1,te;te=Symbol.for("react.module.reference");function de(x){return!!(typeof x=="string"||typeof x=="function"||x===r||x===o||re||x===l||x===i||x===c||J||x===y||D||$||k||typeof x=="object"&&x!==null&&(x.$$typeof===f||x.$$typeof===h||x.$$typeof===a||x.$$typeof===m||x.$$typeof===u||x.$$typeof===te||x.getModuleId!==void 0))}function be(x,O,U){var P=x.displayName;if(P)return P;var N=O.displayName||O.name||"";return N!==""?U+"("+N+")":U}function Z(x){return x.displayName||"Context"}function X(x){if(x==null)return null;if(typeof x.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof x=="function")return x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case l:return"StrictMode";case i:return"Suspense";case c:return"SuspenseList"}if(typeof x=="object")switch(x.$$typeof){case m:var O=x;return Z(O)+".Consumer";case a:var U=x;return Z(U._context)+".Provider";case u:return be(x,x.render,"ForwardRef");case h:var P=x.displayName||null;return P!==null?P:X(x.type)||"Memo";case f:{var N=x,H=N._payload,W=N._init;try{return X(W(H))}catch{return null}}}return null}var K=Object.assign,ue=0,z,ee,De,nt,At,pt,Et;function se(){}se.__reactDisabledLog=!0;function Se(){{if(ue===0){z=console.log,ee=console.info,De=console.warn,nt=console.error,At=console.group,pt=console.groupCollapsed,Et=console.groupEnd;var x={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:x,log:x,warn:x,error:x,group:x,groupCollapsed:x,groupEnd:x})}ue++}}function yt(){{if(ue--,ue===0){var x={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},x,{value:z}),info:K({},x,{value:ee}),warn:K({},x,{value:De}),error:K({},x,{value:nt}),group:K({},x,{value:At}),groupCollapsed:K({},x,{value:pt}),groupEnd:K({},x,{value:Et})})}ue<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ke=E.ReactCurrentDispatcher,g;function d(x,O,U){{if(g===void 0)try{throw Error()}catch(N){var P=N.stack.trim().match(/\n( *(at )?)/);g=P&&P[1]||""}return`
|
|
18
18
|
`+g+x}}var C=!1,j;{var w=typeof WeakMap=="function"?WeakMap:Map;j=new w}function Y(x,O){if(!x||C)return"";{var U=j.get(x);if(U!==void 0)return U}var P;C=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var H;H=Ke.current,Ke.current=null,Se();try{if(O){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(ke){P=ke}Reflect.construct(x,[],W)}else{try{W.call()}catch(ke){P=ke}x.call(W.prototype)}}else{try{throw Error()}catch(ke){P=ke}x()}}catch(ke){if(ke&&P&&typeof ke.stack=="string"){for(var A=ke.stack.split(`
|
|
19
19
|
`),I=P.stack.split(`
|
|
20
20
|
`),he=A.length-1,Ne=I.length-1;he>=1&&Ne>=0&&A[he]!==I[Ne];)Ne--;for(;he>=1&&Ne>=0;he--,Ne--)if(A[he]!==I[Ne]){if(he!==1||Ne!==1)do if(he--,Ne--,Ne<0||A[he]!==I[Ne]){var Ae=`
|
|
21
|
-
`+A[he].replace(" at new "," at ");return x.displayName&&Ae.includes("<anonymous>")&&(Ae=Ae.replace("<anonymous>",x.displayName)),typeof x=="function"&&j.set(x,Ae),Ae}while(he>=1&&Ne>=0);break}}}finally{C=!1,Ke.current=H,yt(),Error.prepareStackTrace=N}var Ze=x?x.displayName||x.name:"",
|
|
21
|
+
`+A[he].replace(" at new "," at ");return x.displayName&&Ae.includes("<anonymous>")&&(Ae=Ae.replace("<anonymous>",x.displayName)),typeof x=="function"&&j.set(x,Ae),Ae}while(he>=1&&Ne>=0);break}}}finally{C=!1,Ke.current=H,yt(),Error.prepareStackTrace=N}var Ze=x?x.displayName||x.name:"",kt=Ze?d(Ze):"";return typeof x=="function"&&j.set(x,kt),kt}function b(x,O,U){return Y(x,!1)}function F(x){var O=x.prototype;return!!(O&&O.isReactComponent)}function V(x,O,U){if(x==null)return"";if(typeof x=="function")return Y(x,F(x));if(typeof x=="string")return d(x);switch(x){case i:return d("Suspense");case c:return d("SuspenseList")}if(typeof x=="object")switch(x.$$typeof){case u:return b(x.render);case h:return V(x.type,O,U);case f:{var P=x,N=P._payload,H=P._init;try{return V(H(N),O,U)}catch{}}}return""}var fe=Object.prototype.hasOwnProperty,Me={},Le=E.ReactDebugCurrentFrame;function Ce(x){if(x){var O=x._owner,U=V(x.type,x._source,O?O.type:null);Le.setExtraStackFrame(U)}else Le.setExtraStackFrame(null)}function Ye(x,O,U,P,N){{var H=Function.call.bind(fe);for(var W in x)if(H(x,W)){var A=void 0;try{if(typeof x[W]!="function"){var I=Error((P||"React class")+": "+U+" type `"+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[W]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}A=x[W](O,W,P,U,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(he){A=he}A&&!(A instanceof Error)&&(Ce(N),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).",P||"React class",U,W,typeof A),Ce(null)),A instanceof Error&&!(A.message in Me)&&(Me[A.message]=!0,Ce(N),S("Failed %s type: %s",U,A.message),Ce(null))}}}var Qe=Array.isArray;function gt(x){return Qe(x)}function Rt(x){{var O=typeof Symbol=="function"&&Symbol.toStringTag,U=O&&x[Symbol.toStringTag]||x.constructor.name||"Object";return U}}function Lt(x){try{return q(x),!1}catch{return!0}}function q(x){return""+x}function St(x){if(Lt(x))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(x)),q(x)}var rt=E.ReactCurrentOwner,an={key:!0,ref:!0,__self:!0,__source:!0},Ns,js;function ln(x){if(fe.call(x,"ref")){var O=Object.getOwnPropertyDescriptor(x,"ref").get;if(O&&O.isReactWarning)return!1}return x.ref!==void 0}function on(x){if(fe.call(x,"key")){var O=Object.getOwnPropertyDescriptor(x,"key").get;if(O&&O.isReactWarning)return!1}return x.key!==void 0}function cn(x,O){typeof x.ref=="string"&&rt.current}function dn(x,O){{var U=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)",O))};U.isReactWarning=!0,Object.defineProperty(x,"key",{get:U,configurable:!0})}}function hn(x,O){{var U=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)",O))};U.isReactWarning=!0,Object.defineProperty(x,"ref",{get:U,configurable:!0})}}var un=function(x,O,U,P,N,H,W){var A={$$typeof:t,type:x,key:O,ref:U,props:W,_owner:H};return A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(A,"_self",{configurable:!1,enumerable:!1,writable:!1,value:P}),Object.defineProperty(A,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A};function mn(x,O,U,P,N){{var H,W={},A=null,I=null;U!==void 0&&(St(U),A=""+U),on(O)&&(St(O.key),A=""+O.key),ln(O)&&(I=O.ref,cn(O,N));for(H in O)fe.call(O,H)&&!an.hasOwnProperty(H)&&(W[H]=O[H]);if(x&&x.defaultProps){var he=x.defaultProps;for(H in he)W[H]===void 0&&(W[H]=he[H])}if(A||I){var Ne=typeof x=="function"?x.displayName||x.name||"Unknown":x;A&&dn(W,Ne),I&&hn(W,Ne)}return un(x,A,I,N,P,rt.current,W)}}var Zt=E.ReactCurrentOwner,vs=E.ReactDebugCurrentFrame;function xt(x){if(x){var O=x._owner,U=V(x.type,x._source,O?O.type:null);vs.setExtraStackFrame(U)}else vs.setExtraStackFrame(null)}var Jt;Jt=!1;function Xt(x){return typeof x=="object"&&x!==null&&x.$$typeof===t}function _s(){{if(Zt.current){var x=X(Zt.current.type);if(x)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+x+"`."}return""}}function fn(x){return""}var bs={};function pn(x){{var O=_s();if(!O){var U=typeof x=="string"?x:x.displayName||x.name;U&&(O=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+U+">.")}return O}}function Ss(x,O){{if(!x._store||x._store.validated||x.key!=null)return;x._store.validated=!0;var U=pn(O);if(bs[U])return;bs[U]=!0;var P="";x&&x._owner&&x._owner!==
|
|
25
|
+
Check the top-level render call using <`+U+">.")}return O}}function Ss(x,O){{if(!x._store||x._store.validated||x.key!=null)return;x._store.validated=!0;var U=pn(O);if(bs[U])return;bs[U]=!0;var P="";x&&x._owner&&x._owner!==Zt.current&&(P=" It was passed a child from "+X(x._owner.type)+"."),xt(x),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',U,P),xt(null)}}function Ts(x,O){{if(typeof x!="object")return;if(gt(x))for(var U=0;U<x.length;U++){var P=x[U];Xt(P)&&Ss(P,O)}else if(Xt(x))x._store&&(x._store.validated=!0);else if(x){var N=_(x);if(typeof N=="function"&&N!==x.entries)for(var H=N.call(x),W;!(W=H.next()).done;)Xt(W.value)&&Ss(W.value,O)}}}function yn(x){{var O=x.type;if(O==null||typeof O=="string")return;var U;if(typeof O=="function")U=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===u||O.$$typeof===h))U=O.propTypes;else return;if(U){var P=X(O);Ye(U,x.props,"prop",P,x)}else if(O.PropTypes!==void 0&&!Jt){Jt=!0;var N=X(O);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gn(x){{for(var O=Object.keys(x.props),U=0;U<O.length;U++){var P=O[U];if(P!=="children"&&P!=="key"){xt(x),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",P),xt(null);break}}x.ref!==null&&(xt(x),S("Invalid attribute `ref` supplied to `React.Fragment`."),xt(null))}}var ws={};function Is(x,O,U,P,N,H){{var W=de(x);if(!W){var A="";(x===void 0||typeof x=="object"&&x!==null&&Object.keys(x).length===0)&&(A+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=fn();I?A+=I:A+=_s();var he;x===null?he="null":gt(x)?he="array":x!==void 0&&x.$$typeof===t?(he="<"+(X(x.type)||"Unknown")+" />",A=" Did you accidentally export a JSX literal instead of a component?"):he=typeof x,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",he,A)}var Ne=mn(x,O,U,N,H);if(Ne==null)return Ne;if(W){var Ae=O.children;if(Ae!==void 0)if(P)if(gt(Ae)){for(var Ze=0;Ze<Ae.length;Ze++)Ts(Ae[Ze],x);Object.freeze&&Object.freeze(Ae)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ts(Ae,x)}if(fe.call(O,"key")){var kt=X(x),ke=Object.keys(O).filter(function($h){return $h!=="key"}),pr=ke.length>0?"{key: someKey, "+ke.join(": ..., ")+": ...}":"{key: someKey}";if(!ws[kt+pr]){var Uh=ke.length>0?"{"+ke.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,pr,
|
|
30
|
+
<%s key={someKey} {...props} />`,pr,kt,Uh,kt),ws[kt+pr]=!0}}return x===r?gn(Ne):yn(Ne),Ne}}function xn(x,O,U){return Is(x,O,U,!0)}function Nn(x,O,U){return Is(x,O,U,!1)}var jn=Nn,vn=xn;ts.Fragment=r,ts.jsx=jn,ts.jsxs=vn}()),ts}var Nr;function ai(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Cs.exports=ni():Cs.exports=ri()),Cs.exports}var s=ai(),Pt={},jr;function ii(){if(jr)return Pt;jr=1;var e=si;if(process.env.NODE_ENV==="production")Pt.createRoot=e.createRoot,Pt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Pt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Pt.hydrateRoot=function(n,r,l){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,l)}finally{t.usingClientEntryPoint=!1}}}return Pt}var li=ii();const vr=yr(li),ss=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
|
|
31
31
|
//! version : 2.30.1
|
|
32
32
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
33
33
|
//! license : MIT
|
|
34
34
|
//! momentjs.com
|
|
35
|
-
var _r;function R(){return _r.apply(null,arguments)}function oi(e){_r=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Tt(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 at(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function
|
|
35
|
+
var _r;function R(){return _r.apply(null,arguments)}function oi(e){_r=e}function Be(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Tt(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 at(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ns(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function br(e,t){var n=[],r,l=e.length;for(r=0;r<l;++r)n.push(t(e[r],r));return n}function Nt(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 Je(e,t,n,r){return Qr(e,t,n,r,!0).utc()}function ci(){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 ne(e){return e._pf==null&&(e._pf=ci()),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=ne(e),n=bn.call(t.parsedDateParts,function(l){return l!=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=Je(NaN);return e!=null?Nt(ne(t),e):ne(t).userInvalidated=!0,t}var Sr=R.momentProperties=[],Tn=!1;function wn(e,t){var n,r,l,o=Sr.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=ne(t)),Ee(t._locale)||(e._locale=t._locale),o>0)for(n=0;n<o;n++)r=Sr[n],l=t[r],Ee(l)||(e[r]=l);return e}function rs(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,R.updateOffset(this),Tn=!1)}function Ge(e){return e instanceof rs||e!=null&&e._isAMomentObject!=null}function Tr(e){R.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function Ue(e,t){var n=!0;return Nt(function(){if(R.deprecationHandler!=null&&R.deprecationHandler(null,e),n){var r=[],l,o,a,m=arguments.length;for(o=0;o<m;o++){if(l="",typeof arguments[o]=="object"){l+=`
|
|
36
36
|
[`+o+"] ";for(a in arguments[0])oe(arguments[0],a)&&(l+=a+": "+arguments[0][a]+", ");l=l.slice(0,-2)}else l=arguments[o];r.push(l)}Tr(e+`
|
|
37
37
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
38
|
-
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var wr={};function Ir(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),wr[e]||(Tr(t),wr[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Xe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function di(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Xe(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=Nt({},e),r;for(r in t)oe(t,r)&&(Tt(e[r])&&Tt(t[r])?(n[r]={},Nt(n[r],e[r]),Nt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&Tt(e[r])&&(n[r]=Nt({},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 hi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ui(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Xe(r)?r.call(t,n):r}function et(e,t,n){var r=""+Math.abs(e),l=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,l)).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={},Pt={};function K(e,t,n,r){var l=r;typeof r=="string"&&(l=function(){return this[r]()}),e&&(Pt[e]=l),t&&(Pt[t[0]]=function(){return et(l.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(l.apply(this,arguments),e)})}function mi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function fi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=mi(t[n]);return function(l){var o="",a;for(a=0;a<r;a++)o+=Xe(t[a])?t[a].call(l,e):t[a];return o}}function As(e,t){return e.isValid()?(t=Cr(t,e.localeData()),An[t]=An[t]||fi(t),An[t](e)):e.localeData().invalidDate()}function Cr(e,t){var n=5;function r(l){return t.longDateFormat(l)||l}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var pi={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 yi(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 gi="Invalid date";function xi(){return this._invalidDate}var Ni="%d",ji=/\d{1,2}/;function vi(e){return this._ordinal.replace("%d",e)}var _i={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 bi(e,t,n,r){var l=this._relativeTime[n];return Xe(l)?l(e,t,n,r):l.replace(/%d/i,e)}function Si(e,t){var n=this._relativeTime[e>0?"future":"past"];return Xe(n)?n(t):n.replace(/%s/i,t)}var Or={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 $e(e){return typeof e=="string"?Or[e]||Or[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var Ti={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 wi(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Ti[n]});return t.sort(function(r,l){return r.priority-l.priority}),t}var Mr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,pe=/\d\d?/,Er=/\d\d\d\d?/,Rr=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Ft=/\d+/,ks=/[+-]?\d+/,Ii=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ci=/[+-]?\d+(\.\d{1,3})?/,rs=/[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,Dt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function B(e,t,n){Fs[e]=Xe(t)?t:function(r,l){return r&&n?n:t}}function Oi(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Mi(e))}function Mi(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,l,o){return n||r||l||o}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function He(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ae(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=He(t)),n}var Pn={};function me(e,t){var n,r=t,l;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(o,a){a[t]=ae(o)}),l=e.length,n=0;n<l;n++)Pn[e[n]]=r}function as(e,t){me(e,function(n,r,l,o){l._w=l._w||{},t(n,l._w,l,o)})}function Ai(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 Ie=0,lt=1,tt=2,Te=3,We=4,ot=5,wt=6,Ei=7,Ri=8;K("Y",0,0,function(){var e=this.year();return e<=9999?et(e,4):"+"+e}),K(0,["YY",2],0,function(){return this.year()%100}),K(0,["YYYY",4],0,"year"),K(0,["YYYYY",5],0,"year"),K(0,["YYYYYY",6,!0],0,"year"),B("Y",ks),B("YY",pe,Pe),B("YYYY",Ln,Rn),B("YYYYY",Ls,Es),B("YYYYYY",Ls,Es),me(["YYYYY","YYYYYY"],Ie),me("YYYY",function(e,t){t[Ie]=e.length===2?R.parseTwoDigitYear(e):ae(e)}),me("YY",function(e,t){t[Ie]=R.parseTwoDigitYear(e)}),me("Y",function(e,t){t[Ie]=parseInt(e,10)});function is(e){return Ds(e)?366:365}R.parseTwoDigitYear=function(e){return ae(e)+(ae(e)>68?1900:2e3)};var Lr=Yt("FullYear",!0);function Li(){return Ds(this.year())}function Yt(e,t){return function(n){return n!=null?(kr(this,e,n),R.updateOffset(this,t),this):ls(this,e)}}function ls(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 kr(e,t,n){var r,l,o,a,m;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,l=e._isUTC,t){case"Milliseconds":return void(l?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(l?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(l?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(l?r.setUTCHours(n):r.setHours(n));case"Date":return void(l?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,a=e.month(),m=e.date(),m=m===29&&a===1&&!Ds(o)?28:m,l?r.setUTCFullYear(o,a,m):r.setFullYear(o,a,m)}}function ki(e){return e=$e(e),Xe(this[e])?this[e]():this}function Pi(e,t){if(typeof e=="object"){e=En(e);var n=wi(e),r,l=n.length;for(r=0;r<l;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),Xe(this[e]))return this[e](t);return this}function Fi(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=Fi(t,12);return e+=(t-n)/12,n===1?Ds(e)?29:28:31-n%7%2}K("M",["MM",2],"Mo",function(){return this.month()+1}),K("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),K("MMMM",0,0,function(e){return this.localeData().months(this,e)}),B("M",pe,Dt),B("MM",pe,Pe),B("MMM",function(e,t){return t.monthsShortRegex(e)}),B("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[lt]=ae(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var l=n._locale.monthsParse(e,r,n._strict);l!=null?t[lt]=l:ne(n).invalidMonth=e});var Di="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=rs,Ui=rs;function $i(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function Hi(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bi(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=Je([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(l=je.call(this._shortMonthsParse,a),l!==-1?l:null):(l=je.call(this._longMonthsParse,a),l!==-1?l:null):t==="MMM"?(l=je.call(this._shortMonthsParse,a),l!==-1?l:(l=je.call(this._longMonthsParse,a),l!==-1?l:null)):(l=je.call(this._longMonthsParse,a),l!==-1?l:(l=je.call(this._shortMonthsParse,a),l!==-1?l:null))}function Gi(e,t,n){var r,l,o;if(this._monthsParseExact)return Bi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(l=Je([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(l,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(l,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(l,"")+"|^"+this.monthsShort(l,""),this._monthsParse[r]=new RegExp(o.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 Dr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=ae(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 Yr(e){return e!=null?(Dr(this,e),R.updateOffset(this,!0),this):ls(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Vi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Ui),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Ur(){function e(u,i){return i.length-u.length}var t=[],n=[],r=[],l,o,a,m;for(l=0;l<12;l++)o=Je([2e3,l]),a=it(this.monthsShort(o,"")),m=it(this.months(o,"")),t.push(a),n.push(m),r.push(m),r.push(a);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 qi(e,t,n,r,l,o,a){var m;return e<100&&e>=0?(m=new Date(e+400,t,n,r,l,o,a),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,n,r,l,o,a),m}function os(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,l=(7+os(e,0,r).getUTCDay()-t)%7;return-l+r-1}function $r(e,t,n,r,l){var o=(7+n-r)%7,a=Ys(e,r,l),m=1+7*(t-1)+o+a,u,i;return m<=0?(u=e-1,i=is(u)+m):m>is(e)?(u=e+1,i=m-is(e)):(u=e,i=m),{year:u,dayOfYear:i}}function cs(e,t,n){var r=Ys(e.year(),t,n),l=Math.floor((e.dayOfYear()-r-1)/7)+1,o,a;return l<1?(a=e.year()-1,o=l+ct(a,t,n)):l>ct(e.year(),t,n)?(o=l-ct(e.year(),t,n),a=e.year()+1):(a=e.year(),o=l),{week:o,year:a}}function ct(e,t,n){var r=Ys(e,t,n),l=Ys(e+1,t,n);return(is(e)-r+l)/7}K("w",["ww",2],"wo","week"),K("W",["WW",2],"Wo","isoWeek"),B("w",pe,Dt),B("ww",pe,Pe),B("W",pe,Dt),B("WW",pe,Pe),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=ae(e)});function Ki(e){return cs(e,this._week.dow,this._week.doy).week}var Qi={dow:0,doy:6};function Zi(){return this._week.dow}function Ji(){return this._week.doy}function Xi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function el(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}K("d",0,"do","day"),K("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),K("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),K("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),K("e",0,0,"weekday"),K("E",0,0,"isoWeekday"),B("d",pe),B("e",pe),B("E",pe),B("dd",function(e,t){return t.weekdaysMinRegex(e)}),B("ddd",function(e,t){return t.weekdaysShortRegex(e)}),B("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var l=n._locale.weekdaysParse(e,r,n._strict);l!=null?t.d=l:ne(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=ae(e)});function tl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function sl(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 nl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),al=rs,il=rs,ll=rs;function ol(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 cl(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function dl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function hl(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=Je([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(l=je.call(this._weekdaysParse,a),l!==-1?l:null):t==="ddd"?(l=je.call(this._shortWeekdaysParse,a),l!==-1?l:null):(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null):t==="dddd"?(l=je.call(this._weekdaysParse,a),l!==-1||(l=je.call(this._shortWeekdaysParse,a),l!==-1)?l:(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null)):t==="ddd"?(l=je.call(this._shortWeekdaysParse,a),l!==-1||(l=je.call(this._weekdaysParse,a),l!==-1)?l:(l=je.call(this._minWeekdaysParse,a),l!==-1?l:null)):(l=je.call(this._minWeekdaysParse,a),l!==-1||(l=je.call(this._weekdaysParse,a),l!==-1)?l:(l=je.call(this._shortWeekdaysParse,a),l!==-1?l:null))}function ul(e,t,n){var r,l,o;if(this._weekdaysParseExact)return hl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(l=Je([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(l,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(l,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(l,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(l,"")+"|^"+this.weekdaysShort(l,"")+"|^"+this.weekdaysMin(l,""),this._weekdaysParse[r]=new RegExp(o.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 ml(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=tl(e,this.localeData()),this.add(e-t,"d")):t}function fl(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 pl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=sl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=al),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=il),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ll),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],l=[],o,a,m,u,i;for(o=0;o<7;o++)a=Je([2e3,1]).day(o),m=it(this.weekdaysMin(a,"")),u=it(this.weekdaysShort(a,"")),i=it(this.weekdays(a,"")),t.push(m),n.push(u),r.push(i),l.push(m),l.push(u),l.push(i);t.sort(e),n.sort(e),r.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.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 Nl(){return this.hours()||24}K("H",["HH",2],0,"hour"),K("h",["hh",2],0,Un),K("k",["kk",2],0,Nl),K("hmm",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)}),K("hmmss",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)+et(this.seconds(),2)}),K("Hmm",0,0,function(){return""+this.hours()+et(this.minutes(),2)}),K("Hmmss",0,0,function(){return""+this.hours()+et(this.minutes(),2)+et(this.seconds(),2)});function Br(e,t){K(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Br("a",!0),Br("A",!1);function Gr(e,t){return t._meridiemParse}B("a",Gr),B("A",Gr),B("H",pe,kn),B("h",pe,Dt),B("k",pe,Dt),B("HH",pe,Pe),B("hh",pe,Pe),B("kk",pe,Pe),B("hmm",Er),B("hmmss",Rr),B("Hmm",Er),B("Hmmss",Rr),me(["H","HH"],Te),me(["k","kk"],function(e,t,n){var r=ae(e);t[Te]=r===24?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[Te]=ae(e),ne(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r)),ne(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l)),ne(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l))});function jl(e){return(e+"").toLowerCase().charAt(0)==="p"}var vl=/[ap]\.?m?\.?/i,_l=Yt("Hours",!0);function bl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:hi,longDateFormat:pi,invalidDate:gi,ordinal:Ni,dayOfMonthOrdinalParse:ji,relativeTime:_i,months:Di,monthsShort:Pr,week:Qi,weekdays:nl,weekdaysMin:rl,weekdaysShort:Hr,meridiemParse:vl},xe={},ds={},hs;function Sl(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 Tl(e){for(var t=0,n,r,l,o;t<e.length;){for(o=zr(e[t]).split("-"),n=o.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(l=Us(o.slice(0,n).join("-")),l)return l;if(r&&r.length>=n&&Sl(o,r)>=n-1)break;n--}t++}return hs}function wl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&wl(e))try{t=hs._abbr,n=require,n("./locale/"+e),jt(t)}catch{xe[e]=null}return xe[e]}function jt(e,t){var n;return e&&(Ee(t)?n=dt(e):n=$n(e,t),n?hs=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),hs._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,xe[e]!=null)Ir("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=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return ds[t.parentLocale]||(ds[t.parentLocale]=[]),ds[t.parentLocale].push({name:e,config:t}),null;return xe[e]=new Cn(In(r,t)),ds[e]&&ds[e].forEach(function(l){$n(l.name,l.config)}),jt(e),xe[e]}else return delete xe[e],null}function Il(e,t){if(t!=null){var n,r,l=Wr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(In(xe[e]._config,t)):(r=Us(e),r!=null&&(l=r._config),t=In(l,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=xe[e],xe[e]=n),jt(e)}else xe[e]!=null&&(xe[e].parentLocale!=null?(xe[e]=xe[e].parentLocale,e===jt()&&jt(e)):xe[e]!=null&&delete xe[e]);return xe[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Tl(e)}function Cl(){return On(xe)}function Hn(e){var t,n=e._a;return n&&ne(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[tt]<1||n[tt]>Fn(n[Ie],n[lt])?tt:n[Te]<0||n[Te]>24||n[Te]===24&&(n[We]!==0||n[ot]!==0||n[wt]!==0)?Te:n[We]<0||n[We]>59?We:n[ot]<0||n[ot]>59?ot:n[wt]<0||n[wt]>999?wt:-1,ne(e)._overflowDayOfYear&&(t<Ie||t>tt)&&(t=tt),ne(e)._overflowWeeks&&t===-1&&(t=Ei),ne(e)._overflowWeekday&&t===-1&&(t=Ri),ne(e).overflow=t),e}var 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=/^\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)?)?$/,Al=/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/]],El=/^\/?Date\((-?\d+)/i,Rl=/^(?:(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}))$/,Ll={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 Vr(e){var t,n,r=e._i,l=Ol.exec(r)||Ml.exec(r),o,a,m,u,i=$s.length,c=Bn.length;if(l){for(ne(e).iso=!0,t=0,n=i;t<n;t++)if($s[t][1].exec(l[1])){a=$s[t][0],o=$s[t][2]!==!1;break}if(a==null){e._isValid=!1;return}if(l[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(l[3])){m=(l[2]||" ")+Bn[t][0];break}if(m==null){e._isValid=!1;return}}if(!o&&m!=null){e._isValid=!1;return}if(l[4])if(Al.exec(l[4]))u="Z";else{e._isValid=!1;return}e._f=a+(m||"")+(u||""),Wn(e)}else e._isValid=!1}function kl(e,t,n,r,l,o){var a=[Pl(e),Pr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(l,10)];return o&&a.push(parseInt(o,10)),a}function Pl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Fl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dl(e,t,n){if(e){var r=Hr.indexOf(e),l=new Date(t[0],t[1],t[2]).getDay();if(r!==l)return ne(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return Ll[e];if(t)return 0;var r=parseInt(n,10),l=r%100,o=(r-l)/100;return o*60+l}function qr(e){var t=Rl.exec(Fl(e._i)),n;if(t){if(n=kl(t[4],t[3],t[2],t[5],t[6],t[7]),!Dl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ne(e).rfc2822=!0}else e._isValid=!1}function Ul(e){var t=El.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Vr(e),e._isValid===!1)delete e._isValid;else return;if(qr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=Ue("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 Ut(e,t,n){return e??t??n}function $l(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Gn(e){var t,n,r=[],l,o,a;if(!e._d){for(l=$l(e),e._w&&e._a[tt]==null&&e._a[lt]==null&&Hl(e),e._dayOfYear!=null&&(a=Ut(e._a[Ie],l[Ie]),(e._dayOfYear>is(a)||e._dayOfYear===0)&&(ne(e)._overflowDayOfYear=!0),n=os(a,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[tt]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=l[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[We]===0&&e._a[ot]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?os:qi).apply(null,r),o=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!==o&&(ne(e).weekdayMismatch=!0)}}function Hl(e){var t,n,r,l,o,a,m,u,i;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,a=4,n=Ut(t.GG,e._a[Ie],cs(ye(),1,4).year),r=Ut(t.W,1),l=Ut(t.E,1),(l<1||l>7)&&(u=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,i=cs(ye(),o,a),n=Ut(t.gg,e._a[Ie],i.year),r=Ut(t.w,i.week),t.d!=null?(l=t.d,(l<0||l>6)&&(u=!0)):t.e!=null?(l=t.e+o,(t.e<0||t.e>6)&&(u=!0)):l=o),r<1||r>ct(n,o,a)?ne(e)._overflowWeeks=!0:u!=null?ne(e)._overflowWeekday=!0:(m=$r(n,r,l,o,a),e._a[Ie]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Wn(e){if(e._f===R.ISO_8601){Vr(e);return}if(e._f===R.RFC_2822){qr(e);return}e._a=[],ne(e).empty=!0;var t=""+e._i,n,r,l,o,a,m=t.length,u=0,i,c;for(l=Cr(e._f,e._locale).match(Mn)||[],c=l.length,n=0;n<c;n++)o=l[n],r=(t.match(Oi(o,e))||[])[0],r&&(a=t.substr(0,t.indexOf(r)),a.length>0&&ne(e).unusedInput.push(a),t=t.slice(t.indexOf(r)+r.length),u+=r.length),Pt[o]?(r?ne(e).empty=!1:ne(e).unusedTokens.push(o),Ai(o,r,e)):e._strict&&!r&&ne(e).unusedTokens.push(o);ne(e).charsLeftOver=m-u,t.length>0&&ne(e).unusedInput.push(t),e._a[Te]<=12&&ne(e).bigHour===!0&&e._a[Te]>0&&(ne(e).bigHour=void 0),ne(e).parsedDateParts=e._a.slice(0),ne(e).meridiem=e._meridiem,e._a[Te]=Bl(e._locale,e._a[Te],e._meridiem),i=ne(e).era,i!==null&&(e._a[Ie]=e._locale.erasConvertYear(i,e._a[Ie])),Gn(e),Hn(e)}function Bl(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 Gl(e){var t,n,r,l,o,a,m=!1,u=e._f.length;if(u===0){ne(e).invalidFormat=!0,e._d=new Date(NaN);return}for(l=0;l<u;l++)o=0,a=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[l],Wn(t),Sn(t)&&(a=!0),o+=ne(t).charsLeftOver,o+=ne(t).unusedTokens.length*10,ne(t).score=o,m?o<r&&(r=o,n=t):(r==null||o<r||a)&&(r=o,n=t,a&&(m=!0));Nt(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=br([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Gn(e)}}function zl(e){var t=new ns(Hn(Kr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Kr(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)),Ge(t)?new ns(Hn(t)):(ss(t)?e._d=t:Be(n)?Gl(e):n?Wn(e):Vl(e),Sn(e)||(e._d=null),e))}function Vl(e){var t=e._i;Ee(t)?e._d=new Date(R.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Ul(e):Be(t)?(e._a=br(t.slice(0),function(n){return parseInt(n,10)}),Gn(e)):Tt(t)?Wl(e):at(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Qr(e,t,n,r,l){var o={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Tt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=l,o._l=n,o._i=e,o._f=t,o._strict=r,zl(o)}function ye(e,t,n,r){return Qr(e,t,n,r,!1)}var ql=Ue("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),Kl=Ue("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Zr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return ye();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Ql(){var e=[].slice.call(arguments,0);return Zr("isBefore",e)}function Zl(){var e=[].slice.call(arguments,0);return Zr("isAfter",e)}var Jl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Xl(e){var t,n=!1,r,l=us.length;for(t in e)if(oe(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<l;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==ae(e[us[r]])&&(n=!0)}return!0}function eo(){return this._isValid}function to(){return ze(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,l=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,m=t.hour||0,u=t.minute||0,i=t.second||0,c=t.millisecond||0;this._isValid=Xl(t),this._milliseconds=+c+i*1e3+u*6e4+m*1e3*60*60,this._days=+a+o*7,this._months=+l+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Bs(e){return e instanceof Hs}function zn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function so(e,t,n){var r=Math.min(e.length,t.length),l=Math.abs(e.length-t.length),o=0,a;for(a=0;a<r;a++)ae(e[a])!==ae(t[a])&&o++;return o+l}function Jr(e,t){K(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+et(~~(n/60),2)+t+et(~~n%60,2)})}Jr("Z",":"),Jr("ZZ",""),B("Z",Ps),B("ZZ",Ps),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var no=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,l,o;return n===null?null:(r=n[n.length-1]||[],l=(r+"").match(no)||["-",0,0],o=+(l[1]*60)+ae(l[2]),o===0?0:l[0]==="+"?o:-o)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ge(e)||ss(e)?e.valueOf():ye(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):ye(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function ro(e,t,n){var r=this._offset||0,l;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&&(l=Kn(this)),this._offset=e,this._isUTC=!0,l!=null&&this.add(l,"m"),r!==e&&(!t||this._changeInProgress?sa(this,ze(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ao(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function io(e){return this.utcOffset(0,e)}function lo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function oo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(Ii,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function co(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ho(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uo(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=Kr(e),e._a?(t=e._isUTC?Je(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&so(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function mo(){return this.isValid()?!this._isUTC:!1}function fo(){return this.isValid()?this._isUTC:!1}function Xr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var po=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,yo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(e,t){var n=e,r=null,l,o,a;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=po.exec(e))?(l=r[1]==="-"?-1:1,n={y:0,d:ae(r[tt])*l,h:ae(r[Te])*l,m:ae(r[We])*l,s:ae(r[ot])*l,ms:ae(zn(r[wt]*1e3))*l}):(r=yo.exec(e))?(l=r[1]==="-"?-1:1,n={y:It(r[2],l),M:It(r[3],l),w:It(r[4],l),d:It(r[5],l),h:It(r[6],l),m:It(r[7],l),s:It(r[8],l)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=go(ye(n.from),ye(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),o=new Hs(n),Bs(e)&&oe(e,"_locale")&&(o._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(o._isValid=e._isValid),o}ze.fn=Hs.prototype,ze.invalid=to;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ea(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 go(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=ea(e,t):(n=ea(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ta(e,t){return function(n,r){var l,o;return r!==null&&!isNaN(+r)&&(Ir(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."),o=n,n=r,r=o),l=ze(n,r),sa(this,l,e),this}}function sa(e,t,n,r){var l=t._milliseconds,o=zn(t._days),a=zn(t._months);e.isValid()&&(r=r??!0,a&&Dr(e,ls(e,"Month")+a*n),o&&kr(e,"Date",ls(e,"Date")+o*n),l&&e._d.setTime(e._d.valueOf()+l*n),r&&R.updateOffset(e,o||a))}var xo=ta(1,"add"),No=ta(-1,"subtract");function na(e){return typeof e=="string"||e instanceof String}function jo(e){return Ge(e)||ss(e)||na(e)||at(e)||_o(e)||vo(e)||e===null||e===void 0}function vo(e){var t=Tt(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"],l,o,a=r.length;for(l=0;l<a;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function _o(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&na(e)}).length===0),t&&n}function bo(e){var t=Tt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],l,o;for(l=0;l<r.length;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function So(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 To(e,t){arguments.length===1&&(arguments[0]?jo(arguments[0])?(e=arguments[0],t=void 0):bo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=qn(n,this).startOf("day"),l=R.calendarFormat(this,r)||"sameElse",o=t&&(Xe(t[l])?t[l].call(this,n):t[l]);return this.format(o||this.localeData().calendar(l,this,ye(n)))}function wo(){return new ns(this)}function Io(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Co(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Oo(e,t,n,r){var l=Ge(e)?e:ye(e),o=Ge(t)?t:ye(t);return this.isValid()&&l.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(l,n):!this.isBefore(l,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Mo(e,t){var n=Ge(e)?e:ye(e),r;return this.isValid()&&n.isValid()?(t=$e(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 Ao(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Eo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ro(e,t,n){var r,l,o;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(l=(r.utcOffset()-this.utcOffset())*6e4,t=$e(t),t){case"year":o=Gs(this,r)/12;break;case"month":o=Gs(this,r);break;case"quarter":o=Gs(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-l)/864e5;break;case"week":o=(this-r-l)/6048e5;break;default:o=this-r}return n?o:He(o)}function Gs(e,t){if(e.date()<t.date())return-Gs(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),l,o;return t-r<0?(l=e.clone().add(n-1,"months"),o=(t-r)/(r-l)):(l=e.clone().add(n+1,"months"),o=(t-r)/(l-r)),-(n+o)||0}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Lo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ko(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"):Xe(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 Po(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,l,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",l="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+r+l+o)}function Fo(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.from(ye(),e)}function Uo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $o(e){return this.to(ye(),e)}function ra(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var aa=Ue("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 ia(){return this._locale}var Ws=1e3,$t=60*Ws,zs=60*$t,la=(365*400+97)*24*zs;function Ht(e,t){return(e%t+t)%t}function oa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-la:new Date(e,t,n).valueOf()}function ca(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-la:Date.UTC(e,t,n)}function Ho(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,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-=Ht(t+(this._isUTC?0:this.utcOffset()*$t),zs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Ws);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Bo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,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+=zs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),zs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Ws-Ht(t,Ws)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Go(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Vo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function qo(){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 Ko(){return this.isValid()?this.toISOString():null}function Qo(){return Sn(this)}function Zo(){return Nt({},ne(this))}function Jo(){return ne(this).overflow}function Xo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}K("N",0,0,"eraAbbr"),K("NN",0,0,"eraAbbr"),K("NNN",0,0,"eraAbbr"),K("NNNN",0,0,"eraName"),K("NNNNN",0,0,"eraNarrow"),K("y",["y",1],"yo","eraYear"),K("y",["yy",2],0,"eraYear"),K("y",["yyy",3],0,"eraYear"),K("y",["yyyy",4],0,"eraYear"),B("N",Qn),B("NN",Qn),B("NNN",Qn),B("NNNN",dc),B("NNNNN",hc),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var l=n._locale.erasParse(e,r,n._strict);l?ne(n).era=l:ne(n).invalidEra=e}),B("y",Ft),B("yy",Ft),B("yyy",Ft),B("yyyy",Ft),B("yo",uc),me(["y","yy","yyy","yyyy"],Ie),me(["yo"],function(e,t,n,r){var l;n._locale._eraYearOrdinalRegex&&(l=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ie]=n._locale.eraYearOrdinalParse(e,l):t[Ie]=parseInt(e,10)});function ec(e,t){var n,r,l,o=this._eras||dt("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":l=R(o[n].since).startOf("day"),o[n].since=l.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":l=R(o[n].until).startOf("day").valueOf(),o[n].until=l.valueOf();break}}return o}function tc(e,t,n){var r,l,o=this.eras(),a,m,u;for(e=e.toUpperCase(),r=0,l=o.length;r<l;++r)if(a=o[r].name.toUpperCase(),m=o[r].abbr.toUpperCase(),u=o[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(m===e)return o[r];break;case"NNNN":if(a===e)return o[r];break;case"NNNNN":if(u===e)return o[r];break}else if([a,m,u].indexOf(e)>=0)return o[r]}function sc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}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].name;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].narrow;return""}function ac(){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 ic(){var e,t,n,r,l=this.localeData().eras();for(e=0,t=l.length;e<t;++e)if(n=l[e].since<=l[e].until?1:-1,r=this.clone().startOf("day").valueOf(),l[e].since<=r&&r<=l[e].until||l[e].until<=r&&r<=l[e].since)return(this.year()-R(l[e].since).year())*n+l[e].offset;return this.year()}function lc(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function oc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function cc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function dc(e,t){return t.erasNameRegex(e)}function hc(e,t){return t.erasNarrowRegex(e)}function uc(e,t){return t._eraYearOrdinalRegex||Ft}function Zn(){var e=[],t=[],n=[],r=[],l,o,a,m,u,i=this.eras();for(l=0,o=i.length;l<o;++l)a=it(i[l].name),m=it(i[l].abbr),u=it(i[l].narrow),t.push(a),e.push(m),n.push(u),r.push(a),r.push(m),r.push(u);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")}K(0,["gg",2],0,function(){return this.weekYear()%100}),K(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Vs(e,t){K(0,[e,e.length],0,t)}Vs("gggg","weekYear"),Vs("ggggg","weekYear"),Vs("GGGG","isoWeekYear"),Vs("GGGGG","isoWeekYear"),B("G",ks),B("g",ks),B("GG",pe,Pe),B("gg",pe,Pe),B("GGGG",Ln,Rn),B("gggg",Ln,Rn),B("GGGGG",Ls,Es),B("ggggg",Ls,Es),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=ae(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function mc(e){return da.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function fc(e){return da.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function pc(){return ct(this.year(),1,4)}function yc(){return ct(this.isoWeekYear(),1,4)}function gc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function xc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function da(e,t,n,r,l){var o;return e==null?cs(this,r,l).year:(o=ct(e,r,l),t>o&&(t=o),Nc.call(this,e,t,n,r,l))}function Nc(e,t,n,r,l){var o=$r(e,t,n,r,l),a=os(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}K("Q",0,"Qo","quarter"),B("Q",Mr),me("Q",function(e,t){t[lt]=(ae(e)-1)*3});function jc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}K("D",["DD",2],"Do","date"),B("D",pe,Dt),B("DD",pe,Pe),B("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],tt),me("Do",function(e,t){t[tt]=ae(e.match(pe)[0])});var ha=Yt("Date",!0);K("DDD",["DDDD",3],"DDDo","dayOfYear"),B("DDD",Rs),B("DDDD",Ar),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ae(e)});function vc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}K("m",["mm",2],0,"minute"),B("m",pe,kn),B("mm",pe,Pe),me(["m","mm"],We);var _c=Yt("Minutes",!1);K("s",["ss",2],0,"second"),B("s",pe,kn),B("ss",pe,Pe),me(["s","ss"],ot);var bc=Yt("Seconds",!1);K("S",0,0,function(){return~~(this.millisecond()/100)}),K(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),K(0,["SSS",3],0,"millisecond"),K(0,["SSSS",4],0,function(){return this.millisecond()*10}),K(0,["SSSSS",5],0,function(){return this.millisecond()*100}),K(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),K(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),K(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),K(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),B("S",Rs,Mr),B("SS",Rs,Pe),B("SSS",Rs,Ar);var vt,ua;for(vt="SSSS";vt.length<=9;vt+="S")B(vt,Ft);function Sc(e,t){t[wt]=ae(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,Sc);ua=Yt("Milliseconds",!1),K("z",0,0,"zoneAbbr"),K("zz",0,0,"zoneName");function Tc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}var M=ns.prototype;M.add=xo,M.calendar=To,M.clone=wo,M.diff=Ro,M.endOf=Bo,M.format=Fo,M.from=Do,M.fromNow=Yo,M.to=Uo,M.toNow=$o,M.get=ki,M.invalidAt=Jo,M.isAfter=Io,M.isBefore=Co,M.isBetween=Oo,M.isSame=Mo,M.isSameOrAfter=Ao,M.isSameOrBefore=Eo,M.isValid=Qo,M.lang=aa,M.locale=ra,M.localeData=ia,M.max=Kl,M.min=ql,M.parsingFlags=Zo,M.set=Pi,M.startOf=Ho,M.subtract=No,M.toArray=Vo,M.toObject=qo,M.toDate=zo,M.toISOString=ko,M.inspect=Po,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=Ko,M.toString=Lo,M.unix=Wo,M.valueOf=Go,M.creationData=Xo,M.eraName=nc,M.eraNarrow=rc,M.eraAbbr=ac,M.eraYear=ic,M.year=Lr,M.isLeapYear=Li,M.weekYear=mc,M.isoWeekYear=fc,M.quarter=M.quarters=jc,M.month=Yr,M.daysInMonth=Wi,M.week=M.weeks=Xi,M.isoWeek=M.isoWeeks=el,M.weeksInYear=gc,M.weeksInWeekYear=xc,M.isoWeeksInYear=pc,M.isoWeeksInISOWeekYear=yc,M.date=ha,M.day=M.days=ml,M.weekday=fl,M.isoWeekday=pl,M.dayOfYear=vc,M.hour=M.hours=_l,M.minute=M.minutes=_c,M.second=M.seconds=bc,M.millisecond=M.milliseconds=ua,M.utcOffset=ro,M.utc=io,M.local=lo,M.parseZone=oo,M.hasAlignedHourOffset=co,M.isDST=ho,M.isLocal=mo,M.isUtcOffset=fo,M.isUtc=Xr,M.isUTC=Xr,M.zoneAbbr=Tc,M.zoneName=wc,M.dates=Ue("dates accessor is deprecated. Use date instead.",ha),M.months=Ue("months accessor is deprecated. Use month instead",Yr),M.years=Ue("years accessor is deprecated. Use year instead",Lr),M.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ao),M.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uo);function Ic(e){return ye(e*1e3)}function Cc(){return ye.apply(null,arguments).parseZone()}function ma(e){return e}var ce=Cn.prototype;ce.calendar=ui,ce.longDateFormat=yi,ce.invalidDate=xi,ce.ordinal=vi,ce.preparse=ma,ce.postformat=ma,ce.relativeTime=bi,ce.pastFuture=Si,ce.set=di,ce.eras=ec,ce.erasParse=tc,ce.erasConvertYear=sc,ce.erasAbbrRegex=oc,ce.erasNameRegex=lc,ce.erasNarrowRegex=cc,ce.months=$i,ce.monthsShort=Hi,ce.monthsParse=Gi,ce.monthsRegex=Vi,ce.monthsShortRegex=zi,ce.week=Ki,ce.firstDayOfYear=Ji,ce.firstDayOfWeek=Zi,ce.weekdays=ol,ce.weekdaysMin=dl,ce.weekdaysShort=cl,ce.weekdaysParse=ul,ce.weekdaysRegex=yl,ce.weekdaysShortRegex=gl,ce.weekdaysMinRegex=xl,ce.isPM=jl,ce.meridiem=bl;function qs(e,t,n,r){var l=dt(),o=Je().set(r,t);return l[n](o,e)}function fa(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,l=[];for(r=0;r<12;r++)l[r]=qs(e,r,n,"month");return l}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 l=dt(),o=e?l._week.dow:0,a,m=[];if(n!=null)return qs(t,(n+o)%7,r,"day");for(a=0;a<7;a++)m[a]=qs(t,(a+o)%7,r,"day");return m}function Oc(e,t){return fa(e,t,"months")}function Mc(e,t){return fa(e,t,"monthsShort")}function Ac(e,t,n){return Jn(e,t,n,"weekdays")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Rc(e,t,n){return Jn(e,t,n,"weekdaysMin")}jt("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=ae(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),R.lang=Ue("moment.lang is deprecated. Use moment.locale instead.",jt),R.langData=Ue("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Lc(){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 pa(e,t,n,r){var l=ze(t,n);return e._milliseconds+=r*l._milliseconds,e._days+=r*l._days,e._months+=r*l._months,e._bubble()}function kc(e,t){return pa(this,e,t,1)}function Pc(e,t){return pa(this,e,t,-1)}function ya(e){return e<0?Math.floor(e):Math.ceil(e)}function Fc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,l,o,a,m,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ya(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,l=He(e/1e3),r.seconds=l%60,o=He(l/60),r.minutes=o%60,a=He(o/60),r.hours=a%24,t+=He(a/24),u=He(ga(t)),n+=u,t-=ya(Xn(u)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function ga(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=$e(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ga(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 xa=ut("ms"),Yc=ut("s"),Uc=ut("m"),$c=ut("h"),Hc=ut("d"),Bc=ut("w"),Gc=ut("M"),Wc=ut("Q"),zc=ut("y"),Vc=xa;function qc(){return ze(this)}function Kc(e){return e=$e(e),this.isValid()?this[e+"s"]():NaN}function Ct(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qc=Ct("milliseconds"),Zc=Ct("seconds"),Jc=Ct("minutes"),Xc=Ct("hours"),ed=Ct("days"),td=Ct("months"),sd=Ct("years");function nd(){return He(this.days()/7)}var mt=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rd(e,t,n,r,l){return l.relativeTime(t||1,!!n,e,r)}function ad(e,t,n,r){var l=ze(e).abs(),o=mt(l.as("s")),a=mt(l.as("m")),m=mt(l.as("h")),u=mt(l.as("d")),i=mt(l.as("M")),c=mt(l.as("w")),h=mt(l.as("y")),f=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||a<=1&&["m"]||a<n.m&&["mm",a]||m<=1&&["h"]||m<n.h&&["hh",m]||u<=1&&["d"]||u<n.d&&["dd",u];return n.w!=null&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),f=f||i<=1&&["M"]||i<n.M&&["MM",i]||h<=1&&["y"]||["yy",h],f[2]=t,f[3]=+e>0,f[4]=r,rd.apply(null,f)}function id(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function ld(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function od(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,l,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},Bt,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),l=this.localeData(),o=ad(this,!n,r,l),n&&(o=l.pastFuture(+this,o)),l.postformat(o)}var er=Math.abs;function Gt(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,l,o,a,m=this.asSeconds(),u,i,c,h;return m?(r=He(e/60),l=He(r/60),e%=60,r%=60,o=He(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=m<0?"-":"",i=Gt(this._months)!==Gt(m)?"-":"",c=Gt(this._days)!==Gt(m)?"-":"",h=Gt(this._milliseconds)!==Gt(m)?"-":"",u+"P"+(o?i+o+"Y":"")+(n?i+n+"M":"")+(t?c+t+"D":"")+(l||r||e?"T":"")+(l?h+l+"H":"")+(r?h+r+"M":"")+(e?h+a+"S":"")):"P0D"}var ie=Hs.prototype;ie.isValid=eo,ie.abs=Lc,ie.add=kc,ie.subtract=Pc,ie.as=Dc,ie.asMilliseconds=xa,ie.asSeconds=Yc,ie.asMinutes=Uc,ie.asHours=$c,ie.asDays=Hc,ie.asWeeks=Bc,ie.asMonths=Gc,ie.asQuarters=Wc,ie.asYears=zc,ie.valueOf=Vc,ie._bubble=Fc,ie.clone=qc,ie.get=Kc,ie.milliseconds=Qc,ie.seconds=Zc,ie.minutes=Jc,ie.hours=Xc,ie.days=ed,ie.weeks=nd,ie.months=td,ie.years=sd,ie.humanize=od,ie.toISOString=Ks,ie.toString=Ks,ie.toJSON=Ks,ie.locale=ra,ie.localeData=ia,ie.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ie.lang=aa,K("X",0,0,"unix"),K("x",0,0,"valueOf"),B("x",ks),B("X",Ci),me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),me("x",function(e,t,n){n._d=new Date(ae(e))});//! moment.js
|
|
39
|
-
R.version="2.30.1",oi(ye),R.fn=M,R.min=Ql,R.max=Zl,R.now=Jl,R.utc=Je,R.unix=Ic,R.months=Oc,R.isDate=
|
|
38
|
+
`+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var wr={};function Ir(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),wr[e]||(Tr(t),wr[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function Xe(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function di(e){var t,n;for(n in e)oe(e,n)&&(t=e[n],Xe(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=Nt({},e),r;for(r in t)oe(t,r)&&(Tt(e[r])&&Tt(t[r])?(n[r]={},Nt(n[r],e[r]),Nt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)oe(e,r)&&!oe(t,r)&&Tt(e[r])&&(n[r]=Nt({},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 hi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ui(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Xe(r)?r.call(t,n):r}function et(e,t,n){var r=""+Math.abs(e),l=t-r.length,o=e>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,l)).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={},Ft={};function Q(e,t,n,r){var l=r;typeof r=="string"&&(l=function(){return this[r]()}),e&&(Ft[e]=l),t&&(Ft[t[0]]=function(){return et(l.apply(this,arguments),t[1],t[2])}),n&&(Ft[n]=function(){return this.localeData().ordinal(l.apply(this,arguments),e)})}function mi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function fi(e){var t=e.match(Mn),n,r;for(n=0,r=t.length;n<r;n++)Ft[t[n]]?t[n]=Ft[t[n]]:t[n]=mi(t[n]);return function(l){var o="",a;for(a=0;a<r;a++)o+=Xe(t[a])?t[a].call(l,e):t[a];return o}}function As(e,t){return e.isValid()?(t=Cr(t,e.localeData()),An[t]=An[t]||fi(t),An[t](e)):e.localeData().invalidDate()}function Cr(e,t){var n=5;function r(l){return t.longDateFormat(l)||l}for(Ms.lastIndex=0;n>=0&&Ms.test(e);)e=e.replace(Ms,r),Ms.lastIndex=0,n-=1;return e}var pi={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 yi(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 gi="Invalid date";function xi(){return this._invalidDate}var Ni="%d",ji=/\d{1,2}/;function vi(e){return this._ordinal.replace("%d",e)}var _i={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 bi(e,t,n,r){var l=this._relativeTime[n];return Xe(l)?l(e,t,n,r):l.replace(/%d/i,e)}function Si(e,t){var n=this._relativeTime[e>0?"future":"past"];return Xe(n)?n(t):n.replace(/%s/i,t)}var Or={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 $e(e){return typeof e=="string"?Or[e]||Or[e.toLowerCase()]:void 0}function En(e){var t={},n,r;for(r in e)oe(e,r)&&(n=$e(r),n&&(t[n]=e[r]));return t}var Ti={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 wi(e){var t=[],n;for(n in e)oe(e,n)&&t.push({unit:n,priority:Ti[n]});return t.sort(function(r,l){return r.priority-l.priority}),t}var Mr=/\d/,Pe=/\d\d/,Ar=/\d{3}/,Rn=/\d{4}/,Es=/[+-]?\d{6}/,pe=/\d\d?/,Er=/\d\d\d\d?/,Rr=/\d\d\d\d\d\d?/,Rs=/\d{1,3}/,Ln=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Dt=/\d+/,ks=/[+-]?\d+/,Ii=/Z|[+-]\d\d:?\d\d/gi,Ps=/Z|[+-]\d\d(?::?\d\d)?/gi,Ci=/[+-]?\d+(\.\d{1,3})?/,as=/[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,Yt=/^[1-9]\d?/,kn=/^([1-9]\d|\d)/,Fs;Fs={};function B(e,t,n){Fs[e]=Xe(t)?t:function(r,l){return r&&n?n:t}}function Oi(e,t){return oe(Fs,e)?Fs[e](t._strict,t._locale):new RegExp(Mi(e))}function Mi(e){return it(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,l,o){return n||r||l||o}))}function it(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function He(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ae(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=He(t)),n}var Pn={};function me(e,t){var n,r=t,l;for(typeof e=="string"&&(e=[e]),at(t)&&(r=function(o,a){a[t]=ae(o)}),l=e.length,n=0;n<l;n++)Pn[e[n]]=r}function is(e,t){me(e,function(n,r,l,o){l._w=l._w||{},t(n,l._w,l,o)})}function Ai(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 Ie=0,lt=1,tt=2,Te=3,We=4,ot=5,wt=6,Ei=7,Ri=8;Q("Y",0,0,function(){var e=this.year();return e<=9999?et(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"),B("Y",ks),B("YY",pe,Pe),B("YYYY",Ln,Rn),B("YYYYY",Ls,Es),B("YYYYYY",Ls,Es),me(["YYYYY","YYYYYY"],Ie),me("YYYY",function(e,t){t[Ie]=e.length===2?R.parseTwoDigitYear(e):ae(e)}),me("YY",function(e,t){t[Ie]=R.parseTwoDigitYear(e)}),me("Y",function(e,t){t[Ie]=parseInt(e,10)});function ls(e){return Ds(e)?366:365}R.parseTwoDigitYear=function(e){return ae(e)+(ae(e)>68?1900:2e3)};var Lr=Ut("FullYear",!0);function Li(){return Ds(this.year())}function Ut(e,t){return function(n){return n!=null?(kr(this,e,n),R.updateOffset(this,t),this):os(this,e)}}function os(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 kr(e,t,n){var r,l,o,a,m;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,l=e._isUTC,t){case"Milliseconds":return void(l?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(l?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(l?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(l?r.setUTCHours(n):r.setHours(n));case"Date":return void(l?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,a=e.month(),m=e.date(),m=m===29&&a===1&&!Ds(o)?28:m,l?r.setUTCFullYear(o,a,m):r.setFullYear(o,a,m)}}function ki(e){return e=$e(e),Xe(this[e])?this[e]():this}function Pi(e,t){if(typeof e=="object"){e=En(e);var n=wi(e),r,l=n.length;for(r=0;r<l;r++)this[n[r].unit](e[n[r].unit])}else if(e=$e(e),Xe(this[e]))return this[e](t);return this}function Fi(e,t){return(e%t+t)%t}var ve;Array.prototype.indexOf?ve=Array.prototype.indexOf:ve=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=Fi(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)}),B("M",pe,Yt),B("MM",pe,Pe),B("MMM",function(e,t){return t.monthsShortRegex(e)}),B("MMMM",function(e,t){return t.monthsRegex(e)}),me(["M","MM"],function(e,t){t[lt]=ae(e)-1}),me(["MMM","MMMM"],function(e,t,n,r){var l=n._locale.monthsParse(e,r,n._strict);l!=null?t[lt]=l:ne(n).invalidMonth=e});var Di="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Pr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Yi=as,Ui=as;function $i(e,t){return e?Be(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fr).test(t)?"format":"standalone"][e.month()]:Be(this._months)?this._months:this._months.standalone}function Hi(e,t){return e?Be(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fr.test(t)?"format":"standalone"][e.month()]:Be(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Bi(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=Je([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?t==="MMM"?(l=ve.call(this._shortMonthsParse,a),l!==-1?l:null):(l=ve.call(this._longMonthsParse,a),l!==-1?l:null):t==="MMM"?(l=ve.call(this._shortMonthsParse,a),l!==-1?l:(l=ve.call(this._longMonthsParse,a),l!==-1?l:null)):(l=ve.call(this._longMonthsParse,a),l!==-1?l:(l=ve.call(this._shortMonthsParse,a),l!==-1?l:null))}function Gi(e,t,n){var r,l,o;if(this._monthsParseExact)return Bi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(l=Je([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(l,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(l,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(l,"")+"|^"+this.monthsShort(l,""),this._monthsParse[r]=new RegExp(o.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 Dr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=ae(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 Yr(e){return e!=null?(Dr(this,e),R.updateOffset(this,!0),this):os(this,"Month")}function Wi(){return Fn(this.year(),this.month())}function zi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(oe(this,"_monthsShortRegex")||(this._monthsShortRegex=Yi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Vi(e){return this._monthsParseExact?(oe(this,"_monthsRegex")||Ur.call(this),e?this._monthsStrictRegex:this._monthsRegex):(oe(this,"_monthsRegex")||(this._monthsRegex=Ui),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Ur(){function e(u,i){return i.length-u.length}var t=[],n=[],r=[],l,o,a,m;for(l=0;l<12;l++)o=Je([2e3,l]),a=it(this.monthsShort(o,"")),m=it(this.months(o,"")),t.push(a),n.push(m),r.push(m),r.push(a);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 qi(e,t,n,r,l,o,a){var m;return e<100&&e>=0?(m=new Date(e+400,t,n,r,l,o,a),isFinite(m.getFullYear())&&m.setFullYear(e)):m=new Date(e,t,n,r,l,o,a),m}function cs(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,l=(7+cs(e,0,r).getUTCDay()-t)%7;return-l+r-1}function $r(e,t,n,r,l){var o=(7+n-r)%7,a=Ys(e,r,l),m=1+7*(t-1)+o+a,u,i;return m<=0?(u=e-1,i=ls(u)+m):m>ls(e)?(u=e+1,i=m-ls(e)):(u=e,i=m),{year:u,dayOfYear:i}}function ds(e,t,n){var r=Ys(e.year(),t,n),l=Math.floor((e.dayOfYear()-r-1)/7)+1,o,a;return l<1?(a=e.year()-1,o=l+ct(a,t,n)):l>ct(e.year(),t,n)?(o=l-ct(e.year(),t,n),a=e.year()+1):(a=e.year(),o=l),{week:o,year:a}}function ct(e,t,n){var r=Ys(e,t,n),l=Ys(e+1,t,n);return(ls(e)-r+l)/7}Q("w",["ww",2],"wo","week"),Q("W",["WW",2],"Wo","isoWeek"),B("w",pe,Yt),B("ww",pe,Pe),B("W",pe,Yt),B("WW",pe,Pe),is(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=ae(e)});function Ki(e){return ds(e,this._week.dow,this._week.doy).week}var Qi={dow:0,doy:6};function Zi(){return this._week.dow}function Ji(){return this._week.doy}function Xi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function el(e){var t=ds(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"),B("d",pe),B("e",pe),B("E",pe),B("dd",function(e,t){return t.weekdaysMinRegex(e)}),B("ddd",function(e,t){return t.weekdaysShortRegex(e)}),B("dddd",function(e,t){return t.weekdaysRegex(e)}),is(["dd","ddd","dddd"],function(e,t,n,r){var l=n._locale.weekdaysParse(e,r,n._strict);l!=null?t.d=l:ne(n).invalidWeekday=e}),is(["d","e","E"],function(e,t,n,r){t[r]=ae(e)});function tl(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function sl(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 nl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Hr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),al=as,il=as,ll=as;function ol(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 cl(e){return e===!0?Dn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function dl(e){return e===!0?Dn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function hl(e,t,n){var r,l,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=Je([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?t==="dddd"?(l=ve.call(this._weekdaysParse,a),l!==-1?l:null):t==="ddd"?(l=ve.call(this._shortWeekdaysParse,a),l!==-1?l:null):(l=ve.call(this._minWeekdaysParse,a),l!==-1?l:null):t==="dddd"?(l=ve.call(this._weekdaysParse,a),l!==-1||(l=ve.call(this._shortWeekdaysParse,a),l!==-1)?l:(l=ve.call(this._minWeekdaysParse,a),l!==-1?l:null)):t==="ddd"?(l=ve.call(this._shortWeekdaysParse,a),l!==-1||(l=ve.call(this._weekdaysParse,a),l!==-1)?l:(l=ve.call(this._minWeekdaysParse,a),l!==-1?l:null)):(l=ve.call(this._minWeekdaysParse,a),l!==-1||(l=ve.call(this._weekdaysParse,a),l!==-1)?l:(l=ve.call(this._shortWeekdaysParse,a),l!==-1?l:null))}function ul(e,t,n){var r,l,o;if(this._weekdaysParseExact)return hl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(l=Je([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(l,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(l,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(l,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(l,"")+"|^"+this.weekdaysShort(l,"")+"|^"+this.weekdaysMin(l,""),this._weekdaysParse[r]=new RegExp(o.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 ml(e){if(!this.isValid())return e!=null?this:NaN;var t=os(this,"Day");return e!=null?(e=tl(e,this.localeData()),this.add(e-t,"d")):t}function fl(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 pl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=sl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function yl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(oe(this,"_weekdaysRegex")||(this._weekdaysRegex=al),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function gl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(oe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=il),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function xl(e){return this._weekdaysParseExact?(oe(this,"_weekdaysRegex")||Yn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(oe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ll),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Yn(){function e(c,h){return h.length-c.length}var t=[],n=[],r=[],l=[],o,a,m,u,i;for(o=0;o<7;o++)a=Je([2e3,1]).day(o),m=it(this.weekdaysMin(a,"")),u=it(this.weekdaysShort(a,"")),i=it(this.weekdays(a,"")),t.push(m),n.push(u),r.push(i),l.push(m),l.push(u),l.push(i);t.sort(e),n.sort(e),r.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.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 Nl(){return this.hours()||24}Q("H",["HH",2],0,"hour"),Q("h",["hh",2],0,Un),Q("k",["kk",2],0,Nl),Q("hmm",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)}),Q("hmmss",0,0,function(){return""+Un.apply(this)+et(this.minutes(),2)+et(this.seconds(),2)}),Q("Hmm",0,0,function(){return""+this.hours()+et(this.minutes(),2)}),Q("Hmmss",0,0,function(){return""+this.hours()+et(this.minutes(),2)+et(this.seconds(),2)});function Br(e,t){Q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Br("a",!0),Br("A",!1);function Gr(e,t){return t._meridiemParse}B("a",Gr),B("A",Gr),B("H",pe,kn),B("h",pe,Yt),B("k",pe,Yt),B("HH",pe,Pe),B("hh",pe,Pe),B("kk",pe,Pe),B("hmm",Er),B("hmmss",Rr),B("Hmm",Er),B("Hmmss",Rr),me(["H","HH"],Te),me(["k","kk"],function(e,t,n){var r=ae(e);t[Te]=r===24?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[Te]=ae(e),ne(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r)),ne(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l)),ne(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,l=e.length-2;t[Te]=ae(e.substr(0,r)),t[We]=ae(e.substr(r,2)),t[ot]=ae(e.substr(l))});function jl(e){return(e+"").toLowerCase().charAt(0)==="p"}var vl=/[ap]\.?m?\.?/i,_l=Ut("Hours",!0);function bl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:hi,longDateFormat:pi,invalidDate:gi,ordinal:Ni,dayOfMonthOrdinalParse:ji,relativeTime:_i,months:Di,monthsShort:Pr,week:Qi,weekdays:nl,weekdaysMin:rl,weekdaysShort:Hr,meridiemParse:vl},xe={},hs={},us;function Sl(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 Tl(e){for(var t=0,n,r,l,o;t<e.length;){for(o=zr(e[t]).split("-"),n=o.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(l=Us(o.slice(0,n).join("-")),l)return l;if(r&&r.length>=n&&Sl(o,r)>=n-1)break;n--}t++}return us}function wl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Us(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&wl(e))try{t=us._abbr,n=require,n("./locale/"+e),jt(t)}catch{xe[e]=null}return xe[e]}function jt(e,t){var n;return e&&(Ee(t)?n=dt(e):n=$n(e,t),n?us=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),us._abbr}function $n(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,xe[e]!=null)Ir("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=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=Us(t.parentLocale),n!=null)r=n._config;else return hs[t.parentLocale]||(hs[t.parentLocale]=[]),hs[t.parentLocale].push({name:e,config:t}),null;return xe[e]=new Cn(In(r,t)),hs[e]&&hs[e].forEach(function(l){$n(l.name,l.config)}),jt(e),xe[e]}else return delete xe[e],null}function Il(e,t){if(t!=null){var n,r,l=Wr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(In(xe[e]._config,t)):(r=Us(e),r!=null&&(l=r._config),t=In(l,t),r==null&&(t.abbr=e),n=new Cn(t),n.parentLocale=xe[e],xe[e]=n),jt(e)}else xe[e]!=null&&(xe[e].parentLocale!=null?(xe[e]=xe[e].parentLocale,e===jt()&&jt(e)):xe[e]!=null&&delete xe[e]);return xe[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return us;if(!Be(e)){if(t=Us(e),t)return t;e=[e]}return Tl(e)}function Cl(){return On(xe)}function Hn(e){var t,n=e._a;return n&&ne(e).overflow===-2&&(t=n[lt]<0||n[lt]>11?lt:n[tt]<1||n[tt]>Fn(n[Ie],n[lt])?tt:n[Te]<0||n[Te]>24||n[Te]===24&&(n[We]!==0||n[ot]!==0||n[wt]!==0)?Te:n[We]<0||n[We]>59?We:n[ot]<0||n[ot]>59?ot:n[wt]<0||n[wt]>999?wt:-1,ne(e)._overflowDayOfYear&&(t<Ie||t>tt)&&(t=tt),ne(e)._overflowWeeks&&t===-1&&(t=Ei),ne(e)._overflowWeekday&&t===-1&&(t=Ri),ne(e).overflow=t),e}var 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=/^\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)?)?$/,Al=/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/]],El=/^\/?Date\((-?\d+)/i,Rl=/^(?:(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}))$/,Ll={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 Vr(e){var t,n,r=e._i,l=Ol.exec(r)||Ml.exec(r),o,a,m,u,i=$s.length,c=Bn.length;if(l){for(ne(e).iso=!0,t=0,n=i;t<n;t++)if($s[t][1].exec(l[1])){a=$s[t][0],o=$s[t][2]!==!1;break}if(a==null){e._isValid=!1;return}if(l[3]){for(t=0,n=c;t<n;t++)if(Bn[t][1].exec(l[3])){m=(l[2]||" ")+Bn[t][0];break}if(m==null){e._isValid=!1;return}}if(!o&&m!=null){e._isValid=!1;return}if(l[4])if(Al.exec(l[4]))u="Z";else{e._isValid=!1;return}e._f=a+(m||"")+(u||""),Wn(e)}else e._isValid=!1}function kl(e,t,n,r,l,o){var a=[Pl(e),Pr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(l,10)];return o&&a.push(parseInt(o,10)),a}function Pl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Fl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dl(e,t,n){if(e){var r=Hr.indexOf(e),l=new Date(t[0],t[1],t[2]).getDay();if(r!==l)return ne(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Yl(e,t,n){if(e)return Ll[e];if(t)return 0;var r=parseInt(n,10),l=r%100,o=(r-l)/100;return o*60+l}function qr(e){var t=Rl.exec(Fl(e._i)),n;if(t){if(n=kl(t[4],t[3],t[2],t[5],t[6],t[7]),!Dl(t[1],n,e))return;e._a=n,e._tzm=Yl(t[8],t[9],t[10]),e._d=cs.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ne(e).rfc2822=!0}else e._isValid=!1}function Ul(e){var t=El.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Vr(e),e._isValid===!1)delete e._isValid;else return;if(qr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=Ue("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 $t(e,t,n){return e??t??n}function $l(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Gn(e){var t,n,r=[],l,o,a;if(!e._d){for(l=$l(e),e._w&&e._a[tt]==null&&e._a[lt]==null&&Hl(e),e._dayOfYear!=null&&(a=$t(e._a[Ie],l[Ie]),(e._dayOfYear>ls(a)||e._dayOfYear===0)&&(ne(e)._overflowDayOfYear=!0),n=cs(a,0,e._dayOfYear),e._a[lt]=n.getUTCMonth(),e._a[tt]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=l[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[We]===0&&e._a[ot]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Te]=0),e._d=(e._useUTC?cs:qi).apply(null,r),o=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!==o&&(ne(e).weekdayMismatch=!0)}}function Hl(e){var t,n,r,l,o,a,m,u,i;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(o=1,a=4,n=$t(t.GG,e._a[Ie],ds(ye(),1,4).year),r=$t(t.W,1),l=$t(t.E,1),(l<1||l>7)&&(u=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,i=ds(ye(),o,a),n=$t(t.gg,e._a[Ie],i.year),r=$t(t.w,i.week),t.d!=null?(l=t.d,(l<0||l>6)&&(u=!0)):t.e!=null?(l=t.e+o,(t.e<0||t.e>6)&&(u=!0)):l=o),r<1||r>ct(n,o,a)?ne(e)._overflowWeeks=!0:u!=null?ne(e)._overflowWeekday=!0:(m=$r(n,r,l,o,a),e._a[Ie]=m.year,e._dayOfYear=m.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function Wn(e){if(e._f===R.ISO_8601){Vr(e);return}if(e._f===R.RFC_2822){qr(e);return}e._a=[],ne(e).empty=!0;var t=""+e._i,n,r,l,o,a,m=t.length,u=0,i,c;for(l=Cr(e._f,e._locale).match(Mn)||[],c=l.length,n=0;n<c;n++)o=l[n],r=(t.match(Oi(o,e))||[])[0],r&&(a=t.substr(0,t.indexOf(r)),a.length>0&&ne(e).unusedInput.push(a),t=t.slice(t.indexOf(r)+r.length),u+=r.length),Ft[o]?(r?ne(e).empty=!1:ne(e).unusedTokens.push(o),Ai(o,r,e)):e._strict&&!r&&ne(e).unusedTokens.push(o);ne(e).charsLeftOver=m-u,t.length>0&&ne(e).unusedInput.push(t),e._a[Te]<=12&&ne(e).bigHour===!0&&e._a[Te]>0&&(ne(e).bigHour=void 0),ne(e).parsedDateParts=e._a.slice(0),ne(e).meridiem=e._meridiem,e._a[Te]=Bl(e._locale,e._a[Te],e._meridiem),i=ne(e).era,i!==null&&(e._a[Ie]=e._locale.erasConvertYear(i,e._a[Ie])),Gn(e),Hn(e)}function Bl(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 Gl(e){var t,n,r,l,o,a,m=!1,u=e._f.length;if(u===0){ne(e).invalidFormat=!0,e._d=new Date(NaN);return}for(l=0;l<u;l++)o=0,a=!1,t=wn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[l],Wn(t),Sn(t)&&(a=!0),o+=ne(t).charsLeftOver,o+=ne(t).unusedTokens.length*10,ne(t).score=o,m?o<r&&(r=o,n=t):(r==null||o<r||a)&&(r=o,n=t,a&&(m=!0));Nt(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=br([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Gn(e)}}function zl(e){var t=new rs(Hn(Kr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Kr(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)),Ge(t)?new rs(Hn(t)):(ns(t)?e._d=t:Be(n)?Gl(e):n?Wn(e):Vl(e),Sn(e)||(e._d=null),e))}function Vl(e){var t=e._i;Ee(t)?e._d=new Date(R.now()):ns(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Ul(e):Be(t)?(e._a=br(t.slice(0),function(n){return parseInt(n,10)}),Gn(e)):Tt(t)?Wl(e):at(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Qr(e,t,n,r,l){var o={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Tt(e)&&_n(e)||Be(e)&&e.length===0)&&(e=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=l,o._l=n,o._i=e,o._f=t,o._strict=r,zl(o)}function ye(e,t,n,r){return Qr(e,t,n,r,!1)}var ql=Ue("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Os()}),Kl=Ue("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ye.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Os()});function Zr(e,t){var n,r;if(t.length===1&&Be(t[0])&&(t=t[0]),!t.length)return ye();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Ql(){var e=[].slice.call(arguments,0);return Zr("isBefore",e)}function Zl(){var e=[].slice.call(arguments,0);return Zr("isAfter",e)}var Jl=function(){return Date.now?Date.now():+new Date},ms=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Xl(e){var t,n=!1,r,l=ms.length;for(t in e)if(oe(e,t)&&!(ve.call(ms,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<l;++r)if(e[ms[r]]){if(n)return!1;parseFloat(e[ms[r]])!==ae(e[ms[r]])&&(n=!0)}return!0}function eo(){return this._isValid}function to(){return ze(NaN)}function Hs(e){var t=En(e),n=t.year||0,r=t.quarter||0,l=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,m=t.hour||0,u=t.minute||0,i=t.second||0,c=t.millisecond||0;this._isValid=Xl(t),this._milliseconds=+c+i*1e3+u*6e4+m*1e3*60*60,this._days=+a+o*7,this._months=+l+r*3+n*12,this._data={},this._locale=dt(),this._bubble()}function Bs(e){return e instanceof Hs}function zn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function so(e,t,n){var r=Math.min(e.length,t.length),l=Math.abs(e.length-t.length),o=0,a;for(a=0;a<r;a++)ae(e[a])!==ae(t[a])&&o++;return o+l}function Jr(e,t){Q(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+et(~~(n/60),2)+t+et(~~n%60,2)})}Jr("Z",":"),Jr("ZZ",""),B("Z",Ps),B("ZZ",Ps),me(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vn(Ps,e)});var no=/([\+\-]|\d\d)/gi;function Vn(e,t){var n=(t||"").match(e),r,l,o;return n===null?null:(r=n[n.length-1]||[],l=(r+"").match(no)||["-",0,0],o=+(l[1]*60)+ae(l[2]),o===0?0:l[0]==="+"?o:-o)}function qn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ge(e)||ns(e)?e.valueOf():ye(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):ye(e).local()}function Kn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function ro(e,t,n){var r=this._offset||0,l;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&&(l=Kn(this)),this._offset=e,this._isUTC=!0,l!=null&&this.add(l,"m"),r!==e&&(!t||this._changeInProgress?sa(this,ze(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Kn(this)}function ao(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function io(e){return this.utcOffset(0,e)}function lo(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Kn(this),"m")),this}function oo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Vn(Ii,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function co(e){return this.isValid()?(e=e?ye(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function ho(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uo(){if(!Ee(this._isDSTShifted))return this._isDSTShifted;var e={},t;return wn(e,this),e=Kr(e),e._a?(t=e._isUTC?Je(e._a):ye(e._a),this._isDSTShifted=this.isValid()&&so(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function mo(){return this.isValid()?!this._isUTC:!1}function fo(){return this.isValid()?this._isUTC:!1}function Xr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var po=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,yo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ze(e,t){var n=e,r=null,l,o,a;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=po.exec(e))?(l=r[1]==="-"?-1:1,n={y:0,d:ae(r[tt])*l,h:ae(r[Te])*l,m:ae(r[We])*l,s:ae(r[ot])*l,ms:ae(zn(r[wt]*1e3))*l}):(r=yo.exec(e))?(l=r[1]==="-"?-1:1,n={y:It(r[2],l),M:It(r[3],l),w:It(r[4],l),d:It(r[5],l),h:It(r[6],l),m:It(r[7],l),s:It(r[8],l)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(a=go(ye(n.from),ye(n.to)),n={},n.ms=a.milliseconds,n.M=a.months),o=new Hs(n),Bs(e)&&oe(e,"_locale")&&(o._locale=e._locale),Bs(e)&&oe(e,"_isValid")&&(o._isValid=e._isValid),o}ze.fn=Hs.prototype,ze.invalid=to;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ea(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 go(e,t){var n;return e.isValid()&&t.isValid()?(t=qn(t,e),e.isBefore(t)?n=ea(e,t):(n=ea(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ta(e,t){return function(n,r){var l,o;return r!==null&&!isNaN(+r)&&(Ir(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."),o=n,n=r,r=o),l=ze(n,r),sa(this,l,e),this}}function sa(e,t,n,r){var l=t._milliseconds,o=zn(t._days),a=zn(t._months);e.isValid()&&(r=r??!0,a&&Dr(e,os(e,"Month")+a*n),o&&kr(e,"Date",os(e,"Date")+o*n),l&&e._d.setTime(e._d.valueOf()+l*n),r&&R.updateOffset(e,o||a))}var xo=ta(1,"add"),No=ta(-1,"subtract");function na(e){return typeof e=="string"||e instanceof String}function jo(e){return Ge(e)||ns(e)||na(e)||at(e)||_o(e)||vo(e)||e===null||e===void 0}function vo(e){var t=Tt(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"],l,o,a=r.length;for(l=0;l<a;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function _o(e){var t=Be(e),n=!1;return t&&(n=e.filter(function(r){return!at(r)&&na(e)}).length===0),t&&n}function bo(e){var t=Tt(e)&&!_n(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],l,o;for(l=0;l<r.length;l+=1)o=r[l],n=n||oe(e,o);return t&&n}function So(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 To(e,t){arguments.length===1&&(arguments[0]?jo(arguments[0])?(e=arguments[0],t=void 0):bo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ye(),r=qn(n,this).startOf("day"),l=R.calendarFormat(this,r)||"sameElse",o=t&&(Xe(t[l])?t[l].call(this,n):t[l]);return this.format(o||this.localeData().calendar(l,this,ye(n)))}function wo(){return new rs(this)}function Io(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Co(e,t){var n=Ge(e)?e:ye(e);return this.isValid()&&n.isValid()?(t=$e(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Oo(e,t,n,r){var l=Ge(e)?e:ye(e),o=Ge(t)?t:ye(t);return this.isValid()&&l.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(l,n):!this.isBefore(l,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function Mo(e,t){var n=Ge(e)?e:ye(e),r;return this.isValid()&&n.isValid()?(t=$e(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 Ao(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Eo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ro(e,t,n){var r,l,o;if(!this.isValid())return NaN;if(r=qn(e,this),!r.isValid())return NaN;switch(l=(r.utcOffset()-this.utcOffset())*6e4,t=$e(t),t){case"year":o=Gs(this,r)/12;break;case"month":o=Gs(this,r);break;case"quarter":o=Gs(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-l)/864e5;break;case"week":o=(this-r-l)/6048e5;break;default:o=this-r}return n?o:He(o)}function Gs(e,t){if(e.date()<t.date())return-Gs(t,e);var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),l,o;return t-r<0?(l=e.clone().add(n-1,"months"),o=(t-r)/(r-l)):(l=e.clone().add(n+1,"months"),o=(t-r)/(l-r)),-(n+o)||0}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Lo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ko(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"):Xe(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 Po(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,l,o;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",l="-MM-DD[T]HH:mm:ss.SSS",o=t+'[")]',this.format(n+r+l+o)}function Fo(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=As(this,e);return this.localeData().postformat(t)}function Do(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.from(ye(),e)}function Uo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ye(e).isValid())?ze({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $o(e){return this.to(ye(),e)}function ra(e){var t;return e===void 0?this._locale._abbr:(t=dt(e),t!=null&&(this._locale=t),this)}var aa=Ue("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 ia(){return this._locale}var Ws=1e3,Ht=60*Ws,zs=60*Ht,la=(365*400+97)*24*zs;function Bt(e,t){return(e%t+t)%t}function oa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-la:new Date(e,t,n).valueOf()}function ca(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-la:Date.UTC(e,t,n)}function Ho(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,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-=Bt(t+(this._isUTC?0:this.utcOffset()*Ht),zs);break;case"minute":t=this._d.valueOf(),t-=Bt(t,Ht);break;case"second":t=this._d.valueOf(),t-=Bt(t,Ws);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Bo(e){var t,n;if(e=$e(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ca:oa,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+=zs-Bt(t+(this._isUTC?0:this.utcOffset()*Ht),zs)-1;break;case"minute":t=this._d.valueOf(),t+=Ht-Bt(t,Ht)-1;break;case"second":t=this._d.valueOf(),t+=Ws-Bt(t,Ws)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Go(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Vo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function qo(){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 Ko(){return this.isValid()?this.toISOString():null}function Qo(){return Sn(this)}function Zo(){return Nt({},ne(this))}function Jo(){return ne(this).overflow}function Xo(){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"),B("N",Qn),B("NN",Qn),B("NNN",Qn),B("NNNN",dc),B("NNNNN",hc),me(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var l=n._locale.erasParse(e,r,n._strict);l?ne(n).era=l:ne(n).invalidEra=e}),B("y",Dt),B("yy",Dt),B("yyy",Dt),B("yyyy",Dt),B("yo",uc),me(["y","yy","yyy","yyyy"],Ie),me(["yo"],function(e,t,n,r){var l;n._locale._eraYearOrdinalRegex&&(l=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ie]=n._locale.eraYearOrdinalParse(e,l):t[Ie]=parseInt(e,10)});function ec(e,t){var n,r,l,o=this._eras||dt("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":l=R(o[n].since).startOf("day"),o[n].since=l.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":l=R(o[n].until).startOf("day").valueOf(),o[n].until=l.valueOf();break}}return o}function tc(e,t,n){var r,l,o=this.eras(),a,m,u;for(e=e.toUpperCase(),r=0,l=o.length;r<l;++r)if(a=o[r].name.toUpperCase(),m=o[r].abbr.toUpperCase(),u=o[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(m===e)return o[r];break;case"NNNN":if(a===e)return o[r];break;case"NNNNN":if(u===e)return o[r];break}else if([a,m,u].indexOf(e)>=0)return o[r]}function sc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}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].name;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].narrow;return""}function ac(){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 ic(){var e,t,n,r,l=this.localeData().eras();for(e=0,t=l.length;e<t;++e)if(n=l[e].since<=l[e].until?1:-1,r=this.clone().startOf("day").valueOf(),l[e].since<=r&&r<=l[e].until||l[e].until<=r&&r<=l[e].since)return(this.year()-R(l[e].since).year())*n+l[e].offset;return this.year()}function lc(e){return oe(this,"_erasNameRegex")||Zn.call(this),e?this._erasNameRegex:this._erasRegex}function oc(e){return oe(this,"_erasAbbrRegex")||Zn.call(this),e?this._erasAbbrRegex:this._erasRegex}function cc(e){return oe(this,"_erasNarrowRegex")||Zn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Qn(e,t){return t.erasAbbrRegex(e)}function dc(e,t){return t.erasNameRegex(e)}function hc(e,t){return t.erasNarrowRegex(e)}function uc(e,t){return t._eraYearOrdinalRegex||Dt}function Zn(){var e=[],t=[],n=[],r=[],l,o,a,m,u,i=this.eras();for(l=0,o=i.length;l<o;++l)a=it(i[l].name),m=it(i[l].abbr),u=it(i[l].narrow),t.push(a),e.push(m),n.push(u),r.push(a),r.push(m),r.push(u);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"),B("G",ks),B("g",ks),B("GG",pe,Pe),B("gg",pe,Pe),B("GGGG",Ln,Rn),B("gggg",Ln,Rn),B("GGGGG",Ls,Es),B("ggggg",Ls,Es),is(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=ae(e)}),is(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function mc(e){return da.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function fc(e){return da.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function pc(){return ct(this.year(),1,4)}function yc(){return ct(this.isoWeekYear(),1,4)}function gc(){var e=this.localeData()._week;return ct(this.year(),e.dow,e.doy)}function xc(){var e=this.localeData()._week;return ct(this.weekYear(),e.dow,e.doy)}function da(e,t,n,r,l){var o;return e==null?ds(this,r,l).year:(o=ct(e,r,l),t>o&&(t=o),Nc.call(this,e,t,n,r,l))}function Nc(e,t,n,r,l){var o=$r(e,t,n,r,l),a=cs(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}Q("Q",0,"Qo","quarter"),B("Q",Mr),me("Q",function(e,t){t[lt]=(ae(e)-1)*3});function jc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Q("D",["DD",2],"Do","date"),B("D",pe,Yt),B("DD",pe,Pe),B("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],tt),me("Do",function(e,t){t[tt]=ae(e.match(pe)[0])});var ha=Ut("Date",!0);Q("DDD",["DDDD",3],"DDDo","dayOfYear"),B("DDD",Rs),B("DDDD",Ar),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ae(e)});function vc(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"),B("m",pe,kn),B("mm",pe,Pe),me(["m","mm"],We);var _c=Ut("Minutes",!1);Q("s",["ss",2],0,"second"),B("s",pe,kn),B("ss",pe,Pe),me(["s","ss"],ot);var bc=Ut("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}),B("S",Rs,Mr),B("SS",Rs,Pe),B("SSS",Rs,Ar);var vt,ua;for(vt="SSSS";vt.length<=9;vt+="S")B(vt,Dt);function Sc(e,t){t[wt]=ae(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")me(vt,Sc);ua=Ut("Milliseconds",!1),Q("z",0,0,"zoneAbbr"),Q("zz",0,0,"zoneName");function Tc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}var M=rs.prototype;M.add=xo,M.calendar=To,M.clone=wo,M.diff=Ro,M.endOf=Bo,M.format=Fo,M.from=Do,M.fromNow=Yo,M.to=Uo,M.toNow=$o,M.get=ki,M.invalidAt=Jo,M.isAfter=Io,M.isBefore=Co,M.isBetween=Oo,M.isSame=Mo,M.isSameOrAfter=Ao,M.isSameOrBefore=Eo,M.isValid=Qo,M.lang=aa,M.locale=ra,M.localeData=ia,M.max=Kl,M.min=ql,M.parsingFlags=Zo,M.set=Pi,M.startOf=Ho,M.subtract=No,M.toArray=Vo,M.toObject=qo,M.toDate=zo,M.toISOString=ko,M.inspect=Po,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=Ko,M.toString=Lo,M.unix=Wo,M.valueOf=Go,M.creationData=Xo,M.eraName=nc,M.eraNarrow=rc,M.eraAbbr=ac,M.eraYear=ic,M.year=Lr,M.isLeapYear=Li,M.weekYear=mc,M.isoWeekYear=fc,M.quarter=M.quarters=jc,M.month=Yr,M.daysInMonth=Wi,M.week=M.weeks=Xi,M.isoWeek=M.isoWeeks=el,M.weeksInYear=gc,M.weeksInWeekYear=xc,M.isoWeeksInYear=pc,M.isoWeeksInISOWeekYear=yc,M.date=ha,M.day=M.days=ml,M.weekday=fl,M.isoWeekday=pl,M.dayOfYear=vc,M.hour=M.hours=_l,M.minute=M.minutes=_c,M.second=M.seconds=bc,M.millisecond=M.milliseconds=ua,M.utcOffset=ro,M.utc=io,M.local=lo,M.parseZone=oo,M.hasAlignedHourOffset=co,M.isDST=ho,M.isLocal=mo,M.isUtcOffset=fo,M.isUtc=Xr,M.isUTC=Xr,M.zoneAbbr=Tc,M.zoneName=wc,M.dates=Ue("dates accessor is deprecated. Use date instead.",ha),M.months=Ue("months accessor is deprecated. Use month instead",Yr),M.years=Ue("years accessor is deprecated. Use year instead",Lr),M.zone=Ue("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ao),M.isDSTShifted=Ue("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uo);function Ic(e){return ye(e*1e3)}function Cc(){return ye.apply(null,arguments).parseZone()}function ma(e){return e}var ce=Cn.prototype;ce.calendar=ui,ce.longDateFormat=yi,ce.invalidDate=xi,ce.ordinal=vi,ce.preparse=ma,ce.postformat=ma,ce.relativeTime=bi,ce.pastFuture=Si,ce.set=di,ce.eras=ec,ce.erasParse=tc,ce.erasConvertYear=sc,ce.erasAbbrRegex=oc,ce.erasNameRegex=lc,ce.erasNarrowRegex=cc,ce.months=$i,ce.monthsShort=Hi,ce.monthsParse=Gi,ce.monthsRegex=Vi,ce.monthsShortRegex=zi,ce.week=Ki,ce.firstDayOfYear=Ji,ce.firstDayOfWeek=Zi,ce.weekdays=ol,ce.weekdaysMin=dl,ce.weekdaysShort=cl,ce.weekdaysParse=ul,ce.weekdaysRegex=yl,ce.weekdaysShortRegex=gl,ce.weekdaysMinRegex=xl,ce.isPM=jl,ce.meridiem=bl;function qs(e,t,n,r){var l=dt(),o=Je().set(r,t);return l[n](o,e)}function fa(e,t,n){if(at(e)&&(t=e,e=void 0),e=e||"",t!=null)return qs(e,t,n,"month");var r,l=[];for(r=0;r<12;r++)l[r]=qs(e,r,n,"month");return l}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 l=dt(),o=e?l._week.dow:0,a,m=[];if(n!=null)return qs(t,(n+o)%7,r,"day");for(a=0;a<7;a++)m[a]=qs(t,(a+o)%7,r,"day");return m}function Oc(e,t){return fa(e,t,"months")}function Mc(e,t){return fa(e,t,"monthsShort")}function Ac(e,t,n){return Jn(e,t,n,"weekdays")}function Ec(e,t,n){return Jn(e,t,n,"weekdaysShort")}function Rc(e,t,n){return Jn(e,t,n,"weekdaysMin")}jt("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=ae(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),R.lang=Ue("moment.lang is deprecated. Use moment.locale instead.",jt),R.langData=Ue("moment.langData is deprecated. Use moment.localeData instead.",dt);var ht=Math.abs;function Lc(){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 pa(e,t,n,r){var l=ze(t,n);return e._milliseconds+=r*l._milliseconds,e._days+=r*l._days,e._months+=r*l._months,e._bubble()}function kc(e,t){return pa(this,e,t,1)}function Pc(e,t){return pa(this,e,t,-1)}function ya(e){return e<0?Math.floor(e):Math.ceil(e)}function Fc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,l,o,a,m,u;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ya(Xn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,l=He(e/1e3),r.seconds=l%60,o=He(l/60),r.minutes=o%60,a=He(o/60),r.hours=a%24,t+=He(a/24),u=He(ga(t)),n+=u,t-=ya(Xn(u)),m=He(n/12),n%=12,r.days=t,r.months=n,r.years=m,this}function ga(e){return e*4800/146097}function Xn(e){return e*146097/4800}function Dc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=$e(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ga(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 xa=ut("ms"),Yc=ut("s"),Uc=ut("m"),$c=ut("h"),Hc=ut("d"),Bc=ut("w"),Gc=ut("M"),Wc=ut("Q"),zc=ut("y"),Vc=xa;function qc(){return ze(this)}function Kc(e){return e=$e(e),this.isValid()?this[e+"s"]():NaN}function Ct(e){return function(){return this.isValid()?this._data[e]:NaN}}var Qc=Ct("milliseconds"),Zc=Ct("seconds"),Jc=Ct("minutes"),Xc=Ct("hours"),ed=Ct("days"),td=Ct("months"),sd=Ct("years");function nd(){return He(this.days()/7)}var mt=Math.round,Gt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function rd(e,t,n,r,l){return l.relativeTime(t||1,!!n,e,r)}function ad(e,t,n,r){var l=ze(e).abs(),o=mt(l.as("s")),a=mt(l.as("m")),m=mt(l.as("h")),u=mt(l.as("d")),i=mt(l.as("M")),c=mt(l.as("w")),h=mt(l.as("y")),f=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||a<=1&&["m"]||a<n.m&&["mm",a]||m<=1&&["h"]||m<n.h&&["hh",m]||u<=1&&["d"]||u<n.d&&["dd",u];return n.w!=null&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),f=f||i<=1&&["M"]||i<n.M&&["MM",i]||h<=1&&["y"]||["yy",h],f[2]=t,f[3]=+e>0,f[4]=r,rd.apply(null,f)}function id(e){return e===void 0?mt:typeof e=="function"?(mt=e,!0):!1}function ld(e,t){return Gt[e]===void 0?!1:t===void 0?Gt[e]:(Gt[e]=t,e==="s"&&(Gt.ss=t-1),!0)}function od(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Gt,l,o;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},Gt,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),l=this.localeData(),o=ad(this,!n,r,l),n&&(o=l.pastFuture(+this,o)),l.postformat(o)}var er=Math.abs;function Wt(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,l,o,a,m=this.asSeconds(),u,i,c,h;return m?(r=He(e/60),l=He(r/60),e%=60,r%=60,o=He(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=m<0?"-":"",i=Wt(this._months)!==Wt(m)?"-":"",c=Wt(this._days)!==Wt(m)?"-":"",h=Wt(this._milliseconds)!==Wt(m)?"-":"",u+"P"+(o?i+o+"Y":"")+(n?i+n+"M":"")+(t?c+t+"D":"")+(l||r||e?"T":"")+(l?h+l+"H":"")+(r?h+r+"M":"")+(e?h+a+"S":"")):"P0D"}var ie=Hs.prototype;ie.isValid=eo,ie.abs=Lc,ie.add=kc,ie.subtract=Pc,ie.as=Dc,ie.asMilliseconds=xa,ie.asSeconds=Yc,ie.asMinutes=Uc,ie.asHours=$c,ie.asDays=Hc,ie.asWeeks=Bc,ie.asMonths=Gc,ie.asQuarters=Wc,ie.asYears=zc,ie.valueOf=Vc,ie._bubble=Fc,ie.clone=qc,ie.get=Kc,ie.milliseconds=Qc,ie.seconds=Zc,ie.minutes=Jc,ie.hours=Xc,ie.days=ed,ie.weeks=nd,ie.months=td,ie.years=sd,ie.humanize=od,ie.toISOString=Ks,ie.toString=Ks,ie.toJSON=Ks,ie.locale=ra,ie.localeData=ia,ie.toIsoString=Ue("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ks),ie.lang=aa,Q("X",0,0,"unix"),Q("x",0,0,"valueOf"),B("x",ks),B("X",Ci),me("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),me("x",function(e,t,n){n._d=new Date(ae(e))});//! moment.js
|
|
39
|
+
R.version="2.30.1",oi(ye),R.fn=M,R.min=Ql,R.max=Zl,R.now=Jl,R.utc=Je,R.unix=Ic,R.months=Oc,R.isDate=ns,R.locale=jt,R.invalid=Os,R.duration=ze,R.isMoment=Ge,R.weekdays=Ac,R.parseZone=Cc,R.localeData=dt,R.isDuration=Bs,R.monthsShort=Mc,R.weekdaysMin=Rc,R.defineLocale=$n,R.updateLocale=Il,R.locales=Cl,R.weekdaysShort=Ec,R.normalizeUnits=$e,R.relativeTimeRounding=id,R.relativeTimeThreshold=ld,R.calendarFormat=So,R.prototype=M,R.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 ft=(e,t,n)=>{let r;for(let l=0;l<(e==null?void 0:e.length);l++)if(r=e[l],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(" ")},fs=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let l=0;l<e.length;l++)n=e[l],r[n[t]]=n;return r},cd=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},dd=(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 hd=Qs.exports,Na;function ud(){return Na||(Na=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(hd,function(){var t,n,r="2.0.6",l={},o={},a={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},m={currentLocale:a.currentLocale,zeroFormat:a.zeroFormat,nullFormat:a.nullFormat,defaultFormat:a.defaultFormat,scalePercentBy100:a.scalePercentBy100};function u(i,c){this._input=i,this._value=c}return t=function(i){var c,h,f,y;if(t.isNumeral(i))c=i.value();else if(i===0||typeof i>"u")c=0;else if(i===null||n.isNaN(i))c=null;else if(typeof i=="string")if(m.zeroFormat&&i===m.zeroFormat)c=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)c=null;else{for(h in l)if(y=typeof l[h].regexps.unformat=="function"?l[h].regexps.unformat():l[h].regexps.unformat,y&&i.match(y)){f=l[h].unformat;break}f=f||t._.stringToNumber,c=f(i)}else c=Number(i)||null;return new u(i,c)},t.version=r,t.isNumeral=function(i){return i instanceof u},t._=n={numberToFormat:function(i,c,h){var f=o[t.options.currentLocale],y=!1,p=!1,v=0,_="",E=1e12,S=1e9,T=1e6,D=1e3,$="",k=!1,J,re,te,de,be,Z,X;if(i=i||0,re=Math.abs(i),t._.includes(c,"(")?(y=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(be=t._.includes(c,"+")?c.indexOf("+"):i<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(J=c.match(/a(k|m|b|t)?/),J=J?J[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),re>=E&&!J||J==="t"?(_+=f.abbreviations.trillion,i=i/E):re<E&&re>=S&&!J||J==="b"?(_+=f.abbreviations.billion,i=i/S):re<S&&re>=T&&!J||J==="m"?(_+=f.abbreviations.million,i=i/T):(re<T&&re>=D&&!J||J==="k")&&(_+=f.abbreviations.thousand,i=i/D)),t._.includes(c,"[.]")&&(p=!0,c=c.replace("[.]",".")),te=i.toString().split(".")[0],de=c.split(".")[1],Z=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,de?(t._.includes(de,"[")?(de=de.replace("]",""),de=de.split("["),$=t._.toFixed(i,de[0].length+de[1].length,h,de[1].length)):$=t._.toFixed(i,de.length,h),te=$.split(".")[0],t._.includes($,".")?$=f.delimiters.decimal+$.split(".")[1]:$="",p&&Number($.slice(1))===0&&($="")):te=t._.toFixed(i,0,h),_&&!J&&Number(te)>=1e3&&_!==f.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case f.abbreviations.thousand:_=f.abbreviations.million;break;case f.abbreviations.million:_=f.abbreviations.billion;break;case f.abbreviations.billion:_=f.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),k=!0),te.length<v)for(var q=v-te.length;q>0;q--)te="0"+te;return Z>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),c.indexOf(".")===0&&(te=""),X=te+$+(_||""),y?X=(y&&k?"(":"")+X+(y&&k?")":""):be>=0?X=be===0?(k?"-":"+")+X:X+(k?"-":"+"):k&&(X="-"+X),X},stringToNumber:function(i){var c=o[m.currentLocale],h=i,f={thousand:3,million:6,billion:9,trillion:12},y,p,v;if(m.zeroFormat&&i===m.zeroFormat)p=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)p=null;else{p=1,c.delimiters.decimal!=="."&&(i=i.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(y in f)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[y]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){p*=Math.pow(10,f[y]);break}p*=(i.split("-").length+Math.min(i.split("(").length-1,i.split(")").length-1))%2?1:-1,i=i.replace(/[^0-9\.]+/g,""),p*=Number(i)}return p},isNaN:function(i){return typeof i=="number"&&isNaN(i)},includes:function(i,c){return i.indexOf(c)!==-1},insert:function(i,c,h){return i.slice(0,h)+c+i.slice(h)},reduce:function(i,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(i),f=h.length>>>0,y=0,p;if(arguments.length===3)p=arguments[2];else{for(;y<f&&!(y in h);)y++;if(y>=f)throw new TypeError("Reduce of empty array with no initial value");p=h[y++]}for(;y<f;y++)y in h&&(p=c(p,h[y],y,h));return p},multiplier:function(i){var c=i.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var i=Array.prototype.slice.call(arguments);return i.reduce(function(c,h){var f=n.multiplier(h);return c>f?c:f},1)},toFixed:function(i,c,h,f){var y=i.toString().split("."),p=c-(f||0),v,_,E,S;return y.length===2?v=Math.min(Math.max(y[1].length,p),c):v=p,E=Math.pow(10,v),S=(h(i+"e+"+v)/E).toFixed(v),f>c-v&&(_=new RegExp("\\.?0{1,"+(f-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=m,t.formats=l,t.locales=o,t.locale=function(i){return i&&(m.currentLocale=i.toLowerCase()),m.currentLocale},t.localeData=function(i){if(!i)return o[m.currentLocale];if(i=i.toLowerCase(),!o[i])throw new Error("Unknown locale : "+i);return o[i]},t.reset=function(){for(var i in a)m[i]=a[i]},t.zeroFormat=function(i){m.zeroFormat=typeof i=="string"?i:null},t.nullFormat=function(i){m.nullFormat=typeof i=="string"?i:null},t.defaultFormat=function(i){m.defaultFormat=typeof i=="string"?i:"0.0"},t.register=function(i,c,h){if(c=c.toLowerCase(),this[i+"s"][c])throw new TypeError(c+" "+i+" already registered.");return this[i+"s"][c]=h,h},t.validate=function(i,c){var h,f,y,p,v,_,E,S;if(typeof i!="string"&&(i+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",i)),i=i.trim(),i.match(/^\d+$/))return!0;if(i==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return y=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?f="\\.":f=E.delimiters.thousands,S=i.match(/^[^\d]+/),S!==null&&(i=i.substr(1),S[0]!==y)||(S=i.match(/[^\d]+$/),S!==null&&(i=i.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(f+"{2}"),i.match(/[^\d.,]/g)?!1:(p=i.split(h),p.length>2?!1:p.length<2?!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_):p[0].length===1?!!p[0].match(/^\d+$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/):!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/)))},t.fn=u.prototype={clone:function(){return t(this)},format:function(i,c){var h=this._value,f=i||m.defaultFormat,y,p,v;if(c=c||Math.round,h===0&&m.zeroFormat!==null)p=m.zeroFormat;else if(h===null&&m.nullFormat!==null)p=m.nullFormat;else{for(y in l)if(f.match(l[y].regexps.format)){v=l[y].format;break}v=v||t._.numberToFormat,p=v(h,f,c)}return p},value:function(){return this._value},input:function(){return this._input},set:function(i){return this._value=Number(i),this},add:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f+Math.round(c*y)}return this._value=n.reduce([this._value,i],h,0)/c,this},subtract:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f-Math.round(c*y)}return this._value=n.reduce([i],h,Math.round(this._value*c))/c,this},multiply:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)*Math.round(f*v)/Math.round(v*v)}return this._value=n.reduce([this._value,i],c,1),this},divide:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)/Math.round(f*v)}return this._value=n.reduce([this._value,i],c),this},difference:function(i){return Math.abs(t(this._value).subtract(i).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var c=i%10;return~~(i%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(i,c,h){var f=t._.includes(c," BPS")?" ":"",y;return i=i*1e4,c=c.replace(/\s?BPS/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"BPS"),y=y.join("")):y=y+f+"BPS",y},unformat:function(i){return+(t._.stringToNumber(i)*1e-4).toFixed(15)}})}(),function(){var i={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=i.suffixes.concat(c.suffixes.filter(function(y){return i.suffixes.indexOf(y)<0})),f=h.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(y,p,v){var _,E=t._.includes(p,"ib")?c:i,S=t._.includes(p," b")||t._.includes(p," ib")?" ":"",T,D,$;for(p=p.replace(/\s?i?b/,""),T=0;T<=E.suffixes.length;T++)if(D=Math.pow(E.base,T),$=Math.pow(E.base,T+1),y===null||y===0||y>=D&&y<$){S+=E.suffixes[T],D>0&&(y=y/D);break}return _=t._.numberToFormat(y,p,v),_+S},unformat:function(y){var p=t._.stringToNumber(y),v,_;if(p){for(v=i.suffixes.length-1;v>=0;v--){if(t._.includes(y,i.suffixes[v])){_=Math.pow(i.base,v);break}if(t._.includes(y,c.suffixes[v])){_=Math.pow(c.base,v);break}}p*=_||1}return p}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},p,v,_;for(c=c.replace(/\s?\$\s?/,""),p=t._.numberToFormat(i,c,h),i>=0?(y.before=y.before.replace(/[\-\(]/,""),y.after=y.after.replace(/[\-\)]/,"")):i<0&&!t._.includes(y.before,"-")&&!t._.includes(y.before,"(")&&(y.before="-"+y.before),_=0;_<y.before.length;_++)switch(v=y.before[_],v){case"$":p=t._.insert(p,f.currency.symbol,_);break;case" ":p=t._.insert(p," ",_+f.currency.symbol.length-1);break}for(_=y.after.length-1;_>=0;_--)switch(v=y.after[_],v){case"$":p=_===y.after.length-1?p+f.currency.symbol:t._.insert(p,f.currency.symbol,-(y.after.length-(1+_)));break;case" ":p=_===y.after.length-1?p+" ":t._.insert(p," ",-(y.after.length-(1+_)+f.currency.symbol.length-1));break}return p}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(i,c,h){var f,y=typeof i=="number"&&!t._.isNaN(i)?i.toExponential():"0e+0",p=y.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(p[0]),c,h),f+"e"+p[1]},unformat:function(i){var c=t._.includes(i,"e+")?i.split("e+"):i.split("e-"),h=Number(c[0]),f=Number(c[1]);f=t._.includes(i,"e-")?f*=-1:f;function y(p,v,_,E){var S=t._.correctionFactor(p,v),T=p*S*(v*S)/(S*S);return T}return t._.reduce([h,Math.pow(10,f)],y,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y,p=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),p+=f.ordinal(i),y=t._.numberToFormat(i,c,h),y+p}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(i,c,h){var f=t._.includes(c," %")?" ":"",y;return t.options.scalePercentBy100&&(i=i*100),c=c.replace(/\s?\%/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"%"),y=y.join("")):y=y+f+"%",y},unformat:function(i){var c=t._.stringToNumber(i);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(i,c,h){var f=Math.floor(i/60/60),y=Math.floor((i-f*60*60)/60),p=Math.round(i-f*60*60-y*60);return f+":"+(y<10?"0"+y:y)+":"+(p<10?"0"+p:p)},unformat:function(i){var c=i.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 md=ud();const Zs=yr(md),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),st=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fd={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:st},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Oe=(e,t)=>{const n=fd[`_${Wt[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",Wt={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 ja(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 pd(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 l(f){if(f<10)return t[f];if(f<20)return n[f-11];{const y=f%10,p=Math.floor(f/10);return`${r[p]}${y?" "+t[y]:""}`}}function o(f){var y=f.toString(),p,v,_,E,S,T,D,$,k,J,re,te,de="and";if(y=y.replace(/[, ]/g,""),parseInt(y)===0)return"zero";for(p=["","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=y.length,T=[];E>0;)S=E,T.push(y.slice(E=Math.max(0,E-3),S));if(D=T.length,D>_.length)return"";for(te=[],J=0;J<D;J++)$=parseInt(T[J]),$&&(k=T[J].split("").reverse().map(parseFloat),k[1]===1&&(k[0]+=10),(re=_[J])&&te.push(re),(re=p[k[0]])&&te.push(re),(re=v[k[1]])&&te.push(re),(k[0]||k[1])&&(k[2]||J+1>D)&&te.push(de),(re=p[k[2]])&&te.push(re+" Hundred"));return te.reverse().join(" ")}const[a,m]=e.toString().split("."),u=o(parseInt(a,10)),i=l(parseInt(m,10)),c=i?`${i} Paise`:"";return`${u} Rupees ${c&&"And "+c?c:""} Only`}const le=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${Oe(e||0,t)}`:`${Wt[t].symbol} ${Oe(e||0,t)}`},G=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${ja(e||0,t)}`:`${Wt[t].symbol} ${ja(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},yd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},l=n==null?void 0:n.separateItemsDisc;return e.forEach(a=>{var m;(m=a.discounts)==null||m.forEach(u=>{if(u.type){let i=`${u[t]}`;u.type==="DISCOUNT_ITEMS"&&l&&(i=`${u[t]}::${u.discountType}::${u.discountValue}`),r[i]?r[i].discountAmt+=u.discountAmt:r[i]={type:u.type,discountType:u.discountType,discountValue:u.discountValue,discountAmt:yd(u.discountAmt),discountName:u.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(l=>{var o;(o=l.dish_charges)==null||o.forEach(a=>{const m=`${a[t]}`;n[m]?(n[m].amt+=a.amt,n[m].taxAmt+=a.taxAmt):n[m]={amt:a.amt,chargeType:a.chargeType?a.chargeType:a.type,defaultSelcted:a.defaultSelcted,rate:a.rate,tax:a.tax,taxAmt:a.taxAmt,name:a.name,type:a.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 fs(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),l=Buffer.from(t,"utf8"),o=[n,r,l];return Buffer.concat(o)}function gd(e,t,n,r,l){const o=fs("1",e),a=fs("2",t),m=fs("3",n),u=fs("4",r),i=fs("5",l);var c=Buffer.concat([o,a,m,u,i]);return c.toString("base64")}const xd=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"}),Nd=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},ps=tr(),jd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,l=parseInt(r);if(l>60){var o=Math.floor(t/3600),a=Math.floor(t%3600/60),m=`${o} hr ${a} min`;return m}else return r},vd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const l=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],o=ms(l,"internalName");let a;for(let m in e.paymentModes)!r[m]&&e.paymentModes[m]&&(a=o[m],n.push({displayName:a?a.displayName:Ve(m.replace("_"," ")),value:st(e.paymentModes[m])}));return n},_d=(e,t)=>e>0&&t>0?e/t:0;function zt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var l=document.createElement("canvas");l.width=r.width,l.height=r.height;var o=l.getContext("2d");o.drawImage(r,0,0);var a=l.toDataURL("image/png");t(a)},r.onerror=l=>{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(l=>{l.serverName&&l.serverName.includes(t==null?void 0:t.name)&&r.push({...l,value:l[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,f,y;let n,r,l,o,a;const m={},{itemInstructionOnBill:u,printZeroPriceAddons:i}=t;for(let p=0;p<e.length;p++)if(n=e[p],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!i)for(l=[],a=0;a<n.addons.length;a++)o=n.addons[a],o.serviceRate&&l.push(o);else l=n.addons;if(u?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,m[r]){if(m[r].qty+=n.qty,m[r].sub_total+=n.sub_total,(h=m[r].addons)!=null&&h.length&&((f=n.addons)!=null&&f.length)){const v=ms(n.addons,"serviceId"),_=[];let E;for(let S=0;S<m[r].addons.length;S++)o=m[r].addons[S],(y=v[o.serviceId])!=null&&y.serviceId&&(E=v[o.serviceId],o.sub_total+=E.sub_total??0),_.push(o);m[r].addons=_}}else m[r]=JSON.parse(JSON.stringify({...n,addons:l}))}return Object.values(m)},en=e=>{var m;let t,n,r,l,o={},a=0;for(let u=0;u<e.length;u++)if(t=e[u],(m=t.taxation)!=null&&m.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],l=`${r.tax}::${r.taxType??"GST"}`,o[l]?(o[l].taxableAmt=o[l].taxableAmt+(r.taxableAmt??0),o[l].taxAmt=o[l].taxAmt+(r.taxAmt??0),a+=r.taxAmt):(o[l]=JSON.parse(JSON.stringify(r)),a+=r.taxAmt);return{obj:Object.values(o),sum:a}},lr=(e,t,n)=>{var o,a,m,u;let r=n.occupiedServer,l;try{l=r?JSON.parse(r):void 0}catch(i){console.error("Failed to parse serverData:",i),l=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((o=t.siteSetting)==null?void 0:o.billPrinters,l,"label");if(t.type=="PACKAGING_SLIP"){let i=Xs((a=t.siteSetting)==null?void 0:a.packagingSlipPrinters,l,"value");if(ps=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==e.value):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[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((m=t.siteSetting)==null?void 0:m.billPrinters,l,"value");{let i=Xs((u=t.siteSetting)==null?void 0:u.printers,l,"value");if(i===!0)return i;if(ps=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[c]]:null}}}},bd=(e,t,n={})=>{var E;const{usersObj:r,stationList:l}=n;let o={},a,m;const{cancelledKOT:u,onlyCancelledItems:i,kotStatus:c="KOT_GENERATED"}=n,h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=ft(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(m=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{a=S.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,D)=>{var Z,X,q;let $=T.station?T.station.split("::"):"",k=$&&$.length>1?$[1]:$[0],J=e.tableNo?e.tableNo.split("::"):null,re=J&&J.length>0?J[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?re:e.orderFrom,de;(Z=r==null?void 0:r[S.createdBy])!=null&&Z.name&&(de=r[S.createdBy].name);let be=!1;(u||k&&T.status==c)&&(be=!0),be&&or(k,l)&&(o[k]||(o[k]={},o[k].station=k,o[k].services=[],o[k].tableName=te,o[k].customerName=e.name==t.companyName?null:e.name,o[k].time=R().format("DD-MM-YYYY hh:mm a"),o[k].type=e.orderFrom,o[k].subOrderFrom=e.subOrderFrom,o[k].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,o[k].orderId=new Set([o[k].orderId]),o[k].instruction=e.instruction,o[k].orderSource=e.orderSource,o[k].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,o[k].aggregatorOrderId=e.externalOrderId,o[k].otp=e.otp,o[k].totalQty=0,o[k].tokenId=e.tokenId,o[k].kotId=T.kotId?new Set([T.kotId]):null,o[k].waiterName=e.waiterName,o[k].duplicate=u,o[k].createdBy=de,o[k].zomatoInstant=h,m&&(o[k].customFields=m),i&&(o[k].onlyCancelledItems=i),e.preparationTime&&(o[k].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),o[k]?(o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:T.isUrgent,index:D,status:T.status,addons:T.addons}),o[k].totalQty+=ve(T.qty),(X=o[k].kotId)==null||X.add(T.kotId),e.externalOrderId||e.offlineOrderId||(q=o[k].orderId)==null||q.add(S.subOrderId)):(o[k]=[],o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:S.subOrderId,index:D,status:T.status}),o[k].totalQty+=ve(T.qty)))})});let f={},y="2INCH";tr();let p,v=[],_={};for(const S in o)if(Object.hasOwnProperty.call(o,S)){const T=o[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==T.station.toUpperCase()&&(p=ps=="Android OS"?D:D.value??void 0,y=D.paperSize?D.paperSize:t.printerSize,v.push({printer:p,paperSize:y}))}),v.length==0&&v.push({printer:p,paperSize:t.printerSize||y});for(let D=0;D<T.services.length;D++){let $=T.services[D],k=e.orderList.find(re=>re.subOrderId==$.subOrderId),J=f[$.subOrderId];k&&(J?J.services.push(k.services[$.index]):(f[$.subOrderId]={},f[$.subOrderId].subOrderId=k.subOrderId,f[$.subOrderId].services=[k.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],p=null}for(const S in f)Object.hasOwnProperty.call(f,S)&&f[S];return{obj:o,paperSize:y,printer:p,printersMap:_}},Sd=(e,t,n)=>{var l,o;const{kotStatus:r="KOT_GENERATED"}=n;try{let a="2INCH",m,u=[],i,c;const h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((l=e.customFeilds)!=null&&l.length){let f=ft(e.customFeilds,"INSTRUCTION","customType");f!=null&&f.customValue&&(c=[{customName:f.customName,customValue:f.customValue}])}for(let f=0;f<t.packagingSlipPrinters.length;f++)if(i=t.packagingSlipPrinters[f],i.label==e.subOrderFrom&&(m=ps=="Android OS"?i:i.value??void 0,a=i.paperSize?i.paperSize:a,i.paperSize)){let y,p,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:R().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},T={},D=!1,$,k=0;for(e.preparationTime&&(S.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(y=e.orderList[v],_=0;_<y.services.length;_++)p=y.services[_],p={...p,instruction:p.isUrgent&&p.instruction?`(URGENT -${p.instruction})`:p.instruction?`(${p.instruction})`:p.isUrgent?"(URGENT)":null},D=!1,p.status===r&&((o=i.stations)!=null&&o.length?($=cd(i.stations),$[p.station]&&(D=!0)):D=!0),D&&p.kotId&&p.station&&(E=p.station.split("::")[1],k+=p.qty,T[`${E}/${p.kotId}`]?T[`${E}/${p.kotId}`].push(p):T[`${E}/${p.kotId}`]=[p]);Object.keys(T).length&&(S.services=T,S.totalQty=st(k),u.push({printer:m,paperSize:a,obj:S}))}return{printers:u}}catch(a){console.log(a)}},Td=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(u=>{u.services.forEach(i=>{var c;if((i.status==="KOT_GENERATED"||i.status==="IN_PROCESS")&&i.station){let h=(c=i.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[i.kotId]=i.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[i.kotId]:i.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:i.id})}})});else{let u,i,c,h,f={},y=[];for(i=0;i<n.sources.length;i++)for(u=n.sources[i],y.push(u.tableNo),c=0;c<u.ids.length;c++)h=u.ids[c],f[h]=h;for(let p=0;p<n.orderData.length;p++)u=n.orderData[p],f[u.id]&&u.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:y,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let l="2INCH",o,a=[],m={};for(const u in r)if(Object.hasOwnProperty.call(r,u)){const i=r[u];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==i.station.toUpperCase()&&(o=c.value?ps=="Android OS"?c:c.value:void 0,l=c.paperSize?c.paperSize:t.printerSize,a.push({printer:o,paperSize:l}))}),a.length==0&&a.push({printer:o,paperSize:t.printerSize||l})}catch(c){console.log(c)}m[u]=a,a=[],o=null}return{obj:r,paperSize:l,printersMap:m}},wd=(e,t)=>{var T,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:l,dailyExpanse:o,collectionDate:a,rangeDate:m}=t,u={},i;const c=!!ft(n,"dine-in","slugName").slugName;if(l!=null&&l.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...k}=l;l={...k,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,f=h?r.aggregator_collection:void 0,y=h?r.zomato_collection:void 0,p=h?r.swiggy_collection:void 0,v=c?jd(r.avgTableTime):void 0;i={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const k in $)k.endsWith("collection")?i[ts(k)]=st($[k]):i[ts(k)]=$[k]}if(r.swiggy_aggregator&&(i.Swiggy=r.swiggy_aggregator,i.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(i.Zomato=r.zomato_aggregator,i.Zomato_collection=r.zomato_collection),r.itemTypeList&&((T=Object.keys(r.itemTypeList))!=null&&T.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=a;return m.toDate!==m.fromDate&&(E=`${rr(m.fromDate)} - ${rr(m.toDate)}`),{salesCollection:c?{...r,totalCollection:st(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:f,zomato_aggregator_collection:y,swiggy_aggregator_collection:p,itemTypes:u}:void 0,todayCollection:vd(l,e.paymentModes),totalCollection:st(l.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:_d(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:o&&((D=o.DEBIT)!=null&&D.total)?st(o.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?st(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?st(r.totalBalanceAmt):0,dailyExpanse:o,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:l.refundAmt,writeOffAmt:l.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...i},selectedDate:E,id:Math.random(),otherFields:{salesCollection:l.salesCollection?st(l.salesCollection):0,outstandingAmt:l.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},Id=(e,t,n={})=>new Promise(async(r,l)=>{var h,f,y;const{invoiceFormat:o,userData:a}=n;let m,u,i=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let X=0;X<e.appliedDiscounts.length;X++)m=e.appliedDiscounts[X],c+=m.discountAmt}const p=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const X=ft(e.customFeilds,"INSTRUCTION","customType");X!=null&&X.customValue&&(i=[{customName:X.customName,customValue:X.customValue}])}m={};let v=(y=t==null?void 0:t.footerAddress)!=null&&y.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:"",T=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:T,companyContact:t.contactNumber,companyEmail:t.contactEmail},J={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},re={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),de={...e,companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},be=null,Z=null;o.companyLogo&&(be=await zt(`https://${o.companyLogo.bucket}.s3.amazonaws.com/${o.companyLogo.key}`)),o.qrcode&&(Z=await zt(`https://${o.qrcode.bucket}.s3.amazonaws.com/${o.qrcode.key}`)),e.orderList.filter(X=>{X.services.forEach(async(q,ue)=>{var De,nt;let z="kitchen",ee=e.tableName?e.tableName:e.orderFrom;z&&(m[z]||(m[z]={},m[z].station=z,m[z].services=[],m[z].tableName=ee,m[z].customerName=e.name,m[z].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),m[z].type=e.orderFrom,m[z].orderId=e.orderId,m[z].instruction=e.instruction,m[z].totalQty=0,m[z].tokenId=e.tokenId,m[z].orderSource=e.orderSource,m[z].aggregatorOrderId=e.externalOrderId,m[z].otp=e.otp,m[z].paymentState=e.paymentState,m[z].discountAmt=c,m[z].otherCharges=e.otherCharges,m[z].taxAmt=e.taxAmt,m[z].customFeilds=i,m[z].curr=t.curr??"INR",m[z].zomatoInstant=p),m[z]?(u={serviceName:q.serviceName,qty:q.qty,instruction:q.isUrgent&&q.instruction?`(URGENT -${q.instruction})`:q.instruction?`(${q.instruction})`:q.isUrgent?"(URGENT)":"",subOrderId:X.subOrderId,isUrgent:q.isUrgent,index:ue},(De=q.addons)!=null&&De.length&&(u.addons=q.addons),m[z].services.push(u),m[z].totalQty+=q.qty):(m[z]=[],m[z].services.push({serviceName:q.serviceName,qty:q.qty,instruction:q.instruction?q.instruction:"",subOrderId:X.subOrderId,index:ue}),m[z].totalQty+=q.qty),m[z]={...m[z],companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},m[z].domain=o.siteURL,m[z].paymentMethods=o.paymentMode?de.paymentMethods:null,m[z].companyInfo.companyName=o.companyName,m[z].companyInfo.companyEmail=o.email,m[z].companyInfo.companyAddress=o.address,m[z].companyInfo.companyContact=o.mobile,m[z].tokenId=o.token?de.tokenId:null,o.isPayQR&&o.upiId&&o.upiId!==""&&(de.upiId=o.upiId),m[z].gstNo=o.gst?de.gst:null,m[z].footerMessage=o.footerMessage,m[z].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),m[z].fssai=t.fssai,m[z].vatNo=t.vatNo,m[z].printOperatorInfo=o.printOperatorInfo===null||o.printOperatorInfo===!0,m[z].disabledPoweredBy=t.disabledPoweredBy===!0,m[z].printTime=R().format("DD-MM-YYYY hh:mm A"),m[z].printedBy=a.userRole=="admin"?"Admin":a.name,e.deliveryTimestamp&&(m[z].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),m[z].itemInstructionOnBill=o.itemInstructionOnBill,m[z]={...m[z],companyLogo:be,companyQrCode:Z})})});for(const X in m)if(Object.hasOwnProperty.call(m,X)){const q=m[X];try{let ue=t.printerSize??"2inch";r(new Object({obj:new Object({...q,paperSize:ue}),orderList:e.orderList}));return}catch(ue){console.log(ue)}}}catch(p){console.log("err::",p)}}),Cd=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let f=0;f<e[h].orderList.length;f++)t.push(e[h].orderList[f]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let f=0;f<t[h].services.length;f++)t[h].services[f].status!="CANCELLED"&&t[h].services[f].status!="RETURNED"&&t[h].services[f].status!="SHIFTED"&&n.push(t[h].services[f]);let r={},l=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let f=0;f<n[h].addons.length;f++){let y={...n[h].addons[f]};y.qty=n[h].qty,l.push(y)}n.forEach(h=>{let{attachedCat:f,serviceId:y}=h;r[f]||(r[f]=[]);let p=r[f].findIndex(v=>v.serviceId===y);p!==-1?r[f][p].qty=r[f][p].qty+h.qty:r[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const o=Object.keys(r).sort(),a={};o.forEach(h=>{a[h]=r[h]});for(let h in a)a[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));let m={Category:a},u={};l.forEach(h=>{let{attachedAddonCat:f,serviceId:y}=h;u[f]||(u[f]=[]);let p=u[f].findIndex(v=>v.serviceId===y);p!==-1?u[f][p].qty=u[f][p].qty+h.qty:u[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const i=Object.keys(u).sort(),c={};i.forEach(h=>{c[h]=u[h]});for(let h in c)c[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));return m.Addon=c,m},va={"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"},_a=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return va[t]?va[t]:"SGST"},ba=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c,h,f;try{const{invoiceFormat:y,custName:p,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let T=E==null?void 0:E.userRole;if(E.userRole=="admin"?T="ADMIN":T=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=$?(a=$[0])!=null&&a.paperSize?(m=$[0])==null?void 0:m.paperSize:D||"2INCH":D;let k=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",J=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",re=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",de=(k!=""?k+",":"")+(J!=""?J+",":"")+(re!=""?re+",":"")+(te!=""?te+",":""),be=t.gstNo,Z={companyName:t.companyName,companyAddress:de,companyContact:t.contactNumber,companyEmail:t.contactEmail},q={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ue={custName:y&&y.custName?p==t.companyName?null:p:null,custAddress:y&&y.custAddress&&_||null,custContact:y&&y.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},z=Js(t.curr),ee={...e,companyInfo:Z,orderInfo:q,customerInfo:ue,gst:be,curr:z};if(y){if(ee.domain=y.siteURL,ee.paymentMethods=y.paymentMode?ee.paymentMethods:null,ee.companyInfo.companyName=y.companyName,ee.companyInfo.companyEmail=y.email,ee.companyInfo.companyAddress=y.address,ee.companyInfo.companyContact=y.mobile,ee.customerInfo.custName=y.custName?p:null,ee.tokenId=y.token?ee.tokenId:null,y.isPayQR&&y.upiId&&y.upiId!==""&&(ee.upiId=y.upiId),ee.gstNo=y.gst?ee.gst:null,ee.footerMessage=y.footerMessage,ee.orderFrom=(u=e.subOrderFrom)==null?void 0:u.toUpperCase(),ee.fssai=t.fssai,ee.vatNo=t.vatNo,ee.invoiceType=t.invoiceType,ee.taxLabel=_a(t),ee.printOperatorInfo=y.printOperatorInfo===null||y.printOperatorInfo===!0,ee.disabledPoweredBy=t.disabledPoweredBy===!0,ee.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(ee.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),ee.itemInstructionOnBill=y.itemInstructionOnBill,ee.printHSNCodeOnBill=y.printHSNCodeOnBill,ee.noOfInvoice=y.noOfInvoice,ee.printby=T,ee.newFormat=!0,!(y.itemInstructionOnBill||y.printHSNCodeOnBill)&&((i=ee.itemList)!=null&&i.length)){let se;for(let Se=0;Se<ee.itemList.length;Se++)se=ee.itemList[Se],se.instruction&&delete se.instruction,se.hsnCode&&delete se.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(ee.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let De=[];if((h=e.customFeilds)!=null&&h.length){let se;for(let Se=0;Se<e.customFeilds.length;Se++)se=e.customFeilds[Se],se!=null&&se.customValue&&((f=se.availability)!=null&&f.includes("BILL"))&&De.push({customName:se.customName,customValue:se.customValue});ee.customFields=De}let nt=null,At=null;y.companyLogo&&(nt=await zt(`https://${y.companyLogo.bucket}.s3.amazonaws.com/${y.companyLogo.key}`)),y.qrcode&&(At=await zt(`https://${y.qrcode.bucket}.s3.amazonaws.com/${y.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let pt={};(function(){let se,Se,yt=0,Ke=0,g=0,d=0,C=0,j=0,w=0,Y=0,b=[],F=[],V=0,fe;if(D==="A4"||D==="A5"){for(Se=0;Se<S.length;Se++)se=S[Se],Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0),V+=se.qty;let Me=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(Me);let{obj:Ce,sum:Ye}=en(S);pt={itemList:ir(S,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Ce,subTotal:ve(Ke),afterDisc:ve(g),afterCharges:ve(d),total:ve(yt+Ye),qty:V}}else{let{obj:Me}=en(S);for(ee.taxation=Me,Se=0;Se<S.length;Se++)se=S[Se],se.taxType==="VAT"?(F.push(se),Y+=se.sub_total,j+=se.afterdiscAmt,C+=se.afterdiscAmt+(se.total_charges??0),w+=se.afterdiscAmt+(se.total_charges??0)):(b.push(se),Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0));if(b.length){let Le=sr(b,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(b);pt.GST={itemList:ir(b,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(b,"name"),taxation:Ye,subTotal:ve(Ke),afterDisc:ve(g),afterCharges:ve(d),total:ve(yt+Qe)}}if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(F);pt.VAT={itemList:ir(F,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(F,"name"),taxation:Ye,subTotal:ve(Y),afterDisc:ve(j),afterCharges:ve(C),total:ve(w+Qe)}}}})(),ee.distributedData=pt;let Et={obj:ee,companyLogo:nt,companyQrCode:At,paperSize:t.printerSize,Name:o};r(Et)}}catch(y){console.log("err",y),l(y)}}),Od=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c;try{const{invoiceFormat:h,custName:f,custMobile:y,custAddress:p,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(T!=""?T+",":""),$=t.gstNo,k={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},re={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?R.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?f==t.companyName?null:f:null,custAddress:h&&h.custAddress&&p||null,custContact:h&&h.custMobile?y:null,custEmail:"ajaybaglane7@gmail.com"},de=Js(t.curr),be="",Z={...e,companyInfo:k,orderInfo:re,customerInfo:te,gst:$,curr:de};if(h){if(Z.domain=h.siteURL,Z.paymentMethods=h.paymentMode?Z.paymentMethods:null,Z.companyInfo.companyName=h.companyName,Z.companyInfo.companyEmail=h.email,Z.companyInfo.companyAddress=h.address,Z.companyInfo.companyContact=h.mobile,Z.customerInfo.custName=h.custName?f:null,Z.tokenId=h.token?Z.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Z.upiId=h.upiId),Z.gstNo=h.gst?Z.gst:null,Z.footerMessage=h.footerMessage,Z.orderFrom=(a=v.subOrderFrom)==null?void 0:a.toUpperCase(),Z.fssai=t.fssai,Z.vatNo=t.vatNo,Z.taxLabel=_a(t),Z.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Z.disabledPoweredBy=t.disabledPoweredBy===!0,Z.printTime=R().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Z.deliveryTimestamp=R.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Z.itemInstructionOnBill=h.itemInstructionOnBill,Z.printHSNCodeOnBill=h.printHSNCodeOnBill,Z.noOfInvoice=h.noOfInvoice,Z.area=v.area,Z.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((m=Z.itemList)!=null&&m.length)){let q;for(let ue=0;ue<Z.itemList.length;ue++)q=Z.itemList[ue],q.instruction&&delete q.instruction,q.hsnCode&&delete q.hsnCode}t.enabledOutstandingOnPay&&((u=e.custoutStandingData)!=null&&u.balanceAmt)&&(Z.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let X=[];if((i=v.customFeilds)!=null&&i.length){let q;for(let ue=0;ue<v.customFeilds.length;ue++)q=v.customFeilds[ue],q!=null&&q.customValue&&((c=q.availability)!=null&&c.includes("BILL"))&&X.push({customName:q.customName,customValue:q.customValue});Z.customFields=X}if(t&&t.isOld&&t.isOld==!0){let q=null,ue=null;h.companyLogo&&(q=await zt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(ue=await zt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let z={obj:Z,companyLogo:q,companyQrCode:ue,paperSize:t.printerSize,Name:o};r(z)}}}catch(h){console.log("err",h)}}),Md=(e,t)=>new Promise(async(n,r)=>{var T;let l;(T=t.siteLogo)!=null&&T.key;let o=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",a=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",m=t.footerAddress.city?t.footerAddress.city:"",u=t.footerAddress.zip?t.footerAddress.zip:"",i=(o!=""?o+",":"")+(a!=""?a+",":"")+(m!=""?m+",":"")+(u!=""?u+",":""),c=[],h,f=0,y=0,p=0,v=[],_,E;const S=ms(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}),f+=h.finalAmount,y+=h.paidAmt,p+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:R.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:ve(E.paidAmt)});n({logo:l,companyAddress:i,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:f,totalPaid:y,totalPayable:p,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Ad=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 l;r.newFormat?l=await ba({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):l=await Od(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(l)}),Sa=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,l=e[n];l.newId=r,t.push(l)}return t},or=(e,t)=>{var r,l;if(!(t!=null&&t.length))return!0;let n=t.findIndex(o=>o.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(l=t[n])==null?void 0:l.printKot};function Ed(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"),l=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(l),t&&(r.href=t),l.href=e,l.href}const Rd=(()=>{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 Vt=null;function Ta(e={}){return Vt||(e.includeStyleProperties?(Vt=e.includeStyleProperties,Vt):(Vt=_t(window.getComputedStyle(document.documentElement)),Vt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Ld(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function wa(e,t={}){const n=t.width||Ld(e),r=t.height||kd(e);return{width:n,height:r}}function Pd(){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 Fd(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 Dd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yd(e,t,n){const r="http://www.w3.org/2000/svg",l=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return l.setAttribute("width",`${t}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),l.appendChild(o),o.appendChild(e),Dd(l)}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 Ud(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function $d(e,t){return Ta(t).map(n=>{const r=e.getPropertyValue(n),l=e.getPropertyPriority(n);return`${n}: ${r}${l?" !important":""};`}).join(" ")}function Hd(e,t,n,r){const l=`.${e}:${t}`,o=n.cssText?Ud(n):$d(n,r);return document.createTextNode(`${l}{${o}}`)}function Ia(e,t,n,r){const l=window.getComputedStyle(e,n),o=l.getPropertyValue("content");if(o===""||o==="none")return;const a=Rd();try{t.className=`${t.className} ${a}`}catch{return}const m=document.createElement("style");m.appendChild(Hd(a,n,l,r)),t.appendChild(m)}function Bd(e,t,n){Ia(e,t,":before",n),Ia(e,t,":after",n)}const Ca="application/font-woff",Oa="image/jpeg",Gd={woff:Ca,woff2:Ca,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oa,jpeg:Oa,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 Gd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Vd(e,t){return`data:${t};base64,${e}`}async function Ma(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const l=await r.blob();return new Promise((o,a)=>{const m=new FileReader;m.onerror=a,m.onloadend=()=>{try{o(n({res:r,result:m.result}))}catch(u){a(u)}},m.readAsDataURL(l)})}const hr={};function qd(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=qd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let l;try{const o=await Ma(e,n.fetchRequestInit,({res:a,result:m})=>(t||(t=a.headers.get("Content-Type")||""),zd(m)));l=Vd(o,t)}catch(o){l=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return hr[r]=l,l}async function Kd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Qd(e,t){if(e.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,a==null||a.drawImage(e,0,0,o.width,o.height);const m=o.toDataURL();return sn(m)}const n=e.poster,r=cr(n),l=await ur(n,r,t);return sn(l)}async function Zd(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 Jd(e,t){return Re(e,HTMLCanvasElement)?Kd(e):Re(e,HTMLVideoElement)?Qd(e,t):Re(e,HTMLIFrameElement)?Zd(e,t):e.cloneNode(Aa(e))}const Xd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Aa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function eh(e,t,n){var r,l;if(Aa(t))return t;let o=[];return Xd(e)&&e.assignedNodes?o=_t(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=_t(e.contentDocument.body.childNodes):o=_t(((l=e.shadowRoot)!==null&&l!==void 0?l:e).childNodes),o.length===0||Re(e,HTMLVideoElement)||await o.reduce((a,m)=>a.then(()=>nn(m,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function th(e,t,n){const r=t.style;if(!r)return;const l=window.getComputedStyle(e);l.cssText?(r.cssText=l.cssText,r.transformOrigin=l.transformOrigin):Ta(n).forEach(o=>{let a=l.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(o,a,l.getPropertyPriority(o))})}function sh(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(l=>e.value===l.getAttribute("value"));r&&r.setAttribute("selected","")}}function rh(e,t,n){return Re(t,Element)&&(th(e,t,n),Bd(e,t,n),sh(e,t),nh(e,t)),t}async function ah(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;o<n.length;o++){const m=n[o].getAttribute("xlink:href");if(m){const u=e.querySelector(m),i=document.querySelector(m);!u&&i&&!r[m]&&(r[m]=await nn(i,t,!0))}}const l=Object.values(r);if(l.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const m=document.createElementNS(o,"defs");a.appendChild(m);for(let u=0;u<l.length;u++)m.appendChild(l[u]);e.appendChild(a)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Jd(r,t)).then(r=>eh(e,r,t)).then(r=>rh(e,r,t)).then(r=>ah(r,t))}const Ea=/url\((['"]?)([^'"]+?)\1\)/g,ih=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function oh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ch(e){const t=[];return e.replace(Ea,(n,r,l)=>(t.push(l),n)),t.filter(n=>!dr(n))}async function dh(e,t,n,r,l){try{const o=n?Ed(t,n):t,a=cr(t);let m;return l||(m=await ur(o,a,r)),e.replace(oh(t),`$1${m}$3`)}catch{}return e}function hh(e,{preferredFontFormat:t}){return t?e.replace(lh,n=>{for(;;){const[r,,l]=ih.exec(n)||[];if(!l)return"";if(l===t)return`src: ${r};`}}):e}function Ra(e){return e.search(Ea)!==-1}async function La(e,t,n){if(!Ra(e))return e;const r=hh(e,n);return ch(r).reduce((o,a)=>o.then(m=>dh(m,a,t,n)),Promise.resolve(r))}async function qt(e,t,n){var r;const l=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(l){const o=await La(l,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function uh(e,t){await qt("background",e,t)||await qt("background-image",e,t),await qt("mask",e,t)||await qt("-webkit-mask",e,t)||await qt("mask-image",e,t)||await qt("-webkit-mask-image",e,t)}async function mh(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,l=await ur(r,cr(r),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...u)=>{try{o(t.onImageErrorHandler(...u))}catch(i){a(i)}}:a;const m=e;m.decode&&(m.decode=o),m.loading==="lazy"&&(m.loading="eager"),n?(e.srcset="",e.src=l):e.href.baseVal=l})}async function fh(e,t){const r=_t(e.childNodes).map(l=>ka(l,t));await Promise.all(r).then(()=>e)}async function ka(e,t){Re(e,Element)&&(await uh(e,t),await mh(e,t),await fh(e,t))}function ph(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(l=>{n[l]=r[l]}),e}const Pa={};async function Fa(e){let t=Pa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Pa[e]=t,t}async function Da(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let m=a.replace(r,"$1");return m.startsWith("https://")||(m=new URL(m,e.url).href),Ma(m,t.fetchRequestInit,({result:u})=>(n=n.replace(a,`url(${u})`),[a,u]))});return Promise.all(o).then(()=>n)}function Ya(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=l.exec(r);if(u===null)break;t.push(u[0])}r=r.replace(l,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",m=new RegExp(a,"gi");for(;;){let u=o.exec(r);if(u===null){if(u=m.exec(r),u===null)break;o.lastIndex=m.lastIndex}else m.lastIndex=o.lastIndex;t.push(u[0])}return t}async function yh(e,t){const n=[],r=[];return e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let m=a+1;const u=o.href,i=Fa(u).then(c=>Da(c,t)).then(c=>Ya(c).forEach(h=>{try{l.insertRule(h,h.startsWith("@import")?m+=1:l.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:h,error:f})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(i)}})}catch(o){const a=e.find(m=>m.href==null)||document.styleSheets[0];l.href!=null&&r.push(Fa(l.href).then(m=>Da(m,t)).then(m=>Ya(m).forEach(u=>{a.insertRule(u,a.cssRules.length)})).catch(m=>{console.error("Error loading remote stylesheet",m)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${l.href}`,o)}}),n))}function gh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ra(t.style.getPropertyValue("src")))}async function xh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_t(e.ownerDocument.styleSheets),r=await yh(n,t);return gh(r)}function Ua(e){return e.trim().replace(/["']/g,"")}function Nh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(Ua(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function jh(e,t){const n=await xh(e,t),r=Nh(e);return(await Promise.all(n.filter(o=>r.has(Ua(o.style.fontFamily))).map(o=>{const a=o.parentStyleSheet?o.parentStyleSheet.href:null;return La(o.cssText,a,t)}))).join(`
|
|
46
|
-
`)}async function vh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await jh(e,t);if(n){const r=document.createElement("style"),l=document.createTextNode(n);r.appendChild(l),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function $a(e,t={}){const{width:n,height:r}=wa(e,t),l=await nn(e,t,!0);return await vh(l,t),await ka(l,t),ph(l,t),await Yd(l,n,r)}async function _h(e,t={}){const{width:n,height:r}=wa(e,t),l=await $a(e,t),o=await sn(l),a=document.createElement("canvas"),m=a.getContext("2d"),u=t.pixelRatio||Pd(),i=t.canvasWidth||n,c=t.canvasHeight||r;return a.width=i*u,a.height=c*u,t.skipAutoScale||Fd(a),a.style.width=`${i}`,a.style.height=`${c}`,t.backgroundColor&&(m.fillStyle=t.backgroundColor,m.fillRect(0,0,a.width,a.height)),m.drawImage(o,0,0,a.width,a.height),a}async function bh(e,t={}){return(await _h(e,t)).toDataURL("image/jpeg",t.quality||1)}var Sh=Object.defineProperty,rn=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ga=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,
|
|
45
|
+
*/var hd=Qs.exports,Na;function ud(){return Na||(Na=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(hd,function(){var t,n,r="2.0.6",l={},o={},a={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},m={currentLocale:a.currentLocale,zeroFormat:a.zeroFormat,nullFormat:a.nullFormat,defaultFormat:a.defaultFormat,scalePercentBy100:a.scalePercentBy100};function u(i,c){this._input=i,this._value=c}return t=function(i){var c,h,f,y;if(t.isNumeral(i))c=i.value();else if(i===0||typeof i>"u")c=0;else if(i===null||n.isNaN(i))c=null;else if(typeof i=="string")if(m.zeroFormat&&i===m.zeroFormat)c=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)c=null;else{for(h in l)if(y=typeof l[h].regexps.unformat=="function"?l[h].regexps.unformat():l[h].regexps.unformat,y&&i.match(y)){f=l[h].unformat;break}f=f||t._.stringToNumber,c=f(i)}else c=Number(i)||null;return new u(i,c)},t.version=r,t.isNumeral=function(i){return i instanceof u},t._=n={numberToFormat:function(i,c,h){var f=o[t.options.currentLocale],y=!1,p=!1,v=0,_="",E=1e12,S=1e9,T=1e6,D=1e3,$="",k=!1,J,re,te,de,be,Z,X;if(i=i||0,re=Math.abs(i),t._.includes(c,"(")?(y=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(be=t._.includes(c,"+")?c.indexOf("+"):i<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(J=c.match(/a(k|m|b|t)?/),J=J?J[1]:!1,t._.includes(c," a")&&(_=" "),c=c.replace(new RegExp(_+"a[kmbt]?"),""),re>=E&&!J||J==="t"?(_+=f.abbreviations.trillion,i=i/E):re<E&&re>=S&&!J||J==="b"?(_+=f.abbreviations.billion,i=i/S):re<S&&re>=T&&!J||J==="m"?(_+=f.abbreviations.million,i=i/T):(re<T&&re>=D&&!J||J==="k")&&(_+=f.abbreviations.thousand,i=i/D)),t._.includes(c,"[.]")&&(p=!0,c=c.replace("[.]",".")),te=i.toString().split(".")[0],de=c.split(".")[1],Z=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,de?(t._.includes(de,"[")?(de=de.replace("]",""),de=de.split("["),$=t._.toFixed(i,de[0].length+de[1].length,h,de[1].length)):$=t._.toFixed(i,de.length,h),te=$.split(".")[0],t._.includes($,".")?$=f.delimiters.decimal+$.split(".")[1]:$="",p&&Number($.slice(1))===0&&($="")):te=t._.toFixed(i,0,h),_&&!J&&Number(te)>=1e3&&_!==f.abbreviations.trillion)switch(te=String(Number(te)/1e3),_){case f.abbreviations.thousand:_=f.abbreviations.million;break;case f.abbreviations.million:_=f.abbreviations.billion;break;case f.abbreviations.billion:_=f.abbreviations.trillion;break}if(t._.includes(te,"-")&&(te=te.slice(1),k=!0),te.length<v)for(var K=v-te.length;K>0;K--)te="0"+te;return Z>-1&&(te=te.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+f.delimiters.thousands)),c.indexOf(".")===0&&(te=""),X=te+$+(_||""),y?X=(y&&k?"(":"")+X+(y&&k?")":""):be>=0?X=be===0?(k?"-":"+")+X:X+(k?"-":"+"):k&&(X="-"+X),X},stringToNumber:function(i){var c=o[m.currentLocale],h=i,f={thousand:3,million:6,billion:9,trillion:12},y,p,v;if(m.zeroFormat&&i===m.zeroFormat)p=0;else if(m.nullFormat&&i===m.nullFormat||!i.replace(/[^0-9]+/g,"").length)p=null;else{p=1,c.delimiters.decimal!=="."&&(i=i.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(y in f)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[y]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),h.match(v)){p*=Math.pow(10,f[y]);break}p*=(i.split("-").length+Math.min(i.split("(").length-1,i.split(")").length-1))%2?1:-1,i=i.replace(/[^0-9\.]+/g,""),p*=Number(i)}return p},isNaN:function(i){return typeof i=="number"&&isNaN(i)},includes:function(i,c){return i.indexOf(c)!==-1},insert:function(i,c,h){return i.slice(0,h)+c+i.slice(h)},reduce:function(i,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(i),f=h.length>>>0,y=0,p;if(arguments.length===3)p=arguments[2];else{for(;y<f&&!(y in h);)y++;if(y>=f)throw new TypeError("Reduce of empty array with no initial value");p=h[y++]}for(;y<f;y++)y in h&&(p=c(p,h[y],y,h));return p},multiplier:function(i){var c=i.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var i=Array.prototype.slice.call(arguments);return i.reduce(function(c,h){var f=n.multiplier(h);return c>f?c:f},1)},toFixed:function(i,c,h,f){var y=i.toString().split("."),p=c-(f||0),v,_,E,S;return y.length===2?v=Math.min(Math.max(y[1].length,p),c):v=p,E=Math.pow(10,v),S=(h(i+"e+"+v)/E).toFixed(v),f>c-v&&(_=new RegExp("\\.?0{1,"+(f-(c-v))+"}$"),S=S.replace(_,"")),S}},t.options=m,t.formats=l,t.locales=o,t.locale=function(i){return i&&(m.currentLocale=i.toLowerCase()),m.currentLocale},t.localeData=function(i){if(!i)return o[m.currentLocale];if(i=i.toLowerCase(),!o[i])throw new Error("Unknown locale : "+i);return o[i]},t.reset=function(){for(var i in a)m[i]=a[i]},t.zeroFormat=function(i){m.zeroFormat=typeof i=="string"?i:null},t.nullFormat=function(i){m.nullFormat=typeof i=="string"?i:null},t.defaultFormat=function(i){m.defaultFormat=typeof i=="string"?i:"0.0"},t.register=function(i,c,h){if(c=c.toLowerCase(),this[i+"s"][c])throw new TypeError(c+" "+i+" already registered.");return this[i+"s"][c]=h,h},t.validate=function(i,c){var h,f,y,p,v,_,E,S;if(typeof i!="string"&&(i+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",i)),i=i.trim(),i.match(/^\d+$/))return!0;if(i==="")return!1;try{E=t.localeData(c)}catch{E=t.localeData(t.locale())}return y=E.currency.symbol,v=E.abbreviations,h=E.delimiters.decimal,E.delimiters.thousands==="."?f="\\.":f=E.delimiters.thousands,S=i.match(/^[^\d]+/),S!==null&&(i=i.substr(1),S[0]!==y)||(S=i.match(/[^\d]+$/),S!==null&&(i=i.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(_=new RegExp(f+"{2}"),i.match(/[^\d.,]/g)?!1:(p=i.split(h),p.length>2?!1:p.length<2?!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_):p[0].length===1?!!p[0].match(/^\d+$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/):!!p[0].match(/^\d+.*\d$/)&&!p[0].match(_)&&!!p[1].match(/^\d+$/)))},t.fn=u.prototype={clone:function(){return t(this)},format:function(i,c){var h=this._value,f=i||m.defaultFormat,y,p,v;if(c=c||Math.round,h===0&&m.zeroFormat!==null)p=m.zeroFormat;else if(h===null&&m.nullFormat!==null)p=m.nullFormat;else{for(y in l)if(f.match(l[y].regexps.format)){v=l[y].format;break}v=v||t._.numberToFormat,p=v(h,f,c)}return p},value:function(){return this._value},input:function(){return this._input},set:function(i){return this._value=Number(i),this},add:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f+Math.round(c*y)}return this._value=n.reduce([this._value,i],h,0)/c,this},subtract:function(i){var c=n.correctionFactor.call(null,this._value,i);function h(f,y,p,v){return f-Math.round(c*y)}return this._value=n.reduce([i],h,Math.round(this._value*c))/c,this},multiply:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)*Math.round(f*v)/Math.round(v*v)}return this._value=n.reduce([this._value,i],c,1),this},divide:function(i){function c(h,f,y,p){var v=n.correctionFactor(h,f);return Math.round(h*v)/Math.round(f*v)}return this._value=n.reduce([this._value,i],c),this},difference:function(i){return Math.abs(t(this._value).subtract(i).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(i){var c=i%10;return~~(i%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(i,c,h){var f=t._.includes(c," BPS")?" ":"",y;return i=i*1e4,c=c.replace(/\s?BPS/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"BPS"),y=y.join("")):y=y+f+"BPS",y},unformat:function(i){return+(t._.stringToNumber(i)*1e-4).toFixed(15)}})}(),function(){var i={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=i.suffixes.concat(c.suffixes.filter(function(y){return i.suffixes.indexOf(y)<0})),f=h.join("|");f="("+f.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(f)},format:function(y,p,v){var _,E=t._.includes(p,"ib")?c:i,S=t._.includes(p," b")||t._.includes(p," ib")?" ":"",T,D,$;for(p=p.replace(/\s?i?b/,""),T=0;T<=E.suffixes.length;T++)if(D=Math.pow(E.base,T),$=Math.pow(E.base,T+1),y===null||y===0||y>=D&&y<$){S+=E.suffixes[T],D>0&&(y=y/D);break}return _=t._.numberToFormat(y,p,v),_+S},unformat:function(y){var p=t._.stringToNumber(y),v,_;if(p){for(v=i.suffixes.length-1;v>=0;v--){if(t._.includes(y,i.suffixes[v])){_=Math.pow(i.base,v);break}if(t._.includes(y,c.suffixes[v])){_=Math.pow(c.base,v);break}}p*=_||1}return p}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},p,v,_;for(c=c.replace(/\s?\$\s?/,""),p=t._.numberToFormat(i,c,h),i>=0?(y.before=y.before.replace(/[\-\(]/,""),y.after=y.after.replace(/[\-\)]/,"")):i<0&&!t._.includes(y.before,"-")&&!t._.includes(y.before,"(")&&(y.before="-"+y.before),_=0;_<y.before.length;_++)switch(v=y.before[_],v){case"$":p=t._.insert(p,f.currency.symbol,_);break;case" ":p=t._.insert(p," ",_+f.currency.symbol.length-1);break}for(_=y.after.length-1;_>=0;_--)switch(v=y.after[_],v){case"$":p=_===y.after.length-1?p+f.currency.symbol:t._.insert(p,f.currency.symbol,-(y.after.length-(1+_)));break;case" ":p=_===y.after.length-1?p+" ":t._.insert(p," ",-(y.after.length-(1+_)+f.currency.symbol.length-1));break}return p}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(i,c,h){var f,y=typeof i=="number"&&!t._.isNaN(i)?i.toExponential():"0e+0",p=y.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),f=t._.numberToFormat(Number(p[0]),c,h),f+"e"+p[1]},unformat:function(i){var c=t._.includes(i,"e+")?i.split("e+"):i.split("e-"),h=Number(c[0]),f=Number(c[1]);f=t._.includes(i,"e-")?f*=-1:f;function y(p,v,_,E){var S=t._.correctionFactor(p,v),T=p*S*(v*S)/(S*S);return T}return t._.reduce([h,Math.pow(10,f)],y,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(i,c,h){var f=t.locales[t.options.currentLocale],y,p=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),p+=f.ordinal(i),y=t._.numberToFormat(i,c,h),y+p}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(i,c,h){var f=t._.includes(c," %")?" ":"",y;return t.options.scalePercentBy100&&(i=i*100),c=c.replace(/\s?\%/,""),y=t._.numberToFormat(i,c,h),t._.includes(y,")")?(y=y.split(""),y.splice(-1,0,f+"%"),y=y.join("")):y=y+f+"%",y},unformat:function(i){var c=t._.stringToNumber(i);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(i,c,h){var f=Math.floor(i/60/60),y=Math.floor((i-f*60*60)/60),p=Math.round(i-f*60*60-y*60);return f+":"+(y<10?"0"+y:y)+":"+(p<10?"0"+p:p)},unformat:function(i){var c=i.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 md=ud();const Zs=yr(md),_e=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),st=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),fd={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:st},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:_e}},Oe=(e,t)=>{const n=fd[`_${zt[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",zt={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 ja(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 pd(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 l(f){if(f<10)return t[f];if(f<20)return n[f-11];{const y=f%10,p=Math.floor(f/10);return`${r[p]}${y?" "+t[y]:""}`}}function o(f){var y=f.toString(),p,v,_,E,S,T,D,$,k,J,re,te,de="and";if(y=y.replace(/[, ]/g,""),parseInt(y)===0)return"zero";for(p=["","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=y.length,T=[];E>0;)S=E,T.push(y.slice(E=Math.max(0,E-3),S));if(D=T.length,D>_.length)return"";for(te=[],J=0;J<D;J++)$=parseInt(T[J]),$&&(k=T[J].split("").reverse().map(parseFloat),k[1]===1&&(k[0]+=10),(re=_[J])&&te.push(re),(re=p[k[0]])&&te.push(re),(re=v[k[1]])&&te.push(re),(k[0]||k[1])&&(k[2]||J+1>D)&&te.push(de),(re=p[k[2]])&&te.push(re+" Hundred"));return te.reverse().join(" ")}const[a,m]=e.toString().split("."),u=o(parseInt(a,10)),i=l(parseInt(m,10)),c=i?`${i} Paise`:"";return`${u} Rupees ${c&&"And "+c?c:""} Only`}const le=(e,t)=>{var n;return((n=zt[t])==null?void 0:n.displayType)=="code"?`${t} ${Oe(e||0,t)}`:`${zt[t].symbol} ${Oe(e||0,t)}`},G=(e,t)=>{var n;return((n=zt[t])==null?void 0:n.displayType)=="code"?`${t} ${ja(e||0,t)}`:`${zt[t].symbol} ${ja(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},yd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),sr=(e,t="type",n)=>{const r={},l=n==null?void 0:n.separateItemsDisc;return e.forEach(a=>{var m;(m=a.discounts)==null||m.forEach(u=>{if(u.type){let i=`${u[t]}`;u.type==="DISCOUNT_ITEMS"&&l&&(i=`${u[t]}::${u.discountType}::${u.discountValue}`),r[i]?r[i].discountAmt+=u.discountAmt:r[i]={type:u.type,discountType:u.discountType,discountValue:u.discountValue,discountAmt:yd(u.discountAmt),discountName:u.discountName}}})}),Object.values(r)},nr=(e,t="type")=>{const n={};return e.forEach(l=>{var o;(o=l.dish_charges)==null||o.forEach(a=>{const m=`${a[t]}`;n[m]?(n[m].amt+=a.amt,n[m].taxAmt+=a.taxAmt):n[m]={amt:a.amt,chargeType:a.chargeType?a.chargeType:a.type,defaultSelcted:a.defaultSelcted,rate:a.rate,tax:a.tax,taxAmt:a.taxAmt,name:a.name,type:a.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 ps(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),l=Buffer.from(t,"utf8"),o=[n,r,l];return Buffer.concat(o)}function gd(e,t,n,r,l){const o=ps("1",e),a=ps("2",t),m=ps("3",n),u=ps("4",r),i=ps("5",l);var c=Buffer.concat([o,a,m,u,i]);return c.toString("base64")}const xd=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"}),Nd=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},ys=tr(),jd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,l=parseInt(r);if(l>60){var o=Math.floor(t/3600),a=Math.floor(t%3600/60),m=`${o} hr ${a} min`;return m}else return r},vd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const l=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],o=fs(l,"internalName");let a;for(let m in e.paymentModes)!r[m]&&e.paymentModes[m]&&(a=o[m],n.push({displayName:a?a.displayName:Ve(m.replace("_"," ")),value:st(e.paymentModes[m])}));return n},_d=(e,t)=>e>0&&t>0?e/t:0;function Vt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var l=document.createElement("canvas");l.width=r.width,l.height=r.height;var o=l.getContext("2d");o.drawImage(r,0,0);var a=l.toDataURL("image/png");t(a)},r.onerror=l=>{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(l=>{l.serverName&&l.serverName.includes(t==null?void 0:t.name)&&r.push({...l,value:l[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"OFFER_DISCOUNT":t.OFFER_DISCOUNT?t.OFFER_DISCOUNT.push(n):t.OFFER_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,f,y;let n,r,l,o,a;const m={},{itemInstructionOnBill:u,printZeroPriceAddons:i}=t;for(let p=0;p<e.length;p++)if(n=e[p],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!i)for(l=[],a=0;a<n.addons.length;a++)o=n.addons[a],o.serviceRate&&l.push(o);else l=n.addons;if(u?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,m[r]){if(m[r].qty+=n.qty,m[r].sub_total+=n.sub_total,(h=m[r].addons)!=null&&h.length&&((f=n.addons)!=null&&f.length)){const v=fs(n.addons,"serviceId"),_=[];let E;for(let S=0;S<m[r].addons.length;S++)o=m[r].addons[S],(y=v[o.serviceId])!=null&&y.serviceId&&(E=v[o.serviceId],o.sub_total+=E.sub_total??0),_.push(o);m[r].addons=_}}else m[r]=JSON.parse(JSON.stringify({...n,addons:l}))}return Object.values(m)},en=e=>{var m;let t,n,r,l,o={},a=0;for(let u=0;u<e.length;u++)if(t=e[u],(m=t.taxation)!=null&&m.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],l=`${r.tax}::${r.taxType??"GST"}`,o[l]?(o[l].taxableAmt=o[l].taxableAmt+(r.taxableAmt??0),o[l].taxAmt=o[l].taxAmt+(r.taxAmt??0),a+=r.taxAmt):(o[l]=JSON.parse(JSON.stringify(r)),a+=r.taxAmt);return{obj:Object.values(o),sum:a}},lr=(e,t,n)=>{var o,a,m,u;let r=n.occupiedServer,l;try{l=r?JSON.parse(r):void 0}catch(i){console.error("Failed to parse serverData:",i),l=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return Xs((o=t.siteSetting)==null?void 0:o.billPrinters,l,"label");if(t.type=="PACKAGING_SLIP"){let i=Xs((a=t.siteSetting)==null?void 0:a.packagingSlipPrinters,l,"value");if(ys=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==e.value):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[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((m=t.siteSetting)==null?void 0:m.billPrinters,l,"value");{let i=Xs((u=t.siteSetting)==null?void 0:u.printers,l,"value");if(i===!0)return i;if(ys=="Android OS"){let c=i&&i.length>0?i.findIndex(h=>h.value==(e==null?void 0:e.value)):-1;return c!=-1?[i[c]]:null}else{let c=i&&i.length>0?i.findIndex(h=>h.value==e):-1;return c!=-1?[i[c]]:null}}}},bd=(e,t,n={})=>{var E;const{usersObj:r,stationList:l}=n;let o={},a,m;const{cancelledKOT:u,onlyCancelledItems:i,kotStatus:c="KOT_GENERATED"}=n,h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((E=e.customFeilds)!=null&&E.length){let S=ft(e.customFeilds,"INSTRUCTION","customType");S!=null&&S.customValue&&(m=[{customName:S.customName,customValue:S.customValue}])}e.orderList.filter(S=>{a=S.services.sort(T=>T.status==="CANCELLED"?-1:0),a.forEach((T,D)=>{var Z,X,K;let $=T.station?T.station.split("::"):"",k=$&&$.length>1?$[1]:$[0],J=e.tableNo?e.tableNo.split("::"):null,re=J&&J.length>0?J[0]:e.orderFrom,te=e.tableName?e.tableName:e.tableNo?re:e.orderFrom,de;(Z=r==null?void 0:r[S.createdBy])!=null&&Z.name&&(de=r[S.createdBy].name);let be=!1;(u||k&&T.status==c)&&(be=!0),be&&or(k,l)&&(o[k]||(o[k]={},o[k].station=k,o[k].services=[],o[k].tableName=te,o[k].customerName=e.name==t.companyName?null:e.name,o[k].time=R().format("DD-MM-YYYY hh:mm a"),o[k].type=e.orderFrom,o[k].subOrderFrom=e.subOrderFrom,o[k].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:S.subOrderId,o[k].orderId=new Set([o[k].orderId]),o[k].instruction=e.instruction,o[k].orderSource=e.orderSource,o[k].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,o[k].aggregatorOrderId=e.externalOrderId,o[k].otp=e.otp,o[k].totalQty=0,o[k].tokenId=e.tokenId,o[k].kotId=T.kotId?new Set([T.kotId]):null,o[k].waiterName=e.waiterName,o[k].duplicate=u,o[k].createdBy=de,o[k].zomatoInstant=h,m&&(o[k].customFields=m),i&&(o[k].onlyCancelledItems=i),e.preparationTime&&(o[k].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),o[k]?(o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.isUrgent&&T.instruction?`(URGENT -${T.instruction})`:T.instruction?`(${T.instruction})`:T.isUrgent?"(URGENT)":"",subOrderId:S.subOrderId,isUrgent:T.isUrgent,index:D,status:T.status,addons:T.addons}),o[k].totalQty+=_e(T.qty),(X=o[k].kotId)==null||X.add(T.kotId),e.externalOrderId||e.offlineOrderId||(K=o[k].orderId)==null||K.add(S.subOrderId)):(o[k]=[],o[k].services.push({serviceName:T.serviceName,qty:T.qty,instruction:T.instruction?T.instruction:"",subOrderId:S.subOrderId,index:D,status:T.status}),o[k].totalQty+=_e(T.qty)))})});let f={},y="2INCH";tr();let p,v=[],_={};for(const S in o)if(Object.hasOwnProperty.call(o,S)){const T=o[S];try{t.printers&&t.printers.map(D=>{D.label.toUpperCase()==T.station.toUpperCase()&&(p=ys=="Android OS"?D:D.value??void 0,y=D.paperSize?D.paperSize:t.printerSize,v.push({printer:p,paperSize:y}))}),v.length==0&&v.push({printer:p,paperSize:t.printerSize||y});for(let D=0;D<T.services.length;D++){let $=T.services[D],k=e.orderList.find(re=>re.subOrderId==$.subOrderId),J=f[$.subOrderId];k&&(J?J.services.push(k.services[$.index]):(f[$.subOrderId]={},f[$.subOrderId].subOrderId=k.subOrderId,f[$.subOrderId].services=[k.services[$.index]]))}}catch(D){console.log(D)}_[S]=v,v=[],p=null}for(const S in f)Object.hasOwnProperty.call(f,S)&&f[S];return{obj:o,paperSize:y,printer:p,printersMap:_}},Sd=(e,t,n)=>{var l,o;const{kotStatus:r="KOT_GENERATED"}=n;try{let a="2INCH",m,u=[],i,c;const h=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((l=e.customFeilds)!=null&&l.length){let f=ft(e.customFeilds,"INSTRUCTION","customType");f!=null&&f.customValue&&(c=[{customName:f.customName,customValue:f.customValue}])}for(let f=0;f<t.packagingSlipPrinters.length;f++)if(i=t.packagingSlipPrinters[f],i.label==e.subOrderFrom&&(m=ys=="Android OS"?i:i.value??void 0,a=i.paperSize?i.paperSize:a,i.paperSize)){let y,p,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:R().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},T={},D=!1,$,k=0;for(e.preparationTime&&(S.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(y=e.orderList[v],_=0;_<y.services.length;_++)p=y.services[_],p={...p,instruction:p.isUrgent&&p.instruction?`(URGENT -${p.instruction})`:p.instruction?`(${p.instruction})`:p.isUrgent?"(URGENT)":null},D=!1,p.status===r&&((o=i.stations)!=null&&o.length?($=cd(i.stations),$[p.station]&&(D=!0)):D=!0),D&&p.kotId&&p.station&&(E=p.station.split("::")[1],k+=p.qty,T[`${E}/${p.kotId}`]?T[`${E}/${p.kotId}`].push(p):T[`${E}/${p.kotId}`]=[p]);Object.keys(T).length&&(S.services=T,S.totalQty=st(k),u.push({printer:m,paperSize:a,obj:S}))}return{printers:u}}catch(a){console.log(a)}},Td=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(u=>{u.services.forEach(i=>{var c;if((i.status==="KOT_GENERATED"||i.status==="IN_PROCESS")&&i.station){let h=(c=i.station.split("::"))==null?void 0:c[1];h&&or(h,n.stationList)&&(r[h]?r[h].activeKots[i.kotId]=i.kotId:r[h]={from:[n.from],to:[n.to],station:h,activeKots:{[i.kotId]:i.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:i.id})}})});else{let u,i,c,h,f={},y=[];for(i=0;i<n.sources.length;i++)for(u=n.sources[i],y.push(u.tableNo),c=0;c<u.ids.length;c++)h=u.ids[c],f[h]=h;for(let p=0;p<n.orderData.length;p++)u=n.orderData[p],f[u.id]&&u.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:y,to:[n.to],station:S,activeKots:{[_.kotId]:_.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:_.id})}})})}let l="2INCH",o,a=[],m={};for(const u in r)if(Object.hasOwnProperty.call(r,u)){const i=r[u];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==i.station.toUpperCase()&&(o=c.value?ys=="Android OS"?c:c.value:void 0,l=c.paperSize?c.paperSize:t.printerSize,a.push({printer:o,paperSize:l}))}),a.length==0&&a.push({printer:o,paperSize:t.printerSize||l})}catch(c){console.log(c)}m[u]=a,a=[],o=null}return{obj:r,paperSize:l,printersMap:m}},wd=(e,t)=>{var T,D;let{serviceTypeConfig:n,salesCollection:r,todayCollection:l,dailyExpanse:o,collectionDate:a,rangeDate:m}=t,u={},i;const c=!!ft(n,"dine-in","slugName").slugName;if(l!=null&&l.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:$,...k}=l;l={...k,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,f=h?r.aggregator_collection:void 0,y=h?r.zomato_collection:void 0,p=h?r.swiggy_collection:void 0,v=c?jd(r.avgTableTime):void 0;i={};let _=0;if(r!=null&&r.menuWiseSales){const $=r.menuWiseSales;for(const k in $)k.endsWith("collection")?i[ss(k)]=st($[k]):i[ss(k)]=$[k]}if(r.swiggy_aggregator&&(i.Swiggy=r.swiggy_aggregator,i.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(i.Zomato=r.zomato_aggregator,i.Zomato_collection=r.zomato_collection),r.itemTypeList&&((T=Object.keys(r.itemTypeList))!=null&&T.length))for(let $ in r.itemTypeList)_+=r.itemTypeList[$];let E=a;return m.toDate!==m.fromDate&&(E=`${rr(m.fromDate)} - ${rr(m.toDate)}`),{salesCollection:c?{...r,totalCollection:st(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:f,zomato_aggregator_collection:y,swiggy_aggregator_collection:p,itemTypes:u}:void 0,todayCollection:vd(l,e.paymentModes),totalCollection:st(l.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:_d(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:o&&((D=o.DEBIT)!=null&&D.total)?st(o.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?st(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?st(r.totalBalanceAmt):0,dailyExpanse:o,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:l.refundAmt,writeOffAmt:l.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...i},selectedDate:E,id:Math.random(),otherFields:{salesCollection:l.salesCollection?st(l.salesCollection):0,outstandingAmt:l.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:_,itemTypeList:r.itemTypeList}}},Id=(e,t,n={})=>new Promise(async(r,l)=>{var h,f,y;const{invoiceFormat:o,userData:a}=n;let m,u,i=[],c;try{if((h=e.appliedDiscounts)!=null&&h.length){c=0;for(let X=0;X<e.appliedDiscounts.length;X++)m=e.appliedDiscounts[X],c+=m.discountAmt}const p=ft(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const X=ft(e.customFeilds,"INSTRUCTION","customType");X!=null&&X.customValue&&(i=[{customName:X.customName,customValue:X.customValue}])}m={};let v=(y=t==null?void 0:t.footerAddress)!=null&&y.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:"",T=(v!=""?v+",":"")+(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":""),D=t.gstNo,$={companyName:t.companyName,companyAddress:T,companyContact:t.contactNumber,companyEmail:t.contactEmail},J={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},re={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},te=Js(t.curr),de={...e,companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},be=null,Z=null;o.companyLogo&&(be=await Vt(`https://${o.companyLogo.bucket}.s3.amazonaws.com/${o.companyLogo.key}`)),o.qrcode&&(Z=await Vt(`https://${o.qrcode.bucket}.s3.amazonaws.com/${o.qrcode.key}`)),e.orderList.filter(X=>{X.services.forEach(async(K,ue)=>{var De,nt;let z="kitchen",ee=e.tableName?e.tableName:e.orderFrom;z&&(m[z]||(m[z]={},m[z].station=z,m[z].services=[],m[z].tableName=ee,m[z].customerName=e.name,m[z].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),m[z].type=e.orderFrom,m[z].orderId=e.orderId,m[z].instruction=e.instruction,m[z].totalQty=0,m[z].tokenId=e.tokenId,m[z].orderSource=e.orderSource,m[z].aggregatorOrderId=e.externalOrderId,m[z].otp=e.otp,m[z].paymentState=e.paymentState,m[z].discountAmt=c,m[z].otherCharges=e.otherCharges,m[z].taxAmt=e.taxAmt,m[z].customFeilds=i,m[z].curr=t.curr??"INR",m[z].zomatoInstant=p),m[z]?(u={serviceName:K.serviceName,qty:K.qty,instruction:K.isUrgent&&K.instruction?`(URGENT -${K.instruction})`:K.instruction?`(${K.instruction})`:K.isUrgent?"(URGENT)":"",subOrderId:X.subOrderId,isUrgent:K.isUrgent,index:ue},(De=K.addons)!=null&&De.length&&(u.addons=K.addons),m[z].services.push(u),m[z].totalQty+=K.qty):(m[z]=[],m[z].services.push({serviceName:K.serviceName,qty:K.qty,instruction:K.instruction?K.instruction:"",subOrderId:X.subOrderId,index:ue}),m[z].totalQty+=K.qty),m[z]={...m[z],companyInfo:$,orderInfo:J,customerInfo:re,gst:D,curr:te},m[z].domain=o.siteURL,m[z].paymentMethods=o.paymentMode?de.paymentMethods:null,m[z].companyInfo.companyName=o.companyName,m[z].companyInfo.companyEmail=o.email,m[z].companyInfo.companyAddress=o.address,m[z].companyInfo.companyContact=o.mobile,m[z].tokenId=o.token?de.tokenId:null,o.isPayQR&&o.upiId&&o.upiId!==""&&(de.upiId=o.upiId),m[z].gstNo=o.gst?de.gst:null,m[z].footerMessage=o.footerMessage,m[z].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),m[z].fssai=t.fssai,m[z].vatNo=t.vatNo,m[z].printOperatorInfo=o.printOperatorInfo===null||o.printOperatorInfo===!0,m[z].disabledPoweredBy=t.disabledPoweredBy===!0,m[z].printTime=R().format("DD-MM-YYYY hh:mm A"),m[z].printedBy=a.userRole=="admin"?"Admin":a.name,e.deliveryTimestamp&&(m[z].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),m[z].itemInstructionOnBill=o.itemInstructionOnBill,m[z]={...m[z],companyLogo:be,companyQrCode:Z})})});for(const X in m)if(Object.hasOwnProperty.call(m,X)){const K=m[X];try{let ue=t.printerSize??"2inch";r(new Object({obj:new Object({...K,paperSize:ue}),orderList:e.orderList}));return}catch(ue){console.log(ue)}}}catch(p){console.log("err::",p)}}),Cd=async e=>{let t=[];for(let h=0;h<e.length;h++)for(let f=0;f<e[h].orderList.length;f++)t.push(e[h].orderList[f]);let n=[];if(t.length>0)for(let h=0;h<t.length;h++)for(let f=0;f<t[h].services.length;f++)t[h].services[f].status!="CANCELLED"&&t[h].services[f].status!="RETURNED"&&t[h].services[f].status!="SHIFTED"&&n.push(t[h].services[f]);let r={},l=[];for(let h=0;h<n.length;h++)if(n[h].addons&&n[h].addons.length>0)for(let f=0;f<n[h].addons.length;f++){let y={...n[h].addons[f]};y.qty=n[h].qty,l.push(y)}n.forEach(h=>{let{attachedCat:f,serviceId:y}=h;r[f]||(r[f]=[]);let p=r[f].findIndex(v=>v.serviceId===y);p!==-1?r[f][p].qty=r[f][p].qty+h.qty:r[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedCat,station:h.station})});const o=Object.keys(r).sort(),a={};o.forEach(h=>{a[h]=r[h]});for(let h in a)a[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));let m={Category:a},u={};l.forEach(h=>{let{attachedAddonCat:f,serviceId:y}=h;u[f]||(u[f]=[]);let p=u[f].findIndex(v=>v.serviceId===y);p!==-1?u[f][p].qty=u[f][p].qty+h.qty:u[f].push({serviceName:h.serviceName,qty:h.qty,status:h.status,serviceId:h.serviceId,attachedCat:h.attachedAddonCat,station:h.station})});const i=Object.keys(u).sort(),c={};i.forEach(h=>{c[h]=u[h]});for(let h in c)c[h].sort((f,y)=>f.serviceName.localeCompare(y.serviceName));return m.Addon=c,m},va={"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"},_a=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return va[t]?va[t]:"SGST"},ba=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c,h,f;try{const{invoiceFormat:y,custName:p,custMobile:v,custAddress:_,userData:E={}}=n,{itemList:S}=e;let T=E==null?void 0:E.userRole;if(E.userRole=="admin"?T="ADMIN":T=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=$?(a=$[0])!=null&&a.paperSize?(m=$[0])==null?void 0:m.paperSize:D||"2INCH":D;let k=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",J=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",re=t.footerAddress.city?t.footerAddress.city:"",te=t.footerAddress.zip?t.footerAddress.zip:"",de=(k!=""?k+",":"")+(J!=""?J+",":"")+(re!=""?re+",":"")+(te!=""?te+",":""),be=t.gstNo,Z={companyName:t.companyName,companyAddress:de,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},ue={custName:y&&y.custName?p==t.companyName?null:p:null,custAddress:y&&y.custAddress&&_||null,custContact:y&&y.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},z=Js(t.curr),ee={...e,companyInfo:Z,orderInfo:K,customerInfo:ue,gst:be,curr:z};if(y){if(ee.domain=y.siteURL,ee.paymentMethods=y.paymentMode?ee.paymentMethods:null,ee.companyInfo.companyName=y.companyName,ee.companyInfo.companyEmail=y.email,ee.companyInfo.companyAddress=y.address,ee.companyInfo.companyContact=y.mobile,ee.customerInfo.custName=y.custName?p:null,ee.tokenId=y.token?ee.tokenId:null,y.isPayQR&&y.upiId&&y.upiId!==""&&(ee.upiId=y.upiId),ee.gstNo=y.gst?ee.gst:null,ee.footerMessage=y.footerMessage,ee.orderFrom=(u=e.subOrderFrom)==null?void 0:u.toUpperCase(),ee.fssai=t.fssai,ee.vatNo=t.vatNo,ee.invoiceType=t.invoiceType,ee.taxLabel=_a(t),ee.printOperatorInfo=y.printOperatorInfo===null||y.printOperatorInfo===!0,ee.disabledPoweredBy=t.disabledPoweredBy===!0,ee.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(ee.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),ee.itemInstructionOnBill=y.itemInstructionOnBill,ee.printHSNCodeOnBill=y.printHSNCodeOnBill,ee.noOfInvoice=y.noOfInvoice,ee.printby=T,ee.newFormat=!0,!(y.itemInstructionOnBill||y.printHSNCodeOnBill)&&((i=ee.itemList)!=null&&i.length)){let se;for(let Se=0;Se<ee.itemList.length;Se++)se=ee.itemList[Se],se.instruction&&delete se.instruction,se.hsnCode&&delete se.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(ee.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let De=[];if((h=e.customFeilds)!=null&&h.length){let se;for(let Se=0;Se<e.customFeilds.length;Se++)se=e.customFeilds[Se],se!=null&&se.customValue&&((f=se.availability)!=null&&f.includes("BILL"))&&De.push({customName:se.customName,customValue:se.customValue});ee.customFields=De}let nt=null,At=null;y.companyLogo&&(nt=await Vt(`https://${y.companyLogo.bucket}.s3.amazonaws.com/${y.companyLogo.key}`)),y.qrcode&&(At=await Vt(`https://${y.qrcode.bucket}.s3.amazonaws.com/${y.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let pt={};(function(){let se,Se,yt=0,Ke=0,g=0,d=0,C=0,j=0,w=0,Y=0,b=[],F=[],V=0,fe;if(D==="A4"||D==="A5"){for(Se=0;Se<S.length;Se++)se=S[Se],Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0),V+=se.qty;let Me=sr(S,"discountName",{separateItemsDisc:!0});const Le=ar(Me);let{obj:Ce,sum:Ye}=en(S);pt={itemList:ir(S,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Le,charges:nr(S,"name"),taxation:Ce,subTotal:_e(Ke),afterDisc:_e(g),afterCharges:_e(d),total:_e(yt+Ye),qty:V}}else{let{obj:Me}=en(S);for(ee.taxation=Me,Se=0;Se<S.length;Se++)se=S[Se],se.taxType==="VAT"?(F.push(se),Y+=se.sub_total,j+=se.afterdiscAmt,C+=se.afterdiscAmt+(se.total_charges??0),w+=se.afterdiscAmt+(se.total_charges??0)):(b.push(se),Ke+=se.sub_total,g+=se.afterdiscAmt,d+=se.afterdiscAmt+(se.total_charges??0),yt+=se.afterdiscAmt+(se.total_charges??0));if(b.length){let Le=sr(b,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(b);pt.GST={itemList:ir(b,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(b,"name"),taxation:Ye,subTotal:_e(Ke),afterDisc:_e(g),afterCharges:_e(d),total:_e(yt+Qe)}}if(F.length){let Le=sr(F,"discountName",{separateItemsDisc:!0});const Ce=ar(Le);let{obj:Ye,sum:Qe}=en(F);pt.VAT={itemList:ir(F,{itemInstructionOnBill:y.itemInstructionOnBill,printZeroPriceAddons:y.printZeroPriceAddons}),discounts:Ce,charges:nr(F,"name"),taxation:Ye,subTotal:_e(Y),afterDisc:_e(j),afterCharges:_e(C),total:_e(w+Qe)}}}})(),ee.distributedData=pt;let Et={obj:ee,companyLogo:nt,companyQrCode:At,paperSize:t.printerSize,Name:o};r(Et)}}catch(y){console.log("err",y),l(y)}}),Od=(e,t,n={})=>new Promise(async(r,l)=>{var a,m,u,i,c;try{const{invoiceFormat:h,custName:f,custMobile:y,custAddress:p,orderData:v}=n;let _=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",E=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",T=t.footerAddress.zip?t.footerAddress.zip:"",D=(_!=""?_+",":"")+(E!=""?E+",":"")+(S!=""?S+",":"")+(T!=""?T+",":""),$=t.gstNo,k={companyName:t.companyName,companyAddress:D,companyContact:t.contactNumber,companyEmail:t.contactEmail},re={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?R.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?f==t.companyName?null:f:null,custAddress:h&&h.custAddress&&p||null,custContact:h&&h.custMobile?y:null,custEmail:"ajaybaglane7@gmail.com"},de=Js(t.curr),be="",Z={...e,companyInfo:k,orderInfo:re,customerInfo:te,gst:$,curr:de};if(h){if(Z.domain=h.siteURL,Z.paymentMethods=h.paymentMode?Z.paymentMethods:null,Z.companyInfo.companyName=h.companyName,Z.companyInfo.companyEmail=h.email,Z.companyInfo.companyAddress=h.address,Z.companyInfo.companyContact=h.mobile,Z.customerInfo.custName=h.custName?f:null,Z.tokenId=h.token?Z.tokenId:null,h.isPayQR&&h.upiId&&h.upiId!==""&&(Z.upiId=h.upiId),Z.gstNo=h.gst?Z.gst:null,Z.footerMessage=h.footerMessage,Z.orderFrom=(a=v.subOrderFrom)==null?void 0:a.toUpperCase(),Z.fssai=t.fssai,Z.vatNo=t.vatNo,Z.taxLabel=_a(t),Z.printOperatorInfo=h.printOperatorInfo===null||h.printOperatorInfo===!0,Z.disabledPoweredBy=t.disabledPoweredBy===!0,Z.printTime=R().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(Z.deliveryTimestamp=R.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Z.itemInstructionOnBill=h.itemInstructionOnBill,Z.printHSNCodeOnBill=h.printHSNCodeOnBill,Z.noOfInvoice=h.noOfInvoice,Z.area=v.area,Z.captainName=v.captainName,!(h.itemInstructionOnBill||h.printHSNCodeOnBill)&&((m=Z.itemList)!=null&&m.length)){let K;for(let ue=0;ue<Z.itemList.length;ue++)K=Z.itemList[ue],K.instruction&&delete K.instruction,K.hsnCode&&delete K.hsnCode}t.enabledOutstandingOnPay&&((u=e.custoutStandingData)!=null&&u.balanceAmt)&&(Z.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let X=[];if((i=v.customFeilds)!=null&&i.length){let K;for(let ue=0;ue<v.customFeilds.length;ue++)K=v.customFeilds[ue],K!=null&&K.customValue&&((c=K.availability)!=null&&c.includes("BILL"))&&X.push({customName:K.customName,customValue:K.customValue});Z.customFields=X}if(t&&t.isOld&&t.isOld==!0){let K=null,ue=null;h.companyLogo&&(K=await Vt(`https://${h.companyLogo.bucket}.s3.amazonaws.com/${h.companyLogo.key}`)),h.qrcode&&(ue=await Vt(`https://${h.qrcode.bucket}.s3.amazonaws.com/${h.qrcode.key}`));var o="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(o="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(o="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(o="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(o="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(o="iOS");let z={obj:Z,companyLogo:K,companyQrCode:ue,paperSize:t.printerSize,Name:o};r(z)}}}catch(h){console.log("err",h)}}),Md=(e,t)=>new Promise(async(n,r)=>{var T;let l;(T=t.siteLogo)!=null&&T.key;let o=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",a=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",m=t.footerAddress.city?t.footerAddress.city:"",u=t.footerAddress.zip?t.footerAddress.zip:"",i=(o!=""?o+",":"")+(a!=""?a+",":"")+(m!=""?m+",":"")+(u!=""?u+",":""),c=[],h,f=0,y=0,p=0,v=[],_,E;const S=fs(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}),f+=h.finalAmount,y+=h.paidAmt,p+=h.balanceAmt,_=0;_<h.orderTransactions.length;_++)E=h.orderTransactions[_],E.paidAmt&&v.push({date:R.unix(E.createdAt).format("DD-MM-YYYY"),paymentMode:S[E.paymentMode].displayName,amount:_e(E.paidAmt)});n({logo:l,companyAddress:i,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:f,totalPaid:y,totalPayable:p,paperSize:t.printerSize,curr:Js(t.curr),transactions:v})}),Ad=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 l;r.newFormat?l=await ba({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):l=await Od(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(l)}),Sa=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,l=e[n];l.newId=r,t.push(l)}return t},or=(e,t)=>{var r,l;if(!(t!=null&&t.length))return!0;let n=t.findIndex(o=>o.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(l=t[n])==null?void 0:l.printKot};function Ed(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"),l=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(l),t&&(r.href=t),l.href=e,l.href}const Rd=(()=>{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 qt=null;function Ta(e={}){return qt||(e.includeStyleProperties?(qt=e.includeStyleProperties,qt):(qt=_t(window.getComputedStyle(document.documentElement)),qt))}function tn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Ld(e){const t=tn(e,"border-left-width"),n=tn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=tn(e,"border-top-width"),n=tn(e,"border-bottom-width");return e.clientHeight+t+n}function wa(e,t={}){const n=t.width||Ld(e),r=t.height||kd(e);return{width:n,height:r}}function Pd(){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 Fd(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 Dd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Yd(e,t,n){const r="http://www.w3.org/2000/svg",l=document.createElementNS(r,"svg"),o=document.createElementNS(r,"foreignObject");return l.setAttribute("width",`${t}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${t} ${n}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),l.appendChild(o),o.appendChild(e),Dd(l)}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 Ud(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function $d(e,t){return Ta(t).map(n=>{const r=e.getPropertyValue(n),l=e.getPropertyPriority(n);return`${n}: ${r}${l?" !important":""};`}).join(" ")}function Hd(e,t,n,r){const l=`.${e}:${t}`,o=n.cssText?Ud(n):$d(n,r);return document.createTextNode(`${l}{${o}}`)}function Ia(e,t,n,r){const l=window.getComputedStyle(e,n),o=l.getPropertyValue("content");if(o===""||o==="none")return;const a=Rd();try{t.className=`${t.className} ${a}`}catch{return}const m=document.createElement("style");m.appendChild(Hd(a,n,l,r)),t.appendChild(m)}function Bd(e,t,n){Ia(e,t,":before",n),Ia(e,t,":after",n)}const Ca="application/font-woff",Oa="image/jpeg",Gd={woff:Ca,woff2:Ca,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Oa,jpeg:Oa,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 Gd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Vd(e,t){return`data:${t};base64,${e}`}async function Ma(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const l=await r.blob();return new Promise((o,a)=>{const m=new FileReader;m.onerror=a,m.onloadend=()=>{try{o(n({res:r,result:m.result}))}catch(u){a(u)}},m.readAsDataURL(l)})}const hr={};function qd(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=qd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let l;try{const o=await Ma(e,n.fetchRequestInit,({res:a,result:m})=>(t||(t=a.headers.get("Content-Type")||""),zd(m)));l=Vd(o,t)}catch(o){l=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;o&&(a=typeof o=="string"?o:o.message),a&&console.warn(a)}return hr[r]=l,l}async function Kd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):sn(t)}async function Qd(e,t){if(e.currentSrc){const o=document.createElement("canvas"),a=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,a==null||a.drawImage(e,0,0,o.width,o.height);const m=o.toDataURL();return sn(m)}const n=e.poster,r=cr(n),l=await ur(n,r,t);return sn(l)}async function Zd(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 Jd(e,t){return Re(e,HTMLCanvasElement)?Kd(e):Re(e,HTMLVideoElement)?Qd(e,t):Re(e,HTMLIFrameElement)?Zd(e,t):e.cloneNode(Aa(e))}const Xd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Aa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function eh(e,t,n){var r,l;if(Aa(t))return t;let o=[];return Xd(e)&&e.assignedNodes?o=_t(e.assignedNodes()):Re(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?o=_t(e.contentDocument.body.childNodes):o=_t(((l=e.shadowRoot)!==null&&l!==void 0?l:e).childNodes),o.length===0||Re(e,HTMLVideoElement)||await o.reduce((a,m)=>a.then(()=>nn(m,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function th(e,t,n){const r=t.style;if(!r)return;const l=window.getComputedStyle(e);l.cssText?(r.cssText=l.cssText,r.transformOrigin=l.transformOrigin):Ta(n).forEach(o=>{let a=l.getPropertyValue(o);o==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),Re(e,HTMLIFrameElement)&&o==="display"&&a==="inline"&&(a="block"),o==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(o,a,l.getPropertyPriority(o))})}function sh(e,t){Re(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Re(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function nh(e,t){if(Re(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(l=>e.value===l.getAttribute("value"));r&&r.setAttribute("selected","")}}function rh(e,t,n){return Re(t,Element)&&(th(e,t,n),Bd(e,t,n),sh(e,t),nh(e,t)),t}async function ah(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let o=0;o<n.length;o++){const m=n[o].getAttribute("xlink:href");if(m){const u=e.querySelector(m),i=document.querySelector(m);!u&&i&&!r[m]&&(r[m]=await nn(i,t,!0))}}const l=Object.values(r);if(l.length){const o="http://www.w3.org/1999/xhtml",a=document.createElementNS(o,"svg");a.setAttribute("xmlns",o),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";const m=document.createElementNS(o,"defs");a.appendChild(m);for(let u=0;u<l.length;u++)m.appendChild(l[u]);e.appendChild(a)}return e}async function nn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Jd(r,t)).then(r=>eh(e,r,t)).then(r=>rh(e,r,t)).then(r=>ah(r,t))}const Ea=/url\((['"]?)([^'"]+?)\1\)/g,ih=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,lh=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function oh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function ch(e){const t=[];return e.replace(Ea,(n,r,l)=>(t.push(l),n)),t.filter(n=>!dr(n))}async function dh(e,t,n,r,l){try{const o=n?Ed(t,n):t,a=cr(t);let m;return l||(m=await ur(o,a,r)),e.replace(oh(t),`$1${m}$3`)}catch{}return e}function hh(e,{preferredFontFormat:t}){return t?e.replace(lh,n=>{for(;;){const[r,,l]=ih.exec(n)||[];if(!l)return"";if(l===t)return`src: ${r};`}}):e}function Ra(e){return e.search(Ea)!==-1}async function La(e,t,n){if(!Ra(e))return e;const r=hh(e,n);return ch(r).reduce((o,a)=>o.then(m=>dh(m,a,t,n)),Promise.resolve(r))}async function Kt(e,t,n){var r;const l=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(l){const o=await La(l,null,n);return t.style.setProperty(e,o,t.style.getPropertyPriority(e)),!0}return!1}async function uh(e,t){await Kt("background",e,t)||await Kt("background-image",e,t),await Kt("mask",e,t)||await Kt("-webkit-mask",e,t)||await Kt("mask-image",e,t)||await Kt("-webkit-mask-image",e,t)}async function mh(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,l=await ur(r,cr(r),t);await new Promise((o,a)=>{e.onload=o,e.onerror=t.onImageErrorHandler?(...u)=>{try{o(t.onImageErrorHandler(...u))}catch(i){a(i)}}:a;const m=e;m.decode&&(m.decode=o),m.loading==="lazy"&&(m.loading="eager"),n?(e.srcset="",e.src=l):e.href.baseVal=l})}async function fh(e,t){const r=_t(e.childNodes).map(l=>ka(l,t));await Promise.all(r).then(()=>e)}async function ka(e,t){Re(e,Element)&&(await uh(e,t),await mh(e,t),await fh(e,t))}function ph(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(l=>{n[l]=r[l]}),e}const Pa={};async function Fa(e){let t=Pa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Pa[e]=t,t}async function Da(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,o=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let m=a.replace(r,"$1");return m.startsWith("https://")||(m=new URL(m,e.url).href),Ma(m,t.fetchRequestInit,({result:u})=>(n=n.replace(a,`url(${u})`),[a,u]))});return Promise.all(o).then(()=>n)}function Ya(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=l.exec(r);if(u===null)break;t.push(u[0])}r=r.replace(l,"");const o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",m=new RegExp(a,"gi");for(;;){let u=o.exec(r);if(u===null){if(u=m.exec(r),u===null)break;o.lastIndex=m.lastIndex}else m.lastIndex=o.lastIndex;t.push(u[0])}return t}async function yh(e,t){const n=[],r=[];return e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach((o,a)=>{if(o.type===CSSRule.IMPORT_RULE){let m=a+1;const u=o.href,i=Fa(u).then(c=>Da(c,t)).then(c=>Ya(c).forEach(h=>{try{l.insertRule(h,h.startsWith("@import")?m+=1:l.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:h,error:f})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(i)}})}catch(o){const a=e.find(m=>m.href==null)||document.styleSheets[0];l.href!=null&&r.push(Fa(l.href).then(m=>Da(m,t)).then(m=>Ya(m).forEach(u=>{a.insertRule(u,a.cssRules.length)})).catch(m=>{console.error("Error loading remote stylesheet",m)})),console.error("Error inlining remote css file",o)}}),Promise.all(r).then(()=>(e.forEach(l=>{if("cssRules"in l)try{_t(l.cssRules||[]).forEach(o=>{n.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${l.href}`,o)}}),n))}function gh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ra(t.style.getPropertyValue("src")))}async function xh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=_t(e.ownerDocument.styleSheets),r=await yh(n,t);return gh(r)}function Ua(e){return e.trim().replace(/["']/g,"")}function Nh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(o=>{t.add(Ua(o))}),Array.from(r.children).forEach(o=>{o instanceof HTMLElement&&n(o)})}return n(e),t}async function jh(e,t){const n=await xh(e,t),r=Nh(e);return(await Promise.all(n.filter(o=>r.has(Ua(o.style.fontFamily))).map(o=>{const a=o.parentStyleSheet?o.parentStyleSheet.href:null;return La(o.cssText,a,t)}))).join(`
|
|
46
|
+
`)}async function vh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await jh(e,t);if(n){const r=document.createElement("style"),l=document.createTextNode(n);r.appendChild(l),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function $a(e,t={}){const{width:n,height:r}=wa(e,t),l=await nn(e,t,!0);return await vh(l,t),await ka(l,t),ph(l,t),await Yd(l,n,r)}async function _h(e,t={}){const{width:n,height:r}=wa(e,t),l=await $a(e,t),o=await sn(l),a=document.createElement("canvas"),m=a.getContext("2d"),u=t.pixelRatio||Pd(),i=t.canvasWidth||n,c=t.canvasHeight||r;return a.width=i*u,a.height=c*u,t.skipAutoScale||Fd(a),a.style.width=`${i}`,a.style.height=`${c}`,t.backgroundColor&&(m.fillStyle=t.backgroundColor,m.fillRect(0,0,a.width,a.height)),m.drawImage(o,0,0,a.width,a.height),a}async function bh(e,t={}){return(await _h(e,t)).toDataURL("image/jpeg",t.quality||1)}var Sh=Object.defineProperty,rn=Object.getOwnPropertySymbols,Ha=Object.prototype.hasOwnProperty,Ba=Object.prototype.propertyIsEnumerable,Ga=(e,t,n)=>t in e?Sh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t)=>{for(var n in t||(t={}))Ha.call(t,n)&&Ga(e,n,t[n]);if(rn)for(var n of rn(t))Ba.call(t,n)&&Ga(e,n,t[n]);return e},mr=(e,t)=>{var n={};for(var r in e)Ha.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&&Ba.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
47
47
|
* @license QR Code generator library (TypeScript)
|
|
48
48
|
* Copyright (c) Project Nayuki.
|
|
49
49
|
* SPDX-License-Identifier: MIT
|
|
50
|
-
*/var Ot;(e=>{const t=class{constructor(u,i,c,h){if(this.version=u,this.errorCorrectionLevel=i,this.modules=[],this.isFunction=[],u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=u*4+17;let f=[];for(let p=0;p<this.size;p++)f.push(!1);for(let p=0;p<this.size;p++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(c);if(this.drawCodewords(y),h==-1){let p=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<p&&(h=v,p=_),this.applyMask(v)}}o(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}static encodeText(u,i){const c=e.QrSegment.makeSegments(u);return t.encodeSegments(c,i)}static encodeBinary(u,i){const c=e.QrSegment.makeBytes(u);return t.encodeSegments([c],i)}static encodeSegments(u,i,c=1,h=40,f=-1,y=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let p,v;for(p=c;;p++){const T=t.getNumDataCodewords(p,i)*8,D=m.getTotalBits(u,p);if(D<=T){v=D;break}if(p>=h)throw new RangeError("Data too long")}for(const T of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])y&&v<=t.getNumDataCodewords(p,T)*8&&(i=T);let _=[];for(const T of u){r(T.mode.modeBits,4,_),r(T.numChars,T.mode.numCharCountBits(p),_);for(const D of T.getData())_.push(D)}o(_.length==v);const E=t.getNumDataCodewords(p,i)*8;o(_.length<=E),r(0,Math.min(4,E-_.length),_),r(0,(8-_.length%8)%8,_),o(_.length%8==0);for(let T=236;_.length<E;T^=253)r(T,8,_);let S=[];for(;S.length*8<_.length;)S.push(0);return _.forEach((T,D)=>S[D>>>3]|=T<<7-(D&7)),new t(p,i,S,f)}getModule(u,i){return 0<=u&&u<this.size&&0<=i&&i<this.size&&this.modules[i][u]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const u=this.getAlignmentPatternPositions(),i=u.length;for(let c=0;c<i;c++)for(let h=0;h<i;h++)c==0&&h==0||c==0&&h==i-1||c==i-1&&h==0||this.drawAlignmentPattern(u[c],u[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(u){const i=this.errorCorrectionLevel.formatBits<<3|u;let c=i;for(let f=0;f<10;f++)c=c<<1^(c>>>9)*1335;const h=(i<<10|c)^21522;o(h>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,l(h,f));this.setFunctionModule(8,7,l(h,6)),this.setFunctionModule(8,8,l(h,7)),this.setFunctionModule(7,8,l(h,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,l(h,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,l(h,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,l(h,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let u=this.version;for(let c=0;c<12;c++)u=u<<1^(u>>>11)*7973;const i=this.version<<12|u;o(i>>>18==0);for(let c=0;c<18;c++){const h=l(i,c),f=this.size-11+c%3,y=Math.floor(c/3);this.setFunctionModule(f,y,h),this.setFunctionModule(y,f,h)}}drawFinderPattern(u,i){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){const f=Math.max(Math.abs(h),Math.abs(c)),y=u+h,p=i+c;0<=y&&y<this.size&&0<=p&&p<this.size&&this.setFunctionModule(y,p,f!=2&&f!=4)}}drawAlignmentPattern(u,i){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(u+h,i+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(u,i,c){this.modules[i][u]=c,this.isFunction[i][u]=!0}addEccAndInterleave(u){const i=this.version,c=this.errorCorrectionLevel;if(u.length!=t.getNumDataCodewords(i,c))throw new RangeError("Invalid argument");const h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][i],f=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][i],y=Math.floor(t.getNumRawDataModules(i)/8),p=h-y%h,v=Math.floor(y/h);let _=[];const E=t.reedSolomonComputeDivisor(f);for(let T=0,D=0;T<h;T++){let $=u.slice(D,D+v-f+(T<p?0:1));D+=$.length;const k=t.reedSolomonComputeRemainder($,E);T<p&&$.push(0),_.push($.concat(k))}let S=[];for(let T=0;T<_[0].length;T++)_.forEach((D,$)=>{(T!=v-f||$>=p)&&S.push(D[T])});return o(S.length==y),S}drawCodewords(u){if(u.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let f=0;f<2;f++){const y=c-f,v=(c+1&2)==0?this.size-1-h:h;!this.isFunction[v][y]&&i<u.length*8&&(this.modules[v][y]=l(u[i>>>3],7-(i&7)),i++)}}o(i==u.length*8)}applyMask(u){if(u<0||u>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let c=0;c<this.size;c++){let h;switch(u){case 0:h=(c+i)%2==0;break;case 1:h=i%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+i)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(i/2))%2==0;break;case 5:h=c*i%2+c*i%3==0;break;case 6:h=(c*i%2+c*i%3)%2==0;break;case 7:h=((c+i)%2+c*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][c]&&h&&(this.modules[i][c]=!this.modules[i][c])}}getPenaltyScore(){let u=0;for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[f][_]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[f][_],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][f]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[_][f],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let y=0;y<this.size-1;y++){const p=this.modules[f][y];p==this.modules[f][y+1]&&p==this.modules[f+1][y]&&p==this.modules[f+1][y+1]&&(u+=t.PENALTY_N2)}let i=0;for(const f of this.modules)i=f.reduce((y,p)=>y+(p?1:0),i);const c=this.size*this.size,h=Math.ceil(Math.abs(i*20-c*10)/c)-1;return o(0<=h&&h<=9),u+=h*t.PENALTY_N4,o(0<=u&&u<=2568888),u}getAlignmentPatternPositions(){if(this.version==1)return[];{const u=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(u*2-2))*2;let c=[6];for(let h=this.size-7;c.length<u;h-=i)c.splice(1,0,h);return c}}static getNumRawDataModules(u){if(u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*u+128)*u+64;if(u>=2){const c=Math.floor(u/7)+2;i-=(25*c-10)*c-55,u>=7&&(i-=36)}return o(208<=i&&i<=29648),i}static getNumDataCodewords(u,i){return Math.floor(t.getNumRawDataModules(u)/8)-t.ECC_CODEWORDS_PER_BLOCK[i.ordinal][u]*t.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][u]}static reedSolomonComputeDivisor(u){if(u<1||u>255)throw new RangeError("Degree out of range");let i=[];for(let h=0;h<u-1;h++)i.push(0);i.push(1);let c=1;for(let h=0;h<u;h++){for(let f=0;f<i.length;f++)i[f]=t.reedSolomonMultiply(i[f],c),f+1<i.length&&(i[f]^=i[f+1]);c=t.reedSolomonMultiply(c,2)}return i}static reedSolomonComputeRemainder(u,i){let c=i.map(h=>0);for(const h of u){const f=h^c.shift();c.push(0),i.forEach((y,p)=>c[p]^=t.reedSolomonMultiply(y,f))}return c}static reedSolomonMultiply(u,i){if(u>>>8||i>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(i>>>h&1)*u;return o(c>>>8==0),c}finderPenaltyCountPatterns(u){const i=u[1];o(i<=this.size*3);const c=i>0&&u[2]==i&&u[3]==i*3&&u[4]==i&&u[5]==i;return(c&&u[0]>=i*4&&u[6]>=i?1:0)+(c&&u[6]>=i*4&&u[0]>=i?1:0)}finderPenaltyTerminateAndCount(u,i,c){return u&&(this.finderPenaltyAddHistory(i,c),i=0),i+=this.size,this.finderPenaltyAddHistory(i,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(u,i){i[0]==0&&(u+=this.size),i.pop(),i.unshift(u)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(u,i,c){if(i<0||i>31||u>>>i)throw new RangeError("Value out of range");for(let h=i-1;h>=0;h--)c.push(u>>>h&1)}function l(u,i){return(u>>>i&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const a=class{constructor(u,i,c){if(this.mode=u,this.numChars=i,this.bitData=c,i<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(u){let i=[];for(const c of u)r(c,8,i);return new a(a.Mode.BYTE,u.length,i)}static makeNumeric(u){if(!a.isNumeric(u))throw new RangeError("String contains non-numeric characters");let i=[];for(let c=0;c<u.length;){const h=Math.min(u.length-c,3);r(parseInt(u.substr(c,h),10),h*3+1,i),c+=h}return new a(a.Mode.NUMERIC,u.length,i)}static makeAlphanumeric(u){if(!a.isAlphanumeric(u))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],c;for(c=0;c+2<=u.length;c+=2){let h=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c))*45;h+=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c+1)),r(h,11,i)}return c<u.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c)),6,i),new a(a.Mode.ALPHANUMERIC,u.length,i)}static makeSegments(u){return u==""?[]:a.isNumeric(u)?[a.makeNumeric(u)]:a.isAlphanumeric(u)?[a.makeAlphanumeric(u)]:[a.makeBytes(a.toUtf8ByteArray(u))]}static makeEci(u){let i=[];if(u<0)throw new RangeError("ECI assignment value out of range");if(u<128)r(u,8,i);else if(u<16384)r(2,2,i),r(u,14,i);else if(u<1e6)r(6,3,i),r(u,21,i);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,i)}static isNumeric(u){return a.NUMERIC_REGEX.test(u)}static isAlphanumeric(u){return a.ALPHANUMERIC_REGEX.test(u)}getData(){return this.bitData.slice()}static getTotalBits(u,i){let c=0;for(const h of u){const f=h.mode.numCharCountBits(i);if(h.numChars>=1<<f)return 1/0;c+=4+f+h.bitData.length}return c}static toUtf8ByteArray(u){u=encodeURI(u);let i=[];for(let c=0;c<u.length;c++)u.charAt(c)!="%"?i.push(u.charCodeAt(c)):(i.push(parseInt(u.substr(c+1,2),16)),c+=2);return i}};let m=a;m.NUMERIC_REGEX=/^[0-9]*$/,m.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,m.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=m})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.ordinal=l,this.formatBits=o}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.modeBits=l,this.numBitsCharCount=o}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ot||(Ot={}));var Kt=Ot;/**
|
|
50
|
+
*/var Ot;(e=>{const t=class{constructor(u,i,c,h){if(this.version=u,this.errorCorrectionLevel=i,this.modules=[],this.isFunction=[],u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version value out of range");if(h<-1||h>7)throw new RangeError("Mask value out of range");this.size=u*4+17;let f=[];for(let p=0;p<this.size;p++)f.push(!1);for(let p=0;p<this.size;p++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const y=this.addEccAndInterleave(c);if(this.drawCodewords(y),h==-1){let p=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const _=this.getPenaltyScore();_<p&&(h=v,p=_),this.applyMask(v)}}o(0<=h&&h<=7),this.mask=h,this.applyMask(h),this.drawFormatBits(h),this.isFunction=[]}static encodeText(u,i){const c=e.QrSegment.makeSegments(u);return t.encodeSegments(c,i)}static encodeBinary(u,i){const c=e.QrSegment.makeBytes(u);return t.encodeSegments([c],i)}static encodeSegments(u,i,c=1,h=40,f=-1,y=!0){if(!(t.MIN_VERSION<=c&&c<=h&&h<=t.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let p,v;for(p=c;;p++){const T=t.getNumDataCodewords(p,i)*8,D=m.getTotalBits(u,p);if(D<=T){v=D;break}if(p>=h)throw new RangeError("Data too long")}for(const T of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])y&&v<=t.getNumDataCodewords(p,T)*8&&(i=T);let _=[];for(const T of u){r(T.mode.modeBits,4,_),r(T.numChars,T.mode.numCharCountBits(p),_);for(const D of T.getData())_.push(D)}o(_.length==v);const E=t.getNumDataCodewords(p,i)*8;o(_.length<=E),r(0,Math.min(4,E-_.length),_),r(0,(8-_.length%8)%8,_),o(_.length%8==0);for(let T=236;_.length<E;T^=253)r(T,8,_);let S=[];for(;S.length*8<_.length;)S.push(0);return _.forEach((T,D)=>S[D>>>3]|=T<<7-(D&7)),new t(p,i,S,f)}getModule(u,i){return 0<=u&&u<this.size&&0<=i&&i<this.size&&this.modules[i][u]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2==0),this.setFunctionModule(c,6,c%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const u=this.getAlignmentPatternPositions(),i=u.length;for(let c=0;c<i;c++)for(let h=0;h<i;h++)c==0&&h==0||c==0&&h==i-1||c==i-1&&h==0||this.drawAlignmentPattern(u[c],u[h]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(u){const i=this.errorCorrectionLevel.formatBits<<3|u;let c=i;for(let f=0;f<10;f++)c=c<<1^(c>>>9)*1335;const h=(i<<10|c)^21522;o(h>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,l(h,f));this.setFunctionModule(8,7,l(h,6)),this.setFunctionModule(8,8,l(h,7)),this.setFunctionModule(7,8,l(h,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,l(h,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,l(h,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,l(h,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let u=this.version;for(let c=0;c<12;c++)u=u<<1^(u>>>11)*7973;const i=this.version<<12|u;o(i>>>18==0);for(let c=0;c<18;c++){const h=l(i,c),f=this.size-11+c%3,y=Math.floor(c/3);this.setFunctionModule(f,y,h),this.setFunctionModule(y,f,h)}}drawFinderPattern(u,i){for(let c=-4;c<=4;c++)for(let h=-4;h<=4;h++){const f=Math.max(Math.abs(h),Math.abs(c)),y=u+h,p=i+c;0<=y&&y<this.size&&0<=p&&p<this.size&&this.setFunctionModule(y,p,f!=2&&f!=4)}}drawAlignmentPattern(u,i){for(let c=-2;c<=2;c++)for(let h=-2;h<=2;h++)this.setFunctionModule(u+h,i+c,Math.max(Math.abs(h),Math.abs(c))!=1)}setFunctionModule(u,i,c){this.modules[i][u]=c,this.isFunction[i][u]=!0}addEccAndInterleave(u){const i=this.version,c=this.errorCorrectionLevel;if(u.length!=t.getNumDataCodewords(i,c))throw new RangeError("Invalid argument");const h=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][i],f=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][i],y=Math.floor(t.getNumRawDataModules(i)/8),p=h-y%h,v=Math.floor(y/h);let _=[];const E=t.reedSolomonComputeDivisor(f);for(let T=0,D=0;T<h;T++){let $=u.slice(D,D+v-f+(T<p?0:1));D+=$.length;const k=t.reedSolomonComputeRemainder($,E);T<p&&$.push(0),_.push($.concat(k))}let S=[];for(let T=0;T<_[0].length;T++)_.forEach((D,$)=>{(T!=v-f||$>=p)&&S.push(D[T])});return o(S.length==y),S}drawCodewords(u){if(u.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let h=0;h<this.size;h++)for(let f=0;f<2;f++){const y=c-f,v=(c+1&2)==0?this.size-1-h:h;!this.isFunction[v][y]&&i<u.length*8&&(this.modules[v][y]=l(u[i>>>3],7-(i&7)),i++)}}o(i==u.length*8)}applyMask(u){if(u<0||u>7)throw new RangeError("Mask value out of range");for(let i=0;i<this.size;i++)for(let c=0;c<this.size;c++){let h;switch(u){case 0:h=(c+i)%2==0;break;case 1:h=i%2==0;break;case 2:h=c%3==0;break;case 3:h=(c+i)%3==0;break;case 4:h=(Math.floor(c/3)+Math.floor(i/2))%2==0;break;case 5:h=c*i%2+c*i%3==0;break;case 6:h=(c*i%2+c*i%3)%2==0;break;case 7:h=((c+i)%2+c*i%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[i][c]&&h&&(this.modules[i][c]=!this.modules[i][c])}}getPenaltyScore(){let u=0;for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[f][_]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[f][_],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size;f++){let y=!1,p=0,v=[0,0,0,0,0,0,0];for(let _=0;_<this.size;_++)this.modules[_][f]==y?(p++,p==5?u+=t.PENALTY_N1:p>5&&u++):(this.finderPenaltyAddHistory(p,v),y||(u+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),y=this.modules[_][f],p=1);u+=this.finderPenaltyTerminateAndCount(y,p,v)*t.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let y=0;y<this.size-1;y++){const p=this.modules[f][y];p==this.modules[f][y+1]&&p==this.modules[f+1][y]&&p==this.modules[f+1][y+1]&&(u+=t.PENALTY_N2)}let i=0;for(const f of this.modules)i=f.reduce((y,p)=>y+(p?1:0),i);const c=this.size*this.size,h=Math.ceil(Math.abs(i*20-c*10)/c)-1;return o(0<=h&&h<=9),u+=h*t.PENALTY_N4,o(0<=u&&u<=2568888),u}getAlignmentPatternPositions(){if(this.version==1)return[];{const u=Math.floor(this.version/7)+2,i=this.version==32?26:Math.ceil((this.version*4+4)/(u*2-2))*2;let c=[6];for(let h=this.size-7;c.length<u;h-=i)c.splice(1,0,h);return c}}static getNumRawDataModules(u){if(u<t.MIN_VERSION||u>t.MAX_VERSION)throw new RangeError("Version number out of range");let i=(16*u+128)*u+64;if(u>=2){const c=Math.floor(u/7)+2;i-=(25*c-10)*c-55,u>=7&&(i-=36)}return o(208<=i&&i<=29648),i}static getNumDataCodewords(u,i){return Math.floor(t.getNumRawDataModules(u)/8)-t.ECC_CODEWORDS_PER_BLOCK[i.ordinal][u]*t.NUM_ERROR_CORRECTION_BLOCKS[i.ordinal][u]}static reedSolomonComputeDivisor(u){if(u<1||u>255)throw new RangeError("Degree out of range");let i=[];for(let h=0;h<u-1;h++)i.push(0);i.push(1);let c=1;for(let h=0;h<u;h++){for(let f=0;f<i.length;f++)i[f]=t.reedSolomonMultiply(i[f],c),f+1<i.length&&(i[f]^=i[f+1]);c=t.reedSolomonMultiply(c,2)}return i}static reedSolomonComputeRemainder(u,i){let c=i.map(h=>0);for(const h of u){const f=h^c.shift();c.push(0),i.forEach((y,p)=>c[p]^=t.reedSolomonMultiply(y,f))}return c}static reedSolomonMultiply(u,i){if(u>>>8||i>>>8)throw new RangeError("Byte out of range");let c=0;for(let h=7;h>=0;h--)c=c<<1^(c>>>7)*285,c^=(i>>>h&1)*u;return o(c>>>8==0),c}finderPenaltyCountPatterns(u){const i=u[1];o(i<=this.size*3);const c=i>0&&u[2]==i&&u[3]==i*3&&u[4]==i&&u[5]==i;return(c&&u[0]>=i*4&&u[6]>=i?1:0)+(c&&u[6]>=i*4&&u[0]>=i?1:0)}finderPenaltyTerminateAndCount(u,i,c){return u&&(this.finderPenaltyAddHistory(i,c),i=0),i+=this.size,this.finderPenaltyAddHistory(i,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(u,i){i[0]==0&&(u+=this.size),i.pop(),i.unshift(u)}};let n=t;n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;function r(u,i,c){if(i<0||i>31||u>>>i)throw new RangeError("Value out of range");for(let h=i-1;h>=0;h--)c.push(u>>>h&1)}function l(u,i){return(u>>>i&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const a=class{constructor(u,i,c){if(this.mode=u,this.numChars=i,this.bitData=c,i<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(u){let i=[];for(const c of u)r(c,8,i);return new a(a.Mode.BYTE,u.length,i)}static makeNumeric(u){if(!a.isNumeric(u))throw new RangeError("String contains non-numeric characters");let i=[];for(let c=0;c<u.length;){const h=Math.min(u.length-c,3);r(parseInt(u.substr(c,h),10),h*3+1,i),c+=h}return new a(a.Mode.NUMERIC,u.length,i)}static makeAlphanumeric(u){if(!a.isAlphanumeric(u))throw new RangeError("String contains unencodable characters in alphanumeric mode");let i=[],c;for(c=0;c+2<=u.length;c+=2){let h=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c))*45;h+=a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c+1)),r(h,11,i)}return c<u.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(u.charAt(c)),6,i),new a(a.Mode.ALPHANUMERIC,u.length,i)}static makeSegments(u){return u==""?[]:a.isNumeric(u)?[a.makeNumeric(u)]:a.isAlphanumeric(u)?[a.makeAlphanumeric(u)]:[a.makeBytes(a.toUtf8ByteArray(u))]}static makeEci(u){let i=[];if(u<0)throw new RangeError("ECI assignment value out of range");if(u<128)r(u,8,i);else if(u<16384)r(2,2,i),r(u,14,i);else if(u<1e6)r(6,3,i),r(u,21,i);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,i)}static isNumeric(u){return a.NUMERIC_REGEX.test(u)}static isAlphanumeric(u){return a.ALPHANUMERIC_REGEX.test(u)}getData(){return this.bitData.slice()}static getTotalBits(u,i){let c=0;for(const h of u){const f=h.mode.numCharCountBits(i);if(h.numChars>=1<<f)return 1/0;c+=4+f+h.bitData.length}return c}static toUtf8ByteArray(u){u=encodeURI(u);let i=[];for(let c=0;c<u.length;c++)u.charAt(c)!="%"?i.push(u.charCodeAt(c)):(i.push(parseInt(u.substr(c+1,2),16)),c+=2);return i}};let m=a;m.NUMERIC_REGEX=/^[0-9]*$/,m.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,m.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=m})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.ordinal=l,this.formatBits=o}};let r=n;r.LOW=new n(0,1),r.MEDIUM=new n(1,0),r.QUARTILE=new n(2,3),r.HIGH=new n(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(l,o){this.modeBits=l,this.numBitsCharCount=o}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};let r=n;r.NUMERIC=new n(1,[10,12,14]),r.ALPHANUMERIC=new n(2,[9,11,13]),r.BYTE=new n(4,[8,16,16]),r.KANJI=new n(8,[8,10,12]),r.ECI=new n(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Ot||(Ot={}));var Qt=Ot;/**
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Wa={L:Kt.QrCode.Ecc.LOW,M:Kt.QrCode.Ecc.MEDIUM,Q:Kt.QrCode.Ecc.QUARTILE,H:Kt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,l){let o=null;r.forEach(function(a,m){if(!a&&o!==null){n.push(`M${o+t} ${l+t}h${m-o}v1H${o+t}z`),o=null;return}if(m===r.length-1){if(!a)return;o===null?n.push(`M${m+t},${l+t} h1v1H${m+t}z`):n.push(`M${o+t},${l+t} h${m+1-o}v1H${o+t}z`);return}a&&o===null&&(o=m)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function Xa(e,t,n,r){if(r==null)return null;const l=n?fr:0,o=e.length+l*2,a=Math.floor(t*Th),m=o/t,u=(r.width||a)*m,i=(r.height||a)*m,c=r.x==null?e.length/2-u/2:r.x*m,h=r.y==null?e.length/2-i/2:r.y*m;let f=null;if(r.excavate){let y=Math.floor(c),p=Math.floor(h),v=Math.ceil(u+c-y),_=Math.ceil(i+h-p);f={x:y,y:p,w:v,h:_}}return{x:c,y:h,h:i,w:u,excavation:f}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,style:u,imageSettings:i}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=i==null?void 0:i.src,f=ge.useRef(null),y=ge.useRef(null),[p,v]=ge.useState(!1);ge.useEffect(()=>{if(f.current!=null){const S=f.current,T=S.getContext("2d");if(!T)return;let D=Kt.QrCode.encodeText(n,Wa[l]).getModules();const $=m?fr:0,k=D.length+$*2,J=Xa(D,r,m,i),re=y.current,te=J!=null&&re!==null&&re.complete&&re.naturalHeight!==0&&re.naturalWidth!==0;te&&J.excavation!=null&&(D=Ja(D,J.excavation));const de=window.devicePixelRatio||1;S.height=S.width=r*de;const be=r/k*de;T.scale(be,be),T.fillStyle=o,T.fillRect(0,0,k,k),T.fillStyle=a,wh?T.fill(new Path2D(Za(D,$))):D.forEach(function(Z,X){Z.forEach(function(q,ue){q&&T.fillRect(ue+$,X+$,1,1)})}),te&&T.drawImage(re,J.x+$,J.y+$,J.w,J.h)}}),ge.useEffect(()=>{v(!1)},[h]);const _=ys({height:r,width:r},u);let E=null;return h!=null&&(E=ge.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:y})),ge.createElement(ge.Fragment,null,ge.createElement("canvas",ys({style:_,height:r,width:r,ref:f},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,imageSettings:u}=t,i=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Kt.QrCode.encodeText(n,Wa[l]).getModules();const h=m?fr:0,f=c.length+h*2,y=Xa(c,r,m,u);let p=null;u!=null&&y!=null&&(y.excavation!=null&&(c=Ja(c,y.excavation)),p=ge.createElement("image",{xlinkHref:u.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ge.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${f} ${f}`},i),ge.createElement("path",{fill:o,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),ge.createElement("path",{fill:a,d:v,shapeRendering:"crispEdges"}),p)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ge.createElement(Ch,ys({},r)):ge.createElement(Ih,ys({},r))};const gs=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},L=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 Mt=tr(),_e="normal-class";(Mt=="Android OS"||Mt==="iOS")&&(_e="bold-class");const qe=e=>{var Et,se,Se,yt,Ke;const t=e.additionalActions??{},{invoiceFormat:n={}}=e,r=ge.useRef(null),l=e.settingData?e.settingData:e.value.settingData,o=localStorage.getItem("siteId"),{staticDataKOT:a,printer:m,type:u}=e.printerDataObject,i=((se=(Et=e.value)==null?void 0:Et.settingData)==null?void 0:se.curr)??((Se=e.settingData)==null?void 0:Se.curr)??"INR";l==null||l.fontTheme;let c=e.printerDataObject.paperSize,h=lr(m,{type:u,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const f=l.customLabels??xd();c=h?(yt=h[0])!=null&&yt.paperSize?(Ke=h[0])==null?void 0:Ke.paperSize:c||"3INCH":e.printerDataObject.paperSize;function y(g){const d=Math.abs(parseFloat(g));return p(d)}function p(g){switch(i){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(g).format("0,00.000");default:return Zs(g).format("0,00.00")}}ge.useEffect(()=>{S()},[e.newId]);const v=()=>new Promise(async(g,d)=>{if(Mt=="Android OS"||Mt==="iOS"){let C=await bh(r.current);if(C){const j=await E(C);g(j)}}else{let C=await $a(r.current);C&&g(C)}}),_=()=>new Promise(async(g,d)=>{const C=await v();g(C)}),E=g=>new Promise((d,C)=>{let j=new Image;j.src=g,j.onload=()=>{let w=document.createElement("canvas");const Y=600,b=j.height;let F=j.width,V=j.height;F>V?F>Y&&(V*=Y/F,F=Y):V>b&&(F*=b/V,V=b),w.width=F,w.height=V,w.getContext("2d").drawImage(j,0,0,F,V),d(w.toDataURL())}}),S=async()=>{if(r&&r.current){const g=await _();e.onImageGenerated(g)}},T=g=>{let d=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],i)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,i)})]})),d},D=g=>{let d=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,i)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return d},$=(g,d,C,j,w={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:Y?g:b,renderAs:"canvas",size:w.size??250})},k=(g,d)=>{var Y,b;let C=0;if((Y=d.taxObj)!=null&&Y.VAT.length){let F,V,fe;for(V=0;V<((b=d.taxObj)==null?void 0:b.VAT.length);V++){F=d.taxObj.VAT[V];for(fe in F)C+=ve(F[fe])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:C},w=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:w,renderAs:"canvas",size:250})},J=g=>{const d=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(d.push(s.jsx("hr",{})),g.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:le(g.rewardAmt,i)})]})),g.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:le(g.totalBalanceAmt,i)})]})),g.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:le(g.writeOffAmt,i)})]})),g.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:le(g.refundAmt,i)})]})),g.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:le(g.cashCard,i)})]}))),d},re=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].slugName===g)return d[C]}return!1},te=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].itemType===g)return d[C]}return!1},de=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),be=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":g.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${g.discountValue}${Mh[g.discountType]}`,Z=g=>{const d=new Array;if(g&&Object.keys(g).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${de[C]}:`}),s.jsx("span",{children:le(g[C].total,i)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][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:le(g[C][j],i)})]}))}return d},X=(g,d)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!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 ${L[c].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.gstTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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"})]}):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)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 ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.vatTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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:g.curr+" "+p(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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]})]})]})})]})},q=(g,d,{labels:C,doMultipleTax:j,type:w})=>{var b,F,V,fe,Me,Le,Ce,Ye,Qe,gt,Rt;const Y=g.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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(Q=>{var St;return s.jsxs("div",{style:Q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:[Q.status==="RETURNED"?"(R) ":"",Q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:Q.serviceRate?y(Q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:Q.sub_total?p(Q.sub_total):""})]}),Q.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",Q.hsnCode]}),(St=Q.addons)!=null&&St.length?Q.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",rt.qty*Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",Q.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+Q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.subTotal)})]}),o=="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=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(Q=>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:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:be(Q)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(F=Y.CATEGORY_DISCOUNT)!=null&&F.length?Y.CATEGORY_DISCOUNT.map(Q=>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:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(V=Y.ITEM_DISCOUNT)!=null&&V.length?Y.ITEM_DISCOUNT.map(Q=>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:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+ts(Q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(Me=(fe=Y.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Me.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:C[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ce=(Le=Y.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Ce.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:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Qe=(Ye=Y.ORDER_DISCOUNT)==null?void 0:Ye[0])!=null&&Qe.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:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(Y.ORDER_DISCOUNT[0].discountValue)?`@${Y.ORDER_DISCOUNT[0].discountValue}${Y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||Y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||Y.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.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"})]}):"",(gt=g.charges)!=null&>.length?g.charges.map(Q=>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:C[`charges_${Q.name.toLowerCase()}`]??Q.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt+Q.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.afterCharges)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.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"&&((Rt=g.taxation)!=null&&Rt.length)?g.taxation.map(Q=>{if(Q.taxAmt)return Q.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:C.cgst}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.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:C[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.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:C.vat}}),s.jsx("span",{children:"@"+Q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:w==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},ue=(g,d)=>{var Y,b;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=j.GST)==null?void 0:Y.itemList)&&q(j.GST,g,{labels:d,doMultipleTax:C,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&q(j.VAT,g,{labels:d,doMultipleTax:C,type:"VAT"})]})},z=g=>{const d=g.services,C=Object.keys(g.services),j=C.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:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),d[Y].map(F=>{var V;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[c].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[c].dynamicClassname}`,children:F.qty})]}),((V=F.addons)==null?void 0:V.length)&&F.addons.map(fe=>{var Me;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Me=fe.serviceName)==null?void 0:Me.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",{})]})]})},ee=g=>{const d=g.slice(0,-4),C=g.slice(-4);return{firstDigits:d,last4Dgits:C}},De=(g,d,C,j={})=>{const w=Object.keys(d??{});let Y=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),g&&w.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,i)})]})]}));for(let V=0;V<w.length;V++)b=w[V],d[b]&&Y.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:le(d[b],i)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,d[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},nt=g=>{const d=Object.keys(g.Category),C=Object.keys(g.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((w,Y)=>{const b=g.Category[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=d.length-1&&s.jsx("hr",{})]})]}))}),C.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"})]})),C.forEach((w,Y)=>{const b=g.Addon[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},At=g=>{var C;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",nonChargeable_disc:"NON CHARGEABLE 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((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let w=0;w<g.customBillLabels.length;w++)j=g.customBillLabels[w],d[j.defaultName]=j.displayName}return d},pt=(g,d,C,j)=>{var V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Q,St,rt,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,Qt,vs,xt,Zt,Jt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,O,U;const w=At(l.customLabelsMap),Y=ms(Nd(l.paymentModes),"internalName"),b=P=>{var N;return(N=Y[P])!=null&&N.displayName?Y[P].displayName.toUpperCase():P};if(g==="BILL"){let P;if(c==="A4"||c==="A5"){let N={...d},H=0,W=N.distributedData;const A=W.discounts;P=s.jsx("div",{className:`invoiceContainer main-div ${L[c].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:`${w.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.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:C&&s.jsx("img",{src:C,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||((V=N.customFields)==null?void 0:V.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})}),(fe=N.customFields)!=null&&fe.length?N.customFields.map(I=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[I.customName,": ",I.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:`${w.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:`${w.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:`${w.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(I=>{var Ae;let he="",Ne=[];return H++,Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:he,children:[s.jsx("td",{className:"text-align-left",children:I.serviceRate?H:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:I.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:I.qty}),s.jsx("td",{className:"text-align-right",children:I.serviceRate?G(I.serviceRate,i):""}),s.jsx("td",{className:"text-align-right",children:I.sub_total?G(I.sub_total,i):""})]}),I.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+I.instruction+")"})]})]})),(Ae=I.addons)!=null&&Ae.length&&I.addons.map(Ze=>{Ne.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:["+ ",Ze.serviceName.toUpperCase()]}),s.jsx("td",{children:Ze.qty*I.qty})]}),Ze.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+Ze.instruction+")"})]})]}))}),Ne}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${H} Items and ${ve(W.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",{}),pd(Oe(N.finalAmount,i).toFixed(Wt[i].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||d.splitDetails&&((Me=d.splitDetails)==null?void 0:Me.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.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:w.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:G(W.subTotal,i)})]}),(Le=A==null?void 0:A.DISCOUNT_ITEMS)!=null&&Le.length?A.DISCOUNT_ITEMS.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:be(I)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ce=A==null?void 0:A.CATEGORY_DISCOUNT)!=null&&Ce.length?A.CATEGORY_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ye=A==null?void 0:A.ITEM_DISCOUNT)!=null&&Ye.length?A.ITEM_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(gt=(Qe=A==null?void 0:A.SEGMENT_DISCOUNT)==null?void 0:Qe[0])!=null&>.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${A.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+A.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+A.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.SEGMENT_DISCOUNT[0].discountAmt,i)})]}):"",(Q=(Rt=A==null?void 0:A.COUPON_DISCOUNT)==null?void 0:Rt[0])!=null&&Q.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:`(${A.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${A.COUPON_DISCOUNT[0].discountValue}${A.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.COUPON_DISCOUNT[0].discountAmt,i)})]}):"",(rt=(St=A==null?void 0:A.ORDER_DISCOUNT)==null?void 0:St[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(A.ORDER_DISCOUNT[0].discountValue)?`@${A.ORDER_DISCOUNT[0].discountValue}${A.ORDER_DISCOUNT[0].discountType=="RELATIVE"||A.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||A.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.ORDER_DISCOUNT[0].discountAmt,i)})]}):"",(xs=W.charges)!=null&&xs.length?W.charges.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${I.name.toLowerCase()}`]??I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.amt,i)})]})):"",W.subTotal!==W.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(W.afterCharges,i)})]}):"",(an=W.taxation)!=null&&an.length?W.taxation.map(I=>I.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.sgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:" @"+I.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt,i)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.finalAmount,i)})]}),(Ns=d==null?void 0:d.custoutStandingData)!=null&&Ns.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:w.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt,i)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.grandTotal+((ln=N==null?void 0:N.custoutStandingData)==null?void 0:ln.balanceAmt),i)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.rewardAmt,i)})]}):"",(on=d.paymentMethods)!=null&&on.length?d.paymentMethods.map(I=>{var he;if(I.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(he=I.paymentMode)==null?void 0:he.toLowerCase()}`]??b(I.paymentMode)??"CASH"}}),s.jsx("span",{children:I.isRefund?"(Refund)":""})]}),I.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+G(I.paidAmt,i)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.paidAmt,i)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(d.balanceAmt,i)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(cn=d.splitDetails)!=null&&cn.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(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+I.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 P=s.jsx("div",{className:"main-div bill",style:{width:L[c].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",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.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.menuDisplayName?d.menuDisplayName: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:w.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 ${L[c].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:w.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:w.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:w.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.nonChargeable_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:w.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:w.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:w.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:w.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(dn=d.customFields)!=null&&dn.length?s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?ue(d,w):X(d,w),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.grand_total}}),s.jsx("h6",{className:`actual-qty ${(un=d.custoutStandingData)!=null&&un.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount)})]}),(mn=d.custoutStandingData)!=null&&mn.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:w.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="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:w.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 H;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(H=N.paymentMode)==null?void 0:H.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+" ("+p(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+(((Qt=d==null?void 0:d.custoutStandingData)==null?void 0:Qt.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((vs=d.convertedCurrValue)==null?void 0:vs.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:`(${G(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:w.balance_amt}}),s.jsx("h5",{children:d.curr+" "+p(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods&&!(n!=null&&n.hideRewardPoints)?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)&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:w.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(xt=d.splitDetails)!=null&&xt.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"&&((Zt=d.taxation)!=null&&Zt.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:L[c].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 Mt==="Android OS"||Mt==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt,i)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt,i)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||d.splitDetails&&((Jt=d.splitDetails)==null?void 0:Jt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&l.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),k(l.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].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 P}else if(g==="PRINT_DASHBOARD"&&d.salesCollection){const P=d.salesCollection.totalDiscountAmt?gs(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=R().format("DD/MM/YYYY LT");const H=(_s=d.monthTillDateSalesColl)!=null&&_s.totalDiscountAmt?gs(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[c].dynamicClassname}`,style:{width:L[c].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:le(d.monthTillDateSalesColl.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.monthTillDateSalesColl.totalDiscountAmt,i)}${H?`(${p(H)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection,i)})]})]}),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:le(d.salesCollection.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.salesCollection.totalDiscountAmt,i)}${P?`(${p(P)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.salesCollection.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(N,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]})]}),s.jsx("hr",{}),De(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),De(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),De(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:le(d.salesCollection.totalCollection,i)})]}),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})]}),T(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:De(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 ",l.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:le(d.averageCollection.avgorderValue,i)})]}):"",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:le(d.averageCollection.avgPerCover,i)})]}):"",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:le(d.totalCollection,i)})]}),D(d)]}),J(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:le(d.otherFields.salesCollection,i)})]}),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:le(d.otherFields.outstandingAmt,i)})]}):""]})]}):"",s.jsx("hr",{}),Z(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Mt=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let P;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",P.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:w.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:w.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName: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:w.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:w.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:L[c].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:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(H=>{var W;return s.jsxs("div",{style:H.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:H.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:H.qty})]}),((W=H.addons)==null?void 0:W.length)&&H.addons.map(A=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(A.serviceName)})),H.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:H.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:le(a.discountAmt,i)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(H=>{if(H.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:H.name}),s.jsx("h5",{children:a.curr+" "+p(H.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(H=>{let W=new Array;for(const A in H)if(H[A]&&H[A]!=0){let I=A/2;W.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",I]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",I,"%"]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]})]}))}return W})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(H=>s.jsx("h4",{className:"left-align-entity",children:H.customName+": "+H.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:L[c].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(g==="UPDATE_TABLE"){let P="";return a.action==="SWITCH_TABLE"?P=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:["**",(pn=f.Table)==null?void 0:pn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ss=a.from)==null?void 0:Ss.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(yn=(Ts=e.tableData[a.to[0]])==null?void 0:Ts.attachedArea)==null?void 0:yn.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):P=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 ",(ws=f.Table)==null?void 0:ws.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Is=a.from)==null?void 0:Is.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(Nn=(xn=e.tableData[a.to[0]])==null?void 0:xn.attachedArea)==null?void 0:Nn.toUpperCase()} - ${(jn=e.tableData[a.to[0]])==null?void 0:jn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),P}else if(g==="COUNTER_OPERATION"){let P;return c=="2INCH"||c=="1.8INCH"?P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),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: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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:[" ",G(a.openingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.actualOpeningBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.openingShort,i)," "]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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:[" ",G(a.cashSale,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingActualBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingShort,i)," "]}),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:[" -",G(a.debitEntry,i)," "]})]}),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:[" +",G(a.creditEntry,i)," "]})]}),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:[" -",G(a.internalTransferDebit,i)]})]}),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:[" +",G(a.internalTransferCredit,i)]})]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}):P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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 : ",G(a.openingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",G(a.actualOpeningBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",G(a.openingShort,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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 : ",G(a.cashSale,i)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",G(a.closingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",G(a.closingActualBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",G(a.closingShort,i)]}),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 : -",G(a.debitEntry,i)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",G(a.creditEntry,i)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",G(a.internalTransferDebit,i)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",G(a.internalTransferCredit,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}),P}else if(g==="ITEMWISE_SALES_COUNTER"){let P,{counterDetails:N}=e.printerDataObject;return P=s.jsx("div",{className:"main-div",style:{width:L[c].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",{}),nt(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}`})]})}),P}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:P}=e.printerDataObject;return getRechargeDetails(P)}else if(g==="PACKAGING_SLIP"){let P,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(P=ee(d.aggregatorOrderId));const H=d.services;for(let A in H)N+=H[A].length;return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.Waiter} Name: `+d.waiterName})]}),z(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)]})]}),(vn=d.customFields)==null?void 0:vn.map(A=>s.jsx("h4",{className:"left-align-entity",children:A.customName+": "+A.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(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[c].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 ${L[c].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:w.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:w.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:w.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:w.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:w.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.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 ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(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+" "+p(a.totalPaid)})]})]}),(x=a.transactions)!=null&&x.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 ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(a.totalPayable)})]})]})]})});{let P,N=0,H,W;for(let I=0;I<(((O=a.services)==null?void 0:O.length)||0);I++)W=a.services[I],W.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=W.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.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:`${f.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:L[c].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(I=>(I.status==="CANCELLED"?H=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}):H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}),s.jsx("div",{children:H}))),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)]})]}),(U=a.customFields)==null?void 0:U.map(I=>s.jsx("h4",{className:"left-align-entity",children:I.customName+": "+I.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:r,className:"html-bill-print",style:{maxWidth:L[c].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(u,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(l,o)=>{var a,m,u;try{const{needPackagingSlip:i=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((a=n[e.primaryWaiter])==null?void 0:a.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let f=[],y=[];const p=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(T=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{f.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),T()},additionalActions:r},v.newId+"::"+E.printer))});y.push(S)})}),i&&((m=t.packagingSlipPrinters)!=null&&m.length)){const v=Sd(e,t,r);(u=v.printers)!=null&&u.length&&v.printers.forEach(_=>{y.push(new Promise(E=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{f.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}p.length&&bt("root2",p),await Promise.all(y),l(f)}catch(i){o(i)}}),Eh=(e,t,n)=>new Promise(async(r,l)=>{try{const{tableData:o}=n;let a=[],m=[];if(n!=null&&n.action){const{obj:u,paperSize:i,printersMap:c}=Td(e,t,n),h=Sa(u).flatMap(f=>{var y;return(y=c[f.station])==null?void 0:y.map(p=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:f,paperSize:i,printer:p.printer,type:f.type},newId:f.newId,settingData:t,tableData:ms(o,"typeValue"),onImageGenerated:E=>{a.push({paperSize:p.paperSize,printer:p.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return m.push(v),_}))});h.length&&bt("root1",h),await Promise.all(m.map(f=>new Promise(f)))}r(a)}catch(o){l(o)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const l=wd(e,t);let o=[];await new Promise(m=>{const u=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:l},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:l.id,settingData:e,onImageGenerated:i=>{o.push({paperSize:e.printerSize,image:i,type:"PRINT_DASHBOARD"}),m()},additionalActions:t});bt("root1",u)}),n(o)}catch(l){r(l)}}),Lh=async(e,t,n)=>new Promise(async(r,l)=>{try{const{obj:o}=await Id(e,t,n);let a=[];await new Promise(u=>{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"AGGREGATOR_BILL"}),u()},additionalActions:n});bt("root1",i)}),r(a)}catch(o){l(o)}}),kh=async(e,t,n)=>new Promise(async(r,l)=>{try{let o=await ba(e,t,n),a=[];await new Promise(async u=>{if(n.isSplitBill&&o.obj.splitDetails&&o.obj.splitDetails.length){const i=o.obj.splitDetails.map((c,h)=>new Promise(f=>{let y=JSON.parse(JSON.stringify(o));y.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:y,paperSize:y.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{a.push({paperSize:y.paperSize,image:v,type:"BILL"}),f()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(p)}));await Promise.all(i),u()}else{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"BILL"}),u()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(i)}}),r(a)}catch(o){l(o)}}),Ph=async(e,t,n,r)=>new Promise(async(l,o)=>{try{let a=await Cd(e);if(a&&Object.keys(a.Category).length!==0){let u=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,i=[];await new Promise(h=>{const f=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:u,settingData:t,onImageGenerated:y=>{i.push({paperSize:t.printerSize,image:y,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});bt("root1",f)}),l(i)}else l([])}catch(a){o(a)}}),Fh=async(e,t,n)=>new Promise(async(r,l)=>{try{let a=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(i=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:a,settingData:t,onImageGenerated:h=>{m.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),i()},additionalActions:n});bt("root1",c)}),r(m)}catch(o){l(o)}}),Dh=async(e,t,n={},r={})=>new Promise(async(l,o)=>{var a;try{const m=await Md(e,t);let u=[],i=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=i?(a=i[0])==null?void 0:a.paperSize:t.printerSize;await new Promise(f=>{const y=s.jsx(qe,{printerDataObject:{staticDataKOT:{...m,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:p=>{u.push({paperSize:c,image:p,type:"ORDER_AGGREGATED_PRINT"}),f()},additionalActions:r});bt("root1",y)}),l(u)}catch(m){o(m)}}),Yh=async(e,t,n={})=>new Promise(async(r,l)=>{var o;try{const a=[];let m=[];for(let u=0;u<e.length;u++){let i=e[u];if((o=i.invoiceFormats)!=null&&o.length){let c=dd(i.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(y=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{m.push({paperSize:h.paperSize,image:v,type:"BILL"}),y()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});a.push(p)})}}a.length&&bt("root1",a),r(m)}catch(a){l(a)}}),bt=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ge.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};we.counterDetailsPrint=Fh,we.handleAggregatorBillPrint=Lh,we.handleBillPrint=kh,we.handleDashboardPrint=Rh,we.handleItemWisePrint=Ph,we.handleKOTPrint=Ah,we.handleOldBillPrints=Yh,we.handleSummaryPrint=Dh,we.handleUpdateTablePrint=Eh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Wa={L:Qt.QrCode.Ecc.LOW,M:Qt.QrCode.Ecc.MEDIUM,Q:Qt.QrCode.Ecc.QUARTILE,H:Qt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,l){let o=null;r.forEach(function(a,m){if(!a&&o!==null){n.push(`M${o+t} ${l+t}h${m-o}v1H${o+t}z`),o=null;return}if(m===r.length-1){if(!a)return;o===null?n.push(`M${m+t},${l+t} h1v1H${m+t}z`):n.push(`M${o+t},${l+t} h${m+1-o}v1H${o+t}z`);return}a&&o===null&&(o=m)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function Xa(e,t,n,r){if(r==null)return null;const l=n?fr:0,o=e.length+l*2,a=Math.floor(t*Th),m=o/t,u=(r.width||a)*m,i=(r.height||a)*m,c=r.x==null?e.length/2-u/2:r.x*m,h=r.y==null?e.length/2-i/2:r.y*m;let f=null;if(r.excavate){let y=Math.floor(c),p=Math.floor(h),v=Math.ceil(u+c-y),_=Math.ceil(i+h-p);f={x:y,y:p,w:v,h:_}}return{x:c,y:h,h:i,w:u,excavation:f}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,style:u,imageSettings:i}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=i==null?void 0:i.src,f=ge.useRef(null),y=ge.useRef(null),[p,v]=ge.useState(!1);ge.useEffect(()=>{if(f.current!=null){const S=f.current,T=S.getContext("2d");if(!T)return;let D=Qt.QrCode.encodeText(n,Wa[l]).getModules();const $=m?fr:0,k=D.length+$*2,J=Xa(D,r,m,i),re=y.current,te=J!=null&&re!==null&&re.complete&&re.naturalHeight!==0&&re.naturalWidth!==0;te&&J.excavation!=null&&(D=Ja(D,J.excavation));const de=window.devicePixelRatio||1;S.height=S.width=r*de;const be=r/k*de;T.scale(be,be),T.fillStyle=o,T.fillRect(0,0,k,k),T.fillStyle=a,wh?T.fill(new Path2D(Za(D,$))):D.forEach(function(Z,X){Z.forEach(function(K,ue){K&&T.fillRect(ue+$,X+$,1,1)})}),te&&T.drawImage(re,J.x+$,J.y+$,J.w,J.h)}}),ge.useEffect(()=>{v(!1)},[h]);const _=gs({height:r,width:r},u);let E=null;return h!=null&&(E=ge.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:y})),ge.createElement(ge.Fragment,null,ge.createElement("canvas",gs({style:_,height:r,width:r,ref:f},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,imageSettings:u}=t,i=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Qt.QrCode.encodeText(n,Wa[l]).getModules();const h=m?fr:0,f=c.length+h*2,y=Xa(c,r,m,u);let p=null;u!=null&&y!=null&&(y.excavation!=null&&(c=Ja(c,y.excavation)),p=ge.createElement("image",{xlinkHref:u.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ge.createElement("svg",gs({height:r,width:r,viewBox:`0 0 ${f} ${f}`},i),ge.createElement("path",{fill:o,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),ge.createElement("path",{fill:a,d:v,shapeRendering:"crispEdges"}),p)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ge.createElement(Ch,gs({},r)):ge.createElement(Ih,gs({},r))};const xs=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},L=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 Mt=tr(),je="normal-class";(Mt=="Android OS"||Mt==="iOS")&&(je="bold-class");const qe=e=>{var Et,se,Se,yt,Ke;const t=e.additionalActions??{},{invoiceFormat:n={}}=e,r=ge.useRef(null),l=e.settingData?e.settingData:e.value.settingData,o=localStorage.getItem("siteId"),{staticDataKOT:a,printer:m,type:u}=e.printerDataObject,i=((se=(Et=e.value)==null?void 0:Et.settingData)==null?void 0:se.curr)??((Se=e.settingData)==null?void 0:Se.curr)??"INR";l==null||l.fontTheme,console.log("staticDataKOT>>>",a);let c=e.printerDataObject.paperSize,h=lr(m,{type:u,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const f=l.customLabels??xd();c=h?(yt=h[0])!=null&&yt.paperSize?(Ke=h[0])==null?void 0:Ke.paperSize:c||"3INCH":e.printerDataObject.paperSize;function y(g){const d=Math.abs(parseFloat(g));return p(d)}function p(g){switch(i){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(g).format("0,00.000");default:return Zs(g).format("0,00.00")}}ge.useEffect(()=>{S()},[e.newId]);const v=()=>new Promise(async(g,d)=>{if(Mt=="Android OS"||Mt==="iOS"){let C=await bh(r.current);if(C){const j=await E(C);g(j)}}else{let C=await $a(r.current);C&&g(C)}}),_=()=>new Promise(async(g,d)=>{const C=await v();g(C)}),E=g=>new Promise((d,C)=>{let j=new Image;j.src=g,j.onload=()=>{let w=document.createElement("canvas");const Y=600,b=j.height;let F=j.width,V=j.height;F>V?F>Y&&(V*=Y/F,F=Y):V>b&&(F*=b/V,V=b),w.width=F,w.height=V,w.getContext("2d").drawImage(j,0,0,F,V),d(w.toDataURL())}}),S=async()=>{if(r&&r.current){const g=await _();e.onImageGenerated(g)}},T=g=>{let d=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],i)}),s.jsx("span",{children:p(xs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,i)})]})),d},D=g=>{let d=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,i)}),s.jsx("span",{children:p(xs(g.totalCollection,C.value))+"%"})]}));return d},$=(g,d,C,j,w={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:Y?g:b,renderAs:"canvas",size:w.size??250})},k=(g,d)=>{var Y,b;let C=0;if((Y=d.taxObj)!=null&&Y.VAT.length){let F,V,fe;for(V=0;V<((b=d.taxObj)==null?void 0:b.VAT.length);V++){F=d.taxObj.VAT[V];for(fe in F)C+=_e(F[fe])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:C},w=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:w,renderAs:"canvas",size:250})},J=g=>{const d=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(d.push(s.jsx("hr",{})),g.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:le(g.rewardAmt,i)})]})),g.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:le(g.totalBalanceAmt,i)})]})),g.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:le(g.writeOffAmt,i)})]})),g.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:le(g.refundAmt,i)})]})),g.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:le(g.cashCard,i)})]}))),d},re=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].slugName===g)return d[C]}return!1},te=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].itemType===g)return d[C]}return!1},de=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),be=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":g.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${g.discountValue}${Mh[g.discountType]}`,Z=g=>{const d=new Array;if(g&&Object.keys(g).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${de[C]}:`}),s.jsx("span",{children:le(g[C].total,i)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][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:le(g[C][j],i)})]}))}return d},X=(g,d)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!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 ${L[c].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.gstTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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"})]}):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)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 ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.vatTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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:g.curr+" "+p(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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]})]})]})})]})},K=(g,d,{labels:C,doMultipleTax:j,type:w})=>{var b,F,V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Lt;const Y=g.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 ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(q=>{var St;return s.jsxs("div",{style:q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:[q.status==="RETURNED"?"(R) ":"",q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:q.serviceRate?y(q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:q.sub_total?p(q.sub_total):""})]}),q.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",q.hsnCode]}),(St=q.addons)!=null&&St.length?q.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",rt.qty*q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",q.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname} ${je}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.subTotal)})]}),o=="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=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+q.discountName.toUpperCase()}}),s.jsx("span",{children:be(q)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.discountAmt)})]})):"",(F=Y.CATEGORY_DISCOUNT)!=null&&F.length?Y.CATEGORY_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.discountAmt)})]})):"",(V=Y.ITEM_DISCOUNT)!=null&&V.length?Y.ITEM_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+ss(q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.discountAmt)})]})):"",(Me=(fe=Y.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Me.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ce=(Le=Y.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Ce.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,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:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Ye=Y.OFFER_DISCOUNT)!=null&&Ye.length?Y.OFFER_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+q.discountName.toUpperCase()}}),s.jsxs("span",{children:["@",q.discountType=="RELATIVE"?q.discountValue:p(q.discountAmt),q.discountType=="RELATIVE"?"%":"AMT"]})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.discountAmt)})]})):"",(gt=(Qe=Y.ORDER_DISCOUNT)==null?void 0:Qe[0])!=null&>.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(Y.ORDER_DISCOUNT[0].discountValue)?`@${Y.ORDER_DISCOUNT[0].discountValue}${Y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||Y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||Y.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${je}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Rt=g.charges)!=null&&Rt.length?g.charges.map(q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${q.name.toLowerCase()}`]??q.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.amt+q.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.afterCharges)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.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"&&((Lt=g.taxation)!=null&&Lt.length)?g.taxation.map(q=>{if(q.taxAmt)return q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${je}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:w==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},ue=(g,d)=>{var Y,b;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=j.GST)==null?void 0:Y.itemList)&&K(j.GST,g,{labels:d,doMultipleTax:C,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&K(j.VAT,g,{labels:d,doMultipleTax:C,type:"VAT"})]})},z=g=>{const d=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${je}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),d[Y].map(F=>{var V;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[c].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[c].dynamicClassname}`,children:F.qty})]}),((V=F.addons)==null?void 0:V.length)&&F.addons.map(fe=>{var Me;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Me=fe.serviceName)==null?void 0:Me.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",{})]})]})},ee=g=>{const d=g.slice(0,-4),C=g.slice(-4);return{firstDigits:d,last4Dgits:C}},De=(g,d,C,j={})=>{const w=Object.keys(d??{});let Y=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),g&&w.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,i)})]})]}));for(let V=0;V<w.length;V++)b=w[V],d[b]&&Y.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:le(d[b],i)}),j.action==="addCharges"?s.jsx("span",{children:p(xs(g,d[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},nt=g=>{const d=Object.keys(g.Category),C=Object.keys(g.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((w,Y)=>{const b=g.Category[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ss(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=d.length-1&&s.jsx("hr",{})]})]}))}),C.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"})]})),C.forEach((w,Y)=>{const b=g.Addon[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ss(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},At=g=>{var C;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",nonChargeable_disc:"NON CHARGEABLE 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((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let w=0;w<g.customBillLabels.length;w++)j=g.customBillLabels[w],d[j.defaultName]=j.displayName}return d},pt=(g,d,C,j)=>{var V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Lt,q,St,rt,an,Ns,js,ln,on,cn,dn,hn,un,mn,Zt,vs,xt,Jt,Xt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,O,U;const w=At(l.customLabelsMap),Y=fs(Nd(l.paymentModes),"internalName"),b=P=>{var N;return(N=Y[P])!=null&&N.displayName?Y[P].displayName.toUpperCase():P};if(g==="BILL"){let P;if(c==="A4"||c==="A5"){let N={...d},H=0,W=N.distributedData;const A=W.discounts;P=s.jsx("div",{className:`invoiceContainer main-div ${L[c].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:`${w.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.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:C&&s.jsx("img",{src:C,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||((V=N.customFields)==null?void 0:V.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})}),(fe=N.customFields)!=null&&fe.length?N.customFields.map(I=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[I.customName,": ",I.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:`${w.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:`${w.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:`${w.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(I=>{var Ae;let he="",Ne=[];return H++,Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:he,children:[s.jsx("td",{className:"text-align-left",children:I.serviceRate?H:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:I.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:I.qty}),s.jsx("td",{className:"text-align-right",children:I.serviceRate?G(I.serviceRate,i):""}),s.jsx("td",{className:"text-align-right",children:I.sub_total?G(I.sub_total,i):""})]}),I.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+I.instruction+")"})]})]})),(Ae=I.addons)!=null&&Ae.length&&I.addons.map(Ze=>{Ne.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:["+ ",Ze.serviceName.toUpperCase()]}),s.jsx("td",{children:Ze.qty*I.qty})]}),Ze.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+Ze.instruction+")"})]})]}))}),Ne}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${H} Items and ${_e(W.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",{}),pd(Oe(N.finalAmount,i).toFixed(zt[i].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||d.splitDetails&&((Me=d.splitDetails)==null?void 0:Me.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.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:w.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:G(W.subTotal,i)})]}),(Le=A==null?void 0:A.DISCOUNT_ITEMS)!=null&&Le.length?A.DISCOUNT_ITEMS.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:be(I)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ce=A==null?void 0:A.CATEGORY_DISCOUNT)!=null&&Ce.length?A.CATEGORY_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ye=A==null?void 0:A.ITEM_DISCOUNT)!=null&&Ye.length?A.ITEM_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(gt=(Qe=A==null?void 0:A.SEGMENT_DISCOUNT)==null?void 0:Qe[0])!=null&>.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${A.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+A.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+A.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.SEGMENT_DISCOUNT[0].discountAmt,i)})]}):"",(Lt=(Rt=A==null?void 0:A.COUPON_DISCOUNT)==null?void 0:Rt[0])!=null&&Lt.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:`(${A.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${A.COUPON_DISCOUNT[0].discountValue}${A.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.COUPON_DISCOUNT[0].discountAmt,i)})]}):"",(St=(q=A==null?void 0:A.ORDER_DISCOUNT)==null?void 0:q[0])!=null&&St.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(A.ORDER_DISCOUNT[0].discountValue)?`@${A.ORDER_DISCOUNT[0].discountValue}${A.ORDER_DISCOUNT[0].discountType=="RELATIVE"||A.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||A.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.ORDER_DISCOUNT[0].discountAmt,i)})]}):"",(rt=W.charges)!=null&&rt.length?W.charges.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${I.name.toLowerCase()}`]??I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.amt,i)})]})):"",W.subTotal!==W.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(W.afterCharges,i)})]}):"",(an=W.taxation)!=null&&an.length?W.taxation.map(I=>I.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.sgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:" @"+I.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt,i)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.finalAmount,i)})]}),(Ns=d==null?void 0:d.custoutStandingData)!=null&&Ns.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:w.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt,i)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.grandTotal+((ln=N==null?void 0:N.custoutStandingData)==null?void 0:ln.balanceAmt),i)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.rewardAmt,i)})]}):"",(on=d.paymentMethods)!=null&&on.length?d.paymentMethods.map(I=>{var he;if(I.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(he=I.paymentMode)==null?void 0:he.toLowerCase()}`]??b(I.paymentMode)??"CASH"}}),s.jsx("span",{children:I.isRefund?"(Refund)":""})]}),I.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+G(I.paidAmt,i)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.paidAmt,i)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(d.balanceAmt,i)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(cn=d.splitDetails)!=null&&cn.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(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+I.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 P=s.jsx("div",{className:"main-div bill",style:{width:L[c].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",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.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.menuDisplayName?d.menuDisplayName: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:w.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 ${L[c].dynamicClassname} ${je}`,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:w.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:w.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:w.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.nonChargeable_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:w.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:w.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:w.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:w.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(dn=d.customFields)!=null&&dn.length?s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?ue(d,w):X(d,w),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.grand_total}}),s.jsx("h6",{className:`actual-qty ${(un=d.custoutStandingData)!=null&&un.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount)})]}),(mn=d.custoutStandingData)!=null&&mn.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:w.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="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:w.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 H;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(H=N.paymentMode)==null?void 0:H.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+" ("+p(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+(((Zt=d==null?void 0:d.custoutStandingData)==null?void 0:Zt.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((vs=d.convertedCurrValue)==null?void 0:vs.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${je}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${G(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:w.balance_amt}}),s.jsx("h5",{children:d.curr+" "+p(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods&&!(n!=null&&n.hideRewardPoints)?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)&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:w.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(xt=d.splitDetails)!=null&&xt.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"&&((Jt=d.taxation)!=null&&Jt.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:L[c].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 Mt==="Android OS"||Mt==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt,i)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt,i)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||d.splitDetails&&((Xt=d.splitDetails)==null?void 0:Xt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&l.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),k(l.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].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 P}else if(g==="PRINT_DASHBOARD"&&d.salesCollection){const P=d.salesCollection.totalDiscountAmt?xs(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=R().format("DD/MM/YYYY LT");const H=(_s=d.monthTillDateSalesColl)!=null&&_s.totalDiscountAmt?xs(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[c].dynamicClassname}`,style:{width:L[c].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:le(d.monthTillDateSalesColl.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.monthTillDateSalesColl.totalDiscountAmt,i)}${H?`(${p(H)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection,i)})]})]}),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:le(d.salesCollection.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.salesCollection.totalDiscountAmt,i)}${P?`(${p(P)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.salesCollection.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(N,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]})]}),s.jsx("hr",{}),De(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),De(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),De(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:le(d.salesCollection.totalCollection,i)})]}),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})]}),T(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:De(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 ",l.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:le(d.averageCollection.avgorderValue,i)})]}):"",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:le(d.averageCollection.avgPerCover,i)})]}):"",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:le(d.totalCollection,i)})]}),D(d)]}),J(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:le(d.otherFields.salesCollection,i)})]}),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:le(d.otherFields.outstandingAmt,i)})]}):""]})]}):"",s.jsx("hr",{}),Z(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Mt=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let P;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",P.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:w.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:w.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName: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:w.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:w.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:L[c].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:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(H=>{var W;return s.jsxs("div",{style:H.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:H.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:H.qty})]}),((W=H.addons)==null?void 0:W.length)&&H.addons.map(A=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(A.serviceName)})),H.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:H.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: ",_e(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:le(a.discountAmt,i)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(H=>{if(H.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:H.name}),s.jsx("h5",{children:a.curr+" "+p(H.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(H=>{let W=new Array;for(const A in H)if(H[A]&&H[A]!=0){let I=A/2;W.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",I]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",I,"%"]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]})]}))}return W})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(H=>s.jsx("h4",{className:"left-align-entity",children:H.customName+": "+H.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:L[c].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(g==="UPDATE_TABLE"){let P="";return a.action==="SWITCH_TABLE"?P=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:["**",(pn=f.Table)==null?void 0:pn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ss=a.from)==null?void 0:Ss.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(yn=(Ts=e.tableData[a.to[0]])==null?void 0:Ts.attachedArea)==null?void 0:yn.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):P=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 ",(ws=f.Table)==null?void 0:ws.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Is=a.from)==null?void 0:Is.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(Nn=(xn=e.tableData[a.to[0]])==null?void 0:xn.attachedArea)==null?void 0:Nn.toUpperCase()} - ${(jn=e.tableData[a.to[0]])==null?void 0:jn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),P}else if(g==="COUNTER_OPERATION"){let P;return c=="2INCH"||c=="1.8INCH"?P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),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: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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:[" ",G(a.openingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.actualOpeningBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.openingShort,i)," "]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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:[" ",G(a.cashSale,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingActualBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",G(a.closingShort,i)," "]}),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:[" -",G(a.debitEntry,i)," "]})]}),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:[" +",G(a.creditEntry,i)," "]})]}),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:[" -",G(a.internalTransferDebit,i)]})]}),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:[" +",G(a.internalTransferCredit,i)]})]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}):P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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 : ",G(a.openingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",G(a.actualOpeningBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",G(a.openingShort,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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 : ",G(a.cashSale,i)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",G(a.closingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",G(a.closingActualBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",G(a.closingShort,i)]}),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 : -",G(a.debitEntry,i)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",G(a.creditEntry,i)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",G(a.internalTransferDebit,i)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",G(a.internalTransferCredit,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}),P}else if(g==="ITEMWISE_SALES_COUNTER"){let P,{counterDetails:N}=e.printerDataObject;return P=s.jsx("div",{className:"main-div",style:{width:L[c].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",{}),nt(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}`})]})}),P}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:P}=e.printerDataObject;return getRechargeDetails(P)}else if(g==="PACKAGING_SLIP"){let P,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(P=ee(d.aggregatorOrderId));const H=d.services;for(let A in H)N+=H[A].length;return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.Waiter} Name: `+d.waiterName})]}),z(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: ",_e(d.totalQty)]})]}),(vn=d.customFields)==null?void 0:vn.map(A=>s.jsx("h4",{className:"left-align-entity",children:A.customName+": "+A.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(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[c].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 ${L[c].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:w.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:w.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:w.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:w.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:w.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.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 ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(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+" "+p(a.totalPaid)})]})]}),(x=a.transactions)!=null&&x.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 ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(a.totalPayable)})]})]})]})});{let P,N=0,H,W;for(let I=0;I<(((O=a.services)==null?void 0:O.length)||0);I++)W=a.services[I],W.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=W.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.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:`${f.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${je}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${je}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(I=>(I.status==="CANCELLED"?H=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}):H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}),s.jsx("div",{children:H}))),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: ",_e(a.totalQty-N)]})]}),(U=a.customFields)==null?void 0:U.map(I=>s.jsx("h4",{className:"left-align-entity",children:I.customName+": "+I.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:r,className:"html-bill-print",style:{maxWidth:L[c].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(u,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(l,o)=>{var a,m,u;try{const{needPackagingSlip:i=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((a=n[e.primaryWaiter])==null?void 0:a.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let f=[],y=[];const p=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(T=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{f.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),T()},additionalActions:r},v.newId+"::"+E.printer))});y.push(S)})}),i&&((m=t.packagingSlipPrinters)!=null&&m.length)){const v=Sd(e,t,r);(u=v.printers)!=null&&u.length&&v.printers.forEach(_=>{y.push(new Promise(E=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{f.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}p.length&&bt("root2",p),await Promise.all(y),l(f)}catch(i){o(i)}}),Eh=(e,t,n)=>new Promise(async(r,l)=>{try{const{tableData:o}=n;let a=[],m=[];if(n!=null&&n.action){const{obj:u,paperSize:i,printersMap:c}=Td(e,t,n),h=Sa(u).flatMap(f=>{var y;return(y=c[f.station])==null?void 0:y.map(p=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:f,paperSize:i,printer:p.printer,type:f.type},newId:f.newId,settingData:t,tableData:fs(o,"typeValue"),onImageGenerated:E=>{a.push({paperSize:p.paperSize,printer:p.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return m.push(v),_}))});h.length&&bt("root1",h),await Promise.all(m.map(f=>new Promise(f)))}r(a)}catch(o){l(o)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const l=wd(e,t);let o=[];await new Promise(m=>{const u=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:l},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:l.id,settingData:e,onImageGenerated:i=>{o.push({paperSize:e.printerSize,image:i,type:"PRINT_DASHBOARD"}),m()},additionalActions:t});bt("root1",u)}),n(o)}catch(l){r(l)}}),Lh=async(e,t,n)=>new Promise(async(r,l)=>{try{const{obj:o}=await Id(e,t,n);let a=[];await new Promise(u=>{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"AGGREGATOR_BILL"}),u()},additionalActions:n});bt("root1",i)}),r(a)}catch(o){l(o)}}),kh=async(e,t,n)=>(console.log("handleBillprintData",e),new Promise(async(r,l)=>{try{let o=await ba(e,t,n),a=[];await new Promise(async u=>{if(n.isSplitBill&&o.obj.splitDetails&&o.obj.splitDetails.length){const i=o.obj.splitDetails.map((c,h)=>new Promise(f=>{let y=JSON.parse(JSON.stringify(o));y.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:y,paperSize:y.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{a.push({paperSize:y.paperSize,image:v,type:"BILL"}),f()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(p)}));await Promise.all(i),u()}else{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"BILL"}),u()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(i)}}),r(a)}catch(o){l(o)}})),Ph=async(e,t,n,r)=>new Promise(async(l,o)=>{try{let a=await Cd(e);if(a&&Object.keys(a.Category).length!==0){let u=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,i=[];await new Promise(h=>{const f=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:u,settingData:t,onImageGenerated:y=>{i.push({paperSize:t.printerSize,image:y,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});bt("root1",f)}),l(i)}else l([])}catch(a){o(a)}}),Fh=async(e,t,n)=>new Promise(async(r,l)=>{try{let a=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(i=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:a,settingData:t,onImageGenerated:h=>{m.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),i()},additionalActions:n});bt("root1",c)}),r(m)}catch(o){l(o)}}),Dh=async(e,t,n={},r={})=>new Promise(async(l,o)=>{var a;try{const m=await Md(e,t);let u=[],i=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=i?(a=i[0])==null?void 0:a.paperSize:t.printerSize;await new Promise(f=>{const y=s.jsx(qe,{printerDataObject:{staticDataKOT:{...m,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:p=>{u.push({paperSize:c,image:p,type:"ORDER_AGGREGATED_PRINT"}),f()},additionalActions:r});bt("root1",y)}),l(u)}catch(m){o(m)}}),Yh=async(e,t,n={})=>new Promise(async(r,l)=>{var o;try{const a=[];let m=[];for(let u=0;u<e.length;u++){let i=e[u];if((o=i.invoiceFormats)!=null&&o.length){let c=dd(i.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(y=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{m.push({paperSize:h.paperSize,image:v,type:"BILL"}),y()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});a.push(p)})}}a.length&&bt("root1",a),r(m)}catch(a){l(a)}}),bt=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ge.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};we.counterDetailsPrint=Fh,we.handleAggregatorBillPrint=Lh,we.handleBillPrint=kh,we.handleDashboardPrint=Rh,we.handleItemWisePrint=Ph,we.handleKOTPrint=Ah,we.handleOldBillPrints=Yh,we.handleSummaryPrint=Dh,we.handleUpdateTablePrint=Eh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
|