recaho-print-react 0.0.128 → 0.0.1301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(Oe,je){typeof exports=="object"&&typeof module<"u"?je(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],je):(Oe=typeof globalThis<"u"?globalThis:Oe||self,je(Oe["recaho-print-react"]={},Oe.React,Oe.ReactDOM))})(this,function(Oe,je,Xa){"use strict";function pr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms={exports:{}},Xt={};/**
1
+ (function(Ce,Ne){typeof exports=="object"&&typeof module<"u"?Ne(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Ne):(Ce=typeof globalThis<"u"?globalThis:Ce||self,Ne(Ce["recaho-print-react"]={},Ce.React,Ce.ReactDOM))})(this,function(Ce,Ne,ei){"use strict";function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ms={exports:{}},Xt={};/**
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 yr;function ei(){if(yr)return Xt;yr=1;var e=je,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function h(f,o,l){var c,d={},p=null,m=null;l!==void 0&&(p=""+l),o.key!==void 0&&(p=""+o.key),o.ref!==void 0&&(m=o.ref);for(c in o)r.call(o,c)&&!a.hasOwnProperty(c)&&(d[c]=o[c]);if(f&&f.defaultProps)for(c in o=f.defaultProps,o)d[c]===void 0&&(d[c]=o[c]);return{$$typeof:t,type:f,key:p,ref:m,props:d,_owner:i.current}}return Xt.Fragment=n,Xt.jsx=h,Xt.jsxs=h,Xt}var es={};/**
9
+ */var gr;function ti(){if(gr)return Xt;gr=1;var e=Ne,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function h(f,o,l){var c,d={},p=null,m=null;l!==void 0&&(p=""+l),o.key!==void 0&&(p=""+o.key),o.ref!==void 0&&(m=o.ref);for(c in o)r.call(o,c)&&!a.hasOwnProperty(c)&&(d[c]=o[c]);if(f&&f.defaultProps)for(c in o=f.defaultProps,o)d[c]===void 0&&(d[c]=o[c]);return{$$typeof:t,type:f,key:p,ref:m,props:d,_owner:i.current}}return Xt.Fragment=n,Xt.jsx=h,Xt.jsxs=h,Xt}var es={};/**
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 gr;function ti(){return gr||(gr=1,process.env.NODE_ENV!=="production"&&function(){var e=je,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function b(y){if(y===null||typeof y!="object")return null;var N=x&&y[x]||y[v];return typeof N=="function"?N:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(y){{for(var N=arguments.length,L=new Array(N>1?N-1:0),V=1;V<N;V++)L[V-1]=arguments[V];M("error",y,L)}}function M(y,N,L){{var V=w.ReactDebugCurrentFrame,ce=V.getStackAddendum();ce!==""&&(N+="%s",L=L.concat([ce]));var ue=L.map(function(le){return String(le)});ue.unshift("Warning: "+N),Function.prototype.apply.call(console[y],console,ue)}}var P=!1,O=!1,z=!1,K=!1,se=!1,Q;Q=Symbol.for("react.module.reference");function ie(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||se||y===i||y===l||y===c||K||y===m||P||O||z||typeof y=="object"&&y!==null&&(y.$$typeof===p||y.$$typeof===d||y.$$typeof===h||y.$$typeof===f||y.$$typeof===o||y.$$typeof===Q||y.getModuleId!==void 0))}function Ce(y,N,L){var V=y.displayName;if(V)return V;var ce=N.displayName||N.name||"";return ce!==""?L+"("+ce+")":L}function W(y){return y.displayName||"Context"}function q(y){if(y==null)return null;if(typeof y.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case f:var N=y;return W(N)+".Consumer";case h:var L=y;return W(L._context)+".Provider";case o:return Ce(y,y.render,"ForwardRef");case d:var V=y.displayName||null;return V!==null?V:q(y.type)||"Memo";case p:{var ce=y,ue=ce._payload,le=ce._init;try{return q(le(ue))}catch{return null}}}return null}var B=Object.assign,fe=0,U,Z,nt,rt,Mt,at,At;function J(){}J.__reactDisabledLog=!0;function be(){{if(fe===0){U=console.log,Z=console.info,nt=console.warn,rt=console.error,Mt=console.group,at=console.groupCollapsed,At=console.groupEnd;var y={configurable:!0,enumerable:!0,value:J,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}fe++}}function gt(){{if(fe--,fe===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},y,{value:U}),info:B({},y,{value:Z}),warn:B({},y,{value:nt}),error:B({},y,{value:rt}),group:B({},y,{value:Mt}),groupCollapsed:B({},y,{value:at}),groupEnd:B({},y,{value:At})})}fe<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g=w.ReactCurrentDispatcher,u;function I(y,N,L){{if(u===void 0)try{throw Error()}catch(ce){var V=ce.stack.trim().match(/\n( *(at )?)/);u=V&&V[1]||""}return`
18
- `+u+y}}var j=!1,C;{var F=typeof WeakMap=="function"?WeakMap:Map;C=new F}function T(y,N){if(!y||j)return"";{var L=C.get(y);if(L!==void 0)return L}var V;j=!0;var ce=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ue;ue=g.current,g.current=null,be();try{if(N){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(De){V=De}Reflect.construct(y,[],le)}else{try{le.call()}catch(De){V=De}y.call(le.prototype)}}else{try{throw Error()}catch(De){V=De}y()}}catch(De){if(De&&V&&typeof De.stack=="string"){for(var re=De.stack.split(`
19
- `),Re=V.stack.split(`
20
- `),Se=re.length-1,we=Re.length-1;Se>=1&&we>=0&&re[Se]!==Re[we];)we--;for(;Se>=1&&we>=0;Se--,we--)if(re[Se]!==Re[we]){if(Se!==1||we!==1)do if(Se--,we--,we<0||re[Se]!==Re[we]){var ze=`
21
- `+re[Se].replace(" at new "," at ");return y.displayName&&ze.includes("<anonymous>")&&(ze=ze.replace("<anonymous>",y.displayName)),typeof y=="function"&&C.set(y,ze),ze}while(Se>=1&&we>=0);break}}}finally{j=!1,g.current=ue,gt(),Error.prepareStackTrace=ce}var Jt=y?y.displayName||y.name:"",kt=Jt?I(Jt):"";return typeof y=="function"&&C.set(y,kt),kt}function R(y,N,L){return T(y,!1)}function $(y){var N=y.prototype;return!!(N&&N.isReactComponent)}function pe(y,N,L){if(y==null)return"";if(typeof y=="function")return T(y,$(y));if(typeof y=="string")return I(y);switch(y){case l:return I("Suspense");case c:return I("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case o:return R(y.render);case d:return pe(y.type,N,L);case p:{var V=y,ce=V._payload,ue=V._init;try{return pe(ue(ce),N,L)}catch{}}}return""}var Ee=Object.prototype.hasOwnProperty,Pe={},Fe=w.ReactDebugCurrentFrame;function Ae(y){if(y){var N=y._owner,L=pe(y.type,y._source,N?N.type:null);Fe.setExtraStackFrame(L)}else Fe.setExtraStackFrame(null)}function $e(y,N,L,V,ce){{var ue=Function.call.bind(Ee);for(var le in y)if(ue(y,le)){var re=void 0;try{if(typeof y[le]!="function"){var Re=Error((V||"React class")+": "+L+" type `"+le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[le]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Re.name="Invariant Violation",Re}re=y[le](N,le,V,L,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Se){re=Se}re&&!(re instanceof Error)&&(Ae(ce),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).",V||"React class",L,le,typeof re),Ae(null)),re instanceof Error&&!(re.message in Pe)&&(Pe[re.message]=!0,Ae(ce),S("Failed %s type: %s",L,re.message),Ae(null))}}}var Et=Array.isArray;function xt(y){return Et(y)}function G(y){{var N=typeof Symbol=="function"&&Symbol.toStringTag,L=N&&y[Symbol.toStringTag]||y.constructor.name||"Object";return L}}function Rt(y){try{return it(y),!1}catch{return!0}}function it(y){return""+y}function Ns(y){if(Rt(y))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",G(y)),it(y)}var js=w.ReactCurrentOwner,on={key:!0,ref:!0,__self:!0,__source:!0},vs,_s;function cn(y){if(Ee.call(y,"ref")){var N=Object.getOwnPropertyDescriptor(y,"ref").get;if(N&&N.isReactWarning)return!1}return y.ref!==void 0}function dn(y){if(Ee.call(y,"key")){var N=Object.getOwnPropertyDescriptor(y,"key").get;if(N&&N.isReactWarning)return!1}return y.key!==void 0}function hn(y,N){typeof y.ref=="string"&&js.current}function un(y,N){{var L=function(){vs||(vs=!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)",N))};L.isReactWarning=!0,Object.defineProperty(y,"key",{get:L,configurable:!0})}}function mn(y,N){{var L=function(){_s||(_s=!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)",N))};L.isReactWarning=!0,Object.defineProperty(y,"ref",{get:L,configurable:!0})}}var fn=function(y,N,L,V,ce,ue,le){var re={$$typeof:t,type:y,key:N,ref:L,props:le,_owner:ue};return re._store={},Object.defineProperty(re._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(re,"_self",{configurable:!1,enumerable:!1,writable:!1,value:V}),Object.defineProperty(re,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ce}),Object.freeze&&(Object.freeze(re.props),Object.freeze(re)),re};function pn(y,N,L,V,ce){{var ue,le={},re=null,Re=null;L!==void 0&&(Ns(L),re=""+L),dn(N)&&(Ns(N.key),re=""+N.key),cn(N)&&(Re=N.ref,hn(N,ce));for(ue in N)Ee.call(N,ue)&&!on.hasOwnProperty(ue)&&(le[ue]=N[ue]);if(y&&y.defaultProps){var Se=y.defaultProps;for(ue in Se)le[ue]===void 0&&(le[ue]=Se[ue])}if(re||Re){var we=typeof y=="function"?y.displayName||y.name||"Unknown":y;re&&un(le,we),Re&&mn(le,we)}return fn(y,re,Re,ce,V,js.current,le)}}var Kt=w.ReactCurrentOwner,bs=w.ReactDebugCurrentFrame;function Nt(y){if(y){var N=y._owner,L=pe(y.type,y._source,N?N.type:null);bs.setExtraStackFrame(L)}else bs.setExtraStackFrame(null)}var Qt;Qt=!1;function Zt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function Ss(){{if(Kt.current){var y=q(Kt.current.type);if(y)return`
17
+ */var xr;function si(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=Ne,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),f=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),x=Symbol.iterator,j="@@iterator";function S(y){if(y===null||typeof y!="object")return null;var _=x&&y[x]||y[j];return typeof _=="function"?_:null}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(y){{for(var _=arguments.length,v=new Array(_>1?_-1:0),z=1;z<_;z++)v[z-1]=arguments[z];I("error",y,v)}}function I(y,_,v){{var z=A.ReactDebugCurrentFrame,le=z.getStackAddendum();le!==""&&(_+="%s",v=v.concat([le]));var ue=v.map(function(ne){return String(ne)});ue.unshift("Warning: "+_),Function.prototype.apply.call(console[y],console,ue)}}var P=!1,D=!1,R=!1,q=!1,se=!1,J;J=Symbol.for("react.module.reference");function ce(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||se||y===i||y===l||y===c||q||y===m||P||D||R||typeof y=="object"&&y!==null&&(y.$$typeof===p||y.$$typeof===d||y.$$typeof===h||y.$$typeof===f||y.$$typeof===o||y.$$typeof===J||y.getModuleId!==void 0))}function Te(y,_,v){var z=y.displayName;if(z)return z;var le=_.displayName||_.name||"";return le!==""?v+"("+le+")":v}function G(y){return y.displayName||"Context"}function K(y){if(y==null)return null;if(typeof y.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof y=="function")return y.displayName||y.name||null;if(typeof y=="string")return y;switch(y){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case c:return"SuspenseList"}if(typeof y=="object")switch(y.$$typeof){case f:var _=y;return G(_)+".Consumer";case h:var v=y;return G(v._context)+".Provider";case o:return Te(y,y.render,"ForwardRef");case d:var z=y.displayName||null;return z!==null?z:K(y.type)||"Memo";case p:{var le=y,ue=le._payload,ne=le._init;try{return K(ne(ue))}catch{return null}}}return null}var B=Object.assign,me=0,$,Q,st,nt,Ot,rt,Mt;function Z(){}Z.__reactDisabledLog=!0;function be(){{if(me===0){$=console.log,Q=console.info,st=console.warn,nt=console.error,Ot=console.group,rt=console.groupCollapsed,Mt=console.groupEnd;var y={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}me++}}function yt(){{if(me--,me===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},y,{value:$}),info:B({},y,{value:Q}),warn:B({},y,{value:st}),error:B({},y,{value:nt}),group:B({},y,{value:Ot}),groupCollapsed:B({},y,{value:rt}),groupEnd:B({},y,{value:Mt})})}me<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g=A.ReactCurrentDispatcher,u;function C(y,_,v){{if(u===void 0)try{throw Error()}catch(le){var z=le.stack.trim().match(/\n( *(at )?)/);u=z&&z[1]||""}return`
18
+ `+u+y}}var N=!1,O;{var F=typeof WeakMap=="function"?WeakMap:Map;O=new F}function T(y,_){if(!y||N)return"";{var v=O.get(y);if(v!==void 0)return v}var z;N=!0;var le=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ue;ue=g.current,g.current=null,be();try{if(_){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Fe){z=Fe}Reflect.construct(y,[],ne)}else{try{ne.call()}catch(Fe){z=Fe}y.call(ne.prototype)}}else{try{throw Error()}catch(Fe){z=Fe}y()}}catch(Fe){if(Fe&&z&&typeof Fe.stack=="string"){for(var ae=Fe.stack.split(`
19
+ `),Ee=z.stack.split(`
20
+ `),Se=ae.length-1,we=Ee.length-1;Se>=1&&we>=0&&ae[Se]!==Ee[we];)we--;for(;Se>=1&&we>=0;Se--,we--)if(ae[Se]!==Ee[we]){if(Se!==1||we!==1)do if(Se--,we--,we<0||ae[Se]!==Ee[we]){var We=`
21
+ `+ae[Se].replace(" at new "," at ");return y.displayName&&We.includes("<anonymous>")&&(We=We.replace("<anonymous>",y.displayName)),typeof y=="function"&&O.set(y,We),We}while(Se>=1&&we>=0);break}}}finally{N=!1,g.current=ue,yt(),Error.prepareStackTrace=le}var Jt=y?y.displayName||y.name:"",Rt=Jt?C(Jt):"";return typeof y=="function"&&O.set(y,Rt),Rt}function k(y,_,v){return T(y,!1)}function H(y){var _=y.prototype;return!!(_&&_.isReactComponent)}function fe(y,_,v){if(y==null)return"";if(typeof y=="function")return T(y,H(y));if(typeof y=="string")return C(y);switch(y){case l:return C("Suspense");case c:return C("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case o:return k(y.render);case d:return fe(y.type,_,v);case p:{var z=y,le=z._payload,ue=z._init;try{return fe(ue(le),_,v)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,Le={},Pe=A.ReactDebugCurrentFrame;function Me(y){if(y){var _=y._owner,v=fe(y.type,y._source,_?_.type:null);Pe.setExtraStackFrame(v)}else Pe.setExtraStackFrame(null)}function Ue(y,_,v,z,le){{var ue=Function.call.bind(Ae);for(var ne in y)if(ue(y,ne)){var ae=void 0;try{if(typeof y[ne]!="function"){var Ee=Error((z||"React class")+": "+v+" type `"+ne+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof y[ne]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}ae=y[ne](_,ne,z,v,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Se){ae=Se}ae&&!(ae instanceof Error)&&(Me(le),w("%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).",z||"React class",v,ne,typeof ae),Me(null)),ae instanceof Error&&!(ae.message in Le)&&(Le[ae.message]=!0,Me(le),w("Failed %s type: %s",v,ae.message),Me(null))}}}var At=Array.isArray;function gt(y){return At(y)}function V(y){{var _=typeof Symbol=="function"&&Symbol.toStringTag,v=_&&y[Symbol.toStringTag]||y.constructor.name||"Object";return v}}function Et(y){try{return at(y),!1}catch{return!0}}function at(y){return""+y}function Ns(y){if(Et(y))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",V(y)),at(y)}var js=A.ReactCurrentOwner,ln={key:!0,ref:!0,__self:!0,__source:!0},vs,_s;function on(y){if(Ae.call(y,"ref")){var _=Object.getOwnPropertyDescriptor(y,"ref").get;if(_&&_.isReactWarning)return!1}return y.ref!==void 0}function cn(y){if(Ae.call(y,"key")){var _=Object.getOwnPropertyDescriptor(y,"key").get;if(_&&_.isReactWarning)return!1}return y.key!==void 0}function dn(y,_){typeof y.ref=="string"&&js.current}function hn(y,_){{var v=function(){vs||(vs=!0,w("%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)",_))};v.isReactWarning=!0,Object.defineProperty(y,"key",{get:v,configurable:!0})}}function un(y,_){{var v=function(){_s||(_s=!0,w("%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)",_))};v.isReactWarning=!0,Object.defineProperty(y,"ref",{get:v,configurable:!0})}}var mn=function(y,_,v,z,le,ue,ne){var ae={$$typeof:t,type:y,key:_,ref:v,props:ne,_owner:ue};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:le}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function fn(y,_,v,z,le){{var ue,ne={},ae=null,Ee=null;v!==void 0&&(Ns(v),ae=""+v),cn(_)&&(Ns(_.key),ae=""+_.key),on(_)&&(Ee=_.ref,dn(_,le));for(ue in _)Ae.call(_,ue)&&!ln.hasOwnProperty(ue)&&(ne[ue]=_[ue]);if(y&&y.defaultProps){var Se=y.defaultProps;for(ue in Se)ne[ue]===void 0&&(ne[ue]=Se[ue])}if(ae||Ee){var we=typeof y=="function"?y.displayName||y.name||"Unknown":y;ae&&hn(ne,we),Ee&&un(ne,we)}return mn(y,ae,Ee,le,z,js.current,ne)}}var Kt=A.ReactCurrentOwner,bs=A.ReactDebugCurrentFrame;function xt(y){if(y){var _=y._owner,v=fe(y.type,y._source,_?_.type:null);bs.setExtraStackFrame(v)}else bs.setExtraStackFrame(null)}var Qt;Qt=!1;function Zt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function Ss(){{if(Kt.current){var y=K(Kt.current.type);if(y)return`
22
22
 
23
- Check the render method of \``+y+"`."}return""}}function yn(y){return""}var Ts={};function gn(y){{var N=Ss();if(!N){var L=typeof y=="string"?y:y.displayName||y.name;L&&(N=`
23
+ Check the render method of \``+y+"`."}return""}}function pn(y){return""}var Ts={};function yn(y){{var _=Ss();if(!_){var v=typeof y=="string"?y:y.displayName||y.name;v&&(_=`
24
24
 
25
- Check the top-level render call using <`+L+">.")}return N}}function ws(y,N){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var L=gn(N);if(Ts[L])return;Ts[L]=!0;var V="";y&&y._owner&&y._owner!==Kt.current&&(V=" It was passed a child from "+q(y._owner.type)+"."),Nt(y),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',L,V),Nt(null)}}function Is(y,N){{if(typeof y!="object")return;if(xt(y))for(var L=0;L<y.length;L++){var V=y[L];Zt(V)&&ws(V,N)}else if(Zt(y))y._store&&(y._store.validated=!0);else if(y){var ce=b(y);if(typeof ce=="function"&&ce!==y.entries)for(var ue=ce.call(y),le;!(le=ue.next()).done;)Zt(le.value)&&ws(le.value,N)}}}function xn(y){{var N=y.type;if(N==null||typeof N=="string")return;var L;if(typeof N=="function")L=N.propTypes;else if(typeof N=="object"&&(N.$$typeof===o||N.$$typeof===d))L=N.propTypes;else return;if(L){var V=q(N);$e(L,y.props,"prop",V,y)}else if(N.PropTypes!==void 0&&!Qt){Qt=!0;var ce=q(N);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ce||"Unknown")}typeof N.getDefaultProps=="function"&&!N.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nn(y){{for(var N=Object.keys(y.props),L=0;L<N.length;L++){var V=N[L];if(V!=="children"&&V!=="key"){Nt(y),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",V),Nt(null);break}}y.ref!==null&&(Nt(y),S("Invalid attribute `ref` supplied to `React.Fragment`."),Nt(null))}}var Cs={};function Os(y,N,L,V,ce,ue){{var le=ie(y);if(!le){var re="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(re+=" 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 Re=yn();Re?re+=Re:re+=Ss();var Se;y===null?Se="null":xt(y)?Se="array":y!==void 0&&y.$$typeof===t?(Se="<"+(q(y.type)||"Unknown")+" />",re=" Did you accidentally export a JSX literal instead of a component?"):Se=typeof y,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Se,re)}var we=pn(y,N,L,ce,ue);if(we==null)return we;if(le){var ze=N.children;if(ze!==void 0)if(V)if(xt(ze)){for(var Jt=0;Jt<ze.length;Jt++)Is(ze[Jt],y);Object.freeze&&Object.freeze(ze)}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 Is(ze,y)}if(Ee.call(N,"key")){var kt=q(y),De=Object.keys(N).filter(function(Yh){return Yh!=="key"}),fr=De.length>0?"{key: someKey, "+De.join(": ..., ")+": ...}":"{key: someKey}";if(!Cs[kt+fr]){var Dh=De.length>0?"{"+De.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+v+">.")}return _}}function ws(y,_){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var v=yn(_);if(Ts[v])return;Ts[v]=!0;var z="";y&&y._owner&&y._owner!==Kt.current&&(z=" It was passed a child from "+K(y._owner.type)+"."),xt(y),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',v,z),xt(null)}}function Is(y,_){{if(typeof y!="object")return;if(gt(y))for(var v=0;v<y.length;v++){var z=y[v];Zt(z)&&ws(z,_)}else if(Zt(y))y._store&&(y._store.validated=!0);else if(y){var le=S(y);if(typeof le=="function"&&le!==y.entries)for(var ue=le.call(y),ne;!(ne=ue.next()).done;)Zt(ne.value)&&ws(ne.value,_)}}}function gn(y){{var _=y.type;if(_==null||typeof _=="string")return;var v;if(typeof _=="function")v=_.propTypes;else if(typeof _=="object"&&(_.$$typeof===o||_.$$typeof===d))v=_.propTypes;else return;if(v){var z=K(_);Ue(v,y.props,"prop",z,y)}else if(_.PropTypes!==void 0&&!Qt){Qt=!0;var le=K(_);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",le||"Unknown")}typeof _.getDefaultProps=="function"&&!_.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xn(y){{for(var _=Object.keys(y.props),v=0;v<_.length;v++){var z=_[v];if(z!=="children"&&z!=="key"){xt(y),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),xt(null);break}}y.ref!==null&&(xt(y),w("Invalid attribute `ref` supplied to `React.Fragment`."),xt(null))}}var Cs={};function Os(y,_,v,z,le,ue){{var ne=ce(y);if(!ne){var ae="";(y===void 0||typeof y=="object"&&y!==null&&Object.keys(y).length===0)&&(ae+=" 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 Ee=pn();Ee?ae+=Ee:ae+=Ss();var Se;y===null?Se="null":gt(y)?Se="array":y!==void 0&&y.$$typeof===t?(Se="<"+(K(y.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Se=typeof y,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Se,ae)}var we=fn(y,_,v,le,ue);if(we==null)return we;if(ne){var We=_.children;if(We!==void 0)if(z)if(gt(We)){for(var Jt=0;Jt<We.length;Jt++)Is(We[Jt],y);Object.freeze&&Object.freeze(We)}else w("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 Is(We,y)}if(Ae.call(_,"key")){var Rt=K(y),Fe=Object.keys(_).filter(function(Uh){return Uh!=="key"}),pr=Fe.length>0?"{key: someKey, "+Fe.join(": ..., ")+": ...}":"{key: someKey}";if(!Cs[Rt+pr]){var Yh=Fe.length>0?"{"+Fe.join(": ..., ")+": ...}":"{}";w(`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} />`,fr,kt,Dh,kt),Cs[kt+fr]=!0}}return y===r?Nn(we):xn(we),we}}function te(y,N,L){return Os(y,N,L,!0)}function _(y,N,L){return Os(y,N,L,!1)}var X=_,me=te;es.Fragment=r,es.jsx=X,es.jsxs=me}()),es}var xr;function si(){return xr||(xr=1,process.env.NODE_ENV==="production"?Ms.exports=ei():Ms.exports=ti()),Ms.exports}var s=si(),Lt={},Nr;function ni(){if(Nr)return Lt;Nr=1;var e=Xa;if(process.env.NODE_ENV==="production")Lt.createRoot=e.createRoot,Lt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Lt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Lt.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return Lt}var ri=ni();const ai=pr(ri),ts=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
30
+ <%s key={someKey} {...props} />`,pr,Rt,Yh,Rt),Cs[Rt+pr]=!0}}return y===r?xn(we):gn(we),we}}function Nn(y,_,v){return Os(y,_,v,!0)}function te(y,_,v){return Os(y,_,v,!1)}var b=te,X=Nn;es.Fragment=r,es.jsx=b,es.jsxs=X}()),es}var Nr;function ni(){return Nr||(Nr=1,process.env.NODE_ENV==="production"?Ms.exports=ti():Ms.exports=si()),Ms.exports}var s=ni(),kt={},jr;function ri(){if(jr)return kt;jr=1;var e=ei;if(process.env.NODE_ENV==="production")kt.createRoot=e.createRoot,kt.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;kt.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},kt.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return kt}var ai=ri();const ii=yr(ai),ts=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 jr;function E(){return jr.apply(null,arguments)}function ii(e){jr=e}function Ge(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 de(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(de(e,t))return!1;return!0}function ke(e){return e===void 0}function lt(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ss(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function vr(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function jt(e,t){for(var n in t)de(t,n)&&(e[n]=t[n]);return de(t,"toString")&&(e.toString=t.toString),de(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Ze(e,t,n,r){return qr(e,t,n,r,!0).utc()}function li(){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 ee(e){return e._pf==null&&(e._pf=li()),e._pf}var vn;Array.prototype.some?vn=Array.prototype.some:vn=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 _n(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=ee(e),n=vn.call(t.parsedDateParts,function(i){return i!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function As(e){var t=Ze(NaN);return e!=null?jt(ee(t),e):ee(t).userInvalidated=!0,t}var _r=E.momentProperties=[],bn=!1;function Sn(e,t){var n,r,i,a=_r.length;if(ke(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),ke(t._i)||(e._i=t._i),ke(t._f)||(e._f=t._f),ke(t._l)||(e._l=t._l),ke(t._strict)||(e._strict=t._strict),ke(t._tzm)||(e._tzm=t._tzm),ke(t._isUTC)||(e._isUTC=t._isUTC),ke(t._offset)||(e._offset=t._offset),ke(t._pf)||(e._pf=ee(t)),ke(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=_r[n],i=t[r],ke(i)||(e[r]=i);return e}function ns(e){Sn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),bn===!1&&(bn=!0,E.updateOffset(this),bn=!1)}function Ve(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function br(e){E.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function He(e,t){var n=!0;return jt(function(){if(E.deprecationHandler!=null&&E.deprecationHandler(null,e),n){var r=[],i,a,h,f=arguments.length;for(a=0;a<f;a++){if(i="",typeof arguments[a]=="object"){i+=`
36
- [`+a+"] ";for(h in arguments[0])de(arguments[0],h)&&(i+=h+": "+arguments[0][h]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}br(e+`
35
+ var vr;function E(){return vr.apply(null,arguments)}function li(e){vr=e}function ze(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function St(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function de(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function jn(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(de(e,t))return!1;return!0}function Re(e){return e===void 0}function it(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function ss(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function _r(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function Nt(e,t){for(var n in t)de(t,n)&&(e[n]=t[n]);return de(t,"toString")&&(e.toString=t.toString),de(t,"valueOf")&&(e.valueOf=t.valueOf),e}function Qe(e,t,n,r){return Kr(e,t,n,r,!0).utc()}function oi(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function ee(e){return e._pf==null&&(e._pf=oi()),e._pf}var vn;Array.prototype.some?vn=Array.prototype.some:vn=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 _n(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=ee(e),n=vn.call(t.parsedDateParts,function(i){return i!=null}),r=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict&&(r=r&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(e))e._isValid=r;else return r;return e._isValid}function As(e){var t=Qe(NaN);return e!=null?Nt(ee(t),e):ee(t).userInvalidated=!0,t}var br=E.momentProperties=[],bn=!1;function Sn(e,t){var n,r,i,a=br.length;if(Re(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Re(t._i)||(e._i=t._i),Re(t._f)||(e._f=t._f),Re(t._l)||(e._l=t._l),Re(t._strict)||(e._strict=t._strict),Re(t._tzm)||(e._tzm=t._tzm),Re(t._isUTC)||(e._isUTC=t._isUTC),Re(t._offset)||(e._offset=t._offset),Re(t._pf)||(e._pf=ee(t)),Re(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=br[n],i=t[r],Re(i)||(e[r]=i);return e}function ns(e){Sn(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),bn===!1&&(bn=!0,E.updateOffset(this),bn=!1)}function Ge(e){return e instanceof ns||e!=null&&e._isAMomentObject!=null}function Sr(e){E.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function $e(e,t){var n=!0;return Nt(function(){if(E.deprecationHandler!=null&&E.deprecationHandler(null,e),n){var r=[],i,a,h,f=arguments.length;for(a=0;a<f;a++){if(i="",typeof arguments[a]=="object"){i+=`
36
+ [`+a+"] ";for(h in arguments[0])de(arguments[0],h)&&(i+=h+": "+arguments[0][h]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}Sr(e+`
37
37
  Arguments: `+Array.prototype.slice.call(r).join("")+`
38
- `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Sr={};function Tr(e,t){E.deprecationHandler!=null&&E.deprecationHandler(e,t),Sr[e]||(br(t),Sr[e]=!0)}E.suppressDeprecationWarnings=!1,E.deprecationHandler=null;function Je(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function oi(e){var t,n;for(n in e)de(e,n)&&(t=e[n],Je(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 Tn(e,t){var n=jt({},e),r;for(r in t)de(t,r)&&(Tt(e[r])&&Tt(t[r])?(n[r]={},jt(n[r],e[r]),jt(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)de(e,r)&&!de(t,r)&&Tt(e[r])&&(n[r]=jt({},n[r]));return n}function wn(e){e!=null&&this.set(e)}var In;Object.keys?In=Object.keys:In=function(e){var t,n=[];for(t in e)de(e,t)&&n.push(t);return n};var ci={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function di(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Je(r)?r.call(t,n):r}function Xe(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Cn=/(\[[^\[]*\])|(\\)?([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,Es=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,On={},Pt={};function H(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Pt[e]=i),t&&(Pt[t[0]]=function(){return Xe(i.apply(this,arguments),t[1],t[2])}),n&&(Pt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function hi(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function ui(e){var t=e.match(Cn),n,r;for(n=0,r=t.length;n<r;n++)Pt[t[n]]?t[n]=Pt[t[n]]:t[n]=hi(t[n]);return function(i){var a="",h;for(h=0;h<r;h++)a+=Je(t[h])?t[h].call(i,e):t[h];return a}}function Rs(e,t){return e.isValid()?(t=wr(t,e.localeData()),On[t]=On[t]||ui(t),On[t](e)):e.localeData().invalidDate()}function wr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Es.lastIndex=0;n>=0&&Es.test(e);)e=e.replace(Es,r),Es.lastIndex=0,n-=1;return e}var mi={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 fi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Cn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var pi="Invalid date";function yi(){return this._invalidDate}var gi="%d",xi=/\d{1,2}/;function Ni(e){return this._ordinal.replace("%d",e)}var ji={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 vi(e,t,n,r){var i=this._relativeTime[n];return Je(i)?i(e,t,n,r):i.replace(/%d/i,e)}function _i(e,t){var n=this._relativeTime[e>0?"future":"past"];return Je(n)?n(t):n.replace(/%s/i,t)}var Ir={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 Be(e){return typeof e=="string"?Ir[e]||Ir[e.toLowerCase()]:void 0}function Mn(e){var t={},n,r;for(r in e)de(e,r)&&(n=Be(r),n&&(t[n]=e[r]));return t}var bi={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 Si(e){var t=[],n;for(n in e)de(e,n)&&t.push({unit:n,priority:bi[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Cr=/\d/,Ye=/\d\d/,Or=/\d{3}/,An=/\d{4}/,ks=/[+-]?\d{6}/,ge=/\d\d?/,Mr=/\d\d\d\d?/,Ar=/\d\d\d\d\d\d?/,Ls=/\d{1,3}/,En=/\d{1,4}/,Ps=/[+-]?\d{1,6}/,Ft=/\d+/,Fs=/[+-]?\d+/,Ti=/Z|[+-]\d\d:?\d\d/gi,Ds=/Z|[+-]\d\d(?::?\d\d)?/gi,wi=/[+-]?\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?/,Rn=/^([1-9]\d|\d)/,Ys;Ys={};function D(e,t,n){Ys[e]=Je(t)?t:function(r,i){return r&&n?n:t}}function Ii(e,t){return de(Ys,e)?Ys[e](t._strict,t._locale):new RegExp(Ci(e))}function Ci(e){return ot(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function ot(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function We(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ne(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=We(t)),n}var kn={};function ye(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),lt(t)&&(r=function(a,h){h[t]=ne(a)}),i=e.length,n=0;n<i;n++)kn[e[n]]=r}function as(e,t){ye(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Oi(e,t,n){t!=null&&de(kn,e)&&kn[e](t,n._a,n,e)}function Us(e){return e%4===0&&e%100!==0||e%400===0}var Me=0,ct=1,et=2,Ie=3,qe=4,dt=5,wt=6,Mi=7,Ai=8;H("Y",0,0,function(){var e=this.year();return e<=9999?Xe(e,4):"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),D("Y",Fs),D("YY",ge,Ye),D("YYYY",En,An),D("YYYYY",Ps,ks),D("YYYYYY",Ps,ks),ye(["YYYYY","YYYYYY"],Me),ye("YYYY",function(e,t){t[Me]=e.length===2?E.parseTwoDigitYear(e):ne(e)}),ye("YY",function(e,t){t[Me]=E.parseTwoDigitYear(e)}),ye("Y",function(e,t){t[Me]=parseInt(e,10)});function is(e){return Us(e)?366:365}E.parseTwoDigitYear=function(e){return ne(e)+(ne(e)>68?1900:2e3)};var Er=Yt("FullYear",!0);function Ei(){return Us(this.year())}function Yt(e,t){return function(n){return n!=null?(Rr(this,e,n),E.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 Rr(e,t,n){var r,i,a,h,f;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,h=e.month(),f=e.date(),f=f===29&&h===1&&!Us(a)?28:f,i?r.setUTCFullYear(a,h,f):r.setFullYear(a,h,f)}}function Ri(e){return e=Be(e),Je(this[e])?this[e]():this}function ki(e,t){if(typeof e=="object"){e=Mn(e);var n=Si(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=Be(e),Je(this[e]))return this[e](t);return this}function Li(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 Ln(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Li(t,12);return e+=(t-n)/12,n===1?Us(e)?29:28:31-n%7%2}H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),D("M",ge,Dt),D("MM",ge,Ye),D("MMM",function(e,t){return t.monthsShortRegex(e)}),D("MMMM",function(e,t){return t.monthsRegex(e)}),ye(["M","MM"],function(e,t){t[ct]=ne(e)-1}),ye(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[ct]=i:ee(n).invalidMonth=e});var Pi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),kr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Lr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fi=rs,Di=rs;function Yi(e,t){return e?Ge(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Lr).test(t)?"format":"standalone"][e.month()]:Ge(this._months)?this._months:this._months.standalone}function Ui(e,t){return e?Ge(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Lr.test(t)?"format":"standalone"][e.month()]:Ge(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function $i(e,t,n){var r,i,a,h=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Ze([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=ve.call(this._shortMonthsParse,h),i!==-1?i:null):(i=ve.call(this._longMonthsParse,h),i!==-1?i:null):t==="MMM"?(i=ve.call(this._shortMonthsParse,h),i!==-1?i:(i=ve.call(this._longMonthsParse,h),i!==-1?i:null)):(i=ve.call(this._longMonthsParse,h),i!==-1?i:(i=ve.call(this._shortMonthsParse,h),i!==-1?i:null))}function Hi(e,t,n){var r,i,a;if(this._monthsParseExact)return $i.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Ze([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Pr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=ne(t);else if(t=e.localeData().monthsParse(t),!lt(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Ln(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Fr(e){return e!=null?(Pr(this,e),E.updateOffset(this,!0),this):ls(this,"Month")}function Bi(){return Ln(this.year(),this.month())}function Wi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Dr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(de(this,"_monthsShortRegex")||(this._monthsShortRegex=Fi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function zi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Dr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(de(this,"_monthsRegex")||(this._monthsRegex=Di),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Dr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,h,f;for(i=0;i<12;i++)a=Ze([2e3,i]),h=ot(this.monthsShort(a,"")),f=ot(this.months(a,"")),t.push(h),n.push(f),r.push(f),r.push(h);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 Gi(e,t,n,r,i,a,h){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,r,i,a,h),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,r,i,a,h),f}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 $s(e,t,n){var r=7+t-n,i=(7+os(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Yr(e,t,n,r,i){var a=(7+n-r)%7,h=$s(e,r,i),f=1+7*(t-1)+a+h,o,l;return f<=0?(o=e-1,l=is(o)+f):f>is(e)?(o=e+1,l=f-is(e)):(o=e,l=f),{year:o,dayOfYear:l}}function cs(e,t,n){var r=$s(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,h;return i<1?(h=e.year()-1,a=i+ht(h,t,n)):i>ht(e.year(),t,n)?(a=i-ht(e.year(),t,n),h=e.year()+1):(h=e.year(),a=i),{week:a,year:h}}function ht(e,t,n){var r=$s(e,t,n),i=$s(e+1,t,n);return(is(e)-r+i)/7}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),D("w",ge,Dt),D("ww",ge,Ye),D("W",ge,Dt),D("WW",ge,Ye),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=ne(e)});function Vi(e){return cs(e,this._week.dow,this._week.doy).week}var qi={dow:0,doy:6};function Ki(){return this._week.dow}function Qi(){return this._week.doy}function Zi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Ji(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),D("d",ge),D("e",ge),D("E",ge),D("dd",function(e,t){return t.weekdaysMinRegex(e)}),D("ddd",function(e,t){return t.weekdaysShortRegex(e)}),D("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:ee(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=ne(e)});function Xi(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function el(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var tl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ur="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),sl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),nl=rs,rl=rs,al=rs;function il(e,t){var n=Ge(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Pn(n,this._week.dow):e?n[e.day()]:n}function ll(e){return e===!0?Pn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ol(e){return e===!0?Pn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function cl(e,t,n){var r,i,a,h=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Ze([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=ve.call(this._weekdaysParse,h),i!==-1?i:null):t==="ddd"?(i=ve.call(this._shortWeekdaysParse,h),i!==-1?i:null):(i=ve.call(this._minWeekdaysParse,h),i!==-1?i:null):t==="dddd"?(i=ve.call(this._weekdaysParse,h),i!==-1||(i=ve.call(this._shortWeekdaysParse,h),i!==-1)?i:(i=ve.call(this._minWeekdaysParse,h),i!==-1?i:null)):t==="ddd"?(i=ve.call(this._shortWeekdaysParse,h),i!==-1||(i=ve.call(this._weekdaysParse,h),i!==-1)?i:(i=ve.call(this._minWeekdaysParse,h),i!==-1?i:null)):(i=ve.call(this._minWeekdaysParse,h),i!==-1||(i=ve.call(this._weekdaysParse,h),i!==-1)?i:(i=ve.call(this._shortWeekdaysParse,h),i!==-1?i:null))}function dl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return cl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Ze([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function hl(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=Xi(e,this.localeData()),this.add(e-t,"d")):t}function ul(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 ml(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=el(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function fl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(de(this,"_weekdaysRegex")||(this._weekdaysRegex=nl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function pl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(de(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=rl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function yl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(de(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=al),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fn(){function e(c,d){return d.length-c.length}var t=[],n=[],r=[],i=[],a,h,f,o,l;for(a=0;a<7;a++)h=Ze([2e3,1]).day(a),f=ot(this.weekdaysMin(h,"")),o=ot(this.weekdaysShort(h,"")),l=ot(this.weekdays(h,"")),t.push(f),n.push(o),r.push(l),i.push(f),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Dn(){return this.hours()%12||12}function gl(){return this.hours()||24}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Dn),H("k",["kk",2],0,gl),H("hmm",0,0,function(){return""+Dn.apply(this)+Xe(this.minutes(),2)}),H("hmmss",0,0,function(){return""+Dn.apply(this)+Xe(this.minutes(),2)+Xe(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+Xe(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+Xe(this.minutes(),2)+Xe(this.seconds(),2)});function $r(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}$r("a",!0),$r("A",!1);function Hr(e,t){return t._meridiemParse}D("a",Hr),D("A",Hr),D("H",ge,Rn),D("h",ge,Dt),D("k",ge,Dt),D("HH",ge,Ye),D("hh",ge,Ye),D("kk",ge,Ye),D("hmm",Mr),D("hmmss",Ar),D("Hmm",Mr),D("Hmmss",Ar),ye(["H","HH"],Ie),ye(["k","kk"],function(e,t,n){var r=ne(e);t[Ie]=r===24?0:r}),ye(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ye(["h","hh"],function(e,t,n){t[Ie]=ne(e),ee(n).bigHour=!0}),ye("hmm",function(e,t,n){var r=e.length-2;t[Ie]=ne(e.substr(0,r)),t[qe]=ne(e.substr(r)),ee(n).bigHour=!0}),ye("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=ne(e.substr(0,r)),t[qe]=ne(e.substr(r,2)),t[dt]=ne(e.substr(i)),ee(n).bigHour=!0}),ye("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=ne(e.substr(0,r)),t[qe]=ne(e.substr(r))}),ye("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=ne(e.substr(0,r)),t[qe]=ne(e.substr(r,2)),t[dt]=ne(e.substr(i))});function xl(e){return(e+"").toLowerCase().charAt(0)==="p"}var Nl=/[ap]\.?m?\.?/i,jl=Yt("Hours",!0);function vl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Br={calendar:ci,longDateFormat:mi,invalidDate:pi,ordinal:gi,dayOfMonthOrdinalParse:xi,relativeTime:ji,months:Pi,monthsShort:kr,week:qi,weekdays:tl,weekdaysMin:sl,weekdaysShort:Ur,meridiemParse:Nl},Ne={},ds={},hs;function _l(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 Wr(e){return e&&e.toLowerCase().replace("_","-")}function bl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Wr(e[t]).split("-"),n=a.length,r=Wr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Hs(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&_l(a,r)>=n-1)break;n--}t++}return hs}function Sl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Hs(e){var t=null,n;if(Ne[e]===void 0&&typeof module<"u"&&module&&module.exports&&Sl(e))try{t=hs._abbr,n=require,n("./locale/"+e),vt(t)}catch{Ne[e]=null}return Ne[e]}function vt(e,t){var n;return e&&(ke(t)?n=ut(e):n=Yn(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 Yn(e,t){if(t!==null){var n,r=Br;if(t.abbr=e,Ne[e]!=null)Tr("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=Ne[e]._config;else if(t.parentLocale!=null)if(Ne[t.parentLocale]!=null)r=Ne[t.parentLocale]._config;else if(n=Hs(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 Ne[e]=new wn(Tn(r,t)),ds[e]&&ds[e].forEach(function(i){Yn(i.name,i.config)}),vt(e),Ne[e]}else return delete Ne[e],null}function Tl(e,t){if(t!=null){var n,r,i=Br;Ne[e]!=null&&Ne[e].parentLocale!=null?Ne[e].set(Tn(Ne[e]._config,t)):(r=Hs(e),r!=null&&(i=r._config),t=Tn(i,t),r==null&&(t.abbr=e),n=new wn(t),n.parentLocale=Ne[e],Ne[e]=n),vt(e)}else Ne[e]!=null&&(Ne[e].parentLocale!=null?(Ne[e]=Ne[e].parentLocale,e===vt()&&vt(e)):Ne[e]!=null&&delete Ne[e]);return Ne[e]}function ut(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!Ge(e)){if(t=Hs(e),t)return t;e=[e]}return bl(e)}function wl(){return In(Ne)}function Un(e){var t,n=e._a;return n&&ee(e).overflow===-2&&(t=n[ct]<0||n[ct]>11?ct:n[et]<1||n[et]>Ln(n[Me],n[ct])?et:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[qe]!==0||n[dt]!==0||n[wt]!==0)?Ie:n[qe]<0||n[qe]>59?qe:n[dt]<0||n[dt]>59?dt:n[wt]<0||n[wt]>999?wt:-1,ee(e)._overflowDayOfYear&&(t<Me||t>et)&&(t=et),ee(e)._overflowWeeks&&t===-1&&(t=Mi),ee(e)._overflowWeekday&&t===-1&&(t=Ai),ee(e).overflow=t),e}var Il=/^\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)?)?$/,Cl=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ol=/Z|[+-]\d\d(?::?\d\d)?/,Bs=[["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]],$n=[["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/]],Ml=/^\/?Date\((-?\d+)/i,Al=/^(?:(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}))$/,El={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 zr(e){var t,n,r=e._i,i=Il.exec(r)||Cl.exec(r),a,h,f,o,l=Bs.length,c=$n.length;if(i){for(ee(e).iso=!0,t=0,n=l;t<n;t++)if(Bs[t][1].exec(i[1])){h=Bs[t][0],a=Bs[t][2]!==!1;break}if(h==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if($n[t][1].exec(i[3])){f=(i[2]||" ")+$n[t][0];break}if(f==null){e._isValid=!1;return}}if(!a&&f!=null){e._isValid=!1;return}if(i[4])if(Ol.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=h+(f||"")+(o||""),Bn(e)}else e._isValid=!1}function Rl(e,t,n,r,i,a){var h=[kl(e),kr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&h.push(parseInt(a,10)),h}function kl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Ll(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Pl(e,t,n){if(e){var r=Ur.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return ee(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Fl(e,t,n){if(e)return El[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Gr(e){var t=Al.exec(Ll(e._i)),n;if(t){if(n=Rl(t[4],t[3],t[2],t[5],t[6],t[7]),!Pl(t[1],n,e))return;e._a=n,e._tzm=Fl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ee(e).rfc2822=!0}else e._isValid=!1}function Dl(e){var t=Ml.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(zr(e),e._isValid===!1)delete e._isValid;else return;if(Gr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:E.createFromInputFallback(e)}E.createFromInputFallback=He("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 Yl(e){var t=new Date(E.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Hn(e){var t,n,r=[],i,a,h;if(!e._d){for(i=Yl(e),e._w&&e._a[et]==null&&e._a[ct]==null&&Ul(e),e._dayOfYear!=null&&(h=Ut(e._a[Me],i[Me]),(e._dayOfYear>is(h)||e._dayOfYear===0)&&(ee(e)._overflowDayOfYear=!0),n=os(h,0,e._dayOfYear),e._a[ct]=n.getUTCMonth(),e._a[et]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Ie]===24&&e._a[qe]===0&&e._a[dt]===0&&e._a[wt]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:Gi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ie]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(ee(e).weekdayMismatch=!0)}}function Ul(e){var t,n,r,i,a,h,f,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,h=4,n=Ut(t.GG,e._a[Me],cs(xe(),1,4).year),r=Ut(t.W,1),i=Ut(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,h=e._locale._week.doy,l=cs(xe(),a,h),n=Ut(t.gg,e._a[Me],l.year),r=Ut(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>ht(n,a,h)?ee(e)._overflowWeeks=!0:o!=null?ee(e)._overflowWeekday=!0:(f=Yr(n,r,i,a,h),e._a[Me]=f.year,e._dayOfYear=f.dayOfYear)}E.ISO_8601=function(){},E.RFC_2822=function(){};function Bn(e){if(e._f===E.ISO_8601){zr(e);return}if(e._f===E.RFC_2822){Gr(e);return}e._a=[],ee(e).empty=!0;var t=""+e._i,n,r,i,a,h,f=t.length,o=0,l,c;for(i=wr(e._f,e._locale).match(Cn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ii(a,e))||[])[0],r&&(h=t.substr(0,t.indexOf(r)),h.length>0&&ee(e).unusedInput.push(h),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Pt[a]?(r?ee(e).empty=!1:ee(e).unusedTokens.push(a),Oi(a,r,e)):e._strict&&!r&&ee(e).unusedTokens.push(a);ee(e).charsLeftOver=f-o,t.length>0&&ee(e).unusedInput.push(t),e._a[Ie]<=12&&ee(e).bigHour===!0&&e._a[Ie]>0&&(ee(e).bigHour=void 0),ee(e).parsedDateParts=e._a.slice(0),ee(e).meridiem=e._meridiem,e._a[Ie]=$l(e._locale,e._a[Ie],e._meridiem),l=ee(e).era,l!==null&&(e._a[Me]=e._locale.erasConvertYear(l,e._a[Me])),Hn(e),Un(e)}function $l(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 Hl(e){var t,n,r,i,a,h,f=!1,o=e._f.length;if(o===0){ee(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,h=!1,t=Sn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Bn(t),_n(t)&&(h=!0),a+=ee(t).charsLeftOver,a+=ee(t).unusedTokens.length*10,ee(t).score=a,f?a<r&&(r=a,n=t):(r==null||a<r||h)&&(r=a,n=t,h&&(f=!0));jt(e,n||t)}function Bl(e){if(!e._d){var t=Mn(e._i),n=t.day===void 0?t.date:t.day;e._a=vr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Hn(e)}}function Wl(e){var t=new ns(Un(Vr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Vr(e){var t=e._i,n=e._f;return e._locale=e._locale||ut(e._l),t===null||n===void 0&&t===""?As({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ve(t)?new ns(Un(t)):(ss(t)?e._d=t:Ge(n)?Hl(e):n?Bn(e):zl(e),_n(e)||(e._d=null),e))}function zl(e){var t=e._i;ke(t)?e._d=new Date(E.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Dl(e):Ge(t)?(e._a=vr(t.slice(0),function(n){return parseInt(n,10)}),Hn(e)):Tt(t)?Bl(e):lt(t)?e._d=new Date(t):E.createFromInputFallback(e)}function qr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Tt(e)&&jn(e)||Ge(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,Wl(a)}function xe(e,t,n,r){return qr(e,t,n,r,!1)}var Gl=He("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:As()}),Vl=He("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=xe.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:As()});function Kr(e,t){var n,r;if(t.length===1&&Ge(t[0])&&(t=t[0]),!t.length)return xe();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 Kr("isBefore",e)}function Kl(){var e=[].slice.call(arguments,0);return Kr("isAfter",e)}var Ql=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Zl(e){var t,n=!1,r,i=us.length;for(t in e)if(de(e,t)&&!(ve.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==ne(e[us[r]])&&(n=!0)}return!0}function Jl(){return this._isValid}function Xl(){return Ke(NaN)}function Ws(e){var t=Mn(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,h=t.day||0,f=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Zl(t),this._milliseconds=+c+l*1e3+o*6e4+f*1e3*60*60,this._days=+h+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ut(),this._bubble()}function zs(e){return e instanceof Ws}function Wn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function eo(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,h;for(h=0;h<r;h++)ne(e[h])!==ne(t[h])&&a++;return a+i}function Qr(e,t){H(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Xe(~~(n/60),2)+t+Xe(~~n%60,2)})}Qr("Z",":"),Qr("ZZ",""),D("Z",Ds),D("ZZ",Ds),ye(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zn(Ds,e)});var to=/([\+\-]|\d\d)/gi;function zn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(to)||["-",0,0],a=+(i[1]*60)+ne(i[2]),a===0?0:i[0]==="+"?a:-a)}function Gn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ve(e)||ss(e)?e.valueOf():xe(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),E.updateOffset(n,!1),n):xe(e).local()}function Vn(e){return-Math.round(e._d.getTimezoneOffset())}E.updateOffset=function(){};function so(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=zn(Ds,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Vn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ea(this,Ke(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,E.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Vn(this)}function no(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ro(e){return this.utcOffset(0,e)}function ao(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vn(this),"m")),this}function io(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=zn(Ti,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function lo(e){return this.isValid()?(e=e?xe(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function oo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function co(){if(!ke(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Sn(e,this),e=Vr(e),e._a?(t=e._isUTC?Ze(e._a):xe(e._a),this._isDSTShifted=this.isValid()&&eo(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function ho(){return this.isValid()?!this._isUTC:!1}function uo(){return this.isValid()?this._isUTC:!1}function Zr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var mo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,fo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ke(e,t){var n=e,r=null,i,a,h;return zs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:lt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:ne(r[et])*i,h:ne(r[Ie])*i,m:ne(r[qe])*i,s:ne(r[dt])*i,ms:ne(Wn(r[wt]*1e3))*i}):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:It(r[2],i),M:It(r[3],i),w:It(r[4],i),d:It(r[5],i),h:It(r[6],i),m:It(r[7],i),s:It(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(h=po(xe(n.from),xe(n.to)),n={},n.ms=h.milliseconds,n.M=h.months),a=new Ws(n),zs(e)&&de(e,"_locale")&&(a._locale=e._locale),zs(e)&&de(e,"_isValid")&&(a._isValid=e._isValid),a}Ke.fn=Ws.prototype,Ke.invalid=Xl;function It(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jr(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 po(e,t){var n;return e.isValid()&&t.isValid()?(t=Gn(t,e),e.isBefore(t)?n=Jr(e,t):(n=Jr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Xr(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(Tr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=Ke(n,r),ea(this,i,e),this}}function ea(e,t,n,r){var i=t._milliseconds,a=Wn(t._days),h=Wn(t._months);e.isValid()&&(r=r??!0,h&&Pr(e,ls(e,"Month")+h*n),a&&Rr(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&E.updateOffset(e,a||h))}var yo=Xr(1,"add"),go=Xr(-1,"subtract");function ta(e){return typeof e=="string"||e instanceof String}function xo(e){return Ve(e)||ss(e)||ta(e)||lt(e)||jo(e)||No(e)||e===null||e===void 0}function No(e){var t=Tt(e)&&!jn(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,h=r.length;for(i=0;i<h;i+=1)a=r[i],n=n||de(e,a);return t&&n}function jo(e){var t=Ge(e),n=!1;return t&&(n=e.filter(function(r){return!lt(r)&&ta(e)}).length===0),t&&n}function vo(e){var t=Tt(e)&&!jn(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||de(e,a);return t&&n}function _o(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 bo(e,t){arguments.length===1&&(arguments[0]?xo(arguments[0])?(e=arguments[0],t=void 0):vo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||xe(),r=Gn(n,this).startOf("day"),i=E.calendarFormat(this,r)||"sameElse",a=t&&(Je(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,xe(n)))}function So(){return new ns(this)}function To(e,t){var n=Ve(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function wo(e,t){var n=Ve(e)?e:xe(e);return this.isValid()&&n.isValid()?(t=Be(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Io(e,t,n,r){var i=Ve(e)?e:xe(e),a=Ve(t)?t:xe(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Co(e,t){var n=Ve(e)?e:xe(e),r;return this.isValid()&&n.isValid()?(t=Be(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 Oo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Mo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Ao(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=Gn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=Be(t),t){case"year":a=Gs(this,r)/12;break;case"month":a=Gs(this,r);break;case"quarter":a=Gs(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:We(a)}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"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}E.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",E.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Eo(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ro(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Rs(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Je(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rs(n,"Z")):Rs(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ko(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function Lo(e){e||(e=this.isUtc()?E.defaultFormatUtc:E.defaultFormat);var t=Rs(this,e);return this.localeData().postformat(t)}function Po(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||xe(e).isValid())?Ke({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Fo(e){return this.from(xe(),e)}function Do(e,t){return this.isValid()&&(Ve(e)&&e.isValid()||xe(e).isValid())?Ke({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Yo(e){return this.to(xe(),e)}function sa(e){var t;return e===void 0?this._locale._abbr:(t=ut(e),t!=null&&(this._locale=t),this)}var na=He("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 ra(){return this._locale}var Vs=1e3,$t=60*Vs,qs=60*$t,aa=(365*400+97)*24*qs;function Ht(e,t){return(e%t+t)%t}function ia(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-aa:new Date(e,t,n).valueOf()}function la(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-aa:Date.UTC(e,t,n)}function Uo(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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),qs);break;case"minute":t=this._d.valueOf(),t-=Ht(t,$t);break;case"second":t=this._d.valueOf(),t-=Ht(t,Vs);break}return this._d.setTime(t),E.updateOffset(this,!0),this}function $o(e){var t,n;if(e=Be(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?la:ia,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+=qs-Ht(t+(this._isUTC?0:this.utcOffset()*$t),qs)-1;break;case"minute":t=this._d.valueOf(),t+=$t-Ht(t,$t)-1;break;case"second":t=this._d.valueOf(),t+=Vs-Ht(t,Vs)-1;break}return this._d.setTime(t),E.updateOffset(this,!0),this}function Ho(){return this._d.valueOf()-(this._offset||0)*6e4}function Bo(){return Math.floor(this.valueOf()/1e3)}function Wo(){return new Date(this.valueOf())}function zo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Go(){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 Vo(){return this.isValid()?this.toISOString():null}function qo(){return _n(this)}function Ko(){return jt({},ee(this))}function Qo(){return ee(this).overflow}function Zo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),D("N",qn),D("NN",qn),D("NNN",qn),D("NNNN",oc),D("NNNNN",cc),ye(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?ee(n).era=i:ee(n).invalidEra=e}),D("y",Ft),D("yy",Ft),D("yyy",Ft),D("yyyy",Ft),D("yo",dc),ye(["y","yy","yyy","yyyy"],Me),ye(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Me]=n._locale.eraYearOrdinalParse(e,i):t[Me]=parseInt(e,10)});function Jo(e,t){var n,r,i,a=this._eras||ut("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=E(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=E(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function Xo(e,t,n){var r,i,a=this.eras(),h,f,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(h=a[r].name.toUpperCase(),f=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return a[r];break;case"NNNN":if(h===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([h,f,o].indexOf(e)>=0)return a[r]}function ec(e,t){var n=e.since<=e.until?1:-1;return t===void 0?E(e.since).year():E(e.since).year()+(t-e.offset)*n}function tc(){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 sc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function rc(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-E(i[e].since).year())*n+i[e].offset;return this.year()}function ac(e){return de(this,"_erasNameRegex")||Kn.call(this),e?this._erasNameRegex:this._erasRegex}function ic(e){return de(this,"_erasAbbrRegex")||Kn.call(this),e?this._erasAbbrRegex:this._erasRegex}function lc(e){return de(this,"_erasNarrowRegex")||Kn.call(this),e?this._erasNarrowRegex:this._erasRegex}function qn(e,t){return t.erasAbbrRegex(e)}function oc(e,t){return t.erasNameRegex(e)}function cc(e,t){return t.erasNarrowRegex(e)}function dc(e,t){return t._eraYearOrdinalRegex||Ft}function Kn(){var e=[],t=[],n=[],r=[],i,a,h,f,o,l=this.eras();for(i=0,a=l.length;i<a;++i)h=ot(l[i].name),f=ot(l[i].abbr),o=ot(l[i].narrow),t.push(h),e.push(f),n.push(o),r.push(h),r.push(f),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ks(e,t){H(0,[e,e.length],0,t)}Ks("gggg","weekYear"),Ks("ggggg","weekYear"),Ks("GGGG","isoWeekYear"),Ks("GGGGG","isoWeekYear"),D("G",Fs),D("g",Fs),D("GG",ge,Ye),D("gg",ge,Ye),D("GGGG",En,An),D("gggg",En,An),D("GGGGG",Ps,ks),D("ggggg",Ps,ks),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=ne(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=E.parseTwoDigitYear(e)});function hc(e){return oa.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function uc(e){return oa.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function mc(){return ht(this.year(),1,4)}function fc(){return ht(this.isoWeekYear(),1,4)}function pc(){var e=this.localeData()._week;return ht(this.year(),e.dow,e.doy)}function yc(){var e=this.localeData()._week;return ht(this.weekYear(),e.dow,e.doy)}function oa(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=ht(e,r,i),t>a&&(t=a),gc.call(this,e,t,n,r,i))}function gc(e,t,n,r,i){var a=Yr(e,t,n,r,i),h=os(a.year,0,a.dayOfYear);return this.year(h.getUTCFullYear()),this.month(h.getUTCMonth()),this.date(h.getUTCDate()),this}H("Q",0,"Qo","quarter"),D("Q",Cr),ye("Q",function(e,t){t[ct]=(ne(e)-1)*3});function xc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}H("D",["DD",2],"Do","date"),D("D",ge,Dt),D("DD",ge,Ye),D("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],et),ye("Do",function(e,t){t[et]=ne(e.match(ge)[0])});var ca=Yt("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),D("DDD",Ls),D("DDDD",Or),ye(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ne(e)});function Nc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}H("m",["mm",2],0,"minute"),D("m",ge,Rn),D("mm",ge,Ye),ye(["m","mm"],qe);var jc=Yt("Minutes",!1);H("s",["ss",2],0,"second"),D("s",ge,Rn),D("ss",ge,Ye),ye(["s","ss"],dt);var vc=Yt("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return this.millisecond()*10}),H(0,["SSSSS",5],0,function(){return this.millisecond()*100}),H(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),H(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),H(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),H(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),D("S",Ls,Cr),D("SS",Ls,Ye),D("SSS",Ls,Or);var _t,da;for(_t="SSSS";_t.length<=9;_t+="S")D(_t,Ft);function _c(e,t){t[wt]=ne(("0."+e)*1e3)}for(_t="S";_t.length<=9;_t+="S")ye(_t,_c);da=Yt("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");function bc(){return this._isUTC?"UTC":""}function Sc(){return this._isUTC?"Coordinated Universal Time":""}var A=ns.prototype;A.add=yo,A.calendar=bo,A.clone=So,A.diff=Ao,A.endOf=$o,A.format=Lo,A.from=Po,A.fromNow=Fo,A.to=Do,A.toNow=Yo,A.get=Ri,A.invalidAt=Qo,A.isAfter=To,A.isBefore=wo,A.isBetween=Io,A.isSame=Co,A.isSameOrAfter=Oo,A.isSameOrBefore=Mo,A.isValid=qo,A.lang=na,A.locale=sa,A.localeData=ra,A.max=Vl,A.min=Gl,A.parsingFlags=Ko,A.set=ki,A.startOf=Uo,A.subtract=go,A.toArray=zo,A.toObject=Go,A.toDate=Wo,A.toISOString=Ro,A.inspect=ko,typeof Symbol<"u"&&Symbol.for!=null&&(A[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),A.toJSON=Vo,A.toString=Eo,A.unix=Bo,A.valueOf=Ho,A.creationData=Zo,A.eraName=tc,A.eraNarrow=sc,A.eraAbbr=nc,A.eraYear=rc,A.year=Er,A.isLeapYear=Ei,A.weekYear=hc,A.isoWeekYear=uc,A.quarter=A.quarters=xc,A.month=Fr,A.daysInMonth=Bi,A.week=A.weeks=Zi,A.isoWeek=A.isoWeeks=Ji,A.weeksInYear=pc,A.weeksInWeekYear=yc,A.isoWeeksInYear=mc,A.isoWeeksInISOWeekYear=fc,A.date=ca,A.day=A.days=hl,A.weekday=ul,A.isoWeekday=ml,A.dayOfYear=Nc,A.hour=A.hours=jl,A.minute=A.minutes=jc,A.second=A.seconds=vc,A.millisecond=A.milliseconds=da,A.utcOffset=so,A.utc=ro,A.local=ao,A.parseZone=io,A.hasAlignedHourOffset=lo,A.isDST=oo,A.isLocal=ho,A.isUtcOffset=uo,A.isUtc=Zr,A.isUTC=Zr,A.zoneAbbr=bc,A.zoneName=Sc,A.dates=He("dates accessor is deprecated. Use date instead.",ca),A.months=He("months accessor is deprecated. Use month instead",Fr),A.years=He("years accessor is deprecated. Use year instead",Er),A.zone=He("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",no),A.isDSTShifted=He("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",co);function Tc(e){return xe(e*1e3)}function wc(){return xe.apply(null,arguments).parseZone()}function ha(e){return e}var he=wn.prototype;he.calendar=di,he.longDateFormat=fi,he.invalidDate=yi,he.ordinal=Ni,he.preparse=ha,he.postformat=ha,he.relativeTime=vi,he.pastFuture=_i,he.set=oi,he.eras=Jo,he.erasParse=Xo,he.erasConvertYear=ec,he.erasAbbrRegex=ic,he.erasNameRegex=ac,he.erasNarrowRegex=lc,he.months=Yi,he.monthsShort=Ui,he.monthsParse=Hi,he.monthsRegex=zi,he.monthsShortRegex=Wi,he.week=Vi,he.firstDayOfYear=Qi,he.firstDayOfWeek=Ki,he.weekdays=il,he.weekdaysMin=ol,he.weekdaysShort=ll,he.weekdaysParse=dl,he.weekdaysRegex=fl,he.weekdaysShortRegex=pl,he.weekdaysMinRegex=yl,he.isPM=xl,he.meridiem=vl;function Qs(e,t,n,r){var i=ut(),a=Ze().set(r,t);return i[n](a,e)}function ua(e,t,n){if(lt(e)&&(t=e,e=void 0),e=e||"",t!=null)return Qs(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Qs(e,r,n,"month");return i}function Qn(e,t,n,r){typeof e=="boolean"?(lt(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,lt(t)&&(n=t,t=void 0),t=t||"");var i=ut(),a=e?i._week.dow:0,h,f=[];if(n!=null)return Qs(t,(n+a)%7,r,"day");for(h=0;h<7;h++)f[h]=Qs(t,(h+a)%7,r,"day");return f}function Ic(e,t){return ua(e,t,"months")}function Cc(e,t){return ua(e,t,"monthsShort")}function Oc(e,t,n){return Qn(e,t,n,"weekdays")}function Mc(e,t,n){return Qn(e,t,n,"weekdaysShort")}function Ac(e,t,n){return Qn(e,t,n,"weekdaysMin")}vt("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=ne(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),E.lang=He("moment.lang is deprecated. Use moment.locale instead.",vt),E.langData=He("moment.langData is deprecated. Use moment.localeData instead.",ut);var mt=Math.abs;function Ec(){var e=this._data;return this._milliseconds=mt(this._milliseconds),this._days=mt(this._days),this._months=mt(this._months),e.milliseconds=mt(e.milliseconds),e.seconds=mt(e.seconds),e.minutes=mt(e.minutes),e.hours=mt(e.hours),e.months=mt(e.months),e.years=mt(e.years),this}function ma(e,t,n,r){var i=Ke(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Rc(e,t){return ma(this,e,t,1)}function kc(e,t){return ma(this,e,t,-1)}function fa(e){return e<0?Math.floor(e):Math.ceil(e)}function Lc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,h,f,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=fa(Zn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=We(e/1e3),r.seconds=i%60,a=We(i/60),r.minutes=a%60,h=We(a/60),r.hours=h%24,t+=We(h/24),o=We(pa(t)),n+=o,t-=fa(Zn(o)),f=We(n/12),n%=12,r.days=t,r.months=n,r.years=f,this}function pa(e){return e*4800/146097}function Zn(e){return e*146097/4800}function Pc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=Be(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+pa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Zn(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 ft(e){return function(){return this.as(e)}}var ya=ft("ms"),Fc=ft("s"),Dc=ft("m"),Yc=ft("h"),Uc=ft("d"),$c=ft("w"),Hc=ft("M"),Bc=ft("Q"),Wc=ft("y"),zc=ya;function Gc(){return Ke(this)}function Vc(e){return e=Be(e),this.isValid()?this[e+"s"]():NaN}function Ct(e){return function(){return this.isValid()?this._data[e]:NaN}}var qc=Ct("milliseconds"),Kc=Ct("seconds"),Qc=Ct("minutes"),Zc=Ct("hours"),Jc=Ct("days"),Xc=Ct("months"),ed=Ct("years");function td(){return We(this.days()/7)}var pt=Math.round,Bt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function sd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function nd(e,t,n,r){var i=Ke(e).abs(),a=pt(i.as("s")),h=pt(i.as("m")),f=pt(i.as("h")),o=pt(i.as("d")),l=pt(i.as("M")),c=pt(i.as("w")),d=pt(i.as("y")),p=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||h<=1&&["m"]||h<n.m&&["mm",h]||f<=1&&["h"]||f<n.h&&["hh",f]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),p=p||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d],p[2]=t,p[3]=+e>0,p[4]=r,sd.apply(null,p)}function rd(e){return e===void 0?pt:typeof e=="function"?(pt=e,!0):!1}function ad(e,t){return Bt[e]===void 0?!1:t===void 0?Bt[e]:(Bt[e]=t,e==="s"&&(Bt.ss=t-1),!0)}function id(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Bt,i,a;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)),i=this.localeData(),a=nd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Jn=Math.abs;function Wt(e){return(e>0)-(e<0)||+e}function Zs(){if(!this.isValid())return this.localeData().invalidDate();var e=Jn(this._milliseconds)/1e3,t=Jn(this._days),n=Jn(this._months),r,i,a,h,f=this.asSeconds(),o,l,c,d;return f?(r=We(e/60),i=We(r/60),e%=60,r%=60,a=We(n/12),n%=12,h=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",l=Wt(this._months)!==Wt(f)?"-":"",c=Wt(this._days)!==Wt(f)?"-":"",d=Wt(this._milliseconds)!==Wt(f)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?d+i+"H":"")+(r?d+r+"M":"")+(e?d+h+"S":"")):"P0D"}var ae=Ws.prototype;ae.isValid=Jl,ae.abs=Ec,ae.add=Rc,ae.subtract=kc,ae.as=Pc,ae.asMilliseconds=ya,ae.asSeconds=Fc,ae.asMinutes=Dc,ae.asHours=Yc,ae.asDays=Uc,ae.asWeeks=$c,ae.asMonths=Hc,ae.asQuarters=Bc,ae.asYears=Wc,ae.valueOf=zc,ae._bubble=Lc,ae.clone=Gc,ae.get=Vc,ae.milliseconds=qc,ae.seconds=Kc,ae.minutes=Qc,ae.hours=Zc,ae.days=Jc,ae.weeks=td,ae.months=Xc,ae.years=ed,ae.humanize=id,ae.toISOString=Zs,ae.toString=Zs,ae.toJSON=Zs,ae.locale=sa,ae.localeData=ra,ae.toIsoString=He("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zs),ae.lang=na,H("X",0,0,"unix"),H("x",0,0,"valueOf"),D("x",Fs),D("X",wi),ye("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),ye("x",function(e,t,n){n._d=new Date(ne(e))});//! moment.js
39
- E.version="2.30.1",ii(xe),E.fn=A,E.min=ql,E.max=Kl,E.now=Ql,E.utc=Ze,E.unix=Tc,E.months=Ic,E.isDate=ss,E.locale=vt,E.invalid=As,E.duration=Ke,E.isMoment=Ve,E.weekdays=Oc,E.parseZone=wc,E.localeData=ut,E.isDuration=zs,E.monthsShort=Cc,E.weekdaysMin=Ac,E.defineLocale=Yn,E.updateLocale=Tl,E.locales=wl,E.weekdaysShort=Mc,E.normalizeUnits=Be,E.relativeTimeRounding=rd,E.relativeTimeThreshold=ad,E.calendarFormat=_o,E.prototype=A,E.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 bt=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Qe=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(" ")},ms=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},ld=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},od=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Js={exports:{}};/*! @preserve
38
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var Tr={};function wr(e,t){E.deprecationHandler!=null&&E.deprecationHandler(e,t),Tr[e]||(Sr(t),Tr[e]=!0)}E.suppressDeprecationWarnings=!1,E.deprecationHandler=null;function Ze(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function ci(e){var t,n;for(n in e)de(e,n)&&(t=e[n],Ze(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Tn(e,t){var n=Nt({},e),r;for(r in t)de(t,r)&&(St(e[r])&&St(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)de(e,r)&&!de(t,r)&&St(e[r])&&(n[r]=Nt({},n[r]));return n}function wn(e){e!=null&&this.set(e)}var In;Object.keys?In=Object.keys:In=function(e){var t,n=[];for(t in e)de(e,t)&&n.push(t);return n};var di={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function hi(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return Ze(r)?r.call(t,n):r}function Je(e,t,n){var r=""+Math.abs(e),i=t-r.length,a=e>=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Cn=/(\[[^\[]*\])|(\\)?([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,Es=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,On={},Lt={};function W(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Lt[e]=i),t&&(Lt[t[0]]=function(){return Je(i.apply(this,arguments),t[1],t[2])}),n&&(Lt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function ui(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function mi(e){var t=e.match(Cn),n,r;for(n=0,r=t.length;n<r;n++)Lt[t[n]]?t[n]=Lt[t[n]]:t[n]=ui(t[n]);return function(i){var a="",h;for(h=0;h<r;h++)a+=Ze(t[h])?t[h].call(i,e):t[h];return a}}function Rs(e,t){return e.isValid()?(t=Ir(t,e.localeData()),On[t]=On[t]||mi(t),On[t](e)):e.localeData().invalidDate()}function Ir(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(Es.lastIndex=0;n>=0&&Es.test(e);)e=e.replace(Es,r),Es.lastIndex=0,n-=1;return e}var fi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function pi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Cn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var yi="Invalid date";function gi(){return this._invalidDate}var xi="%d",Ni=/\d{1,2}/;function ji(e){return this._ordinal.replace("%d",e)}var vi={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function _i(e,t,n,r){var i=this._relativeTime[n];return Ze(i)?i(e,t,n,r):i.replace(/%d/i,e)}function bi(e,t){var n=this._relativeTime[e>0?"future":"past"];return Ze(n)?n(t):n.replace(/%s/i,t)}var Cr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function He(e){return typeof e=="string"?Cr[e]||Cr[e.toLowerCase()]:void 0}function Mn(e){var t={},n,r;for(r in e)de(e,r)&&(n=He(r),n&&(t[n]=e[r]));return t}var Si={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Ti(e){var t=[],n;for(n in e)de(e,n)&&t.push({unit:n,priority:Si[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Or=/\d/,De=/\d\d/,Mr=/\d{3}/,An=/\d{4}/,ks=/[+-]?\d{6}/,ye=/\d\d?/,Ar=/\d\d\d\d?/,Er=/\d\d\d\d\d\d?/,Ls=/\d{1,3}/,En=/\d{1,4}/,Ps=/[+-]?\d{1,6}/,Pt=/\d+/,Fs=/[+-]?\d+/,wi=/Z|[+-]\d\d:?\d\d/gi,Ds=/Z|[+-]\d\d(?::?\d\d)?/gi,Ii=/[+-]?\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,Ft=/^[1-9]\d?/,Rn=/^([1-9]\d|\d)/,Ys;Ys={};function Y(e,t,n){Ys[e]=Ze(t)?t:function(r,i){return r&&n?n:t}}function Ci(e,t){return de(Ys,e)?Ys[e](t._strict,t._locale):new RegExp(Oi(e))}function Oi(e){return lt(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,i,a){return n||r||i||a}))}function lt(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Be(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function re(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Be(t)),n}var kn={};function pe(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),it(t)&&(r=function(a,h){h[t]=re(a)}),i=e.length,n=0;n<i;n++)kn[e[n]]=r}function as(e,t){pe(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Mi(e,t,n){t!=null&&de(kn,e)&&kn[e](t,n._a,n,e)}function Us(e){return e%4===0&&e%100!==0||e%400===0}var Oe=0,ot=1,Xe=2,Ie=3,Ve=4,ct=5,Tt=6,Ai=7,Ei=8;W("Y",0,0,function(){var e=this.year();return e<=9999?Je(e,4):"+"+e}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),Y("Y",Fs),Y("YY",ye,De),Y("YYYY",En,An),Y("YYYYY",Ps,ks),Y("YYYYYY",Ps,ks),pe(["YYYYY","YYYYYY"],Oe),pe("YYYY",function(e,t){t[Oe]=e.length===2?E.parseTwoDigitYear(e):re(e)}),pe("YY",function(e,t){t[Oe]=E.parseTwoDigitYear(e)}),pe("Y",function(e,t){t[Oe]=parseInt(e,10)});function is(e){return Us(e)?366:365}E.parseTwoDigitYear=function(e){return re(e)+(re(e)>68?1900:2e3)};var Rr=Dt("FullYear",!0);function Ri(){return Us(this.year())}function Dt(e,t){return function(n){return n!=null?(kr(this,e,n),E.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,i,a,h,f;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,i=e._isUTC,t){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}a=n,h=e.month(),f=e.date(),f=f===29&&h===1&&!Us(a)?28:f,i?r.setUTCFullYear(a,h,f):r.setFullYear(a,h,f)}}function ki(e){return e=He(e),Ze(this[e])?this[e]():this}function Li(e,t){if(typeof e=="object"){e=Mn(e);var n=Ti(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=He(e),Ze(this[e]))return this[e](t);return this}function Pi(e,t){return(e%t+t)%t}var je;Array.prototype.indexOf?je=Array.prototype.indexOf:je=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Ln(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=Pi(t,12);return e+=(t-n)/12,n===1?Us(e)?29:28:31-n%7%2}W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),W("MMMM",0,0,function(e){return this.localeData().months(this,e)}),Y("M",ye,Ft),Y("MM",ye,De),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),pe(["M","MM"],function(e,t){t[ot]=re(e)-1}),pe(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[ot]=i:ee(n).invalidMonth=e});var Fi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Lr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Pr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Di=rs,Yi=rs;function Ui(e,t){return e?ze(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Pr).test(t)?"format":"standalone"][e.month()]:ze(this._months)?this._months:this._months.standalone}function $i(e,t){return e?ze(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Pr.test(t)?"format":"standalone"][e.month()]:ze(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Hi(e,t,n){var r,i,a,h=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=Qe([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=je.call(this._shortMonthsParse,h),i!==-1?i:null):(i=je.call(this._longMonthsParse,h),i!==-1?i:null):t==="MMM"?(i=je.call(this._shortMonthsParse,h),i!==-1?i:(i=je.call(this._longMonthsParse,h),i!==-1?i:null)):(i=je.call(this._longMonthsParse,h),i!==-1?i:(i=je.call(this._shortMonthsParse,h),i!==-1?i:null))}function Bi(e,t,n){var r,i,a;if(this._monthsParseExact)return Hi.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=Qe([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function Fr(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=re(t);else if(t=e.localeData().monthsParse(t),!it(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Ln(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Dr(e){return e!=null?(Fr(this,e),E.updateOffset(this,!0),this):ls(this,"Month")}function Wi(){return Ln(this.year(),this.month())}function zi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Yr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(de(this,"_monthsShortRegex")||(this._monthsShortRegex=Di),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Yr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(de(this,"_monthsRegex")||(this._monthsRegex=Yi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Yr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,h,f;for(i=0;i<12;i++)a=Qe([2e3,i]),h=lt(this.monthsShort(a,"")),f=lt(this.months(a,"")),t.push(h),n.push(f),r.push(f),r.push(h);t.sort(e),n.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Vi(e,t,n,r,i,a,h){var f;return e<100&&e>=0?(f=new Date(e+400,t,n,r,i,a,h),isFinite(f.getFullYear())&&f.setFullYear(e)):f=new Date(e,t,n,r,i,a,h),f}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 $s(e,t,n){var r=7+t-n,i=(7+os(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Ur(e,t,n,r,i){var a=(7+n-r)%7,h=$s(e,r,i),f=1+7*(t-1)+a+h,o,l;return f<=0?(o=e-1,l=is(o)+f):f>is(e)?(o=e+1,l=f-is(e)):(o=e,l=f),{year:o,dayOfYear:l}}function cs(e,t,n){var r=$s(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,h;return i<1?(h=e.year()-1,a=i+dt(h,t,n)):i>dt(e.year(),t,n)?(a=i-dt(e.year(),t,n),h=e.year()+1):(h=e.year(),a=i),{week:a,year:h}}function dt(e,t,n){var r=$s(e,t,n),i=$s(e+1,t,n);return(is(e)-r+i)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),Y("w",ye,Ft),Y("ww",ye,De),Y("W",ye,Ft),Y("WW",ye,De),as(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=re(e)});function qi(e){return cs(e,this._week.dow,this._week.doy).week}var Ki={dow:0,doy:6};function Qi(){return this._week.dow}function Zi(){return this._week.doy}function Ji(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Xi(e){var t=cs(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}W("d",0,"do","day"),W("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),W("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),W("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),Y("d",ye),Y("e",ye),Y("E",ye),Y("dd",function(e,t){return t.weekdaysMinRegex(e)}),Y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Y("dddd",function(e,t){return t.weekdaysRegex(e)}),as(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:ee(n).invalidWeekday=e}),as(["d","e","E"],function(e,t,n,r){t[r]=re(e)});function el(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function tl(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Pn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var sl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),$r="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),nl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),rl=rs,al=rs,il=rs;function ll(e,t){var n=ze(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Pn(n,this._week.dow):e?n[e.day()]:n}function ol(e){return e===!0?Pn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function cl(e){return e===!0?Pn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function dl(e,t,n){var r,i,a,h=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=Qe([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?t==="dddd"?(i=je.call(this._weekdaysParse,h),i!==-1?i:null):t==="ddd"?(i=je.call(this._shortWeekdaysParse,h),i!==-1?i:null):(i=je.call(this._minWeekdaysParse,h),i!==-1?i:null):t==="dddd"?(i=je.call(this._weekdaysParse,h),i!==-1||(i=je.call(this._shortWeekdaysParse,h),i!==-1)?i:(i=je.call(this._minWeekdaysParse,h),i!==-1?i:null)):t==="ddd"?(i=je.call(this._shortWeekdaysParse,h),i!==-1||(i=je.call(this._weekdaysParse,h),i!==-1)?i:(i=je.call(this._minWeekdaysParse,h),i!==-1?i:null)):(i=je.call(this._minWeekdaysParse,h),i!==-1||(i=je.call(this._weekdaysParse,h),i!==-1)?i:(i=je.call(this._shortWeekdaysParse,h),i!==-1?i:null))}function hl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return dl.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=Qe([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function ul(e){if(!this.isValid())return e!=null?this:NaN;var t=ls(this,"Day");return e!=null?(e=el(e,this.localeData()),this.add(e-t,"d")):t}function ml(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function fl(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=tl(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function pl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(de(this,"_weekdaysRegex")||(this._weekdaysRegex=rl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function yl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(de(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=al),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function gl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Fn.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(de(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=il),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fn(){function e(c,d){return d.length-c.length}var t=[],n=[],r=[],i=[],a,h,f,o,l;for(a=0;a<7;a++)h=Qe([2e3,1]).day(a),f=lt(this.weekdaysMin(h,"")),o=lt(this.weekdaysShort(h,"")),l=lt(this.weekdays(h,"")),t.push(f),n.push(o),r.push(l),i.push(f),i.push(o),i.push(l);t.sort(e),n.sort(e),r.sort(e),i.sort(e),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Dn(){return this.hours()%12||12}function xl(){return this.hours()||24}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Dn),W("k",["kk",2],0,xl),W("hmm",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Dn.apply(this)+Je(this.minutes(),2)+Je(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+Je(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+Je(this.minutes(),2)+Je(this.seconds(),2)});function Hr(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Hr("a",!0),Hr("A",!1);function Br(e,t){return t._meridiemParse}Y("a",Br),Y("A",Br),Y("H",ye,Rn),Y("h",ye,Ft),Y("k",ye,Ft),Y("HH",ye,De),Y("hh",ye,De),Y("kk",ye,De),Y("hmm",Ar),Y("hmmss",Er),Y("Hmm",Ar),Y("Hmmss",Er),pe(["H","HH"],Ie),pe(["k","kk"],function(e,t,n){var r=re(e);t[Ie]=r===24?0:r}),pe(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),pe(["h","hh"],function(e,t,n){t[Ie]=re(e),ee(n).bigHour=!0}),pe("hmm",function(e,t,n){var r=e.length-2;t[Ie]=re(e.substr(0,r)),t[Ve]=re(e.substr(r)),ee(n).bigHour=!0}),pe("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=re(e.substr(0,r)),t[Ve]=re(e.substr(r,2)),t[ct]=re(e.substr(i)),ee(n).bigHour=!0}),pe("Hmm",function(e,t,n){var r=e.length-2;t[Ie]=re(e.substr(0,r)),t[Ve]=re(e.substr(r))}),pe("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Ie]=re(e.substr(0,r)),t[Ve]=re(e.substr(r,2)),t[ct]=re(e.substr(i))});function Nl(e){return(e+"").toLowerCase().charAt(0)==="p"}var jl=/[ap]\.?m?\.?/i,vl=Dt("Hours",!0);function _l(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Wr={calendar:di,longDateFormat:fi,invalidDate:yi,ordinal:xi,dayOfMonthOrdinalParse:Ni,relativeTime:vi,months:Fi,monthsShort:Lr,week:Ki,weekdays:sl,weekdaysMin:nl,weekdaysShort:$r,meridiemParse:jl},xe={},ds={},hs;function bl(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function zr(e){return e&&e.toLowerCase().replace("_","-")}function Sl(e){for(var t=0,n,r,i,a;t<e.length;){for(a=zr(e[t]).split("-"),n=a.length,r=zr(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=Hs(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&bl(a,r)>=n-1)break;n--}t++}return hs}function Tl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Hs(e){var t=null,n;if(xe[e]===void 0&&typeof module<"u"&&module&&module.exports&&Tl(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&&(Re(t)?n=ht(e):n=Yn(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 Yn(e,t){if(t!==null){var n,r=Wr;if(t.abbr=e,xe[e]!=null)wr("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xe[e]._config;else if(t.parentLocale!=null)if(xe[t.parentLocale]!=null)r=xe[t.parentLocale]._config;else if(n=Hs(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 wn(Tn(r,t)),ds[e]&&ds[e].forEach(function(i){Yn(i.name,i.config)}),jt(e),xe[e]}else return delete xe[e],null}function wl(e,t){if(t!=null){var n,r,i=Wr;xe[e]!=null&&xe[e].parentLocale!=null?xe[e].set(Tn(xe[e]._config,t)):(r=Hs(e),r!=null&&(i=r._config),t=Tn(i,t),r==null&&(t.abbr=e),n=new wn(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 ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return hs;if(!ze(e)){if(t=Hs(e),t)return t;e=[e]}return Sl(e)}function Il(){return In(xe)}function Un(e){var t,n=e._a;return n&&ee(e).overflow===-2&&(t=n[ot]<0||n[ot]>11?ot:n[Xe]<1||n[Xe]>Ln(n[Oe],n[ot])?Xe:n[Ie]<0||n[Ie]>24||n[Ie]===24&&(n[Ve]!==0||n[ct]!==0||n[Tt]!==0)?Ie:n[Ve]<0||n[Ve]>59?Ve:n[ct]<0||n[ct]>59?ct:n[Tt]<0||n[Tt]>999?Tt:-1,ee(e)._overflowDayOfYear&&(t<Oe||t>Xe)&&(t=Xe),ee(e)._overflowWeeks&&t===-1&&(t=Ai),ee(e)._overflowWeekday&&t===-1&&(t=Ei),ee(e).overflow=t),e}var Cl=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ol=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ml=/Z|[+-]\d\d(?::?\d\d)?/,Bs=[["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]],$n=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Al=/^\/?Date\((-?\d+)/i,El=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Rl={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Gr(e){var t,n,r=e._i,i=Cl.exec(r)||Ol.exec(r),a,h,f,o,l=Bs.length,c=$n.length;if(i){for(ee(e).iso=!0,t=0,n=l;t<n;t++)if(Bs[t][1].exec(i[1])){h=Bs[t][0],a=Bs[t][2]!==!1;break}if(h==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if($n[t][1].exec(i[3])){f=(i[2]||" ")+$n[t][0];break}if(f==null){e._isValid=!1;return}}if(!a&&f!=null){e._isValid=!1;return}if(i[4])if(Ml.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=h+(f||"")+(o||""),Bn(e)}else e._isValid=!1}function kl(e,t,n,r,i,a){var h=[Ll(e),Lr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&h.push(parseInt(a,10)),h}function Ll(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Pl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Fl(e,t,n){if(e){var r=$r.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return ee(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Dl(e,t,n){if(e)return Rl[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function Vr(e){var t=El.exec(Pl(e._i)),n;if(t){if(n=kl(t[4],t[3],t[2],t[5],t[6],t[7]),!Fl(t[1],n,e))return;e._a=n,e._tzm=Dl(t[8],t[9],t[10]),e._d=os.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ee(e).rfc2822=!0}else e._isValid=!1}function Yl(e){var t=Al.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Gr(e),e._isValid===!1)delete e._isValid;else return;if(Vr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:E.createFromInputFallback(e)}E.createFromInputFallback=$e("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 Yt(e,t,n){return e??t??n}function Ul(e){var t=new Date(E.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Hn(e){var t,n,r=[],i,a,h;if(!e._d){for(i=Ul(e),e._w&&e._a[Xe]==null&&e._a[ot]==null&&$l(e),e._dayOfYear!=null&&(h=Yt(e._a[Oe],i[Oe]),(e._dayOfYear>is(h)||e._dayOfYear===0)&&(ee(e)._overflowDayOfYear=!0),n=os(h,0,e._dayOfYear),e._a[ot]=n.getUTCMonth(),e._a[Xe]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Ie]===24&&e._a[Ve]===0&&e._a[ct]===0&&e._a[Tt]===0&&(e._nextDay=!0,e._a[Ie]=0),e._d=(e._useUTC?os:Vi).apply(null,r),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ie]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(ee(e).weekdayMismatch=!0)}}function $l(e){var t,n,r,i,a,h,f,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,h=4,n=Yt(t.GG,e._a[Oe],cs(ge(),1,4).year),r=Yt(t.W,1),i=Yt(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,h=e._locale._week.doy,l=cs(ge(),a,h),n=Yt(t.gg,e._a[Oe],l.year),r=Yt(t.w,l.week),t.d!=null?(i=t.d,(i<0||i>6)&&(o=!0)):t.e!=null?(i=t.e+a,(t.e<0||t.e>6)&&(o=!0)):i=a),r<1||r>dt(n,a,h)?ee(e)._overflowWeeks=!0:o!=null?ee(e)._overflowWeekday=!0:(f=Ur(n,r,i,a,h),e._a[Oe]=f.year,e._dayOfYear=f.dayOfYear)}E.ISO_8601=function(){},E.RFC_2822=function(){};function Bn(e){if(e._f===E.ISO_8601){Gr(e);return}if(e._f===E.RFC_2822){Vr(e);return}e._a=[],ee(e).empty=!0;var t=""+e._i,n,r,i,a,h,f=t.length,o=0,l,c;for(i=Ir(e._f,e._locale).match(Cn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(Ci(a,e))||[])[0],r&&(h=t.substr(0,t.indexOf(r)),h.length>0&&ee(e).unusedInput.push(h),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Lt[a]?(r?ee(e).empty=!1:ee(e).unusedTokens.push(a),Mi(a,r,e)):e._strict&&!r&&ee(e).unusedTokens.push(a);ee(e).charsLeftOver=f-o,t.length>0&&ee(e).unusedInput.push(t),e._a[Ie]<=12&&ee(e).bigHour===!0&&e._a[Ie]>0&&(ee(e).bigHour=void 0),ee(e).parsedDateParts=e._a.slice(0),ee(e).meridiem=e._meridiem,e._a[Ie]=Hl(e._locale,e._a[Ie],e._meridiem),l=ee(e).era,l!==null&&(e._a[Oe]=e._locale.erasConvertYear(l,e._a[Oe])),Hn(e),Un(e)}function Hl(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Bl(e){var t,n,r,i,a,h,f=!1,o=e._f.length;if(o===0){ee(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,h=!1,t=Sn({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Bn(t),_n(t)&&(h=!0),a+=ee(t).charsLeftOver,a+=ee(t).unusedTokens.length*10,ee(t).score=a,f?a<r&&(r=a,n=t):(r==null||a<r||h)&&(r=a,n=t,h&&(f=!0));Nt(e,n||t)}function Wl(e){if(!e._d){var t=Mn(e._i),n=t.day===void 0?t.date:t.day;e._a=_r([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Hn(e)}}function zl(e){var t=new ns(Un(qr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function qr(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),t===null||n===void 0&&t===""?As({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ge(t)?new ns(Un(t)):(ss(t)?e._d=t:ze(n)?Bl(e):n?Bn(e):Gl(e),_n(e)||(e._d=null),e))}function Gl(e){var t=e._i;Re(t)?e._d=new Date(E.now()):ss(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Yl(e):ze(t)?(e._a=_r(t.slice(0),function(n){return parseInt(n,10)}),Hn(e)):St(t)?Wl(e):it(t)?e._d=new Date(t):E.createFromInputFallback(e)}function Kr(e,t,n,r,i){var a={};return(t===!0||t===!1)&&(r=t,t=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(St(e)&&jn(e)||ze(e)&&e.length===0)&&(e=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=i,a._l=n,a._i=e,a._f=t,a._strict=r,zl(a)}function ge(e,t,n,r){return Kr(e,t,n,r,!1)}var Vl=$e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:As()}),ql=$e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=ge.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:As()});function Qr(e,t){var n,r;if(t.length===1&&ze(t[0])&&(t=t[0]),!t.length)return ge();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Kl(){var e=[].slice.call(arguments,0);return Qr("isBefore",e)}function Ql(){var e=[].slice.call(arguments,0);return Qr("isAfter",e)}var Zl=function(){return Date.now?Date.now():+new Date},us=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Jl(e){var t,n=!1,r,i=us.length;for(t in e)if(de(e,t)&&!(je.call(us,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[us[r]]){if(n)return!1;parseFloat(e[us[r]])!==re(e[us[r]])&&(n=!0)}return!0}function Xl(){return this._isValid}function eo(){return qe(NaN)}function Ws(e){var t=Mn(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,h=t.day||0,f=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Jl(t),this._milliseconds=+c+l*1e3+o*6e4+f*1e3*60*60,this._days=+h+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ht(),this._bubble()}function zs(e){return e instanceof Ws}function Wn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function to(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,h;for(h=0;h<r;h++)re(e[h])!==re(t[h])&&a++;return a+i}function Zr(e,t){W(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+Je(~~(n/60),2)+t+Je(~~n%60,2)})}Zr("Z",":"),Zr("ZZ",""),Y("Z",Ds),Y("ZZ",Ds),pe(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=zn(Ds,e)});var so=/([\+\-]|\d\d)/gi;function zn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(so)||["-",0,0],a=+(i[1]*60)+re(i[2]),a===0?0:i[0]==="+"?a:-a)}function Gn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ge(e)||ss(e)?e.valueOf():ge(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),E.updateOffset(n,!1),n):ge(e).local()}function Vn(e){return-Math.round(e._d.getTimezoneOffset())}E.updateOffset=function(){};function no(e,t,n){var r=this._offset||0,i;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=zn(Ds,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=Vn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?ta(this,qe(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,E.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Vn(this)}function ro(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function ao(e){return this.utcOffset(0,e)}function io(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vn(this),"m")),this}function lo(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=zn(wi,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function oo(e){return this.isValid()?(e=e?ge(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function co(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ho(){if(!Re(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Sn(e,this),e=qr(e),e._a?(t=e._isUTC?Qe(e._a):ge(e._a),this._isDSTShifted=this.isValid()&&to(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function uo(){return this.isValid()?!this._isUTC:!1}function mo(){return this.isValid()?this._isUTC:!1}function Jr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,po=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function qe(e,t){var n=e,r=null,i,a,h;return zs(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:it(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=fo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:re(r[Xe])*i,h:re(r[Ie])*i,m:re(r[Ve])*i,s:re(r[ct])*i,ms:re(Wn(r[Tt]*1e3))*i}):(r=po.exec(e))?(i=r[1]==="-"?-1:1,n={y:wt(r[2],i),M:wt(r[3],i),w:wt(r[4],i),d:wt(r[5],i),h:wt(r[6],i),m:wt(r[7],i),s:wt(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(h=yo(ge(n.from),ge(n.to)),n={},n.ms=h.milliseconds,n.M=h.months),a=new Ws(n),zs(e)&&de(e,"_locale")&&(a._locale=e._locale),zs(e)&&de(e,"_isValid")&&(a._isValid=e._isValid),a}qe.fn=Ws.prototype,qe.invalid=eo;function wt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Xr(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function yo(e,t){var n;return e.isValid()&&t.isValid()?(t=Gn(t,e),e.isBefore(t)?n=Xr(e,t):(n=Xr(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ea(e,t){return function(n,r){var i,a;return r!==null&&!isNaN(+r)&&(wr(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),i=qe(n,r),ta(this,i,e),this}}function ta(e,t,n,r){var i=t._milliseconds,a=Wn(t._days),h=Wn(t._months);e.isValid()&&(r=r??!0,h&&Fr(e,ls(e,"Month")+h*n),a&&kr(e,"Date",ls(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&E.updateOffset(e,a||h))}var go=ea(1,"add"),xo=ea(-1,"subtract");function sa(e){return typeof e=="string"||e instanceof String}function No(e){return Ge(e)||ss(e)||sa(e)||it(e)||vo(e)||jo(e)||e===null||e===void 0}function jo(e){var t=St(e)&&!jn(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,a,h=r.length;for(i=0;i<h;i+=1)a=r[i],n=n||de(e,a);return t&&n}function vo(e){var t=ze(e),n=!1;return t&&(n=e.filter(function(r){return!it(r)&&sa(e)}).length===0),t&&n}function _o(e){var t=St(e)&&!jn(e),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,a;for(i=0;i<r.length;i+=1)a=r[i],n=n||de(e,a);return t&&n}function bo(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function So(e,t){arguments.length===1&&(arguments[0]?No(arguments[0])?(e=arguments[0],t=void 0):_o(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||ge(),r=Gn(n,this).startOf("day"),i=E.calendarFormat(this,r)||"sameElse",a=t&&(Ze(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,ge(n)))}function To(){return new ns(this)}function wo(e,t){var n=Ge(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=He(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function Io(e,t){var n=Ge(e)?e:ge(e);return this.isValid()&&n.isValid()?(t=He(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function Co(e,t,n,r){var i=Ge(e)?e:ge(e),a=Ge(t)?t:ge(t);return this.isValid()&&i.isValid()&&a.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(a,n):!this.isAfter(a,n))):!1}function Oo(e,t){var n=Ge(e)?e:ge(e),r;return this.isValid()&&n.isValid()?(t=He(t)||"millisecond",t==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(t).valueOf()<=r&&r<=this.clone().endOf(t).valueOf())):!1}function Mo(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Ao(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Eo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=Gn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=He(t),t){case"year":a=Gs(this,r)/12;break;case"month":a=Gs(this,r);break;case"quarter":a=Gs(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:Be(a)}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"),i,a;return t-r<0?(i=e.clone().add(n-1,"months"),a=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),a=(t-r)/(i-r)),-(n+a)||0}E.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",E.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ro(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ko(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Rs(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ze(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rs(n,"Z")):Rs(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Lo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,i,a;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]',this.format(n+r+i+a)}function Po(e){e||(e=this.isUtc()?E.defaultFormatUtc:E.defaultFormat);var t=Rs(this,e);return this.localeData().postformat(t)}function Fo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ge(e).isValid())?qe({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.from(ge(),e)}function Yo(e,t){return this.isValid()&&(Ge(e)&&e.isValid()||ge(e).isValid())?qe({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Uo(e){return this.to(ge(),e)}function na(e){var t;return e===void 0?this._locale._abbr:(t=ht(e),t!=null&&(this._locale=t),this)}var ra=$e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function aa(){return this._locale}var Vs=1e3,Ut=60*Vs,qs=60*Ut,ia=(365*400+97)*24*qs;function $t(e,t){return(e%t+t)%t}function la(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ia:new Date(e,t,n).valueOf()}function oa(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ia:Date.UTC(e,t,n)}function $o(e){var t,n;if(e=He(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=$t(t+(this._isUTC?0:this.utcOffset()*Ut),qs);break;case"minute":t=this._d.valueOf(),t-=$t(t,Ut);break;case"second":t=this._d.valueOf(),t-=$t(t,Vs);break}return this._d.setTime(t),E.updateOffset(this,!0),this}function Ho(e){var t,n;if(e=He(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?oa:la,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=qs-$t(t+(this._isUTC?0:this.utcOffset()*Ut),qs)-1;break;case"minute":t=this._d.valueOf(),t+=Ut-$t(t,Ut)-1;break;case"second":t=this._d.valueOf(),t+=Vs-$t(t,Vs)-1;break}return this._d.setTime(t),E.updateOffset(this,!0),this}function Bo(){return this._d.valueOf()-(this._offset||0)*6e4}function Wo(){return Math.floor(this.valueOf()/1e3)}function zo(){return new Date(this.valueOf())}function Go(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Vo(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function qo(){return this.isValid()?this.toISOString():null}function Ko(){return _n(this)}function Qo(){return Nt({},ee(this))}function Zo(){return ee(this).overflow}function Jo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}W("N",0,0,"eraAbbr"),W("NN",0,0,"eraAbbr"),W("NNN",0,0,"eraAbbr"),W("NNNN",0,0,"eraName"),W("NNNNN",0,0,"eraNarrow"),W("y",["y",1],"yo","eraYear"),W("y",["yy",2],0,"eraYear"),W("y",["yyy",3],0,"eraYear"),W("y",["yyyy",4],0,"eraYear"),Y("N",qn),Y("NN",qn),Y("NNN",qn),Y("NNNN",cc),Y("NNNNN",dc),pe(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?ee(n).era=i:ee(n).invalidEra=e}),Y("y",Pt),Y("yy",Pt),Y("yyy",Pt),Y("yyyy",Pt),Y("yo",hc),pe(["y","yy","yyy","yyyy"],Oe),pe(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Oe]=n._locale.eraYearOrdinalParse(e,i):t[Oe]=parseInt(e,10)});function Xo(e,t){var n,r,i,a=this._eras||ht("en")._eras;for(n=0,r=a.length;n<r;++n){switch(typeof a[n].since){case"string":i=E(a[n].since).startOf("day"),a[n].since=i.valueOf();break}switch(typeof a[n].until){case"undefined":a[n].until=1/0;break;case"string":i=E(a[n].until).startOf("day").valueOf(),a[n].until=i.valueOf();break}}return a}function ec(e,t,n){var r,i,a=this.eras(),h,f,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(h=a[r].name.toUpperCase(),f=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(f===e)return a[r];break;case"NNNN":if(h===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([h,f,o].indexOf(e)>=0)return a[r]}function tc(e,t){var n=e.since<=e.until?1:-1;return t===void 0?E(e.since).year():E(e.since).year()+(t-e.offset)*n}function sc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].name;return""}function nc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].narrow;return""}function rc(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e)if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until||r[e].until<=n&&n<=r[e].since)return r[e].abbr;return""}function ac(){var e,t,n,r,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,r=this.clone().startOf("day").valueOf(),i[e].since<=r&&r<=i[e].until||i[e].until<=r&&r<=i[e].since)return(this.year()-E(i[e].since).year())*n+i[e].offset;return this.year()}function ic(e){return de(this,"_erasNameRegex")||Kn.call(this),e?this._erasNameRegex:this._erasRegex}function lc(e){return de(this,"_erasAbbrRegex")||Kn.call(this),e?this._erasAbbrRegex:this._erasRegex}function oc(e){return de(this,"_erasNarrowRegex")||Kn.call(this),e?this._erasNarrowRegex:this._erasRegex}function qn(e,t){return t.erasAbbrRegex(e)}function cc(e,t){return t.erasNameRegex(e)}function dc(e,t){return t.erasNarrowRegex(e)}function hc(e,t){return t._eraYearOrdinalRegex||Pt}function Kn(){var e=[],t=[],n=[],r=[],i,a,h,f,o,l=this.eras();for(i=0,a=l.length;i<a;++i)h=lt(l[i].name),f=lt(l[i].abbr),o=lt(l[i].narrow),t.push(h),e.push(f),n.push(o),r.push(h),r.push(f),r.push(o);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ks(e,t){W(0,[e,e.length],0,t)}Ks("gggg","weekYear"),Ks("ggggg","weekYear"),Ks("GGGG","isoWeekYear"),Ks("GGGGG","isoWeekYear"),Y("G",Fs),Y("g",Fs),Y("GG",ye,De),Y("gg",ye,De),Y("GGGG",En,An),Y("gggg",En,An),Y("GGGGG",Ps,ks),Y("ggggg",Ps,ks),as(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=re(e)}),as(["gg","GG"],function(e,t,n,r){t[r]=E.parseTwoDigitYear(e)});function uc(e){return ca.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function mc(e){return ca.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function fc(){return dt(this.year(),1,4)}function pc(){return dt(this.isoWeekYear(),1,4)}function yc(){var e=this.localeData()._week;return dt(this.year(),e.dow,e.doy)}function gc(){var e=this.localeData()._week;return dt(this.weekYear(),e.dow,e.doy)}function ca(e,t,n,r,i){var a;return e==null?cs(this,r,i).year:(a=dt(e,r,i),t>a&&(t=a),xc.call(this,e,t,n,r,i))}function xc(e,t,n,r,i){var a=Ur(e,t,n,r,i),h=os(a.year,0,a.dayOfYear);return this.year(h.getUTCFullYear()),this.month(h.getUTCMonth()),this.date(h.getUTCDate()),this}W("Q",0,"Qo","quarter"),Y("Q",Or),pe("Q",function(e,t){t[ot]=(re(e)-1)*3});function Nc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}W("D",["DD",2],"Do","date"),Y("D",ye,Ft),Y("DD",ye,De),Y("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),pe(["D","DD"],Xe),pe("Do",function(e,t){t[Xe]=re(e.match(ye)[0])});var da=Dt("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),Y("DDD",Ls),Y("DDDD",Mr),pe(["DDD","DDDD"],function(e,t,n){n._dayOfYear=re(e)});function jc(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}W("m",["mm",2],0,"minute"),Y("m",ye,Rn),Y("mm",ye,De),pe(["m","mm"],Ve);var vc=Dt("Minutes",!1);W("s",["ss",2],0,"second"),Y("s",ye,Rn),Y("ss",ye,De),pe(["s","ss"],ct);var _c=Dt("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return this.millisecond()*10}),W(0,["SSSSS",5],0,function(){return this.millisecond()*100}),W(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),W(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),W(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),W(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Y("S",Ls,Or),Y("SS",Ls,De),Y("SSS",Ls,Mr);var vt,ha;for(vt="SSSS";vt.length<=9;vt+="S")Y(vt,Pt);function bc(e,t){t[Tt]=re(("0."+e)*1e3)}for(vt="S";vt.length<=9;vt+="S")pe(vt,bc);ha=Dt("Milliseconds",!1),W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");function Sc(){return this._isUTC?"UTC":""}function Tc(){return this._isUTC?"Coordinated Universal Time":""}var M=ns.prototype;M.add=go,M.calendar=So,M.clone=To,M.diff=Eo,M.endOf=Ho,M.format=Po,M.from=Fo,M.fromNow=Do,M.to=Yo,M.toNow=Uo,M.get=ki,M.invalidAt=Zo,M.isAfter=wo,M.isBefore=Io,M.isBetween=Co,M.isSame=Oo,M.isSameOrAfter=Mo,M.isSameOrBefore=Ao,M.isValid=Ko,M.lang=ra,M.locale=na,M.localeData=aa,M.max=ql,M.min=Vl,M.parsingFlags=Qo,M.set=Li,M.startOf=$o,M.subtract=xo,M.toArray=Go,M.toObject=Vo,M.toDate=zo,M.toISOString=ko,M.inspect=Lo,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=qo,M.toString=Ro,M.unix=Wo,M.valueOf=Bo,M.creationData=Jo,M.eraName=sc,M.eraNarrow=nc,M.eraAbbr=rc,M.eraYear=ac,M.year=Rr,M.isLeapYear=Ri,M.weekYear=uc,M.isoWeekYear=mc,M.quarter=M.quarters=Nc,M.month=Dr,M.daysInMonth=Wi,M.week=M.weeks=Ji,M.isoWeek=M.isoWeeks=Xi,M.weeksInYear=yc,M.weeksInWeekYear=gc,M.isoWeeksInYear=fc,M.isoWeeksInISOWeekYear=pc,M.date=da,M.day=M.days=ul,M.weekday=ml,M.isoWeekday=fl,M.dayOfYear=jc,M.hour=M.hours=vl,M.minute=M.minutes=vc,M.second=M.seconds=_c,M.millisecond=M.milliseconds=ha,M.utcOffset=no,M.utc=ao,M.local=io,M.parseZone=lo,M.hasAlignedHourOffset=oo,M.isDST=co,M.isLocal=uo,M.isUtcOffset=mo,M.isUtc=Jr,M.isUTC=Jr,M.zoneAbbr=Sc,M.zoneName=Tc,M.dates=$e("dates accessor is deprecated. Use date instead.",da),M.months=$e("months accessor is deprecated. Use month instead",Dr),M.years=$e("years accessor is deprecated. Use year instead",Rr),M.zone=$e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",ro),M.isDSTShifted=$e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ho);function wc(e){return ge(e*1e3)}function Ic(){return ge.apply(null,arguments).parseZone()}function ua(e){return e}var he=wn.prototype;he.calendar=hi,he.longDateFormat=pi,he.invalidDate=gi,he.ordinal=ji,he.preparse=ua,he.postformat=ua,he.relativeTime=_i,he.pastFuture=bi,he.set=ci,he.eras=Xo,he.erasParse=ec,he.erasConvertYear=tc,he.erasAbbrRegex=lc,he.erasNameRegex=ic,he.erasNarrowRegex=oc,he.months=Ui,he.monthsShort=$i,he.monthsParse=Bi,he.monthsRegex=Gi,he.monthsShortRegex=zi,he.week=qi,he.firstDayOfYear=Zi,he.firstDayOfWeek=Qi,he.weekdays=ll,he.weekdaysMin=cl,he.weekdaysShort=ol,he.weekdaysParse=hl,he.weekdaysRegex=pl,he.weekdaysShortRegex=yl,he.weekdaysMinRegex=gl,he.isPM=Nl,he.meridiem=_l;function Qs(e,t,n,r){var i=ht(),a=Qe().set(r,t);return i[n](a,e)}function ma(e,t,n){if(it(e)&&(t=e,e=void 0),e=e||"",t!=null)return Qs(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Qs(e,r,n,"month");return i}function Qn(e,t,n,r){typeof e=="boolean"?(it(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,it(t)&&(n=t,t=void 0),t=t||"");var i=ht(),a=e?i._week.dow:0,h,f=[];if(n!=null)return Qs(t,(n+a)%7,r,"day");for(h=0;h<7;h++)f[h]=Qs(t,(h+a)%7,r,"day");return f}function Cc(e,t){return ma(e,t,"months")}function Oc(e,t){return ma(e,t,"monthsShort")}function Mc(e,t,n){return Qn(e,t,n,"weekdays")}function Ac(e,t,n){return Qn(e,t,n,"weekdaysShort")}function Ec(e,t,n){return Qn(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=re(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),E.lang=$e("moment.lang is deprecated. Use moment.locale instead.",jt),E.langData=$e("moment.langData is deprecated. Use moment.localeData instead.",ht);var ut=Math.abs;function Rc(){var e=this._data;return this._milliseconds=ut(this._milliseconds),this._days=ut(this._days),this._months=ut(this._months),e.milliseconds=ut(e.milliseconds),e.seconds=ut(e.seconds),e.minutes=ut(e.minutes),e.hours=ut(e.hours),e.months=ut(e.months),e.years=ut(e.years),this}function fa(e,t,n,r){var i=qe(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function kc(e,t){return fa(this,e,t,1)}function Lc(e,t){return fa(this,e,t,-1)}function pa(e){return e<0?Math.floor(e):Math.ceil(e)}function Pc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,h,f,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=pa(Zn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Be(e/1e3),r.seconds=i%60,a=Be(i/60),r.minutes=a%60,h=Be(a/60),r.hours=h%24,t+=Be(h/24),o=Be(ya(t)),n+=o,t-=pa(Zn(o)),f=Be(n/12),n%=12,r.days=t,r.months=n,r.years=f,this}function ya(e){return e*4800/146097}function Zn(e){return e*146097/4800}function Fc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=He(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+ya(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Zn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function mt(e){return function(){return this.as(e)}}var ga=mt("ms"),Dc=mt("s"),Yc=mt("m"),Uc=mt("h"),$c=mt("d"),Hc=mt("w"),Bc=mt("M"),Wc=mt("Q"),zc=mt("y"),Gc=ga;function Vc(){return qe(this)}function qc(e){return e=He(e),this.isValid()?this[e+"s"]():NaN}function It(e){return function(){return this.isValid()?this._data[e]:NaN}}var Kc=It("milliseconds"),Qc=It("seconds"),Zc=It("minutes"),Jc=It("hours"),Xc=It("days"),ed=It("months"),td=It("years");function sd(){return Be(this.days()/7)}var ft=Math.round,Ht={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nd(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function rd(e,t,n,r){var i=qe(e).abs(),a=ft(i.as("s")),h=ft(i.as("m")),f=ft(i.as("h")),o=ft(i.as("d")),l=ft(i.as("M")),c=ft(i.as("w")),d=ft(i.as("y")),p=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||h<=1&&["m"]||h<n.m&&["mm",h]||f<=1&&["h"]||f<n.h&&["hh",f]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(p=p||c<=1&&["w"]||c<n.w&&["ww",c]),p=p||l<=1&&["M"]||l<n.M&&["MM",l]||d<=1&&["y"]||["yy",d],p[2]=t,p[3]=+e>0,p[4]=r,nd.apply(null,p)}function ad(e){return e===void 0?ft:typeof e=="function"?(ft=e,!0):!1}function id(e,t){return Ht[e]===void 0?!1:t===void 0?Ht[e]:(Ht[e]=t,e==="s"&&(Ht.ss=t-1),!0)}function ld(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Ht,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},Ht,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=rd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Jn=Math.abs;function Bt(e){return(e>0)-(e<0)||+e}function Zs(){if(!this.isValid())return this.localeData().invalidDate();var e=Jn(this._milliseconds)/1e3,t=Jn(this._days),n=Jn(this._months),r,i,a,h,f=this.asSeconds(),o,l,c,d;return f?(r=Be(e/60),i=Be(r/60),e%=60,r%=60,a=Be(n/12),n%=12,h=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=f<0?"-":"",l=Bt(this._months)!==Bt(f)?"-":"",c=Bt(this._days)!==Bt(f)?"-":"",d=Bt(this._milliseconds)!==Bt(f)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?d+i+"H":"")+(r?d+r+"M":"")+(e?d+h+"S":"")):"P0D"}var ie=Ws.prototype;ie.isValid=Xl,ie.abs=Rc,ie.add=kc,ie.subtract=Lc,ie.as=Fc,ie.asMilliseconds=ga,ie.asSeconds=Dc,ie.asMinutes=Yc,ie.asHours=Uc,ie.asDays=$c,ie.asWeeks=Hc,ie.asMonths=Bc,ie.asQuarters=Wc,ie.asYears=zc,ie.valueOf=Gc,ie._bubble=Pc,ie.clone=Vc,ie.get=qc,ie.milliseconds=Kc,ie.seconds=Qc,ie.minutes=Zc,ie.hours=Jc,ie.days=Xc,ie.weeks=sd,ie.months=ed,ie.years=td,ie.humanize=ld,ie.toISOString=Zs,ie.toString=Zs,ie.toJSON=Zs,ie.locale=na,ie.localeData=aa,ie.toIsoString=$e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zs),ie.lang=ra,W("X",0,0,"unix"),W("x",0,0,"valueOf"),Y("x",Fs),Y("X",Ii),pe("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),pe("x",function(e,t,n){n._d=new Date(re(e))});//! moment.js
39
+ E.version="2.30.1",li(ge),E.fn=M,E.min=Kl,E.max=Ql,E.now=Zl,E.utc=Qe,E.unix=wc,E.months=Cc,E.isDate=ss,E.locale=jt,E.invalid=As,E.duration=qe,E.isMoment=Ge,E.weekdays=Mc,E.parseZone=Ic,E.localeData=ht,E.isDuration=zs,E.monthsShort=Oc,E.weekdaysMin=Ec,E.defineLocale=Yn,E.updateLocale=wl,E.locales=Il,E.weekdaysShort=Ac,E.normalizeUnits=He,E.relativeTimeRounding=ad,E.relativeTimeThreshold=id,E.calendarFormat=bo,E.prototype=M,E.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 _t=(e,t,n)=>{let r;for(let i=0;i<(e==null?void 0:e.length);i++)if(r=e[i],r[n]==t)return r;return new Object},Ke=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(" ")},ms=(e,t)=>{let n,r=new Object;if(e&&e.length>0)for(let i=0;i<e.length;i++)n=e[i],r[n[t]]=n;return r},od=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},cd=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e);var Js={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 cd=Js.exports,ga;function dd(){return ga||(ga=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(cd,function(){var t,n,r="2.0.6",i={},a={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,d,p,m;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(d in i)if(m=typeof i[d].regexps.unformat=="function"?i[d].regexps.unformat():i[d].regexps.unformat,m&&l.match(m)){p=i[d].unformat;break}p=p||t._.stringToNumber,c=p(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,d){var p=a[t.options.currentLocale],m=!1,x=!1,v=0,b="",w=1e12,S=1e9,M=1e6,P=1e3,O="",z=!1,K,se,Q,ie,Ce,W,q;if(l=l||0,se=Math.abs(l),t._.includes(c,"(")?(m=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Ce=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(K=c.match(/a(k|m|b|t)?/),K=K?K[1]:!1,t._.includes(c," a")&&(b=" "),c=c.replace(new RegExp(b+"a[kmbt]?"),""),se>=w&&!K||K==="t"?(b+=p.abbreviations.trillion,l=l/w):se<w&&se>=S&&!K||K==="b"?(b+=p.abbreviations.billion,l=l/S):se<S&&se>=M&&!K||K==="m"?(b+=p.abbreviations.million,l=l/M):(se<M&&se>=P&&!K||K==="k")&&(b+=p.abbreviations.thousand,l=l/P)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],ie=c.split(".")[1],W=c.indexOf(","),v=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,ie?(t._.includes(ie,"[")?(ie=ie.replace("]",""),ie=ie.split("["),O=t._.toFixed(l,ie[0].length+ie[1].length,d,ie[1].length)):O=t._.toFixed(l,ie.length,d),Q=O.split(".")[0],t._.includes(O,".")?O=p.delimiters.decimal+O.split(".")[1]:O="",x&&Number(O.slice(1))===0&&(O="")):Q=t._.toFixed(l,0,d),b&&!K&&Number(Q)>=1e3&&b!==p.abbreviations.trillion)switch(Q=String(Number(Q)/1e3),b){case p.abbreviations.thousand:b=p.abbreviations.million;break;case p.abbreviations.million:b=p.abbreviations.billion;break;case p.abbreviations.billion:b=p.abbreviations.trillion;break}if(t._.includes(Q,"-")&&(Q=Q.slice(1),z=!0),Q.length<v)for(var B=v-Q.length;B>0;B--)Q="0"+Q;return W>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),q=Q+O+(b||""),m?q=(m&&z?"(":"")+q+(m&&z?")":""):Ce>=0?q=Ce===0?(z?"-":"+")+q:q+(z?"-":"+"):z&&(q="-"+q),q},stringToNumber:function(l){var c=a[f.currentLocale],d=l,p={thousand:3,million:6,billion:9,trillion:12},m,x,v;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(m in p)if(v=new RegExp("[^a-zA-Z]"+c.abbreviations[m]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),d.match(v)){x*=Math.pow(10,p[m]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,d){return l.slice(0,d)+c+l.slice(d)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var d=Object(l),p=d.length>>>0,m=0,x;if(arguments.length===3)x=arguments[2];else{for(;m<p&&!(m in d);)m++;if(m>=p)throw new TypeError("Reduce of empty array with no initial value");x=d[m++]}for(;m<p;m++)m in d&&(x=c(x,d[m],m,d));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,d){var p=n.multiplier(d);return c>p?c:p},1)},toFixed:function(l,c,d,p){var m=l.toString().split("."),x=c-(p||0),v,b,w,S;return m.length===2?v=Math.min(Math.max(m[1].length,x),c):v=x,w=Math.pow(10,v),S=(d(l+"e+"+v)/w).toFixed(v),p>c-v&&(b=new RegExp("\\.?0{1,"+(p-(c-v))+"}$"),S=S.replace(b,"")),S}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in h)f[l]=h[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,d){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=d,d},t.validate=function(l,c){var d,p,m,x,v,b,w,S;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{w=t.localeData(c)}catch{w=t.localeData(t.locale())}return m=w.currency.symbol,v=w.abbreviations,d=w.delimiters.decimal,w.delimiters.thousands==="."?p="\\.":p=w.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==m)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==v.thousand&&S[0]!==v.million&&S[0]!==v.billion&&S[0]!==v.trillion))?!1:(b=new RegExp(p+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(d),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(b):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(b)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(b)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var d=this._value,p=l||f.defaultFormat,m,x,v;if(c=c||Math.round,d===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(d===null&&f.nullFormat!==null)x=f.nullFormat;else{for(m in i)if(p.match(i[m].regexps.format)){v=i[m].format;break}v=v||t._.numberToFormat,x=v(d,p,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(p,m,x,v){return p+Math.round(c*m)}return this._value=n.reduce([this._value,l],d,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(p,m,x,v){return p-Math.round(c*m)}return this._value=n.reduce([l],d,Math.round(this._value*c))/c,this},multiply:function(l){function c(d,p,m,x){var v=n.correctionFactor(d,p);return Math.round(d*v)*Math.round(p*v)/Math.round(v*v)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(d,p,m,x){var v=n.correctionFactor(d,p);return Math.round(d*v)/Math.round(p*v)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,d){var p=t._.includes(c," BPS")?" ":"",m;return l=l*1e4,c=c.replace(/\s?BPS/,""),m=t._.numberToFormat(l,c,d),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"BPS"),m=m.join("")):m=m+p+"BPS",m},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},d=l.suffixes.concat(c.suffixes.filter(function(m){return l.suffixes.indexOf(m)<0})),p=d.join("|");p="("+p.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(p)},format:function(m,x,v){var b,w=t._.includes(x,"ib")?c:l,S=t._.includes(x," b")||t._.includes(x," ib")?" ":"",M,P,O;for(x=x.replace(/\s?i?b/,""),M=0;M<=w.suffixes.length;M++)if(P=Math.pow(w.base,M),O=Math.pow(w.base,M+1),m===null||m===0||m>=P&&m<O){S+=w.suffixes[M],P>0&&(m=m/P);break}return b=t._.numberToFormat(m,x,v),b+S},unformat:function(m){var x=t._.stringToNumber(m),v,b;if(x){for(v=l.suffixes.length-1;v>=0;v--){if(t._.includes(m,l.suffixes[v])){b=Math.pow(l.base,v);break}if(t._.includes(m,c.suffixes[v])){b=Math.pow(c.base,v);break}}x*=b||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,d){var p=t.locales[t.options.currentLocale],m={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,v,b;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,d),l>=0?(m.before=m.before.replace(/[\-\(]/,""),m.after=m.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(m.before,"-")&&!t._.includes(m.before,"(")&&(m.before="-"+m.before),b=0;b<m.before.length;b++)switch(v=m.before[b],v){case"$":x=t._.insert(x,p.currency.symbol,b);break;case" ":x=t._.insert(x," ",b+p.currency.symbol.length-1);break}for(b=m.after.length-1;b>=0;b--)switch(v=m.after[b],v){case"$":x=b===m.after.length-1?x+p.currency.symbol:t._.insert(x,p.currency.symbol,-(m.after.length-(1+b)));break;case" ":x=b===m.after.length-1?x+" ":t._.insert(x," ",-(m.after.length-(1+b)+p.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,d){var p,m=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=m.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),p=t._.numberToFormat(Number(x[0]),c,d),p+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),d=Number(c[0]),p=Number(c[1]);p=t._.includes(l,"e-")?p*=-1:p;function m(x,v,b,w){var S=t._.correctionFactor(x,v),M=x*S*(v*S)/(S*S);return M}return t._.reduce([d,Math.pow(10,p)],m,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,d){var p=t.locales[t.options.currentLocale],m,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=p.ordinal(l),m=t._.numberToFormat(l,c,d),m+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,d){var p=t._.includes(c," %")?" ":"",m;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),m=t._.numberToFormat(l,c,d),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"%"),m=m.join("")):m=m+p+"%",m},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,d){var p=Math.floor(l/60/60),m=Math.floor((l-p*60*60)/60),x=Math.round(l-p*60*60-m*60);return p+":"+(m<10?"0"+m:m)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),d=0;return c.length===3?(d=d+Number(c[0])*60*60,d=d+Number(c[1])*60,d=d+Number(c[2])):c.length===2&&(d=d+Number(c[0])*60,d=d+Number(c[1])),Number(d)}})}(),t})}(Js)),Js.exports}var hd=dd();const Xs=pr(hd),_e=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),tt=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ud={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:tt},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:_e}},xa=(e,t)=>{const n=ud[`_${tn[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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",tn={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 md(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(p){if(p<10)return t[p];if(p<20)return n[p-11];{const m=p%10,x=Math.floor(p/10);return`${r[x]}${m?" "+t[m]:""}`}}function a(p){var m=p.toString(),x,v,b,w,S,M,P,O,z,K,se,Q,ie="and";if(m=m.replace(/[, ]/g,""),parseInt(m)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],v=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],b=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],w=m.length,M=[];w>0;)S=w,M.push(m.slice(w=Math.max(0,w-3),S));if(P=M.length,P>b.length)return"";for(Q=[],K=0;K<P;K++)O=parseInt(M[K]),O&&(z=M[K].split("").reverse().map(parseFloat),z[1]===1&&(z[0]+=10),(se=b[K])&&Q.push(se),(se=x[z[0]])&&Q.push(se),(se=v[z[1]])&&Q.push(se),(z[0]||z[1])&&(z[2]||K+1>P)&&Q.push(ie),(se=x[z[2]])&&Q.push(se+" Hundred"));return Q.reverse().join(" ")}const[h,f]=e.toString().split("."),o=a(parseInt(h,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const oe=(e,t)=>`${tn[t].symbol} ${xa(e||0,t)}`,Y=(e,t)=>`${tn[t].symbol} ${md(e||0,t)}`,Xn=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),er=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(h=>{var f;(f=h.discounts)==null||f.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},tr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(h=>{const f=`${h[t]}`;n[f]?(n[f].amt+=h.amt,n[f].taxAmt+=h.taxAmt):n[f]={amt:h.amt,chargeType:h.chargeType?h.chargeType:h.type,defaultSelcted:h.defaultSelcted,rate:h.rate,tax:h.tax,taxAmt:h.taxAmt,name:h.name,type:h.type}})}),Object.values(n)},sr=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"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function yd(e,t,n,r,i){const a=fs("1",e),h=fs("2",t),f=fs("3",n),o=fs("4",r),l=fs("5",i);var c=Buffer.concat([a,h,f,o,l]);return c.toString("base64")}const gd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),xd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},ps=Xn(),Nd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),h=Math.floor(t%3600/60),f=`${a} hr ${h} min`;return f}else return r},jd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=ms(i,"internalName");let h;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(h=a[f],n.push({displayName:h?h.displayName:Qe(f.replace("_"," ")),value:tt(e.paymentModes[f])}));return n},vd=(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 i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var h=i.toDataURL("image/png");t(h)},r.onerror=i=>{t(null)}}catch{t(null)}})}const sn=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return!0},nr=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},rr=(e,t)=>{var c,d,p,m;let n,r,i,a,h;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],h=0;h<n.addons.length;h++)a=n.addons[h],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(d=f[r].addons)!=null&&d.length&&((p=n.addons)!=null&&p.length)){const v=ms(n.addons,"serviceId"),b=[];let w;for(let S=0;S<f[r].addons.length;S++)a=f[r].addons[S],(m=v[a.serviceId])!=null&&m.serviceId&&(w=v[a.serviceId],a.sub_total+=w.sub_total??0),b.push(a);f[r].addons=b}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},ar=e=>{var f;let t,n,r,i,a={},h=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),h+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),h+=r.taxAmt);return{obj:Object.values(a),sum:h}},ir=(e,t,n)=>{var a,h,f,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return sn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=sn((h=t.siteSetting)==null?void 0:h.packagingSlipPrinters,i,"value");if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return sn((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=sn((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var b;const{usersObj:r}=n;let i={},a,h;const{cancelledKOT:f,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((b=e.customFeilds)!=null&&b.length){let w=bt(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(h=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{a=w.services.sort(S=>S.status==="CANCELLED"?-1:0),a.forEach((S,M)=>{var Ce,W,q;let P=S.station?S.station.split("::"):"",O=P&&P.length>1?P[1]:P[0],z=e.tableNo?e.tableNo.split("::"):null,K=z&&z.length>0?z[0]:e.orderFrom,se=e.tableName?e.tableName:e.tableNo?K:e.orderFrom,Q;(Ce=r==null?void 0:r[w.createdBy])!=null&&Ce.name&&(Q=r[w.createdBy].name);let ie=!1;(f||O&&S.status==l)&&(ie=!0),ie&&lr(O)&&(i[O]||(i[O]={},i[O].station=O,i[O].services=[],i[O].tableName=se,i[O].customerName=e.name==t.companyName?null:e.name,i[O].time=E().format("DD-MM-YYYY hh:mm a"),i[O].type=e.orderFrom,i[O].subOrderFrom=e.subOrderFrom,i[O].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,i[O].orderId=new Set([i[O].orderId]),i[O].instruction=e.instruction,i[O].orderSource=e.orderSource,i[O].deliveryTimestamp=e.deliveryTimestamp?E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[O].aggregatorOrderId=e.externalOrderId,i[O].otp=e.otp,i[O].totalQty=0,i[O].tokenId=e.tokenId,i[O].kotId=S.kotId?new Set([S.kotId]):null,i[O].waiterName=e.waiterName,i[O].duplicate=f,i[O].createdBy=Q,i[O].zomatoInstant=c,h&&(i[O].customFields=h),o&&(i[O].onlyCancelledItems=o),e.preparationTime&&(i[O].prepareBy=E().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[O]?(i[O].services.push({serviceName:S.serviceName,qty:S.qty,instruction:S.isUrgent&&S.instruction?`(URGENT -${S.instruction})`:S.instruction?`(${S.instruction})`:S.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:S.isUrgent,index:M,status:S.status,addons:S.addons}),i[O].totalQty+=_e(S.qty),(W=i[O].kotId)==null||W.add(S.kotId),e.externalOrderId||e.offlineOrderId||(q=i[O].orderId)==null||q.add(w.subOrderId)):(i[O]=[],i[O].services.push({serviceName:S.serviceName,qty:S.qty,instruction:S.instruction?S.instruction:"",subOrderId:w.subOrderId,index:M,status:S.status}),i[O].totalQty+=_e(S.qty)))})});let d={},p="2INCH";Xn();let m,x=[],v={};for(const w in i)if(Object.hasOwnProperty.call(i,w)){const S=i[w];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==S.station.toUpperCase()&&(m=ps=="Android OS"?M:M.value??void 0,p=M.paperSize?M.paperSize:t.printerSize,x.push({printer:m,paperSize:p}))}),x.length==0&&x.push({printer:m,paperSize:t.printerSize||p});for(let M=0;M<S.services.length;M++){let P=S.services[M],O=e.orderList.find(K=>K.subOrderId==P.subOrderId),z=d[P.subOrderId];O&&(z?z.services.push(O.services[P.index]):(d[P.subOrderId]={},d[P.subOrderId].subOrderId=O.subOrderId,d[P.subOrderId].services=[O.services[P.index]]))}}catch(M){console.log(M)}v[w]=x,x=[],m=null}for(const w in d)Object.hasOwnProperty.call(d,w)&&d[w];return{obj:i,paperSize:p,printer:m,printersMap:v}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let h="2INCH",f,o=[],l,c;const d=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let p=bt(e.customFeilds,"INSTRUCTION","customType");p!=null&&p.customValue&&(c=[{customName:p.customName,customValue:p.customValue}])}for(let p=0;p<t.packagingSlipPrinters.length;p++)if(l=t.packagingSlipPrinters[p],l.label==e.subOrderFrom&&(f=ps=="Android OS"?l:l.value??void 0,h=l.paperSize?l.paperSize:h,l.paperSize)){let m,x,v,b,w,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:E().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:d},M={},P=!1,O,z=0;for(e.preparationTime&&(S.prepareBy=E().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),v=0;v<e.orderList.length;v++)for(m=e.orderList[v],b=0;b<m.services.length;b++)x=m.services[b],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},P=!1,x.status===r&&((a=l.stations)!=null&&a.length?(O=ld(l.stations),O[x.station]&&(P=!0)):P=!0),P&&x.kotId&&x.station&&(w=x.station.split("::")[1],z+=x.qty,M[`${w}/${x.kotId}`]?M[`${w}/${x.kotId}`].push(x):M[`${w}/${x.kotId}`]=[x]);Object.keys(M).length&&(S.services=M,S.totalQty=tt(z),o.push({printer:f,paperSize:h,obj:S}))}return{printers:o}}catch(h){console.log(h)}},Sd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let d=(c=l.station.split("::"))==null?void 0:c[1];d&&lr(d)&&(r[d]?r[d].activeKots[l.kotId]=l.kotId:r[d]={from:[n.from],to:[n.to],station:d,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,d,p={},m=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],m.push(o.tableNo),c=0;c<o.ids.length;c++)d=o.ids[c],p[d]=d;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],p[o.id]&&o.orderList.forEach(v=>{v.services.forEach(b=>{var w;if((b.status==="KOT_GENERATED"||b.status==="IN_PROCESS")&&b.station){let S=(w=b.station.split("::"))==null?void 0:w[1];S&&lr(S)&&(r[S]?r[S].activeKots[b.kotId]=b.kotId:r[S]={from:m,to:[n.to],station:S,activeKots:{[b.kotId]:b.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:b.id})}})})}let i="2INCH",a,h=[],f={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?ps=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,h.push({printer:a,paperSize:i}))}),h.length==0&&h.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=h,h=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var M,P;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:h,rangeDate:f}=t,o={},l;const c=!!bt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:O,...z}=i;i={...z,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let d=c&&(n==null?void 0:n.length)&&n.some(O=>O.slugName==="online-menu")&&e.isAggregatorEnabled==!0,p=d?r.aggregator_collection:void 0,m=d?r.zomato_collection:void 0,x=d?r.swiggy_collection:void 0,v=c?Nd(r.avgTableTime):void 0;l={};let b=0;if(r!=null&&r.menuWiseSales){const O=r.menuWiseSales;for(const z in O)z.endsWith("collection")?l[ts(z)]=tt(O[z]):l[ts(z)]=O[z]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((M=Object.keys(r.itemTypeList))!=null&&M.length))for(let O in r.itemTypeList)b+=r.itemTypeList[O];let w=h;return f.toDate!==f.fromDate&&(w=`${sr(f.fromDate)} - ${sr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:tt(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:p,zomato_aggregator_collection:m,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:tt(i.totalCollection),averageCollection:{avgTableTime:v,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((P=a.DEBIT)!=null&&P.total)?tt(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?tt(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?tt(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:w,id:Math.random(),otherFields:{salesCollection:i.salesCollection?tt(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:b,itemTypeList:r.itemTypeList}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var d,p,m;const{invoiceFormat:a,userData:h}=n;let f,o,l=[],c;try{if((d=e.appliedDiscounts)!=null&&d.length){c=0;for(let q=0;q<e.appliedDiscounts.length;q++)f=e.appliedDiscounts[q],c+=f.discountAmt}const x=bt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((p=e.customFeilds)!=null&&p.length){const q=bt(e.customFeilds,"INSTRUCTION","customType");q!=null&&q.customValue&&(l=[{customName:q.customName,customValue:q.customValue}])}f={};let v=(m=t==null?void 0:t.footerAddress)!=null&&m.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",b=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",S=t.footerAddress.zip?t.footerAddress.zip:"",M=(v!=""?v+",":"")+(b!=""?b+",":"")+(w!=""?w+",":"")+(S!=""?S+",":""),P=t.gstNo,O={companyName:t.companyName,companyAddress:M,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?E.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},se={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},Q=en(t.curr),ie={...e,companyInfo:O,orderInfo:K,customerInfo:se,gst:P,curr:Q},Ce=null,W=null;a.companyLogo&&(Ce=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(W=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(q=>{q.services.forEach(async(B,fe)=>{var nt,rt;let U="kitchen",Z=e.tableName?e.tableName:e.orderFrom;U&&(f[U]||(f[U]={},f[U].station=U,f[U].services=[],f[U].tableName=Z,f[U].customerName=e.name,f[U].time=E.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[U].type=e.orderFrom,f[U].orderId=e.orderId,f[U].instruction=e.instruction,f[U].totalQty=0,f[U].tokenId=e.tokenId,f[U].orderSource=e.orderSource,f[U].aggregatorOrderId=e.externalOrderId,f[U].otp=e.otp,f[U].paymentState=e.paymentState,f[U].discountAmt=c,f[U].otherCharges=e.otherCharges,f[U].taxAmt=e.taxAmt,f[U].customFeilds=l,f[U].curr=t.curr??"INR",f[U].zomatoInstant=x),f[U]?(o={serviceName:B.serviceName,qty:B.qty,instruction:B.isUrgent&&B.instruction?`(URGENT -${B.instruction})`:B.instruction?`(${B.instruction})`:B.isUrgent?"(URGENT)":"",subOrderId:q.subOrderId,isUrgent:B.isUrgent,index:fe},(nt=B.addons)!=null&&nt.length&&(o.addons=B.addons),f[U].services.push(o),f[U].totalQty+=B.qty):(f[U]=[],f[U].services.push({serviceName:B.serviceName,qty:B.qty,instruction:B.instruction?B.instruction:"",subOrderId:q.subOrderId,index:fe}),f[U].totalQty+=B.qty),f[U]={...f[U],companyInfo:O,orderInfo:K,customerInfo:se,gst:P,curr:Q},f[U].domain=a.siteURL,f[U].paymentMethods=a.paymentMode?ie.paymentMethods:null,f[U].companyInfo.companyName=a.companyName,f[U].companyInfo.companyEmail=a.email,f[U].companyInfo.companyAddress=a.address,f[U].companyInfo.companyContact=a.mobile,f[U].tokenId=a.token?ie.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(ie.upiId=a.upiId),f[U].gstNo=a.gst?ie.gst:null,f[U].footerMessage=a.footerMessage,f[U].orderFrom=(rt=e.subOrderFrom)==null?void 0:rt.toUpperCase(),f[U].fssai=t.fssai,f[U].vatNo=t.vatNo,f[U].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[U].disabledPoweredBy=t.disabledPoweredBy===!0,f[U].printTime=E().format("DD-MM-YYYY hh:mm A"),f[U].printedBy=h.userRole=="admin"?"Admin":h.name,e.deliveryTimestamp&&(f[U].deliveryTimestamp=E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[U].itemInstructionOnBill=a.itemInstructionOnBill,f[U]={...f[U],companyLogo:Ce,companyQrCode:W})})});for(const q in f)if(Object.hasOwnProperty.call(f,q)){const B=f[q];try{let fe=t.printerSize??"2inch";r(new Object({obj:new Object({...B,paperSize:fe}),orderList:e.orderList}));return}catch(fe){console.log(fe)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let d=0;d<e.length;d++)for(let p=0;p<e[d].orderList.length;p++)t.push(e[d].orderList[p]);let n=[];if(t.length>0)for(let d=0;d<t.length;d++)for(let p=0;p<t[d].services.length;p++)t[d].services[p].status!="CANCELLED"&&t[d].services[p].status!="RETURNED"&&t[d].services[p].status!="SHIFTED"&&n.push(t[d].services[p]);let r={},i=[];for(let d=0;d<n.length;d++)if(n[d].addons&&n[d].addons.length>0)for(let p=0;p<n[d].addons.length;p++){let m={...n[d].addons[p]};m.qty=n[d].qty,i.push(m)}n.forEach(d=>{let{attachedCat:p,serviceId:m}=d;r[p]||(r[p]=[]);let x=r[p].findIndex(v=>v.serviceId===m);x!==-1?r[p][x].qty=r[p][x].qty+d.qty:r[p].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedCat,station:d.station})});const a=Object.keys(r).sort(),h={};a.forEach(d=>{h[d]=r[d]});for(let d in h)h[d].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));let f={Category:h},o={};i.forEach(d=>{let{attachedAddonCat:p,serviceId:m}=d;o[p]||(o[p]=[]);let x=o[p].findIndex(v=>v.serviceId===m);x!==-1?o[p][x].qty=o[p][x].qty+d.qty:o[p].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedAddonCat,station:d.station})});const l=Object.keys(o).sort(),c={};l.forEach(d=>{c[d]=o[d]});for(let d in c)c[d].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));return f.Addon=c,f},Na={"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"},ja=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return Na[t]?Na[t]:"SGST"},va=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c,d,p;try{const{invoiceFormat:m,custName:x,custMobile:v,custAddress:b,userData:w={}}=n,{itemList:S}=e;let M=w==null?void 0:w.userRole;if(w.userRole=="admin"?M="ADMIN":M=w==null?void 0:w.name,!(S!=null&&S.length))return;let P=t.printerSize,O=ir(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});P=O?(h=O[0])!=null&&h.paperSize?(f=O[0])==null?void 0:f.paperSize:P||"2INCH":P;let z=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",K=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",se=t.footerAddress.city?t.footerAddress.city:"",Q=t.footerAddress.zip?t.footerAddress.zip:"",ie=(z!=""?z+",":"")+(K!=""?K+",":"")+(se!=""?se+",":"")+(Q!=""?Q+",":""),Ce=t.gstNo,W={companyName:t.companyName,companyAddress:ie,companyContact:t.contactNumber,companyEmail:t.contactEmail},B={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?E.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},fe={custName:m&&m.custName?x==t.companyName?null:x:null,custAddress:m&&m.custAddress&&b||null,custContact:m&&m.custMobile?v:null,custEmail:"ajaybaglane7@gmail.com"},U=en(t.curr),Z={...e,companyInfo:W,orderInfo:B,customerInfo:fe,gst:Ce,curr:U};if(m){if(Z.domain=m.siteURL,Z.paymentMethods=m.paymentMode?Z.paymentMethods:null,Z.companyInfo.companyName=m.companyName,Z.companyInfo.companyEmail=m.email,Z.companyInfo.companyAddress=m.address,Z.companyInfo.companyContact=m.mobile,Z.customerInfo.custName=m.custName?x:null,Z.tokenId=m.token?Z.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(Z.upiId=m.upiId),Z.gstNo=m.gst?Z.gst:null,Z.footerMessage=m.footerMessage,Z.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),Z.fssai=t.fssai,Z.vatNo=t.vatNo,Z.taxLabel=ja(t),Z.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,Z.disabledPoweredBy=t.disabledPoweredBy===!0,Z.printTime=E().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(Z.deliveryTimestamp=E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Z.itemInstructionOnBill=m.itemInstructionOnBill,Z.printHSNCodeOnBill=m.printHSNCodeOnBill,Z.noOfInvoice=m.noOfInvoice,Z.printby=M,Z.newFormat=!0,!(m.itemInstructionOnBill||m.printHSNCodeOnBill)&&((l=Z.itemList)!=null&&l.length)){let J;for(let be=0;be<Z.itemList.length;be++)J=Z.itemList[be],J.instruction&&delete J.instruction,J.hsnCode&&delete J.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(Z.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let nt=[];if((d=e.customFeilds)!=null&&d.length){let J;for(let be=0;be<e.customFeilds.length;be++)J=e.customFeilds[be],J!=null&&J.customValue&&((p=J.availability)!=null&&p.includes("BILL"))&&nt.push({customName:J.customName,customValue:J.customValue});Z.customFields=nt}let rt=null,Mt=null;m.companyLogo&&(rt=await zt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(Mt=await zt(`https://${m.qrcode.bucket}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let at={};(function(){let J,be,gt=0,g=0,u=0,I=0,j=0,C=0,F=0,T=0,R=[],$=[],pe=0,Ee;if(P==="A4"||P==="A5"){for(be=0;be<S.length;be++)J=S[be],g+=J.sub_total,u+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0),pe+=J.qty;let Pe=er(S,"discountName",{separateItemsDisc:!0});const Fe=nr(Pe);let{obj:Ae,sum:$e}=ar(S);at={itemList:rr(S,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:tr(S,"name"),taxation:Ae,subTotal:_e(g),afterDisc:_e(u),afterCharges:_e(I),total:_e(gt+$e),qty:pe}}else{for(be=0;be<S.length;be++)J=S[be],J.taxType==="VAT"?($.push(J),T+=J.sub_total,C+=J.afterdiscAmt,j+=J.afterdiscAmt+(J.total_charges??0),F+=J.afterdiscAmt+(J.total_charges??0)):(R.push(J),g+=J.sub_total,u+=J.afterdiscAmt,I+=J.afterdiscAmt+(J.total_charges??0),gt+=J.afterdiscAmt+(J.total_charges??0));if(R.length){let Pe=er(R,"discountName",{separateItemsDisc:!0});const Fe=nr(Pe);let{obj:Ae,sum:$e}=ar(R);at.GST={itemList:rr(R,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:tr(R,"name"),taxation:Ae,subTotal:_e(g),afterDisc:_e(u),afterCharges:_e(I),total:_e(gt+$e)}}if($.length){let Pe=er($,"discountName",{separateItemsDisc:!0});const Fe=nr(Pe);let{obj:Ae,sum:$e}=ar($);at.VAT={itemList:rr($,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Fe,charges:tr($,"name"),taxation:Ae,subTotal:_e(T),afterDisc:_e(C),afterCharges:_e(j),total:_e(F+$e)}}}})(),Z.distributedData=at;let At={obj:Z,companyLogo:rt,companyQrCode:Mt,paperSize:t.printerSize,Name:a};r(At)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c;try{const{invoiceFormat:d,custName:p,custMobile:m,custAddress:x,orderData:v}=n;let b=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",w=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",P=(b!=""?b+",":"")+(w!=""?w+",":"")+(S!=""?S+",":"")+(M!=""?M+",":""),O=t.gstNo,z={companyName:t.companyName,companyAddress:P,companyContact:t.contactNumber,companyEmail:t.contactEmail},se={orderStatus:"COMPLETED",orderDate:v&&v.timestamp?E.unix(v.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:v&&v.orderId?v.orderId:null,timestamp:v.timestamp},Q={custName:d&&d.custName?p==t.companyName?null:p:null,custAddress:d&&d.custAddress&&x||null,custContact:d&&d.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},ie=en(t.curr),Ce="",W={...e,companyInfo:z,orderInfo:se,customerInfo:Q,gst:O,curr:ie};if(d){if(W.domain=d.siteURL,W.paymentMethods=d.paymentMode?W.paymentMethods:null,W.companyInfo.companyName=d.companyName,W.companyInfo.companyEmail=d.email,W.companyInfo.companyAddress=d.address,W.companyInfo.companyContact=d.mobile,W.customerInfo.custName=d.custName?p:null,W.tokenId=d.token?W.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(W.upiId=d.upiId),W.gstNo=d.gst?W.gst:null,W.footerMessage=d.footerMessage,W.orderFrom=(h=v.subOrderFrom)==null?void 0:h.toUpperCase(),W.fssai=t.fssai,W.vatNo=t.vatNo,W.taxLabel=ja(t),W.printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,W.disabledPoweredBy=t.disabledPoweredBy===!0,W.printTime=E().format("DD-MM-YYYY hh:mm A"),v.deliveryTimestamp&&(W.deliveryTimestamp=E.unix(v.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),W.itemInstructionOnBill=d.itemInstructionOnBill,W.printHSNCodeOnBill=d.printHSNCodeOnBill,W.noOfInvoice=d.noOfInvoice,W.area=v.area,W.captainName=v.captainName,!(d.itemInstructionOnBill||d.printHSNCodeOnBill)&&((f=W.itemList)!=null&&f.length)){let B;for(let fe=0;fe<W.itemList.length;fe++)B=W.itemList[fe],B.instruction&&delete B.instruction,B.hsnCode&&delete B.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(W.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let q=[];if((l=v.customFeilds)!=null&&l.length){let B;for(let fe=0;fe<v.customFeilds.length;fe++)B=v.customFeilds[fe],B!=null&&B.customValue&&((c=B.availability)!=null&&c.includes("BILL"))&&q.push({customName:B.customName,customValue:B.customValue});W.customFields=q}if(t&&t.isOld&&t.isOld==!0){let B=null,fe=null;d.companyLogo&&(B=await zt(`https://${d.companyLogo.bucket}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(fe=await zt(`https://${d.qrcode.bucket}.s3.amazonaws.com/${d.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let U={obj:W,companyLogo:B,companyQrCode:fe,paperSize:t.printerSize,Name:a};r(U)}}}catch(d){console.log("err",d)}}),Od=(e,t)=>new Promise(async(n,r)=>{var M;let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",h=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(h!=""?h+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],d,p=0,m=0,x=0,v=[],b,w;const S=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let P=0;P<e.length;P++)for(d=e[P],c.push({date:d.date,orderId:d.orderId,finalAmount:d.finalAmount}),p+=d.finalAmount,m+=d.paidAmt,x+=d.balanceAmt,b=0;b<d.orderTransactions.length;b++)w=d.orderTransactions[b],w.paidAmt&&v.push({date:E.unix(w.createdAt).format("DD-MM-YYYY"),paymentMode:S[w.paymentMode].displayName,amount:_e(w.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:p,totalPaid:m,totalPayable:x,paperSize:t.printerSize,curr:en(t.curr),transactions:v})}),Md=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await va({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),_a=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},lr=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(h=>h.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Ad(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function St(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function ba(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=St(window.getComputedStyle(document.documentElement)),Gt))}function nn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=nn(e,"border-left-width"),n=nn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=nn(e,"border-top-width"),n=nn(e,"border-bottom-width");return e.clientHeight+t+n}function Sa(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ue=16384;function Pd(e){(e.width>Ue||e.height>Ue)&&(e.width>Ue&&e.height>Ue?e.width>e.height?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue):e.width>Ue?(e.height*=Ue/e.width,e.width=Ue):(e.width*=Ue/e.height,e.height=Ue))}function rn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Fd(i)}const Le=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Le(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return ba(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function Ta(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const h=Ed();try{t.className=`${t.className} ${h}`}catch{return}const f=document.createElement("style");f.appendChild($d(h,n,i,r)),t.appendChild(f)}function Hd(e,t,n){Ta(e,t,":before",n),Ta(e,t,":after",n)}const wa="application/font-woff",Ia="image/jpeg",Bd={woff:wa,woff2:wa,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ia,jpeg:Ia,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 or(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function cr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Ca(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,h)=>{const f=new FileReader;f.onerror=h,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){h(o)}},f.readAsDataURL(i)})}const dr={};function Vd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function hr(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(dr[r]!=null)return dr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ca(e,n.fetchRequestInit,({res:h,result:f})=>(t||(t=h.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let h=`Failed to fetch resource: ${e}`;a&&(h=typeof a=="string"?a:a.message),h&&console.warn(h)}return dr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):rn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),h=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,h==null||h.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return rn(f)}const n=e.poster,r=or(n),i=await hr(n,r,t);return rn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await an(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return Le(e,HTMLCanvasElement)?qd(e):Le(e,HTMLVideoElement)?Kd(e,t):Le(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Oa(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Oa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Oa(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=St(e.assignedNodes()):Le(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=St(e.contentDocument.body.childNodes):a=St(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Le(e,HTMLVideoElement)||await a.reduce((h,f)=>h.then(()=>an(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):ba(n).forEach(a=>{let h=i.getPropertyValue(a);a==="font-size"&&h.endsWith("px")&&(h=`${Math.floor(parseFloat(h.substring(0,h.length-2)))-.1}px`),Le(e,HTMLIFrameElement)&&a==="display"&&h==="inline"&&(h="block"),a==="d"&&t.getAttribute("d")&&(h=`path(${t.getAttribute("d")})`),r.setProperty(a,h,i.getPropertyPriority(a))})}function th(e,t){Le(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Le(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(Le(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return Le(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await an(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",h=document.createElementNS(a,"svg");h.setAttribute("xmlns",a),h.style.position="absolute",h.style.width="0",h.style.height="0",h.style.overflow="hidden",h.style.display="none";const f=document.createElementNS(a,"defs");h.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(h)}return e}async function an(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Ma=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Ma,(n,r,i)=>(t.push(i),n)),t.filter(n=>!cr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,h=or(t);let f;return i||(f=await hr(a,h,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Aa(e){return e.search(Ma)!==-1}async function Ea(e,t,n){if(!Aa(e))return e;const r=dh(e,n);return oh(r).reduce((a,h)=>a.then(f=>ch(f,h,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ea(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function uh(e,t){const n=Le(e,HTMLImageElement);if(!(n&&!cr(e.src))&&!(Le(e,SVGImageElement)&&!cr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await hr(r,or(r),t);await new Promise((a,h)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){h(l)}}:h;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=St(e.childNodes).map(i=>Ra(i,t));await Promise.all(r).then(()=>e)}async function Ra(e,t){Le(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const ka={};async function La(e){let t=ka[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},ka[e]=t,t}async function Pa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async h=>{let f=h.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Ca(f,t.fetchRequestInit,({result:o})=>(n=n.replace(h,`url(${o})`),[h,o]))});return Promise.all(a).then(()=>n)}function Fa(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,h="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(h,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach((a,h)=>{if(a.type===CSSRule.IMPORT_RULE){let f=h+1;const o=a.href,l=La(o).then(c=>Pa(c,t)).then(c=>Fa(c).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?f+=1:i.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:d,error:p})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const h=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(La(i.href).then(f=>Pa(f,t)).then(f=>Fa(f).forEach(o=>{h.insertRule(o,h.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{St(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Aa(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=St(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Da(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Da(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Da(a.style.fontFamily))).map(a=>{const h=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ea(a.cssText,h,t)}))).join(`
46
- `)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ya(e,t={}){const{width:n,height:r}=Sa(e,t),i=await an(e,t,!0);return await jh(i,t),await Ra(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Sa(e,t),i=await Ya(e,t),a=await rn(i),h=document.createElement("canvas"),f=h.getContext("2d"),o=t.pixelRatio||Ld(),l=t.canvasWidth||n,c=t.canvasHeight||r;return h.width=l*o,h.height=c*o,t.skipAutoScale||Pd(h),h.style.width=`${l}`,h.style.height=`${c}`,t.backgroundColor&&(f.fillStyle=t.backgroundColor,f.fillRect(0,0,h.width,h.height)),f.drawImage(a,0,0,h.width,h.height),h}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,ln=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,$a=Object.prototype.propertyIsEnumerable,Ha=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ys=(e,t)=>{for(var n in t||(t={}))Ua.call(t,n)&&Ha(e,n,t[n]);if(ln)for(var n of ln(t))$a.call(t,n)&&Ha(e,n,t[n]);return e},ur=(e,t)=>{var n={};for(var r in e)Ua.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ln)for(var r of ln(e))t.indexOf(r)<0&&$a.call(e,r)&&(n[r]=e[r]);return n};/**
45
+ */var dd=Js.exports,xa;function hd(){return xa||(xa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(dd,function(){var t,n,r="2.0.6",i={},a={},h={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},f={currentLocale:h.currentLocale,zeroFormat:h.zeroFormat,nullFormat:h.nullFormat,defaultFormat:h.defaultFormat,scalePercentBy100:h.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,d,p,m;if(t.isNumeral(l))c=l.value();else if(l===0||typeof l>"u")c=0;else if(l===null||n.isNaN(l))c=null;else if(typeof l=="string")if(f.zeroFormat&&l===f.zeroFormat)c=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(d in i)if(m=typeof i[d].regexps.unformat=="function"?i[d].regexps.unformat():i[d].regexps.unformat,m&&l.match(m)){p=i[d].unformat;break}p=p||t._.stringToNumber,c=p(l)}else c=Number(l)||null;return new o(l,c)},t.version=r,t.isNumeral=function(l){return l instanceof o},t._=n={numberToFormat:function(l,c,d){var p=a[t.options.currentLocale],m=!1,x=!1,j=0,S="",A=1e12,w=1e9,I=1e6,P=1e3,D="",R=!1,q,se,J,ce,Te,G,K;if(l=l||0,se=Math.abs(l),t._.includes(c,"(")?(m=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(Te=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(q=c.match(/a(k|m|b|t)?/),q=q?q[1]:!1,t._.includes(c," a")&&(S=" "),c=c.replace(new RegExp(S+"a[kmbt]?"),""),se>=A&&!q||q==="t"?(S+=p.abbreviations.trillion,l=l/A):se<A&&se>=w&&!q||q==="b"?(S+=p.abbreviations.billion,l=l/w):se<w&&se>=I&&!q||q==="m"?(S+=p.abbreviations.million,l=l/I):(se<I&&se>=P&&!q||q==="k")&&(S+=p.abbreviations.thousand,l=l/P)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),J=l.toString().split(".")[0],ce=c.split(".")[1],G=c.indexOf(","),j=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,ce?(t._.includes(ce,"[")?(ce=ce.replace("]",""),ce=ce.split("["),D=t._.toFixed(l,ce[0].length+ce[1].length,d,ce[1].length)):D=t._.toFixed(l,ce.length,d),J=D.split(".")[0],t._.includes(D,".")?D=p.delimiters.decimal+D.split(".")[1]:D="",x&&Number(D.slice(1))===0&&(D="")):J=t._.toFixed(l,0,d),S&&!q&&Number(J)>=1e3&&S!==p.abbreviations.trillion)switch(J=String(Number(J)/1e3),S){case p.abbreviations.thousand:S=p.abbreviations.million;break;case p.abbreviations.million:S=p.abbreviations.billion;break;case p.abbreviations.billion:S=p.abbreviations.trillion;break}if(t._.includes(J,"-")&&(J=J.slice(1),R=!0),J.length<j)for(var B=j-J.length;B>0;B--)J="0"+J;return G>-1&&(J=J.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+p.delimiters.thousands)),c.indexOf(".")===0&&(J=""),K=J+D+(S||""),m?K=(m&&R?"(":"")+K+(m&&R?")":""):Te>=0?K=Te===0?(R?"-":"+")+K:K+(R?"-":"+"):R&&(K="-"+K),K},stringToNumber:function(l){var c=a[f.currentLocale],d=l,p={thousand:3,million:6,billion:9,trillion:12},m,x,j;if(f.zeroFormat&&l===f.zeroFormat)x=0;else if(f.nullFormat&&l===f.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(m in p)if(j=new RegExp("[^a-zA-Z]"+c.abbreviations[m]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),d.match(j)){x*=Math.pow(10,p[m]);break}x*=(l.split("-").length+Math.min(l.split("(").length-1,l.split(")").length-1))%2?1:-1,l=l.replace(/[^0-9\.]+/g,""),x*=Number(l)}return x},isNaN:function(l){return typeof l=="number"&&isNaN(l)},includes:function(l,c){return l.indexOf(c)!==-1},insert:function(l,c,d){return l.slice(0,d)+c+l.slice(d)},reduce:function(l,c){if(this===null)throw new TypeError("Array.prototype.reduce called on null or undefined");if(typeof c!="function")throw new TypeError(c+" is not a function");var d=Object(l),p=d.length>>>0,m=0,x;if(arguments.length===3)x=arguments[2];else{for(;m<p&&!(m in d);)m++;if(m>=p)throw new TypeError("Reduce of empty array with no initial value");x=d[m++]}for(;m<p;m++)m in d&&(x=c(x,d[m],m,d));return x},multiplier:function(l){var c=l.toString().split(".");return c.length<2?1:Math.pow(10,c[1].length)},correctionFactor:function(){var l=Array.prototype.slice.call(arguments);return l.reduce(function(c,d){var p=n.multiplier(d);return c>p?c:p},1)},toFixed:function(l,c,d,p){var m=l.toString().split("."),x=c-(p||0),j,S,A,w;return m.length===2?j=Math.min(Math.max(m[1].length,x),c):j=x,A=Math.pow(10,j),w=(d(l+"e+"+j)/A).toFixed(j),p>c-j&&(S=new RegExp("\\.?0{1,"+(p-(c-j))+"}$"),w=w.replace(S,"")),w}},t.options=f,t.formats=i,t.locales=a,t.locale=function(l){return l&&(f.currentLocale=l.toLowerCase()),f.currentLocale},t.localeData=function(l){if(!l)return a[f.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in h)f[l]=h[l]},t.zeroFormat=function(l){f.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){f.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){f.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,d){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=d,d},t.validate=function(l,c){var d,p,m,x,j,S,A,w;if(typeof l!="string"&&(l+="",console.warn&&console.warn("Numeral.js: Value is not string. It has been co-erced to: ",l)),l=l.trim(),l.match(/^\d+$/))return!0;if(l==="")return!1;try{A=t.localeData(c)}catch{A=t.localeData(t.locale())}return m=A.currency.symbol,j=A.abbreviations,d=A.delimiters.decimal,A.delimiters.thousands==="."?p="\\.":p=A.delimiters.thousands,w=l.match(/^[^\d]+/),w!==null&&(l=l.substr(1),w[0]!==m)||(w=l.match(/[^\d]+$/),w!==null&&(l=l.slice(0,-1),w[0]!==j.thousand&&w[0]!==j.million&&w[0]!==j.billion&&w[0]!==j.trillion))?!1:(S=new RegExp(p+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(d),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(S):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(S)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(S)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var d=this._value,p=l||f.defaultFormat,m,x,j;if(c=c||Math.round,d===0&&f.zeroFormat!==null)x=f.zeroFormat;else if(d===null&&f.nullFormat!==null)x=f.nullFormat;else{for(m in i)if(p.match(i[m].regexps.format)){j=i[m].format;break}j=j||t._.numberToFormat,x=j(d,p,c)}return x},value:function(){return this._value},input:function(){return this._input},set:function(l){return this._value=Number(l),this},add:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(p,m,x,j){return p+Math.round(c*m)}return this._value=n.reduce([this._value,l],d,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function d(p,m,x,j){return p-Math.round(c*m)}return this._value=n.reduce([l],d,Math.round(this._value*c))/c,this},multiply:function(l){function c(d,p,m,x){var j=n.correctionFactor(d,p);return Math.round(d*j)*Math.round(p*j)/Math.round(j*j)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(d,p,m,x){var j=n.correctionFactor(d,p);return Math.round(d*j)/Math.round(p*j)}return this._value=n.reduce([this._value,l],c),this},difference:function(l){return Math.abs(t(this._value).subtract(l).value())}},t.register("locale","en",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},ordinal:function(l){var c=l%10;return~~(l%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th"},currency:{symbol:"$"}}),function(){t.register("format","bps",{regexps:{format:/(BPS)/,unformat:/(BPS)/},format:function(l,c,d){var p=t._.includes(c," BPS")?" ":"",m;return l=l*1e4,c=c.replace(/\s?BPS/,""),m=t._.numberToFormat(l,c,d),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"BPS"),m=m.join("")):m=m+p+"BPS",m},unformat:function(l){return+(t._.stringToNumber(l)*1e-4).toFixed(15)}})}(),function(){var l={base:1e3,suffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},c={base:1024,suffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},d=l.suffixes.concat(c.suffixes.filter(function(m){return l.suffixes.indexOf(m)<0})),p=d.join("|");p="("+p.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(p)},format:function(m,x,j){var S,A=t._.includes(x,"ib")?c:l,w=t._.includes(x," b")||t._.includes(x," ib")?" ":"",I,P,D;for(x=x.replace(/\s?i?b/,""),I=0;I<=A.suffixes.length;I++)if(P=Math.pow(A.base,I),D=Math.pow(A.base,I+1),m===null||m===0||m>=P&&m<D){w+=A.suffixes[I],P>0&&(m=m/P);break}return S=t._.numberToFormat(m,x,j),S+w},unformat:function(m){var x=t._.stringToNumber(m),j,S;if(x){for(j=l.suffixes.length-1;j>=0;j--){if(t._.includes(m,l.suffixes[j])){S=Math.pow(l.base,j);break}if(t._.includes(m,c.suffixes[j])){S=Math.pow(c.base,j);break}}x*=S||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,d){var p=t.locales[t.options.currentLocale],m={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,j,S;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,d),l>=0?(m.before=m.before.replace(/[\-\(]/,""),m.after=m.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(m.before,"-")&&!t._.includes(m.before,"(")&&(m.before="-"+m.before),S=0;S<m.before.length;S++)switch(j=m.before[S],j){case"$":x=t._.insert(x,p.currency.symbol,S);break;case" ":x=t._.insert(x," ",S+p.currency.symbol.length-1);break}for(S=m.after.length-1;S>=0;S--)switch(j=m.after[S],j){case"$":x=S===m.after.length-1?x+p.currency.symbol:t._.insert(x,p.currency.symbol,-(m.after.length-(1+S)));break;case" ":x=S===m.after.length-1?x+" ":t._.insert(x," ",-(m.after.length-(1+S)+p.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,d){var p,m=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=m.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),p=t._.numberToFormat(Number(x[0]),c,d),p+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),d=Number(c[0]),p=Number(c[1]);p=t._.includes(l,"e-")?p*=-1:p;function m(x,j,S,A){var w=t._.correctionFactor(x,j),I=x*w*(j*w)/(w*w);return I}return t._.reduce([d,Math.pow(10,p)],m,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,d){var p=t.locales[t.options.currentLocale],m,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=p.ordinal(l),m=t._.numberToFormat(l,c,d),m+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,d){var p=t._.includes(c," %")?" ":"",m;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),m=t._.numberToFormat(l,c,d),t._.includes(m,")")?(m=m.split(""),m.splice(-1,0,p+"%"),m=m.join("")):m=m+p+"%",m},unformat:function(l){var c=t._.stringToNumber(l);return t.options.scalePercentBy100?c*.01:c}})}(),function(){t.register("format","time",{regexps:{format:/(:)/,unformat:/(:)/},format:function(l,c,d){var p=Math.floor(l/60/60),m=Math.floor((l-p*60*60)/60),x=Math.round(l-p*60*60-m*60);return p+":"+(m<10?"0"+m:m)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),d=0;return c.length===3?(d=d+Number(c[0])*60*60,d=d+Number(c[1])*60,d=d+Number(c[2])):c.length===2&&(d=d+Number(c[0])*60,d=d+Number(c[1])),Number(d)}})}(),t})}(Js)),Js.exports}var ud=hd();const Xs=yr(ud),ve=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),et=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),md={_2:{reg:/^\d+(\.\d{1,2})?$/,message:"Only Positive value upto 2 decimals is allowed",roundUpto:et},_3:{reg:/^\d+(\.\d{1,3})?$/,message:"Only Positive value upto 3 decimals is allowed",roundUpto:ve}},Xn=(e,t)=>{const n=md[`_${Wt[t].minimumFractionDigits??2}`].roundUpto;return n(e)},en=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 Na(e,t){switch(t){case"BHD":case"KWD":case"OMR":return Xs(e).format("0,00.000");default:return Xs(e).format("0,00.00")}}function fd(e){const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"],n=["Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],r=["","Ten","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];function i(p){if(p<10)return t[p];if(p<20)return n[p-11];{const m=p%10,x=Math.floor(p/10);return`${r[x]}${m?" "+t[m]:""}`}}function a(p){var m=p.toString(),x,j,S,A,w,I,P,D,R,q,se,J,ce="and";if(m=m.replace(/[, ]/g,""),parseInt(m)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],j=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],S=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],A=m.length,I=[];A>0;)w=A,I.push(m.slice(A=Math.max(0,A-3),w));if(P=I.length,P>S.length)return"";for(J=[],q=0;q<P;q++)D=parseInt(I[q]),D&&(R=I[q].split("").reverse().map(parseFloat),R[1]===1&&(R[0]+=10),(se=S[q])&&J.push(se),(se=x[R[0]])&&J.push(se),(se=j[R[1]])&&J.push(se),(R[0]||R[1])&&(R[2]||q+1>P)&&J.push(ce),(se=x[R[2]])&&J.push(se+" Hundred"));return J.reverse().join(" ")}const[h,f]=e.toString().split("."),o=a(parseInt(h,10)),l=i(parseInt(f,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const oe=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${Xn(e||0,t)}`:`${Wt[t].symbol} ${Xn(e||0,t)}`},U=(e,t)=>{var n;return((n=Wt[t])==null?void 0:n.displayType)=="code"?`${t} ${Na(e||0,t)}`:`${Wt[t].symbol} ${Na(e||0,t)}`},er=()=>{var e="Unknown OS";return navigator.userAgent.indexOf("Win")!=-1&&(e="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(e="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(e="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(e="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(e="iOS"),e},pd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),tr=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(h=>{var f;(f=h.discounts)==null||f.forEach(o=>{if(o.type){let l=`${o[t]}`;o.type==="DISCOUNT_ITEMS"&&i&&(l=`${o[t]}::${o.discountType}::${o.discountValue}`),r[l]?r[l].discountAmt+=o.discountAmt:r[l]={type:o.type,discountType:o.discountType,discountValue:o.discountValue,discountAmt:pd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},sr=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(h=>{const f=`${h[t]}`;n[f]?(n[f].amt+=h.amt,n[f].taxAmt+=h.taxAmt):n[f]={amt:h.amt,chargeType:h.chargeType?h.chargeType:h.type,defaultSelcted:h.defaultSelcted,rate:h.rate,tax:h.tax,taxAmt:h.taxAmt,name:h.name,type:h.type}})}),Object.values(n)},nr=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"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function yd(e,t,n,r,i){const a=fs("1",e),h=fs("2",t),f=fs("3",n),o=fs("4",r),l=fs("5",i);var c=Buffer.concat([a,h,f,o,l]);return c.toString("base64")}const gd=e=>({Station:"Station",Chef:"Chef",Area:"Areas",Waiter:"Waiter",Captain:"Captain",Table:"Table",KOT:"KOT",Table_View:"Table View",Manage_Dine_In:"Manage Dine-In",Counter:"Counter"}),xd=e=>{let t;return e!=null&&e.length?t=JSON.parse(JSON.stringify(e)):t=[{internalName:"CASH",displayName:"Cash",paymentState:"PAID_OFFLINE"},{internalName:"CREDIT_CARD",displayName:"Credit Card",paymentState:"PAID_ONLINE"},{internalName:"DEBIT_CARD",displayName:"Debit Card",paymentState:"PAID_ONLINE"},{internalName:"UPI",displayName:"UPI",paymentState:"PAID_ONLINE"}],t},ps=er(),Nd=e=>{let t=e||0;var n=Math.floor(t/60),r=`${n} min`,i=parseInt(r);if(i>60){var a=Math.floor(t/3600),h=Math.floor(t%3600/60),f=`${a} hr ${h} min`;return f}else return r},jd=(e,t)=>{let n=new Array,r={WRITE_OFF:"WRITE_OFF",CASH_CARD:"CASH_CARD"};const i=[...t,{internalName:"swiggy",displayName:"Swiggy"},{internalName:"zomato",displayName:"Zomato"}],a=ms(i,"internalName");let h;for(let f in e.paymentModes)!r[f]&&e.paymentModes[f]&&(h=a[f],n.push({displayName:h?h.displayName:Ke(f.replace("_"," ")),value:et(e.paymentModes[f])}));return n},vd=(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 i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var h=i.toDataURL("image/png");t(h)},r.onerror=i=>{t(null)}}catch{t(null)}})}const tn=(e,t,n)=>{if(e&&e.length>0)if(t!=null&&t.name){let r=[];return e.map(i=>{i.serverName&&i.serverName.includes(t==null?void 0:t.name)&&r.push({...i,value:i[n]})}),r}else return e;else return!0},rr=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},ar=(e,t)=>{var c,d,p,m;let n,r,i,a,h;const f={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let x=0;x<e.length;x++)if(n=e[x],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],h=0;h<n.addons.length;h++)a=n.addons[h],a.serviceRate&&i.push(a);else i=n.addons;if(o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,f[r]){if(f[r].qty+=n.qty,f[r].sub_total+=n.sub_total,(d=f[r].addons)!=null&&d.length&&((p=n.addons)!=null&&p.length)){const j=ms(n.addons,"serviceId"),S=[];let A;for(let w=0;w<f[r].addons.length;w++)a=f[r].addons[w],(m=j[a.serviceId])!=null&&m.serviceId&&(A=j[a.serviceId],a.sub_total+=A.sub_total??0),S.push(a);f[r].addons=S}}else f[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(f)},ir=e=>{var f;let t,n,r,i,a={},h=0;for(let o=0;o<e.length;o++)if(t=e[o],(f=t.taxation)!=null&&f.length)for(n=0;n<t.taxation.length;n++)r=t.taxation[n],i=`${r.tax}::${r.taxType??"GST"}`,a[i]?(a[i].taxableAmt=a[i].taxableAmt+(r.taxableAmt??0),a[i].taxAmt=a[i].taxAmt+(r.taxAmt??0),h+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),h+=r.taxAmt);return{obj:Object.values(a),sum:h}},lr=(e,t,n)=>{var a,h,f,o;let r=n.occupiedServer,i;try{i=r?JSON.parse(r):void 0}catch(l){console.error("Failed to parse serverData:",l),i=void 0}if(t.type=="BILL"||t.type=="AGGREGATOR_BILL")return tn((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=tn((h=t.siteSetting)==null?void 0:h.packagingSlipPrinters,i,"value");if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}else{if(t.type=="ITEMWISE_SALES_COUNTER"||t.type=="PRINT_DASHBOARD"||t.type=="COUNTER_OPERATION"||t.type=="CARD_RECHARGE_DETAILS"||t.type==="ORDER_AGGREGATED_PRINT")return tn((f=t.siteSetting)==null?void 0:f.billPrinters,i,"value");{let l=tn((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ps=="Android OS"){let c=l&&l.length>0?l.findIndex(d=>d.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(d=>d.value==e):-1;return c!=-1?[l[c]]:null}}}},_d=(e,t,n={})=>{var A;const{usersObj:r,stationList:i}=n;let a={},h,f;const{cancelledKOT:o,onlyCancelledItems:l,kotStatus:c="KOT_GENERATED"}=n,d=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((A=e.customFeilds)!=null&&A.length){let w=_t(e.customFeilds,"INSTRUCTION","customType");w!=null&&w.customValue&&(f=[{customName:w.customName,customValue:w.customValue}])}e.orderList.filter(w=>{h=w.services.sort(I=>I.status==="CANCELLED"?-1:0),h.forEach((I,P)=>{var G,K,B;let D=I.station?I.station.split("::"):"",R=D&&D.length>1?D[1]:D[0],q=e.tableNo?e.tableNo.split("::"):null,se=q&&q.length>0?q[0]:e.orderFrom,J=e.tableName?e.tableName:e.tableNo?se:e.orderFrom,ce;(G=r==null?void 0:r[w.createdBy])!=null&&G.name&&(ce=r[w.createdBy].name);let Te=!1;(o||R&&I.status==c)&&(Te=!0),Te&&or(R,i)&&(a[R]||(a[R]={},a[R].station=R,a[R].services=[],a[R].tableName=J,a[R].customerName=e.name==t.companyName?null:e.name,a[R].time=E().format("DD-MM-YYYY hh:mm a"),a[R].type=e.orderFrom,a[R].subOrderFrom=e.subOrderFrom,a[R].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:w.subOrderId,a[R].orderId=new Set([a[R].orderId]),a[R].instruction=e.instruction,a[R].orderSource=e.orderSource,a[R].deliveryTimestamp=e.deliveryTimestamp?E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,a[R].aggregatorOrderId=e.externalOrderId,a[R].otp=e.otp,a[R].totalQty=0,a[R].tokenId=e.tokenId,a[R].kotId=I.kotId?new Set([I.kotId]):null,a[R].waiterName=e.waiterName,a[R].duplicate=o,a[R].createdBy=ce,a[R].zomatoInstant=d,f&&(a[R].customFields=f),l&&(a[R].onlyCancelledItems=l),e.preparationTime&&(a[R].prepareBy=E().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),a[R]?(a[R].services.push({serviceName:I.serviceName,qty:I.qty,instruction:I.isUrgent&&I.instruction?`(URGENT -${I.instruction})`:I.instruction?`(${I.instruction})`:I.isUrgent?"(URGENT)":"",subOrderId:w.subOrderId,isUrgent:I.isUrgent,index:P,status:I.status,addons:I.addons}),a[R].totalQty+=ve(I.qty),(K=a[R].kotId)==null||K.add(I.kotId),e.externalOrderId||e.offlineOrderId||(B=a[R].orderId)==null||B.add(w.subOrderId)):(a[R]=[],a[R].services.push({serviceName:I.serviceName,qty:I.qty,instruction:I.instruction?I.instruction:"",subOrderId:w.subOrderId,index:P,status:I.status}),a[R].totalQty+=ve(I.qty)))})});let p={},m="2INCH";er();let x,j=[],S={};for(const w in a)if(Object.hasOwnProperty.call(a,w)){const I=a[w];try{t.printers&&t.printers.map(P=>{P.label.toUpperCase()==I.station.toUpperCase()&&(x=ps=="Android OS"?P:P.value??void 0,m=P.paperSize?P.paperSize:t.printerSize,j.push({printer:x,paperSize:m}))}),j.length==0&&j.push({printer:x,paperSize:t.printerSize||m});for(let P=0;P<I.services.length;P++){let D=I.services[P],R=e.orderList.find(se=>se.subOrderId==D.subOrderId),q=p[D.subOrderId];R&&(q?q.services.push(R.services[D.index]):(p[D.subOrderId]={},p[D.subOrderId].subOrderId=R.subOrderId,p[D.subOrderId].services=[R.services[D.index]]))}}catch(P){console.log(P)}S[w]=j,j=[],x=null}for(const w in p)Object.hasOwnProperty.call(p,w)&&p[w];return{obj:a,paperSize:m,printer:x,printersMap:S}},bd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let h="2INCH",f,o=[],l,c;const d=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let p=_t(e.customFeilds,"INSTRUCTION","customType");p!=null&&p.customValue&&(c=[{customName:p.customName,customValue:p.customValue}])}for(let p=0;p<t.packagingSlipPrinters.length;p++)if(l=t.packagingSlipPrinters[p],l.label==e.subOrderFrom&&(f=ps=="Android OS"?l:l.value??void 0,h=l.paperSize?l.paperSize:h,l.paperSize)){let m,x,j,S,A,w={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:E().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:d},I={},P=!1,D,R=0;for(e.preparationTime&&(w.prepareBy=E().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(w.customFields=c),j=0;j<e.orderList.length;j++)for(m=e.orderList[j],S=0;S<m.services.length;S++)x=m.services[S],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},P=!1,x.status===r&&((a=l.stations)!=null&&a.length?(D=od(l.stations),D[x.station]&&(P=!0)):P=!0),P&&x.kotId&&x.station&&(A=x.station.split("::")[1],R+=x.qty,I[`${A}/${x.kotId}`]?I[`${A}/${x.kotId}`].push(x):I[`${A}/${x.kotId}`]=[x]);Object.keys(I).length&&(w.services=I,w.totalQty=et(R),o.push({printer:f,paperSize:h,obj:w}))}return{printers:o}}catch(h){console.log(h)}},Sd=(e,t,n={})=>{let r={};if(n.action==="SWITCH_TABLE")e.orderList.forEach(o=>{o.services.forEach(l=>{var c;if((l.status==="KOT_GENERATED"||l.status==="IN_PROCESS")&&l.station){let d=(c=l.station.split("::"))==null?void 0:c[1];d&&or(d,n.stationList)&&(r[d]?r[d].activeKots[l.kotId]=l.kotId:r[d]={from:[n.from],to:[n.to],station:d,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,d,p={},m=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],m.push(o.tableNo),c=0;c<o.ids.length;c++)d=o.ids[c],p[d]=d;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],p[o.id]&&o.orderList.forEach(j=>{j.services.forEach(S=>{var A;if((S.status==="KOT_GENERATED"||S.status==="IN_PROCESS")&&S.station){let w=(A=S.station.split("::"))==null?void 0:A[1];w&&or(w,n.stationList)&&(r[w]?r[w].activeKots[S.kotId]=S.kotId:r[w]={from:m,to:[n.to],station:w,activeKots:{[S.kotId]:S.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:S.id})}})})}let i="2INCH",a,h=[],f={};for(const o in r)if(Object.hasOwnProperty.call(r,o)){const l=r[o];try{t.printers&&t.printers.map(c=>{c.label.toUpperCase()==l.station.toUpperCase()&&(a=c.value?ps=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,h.push({printer:a,paperSize:i}))}),h.length==0&&h.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}f[o]=h,h=[],a=null}return{obj:r,paperSize:i,printersMap:f}},Td=(e,t)=>{var I,P;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:h,rangeDate:f}=t,o={},l;const c=!!_t(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:D,...R}=i;i={...R,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let d=c&&(n==null?void 0:n.length)&&n.some(D=>D.slugName==="online-menu")&&e.isAggregatorEnabled==!0,p=d?r.aggregator_collection:void 0,m=d?r.zomato_collection:void 0,x=d?r.swiggy_collection:void 0,j=c?Nd(r.avgTableTime):void 0;l={};let S=0;if(r!=null&&r.menuWiseSales){const D=r.menuWiseSales;for(const R in D)R.endsWith("collection")?l[ts(R)]=et(D[R]):l[ts(R)]=D[R]}if(r.swiggy_aggregator&&(l.Swiggy=r.swiggy_aggregator,l.Swiggy_collection=r.swiggy_collection),r.zomato_aggregator&&(l.Zomato=r.zomato_aggregator,l.Zomato_collection=r.zomato_collection),r.itemTypeList&&((I=Object.keys(r.itemTypeList))!=null&&I.length))for(let D in r.itemTypeList)S+=r.itemTypeList[D];let A=h;return f.toDate!==f.fromDate&&(A=`${nr(f.fromDate)} - ${nr(f.toDate)}`),{salesCollection:c?{...r,totalCollection:et(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:p,zomato_aggregator_collection:m,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:jd(i,e.paymentModes),totalCollection:et(i.totalCollection),averageCollection:{avgTableTime:j,avgorderValue:vd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((P=a.DEBIT)!=null&&P.total)?et(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?et(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?et(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:A,id:Math.random(),otherFields:{salesCollection:i.salesCollection?et(i.salesCollection):0,outstandingAmt:i.outstandingAmt,totalDiscountAmt:r.totalDiscountAmt,discountList:r.discountList,totalOtherCharges:r.totalOtherCharges,otherChargesList:r.otherChargesList,totalTax:r.totalTax,taxList:r.taxList,totalItemType:S,itemTypeList:r.itemTypeList}}},wd=(e,t,n={})=>new Promise(async(r,i)=>{var d,p,m;const{invoiceFormat:a,userData:h}=n;let f,o,l=[],c;try{if((d=e.appliedDiscounts)!=null&&d.length){c=0;for(let K=0;K<e.appliedDiscounts.length;K++)f=e.appliedDiscounts[K],c+=f.discountAmt}const x=_t(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((p=e.customFeilds)!=null&&p.length){const K=_t(e.customFeilds,"INSTRUCTION","customType");K!=null&&K.customValue&&(l=[{customName:K.customName,customValue:K.customValue}])}f={};let j=(m=t==null?void 0:t.footerAddress)!=null&&m.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",S=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",A=t.footerAddress.city?t.footerAddress.city:"",w=t.footerAddress.zip?t.footerAddress.zip:"",I=(j!=""?j+",":"")+(S!=""?S+",":"")+(A!=""?A+",":"")+(w!=""?w+",":""),P=t.gstNo,D={companyName:t.companyName,companyAddress:I,companyContact:t.contactNumber,companyEmail:t.contactEmail},q={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?E.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},se={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},J=en(t.curr),ce={...e,companyInfo:D,orderInfo:q,customerInfo:se,gst:P,curr:J},Te=null,G=null;a.companyLogo&&(Te=await zt(`https://${a.companyLogo.bucket}.s3.amazonaws.com/${a.companyLogo.key}`)),a.qrcode&&(G=await zt(`https://${a.qrcode.bucket}.s3.amazonaws.com/${a.qrcode.key}`)),e.orderList.filter(K=>{K.services.forEach(async(B,me)=>{var st,nt;let $="kitchen",Q=e.tableName?e.tableName:e.orderFrom;$&&(f[$]||(f[$]={},f[$].station=$,f[$].services=[],f[$].tableName=Q,f[$].customerName=e.name,f[$].time=E.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),f[$].type=e.orderFrom,f[$].orderId=e.orderId,f[$].instruction=e.instruction,f[$].totalQty=0,f[$].tokenId=e.tokenId,f[$].orderSource=e.orderSource,f[$].aggregatorOrderId=e.externalOrderId,f[$].otp=e.otp,f[$].paymentState=e.paymentState,f[$].discountAmt=c,f[$].otherCharges=e.otherCharges,f[$].taxAmt=e.taxAmt,f[$].customFeilds=l,f[$].curr=t.curr??"INR",f[$].zomatoInstant=x),f[$]?(o={serviceName:B.serviceName,qty:B.qty,instruction:B.isUrgent&&B.instruction?`(URGENT -${B.instruction})`:B.instruction?`(${B.instruction})`:B.isUrgent?"(URGENT)":"",subOrderId:K.subOrderId,isUrgent:B.isUrgent,index:me},(st=B.addons)!=null&&st.length&&(o.addons=B.addons),f[$].services.push(o),f[$].totalQty+=B.qty):(f[$]=[],f[$].services.push({serviceName:B.serviceName,qty:B.qty,instruction:B.instruction?B.instruction:"",subOrderId:K.subOrderId,index:me}),f[$].totalQty+=B.qty),f[$]={...f[$],companyInfo:D,orderInfo:q,customerInfo:se,gst:P,curr:J},f[$].domain=a.siteURL,f[$].paymentMethods=a.paymentMode?ce.paymentMethods:null,f[$].companyInfo.companyName=a.companyName,f[$].companyInfo.companyEmail=a.email,f[$].companyInfo.companyAddress=a.address,f[$].companyInfo.companyContact=a.mobile,f[$].tokenId=a.token?ce.tokenId:null,a.isPayQR&&a.upiId&&a.upiId!==""&&(ce.upiId=a.upiId),f[$].gstNo=a.gst?ce.gst:null,f[$].footerMessage=a.footerMessage,f[$].orderFrom=(nt=e.subOrderFrom)==null?void 0:nt.toUpperCase(),f[$].fssai=t.fssai,f[$].vatNo=t.vatNo,f[$].printOperatorInfo=a.printOperatorInfo===null||a.printOperatorInfo===!0,f[$].disabledPoweredBy=t.disabledPoweredBy===!0,f[$].printTime=E().format("DD-MM-YYYY hh:mm A"),f[$].printedBy=h.userRole=="admin"?"Admin":h.name,e.deliveryTimestamp&&(f[$].deliveryTimestamp=E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),f[$].itemInstructionOnBill=a.itemInstructionOnBill,f[$]={...f[$],companyLogo:Te,companyQrCode:G})})});for(const K in f)if(Object.hasOwnProperty.call(f,K)){const B=f[K];try{let me=t.printerSize??"2inch";r(new Object({obj:new Object({...B,paperSize:me}),orderList:e.orderList}));return}catch(me){console.log(me)}}}catch(x){console.log("err::",x)}}),Id=async e=>{let t=[];for(let d=0;d<e.length;d++)for(let p=0;p<e[d].orderList.length;p++)t.push(e[d].orderList[p]);let n=[];if(t.length>0)for(let d=0;d<t.length;d++)for(let p=0;p<t[d].services.length;p++)t[d].services[p].status!="CANCELLED"&&t[d].services[p].status!="RETURNED"&&t[d].services[p].status!="SHIFTED"&&n.push(t[d].services[p]);let r={},i=[];for(let d=0;d<n.length;d++)if(n[d].addons&&n[d].addons.length>0)for(let p=0;p<n[d].addons.length;p++){let m={...n[d].addons[p]};m.qty=n[d].qty,i.push(m)}n.forEach(d=>{let{attachedCat:p,serviceId:m}=d;r[p]||(r[p]=[]);let x=r[p].findIndex(j=>j.serviceId===m);x!==-1?r[p][x].qty=r[p][x].qty+d.qty:r[p].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedCat,station:d.station})});const a=Object.keys(r).sort(),h={};a.forEach(d=>{h[d]=r[d]});for(let d in h)h[d].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));let f={Category:h},o={};i.forEach(d=>{let{attachedAddonCat:p,serviceId:m}=d;o[p]||(o[p]=[]);let x=o[p].findIndex(j=>j.serviceId===m);x!==-1?o[p][x].qty=o[p][x].qty+d.qty:o[p].push({serviceName:d.serviceName,qty:d.qty,status:d.status,serviceId:d.serviceId,attachedCat:d.attachedAddonCat,station:d.station})});const l=Object.keys(o).sort(),c={};l.forEach(d=>{c[d]=o[d]});for(let d in c)c[d].sort((p,m)=>p.serviceName.localeCompare(m.serviceName));return f.Addon=c,f},ja={"Andaman and Nicobar Islands":"UTGST",Chandigarh:"UTGST","Dadra and Nagar Haveli and Daman and Diu":"UTGST","Jammu & Kashmir":"UTGST",Ladakh:"UTGST",Lakshadweep:"UTGST",Puducherry:"UTGST"},va=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ja[t]?ja[t]:"SGST"},_a=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c,d,p;try{const{invoiceFormat:m,custName:x,custMobile:j,custAddress:S,userData:A={}}=n,{itemList:w}=e;let I=A==null?void 0:A.userRole;if(A.userRole=="admin"?I="ADMIN":I=A==null?void 0:A.name,!(w!=null&&w.length))return;let P=t.printerSize,D=lr(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});P=D?(h=D[0])!=null&&h.paperSize?(f=D[0])==null?void 0:f.paperSize:P||"2INCH":P;let R=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",q=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",se=t.footerAddress.city?t.footerAddress.city:"",J=t.footerAddress.zip?t.footerAddress.zip:"",ce=(R!=""?R+",":"")+(q!=""?q+",":"")+(se!=""?se+",":"")+(J!=""?J+",":""),Te=t.gstNo,G={companyName:t.companyName,companyAddress:ce,companyContact:t.contactNumber,companyEmail:t.contactEmail},B={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?E.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},me={custName:m&&m.custName?x==t.companyName?null:x:null,custAddress:m&&m.custAddress&&S||null,custContact:m&&m.custMobile?j:null,custEmail:"ajaybaglane7@gmail.com"},$=en(t.curr),Q={...e,companyInfo:G,orderInfo:B,customerInfo:me,gst:Te,curr:$};if(m){if(Q.domain=m.siteURL,Q.paymentMethods=m.paymentMode?Q.paymentMethods:null,Q.companyInfo.companyName=m.companyName,Q.companyInfo.companyEmail=m.email,Q.companyInfo.companyAddress=m.address,Q.companyInfo.companyContact=m.mobile,Q.customerInfo.custName=m.custName?x:null,Q.tokenId=m.token?Q.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(Q.upiId=m.upiId),Q.gstNo=m.gst?Q.gst:null,Q.footerMessage=m.footerMessage,Q.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),Q.fssai=t.fssai,Q.vatNo=t.vatNo,Q.taxLabel=va(t),Q.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,Q.disabledPoweredBy=t.disabledPoweredBy===!0,Q.printTime=E().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(Q.deliveryTimestamp=E.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),Q.itemInstructionOnBill=m.itemInstructionOnBill,Q.printHSNCodeOnBill=m.printHSNCodeOnBill,Q.noOfInvoice=m.noOfInvoice,Q.printby=I,Q.newFormat=!0,!(m.itemInstructionOnBill||m.printHSNCodeOnBill)&&((l=Q.itemList)!=null&&l.length)){let Z;for(let be=0;be<Q.itemList.length;be++)Z=Q.itemList[be],Z.instruction&&delete Z.instruction,Z.hsnCode&&delete Z.hsnCode}t.enabledOutstandingOnPay&&((c=e.custoutStandingData)!=null&&c.balanceAmt)&&(Q.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let st=[];if((d=e.customFeilds)!=null&&d.length){let Z;for(let be=0;be<e.customFeilds.length;be++)Z=e.customFeilds[be],Z!=null&&Z.customValue&&((p=Z.availability)!=null&&p.includes("BILL"))&&st.push({customName:Z.customName,customValue:Z.customValue});Q.customFields=st}let nt=null,Ot=null;m.companyLogo&&(nt=await zt(`https://${m.companyLogo.bucket}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(Ot=await zt(`https://${m.qrcode.bucket}.s3.amazonaws.com/${m.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let rt={};(function(){let Z,be,yt=0,g=0,u=0,C=0,N=0,O=0,F=0,T=0,k=[],H=[],fe=0,Ae;if(P==="A4"||P==="A5"){for(be=0;be<w.length;be++)Z=w[be],g+=Z.sub_total,u+=Z.afterdiscAmt,C+=Z.afterdiscAmt+(Z.total_charges??0),yt+=Z.afterdiscAmt+(Z.total_charges??0),fe+=Z.qty;let Le=tr(w,"discountName",{separateItemsDisc:!0});const Pe=rr(Le);let{obj:Me,sum:Ue}=ir(w);rt={itemList:ar(w,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Pe,charges:sr(w,"name"),taxation:Me,subTotal:ve(g),afterDisc:ve(u),afterCharges:ve(C),total:ve(yt+Ue),qty:fe}}else{for(be=0;be<w.length;be++)Z=w[be],Z.taxType==="VAT"?(H.push(Z),T+=Z.sub_total,O+=Z.afterdiscAmt,N+=Z.afterdiscAmt+(Z.total_charges??0),F+=Z.afterdiscAmt+(Z.total_charges??0)):(k.push(Z),g+=Z.sub_total,u+=Z.afterdiscAmt,C+=Z.afterdiscAmt+(Z.total_charges??0),yt+=Z.afterdiscAmt+(Z.total_charges??0));if(k.length){let Le=tr(k,"discountName",{separateItemsDisc:!0});const Pe=rr(Le);let{obj:Me,sum:Ue}=ir(k);rt.GST={itemList:ar(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Pe,charges:sr(k,"name"),taxation:Me,subTotal:ve(g),afterDisc:ve(u),afterCharges:ve(C),total:ve(yt+Ue)}}if(H.length){let Le=tr(H,"discountName",{separateItemsDisc:!0});const Pe=rr(Le);let{obj:Me,sum:Ue}=ir(H);rt.VAT={itemList:ar(H,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Pe,charges:sr(H,"name"),taxation:Me,subTotal:ve(T),afterDisc:ve(O),afterCharges:ve(N),total:ve(F+Ue)}}}})(),Q.distributedData=rt;let Mt={obj:Q,companyLogo:nt,companyQrCode:Ot,paperSize:t.printerSize,Name:a};r(Mt)}}catch(m){console.log("err",m),i(m)}}),Cd=(e,t,n={})=>new Promise(async(r,i)=>{var h,f,o,l,c;try{const{invoiceFormat:d,custName:p,custMobile:m,custAddress:x,orderData:j}=n;let S=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",A=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",w=t.footerAddress.city?t.footerAddress.city:"",I=t.footerAddress.zip?t.footerAddress.zip:"",P=(S!=""?S+",":"")+(A!=""?A+",":"")+(w!=""?w+",":"")+(I!=""?I+",":""),D=t.gstNo,R={companyName:t.companyName,companyAddress:P,companyContact:t.contactNumber,companyEmail:t.contactEmail},se={orderStatus:"COMPLETED",orderDate:j&&j.timestamp?E.unix(j.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:j&&j.orderId?j.orderId:null,timestamp:j.timestamp},J={custName:d&&d.custName?p==t.companyName?null:p:null,custAddress:d&&d.custAddress&&x||null,custContact:d&&d.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},ce=en(t.curr),Te="",G={...e,companyInfo:R,orderInfo:se,customerInfo:J,gst:D,curr:ce};if(d){if(G.domain=d.siteURL,G.paymentMethods=d.paymentMode?G.paymentMethods:null,G.companyInfo.companyName=d.companyName,G.companyInfo.companyEmail=d.email,G.companyInfo.companyAddress=d.address,G.companyInfo.companyContact=d.mobile,G.customerInfo.custName=d.custName?p:null,G.tokenId=d.token?G.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(G.upiId=d.upiId),G.gstNo=d.gst?G.gst:null,G.footerMessage=d.footerMessage,G.orderFrom=(h=j.subOrderFrom)==null?void 0:h.toUpperCase(),G.fssai=t.fssai,G.vatNo=t.vatNo,G.taxLabel=va(t),G.printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,G.disabledPoweredBy=t.disabledPoweredBy===!0,G.printTime=E().format("DD-MM-YYYY hh:mm A"),j.deliveryTimestamp&&(G.deliveryTimestamp=E.unix(j.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),G.itemInstructionOnBill=d.itemInstructionOnBill,G.printHSNCodeOnBill=d.printHSNCodeOnBill,G.noOfInvoice=d.noOfInvoice,G.area=j.area,G.captainName=j.captainName,!(d.itemInstructionOnBill||d.printHSNCodeOnBill)&&((f=G.itemList)!=null&&f.length)){let B;for(let me=0;me<G.itemList.length;me++)B=G.itemList[me],B.instruction&&delete B.instruction,B.hsnCode&&delete B.hsnCode}t.enabledOutstandingOnPay&&((o=e.custoutStandingData)!=null&&o.balanceAmt)&&(G.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let K=[];if((l=j.customFeilds)!=null&&l.length){let B;for(let me=0;me<j.customFeilds.length;me++)B=j.customFeilds[me],B!=null&&B.customValue&&((c=B.availability)!=null&&c.includes("BILL"))&&K.push({customName:B.customName,customValue:B.customValue});G.customFields=K}if(t&&t.isOld&&t.isOld==!0){let B=null,me=null;d.companyLogo&&(B=await zt(`https://${d.companyLogo.bucket}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(me=await zt(`https://${d.qrcode.bucket}.s3.amazonaws.com/${d.qrcode.key}`));var a="Unknown OS";navigator.userAgent.indexOf("Win")!=-1&&(a="Windows OS"),navigator.userAgent.indexOf("Mac")!=-1&&(a="Macintosh"),navigator.userAgent.indexOf("Linux")!=-1&&(a="Linux OS"),navigator.userAgent.indexOf("Android")!=-1&&(a="Android OS"),navigator.userAgent.indexOf("like Mac")!=-1&&(a="iOS");let $={obj:G,companyLogo:B,companyQrCode:me,paperSize:t.printerSize,Name:a};r($)}}}catch(d){console.log("err",d)}}),Od=(e,t)=>new Promise(async(n,r)=>{var I;let i;(I=t.siteLogo)!=null&&I.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",h=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",f=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(h!=""?h+",":"")+(f!=""?f+",":"")+(o!=""?o+",":""),c=[],d,p=0,m=0,x=0,j=[],S,A;const w=ms(t.paymentModes??defaultPaymentModes,"internalName");for(let P=0;P<e.length;P++)for(d=e[P],c.push({date:d.date,orderId:d.orderId,finalAmount:d.finalAmount}),p+=d.finalAmount,m+=d.paidAmt,x+=d.balanceAmt,S=0;S<d.orderTransactions.length;S++)A=d.orderTransactions[S],A.paidAmt&&j.push({date:E.unix(A.createdAt).format("DD-MM-YYYY"),paymentMode:w[A.paymentMode].displayName,amount:ve(A.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:p,totalPaid:m,totalPayable:x,paperSize:t.printerSize,curr:en(t.curr),transactions:j})}),Md=e=>new Promise(async(t,n)=>{let r={...e};r.orderObj=JSON.parse(e.orderObj),r.settingData=JSON.parse(e.settingData),r.invoiceFormat=JSON.parse(e.invoiceFormat),r.orderData=JSON.parse(e.orderObj);let i;r.newFormat?i=await _a({...r.orderObj,itemList:r.orderObj.orderList},r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress}):i=await Cd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),t(i)}),ba=e=>{let t=new Array;for(const n in e)if(Object.hasOwnProperty.call(e,n)){const r=`${n}::${e[n].orderId}::${Math.random()}`,i=e[n];i.newId=r,t.push(i)}return t},or=(e,t)=>{var r,i;if(!(t!=null&&t.length))return!0;let n=t.findIndex(a=>a.typeValue=="station::"+e);return((r=t[n])==null?void 0:r.printKot)==null?!0:(i=t[n])==null?void 0:i.printKot};function Ad(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}const Ed=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function bt(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let Gt=null;function Sa(e={}){return Gt||(e.includeStyleProperties?(Gt=e.includeStyleProperties,Gt):(Gt=bt(window.getComputedStyle(document.documentElement)),Gt))}function sn(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function Rd(e){const t=sn(e,"border-left-width"),n=sn(e,"border-right-width");return e.clientWidth+t+n}function kd(e){const t=sn(e,"border-top-width"),n=sn(e,"border-bottom-width");return e.clientHeight+t+n}function Ta(e,t={}){const n=t.width||Rd(e),r=t.height||kd(e);return{width:n,height:r}}function Ld(){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 Ye=16384;function Pd(e){(e.width>Ye||e.height>Ye)&&(e.width>Ye&&e.height>Ye?e.width>e.height?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye):e.width>Ye?(e.height*=Ye/e.width,e.width=Ye):(e.width*=Ye/e.height,e.height=Ye))}function nn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function Fd(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Dd(e,t,n){const r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),i.appendChild(a),a.appendChild(e),Fd(i)}const ke=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||ke(n,t)};function Yd(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Ud(e,t){return Sa(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function $d(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Yd(n):Ud(n,r);return document.createTextNode(`${i}{${a}}`)}function wa(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const h=Ed();try{t.className=`${t.className} ${h}`}catch{return}const f=document.createElement("style");f.appendChild($d(h,n,i,r)),t.appendChild(f)}function Hd(e,t,n){wa(e,t,":before",n),wa(e,t,":after",n)}const Ia="application/font-woff",Ca="image/jpeg",Bd={woff:Ia,woff2:Ia,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ca,jpeg:Ca,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Wd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function cr(e){const t=Wd(e).toLowerCase();return Bd[t]||""}function zd(e){return e.split(/,/)[1]}function dr(e){return e.search(/^(data:)/)!==-1}function Gd(e,t){return`data:${t};base64,${e}`}async function Oa(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const i=await r.blob();return new Promise((a,h)=>{const f=new FileReader;f.onerror=h,f.onloadend=()=>{try{a(n({res:r,result:f.result}))}catch(o){h(o)}},f.readAsDataURL(i)})}const hr={};function Vd(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function ur(e,t,n){const r=Vd(e,t,n.includeQueryParams);if(hr[r]!=null)return hr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Oa(e,n.fetchRequestInit,({res:h,result:f})=>(t||(t=h.headers.get("Content-Type")||""),zd(f)));i=Gd(a,t)}catch(a){i=n.imagePlaceholder||"";let h=`Failed to fetch resource: ${e}`;a&&(h=typeof a=="string"?a:a.message),h&&console.warn(h)}return hr[r]=i,i}async function qd(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):nn(t)}async function Kd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),h=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,h==null||h.drawImage(e,0,0,a.width,a.height);const f=a.toDataURL();return nn(f)}const n=e.poster,r=cr(n),i=await ur(n,r,t);return nn(i)}async function Qd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await rn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Zd(e,t){return ke(e,HTMLCanvasElement)?qd(e):ke(e,HTMLVideoElement)?Kd(e,t):ke(e,HTMLIFrameElement)?Qd(e,t):e.cloneNode(Ma(e))}const Jd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ma=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Xd(e,t,n){var r,i;if(Ma(t))return t;let a=[];return Jd(e)&&e.assignedNodes?a=bt(e.assignedNodes()):ke(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=bt(e.contentDocument.body.childNodes):a=bt(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||ke(e,HTMLVideoElement)||await a.reduce((h,f)=>h.then(()=>rn(f,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function eh(e,t,n){const r=t.style;if(!r)return;const i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):Sa(n).forEach(a=>{let h=i.getPropertyValue(a);a==="font-size"&&h.endsWith("px")&&(h=`${Math.floor(parseFloat(h.substring(0,h.length-2)))-.1}px`),ke(e,HTMLIFrameElement)&&a==="display"&&h==="inline"&&(h="block"),a==="d"&&t.getAttribute("d")&&(h=`path(${t.getAttribute("d")})`),r.setProperty(a,h,i.getPropertyPriority(a))})}function th(e,t){ke(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),ke(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function sh(e,t){if(ke(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function nh(e,t,n){return ke(t,Element)&&(eh(e,t,n),Hd(e,t,n),th(e,t),sh(e,t)),t}async function rh(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let a=0;a<n.length;a++){const f=n[a].getAttribute("xlink:href");if(f){const o=e.querySelector(f),l=document.querySelector(f);!o&&l&&!r[f]&&(r[f]=await rn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",h=document.createElementNS(a,"svg");h.setAttribute("xmlns",a),h.style.position="absolute",h.style.width="0",h.style.height="0",h.style.overflow="hidden",h.style.display="none";const f=document.createElementNS(a,"defs");h.appendChild(f);for(let o=0;o<i.length;o++)f.appendChild(i[o]);e.appendChild(h)}return e}async function rn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Zd(r,t)).then(r=>Xd(e,r,t)).then(r=>nh(e,r,t)).then(r=>rh(r,t))}const Aa=/url\((['"]?)([^'"]+?)\1\)/g,ah=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ih=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function lh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function oh(e){const t=[];return e.replace(Aa,(n,r,i)=>(t.push(i),n)),t.filter(n=>!dr(n))}async function ch(e,t,n,r,i){try{const a=n?Ad(t,n):t,h=cr(t);let f;return i||(f=await ur(a,h,r)),e.replace(lh(t),`$1${f}$3`)}catch{}return e}function dh(e,{preferredFontFormat:t}){return t?e.replace(ih,n=>{for(;;){const[r,,i]=ah.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ea(e){return e.search(Aa)!==-1}async function Ra(e,t,n){if(!Ea(e))return e;const r=dh(e,n);return oh(r).reduce((a,h)=>a.then(f=>ch(f,h,t,n)),Promise.resolve(r))}async function Vt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Ra(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function hh(e,t){await Vt("background",e,t)||await Vt("background-image",e,t),await Vt("mask",e,t)||await Vt("-webkit-mask",e,t)||await Vt("mask-image",e,t)||await Vt("-webkit-mask-image",e,t)}async function uh(e,t){const n=ke(e,HTMLImageElement);if(!(n&&!dr(e.src))&&!(ke(e,SVGImageElement)&&!dr(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await ur(r,cr(r),t);await new Promise((a,h)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){h(l)}}:h;const f=e;f.decode&&(f.decode=a),f.loading==="lazy"&&(f.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function mh(e,t){const r=bt(e.childNodes).map(i=>ka(i,t));await Promise.all(r).then(()=>e)}async function ka(e,t){ke(e,Element)&&(await hh(e,t),await uh(e,t),await mh(e,t))}function fh(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}const La={};async function Pa(e){let t=La[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},La[e]=t,t}async function Fa(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async h=>{let f=h.replace(r,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),Oa(f,t.fetchRequestInit,({result:o})=>(n=n.replace(h,`url(${o})`),[h,o]))});return Promise.all(a).then(()=>n)}function Da(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const o=i.exec(r);if(o===null)break;t.push(o[0])}r=r.replace(i,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,h="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(h,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=f.exec(r),o===null)break;a.lastIndex=f.lastIndex}else f.lastIndex=a.lastIndex;t.push(o[0])}return t}async function ph(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach((a,h)=>{if(a.type===CSSRule.IMPORT_RULE){let f=h+1;const o=a.href,l=Pa(o).then(c=>Fa(c,t)).then(c=>Da(c).forEach(d=>{try{i.insertRule(d,d.startsWith("@import")?f+=1:i.cssRules.length)}catch(p){console.error("Error inserting rule from remote css",{rule:d,error:p})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const h=e.find(f=>f.href==null)||document.styleSheets[0];i.href!=null&&r.push(Pa(i.href).then(f=>Fa(f,t)).then(f=>Da(f).forEach(o=>{h.insertRule(o,h.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{bt(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function yh(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ea(t.style.getPropertyValue("src")))}async function gh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=bt(e.ownerDocument.styleSheets),r=await ph(n,t);return yh(r)}function Ya(e){return e.trim().replace(/["']/g,"")}function xh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(Ya(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function Nh(e,t){const n=await gh(e,t),r=xh(e);return(await Promise.all(n.filter(a=>r.has(Ya(a.style.fontFamily))).map(a=>{const h=a.parentStyleSheet?a.parentStyleSheet.href:null;return Ra(a.cssText,h,t)}))).join(`
46
+ `)}async function jh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Nh(e,t);if(n){const r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function Ua(e,t={}){const{width:n,height:r}=Ta(e,t),i=await rn(e,t,!0);return await jh(i,t),await ka(i,t),fh(i,t),await Dd(i,n,r)}async function vh(e,t={}){const{width:n,height:r}=Ta(e,t),i=await Ua(e,t),a=await nn(i),h=document.createElement("canvas"),f=h.getContext("2d"),o=t.pixelRatio||Ld(),l=t.canvasWidth||n,c=t.canvasHeight||r;return h.width=l*o,h.height=c*o,t.skipAutoScale||Pd(h),h.style.width=`${l}`,h.style.height=`${c}`,t.backgroundColor&&(f.fillStyle=t.backgroundColor,f.fillRect(0,0,h.width,h.height)),f.drawImage(a,0,0,h.width,h.height),h}async function _h(e,t={}){return(await vh(e,t)).toDataURL("image/jpeg",t.quality||1)}var bh=Object.defineProperty,an=Object.getOwnPropertySymbols,$a=Object.prototype.hasOwnProperty,Ha=Object.prototype.propertyIsEnumerable,Ba=(e,t,n)=>t in e?bh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ys=(e,t)=>{for(var n in t||(t={}))$a.call(t,n)&&Ba(e,n,t[n]);if(an)for(var n of an(t))Ha.call(t,n)&&Ba(e,n,t[n]);return e},mr=(e,t)=>{var n={};for(var r in e)$a.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&an)for(var r of an(e))t.indexOf(r)<0&&Ha.call(e,r)&&(n[r]=e[r]);return n};/**
47
47
  * @license QR Code generator library (TypeScript)
48
48
  * Copyright (c) Project Nayuki.
49
49
  * SPDX-License-Identifier: MIT
50
- */var Ot;(e=>{const t=class{constructor(o,l,c,d){if(this.version=o,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let p=[];for(let x=0;x<this.size;x++)p.push(!1);for(let x=0;x<this.size;x++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const m=this.addEccAndInterleave(c);if(this.drawCodewords(m),d==-1){let x=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const b=this.getPenaltyScore();b<x&&(d=v,x=b),this.applyMask(v)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(o,l){const c=e.QrSegment.makeSegments(o);return t.encodeSegments(c,l)}static encodeBinary(o,l){const c=e.QrSegment.makeBytes(o);return t.encodeSegments([c],l)}static encodeSegments(o,l,c=1,d=40,p=-1,m=!0){if(!(t.MIN_VERSION<=c&&c<=d&&d<=t.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let x,v;for(x=c;;x++){const M=t.getNumDataCodewords(x,l)*8,P=f.getTotalBits(o,x);if(P<=M){v=P;break}if(x>=d)throw new RangeError("Data too long")}for(const M of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])m&&v<=t.getNumDataCodewords(x,M)*8&&(l=M);let b=[];for(const M of o){r(M.mode.modeBits,4,b),r(M.numChars,M.mode.numCharCountBits(x),b);for(const P of M.getData())b.push(P)}a(b.length==v);const w=t.getNumDataCodewords(x,l)*8;a(b.length<=w),r(0,Math.min(4,w-b.length),b),r(0,(8-b.length%8)%8,b),a(b.length%8==0);for(let M=236;b.length<w;M^=253)r(M,8,b);let S=[];for(;S.length*8<b.length;)S.push(0);return b.forEach((M,P)=>S[P>>>3]|=M<<7-(P&7)),new t(x,l,S,p)}getModule(o,l){return 0<=o&&o<this.size&&0<=l&&l<this.size&&this.modules[l][o]}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 o=this.getAlignmentPatternPositions(),l=o.length;for(let c=0;c<l;c++)for(let d=0;d<l;d++)c==0&&d==0||c==0&&d==l-1||c==l-1&&d==0||this.drawAlignmentPattern(o[c],o[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(l<<10|c)^21522;a(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,i(d,p));this.setFunctionModule(8,7,i(d,6)),this.setFunctionModule(8,8,i(d,7)),this.setFunctionModule(7,8,i(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,i(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,i(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,i(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let c=0;c<12;c++)o=o<<1^(o>>>11)*7973;const l=this.version<<12|o;a(l>>>18==0);for(let c=0;c<18;c++){const d=i(l,c),p=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(p,m,d),this.setFunctionModule(m,p,d)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),m=o+d,x=l+c;0<=m&&m<this.size&&0<=x&&x<this.size&&this.setFunctionModule(m,x,p!=2&&p!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(o+d,l+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(o,l,c){this.modules[l][o]=c,this.isFunction[l][o]=!0}addEccAndInterleave(o){const l=this.version,c=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const d=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],p=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],m=Math.floor(t.getNumRawDataModules(l)/8),x=d-m%d,v=Math.floor(m/d);let b=[];const w=t.reedSolomonComputeDivisor(p);for(let M=0,P=0;M<d;M++){let O=o.slice(P,P+v-p+(M<x?0:1));P+=O.length;const z=t.reedSolomonComputeRemainder(O,w);M<x&&O.push(0),b.push(O.concat(z))}let S=[];for(let M=0;M<b[0].length;M++)b.forEach((P,O)=>{(M!=v-p||O>=x)&&S.push(P[M])});return a(S.length==m),S}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const m=c-p,v=(c+1&2)==0?this.size-1-d:d;!this.isFunction[v][m]&&l<o.length*8&&(this.modules[v][m]=i(o[l>>>3],7-(l&7)),l++)}}a(l==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let d;switch(o){case 0:d=(c+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+l)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:d=c*l%2+c*l%3==0;break;case 6:d=(c*l%2+c*l%3)%2==0;break;case 7:d=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&d&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let p=0;p<this.size;p++){let m=!1,x=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[p][b]==m?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),m||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),m=this.modules[p][b],x=1);o+=this.finderPenaltyTerminateAndCount(m,x,v)*t.PENALTY_N3}for(let p=0;p<this.size;p++){let m=!1,x=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][p]==m?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,v),m||(o+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),m=this.modules[b][p],x=1);o+=this.finderPenaltyTerminateAndCount(m,x,v)*t.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let m=0;m<this.size-1;m++){const x=this.modules[p][m];x==this.modules[p][m+1]&&x==this.modules[p+1][m]&&x==this.modules[p+1][m+1]&&(o+=t.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((m,x)=>m+(x?1:0),l);const c=this.size*this.size,d=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=d&&d<=9),o+=d*t.PENALTY_N4,a(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let c=[6];for(let d=this.size-7;c.length<o;d-=l)c.splice(1,0,d);return c}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*o+128)*o+64;if(o>=2){const c=Math.floor(o/7)+2;l-=(25*c-10)*c-55,o>=7&&(l-=36)}return a(208<=l&&l<=29648),l}static getNumDataCodewords(o,l){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<o-1;d++)l.push(0);l.push(1);let c=1;for(let d=0;d<o;d++){for(let p=0;p<l.length;p++)l[p]=t.reedSolomonMultiply(l[p],c),p+1<l.length&&(l[p]^=l[p+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(d=>0);for(const d of o){const p=d^c.shift();c.push(0),l.forEach((m,x)=>c[x]^=t.reedSolomonMultiply(m,p))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(l>>>d&1)*o;return a(c>>>8==0),c}finderPenaltyCountPatterns(o){const l=o[1];a(l<=this.size*3);const c=l>0&&o[2]==l&&o[3]==l*3&&o[4]==l&&o[5]==l;return(c&&o[0]>=l*4&&o[6]>=l?1:0)+(c&&o[6]>=l*4&&o[0]>=l?1:0)}finderPenaltyTerminateAndCount(o,l,c){return o&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(o,l){l[0]==0&&(o+=this.size),l.pop(),l.unshift(o)}};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(o,l,c){if(l<0||l>31||o>>>l)throw new RangeError("Value out of range");for(let d=l-1;d>=0;d--)c.push(o>>>d&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const h=class{constructor(o,l,c){if(this.mode=o,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(o){let l=[];for(const c of o)r(c,8,l);return new h(h.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!h.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const d=Math.min(o.length-c,3);r(parseInt(o.substr(c,d),10),d*3+1,l),c+=d}return new h(h.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!h.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=o.length;c+=2){let d=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;d+=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(d,11,l)}return c<o.length&&r(h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new h(h.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:h.isNumeric(o)?[h.makeNumeric(o)]:h.isAlphanumeric(o)?[h.makeAlphanumeric(o)]:[h.makeBytes(h.toUtf8ByteArray(o))]}static makeEci(o){let l=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)r(o,8,l);else if(o<16384)r(2,2,l),r(o,14,l);else if(o<1e6)r(6,3,l),r(o,21,l);else throw new RangeError("ECI assignment value out of range");return new h(h.Mode.ECI,0,l)}static isNumeric(o){return h.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return h.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const d of o){const p=d.mode.numCharCountBits(l);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(o){o=encodeURI(o);let l=[];for(let c=0;c<o.length;c++)o.charAt(c)!="%"?l.push(o.charCodeAt(c)):(l.push(parseInt(o.substr(c+1,2),16)),c+=2);return l}};let f=h;f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=f})(Ot||(Ot={})),(e=>{(t=>{const n=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};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(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+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;/**
50
+ */var Ct;(e=>{const t=class{constructor(o,l,c,d){if(this.version=o,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let p=[];for(let x=0;x<this.size;x++)p.push(!1);for(let x=0;x<this.size;x++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const m=this.addEccAndInterleave(c);if(this.drawCodewords(m),d==-1){let x=1e9;for(let j=0;j<8;j++){this.applyMask(j),this.drawFormatBits(j);const S=this.getPenaltyScore();S<x&&(d=j,x=S),this.applyMask(j)}}a(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(o,l){const c=e.QrSegment.makeSegments(o);return t.encodeSegments(c,l)}static encodeBinary(o,l){const c=e.QrSegment.makeBytes(o);return t.encodeSegments([c],l)}static encodeSegments(o,l,c=1,d=40,p=-1,m=!0){if(!(t.MIN_VERSION<=c&&c<=d&&d<=t.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let x,j;for(x=c;;x++){const I=t.getNumDataCodewords(x,l)*8,P=f.getTotalBits(o,x);if(P<=I){j=P;break}if(x>=d)throw new RangeError("Data too long")}for(const I of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])m&&j<=t.getNumDataCodewords(x,I)*8&&(l=I);let S=[];for(const I of o){r(I.mode.modeBits,4,S),r(I.numChars,I.mode.numCharCountBits(x),S);for(const P of I.getData())S.push(P)}a(S.length==j);const A=t.getNumDataCodewords(x,l)*8;a(S.length<=A),r(0,Math.min(4,A-S.length),S),r(0,(8-S.length%8)%8,S),a(S.length%8==0);for(let I=236;S.length<A;I^=253)r(I,8,S);let w=[];for(;w.length*8<S.length;)w.push(0);return S.forEach((I,P)=>w[P>>>3]|=I<<7-(P&7)),new t(x,l,w,p)}getModule(o,l){return 0<=o&&o<this.size&&0<=l&&l<this.size&&this.modules[l][o]}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 o=this.getAlignmentPatternPositions(),l=o.length;for(let c=0;c<l;c++)for(let d=0;d<l;d++)c==0&&d==0||c==0&&d==l-1||c==l-1&&d==0||this.drawAlignmentPattern(o[c],o[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let p=0;p<10;p++)c=c<<1^(c>>>9)*1335;const d=(l<<10|c)^21522;a(d>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,i(d,p));this.setFunctionModule(8,7,i(d,6)),this.setFunctionModule(8,8,i(d,7)),this.setFunctionModule(7,8,i(d,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,i(d,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,i(d,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,i(d,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let o=this.version;for(let c=0;c<12;c++)o=o<<1^(o>>>11)*7973;const l=this.version<<12|o;a(l>>>18==0);for(let c=0;c<18;c++){const d=i(l,c),p=this.size-11+c%3,m=Math.floor(c/3);this.setFunctionModule(p,m,d),this.setFunctionModule(m,p,d)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){const p=Math.max(Math.abs(d),Math.abs(c)),m=o+d,x=l+c;0<=m&&m<this.size&&0<=x&&x<this.size&&this.setFunctionModule(m,x,p!=2&&p!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(o+d,l+c,Math.max(Math.abs(d),Math.abs(c))!=1)}setFunctionModule(o,l,c){this.modules[l][o]=c,this.isFunction[l][o]=!0}addEccAndInterleave(o){const l=this.version,c=this.errorCorrectionLevel;if(o.length!=t.getNumDataCodewords(l,c))throw new RangeError("Invalid argument");const d=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],p=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],m=Math.floor(t.getNumRawDataModules(l)/8),x=d-m%d,j=Math.floor(m/d);let S=[];const A=t.reedSolomonComputeDivisor(p);for(let I=0,P=0;I<d;I++){let D=o.slice(P,P+j-p+(I<x?0:1));P+=D.length;const R=t.reedSolomonComputeRemainder(D,A);I<x&&D.push(0),S.push(D.concat(R))}let w=[];for(let I=0;I<S[0].length;I++)S.forEach((P,D)=>{(I!=j-p||D>=x)&&w.push(P[I])});return a(w.length==m),w}drawCodewords(o){if(o.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let d=0;d<this.size;d++)for(let p=0;p<2;p++){const m=c-p,j=(c+1&2)==0?this.size-1-d:d;!this.isFunction[j][m]&&l<o.length*8&&(this.modules[j][m]=i(o[l>>>3],7-(l&7)),l++)}}a(l==o.length*8)}applyMask(o){if(o<0||o>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let c=0;c<this.size;c++){let d;switch(o){case 0:d=(c+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=c%3==0;break;case 3:d=(c+l)%3==0;break;case 4:d=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:d=c*l%2+c*l%3==0;break;case 6:d=(c*l%2+c*l%3)%2==0;break;case 7:d=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&d&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let p=0;p<this.size;p++){let m=!1,x=0,j=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[p][S]==m?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,j),m||(o+=this.finderPenaltyCountPatterns(j)*t.PENALTY_N3),m=this.modules[p][S],x=1);o+=this.finderPenaltyTerminateAndCount(m,x,j)*t.PENALTY_N3}for(let p=0;p<this.size;p++){let m=!1,x=0,j=[0,0,0,0,0,0,0];for(let S=0;S<this.size;S++)this.modules[S][p]==m?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,j),m||(o+=this.finderPenaltyCountPatterns(j)*t.PENALTY_N3),m=this.modules[S][p],x=1);o+=this.finderPenaltyTerminateAndCount(m,x,j)*t.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let m=0;m<this.size-1;m++){const x=this.modules[p][m];x==this.modules[p][m+1]&&x==this.modules[p+1][m]&&x==this.modules[p+1][m+1]&&(o+=t.PENALTY_N2)}let l=0;for(const p of this.modules)l=p.reduce((m,x)=>m+(x?1:0),l);const c=this.size*this.size,d=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=d&&d<=9),o+=d*t.PENALTY_N4,a(0<=o&&o<=2568888),o}getAlignmentPatternPositions(){if(this.version==1)return[];{const o=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(o*2-2))*2;let c=[6];for(let d=this.size-7;c.length<o;d-=l)c.splice(1,0,d);return c}}static getNumRawDataModules(o){if(o<t.MIN_VERSION||o>t.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*o+128)*o+64;if(o>=2){const c=Math.floor(o/7)+2;l-=(25*c-10)*c-55,o>=7&&(l-=36)}return a(208<=l&&l<=29648),l}static getNumDataCodewords(o,l){return Math.floor(t.getNumRawDataModules(o)/8)-t.ECC_CODEWORDS_PER_BLOCK[l.ordinal][o]*t.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][o]}static reedSolomonComputeDivisor(o){if(o<1||o>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<o-1;d++)l.push(0);l.push(1);let c=1;for(let d=0;d<o;d++){for(let p=0;p<l.length;p++)l[p]=t.reedSolomonMultiply(l[p],c),p+1<l.length&&(l[p]^=l[p+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(d=>0);for(const d of o){const p=d^c.shift();c.push(0),l.forEach((m,x)=>c[x]^=t.reedSolomonMultiply(m,p))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(l>>>d&1)*o;return a(c>>>8==0),c}finderPenaltyCountPatterns(o){const l=o[1];a(l<=this.size*3);const c=l>0&&o[2]==l&&o[3]==l*3&&o[4]==l&&o[5]==l;return(c&&o[0]>=l*4&&o[6]>=l?1:0)+(c&&o[6]>=l*4&&o[0]>=l?1:0)}finderPenaltyTerminateAndCount(o,l,c){return o&&(this.finderPenaltyAddHistory(l,c),l=0),l+=this.size,this.finderPenaltyAddHistory(l,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(o,l){l[0]==0&&(o+=this.size),l.pop(),l.unshift(o)}};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(o,l,c){if(l<0||l>31||o>>>l)throw new RangeError("Value out of range");for(let d=l-1;d>=0;d--)c.push(o>>>d&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const h=class{constructor(o,l,c){if(this.mode=o,this.numChars=l,this.bitData=c,l<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(o){let l=[];for(const c of o)r(c,8,l);return new h(h.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!h.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const d=Math.min(o.length-c,3);r(parseInt(o.substr(c,d),10),d*3+1,l),c+=d}return new h(h.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!h.isAlphanumeric(o))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],c;for(c=0;c+2<=o.length;c+=2){let d=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;d+=h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(d,11,l)}return c<o.length&&r(h.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new h(h.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:h.isNumeric(o)?[h.makeNumeric(o)]:h.isAlphanumeric(o)?[h.makeAlphanumeric(o)]:[h.makeBytes(h.toUtf8ByteArray(o))]}static makeEci(o){let l=[];if(o<0)throw new RangeError("ECI assignment value out of range");if(o<128)r(o,8,l);else if(o<16384)r(2,2,l),r(o,14,l);else if(o<1e6)r(6,3,l),r(o,21,l);else throw new RangeError("ECI assignment value out of range");return new h(h.Mode.ECI,0,l)}static isNumeric(o){return h.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return h.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const d of o){const p=d.mode.numCharCountBits(l);if(d.numChars>=1<<p)return 1/0;c+=4+p+d.bitData.length}return c}static toUtf8ByteArray(o){o=encodeURI(o);let l=[];for(let c=0;c<o.length;c++)o.charAt(c)!="%"?l.push(o.charCodeAt(c)):(l.push(parseInt(o.substr(c+1,2),16)),c+=2);return l}};let f=h;f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=f})(Ct||(Ct={})),(e=>{(t=>{const n=class{constructor(i,a){this.ordinal=i,this.formatBits=a}};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={}))})(Ct||(Ct={})),(e=>{(t=>{const n=class{constructor(i,a){this.modeBits=i,this.numBitsCharCount=a}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+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={}))})(Ct||(Ct={}));var qt=Ct;/**
51
51
  * @license qrcode.react
52
52
  * Copyright (c) Paul O'Shannessy
53
53
  * SPDX-License-Identifier: ISC
54
- */var Ba={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},Wa=128,za="L",Ga="#FFFFFF",Va="#000000",qa=!1,mr=4,Sh=.1;function Ka(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Qa(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Za(e,t,n,r){if(r==null)return null;const i=n?mr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(d),v=Math.ceil(o+c-m),b=Math.ceil(l+d-x);p={x:m,y:x,w:v,h:b}}return{x:c,y:d,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,style:o,imageSettings:l}=t,c=ur(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,p=je.useRef(null),m=je.useRef(null),[x,v]=je.useState(!1);je.useEffect(()=>{if(p.current!=null){const S=p.current,M=S.getContext("2d");if(!M)return;let P=qt.QrCode.encodeText(n,Ba[i]).getModules();const O=f?mr:0,z=P.length+O*2,K=Za(P,r,f,l),se=m.current,Q=K!=null&&se!==null&&se.complete&&se.naturalHeight!==0&&se.naturalWidth!==0;Q&&K.excavation!=null&&(P=Qa(P,K.excavation));const ie=window.devicePixelRatio||1;S.height=S.width=r*ie;const Ce=r/z*ie;M.scale(Ce,Ce),M.fillStyle=a,M.fillRect(0,0,z,z),M.fillStyle=h,Th?M.fill(new Path2D(Ka(P,O))):P.forEach(function(W,q){W.forEach(function(B,fe){B&&M.fillRect(fe+O,q+O,1,1)})}),Q&&M.drawImage(se,K.x+O,K.y+O,K.w,K.h)}}),je.useEffect(()=>{v(!1)},[d]);const b=ys({height:r,width:r},o);let w=null;return d!=null&&(w=je.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),je.createElement(je.Fragment,null,je.createElement("canvas",ys({style:b,height:r,width:r,ref:p},c)),w)}function Ih(e){const t=e,{value:n,size:r=Wa,level:i=za,bgColor:a=Ga,fgColor:h=Va,includeMargin:f=qa,imageSettings:o}=t,l=ur(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Ba[i]).getModules();const d=f?mr:0,p=c.length+d*2,m=Za(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Qa(c,m.excavation)),x=je.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+d,y:m.y+d,preserveAspectRatio:"none"}));const v=Ka(c,d);return je.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),je.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),je.createElement("path",{fill:h,d:v,shapeRendering:"crispEdges"}),x)}var Ja=e=>{const t=e,{renderAs:n}=t,r=ur(t,["renderAs"]);return n==="svg"?je.createElement(Ih,ys({},r)):je.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},k=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var xs=Xn(),Te="normal-class";(xs=="Android OS"||xs==="iOS")&&(Te="bold-class");const st=e=>{var at,At,J,be,gt;const t=e.additionalActions??{},n=je.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((At=(at=e.value)==null?void 0:at.settingData)==null?void 0:At.curr)??((J=e.settingData)==null?void 0:J.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ir(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(gt=c[0])==null?void 0:gt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(g){const u=Math.abs(parseFloat(g));return m(u)}function m(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}je.useEffect(()=>{w()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let I=await _h(n.current);if(I){const j=await b(I);g(j)}}else{let I=await Ya(n.current);I&&g(I)}}),v=()=>new Promise(async(g,u)=>{const I=await x();g(I)}),b=g=>new Promise((u,I)=>{let j=new Image;j.src=g,j.onload=()=>{let C=document.createElement("canvas");const F=600,T=j.height;let R=j.width,$=j.height;R>$?R>F&&($*=F/R,R=F):$>T&&(R*=T/$,$=T),C.width=R,C.height=$,C.getContext("2d").drawImage(j,0,0,R,$),u(C.toDataURL())}}),w=async()=>{if(n&&n.current){const g=await v();e.onImageGenerated(g)}},S=g=>{let u=new Array;for(const I in g.menusCollection)I.endsWith("collection")||(g.menusCollection[`${I}_collection`]||g.menusCollection[I])&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${I.replace("_"," ")}(${g.menusCollection[I]}):`}),s.jsx("span",{children:oe(g.menusCollection[`${I}_collection`],o)}),s.jsx("span",{children:m(gs(g.salesCollection.totalCollection,g.menusCollection[`${I}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.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:oe(g.salesCollection.online_aggregator_collection,o)})]}),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:oe(g.salesCollection.zomato_aggregator_collection,o)})]}),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:oe(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},M=g=>{let u=new Array,I=new Object;for(let j=0;j<g.todayCollection.length;j++)I=g.todayCollection[j],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${I.displayName}:`}),s.jsx("span",{children:oe(I.value,o)}),s.jsx("span",{children:m(gs(g.totalCollection,I.value))+"%"})]}));return u},P=(g,u,I,j,C={})=>{let F=g.includes("upi://");const T=`upi://pay?pa=${g}&pn=${I}&cu=INR&am=${j}&tr=${u}`;return s.jsx(Ja,{value:F?g:T,renderAs:"canvas",size:C.size??250})},O=(g,u)=>{var F,T;let I=0;if((F=u.taxObj)!=null&&F.VAT.length){let R,$,pe;for($=0;$<((T=u.taxObj)==null?void 0:T.VAT.length);$++){R=u.taxObj.VAT[$];for(pe in R)I+=_e(R[pe])}}const j={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:I},C=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Ja,{value:C,renderAs:"canvas",size:250})},z=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:oe(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:oe(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.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:oe(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:oe(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:oe(g.cashCard,o)})]}))),u},K=(g,u)=>{if(u&&u.length){for(let I=0;I<u.length;I++)if(u[I].slugName===g)return u[I]}return!1},se=(g,u)=>{if(u&&u.length){for(let I=0;I<u.length;I++)if(u[I].itemType===g)return u[I]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ie=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Ch[g.discountType]}`,Ce=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const I in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[I]}:`}),s.jsx("span",{children:oe(g[I].total,o)})]})),I&&Object.keys(I).length!==0)for(const j in g[I])j!=="total"&&g[I][j]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Qe(j)}:`}),s.jsx("span",{children:oe(g[I][j],o)})]}))}return u},W=(g,u)=>{let I=!1;g.totalValue&&(I=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(F=>{if(j=g.totalValue[F],F==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.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(T=>{if(T.taxType===F||!T.taxType)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(R=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Qe(R.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(T=>{const R=K(T,g.discArr);if(R&&j.cat[T]!==0&&R.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:u[`disc_${R.serviceName.toLowerCase()}`]??"DISC-"+R.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+R.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.cat[T])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(T=>{const R=se(T,g.itemTypeDiscObj);if(R&&j.itemTypes[T]!==0&&R.itemType&&R.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:u[`disc_${R.itemType.toLowerCase()}`]??"DISC-"+R.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+R.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.itemTypes[T])})]})}):"",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:u[`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+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.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:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[F]&&j?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let R=new Array;for(const $ in T)if(T[$]&&T[$]!=0){let pe=$/2;R.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:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$]/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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$]/2)})]})]}))}return R}):g.taxObj[F].map(T=>{let R=new Array;for(const $ in T)if(T[$]&&T[$]!=0){let pe=$;R.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:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$])})]})}))}return R})}):"",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:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",I&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(F=>{if(j=g.totalValue[F],F==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.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(T=>{if(T.taxType===F)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(R=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Qe(R.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(T=>{const R=K(T,g.discArr);if(R&&j.cat[T]!==0&&R.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:u[`disc_${R.serviceName.toLowerCase()}`]??"DISC-"+R.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+R.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.cat[T])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(T=>{const R=se(T,g.itemTypeDiscObj);if(R&&j.itemTypes[T]!==0&&R.itemType&&R.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:u[`disc_${R.itemType.toLowerCase()}`]??"DISC-"+R.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+R.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.itemTypes[T])})]})}):"",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:u[`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+" "+m(j.segDisc)})]}):"",j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.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:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(T=>s.jsx(s.Fragment,{children:T.taxOnAmount&&T.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:u.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[F]&&j?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let R=new Array;for(const $ in T)if(T[$]&&T[$]!=0){let pe=$/2;R.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:u.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$]/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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$]/2)})]})]}))}return R}):g.taxObj[F].map(T=>{let R=new Array;for(const $ in T)if(T[$]&&T[$]!=0){let pe=$;R.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:u.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[$])})]})}))}return R})}):"",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:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},q=(g,u,{labels:I,doMultipleTax:j,type:C})=>{var T,R,$,pe,Ee,Pe,Fe,Ae,$e,Et,xt;const F=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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:I.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(G=>{var Rt;return s.jsxs("div",{style:G.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[G.status==="RETURNED"?"(R) ":"",G.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:G.serviceRate?p(G.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:G.sub_total?m(G.sub_total):""})]}),G.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",G.hsnCode]}),(Rt=G.addons)!=null&&Rt.length?G.addons.map(it=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Qe(it.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[G.status==="RETURNED"?"-":"",it.qty*G.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:it.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",it.hsnCode]})})]})):"",G.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+G.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname} ${Te}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(T=F.DISCOUNT_ITEMS)!=null&&T.length?F.DISCOUNT_ITEMS.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:ie(G)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.discountAmt)})]})):"",(R=F.CATEGORY_DISCOUNT)!=null&&R.length?F.CATEGORY_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+G.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.discountAmt)})]})):"",($=F.ITEM_DISCOUNT)!=null&&$.length?F.ITEM_DISCOUNT.map(G=>s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${G.discountName.toLowerCase()}`]??"DISC-"+ts(G.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+G.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.discountAmt)})]})):"",(Ee=(pe=F.SEGMENT_DISCOUNT)==null?void 0:pe[0])!=null&&Ee.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${F.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+F.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+F.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Fe=(Pe=F.COUPON_DISCOUNT)==null?void 0:Pe[0])!=null&&Fe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,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:`(${F.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${F.COUPON_DISCOUNT[0].discountValue}${F.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.COUPON_DISCOUNT[0].discountAmt)})]}):"",($e=(Ae=F.ORDER_DISCOUNT)==null?void 0:Ae[0])!=null&&$e.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(F.ORDER_DISCOUNT[0].discountValue)?`@${F.ORDER_DISCOUNT[0].discountValue}${F.ORDER_DISCOUNT[0].discountType=="RELATIVE"||F.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Et=g.charges)!=null&&Et.length?g.charges.map(G=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${G.name.toLowerCase()}`]??G.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.afterCharges)})]}):"",i=="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"})]}):"",(xt=g.taxation)!=null&&xt.length?g.taxation.map(G=>{if(G.taxAmt)return G.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+G.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${Te}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:"@"+G.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(G.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:I.total}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.total)})]}),j?s.jsx(s.Fragment,{children:C==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var F,T;let I=!1;const j=g.distributedData;return g.distributedData&&(I=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((F=j.GST)==null?void 0:F.itemList)&&q(j.GST,g,{labels:u,doMultipleTax:I,type:"GST"}),((T=j.VAT)==null?void 0:T.itemList)&&q(j.VAT,g,{labels:u,doMultipleTax:I,type:"VAT"})]})},fe=g=>{const u=g.services,I=Object.keys(g.services),j=I.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Te}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&I.map((F,T)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[F.toUpperCase(),":"]})}),u[F].map(R=>{var $;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Qe(R.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:R.qty})]}),(($=R.addons)==null?void 0:$.length)&&R.addons.map(pe=>{var Ee;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ee=pe.serviceName)==null?void 0:Ee.toUpperCase())})}),R.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+R.instruction+")"})})]})}),j!==T+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},U=g=>{const u=g.slice(0,-4),I=g.slice(-4);return{firstDigits:u,last4Dgits:I}},Z=(g,u,I,j={})=>{const C=Object.keys(u??{});let F=[],T,R="flex-two-items";if(j.action==="addCharges"&&(R="display-percentage"),g&&C.length){F.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${I.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",I,":"]}),s.jsx("span",{children:oe(g,o)})]})]}));for(let $=0;$<C.length;$++)T=C[$],u[T]&&F.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${R} second-span-right`,children:[s.jsx("span",{children:` -- ${T.replaceAll("_"," ")}:`}),s.jsx("span",{children:oe(u[T],o)}),j.action==="addCharges"?s.jsx("span",{children:m(gs(g,u[T]))+"%"}):""]}));F.push(s.jsx("hr",{}))}return F},nt=g=>{const u=Object.keys(g.Category),I=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"})]})),u.forEach((C,F)=>{const T=g.Category[C];let R=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(C)]}),s.jsxs("section",{className:"products-section",children:[T.forEach($=>{R.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),R,F!=u.length-1&&s.jsx("hr",{})]})]}))}),I.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"})]})),I.forEach((C,F)=>{const T=g.Addon[C];let R=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(C)]}),s.jsxs("section",{className:"products-section",children:[T.forEach($=>{R.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:$.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat($.qty.toFixed(2))})]})}))}),R,F!=I.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},rt=g=>{var I;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((I=g==null?void 0:g.customBillLabels)!=null&&I.length){let j;for(let C=0;C<g.customBillLabels.length;C++)j=g.customBillLabels[C],u[j.defaultName]=j.displayName}return u},Mt=(g,u,I,j)=>{var $,pe,Ee,Pe,Fe,Ae,$e,Et,xt,G,Rt,it,Ns,js,on,vs,_s,cn,dn,hn,un,mn,fn,pn,Kt,bs,Nt,Qt,Zt,Ss,yn,Ts,gn,ws,Is,xn,Nn,Cs,Os;const C=rt(r.customLabelsMap),F=ms(xd(r.paymentModes),"internalName"),T=te=>{var _;return(_=F[te])!=null&&_.displayName?F[te].displayName.toUpperCase():te};if(g==="BILL"){let te;if(l==="A4"||l==="A5"){let _={...u},X=0,me=_.distributedData;const y=me.discounts;te=s.jsx("div",{className:`invoiceContainer main-div ${k[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[_.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:_.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:_.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:I&&s.jsx("img",{src:I,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:[(_.customerInfo.custName||(($=_.customFields)==null?void 0:$.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),_.customerInfo.custName&&_.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custName})}),_.customerInfo.custContact&&_.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custContact})}),_.customerInfo.custAddress&&_.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.customerInfo.custAddress})}),_.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.deliveryTimestamp})}),(pe=_.customFields)!=null&&pe.length?_.customFields.map(N=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[N.customName,": ",N.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:_.companyInfo.companyName})}),_.companyInfo.companyAddress&&_.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyAddress})}),_.companyInfo.companyEmail&&_.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyEmail})}),_.companyInfo.companyContact&&_.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:_.companyInfo.companyContact})}),_.fssai&&_.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.company_FSSAI}:`}}),s.jsx("span",{children:_.fssai})]})}),_.gst&&_.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.company_GST}:`}}),s.jsx("span",{children:_.gst})]})}),_.vatNo&&_.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${C.company_VAT}:`}}),s.jsx("span",{children:_.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:[_.itemList.map(N=>{var ce;let L="",V=[];return X++,V.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:L,children:[s.jsx("td",{className:"text-align-left",children:N.serviceRate?X:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:N.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:N.qty}),s.jsx("td",{className:"text-align-right",children:N.serviceRate?Y(N.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:N.sub_total?Y(N.sub_total,o):""})]}),N.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+N.instruction+")"})]})]})),(ce=N.addons)!=null&&ce.length&&N.addons.map(ue=>{V.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:["+ ",ue.serviceName.toUpperCase()]}),s.jsx("td",{children:ue.qty*N.qty})]}),ue.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+ue.instruction+")"})]})]}))}),V}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${X} Items and ${_e(me.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(xa(_.finalAmount,o).toFixed(tn[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),_.upiId&&u.companyInfo.companyName&&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:P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),_.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:_.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:C.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:Y(me.subTotal,o)})]}),(Ee=y==null?void 0:y.DISCOUNT_ITEMS)!=null&&Ee.length?y.DISCOUNT_ITEMS.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:ie(N)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.discountAmt,o)})]})):"",(Pe=y==null?void 0:y.CATEGORY_DISCOUNT)!=null&&Pe.length?y.CATEGORY_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.discountAmt,o)})]})):"",(Fe=y==null?void 0:y.ITEM_DISCOUNT)!=null&&Fe.length?y.ITEM_DISCOUNT.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${N.discountName.toLowerCase()}`]??"DISC-"+N.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+N.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.discountAmt,o)})]})):"",($e=(Ae=y==null?void 0:y.SEGMENT_DISCOUNT)==null?void 0:Ae[0])!=null&&$e.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",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("td",{className:"text-align-right",width:"50%",children:Y(y.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(xt=(Et=y==null?void 0:y.COUPON_DISCOUNT)==null?void 0:Et[0])!=null&&xt.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:`(${y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${y.COUPON_DISCOUNT[0].discountValue}${y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(y.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Rt=(G=y==null?void 0:y.ORDER_DISCOUNT)==null?void 0:G[0])!=null&&Rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(y.ORDER_DISCOUNT[0].discountValue)?`@${y.ORDER_DISCOUNT[0].discountValue}${y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(y.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(it=me.charges)!=null&&it.length?me.charges.map(N=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${N.name.toLowerCase()}`]??N.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.amt,o)})]})):"",me.subTotal!==me.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(me.afterCharges,o)})]}):"",(Ns=me.taxation)!=null&&Ns.length?me.taxation.map(N=>N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.sgst}}),s.jsx("span",{children:" @"+N.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:" @"+N.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:C.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(_.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.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:C.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y((on=_==null?void 0:_.custoutStandingData)==null?void 0:on.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:C.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(_.grandTotal+((vs=_==null?void 0:_.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",_.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(_.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(N=>{var L;if(N.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`${(L=N.paymentMode)==null?void 0:L.toLowerCase()}`]??T(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),N.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+Y(N.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:Y(N.paidAmt,o)})]})}):"",_.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:Y(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",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 :${_.printby} Printed On: ${_.printTime}`}),_.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else te=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),I&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:I,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!I&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${Te}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),bt(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:C.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(cn=u.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(_=>s.jsx("h4",{className:"left-align-entity",children:_.customName+": "+_.customValue}))]}):"",u.newFormat?B(u,C):W(u,C),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:C.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=u.custoutStandingData)!=null&&hn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount)})]}),(un=u.custoutStandingData)!=null&&un.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+m(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:C.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:C.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(_=>{var X;if(_.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${Te}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`${(X=_.paymentMode)==null?void 0:X.toLowerCase()}`]??T(_.paymentMode)??"CASH"}}),s.jsx("span",{children:_.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:_.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+m(_.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+m(_.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:C.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+(((mn=u==null?void 0:u.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-u.rewardAmt)})]})}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:C.balance_amt}}),s.jsx("h5",{children:u.curr+" "+m(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:C.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),O(r.vatNo,u)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return te}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const te=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,_=u.salesCollection.totalCollection-u.salesCollection.totalTax;var R=E().format("DD/MM/YYYY LT");const X=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${R}`}),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:u.selectedDate})]}),s.jsx("hr",{}),u.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:oe(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.monthTillDateSalesColl.totalDiscountAmt,o)}${X?`(${m(X)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.salesCollection.totalDiscountAmt,o)}${te?`(${m(te)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(_,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Z(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Z(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Z(u.otherFields.totalTax,u.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:oe(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),S(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Z(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.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:oe(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.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:oe(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:oe(u.totalCollection,o)})]}),M(u)]}),z(u.averageCollection),u.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:oe(u.otherFields.salesCollection,o)})]}),u.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:oe(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Ce(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let te;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=U(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),I&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:I,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!I&&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:C.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:C.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:C.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:C.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:C.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",te.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:C.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:C.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.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:C.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:C.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:C.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.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:C.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((pn=a.services)==null?void 0:pn.length)&&a.services.map(X=>{var me;return s.jsxs("div",{style:X.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:X.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:X.qty})]}),((me=X.addons)==null?void 0:me.length)&&X.addons.map(y=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Qe(y.serviceName)})),X.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:X.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:oe(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(X=>{if(X.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:X.name}),s.jsx("h5",{children:a.curr+" "+m(X.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(X=>{let me=new Array;for(const y in X)if(X[y]&&X[y]!=0){let N=y/2;me.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",N]}),s.jsx("h5",{children:a.curr+" "+m(X[y]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",N,"%"]}),s.jsx("h5",{children:a.curr+" "+m(X[y]/2)})]})]}))}return me})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(Kt=a.customFeilds)==null?void 0:Kt.map(X=>s.jsx("h4",{className:"left-align-entity",children:X.customName+": "+X.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let te="";return a.action==="SWITCH_TABLE"?te=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(bs=d.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Nt=a.from)==null?void 0:Nt.map((_,X)=>{var me,y,N;return`${(y=(me=e.tableData[_])==null?void 0:me.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[_])==null?void 0:N.tableName}${X+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:`${(Zt=(Qt=e.tableData[a.to[0]])==null?void 0:Qt.attachedArea)==null?void 0:Zt.toUpperCase()} - ${(Ss=e.tableData[a.to[0]])==null?void 0:Ss.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):te=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 ",(yn=d.Table)==null?void 0:yn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ts=a.from)==null?void 0:Ts.map((_,X)=>{var me,y,N;return`${(y=(me=e.tableData[_])==null?void 0:me.attachedArea)==null?void 0:y.toUpperCase()} - ${(N=e.tableData[_])==null?void 0:N.tableName}${X+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:`${(ws=(gn=e.tableData[a.to[0]])==null?void 0:gn.attachedArea)==null?void 0:ws.toUpperCase()} - ${(Is=e.tableData[a.to[0]])==null?void 0:Is.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),te}else if(g==="COUNTER_OPERATION"){let te;return l=="2INCH"||l=="1.8INCH"?te=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",Y(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",Y(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(_=>{if(_.value>0||_.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",_.displayName," : ",Y(_.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",Y(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(_=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?Y(_.denomination,o):_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",Y(_.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:Y(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",Y(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",Y(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    -",Y(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    +",Y(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   -",Y(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   +",Y(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(_=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?Y(_.denomination,o):_.curr+" "+_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",Y(_.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:Y(a.TotalDenomationsAmount,o)})]})]})}):te=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",Y(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",Y(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(_=>{if(_.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",_.displayName," : ",Y(_.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",Y(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",Y(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",Y(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",Y(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(_=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?Y(_.denomination,o):_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",Y(_.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:Y(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",Y(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",Y(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",Y(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",Y(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",Y(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",Y(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",Y(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",Y(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(_=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?Y(_.denomination,o):_.curr+" "+_.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",_.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",Y(_.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:Y(a.TotalDenomationsAmount,o)})]})]})}),te}else if(g==="ITEMWISE_SALES_COUNTER"){let te,{counterDetails:_}=e.printerDataObject;return te=s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:_.currentDate}),s.jsx("hr",{}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",_.CounterName]}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",_.openedBy]}),_.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",_.loginTime]}),_.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",_.logoutTime]}),_.CounterName&&s.jsx("hr",{}),nt(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${_.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${_.printedOn}`})]})}),te}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:te}=e.printerDataObject;return getRechargeDetails(te)}else if(g==="PACKAGING_SLIP"){let te,_=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(te=U(u.aggregatorOrderId));const X=u.services;for(let y in X)_+=X[y].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),fe(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",_]}),s.jsxs("h5",{children:["TOTAL QTY: ",_e(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(y=>s.jsx("h4",{className:"left-align-entity",children:y.customName+": "+y.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.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:C.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:C.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:C.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:C.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(_=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:sr(_.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:_.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(_.finalAmount)})]})},_.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(Nn=a.transactions)!=null&&Nn.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(_=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:_.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:_.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(_.amount)})]})},_.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let te,_=0,X,me;for(let N=0;N<(((Cs=a.services)==null?void 0:Cs.length)||0);N++)me=a.services[N],me.status==="CANCELLED"&&!a.onlyCancelledItems&&(_+=me.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=U(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",_||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&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.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:`${d.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:`${d.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Te}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${Te}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(N=>(N.status==="CANCELLED"?X=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Qe(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(L=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Qe(L.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}):X=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Qe(N.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:N.qty})]}),N.addons&&N.addons.length&&N.addons.map(L=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Qe(L.serviceName)})),N.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+N.instruction})})]}),s.jsx("div",{children:X}))),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-_)]})]}),(Os=a.customFields)==null?void 0:Os.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:k[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Mt(f,a.obj,a.companyLogo,a.companyQrCode)})})},Oh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);let p=[],m=[];const x=_a(c).flatMap(v=>{var b;return(b=d[v.station])==null?void 0:b.map(w=>new Promise(S=>s.jsx(st,{printerDataObject:{staticDataKOT:v,paperSize:w.paperSize,printer:w.printer},newId:v.newId,value:{settingData:t},onImageGenerated:M=>{p.push({paperSize:w.paperSize,printer:w.printer,image:M,type:"KOT"}),S()},additionalActions:r},v.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(b=>{m.push(new Promise(w=>{x.push(s.jsx(st,{printerDataObject:{staticDataKOT:{obj:b.obj},paperSize:b.paperSize,printer:b.printer,type:"PACKAGING_SLIP"},newId:b.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:b.paperSize,printer:b.printer,image:S,type:"PACKAGING_SLIP"}),w()},additionalActions:r},b.obj.newId))}))})}x.length&&yt("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Mh=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=_a(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(v=>{const b=s.jsx(st,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:w=>{h.push({paperSize:x.paperSize,printer:x.printer,image:w,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),b}))});d.length&&yt("root1",d),await Promise.all(f.map(p=>new Promise(p)))}r(h)}catch(a){i(a)}}),Ah=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(st,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});yt("root1",o)}),n(a)}catch(i){r(i)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(st,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});yt("root1",l)}),r(h)}catch(a){i(a)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await va(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(st,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});yt("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const p=s.jsx(st,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});yt("root1",p)}),i(l)}else i([])}catch(h){a(h)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(st,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});yt("root1",c)}),r(f)}catch(a){i(a)}}),Ph=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=ir(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(st,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});yt("root1",m)}),i(o)}catch(f){a(f)}}),Fh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=od(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(m=>{const x=s.jsx(st,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:d.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});h.push(x)})}}h.length&&yt("root1",h),r(f)}catch(h){i(h)}}),yt=(e,t)=>{const n=document.getElementById(e);n&&ai.createRoot(n).render(t)};Oe.counterDetailsPrint=Lh,Oe.handleAggregatorBillPrint=Eh,Oe.handleBillPrint=Rh,Oe.handleDashboardPrint=Ah,Oe.handleItemWisePrint=kh,Oe.handleKOTPrint=Oh,Oe.handleOldBillPrints=Fh,Oe.handleSummaryPrint=Ph,Oe.handleUpdateTablePrint=Mh,Object.defineProperty(Oe,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,Ga="L",Va="#FFFFFF",qa="#000000",Ka=!1,fr=4,Sh=.1;function Qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Za(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Ja(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(d),j=Math.ceil(o+c-m),S=Math.ceil(l+d-x);p={x:m,y:x,w:j,h:S}}return{x:c,y:d,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,p=Ne.useRef(null),m=Ne.useRef(null),[x,j]=Ne.useState(!1);Ne.useEffect(()=>{if(p.current!=null){const w=p.current,I=w.getContext("2d");if(!I)return;let P=qt.QrCode.encodeText(n,Wa[i]).getModules();const D=f?fr:0,R=P.length+D*2,q=Ja(P,r,f,l),se=m.current,J=q!=null&&se!==null&&se.complete&&se.naturalHeight!==0&&se.naturalWidth!==0;J&&q.excavation!=null&&(P=Za(P,q.excavation));const ce=window.devicePixelRatio||1;w.height=w.width=r*ce;const Te=r/R*ce;I.scale(Te,Te),I.fillStyle=a,I.fillRect(0,0,R,R),I.fillStyle=h,Th?I.fill(new Path2D(Qa(P,D))):P.forEach(function(G,K){G.forEach(function(B,me){B&&I.fillRect(me+D,K+D,1,1)})}),J&&I.drawImage(se,q.x+D,q.y+D,q.w,q.h)}}),Ne.useEffect(()=>{j(!1)},[d]);const S=ys({height:r,width:r},o);let A=null;return d!=null&&(A=Ne.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{j(!0)},ref:m})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ys({style:S,height:r,width:r,ref:p},c)),A)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Wa[i]).getModules();const d=f?fr:0,p=c.length+d*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+d,y:m.y+d,preserveAspectRatio:"none"}));const j=Qa(c,d);return Ne.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:h,d:j,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?Ne.createElement(Ih,ys({},r)):Ne.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},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 xs=er(),_e="normal-class";(xs=="Android OS"||xs==="iOS")&&(_e="bold-class");const tt=e=>{var rt,Mt,Z,be,yt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((Z=e.settingData)==null?void 0:Z.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(yt=c[0])==null?void 0:yt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(g){const u=Math.abs(parseFloat(g));return m(u)}function m(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}Ne.useEffect(()=>{A()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const N=await S(C);g(N)}}else{let C=await Ua(n.current);C&&g(C)}}),j=()=>new Promise(async(g,u)=>{const C=await x();g(C)}),S=g=>new Promise((u,C)=>{let N=new Image;N.src=g,N.onload=()=>{let O=document.createElement("canvas");const F=600,T=N.height;let k=N.width,H=N.height;k>H?k>F&&(H*=F/k,k=F):H>T&&(k*=T/H,H=T),O.width=k,O.height=H,O.getContext("2d").drawImage(N,0,0,k,H),u(O.toDataURL())}}),A=async()=>{if(n&&n.current){const g=await j();e.onImageGenerated(g)}},w=g=>{let u=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&u.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:oe(g.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:m(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.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:oe(g.salesCollection.online_aggregator_collection,o)})]}),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:oe(g.salesCollection.zomato_aggregator_collection,o)})]}),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:oe(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},I=g=>{let u=new Array,C=new Object;for(let N=0;N<g.todayCollection.length;N++)C=g.todayCollection[N],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:oe(C.value,o)}),s.jsx("span",{children:m(gs(g.totalCollection,C.value))+"%"})]}));return u},P=(g,u,C,N,O={})=>{let F=g.includes("upi://");const T=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${N}&tr=${u}`;return s.jsx(Xa,{value:F?g:T,renderAs:"canvas",size:O.size??250})},D=(g,u)=>{var F,T;let C=0;if((F=u.taxObj)!=null&&F.VAT.length){let k,H,fe;for(H=0;H<((T=u.taxObj)==null?void 0:T.VAT.length);H++){k=u.taxObj.VAT[H];for(fe in k)C+=ve(k[fe])}}const N={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:C},O=yd(N.sellerName,N.vatRegistrationNumber,N.invoiceTimestamp,N.invoiceTotal,N.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:O,renderAs:"canvas",size:250})},R=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:oe(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:oe(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.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:oe(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:oe(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:oe(g.cashCard,o)})]}))),u},q=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].slugName===g)return u[C]}return!1},se=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].itemType===g)return u[C]}return!1},J=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ce=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Oh[g.discountType]}`,Te=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${J[C]}:`}),s.jsx("span",{children:oe(g[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const N in g[C])N!=="total"&&g[C][N]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(N)}:`}),s.jsx("span",{children:oe(g[C][N],o)})]}))}return u},G=(g,u)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let N=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(F=>{if(N=g.totalValue[F],F==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.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(T=>{if(T.taxType===F||!T.taxType)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.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:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.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:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.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:u[`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+" "+m(N.segDisc)})]}):"",N&&N.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?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.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"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.gstTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.gstTTL!==N.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[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.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:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.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:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.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(F=>{if(N=g.totalValue[F],F==="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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.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(T=>{if(T.taxType===F)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.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:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.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:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.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:u[`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+" "+m(N.segDisc)})]}):"",N&&N.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?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.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"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:T.taxOnAmount&&T.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:u.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.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:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/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:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.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:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},K=(g,u,{labels:C,doMultipleTax:N,type:O})=>{var T,k,H,fe,Ae,Le,Pe,Me,Ue,At,gt;const F=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[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(V=>{var Et;return s.jsxs("div",{style:V.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[V.status==="RETURNED"?"(R) ":"",V.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:V.serviceRate?p(V.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:V.sub_total?m(V.sub_total):""})]}),V.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",V.hsnCode]}),(Et=V.addons)!=null&&Et.length?V.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",at.qty*V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",V.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+V.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(T=F.DISCOUNT_ITEMS)!=null&&T.length?F.DISCOUNT_ITEMS.map(V=>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_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:ce(V)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(k=F.CATEGORY_DISCOUNT)!=null&&k.length?F.CATEGORY_DISCOUNT.map(V=>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_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(H=F.ITEM_DISCOUNT)!=null&&H.length?F.ITEM_DISCOUNT.map(V=>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_${V.discountName.toLowerCase()}`]??"DISC-"+ts(V.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(Ae=(fe=F.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${F.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+F.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+F.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=F.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.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:`(${F.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${F.COUPON_DISCOUNT[0].discountValue}${F.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Ue=(Me=F.ORDER_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.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:m(F.ORDER_DISCOUNT[0].discountValue)?`@${F.ORDER_DISCOUNT[0].discountValue}${F.ORDER_DISCOUNT[0].discountType=="RELATIVE"||F.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(At=g.charges)!=null&&At.length?g.charges.map(V=>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_${V.name.toLowerCase()}`]??V.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?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:u.curr+" "+m(g.afterCharges)})]}):"",i=="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"})]}):"",(gt=g.taxation)!=null&&gt.length?g.taxation.map(V=>{if(V.taxAmt)return V.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:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.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[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.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:"@"+V.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.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:u.curr+" "+m(g.total)})]}),N?s.jsx(s.Fragment,{children:O==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var F,T;let C=!1;const N=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((F=N.GST)==null?void 0:F.itemList)&&K(N.GST,g,{labels:u,doMultipleTax:C,type:"GST"}),((T=N.VAT)==null?void 0:T.itemList)&&K(N.VAT,g,{labels:u,doMultipleTax:C,type:"VAT"})]})},me=g=>{const u=g.services,C=Object.keys(g.services),N=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[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[N&&C.map((F,T)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[F.toUpperCase(),":"]})}),u[F].map(k=>{var H;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(fe=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=fe.serviceName)==null?void 0:Ae.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),N!==T+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},$=g=>{const u=g.slice(0,-4),C=g.slice(-4);return{firstDigits:u,last4Dgits:C}},Q=(g,u,C,N={})=>{const O=Object.keys(u??{});let F=[],T,k="flex-two-items";if(N.action==="addCharges"&&(k="display-percentage"),g&&O.length){F.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:oe(g,o)})]})]}));for(let H=0;H<O.length;H++)T=O[H],u[T]&&F.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${T.replaceAll("_"," ")}:`}),s.jsx("span",{children:oe(u[T],o)}),N.action==="addCharges"?s.jsx("span",{children:m(gs(g,u[T]))+"%"}):""]}));F.push(s.jsx("hr",{}))}return F},st=g=>{const u=Object.keys(g.Category),C=Object.keys(g.Addon);let N=new Array;return N.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),u.forEach((O,F)=>{const T=g.Category[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=u.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(N.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((O,F)=>{const T=g.Addon[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.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:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),N},nt=g=>{var C;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let N;for(let O=0;O<g.customBillLabels.length;O++)N=g.customBillLabels[O],u[N.defaultName]=N.displayName}return u},Ot=(g,u,C,N)=>{var H,fe,Ae,Le,Pe,Me,Ue,At,gt,V,Et,at,Ns,js,ln,vs,_s,on,cn,dn,hn,un,mn,fn,Kt,bs,xt,Qt,Zt,Ss,pn,Ts,yn,ws,Is,gn,xn,Cs,Os,Nn;const O=nt(r.customLabelsMap),F=ms(xd(r.paymentModes),"internalName"),T=te=>{var b;return(b=F[te])!=null&&b.displayName?F[te].displayName.toUpperCase():te};if(g==="BILL"){let te;if(l==="A4"||l==="A5"){let b={...u},X=0,y=b.distributedData;const _=y.discounts;te=s.jsx("div",{className:`invoiceContainer main-div ${L[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[b.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.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:[(b.customerInfo.custName||((H=b.customFields)==null?void 0:H.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),b.customerInfo.custName&&b.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custName})}),b.customerInfo.custContact&&b.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custContact})}),b.customerInfo.custAddress&&b.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custAddress})}),b.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.deliveryTimestamp})}),(fe=b.customFields)!=null&&fe.length?b.customFields.map(v=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[v.customName,": ",v.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:b.companyInfo.companyName})}),b.companyInfo.companyAddress&&b.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyAddress})}),b.companyInfo.companyEmail&&b.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyEmail})}),b.companyInfo.companyContact&&b.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyContact})}),b.fssai&&b.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_FSSAI}:`}}),s.jsx("span",{children:b.fssai})]})}),b.gst&&b.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_GST}:`}}),s.jsx("span",{children:b.gst})]})}),b.vatNo&&b.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_VAT}:`}}),s.jsx("span",{children:b.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:[b.itemList.map(v=>{var ue;let z="",le=[];return X++,le.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:z,children:[s.jsx("td",{className:"text-align-left",children:v.serviceRate?X:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:v.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:v.qty}),s.jsx("td",{className:"text-align-right",children:v.serviceRate?U(v.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:v.sub_total?U(v.sub_total,o):""})]}),v.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+v.instruction+")"})]})]})),(ue=v.addons)!=null&&ue.length&&v.addons.map(ne=>{le.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:["+ ",ne.serviceName.toUpperCase()]}),s.jsx("td",{children:ne.qty*v.qty})]}),ne.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+ne.instruction+")"})]})]}))}),le}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${X} Items and ${ve(y.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(Xn(b.finalAmount,o).toFixed(Wt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),b.upiId&&u.companyInfo.companyName&&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:P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),b.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:b.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:O.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(y.subTotal,o)})]}),(Ae=_==null?void 0:_.DISCOUNT_ITEMS)!=null&&Ae.length?_.DISCOUNT_ITEMS.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:ce(v)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Le=_==null?void 0:_.CATEGORY_DISCOUNT)!=null&&Le.length?_.CATEGORY_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Pe=_==null?void 0:_.ITEM_DISCOUNT)!=null&&Pe.length?_.ITEM_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Ue=(Me=_==null?void 0:_.SEGMENT_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${_.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+_.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+_.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(gt=(At=_==null?void 0:_.COUPON_DISCOUNT)==null?void 0:At[0])!=null&&gt.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:`(${_.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${_.COUPON_DISCOUNT[0].discountValue}${_.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Et=(V=_==null?void 0:_.ORDER_DISCOUNT)==null?void 0:V[0])!=null&&Et.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(_.ORDER_DISCOUNT[0].discountValue)?`@${_.ORDER_DISCOUNT[0].discountValue}${_.ORDER_DISCOUNT[0].discountType=="RELATIVE"||_.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(at=y.charges)!=null&&at.length?y.charges.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${v.name.toLowerCase()}`]??v.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.amt,o)})]})):"",y.subTotal!==y.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.afterCharges,o)})]}):"",(Ns=y.taxation)!=null&&Ns.length?y.taxation.map(v=>v.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.sgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:" @"+v.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.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:O.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((ln=b==null?void 0:b.custoutStandingData)==null?void 0:ln.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.grandTotal+((vs=b==null?void 0:b.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",b.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(v=>{var z;if(v.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(z=v.paymentMode)==null?void 0:z.toLowerCase()}`]??T(v.paymentMode)??"CASH"}}),s.jsx("span",{children:v.isRefund?"(Refund)":""})]}),v.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(v.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.paidAmt,o)})]})}):"",b.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",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 :${b.printby} Printed On: ${b.printTime}`}),b.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else te=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${_e}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),_t(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:O.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(on=u.customFields)!=null&&on.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(b=>s.jsx("h4",{className:"left-align-entity",children:b.customName+": "+b.customValue}))]}):"",u.newFormat?B(u,O):G(u,O),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(cn=u.custoutStandingData)!=null&&cn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.grand_total}}),s.jsx("h6",{className:`actual-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount)})]}),(hn=u.custoutStandingData)!=null&&hn.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:O.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+m(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(b=>{var X;if(b.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(X=b.paymentMode)==null?void 0:X.toLowerCase()}`]??T(b.paymentMode)??"CASH"}}),s.jsx("span",{children:b.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:b.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+m(b.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+m(b.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+(((un=u==null?void 0:u.custoutStandingData)==null?void 0:un.balanceAmt)||0)-u.rewardAmt)})]})}):"",Ch((mn=u.convertedCurrValue)==null?void 0:mn.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:`(${U(u.convertedCurrValue.value,u.convertedCurrValue.curr)})`})]}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:O.balance_amt}}),s.jsx("h5",{children:u.curr+" "+m(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:O.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),D(r.vatNo,u)]}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return te}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const te=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,b=u.salesCollection.totalCollection-u.salesCollection.totalTax;var k=E().format("DD/MM/YYYY LT");const X=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${k}`}),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:u.selectedDate})]}),s.jsx("hr",{}),u.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:oe(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.monthTillDateSalesColl.totalDiscountAmt,o)}${X?`(${m(X)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.salesCollection.totalDiscountAmt,o)}${te?`(${m(te)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(b,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Q(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Q(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Q(u.otherFields.totalTax,u.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:oe(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),w(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Q(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.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:oe(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.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:oe(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:oe(u.totalCollection,o)})]}),I(u)]}),R(u.averageCollection),u.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:oe(u.otherFields.salesCollection,o)})]}),u.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:oe(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Te(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let te;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].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[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].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:O.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:O.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:O.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:O.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:O.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",te.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:O.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:O.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.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:O.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:O.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:O.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.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:O.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[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((Kt=a.services)==null?void 0:Kt.length)&&a.services.map(X=>{var y;return s.jsxs("div",{style:X.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:X.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:X.qty})]}),((y=X.addons)==null?void 0:y.length)&&X.addons.map(_=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(_.serviceName)})),X.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:X.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:oe(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(X=>{if(X.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:X.name}),s.jsx("h5",{children:a.curr+" "+m(X.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(X=>{let y=new Array;for(const _ in X)if(X[_]&&X[_]!=0){let v=_/2;y.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",v]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",v,"%"]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]})]}))}return y})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(X=>s.jsx("h4",{className:"left-align-entity",children:X.customName+": "+X.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let te="";return a.action==="SWITCH_TABLE"?te=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:["**",(xt=d.Table)==null?void 0:xt.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Qt=a.from)==null?void 0:Qt.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+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:`${(Ss=(Zt=e.tableData[a.to[0]])==null?void 0:Zt.attachedArea)==null?void 0:Ss.toUpperCase()} - ${(pn=e.tableData[a.to[0]])==null?void 0:pn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):te=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 ",(Ts=d.Table)==null?void 0:Ts.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(yn=a.from)==null?void 0:yn.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+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:`${(Is=(ws=e.tableData[a.to[0]])==null?void 0:ws.attachedArea)==null?void 0:Is.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),te}else if(g==="COUNTER_OPERATION"){let te;return l=="2INCH"||l=="1.8INCH"?te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0||b.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",U(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",U(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    -",U(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    +",U(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   -",U(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   +",U(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}):te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}),te}else if(g==="ITEMWISE_SALES_COUNTER"){let te,{counterDetails:b}=e.printerDataObject;return te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:b.currentDate}),s.jsx("hr",{}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",b.CounterName]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",b.openedBy]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",b.loginTime]}),b.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",b.logoutTime]}),b.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${b.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${b.printedOn}`})]})}),te}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:te}=e.printerDataObject;return getRechargeDetails(te)}else if(g==="PACKAGING_SLIP"){let te,b=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(te=$(u.aggregatorOrderId));const X=u.services;for(let _ in X)b+=X[_].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),me(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",b]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(_=>s.jsx("h4",{className:"left-align-entity",children:_.customName+": "+_.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.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:O.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:O.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:O.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:O.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.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[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:nr(b.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.finalAmount)})]})},b.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(Cs=a.transactions)!=null&&Cs.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[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:b.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.amount)})]})},b.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let te,b=0,X,y;for(let v=0;v<(((Os=a.services)==null?void 0:Os.length)||0);v++)y=a.services[v],y.status==="CANCELLED"&&!a.onlyCancelledItems&&(b+=y.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",b||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&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.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:`${d.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:`${d.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[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(v=>(v.status==="CANCELLED"?X=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}):X=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}),s.jsx("div",{children:X}))),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-b)]})]}),(Nn=a.customFields)==null?void 0:Nn.map(v=>s.jsx("h4",{className:"left-align-entity",children:v.customName+": "+v.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Mh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);let p=[],m=[];const x=ba(c).flatMap(j=>{var S;return(S=d[j.station])==null?void 0:S.map(A=>new Promise(w=>s.jsx(tt,{printerDataObject:{staticDataKOT:j,paperSize:A.paperSize,printer:A.printer},newId:j.newId,value:{settingData:t},onImageGenerated:I=>{p.push({paperSize:A.paperSize,printer:A.printer,image:I,type:"KOT"}),w()},additionalActions:r},j.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const j=bd(e,t,r);(o=j.printers)!=null&&o.length&&j.printers.forEach(S=>{m.push(new Promise(A=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:S.obj},paperSize:S.paperSize,printer:S.printer,type:"PACKAGING_SLIP"},newId:S.obj.newId,value:{settingData:t},onImageGenerated:w=>{p.push({paperSize:S.paperSize,printer:S.printer,image:w,type:"PACKAGING_SLIP"}),A()},additionalActions:r},S.obj.newId))}))})}x.length&&pt("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Ah=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(j=>{const S=s.jsx(tt,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:A=>{h.push({paperSize:x.paperSize,printer:x.printer,image:A,type:"UPDATE_TABLE"}),j()},additionalActions:n});return f.push(j),S}))});d.length&&pt("root1",d),await Promise.all(f.map(p=>new Promise(p)))}r(h)}catch(a){i(a)}}),Eh=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});pt("root1",o)}),n(a)}catch(i){r(i)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),Lh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});pt("root1",p)}),i(l)}else i([])}catch(h){a(h)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});pt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});pt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=cd(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(m=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:j=>{f.push({paperSize:d.paperSize,image:j,type:"BILL"}),m()},additionalActions:n});h.push(x)})}}h.length&&pt("root1",h),r(f)}catch(h){i(h)}}),pt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ce.counterDetailsPrint=Ph,Ce.handleAggregatorBillPrint=Rh,Ce.handleBillPrint=kh,Ce.handleDashboardPrint=Eh,Ce.handleItemWisePrint=Lh,Ce.handleKOTPrint=Mh,Ce.handleOldBillPrints=Dh,Ce.handleSummaryPrint=Fh,Ce.handleUpdateTablePrint=Ah,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});