recaho-print-react 0.0.101

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.
@@ -0,0 +1,54 @@
1
+ (function(Ae,ve){typeof exports=="object"&&typeof module<"u"?ve(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],ve):(Ae=typeof globalThis<"u"?globalThis:Ae||self,ve(Ae["recaho-print-react"]={},Ae.React,Ae.ReactDOM))})(this,function(Ae,ve,Xa){"use strict";function fr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Os={exports:{}},ts={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var pr;function Ja(){if(pr)return ts;pr=1;var e=ve,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 d(p,o,l){var c,u={},m=null,f=null;l!==void 0&&(m=""+l),o.key!==void 0&&(m=""+o.key),o.ref!==void 0&&(f=o.ref);for(c in o)r.call(o,c)&&!a.hasOwnProperty(c)&&(u[c]=o[c]);if(p&&p.defaultProps)for(c in o=p.defaultProps,o)u[c]===void 0&&(u[c]=o[c]);return{$$typeof:t,type:p,key:m,ref:f,props:u,_owner:i.current}}return ts.Fragment=n,ts.jsx=d,ts.jsxs=d,ts}var ss={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var yr;function ei(){return yr||(yr=1,process.env.NODE_ENV!=="production"&&function(){var e=ve,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"),d=Symbol.for("react.provider"),p=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),x=Symbol.iterator,_="@@iterator";function j(y){if(y===null||typeof y!="object")return null;var O=x&&y[x]||y[_];return typeof O=="function"?O:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(y){{for(var O=arguments.length,D=new Array(O>1?O-1:0),G=1;G<O;G++)D[G-1]=arguments[G];M("error",y,D)}}function M(y,O,D){{var G=T.ReactDebugCurrentFrame,fe=G.getStackAddendum();fe!==""&&(O+="%s",D=D.concat([fe]));var ge=D.map(function(le){return String(le)});ge.unshift("Warning: "+O),Function.prototype.apply.call(console[y],console,ge)}}var F=!1,C=!1,z=!1,Z=!1,se=!1,Q;Q=Symbol.for("react.module.reference");function ue(y){return!!(typeof y=="string"||typeof y=="function"||y===r||y===a||se||y===i||y===l||y===c||Z||y===f||F||C||z||typeof y=="object"&&y!==null&&(y.$$typeof===m||y.$$typeof===u||y.$$typeof===d||y.$$typeof===p||y.$$typeof===o||y.$$typeof===Q||y.getModuleId!==void 0))}function be(y,O,D){var G=y.displayName;if(G)return G;var fe=O.displayName||O.name||"";return fe!==""?D+"("+fe+")":D}function V(y){return y.displayName||"Context"}function ce(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 p:var O=y;return V(O)+".Consumer";case d:var D=y;return V(D._context)+".Provider";case o:return be(y,y.render,"ForwardRef");case u:var G=y.displayName||null;return G!==null?G:ce(y.type)||"Memo";case m:{var fe=y,ge=fe._payload,le=fe._init;try{return ce(le(ge))}catch{return null}}}return null}var K=Object.assign,J=0,Me,A,xt,at,it,Je,It;function ee(){}ee.__reactDisabledLog=!0;function Se(){{if(J===0){Me=console.log,A=console.info,xt=console.warn,at=console.error,it=console.group,Je=console.groupCollapsed,It=console.groupEnd;var y={configurable:!0,enumerable:!0,value:ee,writable:!0};Object.defineProperties(console,{info:y,log:y,warn:y,error:y,group:y,groupCollapsed:y,groupEnd:y})}J++}}function Nt(){{if(J--,J===0){var y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},y,{value:Me}),info:K({},y,{value:A}),warn:K({},y,{value:xt}),error:K({},y,{value:at}),group:K({},y,{value:it}),groupCollapsed:K({},y,{value:Je}),groupEnd:K({},y,{value:It})})}J<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var g=T.ReactCurrentDispatcher,h;function w(y,O,D){{if(h===void 0)try{throw Error()}catch(fe){var G=fe.stack.trim().match(/\n( *(at )?)/);h=G&&G[1]||""}return`
18
+ `+h+y}}var N=!1,I;{var Y=typeof WeakMap=="function"?WeakMap:Map;I=new Y}function b(y,O){if(!y||N)return"";{var D=I.get(y);if(D!==void 0)return D}var G;N=!0;var fe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ge;ge=g.current,g.current=null,Se();try{if(O){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(Ue){G=Ue}Reflect.construct(y,[],le)}else{try{le.call()}catch(Ue){G=Ue}y.call(le.prototype)}}else{try{throw Error()}catch(Ue){G=Ue}y()}}catch(Ue){if(Ue&&G&&typeof Ue.stack=="string"){for(var ae=Ue.stack.split(`
19
+ `),Le=G.stack.split(`
20
+ `),Te=ae.length-1,Ce=Le.length-1;Te>=1&&Ce>=0&&ae[Te]!==Le[Ce];)Ce--;for(;Te>=1&&Ce>=0;Te--,Ce--)if(ae[Te]!==Le[Ce]){if(Te!==1||Ce!==1)do if(Te--,Ce--,Ce<0||ae[Te]!==Le[Ce]){var Ve=`
21
+ `+ae[Te].replace(" at new "," at ");return y.displayName&&Ve.includes("<anonymous>")&&(Ve=Ve.replace("<anonymous>",y.displayName)),typeof y=="function"&&I.set(y,Ve),Ve}while(Te>=1&&Ce>=0);break}}}finally{N=!1,g.current=ge,Nt(),Error.prepareStackTrace=fe}var es=y?y.displayName||y.name:"",Pt=es?w(es):"";return typeof y=="function"&&I.set(y,Pt),Pt}function k(y,O,D){return b(y,!1)}function H(y){var O=y.prototype;return!!(O&&O.isReactComponent)}function pe(y,O,D){if(y==null)return"";if(typeof y=="function")return b(y,H(y));if(typeof y=="string")return w(y);switch(y){case l:return w("Suspense");case c:return w("SuspenseList")}if(typeof y=="object")switch(y.$$typeof){case o:return k(y.render);case u:return pe(y.type,O,D);case m:{var G=y,fe=G._payload,ge=G._init;try{return pe(ge(fe),O,D)}catch{}}}return""}var ke=Object.prototype.hasOwnProperty,De={},Ye=T.ReactDebugCurrentFrame;function Re(y){if(y){var O=y._owner,D=pe(y.type,y._source,O?O.type:null);Ye.setExtraStackFrame(D)}else Ye.setExtraStackFrame(null)}function Be(y,O,D,G,fe){{var ge=Function.call.bind(ke);for(var le in y)if(ge(y,le)){var ae=void 0;try{if(typeof y[le]!="function"){var Le=Error((G||"React class")+": "+D+" 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 Le.name="Invariant Violation",Le}ae=y[le](O,le,G,D,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Te){ae=Te}ae&&!(ae instanceof Error)&&(Re(fe),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).",G||"React class",D,le,typeof ae),Re(null)),ae instanceof Error&&!(ae.message in De)&&(De[ae.message]=!0,Re(fe),S("Failed %s type: %s",D,ae.message),Re(null))}}}var kt=Array.isArray;function jt(y){return kt(y)}function q(y){{var O=typeof Symbol=="function"&&Symbol.toStringTag,D=O&&y[Symbol.toStringTag]||y.constructor.name||"Object";return D}}function Lt(y){try{return Ct(y),!1}catch{return!0}}function Ct(y){return""+y}function js(y){if(Lt(y))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q(y)),Ct(y)}var vs=T.ReactCurrentOwner,an={key:!0,ref:!0,__self:!0,__source:!0},_s,bs;function ln(y){if(ke.call(y,"ref")){var O=Object.getOwnPropertyDescriptor(y,"ref").get;if(O&&O.isReactWarning)return!1}return y.ref!==void 0}function on(y){if(ke.call(y,"key")){var O=Object.getOwnPropertyDescriptor(y,"key").get;if(O&&O.isReactWarning)return!1}return y.key!==void 0}function cn(y,O){typeof y.ref=="string"&&vs.current}function dn(y,O){{var D=function(){_s||(_s=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};D.isReactWarning=!0,Object.defineProperty(y,"key",{get:D,configurable:!0})}}function hn(y,O){{var D=function(){bs||(bs=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};D.isReactWarning=!0,Object.defineProperty(y,"ref",{get:D,configurable:!0})}}var un=function(y,O,D,G,fe,ge,le){var ae={$$typeof:t,type:y,key:O,ref:D,props:le,_owner:ge};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:G}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:fe}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function mn(y,O,D,G,fe){{var ge,le={},ae=null,Le=null;D!==void 0&&(js(D),ae=""+D),on(O)&&(js(O.key),ae=""+O.key),ln(O)&&(Le=O.ref,cn(O,fe));for(ge in O)ke.call(O,ge)&&!an.hasOwnProperty(ge)&&(le[ge]=O[ge]);if(y&&y.defaultProps){var Te=y.defaultProps;for(ge in Te)le[ge]===void 0&&(le[ge]=Te[ge])}if(ae||Le){var Ce=typeof y=="function"?y.displayName||y.name||"Unknown":y;ae&&dn(le,Ce),Le&&hn(le,Ce)}return un(y,ae,Le,fe,G,vs.current,le)}}var Zt=T.ReactCurrentOwner,Ss=T.ReactDebugCurrentFrame;function vt(y){if(y){var O=y._owner,D=pe(y.type,y._source,O?O.type:null);Ss.setExtraStackFrame(D)}else Ss.setExtraStackFrame(null)}var Xt;Xt=!1;function Jt(y){return typeof y=="object"&&y!==null&&y.$$typeof===t}function Ts(){{if(Zt.current){var y=ce(Zt.current.type);if(y)return`
22
+
23
+ Check the render method of \``+y+"`."}return""}}function fn(y){return""}var ws={};function pn(y){{var O=Ts();if(!O){var D=typeof y=="string"?y:y.displayName||y.name;D&&(O=`
24
+
25
+ Check the top-level render call using <`+D+">.")}return O}}function Is(y,O){{if(!y._store||y._store.validated||y.key!=null)return;y._store.validated=!0;var D=pn(O);if(ws[D])return;ws[D]=!0;var G="";y&&y._owner&&y._owner!==Zt.current&&(G=" It was passed a child from "+ce(y._owner.type)+"."),vt(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.',D,G),vt(null)}}function Cs(y,O){{if(typeof y!="object")return;if(jt(y))for(var D=0;D<y.length;D++){var G=y[D];Jt(G)&&Is(G,O)}else if(Jt(y))y._store&&(y._store.validated=!0);else if(y){var fe=j(y);if(typeof fe=="function"&&fe!==y.entries)for(var ge=fe.call(y),le;!(le=ge.next()).done;)Jt(le.value)&&Is(le.value,O)}}}function yn(y){{var O=y.type;if(O==null||typeof O=="string")return;var D;if(typeof O=="function")D=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===o||O.$$typeof===u))D=O.propTypes;else return;if(D){var G=ce(O);Be(D,y.props,"prop",G,y)}else if(O.PropTypes!==void 0&&!Xt){Xt=!0;var fe=ce(O);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",fe||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gn(y){{for(var O=Object.keys(y.props),D=0;D<O.length;D++){var G=O[D];if(G!=="children"&&G!=="key"){vt(y),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",G),vt(null);break}}y.ref!==null&&(vt(y),S("Invalid attribute `ref` supplied to `React.Fragment`."),vt(null))}}var ne={};function v(y,O,D,G,fe,ge){{var le=ue(y);if(!le){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 Le=fn();Le?ae+=Le:ae+=Ts();var Te;y===null?Te="null":jt(y)?Te="array":y!==void 0&&y.$$typeof===t?(Te="<"+(ce(y.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Te=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",Te,ae)}var Ce=mn(y,O,D,fe,ge);if(Ce==null)return Ce;if(le){var Ve=O.children;if(Ve!==void 0)if(G)if(jt(Ve)){for(var es=0;es<Ve.length;es++)Cs(Ve[es],y);Object.freeze&&Object.freeze(Ve)}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 Cs(Ve,y)}if(ke.call(O,"key")){var Pt=ce(y),Ue=Object.keys(O).filter(function(Ph){return Ph!=="key"}),mr=Ue.length>0?"{key: someKey, "+Ue.join(": ..., ")+": ...}":"{key: someKey}";if(!ne[Pt+mr]){var Lh=Ue.length>0?"{"+Ue.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,mr,Pt,Lh,Pt),ne[Pt+mr]=!0}}return y===r?gn(Ce):yn(Ce),Ce}}function X(y,O,D){return v(y,O,D,!0)}function me(y,O,D){return v(y,O,D,!1)}var B=me,L=X;ss.Fragment=r,ss.jsx=B,ss.jsxs=L}()),ss}var gr;function ti(){return gr||(gr=1,process.env.NODE_ENV==="production"?Os.exports=Ja():Os.exports=ei()),Os.exports}var s=ti(),Ft={},xr;function si(){if(xr)return Ft;xr=1;var e=Xa;if(process.env.NODE_ENV==="production")Ft.createRoot=e.createRoot,Ft.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ft.createRoot=function(n,r){t.usingClientEntryPoint=!0;try{return e.createRoot(n,r)}finally{t.usingClientEntryPoint=!1}},Ft.hydrateRoot=function(n,r,i){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(n,r,i)}finally{t.usingClientEntryPoint=!1}}}return Ft}var ni=si();const ri=fr(ni),ns=e=>e.replace(/\-/g," ").replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());//! moment.js
31
+ //! version : 2.30.1
32
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
33
+ //! license : MIT
34
+ //! momentjs.com
35
+ var Nr;function R(){return Nr.apply(null,arguments)}function ai(e){Nr=e}function qe(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function Ot(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function de(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xn(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 Pe(e){return e===void 0}function lt(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function rs(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function jr(e,t){var n=[],r,i=e.length;for(r=0;r<i;++r)n.push(t(e[r],r));return n}function _t(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 et(e,t,n,r){return Vr(e,t,n,r,!0).utc()}function ii(){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 te(e){return e._pf==null&&(e._pf=ii()),e._pf}var Nn;Array.prototype.some?Nn=Array.prototype.some:Nn=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 jn(e){var t=null,n=!1,r=e._d&&!isNaN(e._d.getTime());if(r&&(t=te(e),n=Nn.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 Ms(e){var t=et(NaN);return e!=null?_t(te(t),e):te(t).userInvalidated=!0,t}var vr=R.momentProperties=[],vn=!1;function _n(e,t){var n,r,i,a=vr.length;if(Pe(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),Pe(t._i)||(e._i=t._i),Pe(t._f)||(e._f=t._f),Pe(t._l)||(e._l=t._l),Pe(t._strict)||(e._strict=t._strict),Pe(t._tzm)||(e._tzm=t._tzm),Pe(t._isUTC)||(e._isUTC=t._isUTC),Pe(t._offset)||(e._offset=t._offset),Pe(t._pf)||(e._pf=te(t)),Pe(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)r=vr[n],i=t[r],Pe(i)||(e[r]=i);return e}function as(e){_n(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),vn===!1&&(vn=!0,R.updateOffset(this),vn=!1)}function Ke(e){return e instanceof as||e!=null&&e._isAMomentObject!=null}function _r(e){R.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+e)}function We(e,t){var n=!0;return _t(function(){if(R.deprecationHandler!=null&&R.deprecationHandler(null,e),n){var r=[],i,a,d,p=arguments.length;for(a=0;a<p;a++){if(i="",typeof arguments[a]=="object"){i+=`
36
+ [`+a+"] ";for(d in arguments[0])de(arguments[0],d)&&(i+=d+": "+arguments[0][d]+", ");i=i.slice(0,-2)}else i=arguments[a];r.push(i)}_r(e+`
37
+ Arguments: `+Array.prototype.slice.call(r).join("")+`
38
+ `+new Error().stack),n=!1}return t.apply(this,arguments)},t)}var br={};function Sr(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),br[e]||(_r(t),br[e]=!0)}R.suppressDeprecationWarnings=!1,R.deprecationHandler=null;function tt(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function li(e){var t,n;for(n in e)de(e,n)&&(t=e[n],tt(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 bn(e,t){var n=_t({},e),r;for(r in t)de(t,r)&&(Ot(e[r])&&Ot(t[r])?(n[r]={},_t(n[r],e[r]),_t(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);for(r in e)de(e,r)&&!de(t,r)&&Ot(e[r])&&(n[r]=_t({},n[r]));return n}function Sn(e){e!=null&&this.set(e)}var Tn;Object.keys?Tn=Object.keys:Tn=function(e){var t,n=[];for(t in e)de(e,t)&&n.push(t);return n};var oi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function ci(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return tt(r)?r.call(t,n):r}function st(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 wn=/(\[[^\[]*\])|(\\)?([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,As=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,In={},Dt={};function W(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Dt[e]=i),t&&(Dt[t[0]]=function(){return st(i.apply(this,arguments),t[1],t[2])}),n&&(Dt[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function di(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function hi(e){var t=e.match(wn),n,r;for(n=0,r=t.length;n<r;n++)Dt[t[n]]?t[n]=Dt[t[n]]:t[n]=di(t[n]);return function(i){var a="",d;for(d=0;d<r;d++)a+=tt(t[d])?t[d].call(i,e):t[d];return a}}function Es(e,t){return e.isValid()?(t=Tr(t,e.localeData()),In[t]=In[t]||hi(t),In[t](e)):e.localeData().invalidDate()}function Tr(e,t){var n=5;function r(i){return t.longDateFormat(i)||i}for(As.lastIndex=0;n>=0&&As.test(e);)e=e.replace(As,r),As.lastIndex=0,n-=1;return e}var ui={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 mi(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(wn).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var fi="Invalid date";function pi(){return this._invalidDate}var yi="%d",gi=/\d{1,2}/;function xi(e){return this._ordinal.replace("%d",e)}var Ni={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 ji(e,t,n,r){var i=this._relativeTime[n];return tt(i)?i(e,t,n,r):i.replace(/%d/i,e)}function vi(e,t){var n=this._relativeTime[e>0?"future":"past"];return tt(n)?n(t):n.replace(/%s/i,t)}var wr={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 ze(e){return typeof e=="string"?wr[e]||wr[e.toLowerCase()]:void 0}function Cn(e){var t={},n,r;for(r in e)de(e,r)&&(n=ze(r),n&&(t[n]=e[r]));return t}var _i={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 bi(e){var t=[],n;for(n in e)de(e,n)&&t.push({unit:n,priority:_i[n]});return t.sort(function(r,i){return r.priority-i.priority}),t}var Ir=/\d/,$e=/\d\d/,Cr=/\d{3}/,On=/\d{4}/,Rs=/[+-]?\d{6}/,xe=/\d\d?/,Or=/\d\d\d\d?/,Mr=/\d\d\d\d\d\d?/,ks=/\d{1,3}/,Mn=/\d{1,4}/,Ls=/[+-]?\d{1,6}/,Yt=/\d+/,Ps=/[+-]?\d+/,Si=/Z|[+-]\d\d:?\d\d/gi,Fs=/Z|[+-]\d\d(?::?\d\d)?/gi,Ti=/[+-]?\d+(\.\d{1,3})?/,is=/[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,Ut=/^[1-9]\d?/,An=/^([1-9]\d|\d)/,Ds;Ds={};function U(e,t,n){Ds[e]=tt(t)?t:function(r,i){return r&&n?n:t}}function wi(e,t){return de(Ds,e)?Ds[e](t._strict,t._locale):new RegExp(Ii(e))}function Ii(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 Ge(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=Ge(t)),n}var En={};function ye(e,t){var n,r=t,i;for(typeof e=="string"&&(e=[e]),lt(t)&&(r=function(a,d){d[t]=re(a)}),i=e.length,n=0;n<i;n++)En[e[n]]=r}function ls(e,t){ye(e,function(n,r,i,a){i._w=i._w||{},t(n,i._w,i,a)})}function Ci(e,t,n){t!=null&&de(En,e)&&En[e](t,n._a,n,e)}function Ys(e){return e%4===0&&e%100!==0||e%400===0}var Ee=0,ct=1,nt=2,Oe=3,Qe=4,dt=5,Mt=6,Oi=7,Mi=8;W("Y",0,0,function(){var e=this.year();return e<=9999?st(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"),U("Y",Ps),U("YY",xe,$e),U("YYYY",Mn,On),U("YYYYY",Ls,Rs),U("YYYYYY",Ls,Rs),ye(["YYYYY","YYYYYY"],Ee),ye("YYYY",function(e,t){t[Ee]=e.length===2?R.parseTwoDigitYear(e):re(e)}),ye("YY",function(e,t){t[Ee]=R.parseTwoDigitYear(e)}),ye("Y",function(e,t){t[Ee]=parseInt(e,10)});function os(e){return Ys(e)?366:365}R.parseTwoDigitYear=function(e){return re(e)+(re(e)>68?1900:2e3)};var Ar=$t("FullYear",!0);function Ai(){return Ys(this.year())}function $t(e,t){return function(n){return n!=null?(Er(this,e,n),R.updateOffset(this,t),this):cs(this,e)}}function cs(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 Er(e,t,n){var r,i,a,d,p;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,d=e.month(),p=e.date(),p=p===29&&d===1&&!Ys(a)?28:p,i?r.setUTCFullYear(a,d,p):r.setFullYear(a,d,p)}}function Ei(e){return e=ze(e),tt(this[e])?this[e]():this}function Ri(e,t){if(typeof e=="object"){e=Cn(e);var n=bi(e),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](e[n[r].unit])}else if(e=ze(e),tt(this[e]))return this[e](t);return this}function ki(e,t){return(e%t+t)%t}var _e;Array.prototype.indexOf?_e=Array.prototype.indexOf:_e=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Rn(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ki(t,12);return e+=(t-n)/12,n===1?Ys(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)}),U("M",xe,Ut),U("MM",xe,$e),U("MMM",function(e,t){return t.monthsShortRegex(e)}),U("MMMM",function(e,t){return t.monthsRegex(e)}),ye(["M","MM"],function(e,t){t[ct]=re(e)-1}),ye(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[ct]=i:te(n).invalidMonth=e});var Li="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Rr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Pi=is,Fi=is;function Di(e,t){return e?qe(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||kr).test(t)?"format":"standalone"][e.month()]:qe(this._months)?this._months:this._months.standalone}function Yi(e,t){return e?qe(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[kr.test(t)?"format":"standalone"][e.month()]:qe(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Ui(e,t,n){var r,i,a,d=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=et([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?t==="MMM"?(i=_e.call(this._shortMonthsParse,d),i!==-1?i:null):(i=_e.call(this._longMonthsParse,d),i!==-1?i:null):t==="MMM"?(i=_e.call(this._shortMonthsParse,d),i!==-1?i:(i=_e.call(this._longMonthsParse,d),i!==-1?i:null)):(i=_e.call(this._longMonthsParse,d),i!==-1?i:(i=_e.call(this._shortMonthsParse,d),i!==-1?i:null))}function $i(e,t,n){var r,i,a;if(this._monthsParseExact)return Ui.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=et([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 Lr(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),!lt(t))return e}var n=t,r=e.date();return r=r<29?r:Math.min(r,Rn(e.year(),n)),e._isUTC?e._d.setUTCMonth(n,r):e._d.setMonth(n,r),e}function Pr(e){return e!=null?(Lr(this,e),R.updateOffset(this,!0),this):cs(this,"Month")}function Hi(){return Rn(this.year(),this.month())}function Bi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Fr.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(de(this,"_monthsShortRegex")||(this._monthsShortRegex=Pi),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function Wi(e){return this._monthsParseExact?(de(this,"_monthsRegex")||Fr.call(this),e?this._monthsStrictRegex:this._monthsRegex):(de(this,"_monthsRegex")||(this._monthsRegex=Fi),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function Fr(){function e(o,l){return l.length-o.length}var t=[],n=[],r=[],i,a,d,p;for(i=0;i<12;i++)a=et([2e3,i]),d=ot(this.monthsShort(a,"")),p=ot(this.months(a,"")),t.push(d),n.push(p),r.push(p),r.push(d);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 zi(e,t,n,r,i,a,d){var p;return e<100&&e>=0?(p=new Date(e+400,t,n,r,i,a,d),isFinite(p.getFullYear())&&p.setFullYear(e)):p=new Date(e,t,n,r,i,a,d),p}function ds(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 Us(e,t,n){var r=7+t-n,i=(7+ds(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Dr(e,t,n,r,i){var a=(7+n-r)%7,d=Us(e,r,i),p=1+7*(t-1)+a+d,o,l;return p<=0?(o=e-1,l=os(o)+p):p>os(e)?(o=e+1,l=p-os(e)):(o=e,l=p),{year:o,dayOfYear:l}}function hs(e,t,n){var r=Us(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,a,d;return i<1?(d=e.year()-1,a=i+ht(d,t,n)):i>ht(e.year(),t,n)?(a=i-ht(e.year(),t,n),d=e.year()+1):(d=e.year(),a=i),{week:a,year:d}}function ht(e,t,n){var r=Us(e,t,n),i=Us(e+1,t,n);return(os(e)-r+i)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),U("w",xe,Ut),U("ww",xe,$e),U("W",xe,Ut),U("WW",xe,$e),ls(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=re(e)});function Gi(e){return hs(e,this._week.dow,this._week.doy).week}var Vi={dow:0,doy:6};function qi(){return this._week.dow}function Ki(){return this._week.doy}function Qi(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function Zi(e){var t=hs(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"),U("d",xe),U("e",xe),U("E",xe),U("dd",function(e,t){return t.weekdaysMinRegex(e)}),U("ddd",function(e,t){return t.weekdaysShortRegex(e)}),U("dddd",function(e,t){return t.weekdaysRegex(e)}),ls(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:te(n).invalidWeekday=e}),ls(["d","e","E"],function(e,t,n,r){t[r]=re(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 Ji(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function kn(e,t){return e.slice(t,7).concat(e.slice(0,t))}var el="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),tl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),sl=is,nl=is,rl=is;function al(e,t){var n=qe(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?kn(n,this._week.dow):e?n[e.day()]:n}function il(e){return e===!0?kn(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ll(e){return e===!0?kn(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ol(e,t,n){var r,i,a,d=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=et([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=_e.call(this._weekdaysParse,d),i!==-1?i:null):t==="ddd"?(i=_e.call(this._shortWeekdaysParse,d),i!==-1?i:null):(i=_e.call(this._minWeekdaysParse,d),i!==-1?i:null):t==="dddd"?(i=_e.call(this._weekdaysParse,d),i!==-1||(i=_e.call(this._shortWeekdaysParse,d),i!==-1)?i:(i=_e.call(this._minWeekdaysParse,d),i!==-1?i:null)):t==="ddd"?(i=_e.call(this._shortWeekdaysParse,d),i!==-1||(i=_e.call(this._weekdaysParse,d),i!==-1)?i:(i=_e.call(this._minWeekdaysParse,d),i!==-1?i:null)):(i=_e.call(this._minWeekdaysParse,d),i!==-1||(i=_e.call(this._weekdaysParse,d),i!==-1)?i:(i=_e.call(this._shortWeekdaysParse,d),i!==-1?i:null))}function cl(e,t,n){var r,i,a;if(this._weekdaysParseExact)return ol.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=et([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 dl(e){if(!this.isValid())return e!=null?this:NaN;var t=cs(this,"Day");return e!=null?(e=Xi(e,this.localeData()),this.add(e-t,"d")):t}function hl(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 ul(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=Ji(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function ml(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Ln.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(de(this,"_weekdaysRegex")||(this._weekdaysRegex=sl),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function fl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Ln.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(de(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nl),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function pl(e){return this._weekdaysParseExact?(de(this,"_weekdaysRegex")||Ln.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(de(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rl),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ln(){function e(c,u){return u.length-c.length}var t=[],n=[],r=[],i=[],a,d,p,o,l;for(a=0;a<7;a++)d=et([2e3,1]).day(a),p=ot(this.weekdaysMin(d,"")),o=ot(this.weekdaysShort(d,"")),l=ot(this.weekdays(d,"")),t.push(p),n.push(o),r.push(l),i.push(p),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 Pn(){return this.hours()%12||12}function yl(){return this.hours()||24}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Pn),W("k",["kk",2],0,yl),W("hmm",0,0,function(){return""+Pn.apply(this)+st(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Pn.apply(this)+st(this.minutes(),2)+st(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+st(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+st(this.minutes(),2)+st(this.seconds(),2)});function Ur(e,t){W(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}Ur("a",!0),Ur("A",!1);function $r(e,t){return t._meridiemParse}U("a",$r),U("A",$r),U("H",xe,An),U("h",xe,Ut),U("k",xe,Ut),U("HH",xe,$e),U("hh",xe,$e),U("kk",xe,$e),U("hmm",Or),U("hmmss",Mr),U("Hmm",Or),U("Hmmss",Mr),ye(["H","HH"],Oe),ye(["k","kk"],function(e,t,n){var r=re(e);t[Oe]=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[Oe]=re(e),te(n).bigHour=!0}),ye("hmm",function(e,t,n){var r=e.length-2;t[Oe]=re(e.substr(0,r)),t[Qe]=re(e.substr(r)),te(n).bigHour=!0}),ye("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Oe]=re(e.substr(0,r)),t[Qe]=re(e.substr(r,2)),t[dt]=re(e.substr(i)),te(n).bigHour=!0}),ye("Hmm",function(e,t,n){var r=e.length-2;t[Oe]=re(e.substr(0,r)),t[Qe]=re(e.substr(r))}),ye("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Oe]=re(e.substr(0,r)),t[Qe]=re(e.substr(r,2)),t[dt]=re(e.substr(i))});function gl(e){return(e+"").toLowerCase().charAt(0)==="p"}var xl=/[ap]\.?m?\.?/i,Nl=$t("Hours",!0);function jl(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Hr={calendar:oi,longDateFormat:ui,invalidDate:fi,ordinal:yi,dayOfMonthOrdinalParse:gi,relativeTime:Ni,months:Li,monthsShort:Rr,week:Vi,weekdays:el,weekdaysMin:tl,weekdaysShort:Yr,meridiemParse:xl},je={},us={},ms;function vl(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 Br(e){return e&&e.toLowerCase().replace("_","-")}function _l(e){for(var t=0,n,r,i,a;t<e.length;){for(a=Br(e[t]).split("-"),n=a.length,r=Br(e[t+1]),r=r?r.split("-"):null;n>0;){if(i=$s(a.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&vl(a,r)>=n-1)break;n--}t++}return ms}function bl(e){return!!(e&&e.match("^[^/\\\\]*$"))}function $s(e){var t=null,n;if(je[e]===void 0&&typeof module<"u"&&module&&module.exports&&bl(e))try{t=ms._abbr,n=require,n("./locale/"+e),bt(t)}catch{je[e]=null}return je[e]}function bt(e,t){var n;return e&&(Pe(t)?n=ut(e):n=Fn(e,t),n?ms=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ms._abbr}function Fn(e,t){if(t!==null){var n,r=Hr;if(t.abbr=e,je[e]!=null)Sr("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=je[e]._config;else if(t.parentLocale!=null)if(je[t.parentLocale]!=null)r=je[t.parentLocale]._config;else if(n=$s(t.parentLocale),n!=null)r=n._config;else return us[t.parentLocale]||(us[t.parentLocale]=[]),us[t.parentLocale].push({name:e,config:t}),null;return je[e]=new Sn(bn(r,t)),us[e]&&us[e].forEach(function(i){Fn(i.name,i.config)}),bt(e),je[e]}else return delete je[e],null}function Sl(e,t){if(t!=null){var n,r,i=Hr;je[e]!=null&&je[e].parentLocale!=null?je[e].set(bn(je[e]._config,t)):(r=$s(e),r!=null&&(i=r._config),t=bn(i,t),r==null&&(t.abbr=e),n=new Sn(t),n.parentLocale=je[e],je[e]=n),bt(e)}else je[e]!=null&&(je[e].parentLocale!=null?(je[e]=je[e].parentLocale,e===bt()&&bt(e)):je[e]!=null&&delete je[e]);return je[e]}function ut(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ms;if(!qe(e)){if(t=$s(e),t)return t;e=[e]}return _l(e)}function Tl(){return Tn(je)}function Dn(e){var t,n=e._a;return n&&te(e).overflow===-2&&(t=n[ct]<0||n[ct]>11?ct:n[nt]<1||n[nt]>Rn(n[Ee],n[ct])?nt:n[Oe]<0||n[Oe]>24||n[Oe]===24&&(n[Qe]!==0||n[dt]!==0||n[Mt]!==0)?Oe:n[Qe]<0||n[Qe]>59?Qe:n[dt]<0||n[dt]>59?dt:n[Mt]<0||n[Mt]>999?Mt:-1,te(e)._overflowDayOfYear&&(t<Ee||t>nt)&&(t=nt),te(e)._overflowWeeks&&t===-1&&(t=Oi),te(e)._overflowWeekday&&t===-1&&(t=Mi),te(e).overflow=t),e}var wl=/^\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)?)?$/,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=/Z|[+-]\d\d(?::?\d\d)?/,Hs=[["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]],Yn=[["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/]],Ol=/^\/?Date\((-?\d+)/i,Ml=/^(?:(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}))$/,Al={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 Wr(e){var t,n,r=e._i,i=wl.exec(r)||Il.exec(r),a,d,p,o,l=Hs.length,c=Yn.length;if(i){for(te(e).iso=!0,t=0,n=l;t<n;t++)if(Hs[t][1].exec(i[1])){d=Hs[t][0],a=Hs[t][2]!==!1;break}if(d==null){e._isValid=!1;return}if(i[3]){for(t=0,n=c;t<n;t++)if(Yn[t][1].exec(i[3])){p=(i[2]||" ")+Yn[t][0];break}if(p==null){e._isValid=!1;return}}if(!a&&p!=null){e._isValid=!1;return}if(i[4])if(Cl.exec(i[4]))o="Z";else{e._isValid=!1;return}e._f=d+(p||"")+(o||""),$n(e)}else e._isValid=!1}function El(e,t,n,r,i,a){var d=[Rl(e),Rr.indexOf(t),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return a&&d.push(parseInt(a,10)),d}function Rl(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function kl(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ll(e,t,n){if(e){var r=Yr.indexOf(e),i=new Date(t[0],t[1],t[2]).getDay();if(r!==i)return te(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function Pl(e,t,n){if(e)return Al[e];if(t)return 0;var r=parseInt(n,10),i=r%100,a=(r-i)/100;return a*60+i}function zr(e){var t=Ml.exec(kl(e._i)),n;if(t){if(n=El(t[4],t[3],t[2],t[5],t[6],t[7]),!Ll(t[1],n,e))return;e._a=n,e._tzm=Pl(t[8],t[9],t[10]),e._d=ds.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),te(e).rfc2822=!0}else e._isValid=!1}function Fl(e){var t=Ol.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(Wr(e),e._isValid===!1)delete e._isValid;else return;if(zr(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=We("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 Ht(e,t,n){return e??t??n}function Dl(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Un(e){var t,n,r=[],i,a,d;if(!e._d){for(i=Dl(e),e._w&&e._a[nt]==null&&e._a[ct]==null&&Yl(e),e._dayOfYear!=null&&(d=Ht(e._a[Ee],i[Ee]),(e._dayOfYear>os(d)||e._dayOfYear===0)&&(te(e)._overflowDayOfYear=!0),n=ds(d,0,e._dayOfYear),e._a[ct]=n.getUTCMonth(),e._a[nt]=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[Oe]===24&&e._a[Qe]===0&&e._a[dt]===0&&e._a[Mt]===0&&(e._nextDay=!0,e._a[Oe]=0),e._d=(e._useUTC?ds:zi).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[Oe]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==a&&(te(e).weekdayMismatch=!0)}}function Yl(e){var t,n,r,i,a,d,p,o,l;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(a=1,d=4,n=Ht(t.GG,e._a[Ee],hs(Ne(),1,4).year),r=Ht(t.W,1),i=Ht(t.E,1),(i<1||i>7)&&(o=!0)):(a=e._locale._week.dow,d=e._locale._week.doy,l=hs(Ne(),a,d),n=Ht(t.gg,e._a[Ee],l.year),r=Ht(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,d)?te(e)._overflowWeeks=!0:o!=null?te(e)._overflowWeekday=!0:(p=Dr(n,r,i,a,d),e._a[Ee]=p.year,e._dayOfYear=p.dayOfYear)}R.ISO_8601=function(){},R.RFC_2822=function(){};function $n(e){if(e._f===R.ISO_8601){Wr(e);return}if(e._f===R.RFC_2822){zr(e);return}e._a=[],te(e).empty=!0;var t=""+e._i,n,r,i,a,d,p=t.length,o=0,l,c;for(i=Tr(e._f,e._locale).match(wn)||[],c=i.length,n=0;n<c;n++)a=i[n],r=(t.match(wi(a,e))||[])[0],r&&(d=t.substr(0,t.indexOf(r)),d.length>0&&te(e).unusedInput.push(d),t=t.slice(t.indexOf(r)+r.length),o+=r.length),Dt[a]?(r?te(e).empty=!1:te(e).unusedTokens.push(a),Ci(a,r,e)):e._strict&&!r&&te(e).unusedTokens.push(a);te(e).charsLeftOver=p-o,t.length>0&&te(e).unusedInput.push(t),e._a[Oe]<=12&&te(e).bigHour===!0&&e._a[Oe]>0&&(te(e).bigHour=void 0),te(e).parsedDateParts=e._a.slice(0),te(e).meridiem=e._meridiem,e._a[Oe]=Ul(e._locale,e._a[Oe],e._meridiem),l=te(e).era,l!==null&&(e._a[Ee]=e._locale.erasConvertYear(l,e._a[Ee])),Un(e),Dn(e)}function Ul(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 $l(e){var t,n,r,i,a,d,p=!1,o=e._f.length;if(o===0){te(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<o;i++)a=0,d=!1,t=_n({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],$n(t),jn(t)&&(d=!0),a+=te(t).charsLeftOver,a+=te(t).unusedTokens.length*10,te(t).score=a,p?a<r&&(r=a,n=t):(r==null||a<r||d)&&(r=a,n=t,d&&(p=!0));_t(e,n||t)}function Hl(e){if(!e._d){var t=Cn(e._i),n=t.day===void 0?t.date:t.day;e._a=jr([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(r){return r&&parseInt(r,10)}),Un(e)}}function Bl(e){var t=new as(Dn(Gr(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Gr(e){var t=e._i,n=e._f;return e._locale=e._locale||ut(e._l),t===null||n===void 0&&t===""?Ms({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),Ke(t)?new as(Dn(t)):(rs(t)?e._d=t:qe(n)?$l(e):n?$n(e):Wl(e),jn(e)||(e._d=null),e))}function Wl(e){var t=e._i;Pe(t)?e._d=new Date(R.now()):rs(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Fl(e):qe(t)?(e._a=jr(t.slice(0),function(n){return parseInt(n,10)}),Un(e)):Ot(t)?Hl(e):lt(t)?e._d=new Date(t):R.createFromInputFallback(e)}function Vr(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),(Ot(e)&&xn(e)||qe(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,Bl(a)}function Ne(e,t,n,r){return Vr(e,t,n,r,!1)}var zl=We("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ne.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Ms()}),Gl=We("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Ne.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Ms()});function qr(e,t){var n,r;if(t.length===1&&qe(t[0])&&(t=t[0]),!t.length)return Ne();for(n=t[0],r=1;r<t.length;++r)(!t[r].isValid()||t[r][e](n))&&(n=t[r]);return n}function Vl(){var e=[].slice.call(arguments,0);return qr("isBefore",e)}function ql(){var e=[].slice.call(arguments,0);return qr("isAfter",e)}var Kl=function(){return Date.now?Date.now():+new Date},fs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ql(e){var t,n=!1,r,i=fs.length;for(t in e)if(de(e,t)&&!(_e.call(fs,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(r=0;r<i;++r)if(e[fs[r]]){if(n)return!1;parseFloat(e[fs[r]])!==re(e[fs[r]])&&(n=!0)}return!0}function Zl(){return this._isValid}function Xl(){return Ze(NaN)}function Bs(e){var t=Cn(e),n=t.year||0,r=t.quarter||0,i=t.month||0,a=t.week||t.isoWeek||0,d=t.day||0,p=t.hour||0,o=t.minute||0,l=t.second||0,c=t.millisecond||0;this._isValid=Ql(t),this._milliseconds=+c+l*1e3+o*6e4+p*1e3*60*60,this._days=+d+a*7,this._months=+i+r*3+n*12,this._data={},this._locale=ut(),this._bubble()}function Ws(e){return e instanceof Bs}function Hn(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Jl(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),a=0,d;for(d=0;d<r;d++)re(e[d])!==re(t[d])&&a++;return a+i}function Kr(e,t){W(e,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+st(~~(n/60),2)+t+st(~~n%60,2)})}Kr("Z",":"),Kr("ZZ",""),U("Z",Fs),U("ZZ",Fs),ye(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Bn(Fs,e)});var eo=/([\+\-]|\d\d)/gi;function Bn(e,t){var n=(t||"").match(e),r,i,a;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(eo)||["-",0,0],a=+(i[1]*60)+re(i[2]),a===0?0:i[0]==="+"?a:-a)}function Wn(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(Ke(e)||rs(e)?e.valueOf():Ne(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),R.updateOffset(n,!1),n):Ne(e).local()}function zn(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function to(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=Bn(Fs,e),e===null)return this}else Math.abs(e)<16&&!n&&(e=e*60);return!this._isUTC&&t&&(i=zn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!t||this._changeInProgress?Jr(this,Ze(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:zn(this)}function so(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function no(e){return this.utcOffset(0,e)}function ro(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(zn(this),"m")),this}function ao(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=Bn(Si,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function io(e){return this.isValid()?(e=e?Ne(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function lo(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function oo(){if(!Pe(this._isDSTShifted))return this._isDSTShifted;var e={},t;return _n(e,this),e=Gr(e),e._a?(t=e._isUTC?et(e._a):Ne(e._a),this._isDSTShifted=this.isValid()&&Jl(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function co(){return this.isValid()?!this._isUTC:!1}function ho(){return this.isValid()?this._isUTC:!1}function Qr(){return this.isValid()?this._isUTC&&this._offset===0:!1}var uo=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,mo=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ze(e,t){var n=e,r=null,i,a,d;return Ws(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:lt(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=uo.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:re(r[nt])*i,h:re(r[Oe])*i,m:re(r[Qe])*i,s:re(r[dt])*i,ms:re(Hn(r[Mt]*1e3))*i}):(r=mo.exec(e))?(i=r[1]==="-"?-1:1,n={y:At(r[2],i),M:At(r[3],i),w:At(r[4],i),d:At(r[5],i),h:At(r[6],i),m:At(r[7],i),s:At(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(d=fo(Ne(n.from),Ne(n.to)),n={},n.ms=d.milliseconds,n.M=d.months),a=new Bs(n),Ws(e)&&de(e,"_locale")&&(a._locale=e._locale),Ws(e)&&de(e,"_isValid")&&(a._isValid=e._isValid),a}Ze.fn=Bs.prototype,Ze.invalid=Xl;function At(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Zr(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 fo(e,t){var n;return e.isValid()&&t.isValid()?(t=Wn(t,e),e.isBefore(t)?n=Zr(e,t):(n=Zr(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)&&(Sr(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=Ze(n,r),Jr(this,i,e),this}}function Jr(e,t,n,r){var i=t._milliseconds,a=Hn(t._days),d=Hn(t._months);e.isValid()&&(r=r??!0,d&&Lr(e,cs(e,"Month")+d*n),a&&Er(e,"Date",cs(e,"Date")+a*n),i&&e._d.setTime(e._d.valueOf()+i*n),r&&R.updateOffset(e,a||d))}var po=Xr(1,"add"),yo=Xr(-1,"subtract");function ea(e){return typeof e=="string"||e instanceof String}function go(e){return Ke(e)||rs(e)||ea(e)||lt(e)||No(e)||xo(e)||e===null||e===void 0}function xo(e){var t=Ot(e)&&!xn(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,d=r.length;for(i=0;i<d;i+=1)a=r[i],n=n||de(e,a);return t&&n}function No(e){var t=qe(e),n=!1;return t&&(n=e.filter(function(r){return!lt(r)&&ea(e)}).length===0),t&&n}function jo(e){var t=Ot(e)&&!xn(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 vo(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 _o(e,t){arguments.length===1&&(arguments[0]?go(arguments[0])?(e=arguments[0],t=void 0):jo(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Ne(),r=Wn(n,this).startOf("day"),i=R.calendarFormat(this,r)||"sameElse",a=t&&(tt(t[i])?t[i].call(this,n):t[i]);return this.format(a||this.localeData().calendar(i,this,Ne(n)))}function bo(){return new as(this)}function So(e,t){var n=Ke(e)?e:Ne(e);return this.isValid()&&n.isValid()?(t=ze(t)||"millisecond",t==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf()):!1}function To(e,t){var n=Ke(e)?e:Ne(e);return this.isValid()&&n.isValid()?(t=ze(t)||"millisecond",t==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf()):!1}function wo(e,t,n,r){var i=Ke(e)?e:Ne(e),a=Ke(t)?t:Ne(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 Io(e,t){var n=Ke(e)?e:Ne(e),r;return this.isValid()&&n.isValid()?(t=ze(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 Co(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Oo(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function Mo(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(r=Wn(e,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,t=ze(t),t){case"year":a=zs(this,r)/12;break;case"month":a=zs(this,r);break;case"quarter":a=zs(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:Ge(a)}function zs(e,t){if(e.date()<t.date())return-zs(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}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Ao(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Eo(e){if(!this.isValid())return null;var t=e!==!0,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?Es(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):tt(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Es(n,"Z")):Es(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ro(){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 ko(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Es(this,e);return this.localeData().postformat(t)}function Lo(e,t){return this.isValid()&&(Ke(e)&&e.isValid()||Ne(e).isValid())?Ze({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Po(e){return this.from(Ne(),e)}function Fo(e,t){return this.isValid()&&(Ke(e)&&e.isValid()||Ne(e).isValid())?Ze({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Do(e){return this.to(Ne(),e)}function ta(e){var t;return e===void 0?this._locale._abbr:(t=ut(e),t!=null&&(this._locale=t),this)}var sa=We("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 na(){return this._locale}var Gs=1e3,Bt=60*Gs,Vs=60*Bt,ra=(365*400+97)*24*Vs;function Wt(e,t){return(e%t+t)%t}function aa(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-ra:new Date(e,t,n).valueOf()}function ia(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-ra:Date.UTC(e,t,n)}function Yo(e){var t,n;if(e=ze(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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-=Wt(t+(this._isUTC?0:this.utcOffset()*Bt),Vs);break;case"minute":t=this._d.valueOf(),t-=Wt(t,Bt);break;case"second":t=this._d.valueOf(),t-=Wt(t,Gs);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function Uo(e){var t,n;if(e=ze(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?ia:aa,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+=Vs-Wt(t+(this._isUTC?0:this.utcOffset()*Bt),Vs)-1;break;case"minute":t=this._d.valueOf(),t+=Bt-Wt(t,Bt)-1;break;case"second":t=this._d.valueOf(),t+=Gs-Wt(t,Gs)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function $o(){return this._d.valueOf()-(this._offset||0)*6e4}function Ho(){return Math.floor(this.valueOf()/1e3)}function Bo(){return new Date(this.valueOf())}function Wo(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function zo(){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 Go(){return this.isValid()?this.toISOString():null}function Vo(){return jn(this)}function qo(){return _t({},te(this))}function Ko(){return te(this).overflow}function Qo(){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"),U("N",Gn),U("NN",Gn),U("NNN",Gn),U("NNNN",lc),U("NNNNN",oc),ye(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var i=n._locale.erasParse(e,r,n._strict);i?te(n).era=i:te(n).invalidEra=e}),U("y",Yt),U("yy",Yt),U("yyy",Yt),U("yyyy",Yt),U("yo",cc),ye(["y","yy","yyy","yyyy"],Ee),ye(["yo"],function(e,t,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Ee]=n._locale.eraYearOrdinalParse(e,i):t[Ee]=parseInt(e,10)});function Zo(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=R(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=R(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(),d,p,o;for(e=e.toUpperCase(),r=0,i=a.length;r<i;++r)if(d=a[r].name.toUpperCase(),p=a[r].abbr.toUpperCase(),o=a[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(p===e)return a[r];break;case"NNNN":if(d===e)return a[r];break;case"NNNNN":if(o===e)return a[r];break}else if([d,p,o].indexOf(e)>=0)return a[r]}function Jo(e,t){var n=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*n}function ec(){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 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].narrow;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].abbr;return""}function nc(){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()-R(i[e].since).year())*n+i[e].offset;return this.year()}function rc(e){return de(this,"_erasNameRegex")||Vn.call(this),e?this._erasNameRegex:this._erasRegex}function ac(e){return de(this,"_erasAbbrRegex")||Vn.call(this),e?this._erasAbbrRegex:this._erasRegex}function ic(e){return de(this,"_erasNarrowRegex")||Vn.call(this),e?this._erasNarrowRegex:this._erasRegex}function Gn(e,t){return t.erasAbbrRegex(e)}function lc(e,t){return t.erasNameRegex(e)}function oc(e,t){return t.erasNarrowRegex(e)}function cc(e,t){return t._eraYearOrdinalRegex||Yt}function Vn(){var e=[],t=[],n=[],r=[],i,a,d,p,o,l=this.eras();for(i=0,a=l.length;i<a;++i)d=ot(l[i].name),p=ot(l[i].abbr),o=ot(l[i].narrow),t.push(d),e.push(p),n.push(o),r.push(d),r.push(p),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 qs(e,t){W(0,[e,e.length],0,t)}qs("gggg","weekYear"),qs("ggggg","weekYear"),qs("GGGG","isoWeekYear"),qs("GGGGG","isoWeekYear"),U("G",Ps),U("g",Ps),U("GG",xe,$e),U("gg",xe,$e),U("GGGG",Mn,On),U("gggg",Mn,On),U("GGGGG",Ls,Rs),U("ggggg",Ls,Rs),ls(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=re(e)}),ls(["gg","GG"],function(e,t,n,r){t[r]=R.parseTwoDigitYear(e)});function dc(e){return la.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function hc(e){return la.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function uc(){return ht(this.year(),1,4)}function mc(){return ht(this.isoWeekYear(),1,4)}function fc(){var e=this.localeData()._week;return ht(this.year(),e.dow,e.doy)}function pc(){var e=this.localeData()._week;return ht(this.weekYear(),e.dow,e.doy)}function la(e,t,n,r,i){var a;return e==null?hs(this,r,i).year:(a=ht(e,r,i),t>a&&(t=a),yc.call(this,e,t,n,r,i))}function yc(e,t,n,r,i){var a=Dr(e,t,n,r,i),d=ds(a.year,0,a.dayOfYear);return this.year(d.getUTCFullYear()),this.month(d.getUTCMonth()),this.date(d.getUTCDate()),this}W("Q",0,"Qo","quarter"),U("Q",Ir),ye("Q",function(e,t){t[ct]=(re(e)-1)*3});function gc(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}W("D",["DD",2],"Do","date"),U("D",xe,Ut),U("DD",xe,$e),U("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],nt),ye("Do",function(e,t){t[nt]=re(e.match(xe)[0])});var oa=$t("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),U("DDD",ks),U("DDDD",Cr),ye(["DDD","DDDD"],function(e,t,n){n._dayOfYear=re(e)});function xc(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"),U("m",xe,An),U("mm",xe,$e),ye(["m","mm"],Qe);var Nc=$t("Minutes",!1);W("s",["ss",2],0,"second"),U("s",xe,An),U("ss",xe,$e),ye(["s","ss"],dt);var jc=$t("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}),U("S",ks,Ir),U("SS",ks,$e),U("SSS",ks,Cr);var St,ca;for(St="SSSS";St.length<=9;St+="S")U(St,Yt);function vc(e,t){t[Mt]=re(("0."+e)*1e3)}for(St="S";St.length<=9;St+="S")ye(St,vc);ca=$t("Milliseconds",!1),W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");function _c(){return this._isUTC?"UTC":""}function bc(){return this._isUTC?"Coordinated Universal Time":""}var E=as.prototype;E.add=po,E.calendar=_o,E.clone=bo,E.diff=Mo,E.endOf=Uo,E.format=ko,E.from=Lo,E.fromNow=Po,E.to=Fo,E.toNow=Do,E.get=Ei,E.invalidAt=Ko,E.isAfter=So,E.isBefore=To,E.isBetween=wo,E.isSame=Io,E.isSameOrAfter=Co,E.isSameOrBefore=Oo,E.isValid=Vo,E.lang=sa,E.locale=ta,E.localeData=na,E.max=Gl,E.min=zl,E.parsingFlags=qo,E.set=Ri,E.startOf=Yo,E.subtract=yo,E.toArray=Wo,E.toObject=zo,E.toDate=Bo,E.toISOString=Eo,E.inspect=Ro,typeof Symbol<"u"&&Symbol.for!=null&&(E[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),E.toJSON=Go,E.toString=Ao,E.unix=Ho,E.valueOf=$o,E.creationData=Qo,E.eraName=ec,E.eraNarrow=tc,E.eraAbbr=sc,E.eraYear=nc,E.year=Ar,E.isLeapYear=Ai,E.weekYear=dc,E.isoWeekYear=hc,E.quarter=E.quarters=gc,E.month=Pr,E.daysInMonth=Hi,E.week=E.weeks=Qi,E.isoWeek=E.isoWeeks=Zi,E.weeksInYear=fc,E.weeksInWeekYear=pc,E.isoWeeksInYear=uc,E.isoWeeksInISOWeekYear=mc,E.date=oa,E.day=E.days=dl,E.weekday=hl,E.isoWeekday=ul,E.dayOfYear=xc,E.hour=E.hours=Nl,E.minute=E.minutes=Nc,E.second=E.seconds=jc,E.millisecond=E.milliseconds=ca,E.utcOffset=to,E.utc=no,E.local=ro,E.parseZone=ao,E.hasAlignedHourOffset=io,E.isDST=lo,E.isLocal=co,E.isUtcOffset=ho,E.isUtc=Qr,E.isUTC=Qr,E.zoneAbbr=_c,E.zoneName=bc,E.dates=We("dates accessor is deprecated. Use date instead.",oa),E.months=We("months accessor is deprecated. Use month instead",Pr),E.years=We("years accessor is deprecated. Use year instead",Ar),E.zone=We("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",so),E.isDSTShifted=We("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",oo);function Sc(e){return Ne(e*1e3)}function Tc(){return Ne.apply(null,arguments).parseZone()}function da(e){return e}var he=Sn.prototype;he.calendar=ci,he.longDateFormat=mi,he.invalidDate=pi,he.ordinal=xi,he.preparse=da,he.postformat=da,he.relativeTime=ji,he.pastFuture=vi,he.set=li,he.eras=Zo,he.erasParse=Xo,he.erasConvertYear=Jo,he.erasAbbrRegex=ac,he.erasNameRegex=rc,he.erasNarrowRegex=ic,he.months=Di,he.monthsShort=Yi,he.monthsParse=$i,he.monthsRegex=Wi,he.monthsShortRegex=Bi,he.week=Gi,he.firstDayOfYear=Ki,he.firstDayOfWeek=qi,he.weekdays=al,he.weekdaysMin=ll,he.weekdaysShort=il,he.weekdaysParse=cl,he.weekdaysRegex=ml,he.weekdaysShortRegex=fl,he.weekdaysMinRegex=pl,he.isPM=gl,he.meridiem=jl;function Ks(e,t,n,r){var i=ut(),a=et().set(r,t);return i[n](a,e)}function ha(e,t,n){if(lt(e)&&(t=e,e=void 0),e=e||"",t!=null)return Ks(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ks(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,d,p=[];if(n!=null)return Ks(t,(n+a)%7,r,"day");for(d=0;d<7;d++)p[d]=Ks(t,(d+a)%7,r,"day");return p}function wc(e,t){return ha(e,t,"months")}function Ic(e,t){return ha(e,t,"monthsShort")}function Cc(e,t,n){return qn(e,t,n,"weekdays")}function Oc(e,t,n){return qn(e,t,n,"weekdaysShort")}function Mc(e,t,n){return qn(e,t,n,"weekdaysMin")}bt("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}}),R.lang=We("moment.lang is deprecated. Use moment.locale instead.",bt),R.langData=We("moment.langData is deprecated. Use moment.localeData instead.",ut);var mt=Math.abs;function Ac(){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 ua(e,t,n,r){var i=Ze(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function Ec(e,t){return ua(this,e,t,1)}function Rc(e,t){return ua(this,e,t,-1)}function ma(e){return e<0?Math.floor(e):Math.ceil(e)}function kc(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,a,d,p,o;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ma(Kn(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=Ge(e/1e3),r.seconds=i%60,a=Ge(i/60),r.minutes=a%60,d=Ge(a/60),r.hours=d%24,t+=Ge(d/24),o=Ge(fa(t)),n+=o,t-=ma(Kn(o)),p=Ge(n/12),n%=12,r.days=t,r.months=n,r.years=p,this}function fa(e){return e*4800/146097}function Kn(e){return e*146097/4800}function Lc(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=ze(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+fa(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Kn(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 pa=ft("ms"),Pc=ft("s"),Fc=ft("m"),Dc=ft("h"),Yc=ft("d"),Uc=ft("w"),$c=ft("M"),Hc=ft("Q"),Bc=ft("y"),Wc=pa;function zc(){return Ze(this)}function Gc(e){return e=ze(e),this.isValid()?this[e+"s"]():NaN}function Et(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vc=Et("milliseconds"),qc=Et("seconds"),Kc=Et("minutes"),Qc=Et("hours"),Zc=Et("days"),Xc=Et("months"),Jc=Et("years");function ed(){return Ge(this.days()/7)}var pt=Math.round,zt={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function td(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function sd(e,t,n,r){var i=Ze(e).abs(),a=pt(i.as("s")),d=pt(i.as("m")),p=pt(i.as("h")),o=pt(i.as("d")),l=pt(i.as("M")),c=pt(i.as("w")),u=pt(i.as("y")),m=a<=n.ss&&["s",a]||a<n.s&&["ss",a]||d<=1&&["m"]||d<n.m&&["mm",d]||p<=1&&["h"]||p<n.h&&["hh",p]||o<=1&&["d"]||o<n.d&&["dd",o];return n.w!=null&&(m=m||c<=1&&["w"]||c<n.w&&["ww",c]),m=m||l<=1&&["M"]||l<n.M&&["MM",l]||u<=1&&["y"]||["yy",u],m[2]=t,m[3]=+e>0,m[4]=r,td.apply(null,m)}function nd(e){return e===void 0?pt:typeof e=="function"?(pt=e,!0):!1}function rd(e,t){return zt[e]===void 0?!1:t===void 0?zt[e]:(zt[e]=t,e==="s"&&(zt.ss=t-1),!0)}function ad(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=zt,i,a;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},zt,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),i=this.localeData(),a=sd(this,!n,r,i),n&&(a=i.pastFuture(+this,a)),i.postformat(a)}var Qn=Math.abs;function Gt(e){return(e>0)-(e<0)||+e}function Qs(){if(!this.isValid())return this.localeData().invalidDate();var e=Qn(this._milliseconds)/1e3,t=Qn(this._days),n=Qn(this._months),r,i,a,d,p=this.asSeconds(),o,l,c,u;return p?(r=Ge(e/60),i=Ge(r/60),e%=60,r%=60,a=Ge(n/12),n%=12,d=e?e.toFixed(3).replace(/\.?0+$/,""):"",o=p<0?"-":"",l=Gt(this._months)!==Gt(p)?"-":"",c=Gt(this._days)!==Gt(p)?"-":"",u=Gt(this._milliseconds)!==Gt(p)?"-":"",o+"P"+(a?l+a+"Y":"")+(n?l+n+"M":"")+(t?c+t+"D":"")+(i||r||e?"T":"")+(i?u+i+"H":"")+(r?u+r+"M":"")+(e?u+d+"S":"")):"P0D"}var ie=Bs.prototype;ie.isValid=Zl,ie.abs=Ac,ie.add=Ec,ie.subtract=Rc,ie.as=Lc,ie.asMilliseconds=pa,ie.asSeconds=Pc,ie.asMinutes=Fc,ie.asHours=Dc,ie.asDays=Yc,ie.asWeeks=Uc,ie.asMonths=$c,ie.asQuarters=Hc,ie.asYears=Bc,ie.valueOf=Wc,ie._bubble=kc,ie.clone=zc,ie.get=Gc,ie.milliseconds=Vc,ie.seconds=qc,ie.minutes=Kc,ie.hours=Qc,ie.days=Zc,ie.weeks=ed,ie.months=Xc,ie.years=Jc,ie.humanize=ad,ie.toISOString=Qs,ie.toString=Qs,ie.toJSON=Qs,ie.locale=ta,ie.localeData=na,ie.toIsoString=We("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qs),ie.lang=sa,W("X",0,0,"unix"),W("x",0,0,"valueOf"),U("x",Ps),U("X",Ti),ye("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)}),ye("x",function(e,t,n){n._d=new Date(re(e))});//! moment.js
39
+ R.version="2.30.1",ai(Ne),R.fn=E,R.min=Vl,R.max=ql,R.now=Kl,R.utc=et,R.unix=Sc,R.months=wc,R.isDate=rs,R.locale=bt,R.invalid=Ms,R.duration=Ze,R.isMoment=Ke,R.weekdays=Cc,R.parseZone=Tc,R.localeData=ut,R.isDuration=Ws,R.monthsShort=Ic,R.weekdaysMin=Mc,R.defineLocale=Fn,R.updateLocale=Sl,R.locales=Tl,R.weekdaysShort=Oc,R.normalizeUnits=ze,R.relativeTimeRounding=nd,R.relativeTimeThreshold=rd,R.calendarFormat=vo,R.prototype=E,R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const Tt=(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},Xe=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(" ")},Zn=(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},id=e=>{let t,n=new Object;for(let r=0;r<e.length;r++)t=e[r],n[t]=t;return n},ld=(e,t)=>(e.sort((n,r)=>r[t]-n[t]),e),Zs=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",Xs={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 od(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(m){if(m<10)return t[m];if(m<20)return n[m-11];{const f=m%10,x=Math.floor(m/10);return`${r[x]}${f?" "+t[f]:""}`}}function a(m){var f=m.toString(),x,_,j,T,S,M,F,C,z,Z,se,Q,ue="and";if(f=f.replace(/[, ]/g,""),parseInt(f)===0)return"zero";for(x=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],_=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"],j=["","Thousand","Million","Billion","Trillion","Quadrillion","Quintillion","Sextillion","Septillion","Octillion","Nonillion","Decillion","Undecillion","Duodecillion","Tredecillion","Quatttuor-Decillion","quindecillion","sexdecillion","septen-decillion","octodecillion","novemdecillion","vigintillion","centillion"],T=f.length,M=[];T>0;)S=T,M.push(f.slice(T=Math.max(0,T-3),S));if(F=M.length,F>j.length)return"";for(Q=[],Z=0;Z<F;Z++)C=parseInt(M[Z]),C&&(z=M[Z].split("").reverse().map(parseFloat),z[1]===1&&(z[0]+=10),(se=j[Z])&&Q.push(se),(se=x[z[0]])&&Q.push(se),(se=_[z[1]])&&Q.push(se),(z[0]||z[1])&&(z[2]||Z+1>F)&&Q.push(ue),(se=x[z[2]])&&Q.push(se+" Hundred"));return Q.reverse().join(" ")}const[d,p]=e.toString().split("."),o=a(parseInt(d,10)),l=i(parseInt(p,10)),c=l?`${l} Paise`:"";return`${o} Rupees ${c&&"And "+c?c:""} Only`}const oe=(e,t)=>`${Xs[t].symbol} ${roundAccordingly(e||0,t)}`,$=(e,t)=>`${Xs[t].symbol} ${formatDecimalPlaces(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},cd=e=>+(Math.round(parseFloat(e)*1e3)/1e3).toFixed(3),Jn=(e,t="type",n)=>{const r={},i=n==null?void 0:n.separateItemsDisc;return e.forEach(d=>{var p;(p=d.discounts)==null||p.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:cd(o.discountAmt),discountName:o.discountName}}})}),Object.values(r)},er=(e,t="type")=>{const n={};return e.forEach(i=>{var a;(a=i.dish_charges)==null||a.forEach(d=>{const p=`${d[t]}`;n[p]?(n[p].amt+=d.amt,n[p].taxAmt+=d.taxAmt):n[p]={amt:d.amt,chargeType:d.chargeType?d.chargeType:d.type,defaultSelcted:d.defaultSelcted,rate:d.rate,tax:d.tax,taxAmt:d.taxAmt,name:d.name,type:d.type}})}),Object.values(n)},tr=e=>{const t=e==null?void 0:e.split("-");return(t==null?void 0:t.length)===3?`${t[2]}-${t[1]}-${t[0]}`:null};function ps(e,t){const n=Buffer.from([e],"utf8"),r=Buffer.from([t.length],"utf8"),i=Buffer.from(t,"utf8"),a=[n,r,i];return Buffer.concat(a)}function dd(e,t,n,r,i){const a=ps("1",e),d=ps("2",t),p=ps("3",n),o=ps("4",r),l=ps("5",i);var c=Buffer.concat([a,d,p,o,l]);return c.toString("base64")}const hd=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"}),we=e=>+(Math.round(parseFloat(e)+"e+3")+"e-3"),yt=e=>+(Math.round(parseFloat(e)+"e+2")+"e-2"),ys=Xn(),ud=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),d=Math.floor(t%3600/60),p=`${a} hr ${d} min`;return p}else return r},md=(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=Zn(i,"internalName");let d;for(let p in e.paymentModes)!r[p]&&e.paymentModes[p]&&(d=a[p],n.push({displayName:d?d.displayName:Xe(p.replace("_"," ")),value:yt(e.paymentModes[p])}));return n},fd=(e,t)=>e>0&&t>0?e/t:0;function Vt(e){return new Promise((t,n)=>{try{var r=new Image;r.src=e,r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{var i=document.createElement("canvas");i.width=r.width,i.height=r.height;var a=i.getContext("2d");a.drawImage(r,0,0);var d=i.toDataURL("image/png");t(d)},r.onerror=i=>{t(null)}}catch{t(null)}})}const Js=(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 console.log("OLD FLOW"),!0},sr=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},nr=(e,t)=>{var c;let n,r,i,a,d;const p={},{itemInstructionOnBill:o,printZeroPriceAddons:l}=t;for(let u=0;u<e.length;u++)if(n=e[u],n.status!=="CANCELLED"){if((c=n.addons)!=null&&c.length&&!l)for(i=[],d=0;d<n.addons.length;d++)a=n.addons[d],a.serviceRate&&i.push(a);else i=n.addons;o?r=`${n.serviceId}::${n.serviceRate}::${n.instruction}::${n.taxType??"GST"}`:r=`${n.serviceId}::${n.serviceRate}::${n.taxType??"GST"}`,p[r]?(p[r].qty+=n.qty,p[r].sub_total+=n.sub_total):p[r]=JSON.parse(JSON.stringify({...n,addons:i}))}return Object.values(p)},rr=e=>{var p;let t,n,r,i,a={},d=0;for(let o=0;o<e.length;o++)if(t=e[o],(p=t.taxation)!=null&&p.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),d+=r.taxAmt):(a[i]=JSON.parse(JSON.stringify(r)),d+=r.taxAmt);return{obj:Object.values(a),sum:d}},ar=(e,t,n)=>{var a,d,p,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 Js((a=t.siteSetting)==null?void 0:a.billPrinters,i,"label");if(t.type=="PACKAGING_SLIP"){let l=Js((d=t.siteSetting)==null?void 0:d.packagingSlipPrinters,i,"value");if(ys=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==e.value):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.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 Js((p=t.siteSetting)==null?void 0:p.billPrinters,i,"value");{let l=Js((o=t.siteSetting)==null?void 0:o.printers,i,"value");if(l===!0)return l;if(ys=="Android OS"){let c=l&&l.length>0?l.findIndex(u=>u.value==(e==null?void 0:e.value)):-1;return c!=-1?[l[c]]:null}else{let c=l&&l.length>0?l.findIndex(u=>u.value==e):-1;return c!=-1?[l[c]]:null}}}},pd=(e,t,n={})=>{var j;const{usersObj:r}=n;let i={},a,d;const{cancelledKOT:p,onlyCancelledItems:o,kotStatus:l="KOT_GENERATED"}=n,c=Tt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((j=e.customFeilds)!=null&&j.length){let T=Tt(e.customFeilds,"INSTRUCTION","customType");T!=null&&T.customValue&&(d=[{customName:T.customName,customValue:T.customValue}])}e.orderList.filter(T=>{a=T.services.sort(S=>S.status==="CANCELLED"?-1:0),a.forEach((S,M)=>{var be,V,ce;let F=S.station?S.station.split("::"):"",C=F&&F.length>1?F[1]:F[0],z=e.tableNo?e.tableNo.split("::"):null,Z=z&&z.length>0?z[0]:e.orderFrom,se=e.tableName?e.tableName:e.tableNo?Z:e.orderFrom,Q;(be=r==null?void 0:r[T.createdBy])!=null&&be.name&&(Q=r[T.createdBy].name);let ue=!1;(p||C&&S.status==l)&&(ue=!0),ue&&ir(C)?(i[C]||(i[C]={},i[C].station=C,i[C].services=[],i[C].tableName=se,i[C].customerName=e.name==t.companyName?null:e.name,i[C].time=R().format("DD-MM-YYYY hh:mm a"),i[C].type=e.orderFrom,i[C].subOrderFrom=e.subOrderFrom,i[C].orderId=e.externalOrderId||e.offlineOrderId?e.orderId:T.subOrderId,i[C].orderId=new Set([i[C].orderId]),i[C].instruction=e.instruction,i[C].orderSource=e.orderSource,i[C].deliveryTimestamp=e.deliveryTimestamp?R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A"):null,i[C].aggregatorOrderId=e.externalOrderId,i[C].otp=e.otp,i[C].totalQty=0,i[C].tokenId=e.tokenId,i[C].kotId=S.kotId?new Set([S.kotId]):null,i[C].waiterName=e.waiterName,i[C].duplicate=p,i[C].createdBy=Q,i[C].zomatoInstant=c,d&&(i[C].customFields=d),o&&(i[C].onlyCancelledItems=o),e.preparationTime&&(i[C].prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A"))),i[C]?(i[C].services.push({serviceName:S.serviceName,qty:S.qty,instruction:S.isUrgent&&S.instruction?`(URGENT -${S.instruction})`:S.instruction?`(${S.instruction})`:S.isUrgent?"(URGENT)":"",subOrderId:T.subOrderId,isUrgent:S.isUrgent,index:M,status:S.status,addons:S.addons}),i[C].totalQty+=we(S.qty),(V=i[C].kotId)==null||V.add(S.kotId),e.externalOrderId||e.offlineOrderId||(ce=i[C].orderId)==null||ce.add(T.subOrderId)):(console.log("else"),i[C]=[],i[C].services.push({serviceName:S.serviceName,qty:S.qty,instruction:S.instruction?S.instruction:"",subOrderId:T.subOrderId,index:M,status:S.status}),i[C].totalQty+=we(S.qty))):console.log("cancelledKOT ::")})});let u={},m="2INCH";Xn();let f,x=[],_={};for(const T in i)if(Object.hasOwnProperty.call(i,T)){const S=i[T];try{t.printers&&t.printers.map(M=>{M.label.toUpperCase()==S.station.toUpperCase()&&(f=ys=="Android OS"?M:M.value??void 0,m=M.paperSize?M.paperSize:t.printerSize,x.push({printer:f,paperSize:m}))}),x.length==0&&x.push({printer:f,paperSize:t.printerSize||m});for(let M=0;M<S.services.length;M++){let F=S.services[M],C=e.orderList.find(Z=>Z.subOrderId==F.subOrderId),z=u[F.subOrderId];C&&(z?z.services.push(C.services[F.index]):(u[F.subOrderId]={},u[F.subOrderId].subOrderId=C.subOrderId,u[F.subOrderId].services=[C.services[F.index]]))}}catch(M){console.log(M)}_[T]=x,x=[],f=null}for(const T in u)Object.hasOwnProperty.call(u,T)&&u[T];return{obj:i,paperSize:m,printer:f,printersMap:_}},yd=(e,t,n)=>{var i,a;const{kotStatus:r="KOT_GENERATED"}=n;try{let d="2INCH",p,o=[],l,c;const u=Tt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((i=e.customFeilds)!=null&&i.length){let m=Tt(e.customFeilds,"INSTRUCTION","customType");m!=null&&m.customValue&&(c=[{customName:m.customName,customValue:m.customValue}])}for(let m=0;m<t.packagingSlipPrinters.length;m++)if(l=t.packagingSlipPrinters[m],l.label==e.subOrderFrom&&(p=ys=="Android OS"?l:l.value??void 0,d=l.paperSize?l.paperSize:d,l.paperSize)){let f,x,_,j,T,S={orderFrom:e.orderFrom,subOrderFrom:e.subOrderFrom,companyInfo:{companyName:t.companyName},tokenId:e.tokenId,orderId:e.orderId,customerInfo:{custName:e.name,custContact:e.mobile},paymentMethods:e.paymentMethods,newId:Math.random(),date:R().format("DD-MM-YYYY hh:mm a"),tableName:e.tableName,tableName:e.tableName,waiterName:e.waiterName,paymentStatus:e.paymentStatus??"UNPAID",aggregatorOrderId:e.externalOrderId,orderSource:e.orderSource,otp:e.otp,zomatoInstant:u},M={},F=!1,C,z=0;for(e.preparationTime&&(S.prepareBy=R().add(e.preparationTime,"minutes").format("DD-MM-YYYY hh:mm A")),c&&(S.customFields=c),_=0;_<e.orderList.length;_++)for(f=e.orderList[_],j=0;j<f.services.length;j++)x=f.services[j],x={...x,instruction:x.isUrgent&&x.instruction?`(URGENT -${x.instruction})`:x.instruction?`(${x.instruction})`:x.isUrgent?"(URGENT)":null},F=!1,x.status===r&&((a=l.stations)!=null&&a.length?(C=id(l.stations),C[x.station]&&(F=!0)):F=!0),F&&x.kotId&&x.station&&(T=x.station.split("::")[1],z+=x.qty,M[`${T}/${x.kotId}`]?M[`${T}/${x.kotId}`].push(x):M[`${T}/${x.kotId}`]=[x]);Object.keys(M).length&&(S.services=M,S.totalQty=yt(z),o.push({printer:p,paperSize:d,obj:S}))}return{printers:o}}catch(d){console.log(d)}},gd=(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 u=(c=l.station.split("::"))==null?void 0:c[1];u&&ir(u)&&(r[u]?r[u].activeKots[l.kotId]=l.kotId:r[u]={from:[n.from],to:[n.to],station:u,activeKots:{[l.kotId]:l.kotId},type:"UPDATE_TABLE",action:"SWITCH_TABLE",orderId:l.id})}})});else{let o,l,c,u,m={},f=[];for(l=0;l<n.sources.length;l++)for(o=n.sources[l],f.push(o.tableNo),c=0;c<o.ids.length;c++)u=o.ids[c],m[u]=u;for(let x=0;x<n.orderData.length;x++)o=n.orderData[x],m[o.id]&&o.orderList.forEach(_=>{_.services.forEach(j=>{var T;if((j.status==="KOT_GENERATED"||j.status==="IN_PROCESS")&&j.station){let S=(T=j.station.split("::"))==null?void 0:T[1];S&&ir(S)&&(r[S]?r[S].activeKots[j.kotId]=j.kotId:r[S]={from:f,to:[n.to],station:S,activeKots:{[j.kotId]:j.kotId},type:"UPDATE_TABLE",action:"MERGE_TABLE",orderId:j.id})}})})}let i="2INCH",a,d=[],p={};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?ys=="Android OS"?c:c.value:void 0,i=c.paperSize?c.paperSize:t.printerSize,d.push({printer:a,paperSize:i}))}),d.length==0&&d.push({printer:a,paperSize:t.printerSize||i})}catch(c){console.log(c)}p[o]=d,d=[],a=null}return{obj:r,paperSize:i,printersMap:p}},xd=(e,t)=>{var M,F;let{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d,rangeDate:p}=t;console.log(e,{serviceTypeConfig:n,salesCollection:r,todayCollection:i,dailyExpanse:a,collectionDate:d});let o={},l;const c=!!Tt(n,"dine-in","slugName").slugName;if(i!=null&&i.AGGREGATOR_PAYMENT){const{AGGREGATOR_PAYMENT:C,...z}=i;i={...z,swiggy:r.swiggy_collection??0,zomato:r.zomato_collection??0}}let u=c&&(n==null?void 0:n.length)&&n.some(C=>C.slugName==="online-menu")&&e.isAggregatorEnabled==!0,m=u?r.aggregator_collection:void 0,f=u?r.zomato_collection:void 0,x=u?r.swiggy_collection:void 0,_=c?ud(r.avgTableTime):void 0;l={};let j=0;if(r!=null&&r.menuWiseSales){const C=r.menuWiseSales;for(const z in C)z.endsWith("collection")?l[ns(z)]=yt(C[z]):l[ns(z)]=C[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 C in r.itemTypeList)j+=r.itemTypeList[C];let T=d;return p.toDate!==p.fromDate&&(T=`${tr(p.fromDate)} - ${tr(p.toDate)}`),{salesCollection:c?{...r,totalCollection:yt(r.totalCollection),totalOrders:r.totalOrders,online_aggregator:r.aggregator,zomato_aggregator:r.zomato_aggregator,swiggy_aggregator:r.swiggy_aggregator,online_aggregator_collection:m,zomato_aggregator_collection:f,swiggy_aggregator_collection:x,itemTypes:o}:void 0,todayCollection:md(i,e.paymentModes),totalCollection:yt(i.totalCollection),averageCollection:{avgTableTime:_,avgorderValue:fd(r.totalCollection,r.totalOrders).toFixed(2),todayExpense:a&&((F=a.DEBIT)!=null&&F.total)?yt(a.DEBIT.total):0,totalDiscountAmt:r&&r.totalDiscountAmt?yt(r.totalDiscountAmt):0,totalBalanceAmt:r&&r.totalBalanceAmt?yt(r.totalBalanceAmt):0,dailyExpanse:a,noOfGuest:r.noOfGuest,avgPerCover:r.avgPerCover,refundAmt:i.refundAmt,writeOffAmt:i.writeOffAmt,rewardAmt:r.rewardAmt},menusCollection:{...l},selectedDate:T,id:Math.random(),otherFields:{salesCollection:i.salesCollection?yt(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:j,itemTypeList:r.itemTypeList}}},Nd=(e,t,n={})=>new Promise(async(r,i)=>{var m,f,x;console.log({order:e,settingData:t,additionalActions:n});const a=void 0,{invoiceFormat:d,userData:p}=n;let o,l,c=[],u;try{if((m=e.appliedDiscounts)!=null&&m.length){u=0;for(let K=0;K<e.appliedDiscounts.length;K++)o=e.appliedDiscounts[K],u+=o.discountAmt}const _=Tt(e.orderTags,"EXPRESS","tag_type").content?"INSTANT - URGENT ORDER":null;if((f=e.customFeilds)!=null&&f.length){const K=Tt(e.customFeilds,"INSTRUCTION","customType");K!=null&&K.customValue&&(c=[{customName:K.customName,customValue:K.customValue}])}o={};let j=(x=t==null?void 0:t.footerAddress)!=null&&x.addressLineOne?t==null?void 0:t.footerAddress.addressLineOne:"",T=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(j!=""?j+",":"")+(T!=""?T+",":"")+(S!=""?S+",":"")+(M!=""?M+",":""),C=t.gstNo,z={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},se={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},Q={custName:e.name??null,custAddress:e.custAddress??null,custContact:e.mobile??null},ue=Zs(t.curr),be={...e,companyInfo:z,orderInfo:se,customerInfo:Q,gst:C,curr:ue},V=null,ce=null;d.companyLogo&&(V=await Vt(`https://${a}.s3.amazonaws.com/${d.companyLogo.key}`)),d.qrcode&&(ce=await Vt(`https://${a}.s3.amazonaws.com/${d.qrcode.key}`)),e.orderList.filter(K=>{K.services.forEach(async(J,Me)=>{var at,it;let A="kitchen",xt=e.tableName?e.tableName:e.orderFrom;A&&(o[A]||(o[A]={},o[A].station=A,o[A].services=[],o[A].tableName=xt,o[A].customerName=e.name,o[A].time=R.unix(e.timestamp).format("DD-MM-YYYY hh:mm a"),o[A].type=e.orderFrom,o[A].orderId=e.orderId,o[A].instruction=e.instruction,o[A].totalQty=0,o[A].tokenId=e.tokenId,o[A].orderSource=e.orderSource,o[A].aggregatorOrderId=e.externalOrderId,o[A].otp=e.otp,o[A].paymentState=e.paymentState,o[A].discountAmt=u,o[A].otherCharges=e.otherCharges,o[A].taxAmt=e.taxAmt,o[A].customFeilds=c,o[A].curr=t.curr??"INR",o[A].zomatoInstant=_),o[A]?(l={serviceName:J.serviceName,qty:J.qty,instruction:J.isUrgent&&J.instruction?`(URGENT -${J.instruction})`:J.instruction?`(${J.instruction})`:J.isUrgent?"(URGENT)":"",subOrderId:K.subOrderId,isUrgent:J.isUrgent,index:Me},(at=J.addons)!=null&&at.length&&(l.addons=J.addons),o[A].services.push(l),o[A].totalQty+=J.qty):(o[A]=[],o[A].services.push({serviceName:J.serviceName,qty:J.qty,instruction:J.instruction?J.instruction:"",subOrderId:K.subOrderId,index:Me}),o[A].totalQty+=J.qty),o[A]={...o[A],companyInfo:z,orderInfo:se,customerInfo:Q,gst:C,curr:ue},o[A].domain=d.siteURL,o[A].paymentMethods=d.paymentMode?be.paymentMethods:null,o[A].companyInfo.companyName=d.companyName,o[A].companyInfo.companyEmail=d.email,o[A].companyInfo.companyAddress=d.address,o[A].companyInfo.companyContact=d.mobile,o[A].tokenId=d.token?be.tokenId:null,d.isPayQR&&d.upiId&&d.upiId!==""&&(be.upiId=d.upiId),o[A].gstNo=d.gst?be.gst:null,o[A].footerMessage=d.footerMessage,o[A].orderFrom=(it=e.subOrderFrom)==null?void 0:it.toUpperCase(),o[A].fssai=t.fssai,o[A].vatNo=t.vatNo,o[A].printOperatorInfo=d.printOperatorInfo===null||d.printOperatorInfo===!0,o[A].disabledPoweredBy=t.disabledPoweredBy===!0,o[A].printTime=R().format("DD-MM-YYYY hh:mm A"),o[A].printedBy=p.userRole=="admin"?"Admin":p.name,e.deliveryTimestamp&&(o[A].deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),o[A].itemInstructionOnBill=d.itemInstructionOnBill,o[A]={...o[A],companyLogo:V,companyQrCode:ce})})});for(const K in o)if(Object.hasOwnProperty.call(o,K)){const J=o[K];try{let Me=t.printerSize??"2inch";r(new Object({obj:new Object({...J,paperSize:Me}),orderList:e.orderList}));return}catch(Me){console.log(Me)}}}catch(_){console.log("err::",_)}}),jd=async e=>{let t=[];for(let u=0;u<e.length;u++)for(let m=0;m<e[u].orderList.length;m++)t.push(e[u].orderList[m]);let n=[];if(t.length>0)for(let u=0;u<t.length;u++)for(let m=0;m<t[u].services.length;m++)t[u].services[m].status!="CANCELLED"&&t[u].services[m].status!="RETURNED"&&t[u].services[m].status!="SHIFTED"&&n.push(t[u].services[m]);let r={},i=[];for(let u=0;u<n.length;u++)if(n[u].addons&&n[u].addons.length>0)for(let m=0;m<n[u].addons.length;m++){let f={...n[u].addons[m]};f.qty=n[u].qty,i.push(f)}n.forEach(u=>{let{attachedCat:m,serviceId:f}=u;r[m]||(r[m]=[]);let x=r[m].findIndex(_=>_.serviceId===f);x!==-1?r[m][x].qty=r[m][x].qty+u.qty:r[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedCat,station:u.station})});const a=Object.keys(r).sort(),d={};a.forEach(u=>{d[u]=r[u]});for(let u in d)d[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));let p={Category:d},o={};i.forEach(u=>{let{attachedAddonCat:m,serviceId:f}=u;o[m]||(o[m]=[]);let x=o[m].findIndex(_=>_.serviceId===f);x!==-1?o[m][x].qty=o[m][x].qty+u.qty:o[m].push({serviceName:u.serviceName,qty:u.qty,status:u.status,serviceId:u.serviceId,attachedCat:u.attachedAddonCat,station:u.station})});const l=Object.keys(o).sort(),c={};l.forEach(u=>{c[u]=o[u]});for(let u in c)c[u].sort((m,f)=>m.serviceName.localeCompare(f.serviceName));return p.Addon=c,p},ya={"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"},ga=e=>{let t=e&&e.footerAddress&&e.footerAddress.state&&e.footerAddress.state?e.footerAddress.state:null;return ya[t]?ya[t]:"SGST"},xa=(e,t,n={})=>new Promise(async(r,i)=>{var d,p,o,l,c,u;try{const{invoiceFormat:m,custName:f,custMobile:x,custAddress:_,userData:j={}}=n,{itemList:T}=e,S=void 0;let M=j==null?void 0:j.userRole;if(j.userRole=="admin"?M="ADMIN":M=j==null?void 0:j.name,!(T!=null&&T.length))return;let F=t.printerSize,C=ar(null,{type:"BILL",siteSetting:t},{occupiedServer:n.occupiedServer});F=C?(d=C[0])!=null&&d.paperSize?(p=C[0])==null?void 0:p.paperSize:F||"2INCH":F;let z=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",Z=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",se=t.footerAddress.city?t.footerAddress.city:"",Q=t.footerAddress.zip?t.footerAddress.zip:"",ue=(z!=""?z+",":"")+(Z!=""?Z+",":"")+(se!=""?se+",":"")+(Q!=""?Q+",":""),be=t.gstNo,V={companyName:t.companyName,companyAddress:ue,companyContact:t.contactNumber,companyEmail:t.contactEmail},K={orderStatus:"COMPLETED",orderDate:e&&e.timestamp?R.unix(e.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:e&&e.orderId?e.orderId:null,timestamp:e.timestamp},J={custName:m&&m.custName?f==t.companyName?null:f:null,custAddress:m&&m.custAddress&&_||null,custContact:m&&m.custMobile?x:null,custEmail:"ajaybaglane7@gmail.com"},Me=Zs(t.curr),A={...e,companyInfo:V,orderInfo:K,customerInfo:J,gst:be,curr:Me};if(m){if(A.domain=m.siteURL,A.paymentMethods=m.paymentMode?A.paymentMethods:null,A.companyInfo.companyName=m.companyName,A.companyInfo.companyEmail=m.email,A.companyInfo.companyAddress=m.address,A.companyInfo.companyContact=m.mobile,A.customerInfo.custName=m.custName?f:null,A.tokenId=m.token?A.tokenId:null,m.isPayQR&&m.upiId&&m.upiId!==""&&(A.upiId=m.upiId),A.gstNo=m.gst?A.gst:null,A.footerMessage=m.footerMessage,A.orderFrom=(o=e.subOrderFrom)==null?void 0:o.toUpperCase(),A.fssai=t.fssai,A.vatNo=t.vatNo,A.taxLabel=ga(t),A.printOperatorInfo=m.printOperatorInfo===null||m.printOperatorInfo===!0,A.disabledPoweredBy=t.disabledPoweredBy===!0,A.printTime=R().format("DD-MM-YYYY hh:mm A"),e.deliveryTimestamp&&(A.deliveryTimestamp=R.unix(e.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),A.itemInstructionOnBill=m.itemInstructionOnBill,A.noOfInvoice=m.noOfInvoice,A.printby=M,A.newFormat=!0,!m.itemInstructionOnBill&&A.itemList){let ee;for(let Se=0;Se<A.itemList.length;Se++)ee=A.itemList[Se],ee.instruction&&delete ee.instruction}t.enabledOutstandingOnPay&&((l=e.custoutStandingData)!=null&&l.balanceAmt)&&(A.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let xt=[];if((c=e.customFeilds)!=null&&c.length){let ee;for(let Se=0;Se<e.customFeilds.length;Se++)ee=e.customFeilds[Se],ee!=null&&ee.customValue&&((u=ee.availability)!=null&&u.includes("BILL"))&&xt.push({customName:ee.customName,customValue:ee.customValue});A.customFields=xt}let at=null,it=null;m.companyLogo&&(at=await Vt(`https://${S}.s3.amazonaws.com/${m.companyLogo.key}`)),m.qrcode&&(it=await Vt(`https://${S}.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 Je={};(function(){let ee,Se,Nt=0,g=0,h=0,w=0,N=0,I=0,Y=0,b=0,k=[],H=[],pe=0,ke;if(F==="A4"||F==="A5"){for(Se=0;Se<T.length;Se++)ee=T[Se],g+=ee.sub_total,h+=ee.afterdiscAmt,w+=ee.afterdiscAmt+(ee.total_charges??0),Nt+=ee.afterdiscAmt+(ee.total_charges??0),pe+=ee.qty;let De=Jn(T,"discountName",{separateItemsDisc:!0});const Ye=sr(De);let{obj:Re,sum:Be}=rr(T);Je={itemList:nr(T,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Ye,charges:er(T,"name"),taxation:Re,subTotal:we(g),afterDisc:we(h),afterCharges:we(w),total:we(Nt+Be),qty:pe}}else{for(Se=0;Se<T.length;Se++)ee=T[Se],ee.taxType==="VAT"?(H.push(ee),b+=ee.sub_total,I+=ee.afterdiscAmt,N+=ee.afterdiscAmt+(ee.total_charges??0),Y+=ee.afterdiscAmt+(ee.total_charges??0)):(k.push(ee),g+=ee.sub_total,h+=ee.afterdiscAmt,w+=ee.afterdiscAmt+(ee.total_charges??0),Nt+=ee.afterdiscAmt+(ee.total_charges??0));if(k.length){let De=Jn(k,"discountName",{separateItemsDisc:!0});const Ye=sr(De);let{obj:Re,sum:Be}=rr(k);Je.GST={itemList:nr(k,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Ye,charges:er(k,"name"),taxation:Re,subTotal:we(g),afterDisc:we(h),afterCharges:we(w),total:we(Nt+Be)}}if(H.length){let De=Jn(H,"discountName",{separateItemsDisc:!0});const Ye=sr(De);let{obj:Re,sum:Be}=rr(H);Je.VAT={itemList:nr(H,{itemInstructionOnBill:m.itemInstructionOnBill,printZeroPriceAddons:m.printZeroPriceAddons}),discounts:Ye,charges:er(H,"name"),taxation:Re,subTotal:we(b),afterDisc:we(I),afterCharges:we(N),total:we(Y+Be)}}}})(),console.log("distributedData :::",Je),A.distributedData=Je;let It={obj:A,companyLogo:at,companyQrCode:it,paperSize:t.printerSize,Name:a};console.log("obj1 :::",It),r(It)}}catch(m){console.log("err",m),i(m)}}),vd=(e,t,n={})=>new Promise(async(r,i)=>{var d,p,o,l;try{const{invoiceFormat:c,custName:u,custMobile:m,custAddress:f,orderData:x}=n,_=void 0;let j=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",T=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",S=t.footerAddress.city?t.footerAddress.city:"",M=t.footerAddress.zip?t.footerAddress.zip:"",F=(j!=""?j+",":"")+(T!=""?T+",":"")+(S!=""?S+",":"")+(M!=""?M+",":""),C=t.gstNo,z={companyName:t.companyName,companyAddress:F,companyContact:t.contactNumber,companyEmail:t.contactEmail},se={orderStatus:"COMPLETED",orderDate:x&&x.timestamp?R.unix(x.timestamp).format("DD-MM-YYYY hh:mm A"):null,orderNumber:x&&x.orderId?x.orderId:null,timestamp:x.timestamp},Q={custName:c&&c.custName?u==t.companyName?null:u:null,custAddress:c&&c.custAddress&&f||null,custContact:c&&c.custMobile?m:null,custEmail:"ajaybaglane7@gmail.com"},ue=Zs(t.curr),be="",V={...e,companyInfo:z,orderInfo:se,customerInfo:Q,gst:C,curr:ue};if(c){if(V.domain=c.siteURL,V.paymentMethods=c.paymentMode?V.paymentMethods:null,V.companyInfo.companyName=c.companyName,V.companyInfo.companyEmail=c.email,V.companyInfo.companyAddress=c.address,V.companyInfo.companyContact=c.mobile,V.customerInfo.custName=c.custName?u:null,V.tokenId=c.token?V.tokenId:null,c.isPayQR&&c.upiId&&c.upiId!==""&&(V.upiId=c.upiId),V.gstNo=c.gst?V.gst:null,V.footerMessage=c.footerMessage,V.orderFrom=(d=x.subOrderFrom)==null?void 0:d.toUpperCase(),V.fssai=t.fssai,V.vatNo=t.vatNo,V.taxLabel=ga(t),V.printOperatorInfo=c.printOperatorInfo===null||c.printOperatorInfo===!0,V.disabledPoweredBy=t.disabledPoweredBy===!0,V.printTime=R().format("DD-MM-YYYY hh:mm A"),x.deliveryTimestamp&&(V.deliveryTimestamp=R.unix(x.deliveryTimestamp).format("DD-MM-YYYY hh:mm A")),V.itemInstructionOnBill=c.itemInstructionOnBill,V.noOfInvoice=c.noOfInvoice,V.area=x.area,V.captainName=x.captainName,!c.itemInstructionOnBill&&V.itemList){let K;for(let J=0;J<V.itemList.length;J++)K=V.itemList[J],K.instruction&&delete K.instruction}t.enabledOutstandingOnPay&&((p=e.custoutStandingData)!=null&&p.balanceAmt)&&(V.custoutStandingData={balanceAmt:e.custoutStandingData.balanceAmt});let ce=[];if((o=x.customFeilds)!=null&&o.length){let K;for(let J=0;J<x.customFeilds.length;J++)K=x.customFeilds[J],K!=null&&K.customValue&&((l=K.availability)!=null&&l.includes("BILL"))&&ce.push({customName:K.customName,customValue:K.customValue});V.customFields=ce}if(t&&t.isOld&&t.isOld==!0){let K=null,J=null;c.companyLogo&&(K=await Vt(`https://${_}.s3.amazonaws.com/${c.companyLogo.key}`)),c.qrcode&&(J=await Vt(`https://${_}.s3.amazonaws.com/${c.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 Me={obj:V,companyLogo:K,companyQrCode:J,paperSize:t.printerSize,Name:a};r(Me)}}}catch(c){console.log("err",c)}}),_d=(e,t)=>new Promise(async(n,r)=>{var M;console.log({orders:e,settingData:t});let i;(M=t.siteLogo)!=null&&M.key;let a=t.footerAddress.addressLineOne?t.footerAddress.addressLineOne:"",d=t.footerAddress.addressLineTwo?t.footerAddress.addressLineTwo:"",p=t.footerAddress.city?t.footerAddress.city:"",o=t.footerAddress.zip?t.footerAddress.zip:"",l=(a!=""?a+",":"")+(d!=""?d+",":"")+(p!=""?p+",":"")+(o!=""?o+",":""),c=[],u,m=0,f=0,x=0,_=[],j,T;const S=Zn(t.paymentModes??defaultPaymentModes,"internalName");for(let F=0;F<e.length;F++)for(u=e[F],c.push({date:u.date,orderId:u.orderId,finalAmount:u.finalAmount}),m+=u.finalAmount,f+=u.paidAmt,x+=u.balanceAmt,j=0;j<u.orderTransactions.length;j++)T=u.orderTransactions[j],T.paidAmt&&_.push({date:R.unix(T.createdAt).format("DD-MM-YYYY"),paymentMode:S[T.paymentMode].displayName,amount:we(T.paidAmt)});n({logo:i,companyAddress:l,companyName:t.companyName,companyContact:t.contactNumber,gst:t.gstNo,vatNo:t.vatNo,fssai:t.fssai,orders:c,totalAmount:m,totalPaid:f,totalPayable:x,paperSize:t.printerSize,curr:Zs(t.curr),transactions:_})}),bd=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 xa({...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 vd(r.orderObj,r.settingData,{invoiceFormat:r.invoiceFormat,custName:r.orderObj.custName,custMobile:r.orderObj.custMob,custAddress:r.orderObj.custAddress,orderData:r.orderData}),console.log("resp :::",i),t(i)}),Na=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},ir=e=>{var i,a;let t=localStorage.getItem("stationList"),n=JSON.parse(t),r=n.findIndex(d=>d.typeValue=="station::"+e);return((i=n[r])==null?void 0:i.printKot)==null?!0:(a=n[r])==null?void 0:a.printKot};function Sd(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 Td=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function wt(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}let qt=null;function ja(e={}){return qt||(e.includeStyleProperties?(qt=e.includeStyleProperties,qt):(qt=wt(window.getComputedStyle(document.documentElement)),qt))}function en(e,t){const r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}function wd(e){const t=en(e,"border-left-width"),n=en(e,"border-right-width");return e.clientWidth+t+n}function Id(e){const t=en(e,"border-top-width"),n=en(e,"border-bottom-width");return e.clientHeight+t+n}function va(e,t={}){const n=t.width||wd(e),r=t.height||Id(e);return{width:n,height:r}}function Cd(){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 He=16384;function Od(e){(e.width>He||e.height>He)&&(e.width>He&&e.height>He?e.width>e.height?(e.height*=He/e.width,e.width=He):(e.width*=He/e.height,e.height=He):e.width>He?(e.height*=He/e.width,e.width=He):(e.width*=He/e.height,e.height=He))}function tn(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 Md(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function Ad(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),Md(i)}const Fe=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Fe(n,t)};function Ed(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Rd(e,t){return ja(t).map(n=>{const r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}function kd(e,t,n,r){const i=`.${e}:${t}`,a=n.cssText?Ed(n):Rd(n,r);return document.createTextNode(`${i}{${a}}`)}function _a(e,t,n,r){const i=window.getComputedStyle(e,n),a=i.getPropertyValue("content");if(a===""||a==="none")return;const d=Td();try{t.className=`${t.className} ${d}`}catch{return}const p=document.createElement("style");p.appendChild(kd(d,n,i,r)),t.appendChild(p)}function Ld(e,t,n){_a(e,t,":before",n),_a(e,t,":after",n)}const ba="application/font-woff",Sa="image/jpeg",Pd={woff:ba,woff2:ba,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Sa,jpeg:Sa,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Fd(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function lr(e){const t=Fd(e).toLowerCase();return Pd[t]||""}function Dd(e){return e.split(/,/)[1]}function or(e){return e.search(/^(data:)/)!==-1}function Yd(e,t){return`data:${t};base64,${e}`}async function Ta(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,d)=>{const p=new FileReader;p.onerror=d,p.onloadend=()=>{try{a(n({res:r,result:p.result}))}catch(o){d(o)}},p.readAsDataURL(i)})}const cr={};function Ud(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 dr(e,t,n){const r=Ud(e,t,n.includeQueryParams);if(cr[r]!=null)return cr[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{const a=await Ta(e,n.fetchRequestInit,({res:d,result:p})=>(t||(t=d.headers.get("Content-Type")||""),Dd(p)));i=Yd(a,t)}catch(a){i=n.imagePlaceholder||"";let d=`Failed to fetch resource: ${e}`;a&&(d=typeof a=="string"?a:a.message),d&&console.warn(d)}return cr[r]=i,i}async function $d(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):tn(t)}async function Hd(e,t){if(e.currentSrc){const a=document.createElement("canvas"),d=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,d==null||d.drawImage(e,0,0,a.width,a.height);const p=a.toDataURL();return tn(p)}const n=e.poster,r=lr(n),i=await dr(n,r,t);return tn(i)}async function Bd(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await sn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function Wd(e,t){return Fe(e,HTMLCanvasElement)?$d(e):Fe(e,HTMLVideoElement)?Hd(e,t):Fe(e,HTMLIFrameElement)?Bd(e,t):e.cloneNode(wa(e))}const zd=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",wa=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Gd(e,t,n){var r,i;if(wa(t))return t;let a=[];return zd(e)&&e.assignedNodes?a=wt(e.assignedNodes()):Fe(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?a=wt(e.contentDocument.body.childNodes):a=wt(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),a.length===0||Fe(e,HTMLVideoElement)||await a.reduce((d,p)=>d.then(()=>sn(p,n)).then(o=>{o&&t.appendChild(o)}),Promise.resolve()),t}function Vd(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):ja(n).forEach(a=>{let d=i.getPropertyValue(a);a==="font-size"&&d.endsWith("px")&&(d=`${Math.floor(parseFloat(d.substring(0,d.length-2)))-.1}px`),Fe(e,HTMLIFrameElement)&&a==="display"&&d==="inline"&&(d="block"),a==="d"&&t.getAttribute("d")&&(d=`path(${t.getAttribute("d")})`),r.setProperty(a,d,i.getPropertyPriority(a))})}function qd(e,t){Fe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Fe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function Kd(e,t){if(Fe(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}function Qd(e,t,n){return Fe(t,Element)&&(Vd(e,t,n),Ld(e,t,n),qd(e,t),Kd(e,t)),t}async function Zd(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 p=n[a].getAttribute("xlink:href");if(p){const o=e.querySelector(p),l=document.querySelector(p);!o&&l&&!r[p]&&(r[p]=await sn(l,t,!0))}}const i=Object.values(r);if(i.length){const a="http://www.w3.org/1999/xhtml",d=document.createElementNS(a,"svg");d.setAttribute("xmlns",a),d.style.position="absolute",d.style.width="0",d.style.height="0",d.style.overflow="hidden",d.style.display="none";const p=document.createElementNS(a,"defs");d.appendChild(p);for(let o=0;o<i.length;o++)p.appendChild(i[o]);e.appendChild(d)}return e}async function sn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Wd(r,t)).then(r=>Gd(e,r,t)).then(r=>Qd(e,r,t)).then(r=>Zd(r,t))}const Ia=/url\((['"]?)([^'"]+?)\1\)/g,Xd=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Jd=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function eh(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function th(e){const t=[];return e.replace(Ia,(n,r,i)=>(t.push(i),n)),t.filter(n=>!or(n))}async function sh(e,t,n,r,i){try{const a=n?Sd(t,n):t,d=lr(t);let p;return i||(p=await dr(a,d,r)),e.replace(eh(t),`$1${p}$3`)}catch{}return e}function nh(e,{preferredFontFormat:t}){return t?e.replace(Jd,n=>{for(;;){const[r,,i]=Xd.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}function Ca(e){return e.search(Ia)!==-1}async function Oa(e,t,n){if(!Ca(e))return e;const r=nh(e,n);return th(r).reduce((a,d)=>a.then(p=>sh(p,d,t,n)),Promise.resolve(r))}async function Kt(e,t,n){var r;const i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){const a=await Oa(i,null,n);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function rh(e,t){await Kt("background",e,t)||await Kt("background-image",e,t),await Kt("mask",e,t)||await Kt("-webkit-mask",e,t)||await Kt("mask-image",e,t)||await Kt("-webkit-mask-image",e,t)}async function ah(e,t){const n=Fe(e,HTMLImageElement);if(!(n&&!or(e.src))&&!(Fe(e,SVGImageElement)&&!or(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,i=await dr(r,lr(r),t);await new Promise((a,d)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...o)=>{try{a(t.onImageErrorHandler(...o))}catch(l){d(l)}}:d;const p=e;p.decode&&(p.decode=a),p.loading==="lazy"&&(p.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}async function ih(e,t){const r=wt(e.childNodes).map(i=>Ma(i,t));await Promise.all(r).then(()=>e)}async function Ma(e,t){Fe(e,Element)&&(await rh(e,t),await ah(e,t),await ih(e,t))}function lh(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 Aa={};async function Ea(e){let t=Aa[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},Aa[e]=t,t}async function Ra(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,a=(n.match(/url\([^)]+\)/g)||[]).map(async d=>{let p=d.replace(r,"$1");return p.startsWith("https://")||(p=new URL(p,e.url).href),Ta(p,t.fetchRequestInit,({result:o})=>(n=n.replace(d,`url(${o})`),[d,o]))});return Promise.all(a).then(()=>n)}function ka(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,d="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",p=new RegExp(d,"gi");for(;;){let o=a.exec(r);if(o===null){if(o=p.exec(r),o===null)break;a.lastIndex=p.lastIndex}else p.lastIndex=a.lastIndex;t.push(o[0])}return t}async function oh(e,t){const n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{wt(i.cssRules||[]).forEach((a,d)=>{if(a.type===CSSRule.IMPORT_RULE){let p=d+1;const o=a.href,l=Ea(o).then(c=>Ra(c,t)).then(c=>ka(c).forEach(u=>{try{i.insertRule(u,u.startsWith("@import")?p+=1:i.cssRules.length)}catch(m){console.error("Error inserting rule from remote css",{rule:u,error:m})}})).catch(c=>{console.error("Error loading remote css",c.toString())});r.push(l)}})}catch(a){const d=e.find(p=>p.href==null)||document.styleSheets[0];i.href!=null&&r.push(Ea(i.href).then(p=>Ra(p,t)).then(p=>ka(p).forEach(o=>{d.insertRule(o,d.cssRules.length)})).catch(p=>{console.error("Error loading remote stylesheet",p)})),console.error("Error inlining remote css file",a)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{wt(i.cssRules||[]).forEach(a=>{n.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${i.href}`,a)}}),n))}function ch(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Ca(t.style.getPropertyValue("src")))}async function dh(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=wt(e.ownerDocument.styleSheets),r=await oh(n,t);return ch(r)}function La(e){return e.trim().replace(/["']/g,"")}function hh(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(a=>{t.add(La(a))}),Array.from(r.children).forEach(a=>{a instanceof HTMLElement&&n(a)})}return n(e),t}async function uh(e,t){const n=await dh(e,t),r=hh(e);return(await Promise.all(n.filter(a=>r.has(La(a.style.fontFamily))).map(a=>{const d=a.parentStyleSheet?a.parentStyleSheet.href:null;return Oa(a.cssText,d,t)}))).join(`
40
+ `)}async function mh(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await uh(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 Pa(e,t={}){const{width:n,height:r}=va(e,t),i=await sn(e,t,!0);return await mh(i,t),await Ma(i,t),lh(i,t),await Ad(i,n,r)}async function fh(e,t={}){const{width:n,height:r}=va(e,t),i=await Pa(e,t),a=await tn(i),d=document.createElement("canvas"),p=d.getContext("2d"),o=t.pixelRatio||Cd(),l=t.canvasWidth||n,c=t.canvasHeight||r;return d.width=l*o,d.height=c*o,t.skipAutoScale||Od(d),d.style.width=`${l}`,d.style.height=`${c}`,t.backgroundColor&&(p.fillStyle=t.backgroundColor,p.fillRect(0,0,d.width,d.height)),p.drawImage(a,0,0,d.width,d.height),d}async function ph(e,t={}){return(await fh(e,t)).toDataURL("image/jpeg",t.quality||1)}var nn={exports:{}};/*! @preserve
41
+ * numeral.js
42
+ * version : 2.0.6
43
+ * author : Adam Draper
44
+ * license : MIT
45
+ * http://adamwdraper.github.com/Numeral-js/
46
+ */var yh=nn.exports,Fa;function gh(){return Fa||(Fa=1,function(e){(function(t,n){e.exports?e.exports=n():t.numeral=n()})(yh,function(){var t,n,r="2.0.6",i={},a={},d={currentLocale:"en",zeroFormat:null,nullFormat:null,defaultFormat:"0,0",scalePercentBy100:!0},p={currentLocale:d.currentLocale,zeroFormat:d.zeroFormat,nullFormat:d.nullFormat,defaultFormat:d.defaultFormat,scalePercentBy100:d.scalePercentBy100};function o(l,c){this._input=l,this._value=c}return t=function(l){var c,u,m,f;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(p.zeroFormat&&l===p.zeroFormat)c=0;else if(p.nullFormat&&l===p.nullFormat||!l.replace(/[^0-9]+/g,"").length)c=null;else{for(u in i)if(f=typeof i[u].regexps.unformat=="function"?i[u].regexps.unformat():i[u].regexps.unformat,f&&l.match(f)){m=i[u].unformat;break}m=m||t._.stringToNumber,c=m(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,u){var m=a[t.options.currentLocale],f=!1,x=!1,_=0,j="",T=1e12,S=1e9,M=1e6,F=1e3,C="",z=!1,Z,se,Q,ue,be,V,ce;if(l=l||0,se=Math.abs(l),t._.includes(c,"(")?(f=!0,c=c.replace(/[\(|\)]/g,"")):(t._.includes(c,"+")||t._.includes(c,"-"))&&(be=t._.includes(c,"+")?c.indexOf("+"):l<0?c.indexOf("-"):-1,c=c.replace(/[\+|\-]/g,"")),t._.includes(c,"a")&&(Z=c.match(/a(k|m|b|t)?/),Z=Z?Z[1]:!1,t._.includes(c," a")&&(j=" "),c=c.replace(new RegExp(j+"a[kmbt]?"),""),se>=T&&!Z||Z==="t"?(j+=m.abbreviations.trillion,l=l/T):se<T&&se>=S&&!Z||Z==="b"?(j+=m.abbreviations.billion,l=l/S):se<S&&se>=M&&!Z||Z==="m"?(j+=m.abbreviations.million,l=l/M):(se<M&&se>=F&&!Z||Z==="k")&&(j+=m.abbreviations.thousand,l=l/F)),t._.includes(c,"[.]")&&(x=!0,c=c.replace("[.]",".")),Q=l.toString().split(".")[0],ue=c.split(".")[1],V=c.indexOf(","),_=(c.split(".")[0].split(",")[0].match(/0/g)||[]).length,ue?(t._.includes(ue,"[")?(ue=ue.replace("]",""),ue=ue.split("["),C=t._.toFixed(l,ue[0].length+ue[1].length,u,ue[1].length)):C=t._.toFixed(l,ue.length,u),Q=C.split(".")[0],t._.includes(C,".")?C=m.delimiters.decimal+C.split(".")[1]:C="",x&&Number(C.slice(1))===0&&(C="")):Q=t._.toFixed(l,0,u),j&&!Z&&Number(Q)>=1e3&&j!==m.abbreviations.trillion)switch(Q=String(Number(Q)/1e3),j){case m.abbreviations.thousand:j=m.abbreviations.million;break;case m.abbreviations.million:j=m.abbreviations.billion;break;case m.abbreviations.billion:j=m.abbreviations.trillion;break}if(t._.includes(Q,"-")&&(Q=Q.slice(1),z=!0),Q.length<_)for(var K=_-Q.length;K>0;K--)Q="0"+Q;return V>-1&&(Q=Q.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+m.delimiters.thousands)),c.indexOf(".")===0&&(Q=""),ce=Q+C+(j||""),f?ce=(f&&z?"(":"")+ce+(f&&z?")":""):be>=0?ce=be===0?(z?"-":"+")+ce:ce+(z?"-":"+"):z&&(ce="-"+ce),ce},stringToNumber:function(l){var c=a[p.currentLocale],u=l,m={thousand:3,million:6,billion:9,trillion:12},f,x,_;if(p.zeroFormat&&l===p.zeroFormat)x=0;else if(p.nullFormat&&l===p.nullFormat||!l.replace(/[^0-9]+/g,"").length)x=null;else{x=1,c.delimiters.decimal!=="."&&(l=l.replace(/\./g,"").replace(c.delimiters.decimal,"."));for(f in m)if(_=new RegExp("[^a-zA-Z]"+c.abbreviations[f]+"(?:\\)|(\\"+c.currency.symbol+")?(?:\\))?)?$"),u.match(_)){x*=Math.pow(10,m[f]);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,u){return l.slice(0,u)+c+l.slice(u)},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 u=Object(l),m=u.length>>>0,f=0,x;if(arguments.length===3)x=arguments[2];else{for(;f<m&&!(f in u);)f++;if(f>=m)throw new TypeError("Reduce of empty array with no initial value");x=u[f++]}for(;f<m;f++)f in u&&(x=c(x,u[f],f,u));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,u){var m=n.multiplier(u);return c>m?c:m},1)},toFixed:function(l,c,u,m){var f=l.toString().split("."),x=c-(m||0),_,j,T,S;return f.length===2?_=Math.min(Math.max(f[1].length,x),c):_=x,T=Math.pow(10,_),S=(u(l+"e+"+_)/T).toFixed(_),m>c-_&&(j=new RegExp("\\.?0{1,"+(m-(c-_))+"}$"),S=S.replace(j,"")),S}},t.options=p,t.formats=i,t.locales=a,t.locale=function(l){return l&&(p.currentLocale=l.toLowerCase()),p.currentLocale},t.localeData=function(l){if(!l)return a[p.currentLocale];if(l=l.toLowerCase(),!a[l])throw new Error("Unknown locale : "+l);return a[l]},t.reset=function(){for(var l in d)p[l]=d[l]},t.zeroFormat=function(l){p.zeroFormat=typeof l=="string"?l:null},t.nullFormat=function(l){p.nullFormat=typeof l=="string"?l:null},t.defaultFormat=function(l){p.defaultFormat=typeof l=="string"?l:"0.0"},t.register=function(l,c,u){if(c=c.toLowerCase(),this[l+"s"][c])throw new TypeError(c+" "+l+" already registered.");return this[l+"s"][c]=u,u},t.validate=function(l,c){var u,m,f,x,_,j,T,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{T=t.localeData(c)}catch{T=t.localeData(t.locale())}return f=T.currency.symbol,_=T.abbreviations,u=T.delimiters.decimal,T.delimiters.thousands==="."?m="\\.":m=T.delimiters.thousands,S=l.match(/^[^\d]+/),S!==null&&(l=l.substr(1),S[0]!==f)||(S=l.match(/[^\d]+$/),S!==null&&(l=l.slice(0,-1),S[0]!==_.thousand&&S[0]!==_.million&&S[0]!==_.billion&&S[0]!==_.trillion))?!1:(j=new RegExp(m+"{2}"),l.match(/[^\d.,]/g)?!1:(x=l.split(u),x.length>2?!1:x.length<2?!!x[0].match(/^\d+.*\d$/)&&!x[0].match(j):x[0].length===1?!!x[0].match(/^\d+$/)&&!x[0].match(j)&&!!x[1].match(/^\d+$/):!!x[0].match(/^\d+.*\d$/)&&!x[0].match(j)&&!!x[1].match(/^\d+$/)))},t.fn=o.prototype={clone:function(){return t(this)},format:function(l,c){var u=this._value,m=l||p.defaultFormat,f,x,_;if(c=c||Math.round,u===0&&p.zeroFormat!==null)x=p.zeroFormat;else if(u===null&&p.nullFormat!==null)x=p.nullFormat;else{for(f in i)if(m.match(i[f].regexps.format)){_=i[f].format;break}_=_||t._.numberToFormat,x=_(u,m,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 u(m,f,x,_){return m+Math.round(c*f)}return this._value=n.reduce([this._value,l],u,0)/c,this},subtract:function(l){var c=n.correctionFactor.call(null,this._value,l);function u(m,f,x,_){return m-Math.round(c*f)}return this._value=n.reduce([l],u,Math.round(this._value*c))/c,this},multiply:function(l){function c(u,m,f,x){var _=n.correctionFactor(u,m);return Math.round(u*_)*Math.round(m*_)/Math.round(_*_)}return this._value=n.reduce([this._value,l],c,1),this},divide:function(l){function c(u,m,f,x){var _=n.correctionFactor(u,m);return Math.round(u*_)/Math.round(m*_)}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,u){var m=t._.includes(c," BPS")?" ":"",f;return l=l*1e4,c=c.replace(/\s?BPS/,""),f=t._.numberToFormat(l,c,u),t._.includes(f,")")?(f=f.split(""),f.splice(-1,0,m+"BPS"),f=f.join("")):f=f+m+"BPS",f},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"]},u=l.suffixes.concat(c.suffixes.filter(function(f){return l.suffixes.indexOf(f)<0})),m=u.join("|");m="("+m.replace("B","B(?!PS)")+")",t.register("format","bytes",{regexps:{format:/([0\s]i?b)/,unformat:new RegExp(m)},format:function(f,x,_){var j,T=t._.includes(x,"ib")?c:l,S=t._.includes(x," b")||t._.includes(x," ib")?" ":"",M,F,C;for(x=x.replace(/\s?i?b/,""),M=0;M<=T.suffixes.length;M++)if(F=Math.pow(T.base,M),C=Math.pow(T.base,M+1),f===null||f===0||f>=F&&f<C){S+=T.suffixes[M],F>0&&(f=f/F);break}return j=t._.numberToFormat(f,x,_),j+S},unformat:function(f){var x=t._.stringToNumber(f),_,j;if(x){for(_=l.suffixes.length-1;_>=0;_--){if(t._.includes(f,l.suffixes[_])){j=Math.pow(l.base,_);break}if(t._.includes(f,c.suffixes[_])){j=Math.pow(c.base,_);break}}x*=j||1}return x}})}(),function(){t.register("format","currency",{regexps:{format:/(\$)/},format:function(l,c,u){var m=t.locales[t.options.currentLocale],f={before:c.match(/^([\+|\-|\(|\s|\$]*)/)[0],after:c.match(/([\+|\-|\)|\s|\$]*)$/)[0]},x,_,j;for(c=c.replace(/\s?\$\s?/,""),x=t._.numberToFormat(l,c,u),l>=0?(f.before=f.before.replace(/[\-\(]/,""),f.after=f.after.replace(/[\-\)]/,"")):l<0&&!t._.includes(f.before,"-")&&!t._.includes(f.before,"(")&&(f.before="-"+f.before),j=0;j<f.before.length;j++)switch(_=f.before[j],_){case"$":x=t._.insert(x,m.currency.symbol,j);break;case" ":x=t._.insert(x," ",j+m.currency.symbol.length-1);break}for(j=f.after.length-1;j>=0;j--)switch(_=f.after[j],_){case"$":x=j===f.after.length-1?x+m.currency.symbol:t._.insert(x,m.currency.symbol,-(f.after.length-(1+j)));break;case" ":x=j===f.after.length-1?x+" ":t._.insert(x," ",-(f.after.length-(1+j)+m.currency.symbol.length-1));break}return x}})}(),function(){t.register("format","exponential",{regexps:{format:/(e\+|e-)/,unformat:/(e\+|e-)/},format:function(l,c,u){var m,f=typeof l=="number"&&!t._.isNaN(l)?l.toExponential():"0e+0",x=f.split("e");return c=c.replace(/e[\+|\-]{1}0/,""),m=t._.numberToFormat(Number(x[0]),c,u),m+"e"+x[1]},unformat:function(l){var c=t._.includes(l,"e+")?l.split("e+"):l.split("e-"),u=Number(c[0]),m=Number(c[1]);m=t._.includes(l,"e-")?m*=-1:m;function f(x,_,j,T){var S=t._.correctionFactor(x,_),M=x*S*(_*S)/(S*S);return M}return t._.reduce([u,Math.pow(10,m)],f,1)}})}(),function(){t.register("format","ordinal",{regexps:{format:/(o)/},format:function(l,c,u){var m=t.locales[t.options.currentLocale],f,x=t._.includes(c," o")?" ":"";return c=c.replace(/\s?o/,""),x+=m.ordinal(l),f=t._.numberToFormat(l,c,u),f+x}})}(),function(){t.register("format","percentage",{regexps:{format:/(%)/,unformat:/(%)/},format:function(l,c,u){var m=t._.includes(c," %")?" ":"",f;return t.options.scalePercentBy100&&(l=l*100),c=c.replace(/\s?\%/,""),f=t._.numberToFormat(l,c,u),t._.includes(f,")")?(f=f.split(""),f.splice(-1,0,m+"%"),f=f.join("")):f=f+m+"%",f},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,u){var m=Math.floor(l/60/60),f=Math.floor((l-m*60*60)/60),x=Math.round(l-m*60*60-f*60);return m+":"+(f<10?"0"+f:f)+":"+(x<10?"0"+x:x)},unformat:function(l){var c=l.split(":"),u=0;return c.length===3?(u=u+Number(c[0])*60*60,u=u+Number(c[1])*60,u=u+Number(c[2])):c.length===2&&(u=u+Number(c[0])*60,u=u+Number(c[1])),Number(u)}})}(),t})}(nn)),nn.exports}var xh=gh();const Da=fr(xh);var Nh=Object.defineProperty,rn=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Ua=Object.prototype.propertyIsEnumerable,$a=(e,t,n)=>t in e?Nh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gs=(e,t)=>{for(var n in t||(t={}))Ya.call(t,n)&&$a(e,n,t[n]);if(rn)for(var n of rn(t))Ua.call(t,n)&&$a(e,n,t[n]);return e},hr=(e,t)=>{var n={};for(var r in e)Ya.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rn)for(var r of rn(e))t.indexOf(r)<0&&Ua.call(e,r)&&(n[r]=e[r]);return n};/**
47
+ * @license QR Code generator library (TypeScript)
48
+ * Copyright (c) Project Nayuki.
49
+ * SPDX-License-Identifier: MIT
50
+ */var Rt;(e=>{const t=class{constructor(o,l,c,u){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(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=o*4+17;let m=[];for(let x=0;x<this.size;x++)m.push(!1);for(let x=0;x<this.size;x++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(c);if(this.drawCodewords(f),u==-1){let x=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const j=this.getPenaltyScore();j<x&&(u=_,x=j),this.applyMask(_)}}a(0<=u&&u<=7),this.mask=u,this.applyMask(u),this.drawFormatBits(u),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,u=40,m=-1,f=!0){if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let x,_;for(x=c;;x++){const M=t.getNumDataCodewords(x,l)*8,F=p.getTotalBits(o,x);if(F<=M){_=F;break}if(x>=u)throw new RangeError("Data too long")}for(const M of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])f&&_<=t.getNumDataCodewords(x,M)*8&&(l=M);let j=[];for(const M of o){r(M.mode.modeBits,4,j),r(M.numChars,M.mode.numCharCountBits(x),j);for(const F of M.getData())j.push(F)}a(j.length==_);const T=t.getNumDataCodewords(x,l)*8;a(j.length<=T),r(0,Math.min(4,T-j.length),j),r(0,(8-j.length%8)%8,j),a(j.length%8==0);for(let M=236;j.length<T;M^=253)r(M,8,j);let S=[];for(;S.length*8<j.length;)S.push(0);return j.forEach((M,F)=>S[F>>>3]|=M<<7-(F&7)),new t(x,l,S,m)}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 u=0;u<l;u++)c==0&&u==0||c==0&&u==l-1||c==l-1&&u==0||this.drawAlignmentPattern(o[c],o[u]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(o){const l=this.errorCorrectionLevel.formatBits<<3|o;let c=l;for(let m=0;m<10;m++)c=c<<1^(c>>>9)*1335;const u=(l<<10|c)^21522;a(u>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,i(u,m));this.setFunctionModule(8,7,i(u,6)),this.setFunctionModule(8,8,i(u,7)),this.setFunctionModule(7,8,i(u,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,i(u,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,i(u,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,i(u,m));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 u=i(l,c),m=this.size-11+c%3,f=Math.floor(c/3);this.setFunctionModule(m,f,u),this.setFunctionModule(f,m,u)}}drawFinderPattern(o,l){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const m=Math.max(Math.abs(u),Math.abs(c)),f=o+u,x=l+c;0<=f&&f<this.size&&0<=x&&x<this.size&&this.setFunctionModule(f,x,m!=2&&m!=4)}}drawAlignmentPattern(o,l){for(let c=-2;c<=2;c++)for(let u=-2;u<=2;u++)this.setFunctionModule(o+u,l+c,Math.max(Math.abs(u),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 u=t.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l],m=t.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l],f=Math.floor(t.getNumRawDataModules(l)/8),x=u-f%u,_=Math.floor(f/u);let j=[];const T=t.reedSolomonComputeDivisor(m);for(let M=0,F=0;M<u;M++){let C=o.slice(F,F+_-m+(M<x?0:1));F+=C.length;const z=t.reedSolomonComputeRemainder(C,T);M<x&&C.push(0),j.push(C.concat(z))}let S=[];for(let M=0;M<j[0].length;M++)j.forEach((F,C)=>{(M!=_-m||C>=x)&&S.push(F[M])});return a(S.length==f),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 u=0;u<this.size;u++)for(let m=0;m<2;m++){const f=c-m,_=(c+1&2)==0?this.size-1-u:u;!this.isFunction[_][f]&&l<o.length*8&&(this.modules[_][f]=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 u;switch(o){case 0:u=(c+l)%2==0;break;case 1:u=l%2==0;break;case 2:u=c%3==0;break;case 3:u=(c+l)%3==0;break;case 4:u=(Math.floor(c/3)+Math.floor(l/2))%2==0;break;case 5:u=c*l%2+c*l%3==0;break;case 6:u=(c*l%2+c*l%3)%2==0;break;case 7:u=((c+l)%2+c*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][c]&&u&&(this.modules[l][c]=!this.modules[l][c])}}getPenaltyScore(){let o=0;for(let m=0;m<this.size;m++){let f=!1,x=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[m][j]==f?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,_),f||(o+=this.finderPenaltyCountPatterns(_)*t.PENALTY_N3),f=this.modules[m][j],x=1);o+=this.finderPenaltyTerminateAndCount(f,x,_)*t.PENALTY_N3}for(let m=0;m<this.size;m++){let f=!1,x=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][m]==f?(x++,x==5?o+=t.PENALTY_N1:x>5&&o++):(this.finderPenaltyAddHistory(x,_),f||(o+=this.finderPenaltyCountPatterns(_)*t.PENALTY_N3),f=this.modules[j][m],x=1);o+=this.finderPenaltyTerminateAndCount(f,x,_)*t.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){const x=this.modules[m][f];x==this.modules[m][f+1]&&x==this.modules[m+1][f]&&x==this.modules[m+1][f+1]&&(o+=t.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((f,x)=>f+(x?1:0),l);const c=this.size*this.size,u=Math.ceil(Math.abs(l*20-c*10)/c)-1;return a(0<=u&&u<=9),o+=u*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 u=this.size-7;c.length<o;u-=l)c.splice(1,0,u);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 u=0;u<o-1;u++)l.push(0);l.push(1);let c=1;for(let u=0;u<o;u++){for(let m=0;m<l.length;m++)l[m]=t.reedSolomonMultiply(l[m],c),m+1<l.length&&(l[m]^=l[m+1]);c=t.reedSolomonMultiply(c,2)}return l}static reedSolomonComputeRemainder(o,l){let c=l.map(u=>0);for(const u of o){const m=u^c.shift();c.push(0),l.forEach((f,x)=>c[x]^=t.reedSolomonMultiply(f,m))}return c}static reedSolomonMultiply(o,l){if(o>>>8||l>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(l>>>u&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 u=l-1;u>=0;u--)c.push(o>>>u&1)}function i(o,l){return(o>>>l&1)!=0}function a(o){if(!o)throw new Error("Assertion error")}const d=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 d(d.Mode.BYTE,o.length,l)}static makeNumeric(o){if(!d.isNumeric(o))throw new RangeError("String contains non-numeric characters");let l=[];for(let c=0;c<o.length;){const u=Math.min(o.length-c,3);r(parseInt(o.substr(c,u),10),u*3+1,l),c+=u}return new d(d.Mode.NUMERIC,o.length,l)}static makeAlphanumeric(o){if(!d.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 u=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c))*45;u+=d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c+1)),r(u,11,l)}return c<o.length&&r(d.ALPHANUMERIC_CHARSET.indexOf(o.charAt(c)),6,l),new d(d.Mode.ALPHANUMERIC,o.length,l)}static makeSegments(o){return o==""?[]:d.isNumeric(o)?[d.makeNumeric(o)]:d.isAlphanumeric(o)?[d.makeAlphanumeric(o)]:[d.makeBytes(d.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 d(d.Mode.ECI,0,l)}static isNumeric(o){return d.NUMERIC_REGEX.test(o)}static isAlphanumeric(o){return d.ALPHANUMERIC_REGEX.test(o)}getData(){return this.bitData.slice()}static getTotalBits(o,l){let c=0;for(const u of o){const m=u.mode.numCharCountBits(l);if(u.numChars>=1<<m)return 1/0;c+=4+m+u.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 p=d;p.NUMERIC_REGEX=/^[0-9]*$/,p.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,p.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=p})(Rt||(Rt={})),(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={}))})(Rt||(Rt={})),(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={}))})(Rt||(Rt={}));var Qt=Rt;/**
51
+ * @license qrcode.react
52
+ * Copyright (c) Paul O'Shannessy
53
+ * SPDX-License-Identifier: ISC
54
+ */var Ha={L:Qt.QrCode.Ecc.LOW,M:Qt.QrCode.Ecc.MEDIUM,Q:Qt.QrCode.Ecc.QUARTILE,H:Qt.QrCode.Ecc.HIGH},Ba=128,Wa="L",za="#FFFFFF",Ga="#000000",Va=!1,ur=4,jh=.1;function qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(d,p){if(!d&&a!==null){n.push(`M${a+t} ${i+t}h${p-a}v1H${a+t}z`),a=null;return}if(p===r.length-1){if(!d)return;a===null?n.push(`M${p+t},${i+t} h1v1H${p+t}z`):n.push(`M${a+t},${i+t} h${p+1-a}v1H${a+t}z`);return}d&&a===null&&(a=p)})}),n.join("")}function Ka(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 Qa(e,t,n,r){if(r==null)return null;const i=n?ur:0,a=e.length+i*2,d=Math.floor(t*jh),p=a/t,o=(r.width||d)*p,l=(r.height||d)*p,c=r.x==null?e.length/2-o/2:r.x*p,u=r.y==null?e.length/2-l/2:r.y*p;let m=null;if(r.excavate){let f=Math.floor(c),x=Math.floor(u),_=Math.ceil(o+c-f),j=Math.ceil(l+u-x);m={x:f,y:x,w:_,h:j}}return{x:c,y:u,h:l,w:o,excavation:m}}var vh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function _h(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:p=Va,style:o,imageSettings:l}=t,c=hr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),u=l==null?void 0:l.src,m=ve.useRef(null),f=ve.useRef(null),[x,_]=ve.useState(!1);ve.useEffect(()=>{if(m.current!=null){const S=m.current,M=S.getContext("2d");if(!M)return;let F=Qt.QrCode.encodeText(n,Ha[i]).getModules();const C=p?ur:0,z=F.length+C*2,Z=Qa(F,r,p,l),se=f.current,Q=Z!=null&&se!==null&&se.complete&&se.naturalHeight!==0&&se.naturalWidth!==0;Q&&Z.excavation!=null&&(F=Ka(F,Z.excavation));const ue=window.devicePixelRatio||1;S.height=S.width=r*ue;const be=r/z*ue;M.scale(be,be),M.fillStyle=a,M.fillRect(0,0,z,z),M.fillStyle=d,vh?M.fill(new Path2D(qa(F,C))):F.forEach(function(V,ce){V.forEach(function(K,J){K&&M.fillRect(J+C,ce+C,1,1)})}),Q&&M.drawImage(se,Z.x+C,Z.y+C,Z.w,Z.h)}}),ve.useEffect(()=>{_(!1)},[u]);const j=gs({height:r,width:r},o);let T=null;return u!=null&&(T=ve.createElement("img",{src:u,key:u,style:{display:"none"},onLoad:()=>{_(!0)},ref:f})),ve.createElement(ve.Fragment,null,ve.createElement("canvas",gs({style:j,height:r,width:r,ref:m},c)),T)}function bh(e){const t=e,{value:n,size:r=Ba,level:i=Wa,bgColor:a=za,fgColor:d=Ga,includeMargin:p=Va,imageSettings:o}=t,l=hr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Qt.QrCode.encodeText(n,Ha[i]).getModules();const u=p?ur:0,m=c.length+u*2,f=Qa(c,r,p,o);let x=null;o!=null&&f!=null&&(f.excavation!=null&&(c=Ka(c,f.excavation)),x=ve.createElement("image",{xlinkHref:o.src,height:f.h,width:f.w,x:f.x+u,y:f.y+u,preserveAspectRatio:"none"}));const _=qa(c,u);return ve.createElement("svg",gs({height:r,width:r,viewBox:`0 0 ${m} ${m}`},l),ve.createElement("path",{fill:a,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),ve.createElement("path",{fill:d,d:_,shapeRendering:"crispEdges"}),x)}var Za=e=>{const t=e,{renderAs:n}=t,r=hr(t,["renderAs"]);return n==="svg"?ve.createElement(bh,gs({},r)):ve.createElement(_h,gs({},r))};const xs=(e,t)=>t*100/e,Sh=(e,t)=>{const n=validators[`_${Xs[t].minimumFractionDigits??2}`].roundUpto;return n(e)},Th={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},P=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 Ns=Xn(),Ie="normal-class";(Ns=="Android OS"||Ns==="iOS")&&(Ie="bold-class");const rt=e=>{var Je,It,ee,Se,Nt;const t=e.additionalActions??{},n=ve.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:d,type:p}=e.printerDataObject,o=((It=(Je=e.value)==null?void 0:Je.settingData)==null?void 0:It.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=ar(d,{type:p,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const u=r.customLabels??hd();l=c?(Se=c[0])!=null&&Se.paperSize?(Nt=c[0])==null?void 0:Nt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function m(g){const h=Math.abs(parseFloat(g));return f(h)}function f(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Da(g).format("0,00.000");default:return Da(g).format("0,00.00")}}ve.useEffect(()=>{T()},[e.newId]);const x=()=>new Promise(async(g,h)=>{if(Ns=="Android OS"||Ns==="iOS"){let w=await ph(n.current);if(w){const N=await j(w);g(N)}}else{let w=await Pa(n.current);w&&g(w)}}),_=()=>new Promise(async(g,h)=>{const w=await x();g(w)}),j=g=>new Promise((h,w)=>{let N=new Image;N.src=g,N.onload=()=>{let I=document.createElement("canvas");const Y=600,b=N.height;let k=N.width,H=N.height;k>H?k>Y&&(H*=Y/k,k=Y):H>b&&(k*=b/H,H=b),I.width=k,I.height=H,I.getContext("2d").drawImage(N,0,0,k,H),h(I.toDataURL())}}),T=async()=>{if(n&&n.current){const g=await _();e.onImageGenerated(g)}},S=g=>{let h=new Array;for(const w in g.menusCollection)w.endsWith("collection")||(g.menusCollection[`${w}_collection`]||g.menusCollection[w])&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${w.replace("_"," ")}(${g.menusCollection[w]}):`}),s.jsx("span",{children:oe(g.menusCollection[`${w}_collection`],o)}),s.jsx("span",{children:f(xs(g.salesCollection.totalCollection,g.menusCollection[`${w}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&h.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)})]})),h},M=g=>{let h=new Array,w=new Object;for(let N=0;N<g.todayCollection.length;N++)w=g.todayCollection[N],h.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${w.displayName}:`}),s.jsx("span",{children:oe(w.value,o)}),s.jsx("span",{children:f(xs(g.totalCollection,w.value))+"%"})]}));return h},F=(g,h,w,N,I={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${w}&cu=INR&am=${N}&tr=${h}`;return s.jsx(Za,{value:Y?g:b,renderAs:"canvas",size:I.size??250})},C=(g,h)=>{var Y,b;let w=0;if((Y=h.taxObj)!=null&&Y.VAT.length){let k,H,pe;for(H=0;H<((b=h.taxObj)==null?void 0:b.VAT.length);H++){k=h.taxObj.VAT[H];for(pe in k)w+=we(k[pe])}}const N={sellerName:h.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(h.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:h.finalAmount,invoiceVatTotal:w},I=dd(N.sellerName,N.vatRegistrationNumber,N.invoiceTimestamp,N.invoiceTotal,N.invoiceVatTotal.toFixed(2));return s.jsx(Za,{value:I,renderAs:"canvas",size:250})},z=g=>{const h=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(h.push(s.jsx("hr",{})),g.rewardAmt&&h.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&&h.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&&h.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&&h.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&&h.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)})]}))),h},Z=(g,h)=>{if(h&&h.length){for(let w=0;w<h.length;w++)if(h[w].slugName===g)return h[w]}return!1},se=(g,h)=>{if(h&&h.length){for(let w=0;w<h.length;w++)if(h[w].itemType===g)return h[w]}return!1},Q=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ue=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Th[g.discountType]}`,be=g=>{const h=new Array;if(g&&Object.keys(g).length!==0){h.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const w in g)if(h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${Q[w]}:`}),s.jsx("span",{children:oe(g[w].total,o)})]})),w&&Object.keys(w).length!==0)for(const N in g[w])N!=="total"&&g[w][N]&&h.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Xe(N)}:`}),s.jsx("span",{children:oe(g[w][N],o)})]}))}return h},V=(g,h)=>{let w=!1;g.totalValue&&(w=Object.keys(g.totalValue).length>1);let N=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(N=g.totalValue[Y],Y==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h4",{className:`items products-heading-rate ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h4",{className:`items products-heading-amt ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${P[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${P[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?m(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${P[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?f(b.serviceAmount):"":b.price?f(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${P[l].dynamicClassname}`,children:"- "+Xe(k.serviceName)})),b.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${P[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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(b=>{const k=Z(b,g.discArr);if(k&&N.cat[b]!==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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(N.cat[b])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(b=>{const k=se(b,g.itemTypeDiscObj);if(k&&N.itemTypes[b]!==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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(N.itemTypes[b])})]})}):"",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:h[`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+" "+f(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?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",f(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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[Y]&&N?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let k=new Array;for(const H in b)if(b[H]&&b[H]!=0){let pe=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:h.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[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:h[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[H]/2)})]})]}))}return k}):g.taxObj[Y].map(b=>{let k=new Array;for(const H in b)if(b[H]&&b[H]!=0){let pe=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:h.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[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:h.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f((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:"- - - - -"}):"",w&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(N=g.totalValue[Y],Y==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.qty}}),s.jsx("h6",{className:`items products-heading-rate ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.rate}}),s.jsx("h6",{className:`items products-heading-amt ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:h.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${P[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${P[l].dynamicClassname}`,children:b.rate?m(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${P[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?f(b.serviceAmount):"":b.price?f(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${P[l].dynamicClassname}`,children:"- "+Xe(k.serviceName)})),b.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${P[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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(b=>{const k=Z(b,g.discArr);if(k&&N.cat[b]!==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:h[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(N.cat[b])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(b=>{const k=se(b,g.itemTypeDiscObj);if(k&&N.itemTypes[b]!==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:h[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(N.itemTypes[b])})]})}):"",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:h[`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+" "+f(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?h.coupon_disc??"COUPON DISC":h.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",f(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:h[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b.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:h.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(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(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:h.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:h[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&N?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let k=new Array;for(const H in b)if(b[H]&&b[H]!=0){let pe=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:h.cgst}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[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:h[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[H]/2)})]})]}))}return k}):g.taxObj[Y].map(b=>{let k=new Array;for(const H in b)if(b[H]&&b[H]!=0){let pe=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:h.vat}}),s.jsx("span",{children:" @"+pe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f(b[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:h.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+f((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"})]})]})]})})]})},ce=(g,h,{labels:w,doMultipleTax:N,type:I})=>{var b,k,H,pe,ke,De,Ye,Re,Be,kt,jt;console.log({iterator:g,staticData:h});const Y=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:w.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:w.qty}}),s.jsx("h4",{className:`items products-heading-rate ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:w.rate}}),s.jsx("h4",{className:`items products-heading-amt ${P[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:w.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(q=>{var Lt;return s.jsxs("div",{style:q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,style:{lineHeight:1.2},children:[q.status==="RETURNED"?"(R) ":"",q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${P[l].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${P[l].dynamicClassname}`,children:q.serviceRate?m(q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${P[l].dynamicClassname}`,children:q.status==="RETURNED"?q.serviceAmount?f(q.serviceAmount):"":q.sub_total?f(q.sub_total):""})]}),(Lt=q.addons)!=null&&Lt.length?q.addons.map(Ct=>s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Xe(Ct.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${P[l].dynamicClassname}`,children:[q.status==="RETURNED"?"-":"",Ct.qty]}),s.jsx("h6",{className:`items products-heading-rate ${P[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${P[l].dynamicClassname}`})]})):"",q.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${P[l].dynamicClassname} ${Ie}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:w.subtotal}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(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"})]}):""]}),(b=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+q.discountName.toUpperCase()}}),s.jsx("span",{children:ue(q)})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.discountAmt)})]})):"",(k=Y.CATEGORY_DISCOUNT)!=null&&k.length?Y.CATEGORY_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.discountAmt)})]})):"",(H=Y.ITEM_DISCOUNT)!=null&&H.length?Y.ITEM_DISCOUNT.map(q=>s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${q.discountName.toLowerCase()}`]??"DISC-"+ns(q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.discountAmt)})]})):"",(ke=(pe=Y.SEGMENT_DISCOUNT)==null?void 0:pe[0])!=null&&ke.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ye=(De=Y.COUPON_DISCOUNT)==null?void 0:De[0])!=null&&Ye.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Be=(Re=Y.ORDER_DISCOUNT)==null?void 0:Re[0])!=null&&Be.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:f(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("h5",{className:"actual-qty",children:h.curr+" "+f(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${Ie}`,children:[s.jsxs("h5",{className:"total-qty",children:["  ",h.couponCode?"COUPON DISC":"خصم الطلب",h.couponCode?`(${h.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(kt=g.charges)!=null&&kt.length?g.charges.map(q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${q.name.toLowerCase()}`]??q.name}})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:w.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(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"})]}):"",(jt=g.taxation)!=null&&jt.length?g.taxation.map(q=>{if(q.taxAmt)return q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:"@"+q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w[h.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${Ie}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:"@"+q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:w.total}}),s.jsx("h5",{className:"actual-qty",children:h.curr+" "+f(g.total)})]}),N?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},K=(g,h)=>{var Y,b;let w=!1;const N=g.distributedData;return console.log({distributedData:N,labels:h}),g.distributedData&&(w=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=N.GST)==null?void 0:Y.itemList)&&ce(N.GST,g,{labels:h,doMultipleTax:w,type:"GST"}),((b=N.VAT)==null?void 0:b.itemList)&&ce(N.VAT,g,{labels:h,doMultipleTax:w,type:"VAT"})]})},J=g=>{const h=g.services,w=Object.keys(g.services),N=w.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Ie}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:P[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[N&&w.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),h[Y].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 ${P[l].dynamicClassname}`,children:Xe(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${P[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(pe=>{var ke;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((ke=pe.serviceName)==null?void 0:ke.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),N!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},Me=g=>{const h=g.slice(0,-4),w=g.slice(-4);return{firstDigits:h,last4Dgits:w}},A=(g,h,w,N={})=>{const I=Object.keys(h??{});let Y=[],b,k="flex-two-items";if(N.action==="addCharges"&&(k="display-percentage"),g&&I.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${w.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",w,":"]}),s.jsx("span",{children:oe(g,o)})]})]}));for(let H=0;H<I.length;H++)b=I[H],h[b]&&Y.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:oe(h[b],o)}),N.action==="addCharges"?s.jsx("span",{children:f(xs(g,h[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},xt=g=>{const h=Object.keys(g.Category),w=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"})]})),h.forEach((I,Y)=>{const b=g.Category[I];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ns(I)]}),s.jsxs("section",{className:"products-section",children:[b.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 ${P["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${P["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,Y!=h.length-1&&s.jsx("hr",{})]})]}))}),w.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"})]})),w.forEach((I,Y)=>{const b=g.Addon[I];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ns(I)]}),s.jsxs("section",{className:"products-section",children:[b.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 ${P["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${P["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,Y!=w.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),N},at=g=>{var w;const h={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((w=g==null?void 0:g.customBillLabels)!=null&&w.length){let N;for(let I=0;I<g.customBillLabels.length;I++)N=g.customBillLabels[I],h[N.defaultName]=N.displayName}return h},it=(g,h,w,N)=>{var b,k,H,pe,ke,De,Ye,Re,Be,kt,jt,q,Lt,Ct,js,vs,an,_s,bs,ln,on,cn,dn,hn,un,mn,Zt,Ss,vt,Xt,Jt,Ts,fn,ws,pn,Is,Cs,yn,gn;const I=at(r.customLabelsMap);if(g==="BILL"){console.log("staticData ::",h);let ne;if(l==="A4"||l==="A5"){let v={...h},X=0,me=v.distributedData;const B=me.discounts;ne=s.jsx("div",{className:`invoiceContainer main-div ${P[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:[v.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:v.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:v.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:w&&s.jsx("img",{src:w,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:[(v.customerInfo.custName||((b=v.customFields)==null?void 0:b.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),v.customerInfo.custName&&v.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custName})}),v.customerInfo.custContact&&v.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custContact})}),v.customerInfo.custAddress&&v.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.customerInfo.custAddress})}),v.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.deliveryTimestamp})}),(k=v.customFields)!=null&&k.length?v.customFields.map(L=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[L.customName,": ",L.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:v.companyInfo.companyName})}),v.companyInfo.companyAddress&&v.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyAddress})}),v.companyInfo.companyEmail&&v.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyEmail})}),v.companyInfo.companyContact&&v.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:v.companyInfo.companyContact})}),v.fssai&&v.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:v.fssai})]})}),v.gst&&v.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:v.gst})]})}),v.vatNo&&v.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:v.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:[v.itemList.map(L=>{var D;let y="",O=[];return X++,O.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:y,children:[s.jsx("td",{className:"text-align-left",children:L.serviceRate?X:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:L.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:L.qty}),s.jsx("td",{className:"text-align-right",children:L.serviceRate?$(L.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:L.sub_total?$(L.sub_total,o):""})]}),L.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+L.instruction+")"})]})]})),(D=L.addons)!=null&&D.length&&L.addons.map(G=>{O.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:["+ ",G.serviceName.toUpperCase()]}),s.jsx("td",{children:G.qty})]}),G.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+G.instruction+")"})]})]}))}),O}),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 ${we(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",{}),od(Sh(v.finalAmount,o).toFixed(Xs[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),v.upiId&&h.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:F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmt,{size:100})})})})]}),v.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:v.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:$(me.subTotal,o)})]}),(H=B==null?void 0:B.DISCOUNT_ITEMS)!=null&&H.length?B.DISCOUNT_ITEMS.map(L=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${L.discountName.toLowerCase()}`]??"DISC-"+L.discountName.toUpperCase()}}),s.jsx("span",{children:ue(L)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.discountAmt,o)})]})):"",(pe=B==null?void 0:B.CATEGORY_DISCOUNT)!=null&&pe.length?B.CATEGORY_DISCOUNT.map(L=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${L.discountName.toLowerCase()}`]??"DISC-"+L.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+L.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.discountAmt,o)})]})):"",(ke=B==null?void 0:B.ITEM_DISCOUNT)!=null&&ke.length?B.ITEM_DISCOUNT.map(L=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${L.discountName.toLowerCase()}`]??"DISC-"+L.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+L.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.discountAmt,o)})]})):"",(Ye=(De=B==null?void 0:B.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&Ye.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${B.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+B.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+B.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(B.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(Be=(Re=B==null?void 0:B.COUPON_DISCOUNT)==null?void 0:Re[0])!=null&&Be.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:`(${B.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${B.COUPON_DISCOUNT[0].discountValue}${B.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(B.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(jt=(kt=B==null?void 0:B.ORDER_DISCOUNT)==null?void 0:kt[0])!=null&&jt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:f(B.ORDER_DISCOUNT[0].discountValue)?`@${B.ORDER_DISCOUNT[0].discountValue}${B.ORDER_DISCOUNT[0].discountType=="RELATIVE"||B.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(B.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(q=me.charges)!=null&&q.length?me.charges.map(L=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${L.name.toLowerCase()}`]??L.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.amt,o)})]})):"",me.subTotal!==me.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(me.afterCharges,o)})]}):"",(Lt=me.taxation)!=null&&Lt.length?me.taxation.map(L=>L.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+L.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+L.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+L.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(v.finalAmount,o)})]}),(Ct=h==null?void 0:h.custoutStandingData)!=null&&Ct.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$((js=v==null?void 0:v.custoutStandingData)==null?void 0:js.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(v.grandTotal+((vs=v==null?void 0:v.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",v.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(v.rewardAmt,o)})]}):"",(an=h.paymentMethods)!=null&&an.length?h.paymentMethods.map(L=>{var y;if(L.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(y=L.paymentMode)==null?void 0:y.toLowerCase()}`]??L.paymentMode??"CASH"}}),s.jsx("span",{children:L.isRefund?"(Refund)":""})]}),L.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+$(L.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:$(L.paidAmt,o)})]})}):"",v.balanceAmt&&h.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:$(h.balanceAmt,o)})]}):"",h.balPoint&&!Number.isNaN(h.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:h.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 :${v.printby} Printed On: ${v.printTime}`}),v.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else ne=s.jsx("div",{className:"main-div bill",style:{width:P[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[h.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),w&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:w,className:"single-entity-and-center",style:{width:P[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${P[l].dynamicClassname}`,children:[!w&&h.companyInfo.companyName&&h.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:h.companyInfo.companyName}),h.companyInfo.companyAddress&&h.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.companyInfo.companyAddress}}),h.companyInfo.companyContact&&h.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:h.companyInfo.companyContact})]})}),h.companyInfo.companyEmail&&h.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:h.companyInfo.companyEmail})]})}),h.fssai&&h.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:h.fssai})]})}),h.gst&&h.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:h.gst})]})}),h.vatNo&&h.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:h.vatNo})]})}),s.jsx("hr",{}),h.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.orderFrom}),h.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[h.area," : ",h.tableName?h.tableName:h.tableNo]}),h.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:h.tokenId})]})}),h.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${P[l].dynamicClassname} ${Ie}`,children:[h.customerInfo.custName&&h.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:h.customerInfo.custName})]})}),h.customerInfo.custContact&&h.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:h.customerInfo.custContact})]})}),h.customerInfo.custAddress&&h.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:h.customerInfo.custAddress})]})}),Tt(h.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),h.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:h.orderId})]})}),h.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:h.orderInfo.orderDate})]})}),h.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:h.deliveryTimestamp})]})}),h.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:h.captainName})]})})]}),(_s=h.customFields)!=null&&_s.length?s.jsxs("div",{className:`details-section ${P[l].dynamicClassname}`,children:[s.jsx("hr",{}),h.customFields.map(v=>s.jsx("h4",{className:"left-align-entity",children:v.customName+": "+v.customValue}))]}):"",h.newFormat?K(h,I):V(h,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${P[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(bs=h.custoutStandingData)!=null&&bs.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(ln=h.custoutStandingData)!=null&&ln.balanceAmt||h.rewardAmt&&h.paymentMethods&&h.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+f(h.finalAmount)})]}),(on=h.custoutStandingData)!=null&&on.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.previous_outstanding}})}),s.jsx("h5",{children:h.curr+" "+f(h.custoutStandingData.balanceAmt)})]}),!h.rewardAmt&&!h.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+f(h.finalAmount+h.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"}})]}):"",h.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+h.usedPoints+" Points)"})]}),s.jsx("h5",{children:h.curr+" "+h.rewardAmt})]}):"",h.paymentMethods&&h.paymentMethods.length?h.paymentMethods.map(v=>{var X;if(v.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${Ie}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(X=v.paymentMode)==null?void 0:X.toLowerCase()}`]??v.paymentMode??"CASH"}}),s.jsx("span",{children:v.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:v.isRefund?s.jsx(s.Fragment,{children:h.curr+" ("+f(v.paidAmt)+")"}):s.jsx(s.Fragment,{children:h.curr+" "+f(v.paidAmt)})})]})}):"",h.rewardAmt&&!h.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:h.curr+" "+f(h.finalAmount+(((cn=h==null?void 0:h.custoutStandingData)==null?void 0:cn.balanceAmt)||0)-h.rewardAmt)})]})}):"",h.balanceAmt&&h.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:h.curr+" "+f(h.balanceAmt)})]}):"",s.jsx("hr",{})]}),h.earnPoints&&h.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:h.earnPoints})]}):"",(h.balPoint||h.earnPoints)&&!Number.isNaN(h.balPoint||h.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:h.balPoint+h.earnPoints||0})]}):"",h.upiId&&h.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),F(h.upiId,h.orderId,h.companyInfo.companyName,h.paidAmount)]}),h.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."}),C(r.vatNo,h)]}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:P[l].logoWidth}})}):"",h.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:h.footerMessage}}):"",h.printby&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${h.printby}`}):"",h.printTime&&h.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${h.printTime}`}):"",h.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return ne}else if(g==="PRINT_DASHBOARD"&&h.salesCollection){const ne=h.salesCollection.totalDiscountAmt?xs(h.salesCollection.grandTotal,h.salesCollection.totalDiscountAmt):null,v=h.salesCollection.totalCollection-h.salesCollection.totalTax;var Y=R().format("DD/MM/YYYY LT");const X=(dn=h.monthTillDateSalesColl)!=null&&dn.totalDiscountAmt?xs(h.monthTillDateSalesColl.grandTotal,h.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${P[l].dynamicClassname}`,style:{width:P[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:- ${Y}`}),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:h.selectedDate})]}),s.jsx("hr",{}),h.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(h.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(h.monthTillDateSalesColl.totalDiscountAmt,o)}${X?`(${f(X)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(h.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(h.monthTillDateSalesColl.totalCollection-h.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(h.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(h.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(h.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(h.salesCollection.totalDiscountAmt,o)}${ne?`(${f(ne)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(h.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(v,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(h.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(h.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),A(h.otherFields.totalDiscountAmt,h.otherFields.discountList,"Discount",{action:"addCharges"}),A(h.otherFields.totalOtherCharges,h.otherFields.otherChargesList,"Charges"),A(h.otherFields.totalTax,h.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(h.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:h.salesCollection.totalOrders})]}),S(h)]}),s.jsx("hr",{}),h.otherFields.totalItemType?s.jsx("div",{children:A(h.otherFields.totalItemType,h.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",h.averageCollection.avgTableTime||h.averageCollection.avgorderValue||h.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),h.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:h.averageCollection.avgTableTime})]}):"",h.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(h.averageCollection.avgorderValue,o)})]}):"",h.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:h.averageCollection.noOfGuest})]}):"",h.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(h.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(h.totalCollection,o)})]}),M(h)]}),z(h.averageCollection),h.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(h.otherFields.salesCollection,o)})]}),h.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(h.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),be(h.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ns=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let ne;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ne=Me(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:P[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),w&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:w,className:"single-entity-and-center",style:{width:P[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${P[l].dynamicClassname}`,children:[!w&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&ne&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${ne.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",ne.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${P[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:P[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:[((hn=a.services)==null?void 0:hn.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(B=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Xe(B.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: ",we(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+" "+f(X.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(X=>{let me=new Array;for(const B in X)if(X[B]&&X[B]!=0){let L=B/2;me.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",L]}),s.jsx("h5",{children:a.curr+" "+f(X[B]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[h.taxLabel+" "," @",L,"%"]}),s.jsx("h5",{children:a.curr+" "+f(X[B]/2)})]})]}))}return me})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(un=a.customFeilds)==null?void 0:un.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:P[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 ne="";return a.action==="SWITCH_TABLE"?ne=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:["**",(mn=u.Table)==null?void 0:mn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Zt=a.from)==null?void 0:Zt.map((v,X)=>{var me,B,L;return`${(B=(me=e.tableData[v])==null?void 0:me.attachedArea)==null?void 0:B.toUpperCase()} - ${(L=e.tableData[v])==null?void 0:L.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:`${(vt=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:vt.toUpperCase()} - ${(Xt=e.tableData[a.to[0]])==null?void 0:Xt.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):ne=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 ",(Jt=u.Table)==null?void 0:Jt.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((v,X)=>{var me,B,L;return`${(B=(me=e.tableData[v])==null?void 0:me.attachedArea)==null?void 0:B.toUpperCase()} - ${(L=e.tableData[v])==null?void 0:L.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=(fn=e.tableData[a.to[0]])==null?void 0:fn.attachedArea)==null?void 0:ws.toUpperCase()} - ${(pn=e.tableData[a.to[0]])==null?void 0:pn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${u.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),ne}else if(g==="COUNTER_OPERATION"){let ne;return l=="2INCH"||l=="1.8INCH"?ne=s.jsx("div",{className:"main-div",style:{width:P[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: ",$(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: ",$(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(v=>{if(v.value>0||v.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",v.displayName," : ",$(v.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",$(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:["    ",$(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:["    ",$(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:["    ",$(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(v=>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"?$(v.denomination,o):v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",$(v.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:$(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:["    ",$(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:["    ",$(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:["   ",$(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:["    ",$(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:["    -",$(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:["    +",$(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:["   -",$(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:["   +",$(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(v=>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"?$(v.denomination,o):v.curr+" "+v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",$(v.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:$(a.TotalDenomationsAmount,o)})]})]})}):ne=s.jsx("div",{className:"main-div",style:{width:P[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: ",$(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: ",$(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(v=>{if(v.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",v.displayName," : ",$(v.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",$(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 : ",$(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",$(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",$(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(v=>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"?$(v.denomination,o):v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",$(v.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:$(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 : ",$(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",$(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",$(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",$(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 : -",$(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",$(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",$(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",$(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(v=>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"?$(v.denomination,o):v.curr+" "+v.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",v.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",$(v.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:$(a.TotalDenomationsAmount,o)})]})]})}),ne}else if(g==="ITEMWISE_SALES_COUNTER"){let ne,{counterDetails:v}=e.printerDataObject;return ne=s.jsx("div",{className:"main-div",style:{width:P[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:v.currentDate}),s.jsx("hr",{}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",v.CounterName]}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",v.openedBy]}),v.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",v.loginTime]}),v.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",v.logoutTime]}),v.CounterName&&s.jsx("hr",{}),xt(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${v.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${v.printedOn}`})]})}),ne}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:ne}=e.printerDataObject;return getRechargeDetails(ne)}else if(g==="PACKAGING_SLIP"){let ne,v=0;h.aggregatorOrderId&&h.aggregatorOrderId!==""&&(ne=Me(h.aggregatorOrderId));const X=h.services;for(let B in X)v+=X[B].length;return s.jsx("div",{className:"main-div",style:{width:P[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${P[l].dynamicClassname}`,children:[h.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:h.subOrderFrom.toUpperCase()}),h.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",h.tokenId]}),h.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:h.tableName}),h.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+h.otp}),h.orderSource&&ne&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${h.orderSource}: ${ne.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ne.last4Dgits||""})]}),h.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:h.zomatoInstant}),s.jsx("hr",{}),h.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+h.orderId}),h.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",h.date]}),h.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+h.prepareBy}):"",h.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${u.Waiter} Name: `+h.waiterName})]}),J(h),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",v]}),s.jsxs("h5",{children:["TOTAL QTY: ",we(h.totalQty)]})]}),(Is=h.customFields)==null?void 0:Is.map(B=>s.jsx("h4",{className:"left-align-entity",children:B.customName+": "+B.customValue})),s.jsx("br",{}),h.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",h.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:P[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 ${P[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${P[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${P[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${P[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(v=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,children:tr(v.date)}),s.jsx("h6",{className:`items products-heading-orderId ${P[l].dynamicClassname}`,children:v.orderId}),s.jsx("h6",{className:`items products-heading-amount ${P[l].dynamicClassname}`,children:a.curr+" "+f(v.finalAmount)})]})},v.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+" "+f(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+" "+f(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 ${P[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${P[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${P[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(v=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${P[l].dynamicClassname}`,children:v.date}),s.jsx("h6",{className:`items products-heading-orderId ${P[l].dynamicClassname}`,children:v.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${P[l].dynamicClassname}`,children:a.curr+" "+f(v.amount)})]})},v.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+" "+f(a.totalPayable)})]})]})]})});{let ne,v=0,X,me;for(let L=0;L<(((yn=a.services)==null?void 0:yn.length)||0);L++)me=a.services[L],me.status==="CANCELLED"&&!a.onlyCancelledItems&&(v+=me.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(ne=Me(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:P[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"}):"",v||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&&ne&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${ne.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:ne.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:`${u.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:`${u.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${Ie}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:P[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${Ie}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(L=>(L.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:Xe(L.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:L.qty})]}),L.addons&&L.addons.length&&L.addons.map(y=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Xe(y.serviceName)})),L.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+L.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:Xe(L.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:L.qty})]}),L.addons&&L.addons.length&&L.addons.map(y=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Xe(y.serviceName)})),L.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+L.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: ",we(a.totalQty-v)]})]}),(gn=a.customFields)==null?void 0:gn.map(L=>s.jsx("h4",{className:"left-align-entity",children:L.customName+": "+L.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:P[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:it(p,a.obj,a.companyLogo,a.companyQrCode)})})},wh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var d,p,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((d=n[e.primaryWaiter])==null?void 0:d.name)||null);const{obj:c,printersMap:u}=pd(e,t,r);console.log({obj:c,printersMap:u});let m=[],f=[];const x=Na(c).flatMap(_=>{var j;return(j=u[_.station])==null?void 0:j.map(T=>new Promise(S=>s.jsx(rt,{printerDataObject:{staticDataKOT:_,paperSize:T.paperSize,printer:T.printer},newId:_.newId,value:{settingData:t},onImageGenerated:M=>{m.push({paperSize:T.paperSize,printer:T.printer,image:M,type:"KOT"}),S()},additionalActions:r},_.newId)))});if(l&&((p=t.packagingSlipPrinters)!=null&&p.length)){const _=yd(e,t,r);(o=_.printers)!=null&&o.length&&_.printers.forEach(j=>{f.push(new Promise(T=>{x.push(s.jsx(rt,{printerDataObject:{staticDataKOT:{obj:j.obj},paperSize:j.paperSize,printer:j.printer,type:"PACKAGING_SLIP"},newId:j.obj.newId,value:{settingData:t},onImageGenerated:S=>{m.push({paperSize:j.paperSize,printer:j.printer,image:S,type:"PACKAGING_SLIP"}),T()},additionalActions:r},j.obj.newId))}))})}x.length&&gt("root2",x),await Promise.all(f),i(m)}catch(l){a(l)}}),Ih=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let d=[],p=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=gd(e,t,n),u=Na(o).flatMap(m=>{var f;return(f=c[m.station])==null?void 0:f.map(x=>new Promise(_=>{const j=s.jsx(rt,{printerDataObject:{staticDataKOT:m,paperSize:l,printer:x.printer,type:m.type},newId:m.newId,settingData:t,tableData:Zn(a,"typeValue"),onImageGenerated:T=>{d.push({paperSize:x.paperSize,printer:x.printer,image:T,type:"UPDATE_TABLE"}),_()},additionalActions:n});return p.push(_),j}))});u.length&&gt("root1",u),await Promise.all(p.map(m=>new Promise(m)))}r(d)}catch(a){i(a)}}),Ch=(e,t)=>new Promise(async(n,r)=>{try{const i=xd(e,t);let a=[];await new Promise(p=>{const o=s.jsx(rt,{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"}),p()},additionalActions:t});gt("root1",o)}),n(a)}catch(i){r(i)}}),Oh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await Nd(e,t,n);let d=[];await new Promise(o=>{const l=s.jsx(rt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});gt("root1",l)}),r(d)}catch(a){i(a)}}),Mh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await xa(e,t,n),d=[];await new Promise(o=>{const l=s.jsx(rt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{d.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});gt("root1",l)}),r(d)}catch(a){i(a)}}),Ah=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let d=await jd(e);if(d&&Object.keys(d.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(u=>{const m=s.jsx(rt,{printerDataObject:{staticDataKOT:d,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:f=>{l.push({paperSize:t.printerSize,image:f,type:"ITEMWISE_SALES_COUNTER"}),u()},additionalActions:r});gt("root1",m)}),i(l)}else i([])}catch(d){a(d)}}),Eh=async(e,t,n)=>new Promise(async(r,i)=>{try{let d=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,p=[];await new Promise(l=>{const c=s.jsx(rt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:d,settingData:t,onImageGenerated:u=>{p.push({paperSize:t.printerSize,image:u,type:"COUNTER_OPERATION"}),l()},additionalActions:n});gt("root1",c)}),r(p)}catch(a){i(a)}}),Rh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var d;try{const p=await _d(e,t);let o=[],l=ar(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(d=l[0])==null?void 0:d.paperSize:t.printerSize;await new Promise(m=>{const f=s.jsx(rt,{printerDataObject:{staticDataKOT:{...p,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"}),m()},additionalActions:r});gt("root1",f)}),i(o)}catch(p){a(p)}}),kh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const d=[];let p=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=ld(l.invoiceFormats,"createdAt")[0],u=await bd(c);await new Promise(f=>{const x=s.jsx(rt,{printerDataObject:{staticDataKOT:u,paperSize:u.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:_=>{p.push({paperSize:u.paperSize,image:_,type:"BILL"}),f()},additionalActions:n});d.push(x)})}}d.length&&gt("root1",d),r(p)}catch(d){i(d)}}),gt=(e,t)=>{const n=document.getElementById(e);n&&ri.createRoot(n).render(t)};Ae.counterDetailsPrint=Eh,Ae.handleAggregatorBillPrint=Oh,Ae.handleBillPrint=Mh,Ae.handleDashboardPrint=Ch,Ae.handleItemWisePrint=Ah,Ae.handleKOTPrint=wh,Ae.handleOldBillPrints=kh,Ae.handleSummaryPrint=Rh,Ae.handleUpdateTablePrint=Ih,Object.defineProperty(Ae,Symbol.toStringTag,{value:"Module"})});