@feedmepos/mf-report 5.31.0 → 5.31.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-CTOxEWL3.js → App-CifvmxI-.js} +34 -34
- package/dist/{DateRangeSelect-DlBcbeZk.js → DateRangeSelect-ChxxlHH1.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-J0peCpEq.js → Default.vue_vue_type_script_setup_true_lang-CL1-_8mf.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-DHSARSGW.js → DynamicWidget.vue_vue_type_script_setup_true_lang-DHjqUTvO.js} +7 -7
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CmHTV3Na.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-CSs3HGml.js} +566 -564
- package/dist/{InsightView-BugYktvQ.js → InsightView-Du6tSxTb.js} +5 -5
- package/dist/{Integration-BjzD2_3f.js → Integration-BAcn22tg.js} +3 -3
- package/dist/{Integrations-mWUyrs1g.js → Integrations-DJxV9dAE.js} +2 -2
- package/dist/{Layout-CHgtDZHa.js → Layout-BYyARllh.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-bD5UFVrJ.js → LocationSelect.vue_vue_type_script_setup_true_lang-CvOMVHQ5.js} +2 -2
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-xNaYh3OY.js → MenuTab.vue_vue_type_script_setup_true_lang-DresFUiL.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-DGRmIPh6.js → NavigationTab.vue_vue_type_script_setup_true_lang-CTWgBaBB.js} +4644 -4614
- package/dist/{OverviewView-LJYMb_hp.js → OverviewView-WaYZ9aiD.js} +5 -5
- package/dist/{Report-DvvKwWi-.js → Report-NAiFlYu_.js} +3 -3
- package/dist/{ReportCanvasView-Cnfg_oGq.js → ReportCanvasView-Bfr5ZK1X.js} +5 -5
- package/dist/{ReportEditor-Do7qTp11.js → ReportEditor-DNKWamHm.js} +7 -7
- package/dist/{ReportView-BTXnZdYx.js → ReportView-DVOKMdRI.js} +6 -6
- package/dist/{ReportViewRoute-BbvgEh5V.js → ReportViewRoute-4E5uW09e.js} +2 -2
- package/dist/{Setting-DQGpx1xF.js → Setting-BIUKmm2_.js} +3 -3
- package/dist/{Template-BRXT7p53.js → Template-COsS2dIW.js} +3 -3
- package/dist/{TileEditor-B_Rz_Fc9.js → TileEditor-BGiamZMW.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-mzuvBako.js → TilePageStack.vue_vue_type_script_setup_true_lang-CIMNFOXf.js} +2 -2
- package/dist/{TransitionFade-ZeaWuTiO.js → TransitionFade-DddzAlaC.js} +5 -5
- package/dist/{app-EPe7ZUzI.js → app-B1esZ9Mq.js} +34 -14
- package/dist/app.js +1 -1
- package/dist/assets/{formatChartData.worker-DdA-N536.js → formatChartData.worker-DcIXAZPX.js} +1 -1
- package/dist/assets/{processTableData.worker-B69y8rv8.js → processTableData.worker-r9RKAQPd.js} +1 -1
- package/dist/{currency-BpBPtZnn.js → currency-CT2q92PX.js} +1 -1
- package/dist/{index-Dyeup-zc.js → index-BScxCrNy.js} +3 -3
- package/dist/{report-Dpf_dull.js → report-BCTiFDGD.js} +1 -1
- package/dist/{useRestaurantPermission-CuCNpcUn.js → useRestaurantPermission-Bt2kY6PE.js} +1 -1
- package/package.json +1 -1
package/dist/assets/{processTableData.worker-B69y8rv8.js → processTableData.worker-r9RKAQPd.js}
RENAMED
|
@@ -86,7 +86,7 @@ Arguments: [`+c+"]"}},t.UnsupportedError.prototype={toString$0(r){return"Unsuppo
|
|
|
86
86
|
`):$+(" (at character "+(E+1)+`)
|
|
87
87
|
`),p=g.length,s=E;s<p;++s)if(l=u.JSString_methods.codeUnitAt$1(g,s),l===10||l===13){p=s;break}return p-a>78?E-a<75?(c=a+75,M=a,b="",O="..."):(p-E<75?(M=p-75,c=p,O=""):(M=E-36,c=E+36,O="..."),b="..."):(c=p,M=a,b="",O=""),$+b+u.JSString_methods.substring$2(g,M,c)+O+`
|
|
88
88
|
`+u.JSString_methods.$mul(" ",E-M+b.length)+`^
|
|
89
|
-
`}else return E!=null?$+(" (at offset "+t.S(E)+")"):$}},t.Iterable.prototype={cast$1$0(r,e){return t.CastIterable_CastIterable(this,t._instanceType(this)._eval$1("Iterable.E"),e)},map$1$1(r,e,n){return t.MappedIterable_MappedIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"),n)},map$1(r,e){return this.map$1$1(r,e,d.dynamic)},where$1(r,e){return new t.WhereIterable(this,e,t._instanceType(this)._eval$1("WhereIterable<Iterable.E>"))},contains$1(r,e){var n;for(n=this.get$iterator(this);n.moveNext$0();)if(o.$eq$(n.get$current(),e))return!0;return!1},fold$1$2(r,e,n){var a,i;for(a=this.get$iterator(this),i=e;a.moveNext$0();)i=n.call$2(i,a.get$current());return i},fold$2(r,e,n){return this.fold$1$2(r,e,n,d.dynamic)},join$1(r,e){var n,a=this.get$iterator(this);if(!a.moveNext$0())return"";if(e===""){n="";do n+=t.S(o.toString$0$(a.get$current()));while(a.moveNext$0())}else for(n=""+t.S(o.toString$0$(a.get$current()));a.moveNext$0();)n=n+e+t.S(o.toString$0$(a.get$current()));return n.charCodeAt(0)==0,n},toList$1$growable(r,e){return t.List_List$of(this,e,t._instanceType(this)._eval$1("Iterable.E"))},toList$0(r){return this.toList$1$growable(r,!0)},toSet$0(r){var e=t.LinkedHashSet_LinkedHashSet(t._instanceType(this)._eval$1("Iterable.E"));return e.addAll$1(0,this),e},get$length(r){var e,n=this.get$iterator(this);for(e=0;n.moveNext$0();)++e;return e},get$isEmpty(r){return!this.get$iterator(this).moveNext$0()},get$isNotEmpty(r){return!this.get$isEmpty(this)},skip$1(r,e){return t.SkipIterable_SkipIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"))},get$first(r){var e=this.get$iterator(this);if(!e.moveNext$0())throw t.wrapException(t.IterableElementError_noElement());return e.get$current()},firstWhere$1(r,e){var n,a;for(n=this.get$iterator(this);n.moveNext$0();)if(a=n.get$current(),e.call$1(a))return a;throw t.wrapException(t.IterableElementError_noElement())},elementAt$1(r,e){var n,a,i;for(t.RangeError_checkNotNegative(e,"index"),n=this.get$iterator(this),a=0;n.moveNext$0();){if(i=n.get$current(),e===a)return i;++a}throw t.wrapException(t.IndexError$withLength(e,a,this,null,"index"))},toString$0(r){return t.IterableBase_iterableToShortString(this,"(",")")}},t._GeneratorIterable.prototype={elementAt$1(r,e){var n=this.length;return(0>e||e>=n)&&t.throwExpression(t.IndexError$withLength(e,n,this,null,"index")),this._generator.call$1(e)},get$length(r){return this.length}},t.Iterator.prototype={},t.MapEntry.prototype={toString$0(r){return"MapEntry("+t.S(this.key)+": "+t.S(this.value)+")"}},t.Null.prototype={get$hashCode(r){return t.Object.prototype.get$hashCode.call(this,this)},toString$0(r){return"null"}},t.Object.prototype={$isObject:1,$eq(r,e){return this===e},get$hashCode(r){return t.Primitives_objectHashCode(this)},toString$0(r){return"Instance of '"+t.Primitives_objectTypeName(this)+"'"},noSuchMethod$1(r,e){throw t.wrapException(t.NoSuchMethodError$_(this,e.get$memberName(),e.get$positionalArguments(),e.get$namedArguments(),null))},toString(){return this.toString$0(this)}},t.Sink.prototype={},t.StringBuffer.prototype={get$length(r){return this._contents.length},toString$0(r){var e=this._contents;return e.charCodeAt(0)==0,e}},t.Endian.prototype={},t.Digest.prototype={$eq(r,e){var n,a,i,s,l;if(e==null)return!1;if(e instanceof t.Digest){if(n=this.bytes,a=e.bytes,i=n.length,i!==a.length)return!1;for(s=0,l=0;l<i;++l)s|=n[l]^a[l];return s===0}return!1},get$hashCode(r){return t.Object_hashAll(this.bytes)},toString$0(r){return t._hexEncode(this.bytes)}},t.DigestSink.prototype={},t.HashSink.prototype={close$0(r){var e,n,a=this;a._isClosed||(a._isClosed=!0,a._finalizeData$0(),a._iterate$0(),e=a._hash_sink$_sink,n=a._byteDigest$0(),e._value!=null&&t.throwExpression(t.StateError$("add may only be called once.")),e._value=new t.Digest(n))},_byteDigest$0(){var r,e,n,a,i;if(u.C_Endian===q.$get$Endian_host())return t.NativeUint8List_NativeUint8List$view(this.digest.buffer,0,null);for(r=this.digest,e=r.byteLength,n=new Uint8Array(e),a=t.NativeByteData_NativeByteData$view(n.buffer,0,null),i=0;i<5;++i)a.setUint32(i*4,r[i],!1);return n},_iterate$0(){var r,e,n,a=this._pendingData,i=t.NativeByteData_NativeByteData$view(a._buffer.buffer,0,null),s=this._currentChunk,l=u.JSInt_methods.$tdiv(a._typed_buffer$_length,s.byteLength);for(r=s.length,e=0;e<l;++e){for(n=0;n<r;++n)s[n]=i.getUint32(e*s.byteLength+n*4,!1);this.updateHash$1(s)}s=l*s.byteLength,t.RangeError_checkValidRange(0,s,a.get$length(a)),s>0&&a._closeGap$2(a,0,s)},_finalizeData$0(){var r,e,n,a,i,s,l=this,p=l._pendingData;for(p._add$1(128),r=l._lengthInBytes+1+8,e=l._currentChunk.byteLength,e=((r+e-1&-e)>>>0)-r,n=0;n<e;++n)p._add$1(0);if(e=l._lengthInBytes,e>0x3ffffffffffff)throw t.wrapException(t.UnsupportedError$("Hashing is unsupported for messages with more than 2^53 bits."));a=e*8,i=p._typed_buffer$_length,p.addAll$1(0,new Uint8Array(8)),s=t.NativeByteData_NativeByteData$view(p._buffer.buffer,0,null),s.setUint32(i,u.JSInt_methods._tdivFast$1(a,4294967296),!1),s.setUint32(i+4,a>>>0,!1)}},t._Sha1Sink.prototype={updateHash$1(r){var e,n,a,i,s,l=this.digest,p=l[0],c=l[1],M=l[2],b=l[3],O=l[4];for(e=this._extended,n=0;n<80;++n,O=b,b=M,M=s,c=p,p=i)n<16?e[n]=r[n]:(a=e[n-3]^e[n-8]^e[n-14]^e[n-16],e[n]=(a<<1|a>>>31)>>>0),i=(((p<<5|p>>>27)>>>0)+O>>>0)+e[n]>>>0,n<20?i=(i+((c&M|~c&b)>>>0)>>>0)+1518500249>>>0:n<40?i=(i+((c^M^b)>>>0)>>>0)+1859775393>>>0:i=n<60?(i+((c&M|c&b|M&b)>>>0)>>>0)+2400959708>>>0:(i+((c^M^b)>>>0)>>>0)+3395469782>>>0,s=(c<<30|c>>>2)>>>0;l[0]=p+l[0]>>>0,l[1]=c+l[1]>>>0,l[2]=M+l[2]>>>0,l[3]=b+l[3]>>>0,l[4]=O+l[4]>>>0}},t.DateSymbols.prototype={toString$0(r){return this.NAME}},t.DateBuilder.prototype={setYear$1(r){this.year=r},setMonth$1(r){this.month=r},setDay$1(r){this.day=r},setDayOfYear$1(r){this.dayOfYear=r},setHour$1(r){this.hour=r},setMinute$1(r){this.minute=r},setSecond$1(r){this.second=r},setFractionalSecond$1(r){this.fractionalSecond=r},_offsetYear$2(r,e){return this._dateTimeConstructor.call$8(r.get$year()+e,r.get$month(),r.get$day(),r.get$hour(),r.get$minute(),r.get$second(),r.get$millisecond(),r.get$isUtc())},asDate$1$retries(r){var e,n,a,i,s,l,p,c,M,b,O,D=this,$=D._date;return $!=null||(D._hasAmbiguousCentury?($=D.year,e=$<0||$>=100):e=!0,e?($=D.year,n=D.month,a=D.dayOfYear,a===0&&(a=D.day),i=D.pm,s=D.hour,i=i?s+12:s,l=D._dateTimeConstructor.call$8($,n,a,i,D.minute,D.second,D.fractionalSecond,D.utc)):(q.$get$_clockKey(),p=t.systemTime(),D.utc&&(p=p.toUtc$0()),c=D._offsetYear$2(p,-80),M=D._offsetYear$2(p,20),$=u.JSInt_methods._tdivFast$1(c.get$year(),100),n=u.JSInt_methods._tdivFast$1(M.get$year(),100),a=D.year,i=D.month,s=D.dayOfYear,s===0&&(s=D.day),b=D.pm,O=D.hour,b=b?O+12:O,O=D._dateTimeConstructor,l=O.call$8(n*100+a,i,s,b,D.minute,D.second,D.fractionalSecond,D.utc),l.compareTo$1(0,M)<=0||(n=D.year,a=D.month,i=D.dayOfYear,i===0&&(i=D.day),s=D.pm,b=D.hour,s=s?b+12:b,l=O.call$8($*100+n,a,i,s,D.minute,D.second,D.fractionalSecond,D.utc))),D.utc&&e?(D._date=l,$=l):$=D._date=D._correctForErrors$2(l,r)),$},asDate$0(){return this.asDate$1$retries(3)},_correctForErrors$2(r,e){var n,a,i,s,l,p,c,M,b=this;return e<=0?r:(n=r.get$year(),n=t.Primitives_valueFromDecomposedDate(n,2,29,0,0,0,0,!1),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),a=t.Primitives_getMonth(new t.DateTime(n,!1))===2,i=t.dayOfYear(r.get$month(),r.get$day(),a),b.utc?n=!1:r.get$isUtc()?(n=r.get$hour(),s=b.pm,l=b.hour,n===(s?l+12:l)&&r.get$day(),n=!0):n=!1,n?(++b._retried,b.asDate$1$retries(e-1)):b.dateOnly&&r.get$hour()!==0?(p=b.asDate$1$retries(e-1),p.$eq(0,r)?(c=b.dayOfYear,c===0&&(c=t.dayOfYear(b.month,b.day,a)),M=r.add$1(0,t.Duration$(0,(c-i)*24-r.get$hour(),0,0,0,0)),M.get$hour()===0?M:t.dayOfYear(M.get$month(),M.get$day(),a)!==c?r:M):p):r)}},t.DateFormat.prototype={_parse$3$strict$utc(r,e,n){var a,i,s,l=this,p=new t.DateBuilder(l._locale,l.dateTimeConstructor),c=l._dateOnly;for(p.dateOnly=c??(l._dateOnly=l.get$_checkDateOnly()),a=new t.StringStack(r),c=l.get$_formatFields(),i=c.length,s=0;s<c.length;c.length===i||(0,t.throwConcurrentModificationError)(c),++s)c[s].parse$2(a,p);return p.asDate$0()},get$_checkDateOnly(){return u.JSArray_methods.every$1(this.get$_formatFields(),new t.DateFormat__checkDateOnly_closure)},get$_formatFields(){var r,e=this,n=e._formatFieldsPrivate;return n==null&&(e._date_format$_pattern==null&&(e.addPattern$1("yMMMMd"),e.addPattern$1("jms")),n=e._date_format$_pattern,n.toString,n=e._parsePatternHelper$1(n),r=t._arrayInstanceType(n)._eval$1("ReversedListIterable<1>"),r=e._formatFieldsPrivate=t.List_List$of(new t.ReversedListIterable(n,r),!0,r._eval$1("ListIterable.E")),n=r),n},_appendPattern$2(r,e){var n=this._date_format$_pattern;this._date_format$_pattern=n==null?r:n+e+r},addPattern$1(r){var e,n,a=this;return a._formatFieldsPrivate=null,e=q.$get$dateTimePatterns(),n=a._locale,e.toString,(t.canonicalizedLocale(n)==="en_US"?e.fallbackData:e._throwException$0()).containsKey$1(r)?(e=q.$get$dateTimePatterns(),e.toString,a._appendPattern$2((t.canonicalizedLocale(n)==="en_US"?e.fallbackData:e._throwException$0()).$index(0,r)," ")):a._appendPattern$2(r," "),a},get$dateSymbols(){var r,e=this._locale;return e!==q.lastDateSymbolLocale&&(q.lastDateSymbolLocale=e,r=q.$get$_dateTimeSymbols(),r.toString,q.cachedDateSymbols=t.canonicalizedLocale(e)==="en_US"?r.fallbackData:r._throwException$0()),e=q.cachedDateSymbols,e.toString,e},get$useNativeDigits(){var r=this._useNativeDigits;return r==null&&(q.DateFormat__useNativeDigitsByDefault.$index(0,this._locale),r=this._useNativeDigits=!0),r},get$digitMatcher(){var r=this,e=r._digitMatcher;return e!=null||(e=q.DateFormat__digitMatchers.putIfAbsent$2(r.get$localeZero(),r.get$_initDigitMatcher()),r._digitMatcher=e,e.toString),e},get$localeZeroCodeUnit(){var r=this._localeZeroCodeUnit;return r??(this._localeZeroCodeUnit=u.JSString_methods._codeUnitAt$1(this.get$localeZero(),0))},get$localeZero(){var r=this,e=r._localeZero;return e==null&&(r.get$useNativeDigits(),r.get$dateSymbols(),e=r._localeZero="0"),e},_initDigitMatcher$0(){var r,e;return this.get$useNativeDigits(),r=this._localeZeroCodeUnit,e=q.$get$asciiZeroCodeUnit(),r==e?q.$get$asciiDigitMatcher():(r=d.int,t.RegExp_RegExp("^["+t.String_String$fromCharCodes(t.Iterable_Iterable$generate(10,new t.DateFormat__initDigitMatcher_closure,r).map$1$1(0,new t.DateFormat__initDigitMatcher_closure0(this),r).toList$0(0),0,null)+"]+",!1))},_parsePatternHelper$1(r){var e,n;return r.length===0?t._setArrayType([],d.JSArray__DateFormatField):(e=this._date_format$_match$1(r),e==null?t._setArrayType([],d.JSArray__DateFormatField):(n=this._parsePatternHelper$1(u.JSString_methods.substring$1(r,e.fullPattern$0().length)),n.push(e),n))},_date_format$_match$1(r){var e,n,a,i;for(e=0;n=q.$get$DateFormat__matchers(),e<3;++e)if(a=n[e].firstMatch$1(r),a!=null)return n=t.DateFormat__fieldConstructors()[e],i=a._match[0],i.toString,n.call$2(i,this);return null}},t.DateFormat_dateTimeConstructor_closure.prototype={call$8(r,e,n,a,i,s,l,p){var c;return p?(c=t.Primitives_valueFromDecomposedDate(r,e,n,a,i,s,l,!0),t._isInt(c)||t.throwExpression(t.argumentErrorValue(c)),new t.DateTime(c,!0)):(c=t.Primitives_valueFromDecomposedDate(r,e,n,a,i,s,l,!1),t._isInt(c)||t.throwExpression(t.argumentErrorValue(c)),new t.DateTime(c,!1))},"call*":"call$8",$requiredArgCount:8,$signature:56},t.DateFormat__checkDateOnly_closure.prototype={call$1(r){return r.get$forDate()},$signature:51},t.DateFormat__initDigitMatcher_closure.prototype={call$1(r){return r},$signature:46},t.DateFormat__initDigitMatcher_closure0.prototype={call$1(r){return this.$this.get$localeZeroCodeUnit()+r},$signature:46},t.DateFormat__fieldConstructors_closure.prototype={call$2(r,e){var n=t._DateFormatQuotedField__patchQuotes(r);return u.JSString_methods.trim$0(n),new t._DateFormatQuotedField(r,n,e)},$signature:65},t.DateFormat__fieldConstructors_closure0.prototype={call$2(r,e){return u.JSString_methods.trim$0(r),new t._DateFormatPatternField(r,e)},$signature:69},t.DateFormat__fieldConstructors_closure1.prototype={call$2(r,e){return u.JSString_methods.trim$0(r),new t._DateFormatLiteralField(r,e)},$signature:74},t._DateFormatField.prototype={get$forDate(){return!0},fullPattern$0(){return this.pattern},toString$0(r){return this.pattern},parseLiteral$1(r){var e=this.pattern,n=e.length,a=r.peek$1(n);r._string_stack$_index+=n,a!==e&&this.throwFormatException$1(r)},throwFormatException$1(r){throw t.wrapException(t.FormatException$("Trying to read "+this.toString$0(0)+" from "+r.toString$0(0),null,null))}},t._DateFormatLiteralField.prototype={parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatQuotedField.prototype={fullPattern$0(){return this._fullPattern},parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatPatternField.prototype={parse$2(r,e){this.parseField$2(r,e)},get$forDate(){var r=this._forDate;return r==null&&(r=this.pattern[0],r=this._forDate=t.stringContainsUnchecked("cdDEGLMQvyZz",r,0)),r},parseField$2(r,e){var n,a,i=this;try{switch(n=i.pattern,n[0]){case"a":i.parseEnumeratedString$2(r,i.parent.get$dateSymbols().AMPMS)===1&&(e.pm=!0);break;case"c":i.parseStandaloneDay$1(r);break;case"d":i.handleNumericField$2(r,e.get$setDay());break;case"D":i.handleNumericField$2(r,e.get$setDayOfYear());break;case"E":a=i.parent,i.parseEnumeratedString$2(r,n.length>=4?a.get$dateSymbols().WEEKDAYS:a.get$dateSymbols().SHORTWEEKDAYS);break;case"G":a=i.parent,i.parseEnumeratedString$2(r,n.length>=4?a.get$dateSymbols().ERANAMES:a.get$dateSymbols().ERAS);break;case"h":i.handleNumericField$2(r,e.get$setHour()),e.hour===12&&(e.hour=0);break;case"H":i.handleNumericField$2(r,e.get$setHour());break;case"K":i.handleNumericField$2(r,e.get$setHour());break;case"k":i.handleNumericField$3(r,e.get$setHour(),-1);break;case"L":i.parseStandaloneMonth$2(r,e);break;case"M":i.parseMonth$2(r,e);break;case"m":i.handleNumericField$2(r,e.get$setMinute());break;case"Q":break;case"S":i.handleNumericField$2(r,e.get$setFractionalSecond());break;case"s":i.handleNumericField$2(r,e.get$setSecond());break;case"v":break;case"y":i.handleNumericField$2(r,e.get$setYear()),e._hasAmbiguousCentury=n.length===2;break;case"z":break;case"Z":break;default:return}}catch{i.throwFormatException$1(r)}},handleNumericField$3(r,e,n){var a=this.parent;e.call$1(this._nextInteger$3(r,a.get$digitMatcher(),a.get$localeZeroCodeUnit())+n)},handleNumericField$2(r,e){return this.handleNumericField$3(r,e,0)},_nextInteger$3(r,e,n){var a,i,s,l,p=e.stringMatch$1(r.peek$1(r.contents.length-r._string_stack$_index));if(p==null||p.length===0)return this.throwFormatException$1(r);if(a=p.length,r._string_stack$_index+=a,i=q.$get$asciiZeroCodeUnit(),n!==i){for(a>4294967295&&t.throwExpression(t.RangeError$range(a,0,4294967295,"length",null)),s=o.JSArray_JSArray$markFixed(new Array(a),d.int),l=0;l<a;++l)s[l]=u.JSString_methods._codeUnitAt$1(p,l)-n+i;p=t.String_String$fromCharCodes(s,0,null)}return t.int_parse(p)},parseEnumeratedString$2(r,e){var n,a,i,s,l,p,c,M,b=t._setArrayType([],d.JSArray_int);for(n=e.length,a=r.contents,i=a.length,s=0;s<n;++s)l=e[s],p=r._string_stack$_index,u.JSString_methods.substring$2(a,p,Math.min(p+l.length,i))===l&&b.push(s);for(b.length===0&&this.throwFormatException$1(r),c=u.JSArray_methods.get$first(b),b=t.SubListIterable$(b,1,null,d.int),b=new t.ListIterator(b,b.get$length(b)),n=t._instanceType(b)._precomputed1;b.moveNext$0();)a=b.__internal$_current,M=a??n._as(a),e[M].length>=e[c].length&&(c=M);return r._string_stack$_index+=e[c].length,c},parseMonth$2(r,e){var n,a=this;switch(a.pattern.length){case 5:n=a.parent.get$dateSymbols().NARROWMONTHS;break;case 4:n=a.parent.get$dateSymbols().MONTHS;break;case 3:n=a.parent.get$dateSymbols().SHORTMONTHS;break;default:return a.handleNumericField$2(r,e.get$setMonth())}e.month=a.parseEnumeratedString$2(r,n)+1},parseStandaloneDay$1(r){var e,n=this;switch(n.pattern.length){case 5:e=n.parent.get$dateSymbols().STANDALONENARROWWEEKDAYS;break;case 4:e=n.parent.get$dateSymbols().STANDALONEWEEKDAYS;break;case 3:e=n.parent.get$dateSymbols().STANDALONESHORTWEEKDAYS;break;default:return n.handleNumericField$2(r,new t._DateFormatPatternField_parseStandaloneDay_closure)}n.parseEnumeratedString$2(r,e)},parseStandaloneMonth$2(r,e){var n,a=this;switch(a.pattern.length){case 5:n=a.parent.get$dateSymbols().STANDALONENARROWMONTHS;break;case 4:n=a.parent.get$dateSymbols().STANDALONEMONTHS;break;case 3:n=a.parent.get$dateSymbols().STANDALONESHORTMONTHS;break;default:return a.handleNumericField$2(r,e.get$setMonth())}e.month=a.parseEnumeratedString$2(r,n)+1}},t._DateFormatPatternField_parseStandaloneDay_closure.prototype={call$1(r){return r},$signature:7},t.StringStack.prototype={peek$1(r){var e=this.contents,n=this._string_stack$_index;return u.JSString_methods.substring$2(e,n,Math.min(n+r,e.length))},toString$0(r){return this.contents+" at "+this._string_stack$_index}},t.UninitializedLocaleData.prototype={$index(r,e){return t.canonicalizedLocale(e)==="en_US"?this.fallbackData:this._throwException$0()},_throwException$0(){throw t.wrapException(new t.LocaleDataException("Locale data has not been initialized, call "+this.message+"."))}},t.LocaleDataException.prototype={toString$0(r){return"LocaleDataException: "+this.message}},t.StartOfWeek.prototype={_enumToString$0(){return"StartOfWeek."+this._name}},t.Units.prototype={_enumToString$0(){return"Units."+this._name}},t.Jiffy.prototype={get$dateTime(){var r=this.__Jiffy__dateTime_A;return r===q&&t.throwUnnamedLateFieldNI(),r},_parseMap$1(r){var e,n,a,i,s,l,p;return r.forEach$1(0,new t.Jiffy__parseMap_closure),r.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=r.$index(0,"year"),e==null&&(e=r.$index(0,"years")),e==null&&(e=r.$index(0,"y")),e==null&&(e=t.Primitives_getYear(new t.DateTime(Date.now(),!1))),n=r.$index(0,"month"),n==null&&(n=r.$index(0,"months")),n==null&&(n=r.$index(0,"M")),n==null&&(n=t.Primitives_getMonth(new t.DateTime(Date.now(),!1))),a=r.$index(0,"day"),a==null&&(a=r.$index(0,"days")),a==null&&(a=r.$index(0,"d")),a==null&&(a=t.Primitives_getDay(new t.DateTime(Date.now(),!1))),i=r.$index(0,"hour"),i==null&&(i=r.$index(0,"hours")),i==null&&(i=r.$index(0,"h")),i==null&&(i=t.Primitives_getHours(new t.DateTime(Date.now(),!1))),s=r.$index(0,"minute"),s==null&&(s=r.$index(0,"minutes")),s==null&&(s=r.$index(0,"m")),s==null&&(s=t.Primitives_getMinutes(new t.DateTime(Date.now(),!1))),l=r.$index(0,"second"),l==null&&(l=r.$index(0,"seconds")),l==null&&(l=r.$index(0,"s")),l==null&&(l=t.Primitives_getSeconds(new t.DateTime(Date.now(),!1))),p=r.$index(0,"millisecond"),p==null&&(p=r.$index(0,"milliseconds")),p==null&&(p=r.$index(0,"ms")),p==null&&(p=t.Primitives_getMilliseconds(new t.DateTime(Date.now(),!1))),e=t.Primitives_valueFromDecomposedDate(e,n,a,i,s,l,p,!1),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!1))},_parseList$1(r){var e,n,a,i,s,l,p=o.getInterceptor$asx(r);return p.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=p.$index(r,0),n=p.get$length(r)>1?p.$index(r,1):1,a=p.get$length(r)>2?p.$index(r,2):1,i=p.get$length(r)>3?p.$index(r,3):0,s=p.get$length(r)>4?p.$index(r,4):0,l=p.get$length(r)>5?p.$index(r,5):0,p=p.get$length(r)>6?p.$index(r,6):0,p=t.Primitives_valueFromDecomposedDate(e,n,a,i,s,l,p,!1),t._isInt(p)||t.throwExpression(t.argumentErrorValue(p)),new t.DateTime(p,!1))},_parseString$2(r,e){var n="yyyy/MM/dd",a="(\\d{4})(\\d{1,2})(\\d{1,2})$",i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}$",!1);if(i._nativeRegExp.test(r))return t.DateFormat$("yyyy-MM-dd")._parse$3$strict$utc(r,!1,!1);if(i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),i._nativeRegExp.test(r)?i=!0:(i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),i=i._nativeRegExp.test(r)),i)return t.DateTime_parse(r).toLocal$0();if(i=t.RegExp_RegExp("\\d{4}\\/\\d{1,2}\\/\\d{1,2}$",!1),i._nativeRegExp.test(r))return t.DateFormat$(n)._parse$3$strict$utc(r,!1,!1);if(i=t.RegExp_RegExp(a,!1),i._nativeRegExp.test(r))return t.DateFormat$(n)._parse$3$strict$utc(t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(a,!1),new t.Jiffy__parseString_closure,null),!1,!1);throw t.wrapException(t.JiffyException$('Date time not recognized, a pattern must be passed, e.g. Jiffy("12, Oct", "dd, MMM")').get$cause())},add$1$minutes(r,e){var n=this,a=n.__Jiffy__dateTime_A;return a===q&&t.throwUnnamedLateFieldNI(),a=a.add$1(0,u.Duration_0),n.__Jiffy__dateTime_A=a,a=a.add$1(0,t.Duration$(0,0,0,0,e,0)),n.__Jiffy__dateTime_A=a,a=n._addMonths$2(a,0),n.__Jiffy__dateTime_A=a,n.__Jiffy__dateTime_A=n._addMonths$2(a,0),t.Jiffy$(n)},subtract$1$days(r){var e=this,n=e.__Jiffy__dateTime_A;return n===q&&t.throwUnnamedLateFieldNI(),n=n.subtract$1(u.Duration_0),e.__Jiffy__dateTime_A=n,n=n.subtract$1(t.Duration$(r,0,0,0,0,0)),e.__Jiffy__dateTime_A=n,n=e._addMonths$2(n,-0),e.__Jiffy__dateTime_A=n,e.__Jiffy__dateTime_A=e._addMonths$2(n,-0),t.Jiffy$(e)},_addMonths$2(r,e){var n,a,i,s,l,p,c,M=u.JSInt_methods.$mod(e,12),b=u.JSInt_methods._tdivFast$1(e-M,12),O=r.get$year()+b,D=r.get$month()+M;return D>12&&(++O,D-=12),n=r.get$day(),a=u.List_mC8[D],D===2&&u.JSInt_methods.$mod(O,4)===0?i=u.JSInt_methods.$mod(O,100)!==0||u.JSInt_methods.$mod(O,400)===0:i=!1,i&&++a,s=Math.min(n,a),r.get$isUtc()?(n=r.get$hour(),i=r.get$minute(),l=r.get$second(),p=r.get$millisecond(),c=r.get$microsecond(),n=t.Primitives_valueFromDecomposedDate(O,D,s,n,i,l,p+u.JSNumber_methods.round$0(c/1e3),!0),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),new t.DateTime(n,!0)):(n=r.get$hour(),i=r.get$minute(),l=r.get$second(),p=r.get$millisecond(),c=r.get$microsecond(),n=t.Primitives_valueFromDecomposedDate(O,D,s,n,i,l,p+u.JSNumber_methods.round$0(c/1e3),!1),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),new t.DateTime(n,!1))}},t.Jiffy__parseMap_closure.prototype={call$2(r,e){(r==="M"?r:t.normalizeUnits(r))==="0"&&t.throwExpression(t.JiffyException$('Invalid unit passed, the following units are available "year", "month", "week", "day", "hour", "minute", "second", "millisecond"').get$cause())},$signature:33},t.Jiffy__parseString_closure.prototype={call$1(r){return t.S(r.group$1(0,1))+"/"+t.S(r.group$1(0,2))+"/"+t.S(r.group$1(0,3))},$signature:15},t.ArLyLocale.prototype={},t.ArSaMaDzKwTnLocale.prototype={},t.AzLocale.prototype={},t.BnLocale.prototype={},t.DeLocale.prototype={},t.EnLocale.prototype={},t.EsLocale.prototype={},t.FaLocale.prototype={},t.FrLocale.prototype={},t.HiLocale.prototype={},t.IdLocale.prototype={},t.ItLocale.prototype={},t.JaLocale.prototype={},t.KoLocale.prototype={},t.Locale.prototype={},t.NbLocale.prototype={},t.NlLocale.prototype={},t.PlLocale.prototype={},t.PtLocale.prototype={},t.RuLocale.prototype={},t.SvLocale.prototype={},t.ThLocale.prototype={},t.TrLocale.prototype={},t.UkLocale.prototype={},t.ZhCnLocale.prototype={},t.ZhLocale.prototype={},t.JiffyException.prototype={get$cause(){return"JiffyException: "+this._cause}},t.BufferModule.prototype={},t.BufferConstants.prototype={},t.Buffer.prototype={},t.ConsoleModule.prototype={},t.Console.prototype={},t.EventEmitter.prototype={},t.Promise.prototype={},t.Date.prototype={},t.JsError.prototype={},t.Atomics.prototype={},t.Modules.prototype={},t.Module.prototype={},t.Net.prototype={},t.Socket.prototype={},t.NetAddress.prototype={},t.NetServer.prototype={},t.NodeJsError.prototype={},t.JsAssertionError.prototype={},t.JsRangeError.prototype={},t.JsReferenceError.prototype={},t.JsSyntaxError.prototype={},t.JsTypeError.prototype={},t.JsSystemError.prototype={},t.Process.prototype={},t.CPUUsage.prototype={},t.Release.prototype={},t.StreamModule.prototype={},t.Readable.prototype={},t.Writable.prototype={},t.Duplex.prototype={},t.Transform.prototype={},t.WritableOptions.prototype={},t.ReadableOptions.prototype={},t.Immediate.prototype={},t.Timeout.prototype={},t.TTY.prototype={},t.TTYReadStream.prototype={},t.TTYWriteStream.prototype={},t.Util.prototype={},t.Connection.prototype={},t.SchemaLibrary.prototype={SchemaLibrary$2$connection$schemas(r,e){var n,a,i,s,l;for(n=this._schemas,a=r.sourceDatasetId,i=r.targetDatasetId,s=0;s<114;++s)l=n[s],l._rawTablePrefix=a,l._materializeTablePrefix=i},getSchema$1(r){return u.JSArray_methods.firstWhere$1(this._schemas,new t.SchemaLibrary_getSchema_closure(r))},get$visualizationSchemas(){var r=this._schemas,e=t._arrayInstanceType(r),n=e._eval$1("MappedIterable<1,VisualizationSchema>");return t.List_List$of(new t.MappedIterable(new t.WhereIterable(r,new t.SchemaLibrary_visualizationSchemas_closure,e._eval$1("WhereIterable<1>")),new t.SchemaLibrary_visualizationSchemas_closure0,n),!0,n._eval$1("Iterable.E"))}},t.SchemaLibrary_getSchema_closure.prototype={call$1(r){return r.name===this.name},$signature:37},t.SchemaLibrary_visualizationSchemas_closure.prototype={call$1(r){return!r.isMaterializeOnly},$signature:37},t.SchemaLibrary_visualizationSchemas_closure0.prototype={call$1(r){return r.get$visualizationSchema()},$signature:92},t.QueryEngineContext.prototype={},t.Materialize_get_createMaterializedTableSql_closure.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure0.prototype={call$1(r){return"ADD COLUMN IF NOT EXISTS "+r.name+" "+r.type._name},$signature:10},t.Materialize_get_createMaterializedTableSql_closure1.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure2.prototype={call$1(r){return r.name+" "+r.type._name},$signature:10},t.Materialize_getMergeSql_closure.prototype={call$1(r){return"CAST("+r+" AS STRING)"},$signature:3},t.Materialize_getMergeSql_closure0.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure1.prototype={call$1(r){return"SAFE_CAST(JSON_VALUE("+this._this.name._name+", '$."+t.S(r.pointTo)+"') AS "+r.type._name+") AS "+r.name},$signature:10},t.Materialize_getMergeSql_closure2.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure3.prototype={call$1(r){return r.name},$signature:10},t.Materialize_getMergeSql_closure4.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure5.prototype={call$1(r){var e=r.name;return e+"=source_table."+e},$signature:10},t.Materialize_getMaterializeInfoSql_closure.prototype={call$1(r){return"CAST("+r+" AS STRING)"},$signature:3},t.Materialize_getMaterializeInfoSql_closure0.prototype={call$1(r){return"TIMESTAMP("+r+", '"+this.tz+"') AS "+r},$signature:3},t.SOURCE_TYPE.prototype={_enumToString$0(){return"SOURCE_TYPE."+this._name}},t.MERGE_FILTER_TYPE.prototype={_enumToString$0(){return"MERGE_FILTER_TYPE."+this._name}},t.FIELD_ROLE.prototype={_enumToString$0(){return"FIELD_ROLE."+this._name}},t.Canonical.prototype={toJson$0(){var r,e=this.predicates;return o.get$isEmpty$asx(e)&&(e=null),r=this.measurePredicates,r.get$isEmpty(r)&&(r=null),t.LinkedHashMap_LinkedHashMap$_literal(["measures",this.measures,"predicates",e,"measurePredicates",r],d.String,d.dynamic)}},t.Canonical_fromJson_closure.prototype={call$2(r,e){return new t.MapEntry(t._asString(r),o.cast$1$0$ax(d.List_dynamic._as(e),d.String),d.MapEntry_of_String_and_List_String)},$signature:114},t.Hierarchy.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["depth",r.depth,"root",r.root,"parent",r.parent,"rootKey",r.rootKey],d.String,d.dynamic)}},t.SCHEMA_NAME.prototype={_enumToString$0(){return"SCHEMA_NAME."+this._name}},t.DATA_TYPE.prototype={_enumToString$0(){return"DATA_TYPE."+this._name}},t.AGGREGATION_TYPE.prototype={_enumToString$0(){return"AGGREGATION_TYPE."+this._name}},t.COMPARISON_OPERATOR.prototype={_enumToString$0(){return"COMPARISON_OPERATOR."+this._name}},t.DIMENSION_OPTION.prototype={_enumToString$0(){return"DIMENSION_OPTION."+this._name}},t.TIME_FORMATTER.prototype={_enumToString$0(){return"TIME_FORMATTER."+this._name}},t.FORMATTER_TYPE.prototype={_enumToString$0(){return"FORMATTER_TYPE."+this._name}},t.PERIOD_TYPE.prototype={_enumToString$0(){return"PERIOD_TYPE."+this._name}},t.SORT_TYPE.prototype={_enumToString$0(){return"SORT_TYPE."+this._name}},t.PermissionType.prototype={_enumToString$0(){return"PermissionType."+this._name}},t.Permission.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"field",this.field],d.String,d.dynamic)}},t.TopLevelFilters.prototype={toJson$0(){var r=this.permissions,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>");return t.LinkedHashMap_LinkedHashMap$_literal(["timeControl",this.timeControl,"permissions",t.List_List$of(new t.MappedListIterable(r,new t.TopLevelFilters_toJson_closure,e),!0,e._eval$1("ListIterable.E"))],d.String,d.dynamic)}},t.TopLevelFilters_fromJson_closure.prototype={call$1(r){return new t.Permission(t.EnumByName_byName(u.List_wsa,r.$index(0,"type")),r.$index(0,"field"))},$signature:55},t.TopLevelFilters_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:118},t.Source.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["type",r.type._name,"table",r.table,"field",r.field,"dataset",r.dataset,"uniqueKey",r.uniqueKey,"timeColumn",r.timeColumn,"dateColumns",r.dateColumns],d.String,d.dynamic)}},t.INDEX_METHOD.prototype={_enumToString$0(){return"INDEX_METHOD."+this._name}},t.Index.prototype={toJson$0(){var r=this,e=r.indexMethod;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["column",r.column,"customName",r.customName,"indexMethod",e,"include",r.include],d.String,d.dynamic)}},t.Schema.prototype={setConnection$1(r){this._rawTablePrefix=r.sourceDatasetId,this._materializeTablePrefix=r.targetDatasetId},getTransformedTableQuery$1$getParentDocs(r){var e,n,a=this.source,i=a.type;return i===u.SOURCE_TYPE_2?e="transformBigqueryDoc":e=i===u.SOURCE_TYPE_1?"transformCouchdbDoc":"transformMongodbDoc",n="SAFE.PARSE_JSON("+("`"+this._materializeTablePrefix+"."+e+"`(data, id, db_name, publish_time, deleted, '"+a.table+"')")+", wide_number_mode=>'round')",a=a.field,a!=null&&!r?(a=t.S(a),a="SELECT JSON_QUERY_ARRAY("+n+", '$."+a+"') AS "+a+" FROM docs"):a="SELECT "+n+" AS "+this.name._name+" FROM docs",a},get$fullRawTableName(){var r=this._rawTablePrefix;return r=r!==""?r+".":"",r+this.rawTableName},get$fullMaterializedTableName(){var r=this._materializeTablePrefix;return r=r!==""?r+".":"",r+this.materializedTableName},get$visualizationSchema(){var r=this,e=o.where$1$ax(r.fields,new t.Schema_visualizationSchema_closure),n=e.$ti._eval$1("MappedIterable<1,VisualizationField>");return t.VisualizationSchema$(t.List_List$of(new t.MappedIterable(e,new t.Schema_visualizationSchema_closure0,n),!0,n._eval$1("Iterable.E")),r.isJoinOnly,o.map$1$1$ax(r.joins,new t.Schema_visualizationSchema_closure1,d.SCHEMA_NAME).toList$0(0),r.label,r.name)},toJson$0(){var r,e,n,a,i,s,l=this,p=d.Map_String_dynamic,c=o.map$1$1$ax(l.fields,new t.Schema_toJson_closure,p).toList$0(0);return p=o.map$1$1$ax(l.joins,new t.Schema_toJson_closure0,p).toList$0(0),r=l.topLevelFilters.toJson$0(),e=l.source.toJson$0(),n=l.filters,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(n,new t.Schema_toJson_closure1,a),!0,a._eval$1("ListIterable.E")),n=l.indexes,n==null?n=null:(i=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(n,new t.Schema_toJson_closure2,i),!0,i._eval$1("ListIterable.E")),n=i),i=l.canonical,i=i==null?null:i.toJson$0(),s=l.hierarchy,s=s==null?null:s.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["fields",c,"label",l.label,"name",l.name._name,"joins",p,"topLevelFilters",r,"source",e,"dynamicRawTable",l.dynamicRawTable,"rawTableName",l.rawTableName,"rawTopicName",l.rawTopicName,"materializedTableName",l.materializedTableName,"materializedPostgresqlTableName",l.materializedPostgresqlTableName,"isJoinOnly",l.isJoinOnly,"isMaterializeOnly",l.isMaterializeOnly,"isContinuousUpdate",l.isContinuousUpdate,"interval",l.interval,"partition",l.partition,"requirePartitionFilter",l.requirePartitionFilter,"clusters",l.clusters,"filters",a,"indexes",n,"isGlobal",l.isGlobal,"isAiHidden",l.isAiHidden,"aiKeywords",l.aiKeywords,"aiCategory",l.aiCategory,"aiPriority",l.aiPriority,"mergeFilterType",l.mergeFilterType._name,"description",l.description,"canonical",i,"hierarchy",s,"activityAnchor",l.activityAnchor,"isDeprecated",l.isDeprecated],d.String,d.dynamic)}},t.Schema_visualizationSchema_closure.prototype={call$1(r){return!r.hidden},$signature:2},t.Schema_visualizationSchema_closure0.prototype={call$1(r){var e=r.type,n=r.name,a=r.label,i=r.schemaName,s=t.getFilterOperators(e);return new t.VisualizationField(i,n,a,e,t.getAggregationTypes(e),t.getDimensionOptions(e),s)},$signature:117},t.Schema_visualizationSchema_closure1.prototype={call$1(r){return r.joinSchemaName},$signature:106},t.Schema_fromJson_closure.prototype={call$1(r){return t.Field_fromJson(r)},$signature:105},t.Schema_fromJson_closure0.prototype={call$1(r){return t.Join_fromJson(r)},$signature:104},t.Schema_fromJson_closure1.prototype={call$1(r){var e,n,a,i=r.$index(0,"column");return i==null&&(i=t._setArrayType([],d.JSArray_String)),e=r.$index(0,"customName"),n=t.EnumByName_byName(u.List_88s,r.$index(0,"indexMethod")),a=d.nullable_List_dynamic._as(r.$index(0,"include")),new t.Index(i,e,n,a==null?null:o.cast$1$0$ax(a,d.String))},$signature:102},t.Schema_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:16},t.Schema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:99},t.Schema_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:97},t.Schema_toJson_closure1.prototype={call$1(r){return r.toJson$0()},$signature:17},t.Schema_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:95},t.Field.prototype={getSql$3$option$schema$value(r,e,n){var a,i;return n!=null?o.toString$0$(n):(a=this.formula,i=e.name._name,a!=null?(i=t.ReCase$(i)._getCamelCase$0(),t.stringReplaceAllUnchecked(a,"@",i+".")):t.ReCase$(i)._getCamelCase$0()+"."+this.name)},getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(r,e,n,a){var i=n.getSchema$1(this.schemaName),s=o.firstWhere$1$ax(i.fields,new t.Field_getQueryPlainSql_closure(this)),l=i.name._name,p=t.ReCase$(l)._getCamelCase$0()+"."+s.name,c=s.formula;switch(c!=null&&(l=t.ReCase$(l)._getCamelCase$0(),p=t.stringReplaceAllUnchecked(c,"@",l+".")),s.type.index){case 1:p=e==null?T.FORMAT+p+")":t.DimensionOptionExtension_formatSql(e,p,a);break;case 0:p="ANY_VALUE("+p+") OVER (PARTITION BY REGEXP_REPLACE(IFNULL("+p+",''), ' ', ''))";break}return p},toJson$0(){var r=this,e=r.role;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name,"schemaName",r.schemaName._name,"pointTo",r.pointTo,"formula",r.formula,"postgresqlFormula",r.postgresqlFormula,"label",r.label,"hidden",r.hidden,"type",r.type._name,"isAiHidden",r.isAiHidden,"isCompareIgnoreSpaces",r.isCompareIgnoreSpaces,"description",r.description,"role",e,"identityOf",r.identityOf],d.String,d.dynamic)}},t.Field_getQueryPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t._NumericField.prototype={getSql$3$option$schema$value(r,e,n){return this.super$Field$getSql(r,e,n)}},t._TimestampField.prototype={_getExtractTimestampSql$3$part$sql$value(r,e,n){return n!=null?e:"CAST(EXTRACT("+r+" FROM "+e+" AT TIME ZONE @TIMEZONE) as INT64)"},getSql$3$option$schema$value(r,e,n){var a=this,i=a.super$Field$getSql(r,e,n);switch(r){case u.DIMENSION_OPTION_5:i="TIME("+(n!=null?"TIMESTAMP('"+i+"')":i)+", @TIMEZONE)";break;case u.DIMENSION_OPTION_6:i=a._getExtractTimestampSql$3$part$sql$value("HOUR",i,n);break;case u.DIMENSION_OPTION_7:i=a._getExtractTimestampSql$3$part$sql$value("DAYOFWEEK",i,n);break;case u.DIMENSION_OPTION_8:i=a._getExtractTimestampSql$3$part$sql$value("DAY",i,n);break;case u.DIMENSION_OPTION_9:i=a._getExtractTimestampSql$3$part$sql$value("MONTH",i,n);break;case u.DIMENSION_OPTION_10:i=a._getExtractTimestampSql$3$part$sql$value("YEAR",i,n);break;case u.DIMENSION_OPTION_0:case u.DIMENSION_OPTION_1:case u.DIMENSION_OPTION_2:case u.DIMENSION_OPTION_3:case u.DIMENSION_OPTION_4:case u.DIMENSION_OPTION_11:default:n!=null&&(i="TIMESTAMP('"+i+"')");break}return i}},t._BoolField.prototype={getSql$3$option$schema$value(r,e,n){return this.super$Field$getSql(r,e,n)}},t._StringField.prototype={getSql$3$option$schema$value(r,e,n){var a=this.super$Field$getSql(r,e,n);return o.$eq$(n,"NULL")?a:n!=null?"'"+a+"'":a}},t.Join.prototype={getConditionsSql$1(r){return u.JSArray_methods.fold$2(this.conditions,"",new t.Join_getConditionsSql_closure(this,r))},toJson$0(){var r=this,e=r.conditions,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>");return n=t.List_List$of(new t.MappedListIterable(e,new t.Join_toJson_closure,n),!0,n._eval$1("ListIterable.E")),e=r.lateral,e=e==null?null:e.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["joinSchemaName",r.joinSchemaName._name,"mainSchemaName",r.mainSchemaName._name,"conditions",n,"topLevelTimeControl",r.topLevelTimeControl,"lateral",e],d.String,d.dynamic)}},t.Join_getConditionsSql_closure.prototype={call$2(r,e){var n=this.$this,a=t._setArrayType([e.joinField],d.JSArray_String),i=e.option,s=t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(null,a,i,n.joinSchemaName),e.operator,this.schemaLibrary,t._QueryRequestComparisonTargetVariable$(null,e.mainFields,i,n.mainSchemaName)).getSql$0();return r===""?s:r+" and "+s},$signature:89},t.Join_fromJson_closure.prototype={call$1(r){var e=r.$index(0,"joinField"),n=r.$index(0,"mainFields"),a=t.EnumByName_byName(u.List_LO4,r.$index(0,"operator"));return new t.JoinCondition(e,n,a,r.$index(0,"option")!=null?t.EnumByName_byName(u.List_yRY,r.$index(0,"option")):null)},$signature:88},t.Join_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:85},t.JoinLateralSort.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["name",this.name,"type",this.type._name],d.String,d.dynamic)}},t.JoinLateral.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["distinctFields",this.distinctFields,"sorts",o.map$1$1$ax(this.sorts,new t.JoinLateral_toJson_closure,d.Map_String_dynamic).toList$0(0)],d.String,d.dynamic)}},t.JoinLateral_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:78},t.JoinCondition.prototype={toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["joinField",r.joinField,"mainFields",r.mainFields,"operator",r.operator._name,"option",e],d.String,d.dynamic)}},t.QueryRequestComparisonTarget.prototype={},t._QueryRequestComparisonTargetValue.prototype={},t._QueryRequestComparisonTargetVariable.prototype={},t.QueryRequestComparison.prototype={getSql$0(){var r,e,n,a=this,i=a.operator;switch(i.index){case 0:i=a.to,r=i.length,r===0?e="":r===1?(n=i[0],i=a.from,e=n==="NULL"?i+" is "+n:i+"="+n):(r=a.from,e=r+" in ("+u.JSArray_methods.join$1(i,",")+")",u.JSArray_methods.contains$1(i,"NULL")&&(e=e+" OR "+r+" IS NULL"));break;case 1:i=a.to,r=i.length,r===0?e="":r===1?(n=i[0],i=a.from,e=n==="NULL"?i+" is not "+n:i+"!="+n):(r=a.from,e=r+" not in ("+u.JSArray_methods.join$1(i,",")+")",u.JSArray_methods.contains$1(i,"NULL")&&(e=e+" AND "+r+" IS NOT NULL"));break;case 7:i=a.to,e=i.length===0?"":new t.MappedListIterable(i,new t.QueryRequestComparison_getSql_closure(a),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0," or ");break;case 8:i=a.to,e=i.length===0?"":new t.MappedListIterable(i,new t.QueryRequestComparison_getSql_closure0(a),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0," and ");break;case 3:e=a.from+"<"+t.S(a.to[0]);break;case 5:e=a.from+"<="+t.S(a.to[0]);break;case 2:e=a.from+">"+t.S(a.to[0]);break;case 4:e=a.from+">="+t.S(a.to[0]);break;case 6:i=a.to,e=a.from+" between "+t.S(i[0])+" and "+t.S(i[1]);break;case 10:i=t._setArrayType([a.from],d.JSArray_String),u.JSArray_methods.addAll$1(i,a.to),e=u.JSArray_methods.join$1(i," or ");break;case 9:i=t._setArrayType([a.from],d.JSArray_String),u.JSArray_methods.addAll$1(i,a.to),e=u.JSArray_methods.join$1(i," and ");break;default:throw t.wrapException(t.Exception_Exception("invalid operator "+i._name))}return e!==""?"("+e+")":e}},t.QueryRequestComparison_QueryRequestComparison$nested_closure.prototype={call$1(r){return r.getSql$0()},$signature:60},t.QueryRequestComparison_getToValues_closure.prototype={call$1(r){var e=this.toSchema;return o.firstWhere$1$ax(e.fields,new t.QueryRequestComparison_getToValues__closure0(r)).getSql$3$option$schema$value(this.to.option,e,null)},$signature:3},t.QueryRequestComparison_getToValues__closure0.prototype={call$1(r){return r.name===this.name},$signature:2},t.QueryRequestComparison_getToValues_closure0.prototype={call$1(r){var e,n=this.operator;return n===u.COMPARISON_OPERATOR_7||n===u.COMPARISON_OPERATOR_8?"'%"+t.S(r)+"%'":(n=this.toSchema,e=this.to,o.firstWhere$1$ax(n.fields,new t.QueryRequestComparison_getToValues__closure(e)).getSql$3$option$schema$value(e.option,n,r))},$signature:8},t.QueryRequestComparison_getToValues__closure.prototype={call$1(r){return r.name===o.get$first$ax(this.to.names)},$signature:2},t.QueryRequestComparison_getFromValue_closure.prototype={call$1(r){return r.name===o.get$first$ax(this.from.names)},$signature:2},t.QueryRequestComparison_getSql_closure.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') like "+(e+r+"), ' ', '')")},$signature:3},t.QueryRequestComparison_getSql_closure0.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') not like "+(e+r+"), ' ', '')")},$signature:3},t.uniqueAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.Primitives_stringFromCharCode(97+t.int_parse(e))},$signature:15},t.QueryRequestCommonField.prototype={getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r,e,n,a,i,s,l,p){var c,M,b=s!=null;if(r!=null)switch(c="ORDER BY "+e+"_sort ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING",r.index){case 0:case 10:return"SUM("+e+") OVER ("+i+") "+e;case 2:case 12:return b?"SUM("+e+") OVER ("+i+") "+e:"COUNT("+e+") OVER ("+i+") "+e;case 3:return b?"SUM("+e+") OVER ("+i+") "+e:"COUNT(DISTINCT "+e+") OVER ("+i+") "+e;case 1:case 11:return"AVG("+e+") OVER ("+i+") "+e;case 7:case 13:return b?"'' "+e:"STRING_AGG("+e+") OVER ("+i+") "+e;case 4:return u.JSArray_methods.join$1(t._setArrayType(["FIRST_VALUE("+e+") OVER ("+i+" "+c+") "+e,"LAST_VALUE("+e+"_sort) OVER ("+i+" "+c+") "+e+"_sort"],d.JSArray_String),",");case 5:return M="LAST_VALUE("+e,u.JSArray_methods.join$1(t._setArrayType([M+") OVER ("+i+" "+c+") "+e,M+"_sort) OVER ("+i+" "+c+") "+e+"_sort"],d.JSArray_String),",");case 8:return"MIN("+e+") OVER ("+i+") "+e;case 9:return"MAX("+e+") OVER ("+i+") "+e;case 6:return b?"'' "+e:"ANY_VALUE(CAST("+e+" as STRING)) OVER ("+i+") "+e}else return b&&n>=s?"CAST(NULL as "+t.S(t.DataTypeExtension_get_sqlType(o.firstWhere$1$ax(l.getSchema$1(this.schemaName).fields,new t.QueryRequestCommonField_getAggregatedSql_closure(this)).type))+") "+e:a?"ANY_VALUE("+e+") OVER ("+i+") "+e:e}},t.QueryRequestCommonField_getAggregatedSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension.prototype={toJson$0(){var r,e,n=this,a=n.timeFormatter;return a=a==null?null:a._name,r=n.formatter,r=r==null?null:r._name,e=n.option,e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",n.schemaName._name,"name",n.name,"decimal",n.decimal,"timeFormatter",a,"formatter",r,"label",n.label,"option",e,"fillGap",n.fillGap,"hide",n.hide,"dataFormula",n.dataFormula,"displayFormula",n.displayFormula,"dateComparison",n.dateComparison],d.String,d.dynamic)},copyWith$1$hide(r){var e=this;return new t.QueryRequestDimension(e.option,e.label,e.decimal,e.timeFormatter,e.formatter,e.fillGap,e.dataFormula,e.displayFormula,!0,e.dateComparison,e.schemaName,e.name)},get$idV1(){var r=this.name,e=this.option;return e!=null&&(r=r+"_"+e._name),(this.schemaName._name+"_"+r).toLowerCase()},get$alias(){var r=this,e=r.name,n=r.option;return n!=null&&(e=e+"_"+n._name),n=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0),(r.schemaName._name+"_"+e+"_"+t.stringReplaceAllUnchecked(r.label,n,"")).toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){return o.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestDimension_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,this.option,r,e)},generateTimestampArraySql$2$timeFilters$timezone(r,e){var n,a,i,s,l,p,c;switch(this.option){case u.DIMENSION_OPTION_1:case u.DIMENSION_OPTION_6:n=u.Units_3;break;case u.DIMENSION_OPTION_2:case u.DIMENSION_OPTION_7:case u.DIMENSION_OPTION_8:case u.DIMENSION_OPTION_11:n=u.Units_4;break;case u.DIMENSION_OPTION_3:n=u.Units_5;break;case u.DIMENSION_OPTION_4:case u.DIMENSION_OPTION_9:n=u.Units_6;break;case u.DIMENSION_OPTION_10:n=u.Units_7;break;case u.DIMENSION_OPTION_0:case u.DIMENSION_OPTION_5:default:n=null;break}if(a=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$first(r).values,0)).toUtc$0(),i=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$first(r).values,1)).toUtc$0(),s=new t.QueryRequestDimension_generateTimestampArraySql_closure(r,a).call$0(),l=new t.QueryRequestDimension_generateTimestampArraySql_closure0(r,i).call$0(),s.isAfter$1(l)&&(l=l.add$1(0,t.Duration$(1,0,0,0,0,0))),n!=null)switch(p=t.DateTimeExtension_startOfUtc(s,n,s,e)._toString$1$iso8601(!0),c=t.DateTimeExtension_endOfUtc(l,n,l,e)._toString$1$iso8601(!0),n.index){case 3:case 4:return'UNNEST(GENERATE_TIMESTAMP_ARRAY(TIMESTAMP("'+p+'"),TIMESTAMP("'+c+'"),INTERVAL 1 '+n._name+"))";case 5:case 6:case 7:return'UNNEST(ARRAY(SELECT TIMESTAMP(date, "'+e+'") FROM UNNEST(GENERATE_DATE_ARRAY(DATE(TIMESTAMP "'+p+'", "'+e+'"),DATE(TIMESTAMP "'+c+'", "'+e+'"),INTERVAL 1 '+n._name+")) as date))";default:return"[]"}else return[]},getColumn$1(r){var e=this,n=e.schemaName,a=o.firstWhere$1$ax(r.getSchema$1(n).fields,new t.QueryRequestDimension_getColumn_closure(e)),i=t.uniqueAlias(e.get$alias()),s=a.type;return new t.QueryResponseColumn(n,e.label,s,u.FIELD_TYPE_0,i,null,e.option,e.decimal,e.timeFormatter,e.formatter,!1,e.hide,e.dateComparison===!0)},$eq(r,e){var n=this;return e==null?!1:e instanceof t.QueryRequestDimension&&n.option==e.option&&n.name===e.name&&n.schemaName===e.schemaName&&n.label===e.label},get$hashCode(r){var e=this;return u.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+o.get$hashCode$(e.option)+u.JSString_methods.get$hashCode(e.label)}},t.QueryRequestDimension_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension_generateTimestampArraySql_closure.prototype={call$0(){var r=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$last(this.timeFilters).values,0)).toUtc$0(),e=this.startTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:27},t.QueryRequestDimension_generateTimestampArraySql_closure0.prototype={call$0(){var r=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$last(this.timeFilters).values,1)).toUtc$0(),e=this.endTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:27},t.QueryRequestDimension_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric.prototype={toJson$0(){var r,e=this,n=e.timeFormatter;return n=n==null?null:n._name,r=e.formatter,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"label",e.label,"decimal",e.decimal,"aggregation",e.aggregation._name,"nullable",e.nullable,"hide",e.hide,"dataFormula",e.dataFormula,"displayFormula",e.displayFormula,"timeFormatter",n,"formatter",r],d.String,d.dynamic)},get$alias(){var r=this,e=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0);return(r.schemaName._name+"_"+r.name+"_"+r.aggregation._name+"_"+t.stringReplaceAllUnchecked(r.label,e,"")).toLowerCase()},getColumn$1(r){var e=this,n=e.schemaName,a=o.firstWhere$1$ax(r.getSchema$1(n).fields,new t.QueryRequestMetric_getColumn_closure(e)).type,i=e.aggregation;switch(i.index){case 2:case 3:case 0:a=u.DATA_TYPE_3;break}return new t.QueryResponseColumn(n,e.label,a,u.FIELD_TYPE_1,t.uniqueAlias(e.get$alias()),i,null,e.decimal,e.timeFormatter,e.formatter,e.nullable,e.hide,!1)},getPlainSql$2$schemaLibrary$timezone(r,e){return o.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestMetric_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(this.aggregation,null,r,e)},$eq(r,e){var n=this;return e==null?!1:e instanceof t.QueryRequestMetric&&n.aggregation===e.aggregation&&n.name===e.name&&n.schemaName===e.schemaName&&n.label===e.label},get$hashCode(r){var e=this;return u.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+t.Primitives_objectHashCode(e.aggregation)+u.JSString_methods.get$hashCode(e.label)}},t.QueryRequestMetric_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestFilter.prototype={toComparison$2$timezone(r,e){var n,a,i,s,l,p,c,M,b,O=this,D=O.schemaName,$=r.getSchema$1(D),E=O.operator;return E===u.COMPARISON_OPERATOR_6&&O.option===u.DIMENSION_OPTION_5&&(n=O.values,a=o.getInterceptor$asx(n),i=t.Jiffy$(a.$index(n,0)),s=t.Jiffy$(a.$index(n,1)),n=i.__Jiffy__dateTime_A,n===q&&t.throwUnnamedLateFieldNI(),n=n.get$hour(),a=i.__Jiffy__dateTime_A.get$minute(),l=s.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),l.get$hour()*60+s.__Jiffy__dateTime_A.get$minute()<n*60+a)?(D=$.name,E=O.name,n=d.JSArray_String,a=O.option,l=O.dataFormula,p=t._QueryRequestComparisonTargetVariable$(l,t._setArrayType([E],n),a,D),c=t.Jiffy$(i),M=c.__Jiffy__dateTime_A,M===q&&t.throwUnnamedLateFieldNI(),M=M.toUtc$0(),c.__Jiffy__dateTime_A=M,M=M.toIso8601String$0(),c=i.__Jiffy__dateTime_A,c=t.DateTimeExtension_endOfUtc(c,u.Units_4,c,e)._toString$1$iso8601(!0),c=t.QueryRequestComparison_QueryRequestComparison$single(p,u.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([E],n),[M,c],a,null)),l=t._QueryRequestComparisonTargetVariable$(l,t._setArrayType([E],n),a,D),M=s.__Jiffy__dateTime_A,M=t.DateTimeExtension_startOfUtc(M,u.Units_4,M,e)._toString$1$iso8601(!0),p=t.Jiffy$(s),b=p.__Jiffy__dateTime_A,b===q&&t.throwUnnamedLateFieldNI(),b=b.toUtc$0(),p.__Jiffy__dateTime_A=b,b=b.toIso8601String$0(),t.QueryRequestComparison_QueryRequestComparison$nested(u.COMPARISON_OPERATOR_10,t._setArrayType([c,t.QueryRequestComparison_QueryRequestComparison$single(l,u.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([E],n),[M,b],a,null))],d.JSArray_QueryRequestComparison))):(n=O.name,a=d.JSArray_String,l=O.option,t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(O.dataFormula,t._setArrayType([n],a),l,D),E,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([n],a),O.values,l,null)))},toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",r.schemaName._name,"name",r.name,"operator",r.operator._name,"option",e,"dataFormula",r.dataFormula,"isGlobalFilter",r.isGlobalFilter,"values",r.values],d.String,d.dynamic)}},t._GetSourceTableResponse.prototype={},t._PlainSqlColumn.prototype={},t.QueryRequest.prototype={get$populatedSorts(){var r,e,n,a,i=null,s=this.sorts;return s.length!==0?s:(s=this.dimensions,r=o.getInterceptor$asx(s),r.get$isNotEmpty(s)?(e=r.get$first(s),t._setArrayType([new t.QueryRequestSort(u.SORT_TYPE_0,i,i,i,e.schemaName,e.name)],d.JSArray_QueryRequestSort)):(s=this.metrics,r=o.getInterceptor$asx(s),n=d.JSArray_QueryRequestSort,r.get$isNotEmpty(s)?(a=r.get$first(s),t._setArrayType([new t.QueryRequestSort(u.SORT_TYPE_0,i,i,i,a.schemaName,a.name)],n)):t._setArrayType([],n)))},_getJoins$1(r){var e=this.joins,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Join>");return t.List_List$of(new t.MappedListIterable(e,new t.QueryRequest__getJoins_closure(this,r),n),!0,n._eval$1("ListIterable.E"))},toJson$0(){var r,e,n,a,i,s,l=this,p=d.Map_String_dynamic,c=o.map$1$1$ax(l.dimensions,new t.QueryRequest_toJson_closure,p).toList$0(0);return p=o.map$1$1$ax(l.metrics,new t.QueryRequest_toJson_closure0,p).toList$0(0),r=l.joins,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),r=l.timeDimension,r=r==null?null:r.toJson$0(),n=l.filters,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure2,a),!0,a._eval$1("ListIterable.E")),n=l.sorts,i=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure3,i),!0,i._eval$1("ListIterable.E")),n=l.blendConditions,n==null&&(n=t._setArrayType([],d.JSArray_JoinDatasourceCondition)),s=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",l.schemaName._name,"dimensions",c,"metrics",p,"joins",e,"timeDimension",r,"restaurantIds",l.restaurantIds,"warehouseIds",l.warehouseIds,"businessIds",l.businessIds,"filters",a,"sorts",i,"blendConditions",t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure4,s),!0,s._eval$1("ListIterable.E")),"limit",l.limit,"rollup",l.rollup,"rollupPosition",l.rollupPosition,"timezone",l.timezone],d.String,d.dynamic)},copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,n,a,i){var s=this,l=i??s.sorts,p=n??s.rollup,c=a??s.rollupPosition,M=r??s.blendConditions;return t.QueryRequest$(M,s.businessIds,e,s.filters,s.joins,s.limit,s.metrics,s.restaurantIds,p,c,s.schemaName,l,s.timeDimension,s.timezone,s.warehouseIds)},copyWith$2$dimensions$sorts(r,e){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,e)},copyWith$1$dimensions(r){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,null)},copyWith$3$blendConditions$dimensions$rollup(r,e,n){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,n,null,null)},copyWith$3$dimensions$rollup$rollupPosition(r,e,n){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,e,n,null)},getColumns$1(r){var e=d.QueryResponseColumn,n=t.List_List$of(o.map$1$1$ax(this.dimensions,new t.QueryRequest_getColumns_closure(r),e),!0,e);return u.JSArray_methods.addAll$1(n,o.map$1$1$ax(this.metrics,new t.QueryRequest_getColumns_closure0(r),e)),n},_getPlainSqlColumns$1(r){var e=this,n=d._PlainSqlColumn,a=t.List_List$of(o.map$1$1$ax(e.dimensions,new t.QueryRequest__getPlainSqlColumns_closure(e,r),n),!0,n),i=e.metrics,s=o.getInterceptor$ax(i);return u.JSArray_methods.addAll$1(a,s.map$1$1(i,new t.QueryRequest__getPlainSqlColumns_closure0(e,r),n)),n=e.sorts,u.JSArray_methods.addAll$1(a,new t.MappedListIterable(n,new t.QueryRequest__getPlainSqlColumns_closure1(e,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,_PlainSqlColumn>"))),u.JSArray_methods.addAll$1(a,s.fold$2(i,t._setArrayType([],d.JSArray__PlainSqlColumn),new t.QueryRequest__getPlainSqlColumns_closure2(e,r))),a},_getPlainSqlSorts$1(r){var e=this.get$populatedSorts(),n=new t.MappedListIterable(e,new t.QueryRequest__getPlainSqlSorts_closure(this,r),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>"));return n.get$length(n)===0?"":" order by "+n.join$1(0,",")},_getTimeFilters$1(r){var e,n,a,i,s,l,p,c,M,b,O,D=null,$=t._setArrayType([],d.JSArray_QueryRequestFilter),E=r.topLevelFilters.timeControl;return E!=null&&(e=this.timeDimension,n=e.timeStart,n!=null&&e.timeEnd!=null?(a=t.Jiffy$(n),i=e.timeEnd,s=t.Jiffy$(i),l=a.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),p=l.get$hour()*60+a.__Jiffy__dateTime_A.get$minute(),l=s.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),c=l.get$hour()*60+s.__Jiffy__dateTime_A.get$minute(),M=c-p,M<=0&&(M+=1440),b=p>720&&M>720,O=c<p?s.__Jiffy__dateTime_A.toLocal$0().get$hour()*60+s.__Jiffy__dateTime_A.toLocal$0().get$minute()+1:0,n.toString,i.toString,$.push(new t.QueryRequestFilter(u.COMPARISON_OPERATOR_6,u.DIMENSION_OPTION_5,D,D,[n,i],r.name,E))):(O=0,b=!1),n=t.Jiffy$(e.start),n=n.subtract$1$days(b?1:0).add$1$minutes(0,O),i=n.__Jiffy__dateTime_A,i===q&&t.throwUnnamedLateFieldNI(),i=i.toUtc$0(),n.__Jiffy__dateTime_A=i,i=i.toIso8601String$0(),e=t.Jiffy$(e.end),e=e.subtract$1$days(b?1:0).add$1$minutes(0,O),n=e.__Jiffy__dateTime_A,n===q&&t.throwUnnamedLateFieldNI(),n=n.toUtc$0(),e.__Jiffy__dateTime_A=n,$.push(new t.QueryRequestFilter(u.COMPARISON_OPERATOR_6,u.DIMENSION_OPTION_0,D,D,[i,n.toIso8601String$0()],r.name,E))),$},_getSqlFilters$1(r){var e,n,a,i,s=this,l=t._setArrayType([],d.JSArray_QueryRequestFilter),p=r.getSchema$1(s.schemaName);return s.timeDimension!=null&&(e=t.List_List$of(l,!0,d.QueryRequestFilter),u.JSArray_methods.addAll$1(e,s._getTimeFilters$1(p)),l=e),e=p.topLevelFilters.permissions,e.length!==0?(n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,QueryRequestFilter>"),a=n._eval$1("MappedListIterable<ListIterable.E,QueryRequestComparison>"),i=t.QueryRequestComparison_QueryRequestComparison$nested(u.COMPARISON_OPERATOR_10,t.List_List$of(new t.MappedListIterable(new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure(s),n),new t.QueryRequest__getSqlFilters_closure0(s,r),a),!0,a._eval$1("ListIterable.E"))).getSql$0()):i="id='_'",e=t._setArrayType([i],d.JSArray_String),u.JSArray_methods.addAll$1(e,new t.MappedListIterable(l,new t.QueryRequest__getSqlFilters_closure1(s,r),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),n=s.filters,u.JSArray_methods.addAll$1(e,new t.MappedListIterable(n,new t.QueryRequest__getSqlFilters_closure2(s,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),n=p.filters,u.JSArray_methods.addAll$1(e,new t.MappedListIterable(n,new t.QueryRequest__getSqlFilters_closure3(s,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),e.length!==0?" where "+new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure4,d.MappedListIterable_String_String).join$1(0," and "):""},_getSqlJoins$1(r){return u.JSArray_methods.fold$2(this._getJoins$1(r),"",new t.QueryRequest__getSqlJoins_closure(this,r))},_getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(r,e,n,a){var i,s,l,p,c,M,b,O,D=this,$=r!=null,E=D.dimensions,g=d.QueryRequestDimension,h=t.ListExtensions_whereIndexed(E,new t.QueryRequest__getRollupSelect_closure(r),g),R=h.get$isEmpty(h)?"":"PARTITION BY "+t.MappedIterable_MappedIterable(h,new t.QueryRequest__getRollupSelect_closure0,h.$ti._eval$1("Iterable.E"),d.String).join$1(0,","),L=d.String;return g=t.List_List$of(t.ListExtensions_mapIndexed(E,new t.QueryRequest__getRollupSelect_closure1(D,e,r,R),g,L),!0,L),i=D.metrics,s=d.JSArray_String,u.JSArray_methods.addAll$1(g,t.IterableExtension_foldIndexed(i,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure2(D,e,r,R))),l=D.sorts,p=t._arrayInstanceType(l),c=p._eval$1("MappedListIterable<1,String>"),u.JSArray_methods.addAll$1(g,new t.MappedListIterable(l,new t.QueryRequest__getRollupSelect_closure3(D,e,r,R),c)),g=u.JSArray_methods.join$1(g,","),M=o.getInterceptor$ax(E),b=t.List_List$of(M.map$1$1(E,new t.QueryRequest__getRollupSelect_closure4(a),L),!0,L),u.JSArray_methods.addAll$1(b,o.fold$2$ax(i,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure5(a,$))),u.JSArray_methods.addAll$1(b,new t.MappedListIterable(l,new t.QueryRequest__getRollupSelect_closure6,c)),b.push(""+$+" _is_rollup"),O="select "+u.JSArray_methods.join$1(b,",")+" from ("+("select "+g+" from "+n)+")",M.get$isNotEmpty(E)&&(E=t.List_List$of(M.map$1$1(E,new t.QueryRequest__getRollupSelect_closure7,L),!0,L),g=p._eval$1("MappedIterable<1,String>"),u.JSArray_methods.addAll$1(E,t.List_List$of(new t.MappedIterable(new t.WhereIterable(l,new t.QueryRequest__getRollupSelect_closure8,p._eval$1("WhereIterable<1>")),new t.QueryRequest__getRollupSelect_closure9,g),!0,g._eval$1("Iterable.E"))),O=O+" group by "+u.JSArray_methods.join$1(E,",")),O},get$_hasFillGap(){var r=o.where$1$ax(this.dimensions,new t.QueryRequest__hasFillGap_closure);return!r.get$isEmpty(r)},_getSqlSelectSorts$1(r){var e,n=this,a=n.rollup;return a==null&&(a=0),e=d.String,e=t.List_List$of(o.map$1$1$ax(o.sublist$2$ax(n.dimensions,0,a),new t.QueryRequest__getSqlSelectSorts_closure(n,r),e),!0,e),e.push("_is_rollup "+(n.rollupPosition==="BOTTOM"?"ASC":"DESC")),u.JSArray_methods.addAll$1(e,u.JSArray_methods.fold$2(n.sorts,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getSqlSelectSorts_closure0(r)))," ORDER BY "+u.JSArray_methods.join$1(e,",")},_getSortedLimitTable$2$schemaLibrary$sourceTableName(r,e){var n,a=this.limit,i=a!=null?" LIMIT "+t.S(a):"";return a=this.sorts,n=a.length!==0?" ORDER BY "+o.join$1$ax(u.JSArray_methods.fold$2(a,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getSortedLimitTable_closure(r)),","):"","SELECT * from "+e+n+i},getSqlSelect$1(r){var e,n,a,i,s,l,p,c,M=this,b="source_table",O=M.dimensions,D=o.getInterceptor$asx(O);if(D.get$isEmpty(O)&&o.get$isEmpty$asx(M.metrics))throw t.wrapException(t.Exception_Exception("column is empty"));for(e=M._getSourceTable$1$schemaLibrary(r),n="with source_table as ("+e.sql+")",n=M.get$_hasFillGap()?n+",fill_gap_table as ("+M._getFillGapTable$2$schemaLibrary$sourceTableName(r,b)+"),full_table as ("+M._getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName("fill_gap_table",r,b)+")":n+",full_table as (SELECT * FROM source_table)",n=n+",aggregated_table as ("+M._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(null,r,"full_table",!1)+"),sorted_limit_table as ("+M._getSortedLimitTable$2$schemaLibrary$sourceTableName(r,"aggregated_table")+")",a=M.rollup,a!=null&&D.get$isNotEmpty(O)&&a>=D.get$length(O)&&(a=D.get$length(O)-1),i=a!=null?a+1:0,i<0&&t.throwExpression(t.ArgumentError$("Length must be a non-negative integer: "+i)),s=t._setArrayType(new Array(i),d.JSArray_String),l=0;l<i;++l)s[l]=M._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(l,r,"sorted_limit_table",!0);return p=d.String,c=t.List_List$of(s,!0,p),O=t.List_List$of(D.map$1$1(O,new t.QueryRequest_getSqlSelect_closure,p),!0,p),u.JSArray_methods.addAll$1(O,o.map$1$1$ax(M.metrics,new t.QueryRequest_getSqlSelect_closure0,p)),p=M.sorts,u.JSArray_methods.addAll$1(O,new t.MappedListIterable(p,new t.QueryRequest_getSqlSelect_closure1,t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"))),O.push("_is_rollup"),c.push("SELECT "+u.JSArray_methods.join$1(O,",")+" FROM sorted_limit_table"),c.length!==0&&(n=n+" "+u.JSArray_methods.join$1(c," UNION ALL ")),O=M._getSqlSelectSorts$1(r),M._transformSqlAlias$2(t.stringReplaceAllUnchecked(n+O,"@TIMEZONE","'"+M.timezone+"'"),e.aliases)},_transformSqlAlias$2(r,e){return e.length===0?r:t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(new t.MappedListIterable(e,t.core_RegExp_escape$closure(),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>")).join$1(0,"|"),!1),new t.QueryRequest__transformSqlAlias_closure,null)},_getSourceTable$1$schemaLibrary(r){var e=this,n=r.getSchema$1(e.schemaName),a=e._getPlainSqlColumns$1(r),i=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"),s=new t.MappedListIterable(a,new t.QueryRequest__getSourceTable_closure,i).join$1(0,","),l=n.get$fullMaterializedTableName(),p=t.ReCase$(n.name._name)._getCamelCase$0(),c=e._getSqlJoins$1(r),M=e._getSqlFilters$1(r),b=e._getPlainSqlSorts$1(r),O=t._setArrayType([],d.JSArray_String);return new t._GetSourceTableResponse("SELECT "+new t.MappedListIterable(a,new t.QueryRequest__getSourceTable_closure0(O),i).join$1(0,",")+" FROM ("+("SELECT "+s+" FROM `"+l+"` AS "+p+c+M+b)+")",O)},_getFillGapTable$2$schemaLibrary$sourceTableName(r,e){var n,a,i,s,l,p,c,M,b,O,D,$=this,E=" CROSS JOIN ",g=d.JSArray_String,h=t._setArrayType([],g),R=$._getTimeFilters$1(r.getSchema$1($.schemaName));for(n=$.dimensions,a=o.getInterceptor$ax(n),i=a.get$iterator(n),s=$.timeDimension!=null,l=$.timezone;i.moveNext$0();)p=i.get$current(),c=p.getColumn$1(r),p.fillGap&&c.dataType===u.DATA_TYPE_1&&s&&(M=p.generateTimestampArraySql$2$timeFilters$timezone(R,l),c=p.option,c.toString,h.push("SELECT "+t.DimensionOptionExtension_formatSql(c,t.uniqueAlias(p.get$alias()),l)+" "+t.uniqueAlias(p.get$alias())+" FROM "+t.S(M)+" "+t.uniqueAlias(p.get$alias())+" GROUP BY "+t.uniqueAlias(p.get$alias())));return i=d.String,b=t.ListExtensions_mapIndexed(h,new t.QueryRequest__getFillGapTable_closure,i,i).join$1(0,E),i=t.List_List$of(a.map$1$1(n,new t.QueryRequest__getFillGapTable_closure0,i),!0,i),u.JSArray_methods.addAll$1(i,o.fold$2$ax($.metrics,t._setArrayType([],g),new t.QueryRequest__getFillGapTable_closure1($,r))),s=$.sorts,u.JSArray_methods.addAll$1(i,new t.MappedListIterable(s,new t.QueryRequest__getFillGapTable_closure2($,r),t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"))),O=t._setArrayType(["SELECT "+u.JSArray_methods.join$1(i,",")+" FROM ("+b+")"],g),D=a.where$1(n,new t.QueryRequest__getFillGapTable_closure3),D.get$isEmpty(D)||O.push("(SELECT DISTINCT "+new t.MappedIterable(D,new t.QueryRequest__getFillGapTable_closure4,D.$ti._eval$1("MappedIterable<1,String>")).join$1(0,",")+" FROM "+e+")"),u.JSArray_methods.join$1(O,E)},_getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName(r,e,n){var a,i="fill_gap_table",s=this.dimensions,l=d.String,p=o.getInterceptor$ax(s),c=t.List_List$of(p.map$1$1(s,new t.QueryRequest__getFullTable_closure(i,n),l),!0,l);return u.JSArray_methods.addAll$1(c,o.fold$2$ax(this.metrics,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getFullTable_closure0(n,i))),a=this.sorts,u.JSArray_methods.addAll$1(c,new t.MappedListIterable(a,new t.QueryRequest__getFullTable_closure1(n,i),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"))),"SELECT "+u.JSArray_methods.join$1(c,",")+" FROM fill_gap_table LEFT JOIN "+n+" ON "+p.map$1$1(s,new t.QueryRequest__getFullTable_closure2(i,n),l).join$1(0," AND ")}},t.QueryRequest_closure.prototype={call$2(r,e){var n=o.getInterceptor$ax(r),a=n.map$1$1(r,new t.QueryRequest__closure0,d.String).toSet$0(0);return u.JSArray_methods.contains$1(t.List_List$of(a,!0,t._instanceType(a)._precomputed1),t.uniqueAlias(e.get$alias()))||n.add$1(r,e),r},$signature:75},t.QueryRequest__closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_closure0.prototype={call$2(r,e){var n=o.getInterceptor$ax(r),a=n.map$1$1(r,new t.QueryRequest__closure,d.String).toSet$0(0);return u.JSArray_methods.contains$1(t.List_List$of(a,!0,t._instanceType(a)._precomputed1),t.uniqueAlias(e.get$alias()))||n.add$1(r,e),r},$signature:57},t.QueryRequest__closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:18},t.QueryRequest__getJoins_closure.prototype={call$1(r){return o.firstWhere$1$ax(this.schemaLibrary.getSchema$1(this.$this.schemaName).joins,new t.QueryRequest__getJoins__closure(r))},$signature:54},t.QueryRequest__getJoins__closure.prototype={call$1(r){return r.joinSchemaName===this.joinSchemaName},$signature:52},t.QueryRequest_fromJson_closure.prototype={call$1(r){return t.QueryRequestDimension_fromJson(r)},$signature:19},t.QueryRequest_fromJson_closure0.prototype={call$1(r){return t.QueryRequestMetric_fromJson(r)},$signature:28},t.QueryRequest_fromJson_closure1.prototype={call$1(r){return t.EnumByName_byName(u.List_r5g,r)},$signature:49},t.QueryRequest_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:16},t.QueryRequest_fromJson_closure3.prototype={call$1(r){return t.QueryRequestSort_fromJson(r)},$signature:48},t.QueryRequest_fromJson_closure4.prototype={call$1(r){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(r)},$signature:53},t.QueryRequest_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:47},t.QueryRequest_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:26},t.QueryRequest_toJson_closure1.prototype={call$1(r){return r._name},$signature:13},t.QueryRequest_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:17},t.QueryRequest_toJson_closure3.prototype={call$1(r){return r.toJson$0()},$signature:45},t.QueryRequest_toJson_closure4.prototype={call$1(r){return r.toJson$0()},$signature:44},t.QueryRequest_getColumns_closure.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:59},t.QueryRequest_getColumns_closure0.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:120},t.QueryRequest__getPlainSqlColumns_closure.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=t.uniqueAlias(r.get$alias()),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$alias(),a)},$signature:61},t.QueryRequest__getPlainSqlColumns_closure0.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=t.uniqueAlias(r.get$alias()),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$alias(),a)},$signature:62},t.QueryRequest__getPlainSqlColumns_closure1.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=r.get$id(r),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$id(r),a)},$signature:63},t.QueryRequest__getPlainSqlColumns_closure2.prototype={call$2(r,e){var n,a=e.aggregation;return u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),a)&&(a=this.schemaLibrary,n=t.IterableExtension_firstWhereOrNull(a.getSchema$1(e.schemaName).fields,new t.QueryRequest__getPlainSqlColumns__closure),n!=null&&o.add$1$ax(r,new t._PlainSqlColumn(n.getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,null,a,this.$this.timezone),t.uniqueAlias(e.get$alias())+"_sort",t.uniqueAlias(e.get$alias())+"_sort",null))),r},$signature:64},t.QueryRequest__getPlainSqlColumns__closure.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getPlainSqlSorts_closure.prototype={call$1(r){return r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone)+" "+r.type._name},$signature:9},t.QueryRequest__getSqlFilters_closure.prototype={call$1(r){var e=this.$this,n=r.field;return new t.QueryRequestFilter(u.COMPARISON_OPERATOR_0,null,null,null,new t.QueryRequest__getSqlFilters__closure(e,r).call$0(),e.schemaName,n)},$signature:66},t.QueryRequest__getSqlFilters__closure.prototype={call$0(){var r=this,e=d.JSArray_String,n=t._setArrayType([],e);switch(r.permission.type.index){case 0:n=r.$this.restaurantIds;break;case 1:n=r.$this.warehouseIds;break;case 2:n=r.$this.businessIds;break}return o.get$isEmpty$asx(n)?t._setArrayType(["_"],e):n},$signature:67},t.QueryRequest__getSqlFilters_closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone)},$signature:68},t.QueryRequest__getSqlFilters_closure1.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure2.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure3.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure4.prototype={call$1(r){return"("+r+")"},$signature:3},t.QueryRequest__getSqlJoins_closure.prototype={call$2(r,e){var n,a,i,s,l,p;return r!==""&&(r+=" "),n=this.schemaLibrary,a=n.getSchema$1(e.joinSchemaName),i=t._setArrayType([e.getConditionsSql$1(n)],d.JSArray_String),a.topLevelFilters.timeControl!=null&&(s=t.List_List$of(i,!0,d.String),l=this.$this,p=l._getTimeFilters$1(a),u.JSArray_methods.addAll$1(s,new t.MappedListIterable(p,new t.QueryRequest__getSqlJoins__closure(l,n),t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"))),i=s),s=t.List_List$of(i,!0,d.String),l=a.filters,u.JSArray_methods.addAll$1(s,new t.MappedListIterable(l,new t.QueryRequest__getSqlJoins__closure0(this.$this,n),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>")))," "+(r+"left join `"+a.get$fullMaterializedTableName()+"` as "+t.ReCase$(a.name._name)._getCamelCase$0()+" on "+u.JSArray_methods.join$1(s," and "))},$signature:70},t.QueryRequest__getSqlJoins__closure.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlJoins__closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getRollupSelect_closure.prototype={call$2(r,e){var n=this.rollupIndex;return!(n!=null&&r>=n)},$signature:119},t.QueryRequest__getRollupSelect_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure1.prototype={call$2(r,e){var n=this;return e.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(null,t.uniqueAlias(e.get$alias()),r,!1,n.partitions,n.rollupIndex,n.schemaLibrary,n.$this.sorts)},$signature:72},t.QueryRequest__getRollupSelect_closure2.prototype={call$3(r,e,n){var a=this,i=t.uniqueAlias(n.get$alias());return o.add$1$ax(e,n.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(n.aggregation,i,r,!1,a.partitions,a.rollupIndex,a.schemaLibrary,a.$this.sorts)),e},$signature:73},t.QueryRequest__getRollupSelect_closure3.prototype={call$1(r){var e=this,n=r.get$id(r);return r.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r.aggregation,n,9999,!0,e.partitions,e.rollupIndex,e.schemaLibrary,e.$this.sorts)},$signature:9},t.QueryRequest__getRollupSelect_closure4.prototype={call$1(r){var e;return this.useFormula?(e=r.displayFormula,e==null&&(e=t.uniqueAlias(r.get$alias()))):e=t.uniqueAlias(r.get$alias()),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure5.prototype={call$2(r,e){var n,a;return this.useFormula?(n=e.displayFormula,n==null&&(n=t.uniqueAlias(e.get$alias()))):n=t.uniqueAlias(e.get$alias()),a=o.getInterceptor$ax(r),a.add$1(r,"ANY_VALUE("+n+") "+t.uniqueAlias(e.get$alias())),n=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),n)&&!this.isRollup&&a.add$1(r,"ANY_VALUE("+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:20},t.QueryRequest__getRollupSelect_closure6.prototype={call$1(r){return r.aggregation!=null?"ANY_VALUE("+r.get$id(r)+") "+r.get$id(r):r.get$id(r)},$signature:9},t.QueryRequest__getRollupSelect_closure7.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure8.prototype={call$1(r){return r.aggregation==null},$signature:43},t.QueryRequest__getRollupSelect_closure9.prototype={call$1(r){return r.get$id(r)},$signature:9},t.QueryRequest__hasFillGap_closure.prototype={call$1(r){return r.fillGap},$signature:6},t.QueryRequest__getSqlSelectSorts_closure.prototype={call$1(r){var e=this.$this,n=t.IterableExtension_firstWhereOrNull(e.sorts,new t.QueryRequest__getSqlSelectSorts__closure(r)),a=r.schemaName,i=r.name,s=n==null?null:n.type;return s==null&&(s=u.SORT_TYPE_0),i=new t.QueryRequestSort(s,null,r.option,r.dataFormula,a,i).getSortSql$2$id$schemaLibrary(t.uniqueAlias(r.get$alias()),this.schemaLibrary),new t.MappedListIterable(i,new t.QueryRequest__getSqlSelectSorts__closure0(e),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0,",")},$signature:5},t.QueryRequest__getSqlSelectSorts__closure.prototype={call$1(r){var e=this.dimension;return r.schemaName===e.schemaName&&r.name===e.name&&r.dimensionOption==e.option},$signature:43},t.QueryRequest__getSqlSelectSorts__closure0.prototype={call$1(r){var e=this.$this.rollupPosition==="BOTTOM"?"LAST":"FIRST";return r+" NULLS "+e},$signature:3},t.QueryRequest__getSqlSelectSorts_closure0.prototype={call$2(r,e){var n=t.List_List$of(r,!0,d.String);return u.JSArray_methods.addAll$1(n,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),n},$signature:41},t.QueryRequest__getSortedLimitTable_closure.prototype={call$2(r,e){var n=t.List_List$of(r,!0,d.String);return u.JSArray_methods.addAll$1(n,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),n},$signature:41},t.QueryRequest_getSqlSelect_closure.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_getSqlSelect_closure0.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:18},t.QueryRequest_getSqlSelect_closure1.prototype={call$1(r){return r.get$id(r)},$signature:9},t.QueryRequest__transformSqlAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.uniqueAlias(e)},$signature:15},t.QueryRequest__getSourceTable_closure.prototype={call$1(r){return r.field+" "+r.id},$signature:39},t.QueryRequest__getSourceTable_closure0.prototype={call$1(r){var e,n;return this.aliases.push(r.alias),e=r.formula,n=r.id,e!=null?e+" "+n:n},$signature:39},t.QueryRequest__getFillGapTable_closure.prototype={call$2(r,e){return r>0?"("+e+")":e},$signature:79},t.QueryRequest__getFillGapTable_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFillGapTable_closure1.prototype={call$2(r,e){var n,a,i,s=this.schemaLibrary,l=t.IterableExtension_firstWhereOrNull(s.getSchema$1(this.$this.schemaName).fields,new t.QueryRequest__getFillGapTable__closure1(e));return l!=null&&(n=o.getInterceptor$ax(r),n.add$1(r,t.DataTypeExtension_get_defaultSql(l.type)+" "+t.uniqueAlias(e.get$alias())),a=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),a)&&(i=t.IterableExtension_firstWhereOrNull(s.getSchema$1(e.schemaName).fields,new t.QueryRequest__getFillGapTable__closure2),i!=null&&n.add$1(r,t.DataTypeExtension_get_defaultSql(i.type)+" "+t.uniqueAlias(e.get$alias())+"_sort"))),r},$signature:20},t.QueryRequest__getFillGapTable__closure1.prototype={call$1(r){return r.name===this.metric.name},$signature:2},t.QueryRequest__getFillGapTable__closure2.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getFillGapTable_closure2.prototype={call$1(r){var e,n=t.IterableExtension_firstWhereOrNull(this.$this.dimensions,new t.QueryRequest__getFillGapTable__closure(r)),a=t.IterableExtension_firstWhereOrNull(this.schemaLibrary.getSchema$1(r.schemaName).fields,new t.QueryRequest__getFillGapTable__closure0(r));return n!=null?e=t.uniqueAlias(n.get$alias()):e=t.S(a==null?null:t.DataTypeExtension_get_defaultSql(a.type)),e+" "+r.get$id(r)},$signature:9},t.QueryRequest__getFillGapTable__closure.prototype={call$1(r){var e=this.sort;return r.schemaName===e.schemaName&&r.name===e.name&&r.option==e.dimensionOption},$signature:6},t.QueryRequest__getFillGapTable__closure0.prototype={call$1(r){return r.name===this.sort.name},$signature:2},t.QueryRequest__getFillGapTable_closure3.prototype={call$1(r){return!r.fillGap},$signature:6},t.QueryRequest__getFillGapTable_closure4.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure.prototype={call$1(r){var e=this.fillGapTableName;return r.fillGap?e+"."+t.uniqueAlias(r.get$alias()):"IFNULL("+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())+","+e+"."+t.uniqueAlias(r.get$alias())+") "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure0.prototype={call$2(r,e){var n,a="IFNULL("+this.sourceTableName+".",i=this.fillGapTableName,s=o.getInterceptor$ax(r);return s.add$1(r,a+t.uniqueAlias(e.get$alias())+","+i+"."+t.uniqueAlias(e.get$alias())+") "+t.uniqueAlias(e.get$alias())),n=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),n)&&s.add$1(r,a+t.uniqueAlias(e.get$alias())+"_sort,"+i+"."+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:20},t.QueryRequest__getFullTable_closure1.prototype={call$1(r){return"IFNULL("+this.sourceTableName+"."+r.get$id(r)+","+this.fillGapTableName+"."+r.get$id(r)+") "+r.get$id(r)},$signature:9},t.QueryRequest__getFullTable_closure2.prototype={call$1(r){return this.fillGapTableName+"."+t.uniqueAlias(r.get$alias())+"="+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequestSort.prototype={toJson$0(){var r,e=this,n=e.aggregation;return n=n==null?null:n._name,r=e.dimensionOption,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"type",e.type._name,"aggregation",n,"dimensionOption",r,"dataFormula",e.dataFormula],d.String,d.dynamic)},get$id(r){var e=this,n=e.name.toLowerCase(),a=e.dimensionOption;return a!=null?n=n+"_"+a._name.toLowerCase():(a=e.aggregation,a!=null&&(n=n+"_"+a._name.toLowerCase())),e.schemaName._name.toLowerCase()+"_"+n+"_"+e.type._name.toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){var n=this;return o.firstWhere$1$ax(r.getSchema$1(n.schemaName).fields,new t.QueryRequestSort_getPlainSql_closure(n)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(n.aggregation,n.dimensionOption,r,e)},getSortSql$2$id$schemaLibrary(r,e){var n,a=this,i=e.getSchema$1(a.schemaName),s=o.firstWhere$1$ax(i.fields,new t.QueryRequestSort_getSortSql_closure(a)),l=t._setArrayType([],d.JSArray_String),p=r??a.get$id(a);return u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_2,u.AGGREGATION_TYPE_3],d.JSArray_AGGREGATION_TYPE),a.aggregation)||(n=s.type,n===u.DATA_TYPE_1?l.push("LENGTH("+p+") "+a.type._name):n===u.DATA_TYPE_0&&(n=i._materializeTablePrefix,l.push("`"+(n!==""?n+".":"")+"stringToSortableNumber`("+p+") "+a.type._name))),l.push(p+" "+a.type._name),l},getSortSql$1$schemaLibrary(r){return this.getSortSql$2$id$schemaLibrary(null,r)}},t.QueryRequestSort_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestSort_getSortSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestTimeDimension.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["start",r.start,"end",r.end,"timeStart",r.timeStart,"timeEnd",r.timeEnd],d.String,d.dynamic)}},t.FIELD_TYPE.prototype={_enumToString$0(){return"FIELD_TYPE."+this._name}},t.QueryResponseColumn.prototype={toJson$0(){var r,e,n,a=this,i=null,s=a.aggregationType;return s=s==null?i:s._name,r=a.optionType,r=r==null?i:r._name,e=a.timeFormatter,e=e==null?i:e._name,n=a.formatter,n=n==null?i:n._name,t.LinkedHashMap_LinkedHashMap$_literal(["id",a.id,"schema",a.schema._name,"label",a.label,"dataType",a.dataType._name,"fieldType",a.fieldType._name,"aggregationType",s,"optionType",r,"decimal",a.decimal,"timeFormatter",e,"formatter",n,"nullable",a.nullable,"hide",a.hide,"dateComparison",a.dateComparison],d.String,d.dynamic)}},t.DateTimeRange.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["start",this.start,"end",this.end],d.String,d.dynamic)}},t.QueryResponse.prototype={QueryResponse$map$4$columns$dateRange$rows$timeRange(r,e,n,a){var i,s,l,p,c=t.LinkedHashMap_LinkedHashMap$_empty(d.String,d.QueryResponseColumn);for(i=this.columns,s=i.length,l=0;l<i.length;i.length===s||(0,t.throwConcurrentModificationError)(i),++l)p=i[l],c.$indexSet(0,p.id,p);this.rows=o.map$1$1$ax(n,new t.QueryResponse$map_closure(c),d.QueryResponseRow).toList$0(0)},toJson$0(){var r,e=this,n=e.columns,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>");return a=t.List_List$of(new t.MappedListIterable(n,new t.QueryResponse_toJson_closure,a),!0,a._eval$1("ListIterable.E")),n=e.rows,r=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["columns",a,"rows",t.List_List$of(new t.MappedListIterable(n,new t.QueryResponse_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),"dateRange",e.dateRange.toJson$0(),"timeRange",e.timeRange.toJson$0()],d.String,d.dynamic)}},t.QueryResponse$map_closure.prototype={call$1(r){var e,n,a,i,s,l,p,c=r.$index(0,"_is_rollup");for(c==null&&(c=!1),e=t.LinkedHashMap_LinkedHashMap$_empty(d.String,d.dynamic),n=r.get$entries(r),n=n.get$iterator(n),a=this.columnMap;n.moveNext$0();)i=n.get$current(),s=i.key,l=i.value,!u.JSString_methods.endsWith$1(s,"_GROUP")&&(p=a.$index(0,s),e.$indexSet(0,s,p!=null&&p.fieldType===u.FIELD_TYPE_1?t.DataTypeExtension_toData(p.dataType,l,p.nullable):l));return new t.QueryResponseRow(c,e)},$signature:100},t.QueryResponse_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:81},t.QueryResponse_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:82},t.QueryResponseRow.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["isRollup",this.isRollup,"value",this.value],d.String,d.dynamic)}},t.VisualizationSchema.prototype={VisualizationSchema$5$fields$isJoinOnly$joins$label$name(r,e,n,a,i){u.JSArray_methods.sort$1(this.fields,new t.VisualizationSchema_closure)},toJson$0(){var r=this,e=r.fields,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),a=r.joins,i=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>");return t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name._name,"label",r.label,"fields",t.List_List$of(new t.MappedListIterable(e,new t.VisualizationSchema_toJson_closure,n),!0,n._eval$1("ListIterable.E")),"joins",t.List_List$of(new t.MappedListIterable(a,new t.VisualizationSchema_toJson_closure0,i),!0,i._eval$1("ListIterable.E")),"isJoinOnly",r.isJoinOnly],d.String,d.dynamic)}},t.VisualizationSchema_closure.prototype={call$2(r,e){return u.JSInt_methods.compareTo$1(r.type.index,e.type.index)},$signature:83},t.VisualizationSchema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:84},t.VisualizationSchema_toJson_closure0.prototype={call$1(r){return r._name},$signature:13},t.VisualizationField.prototype={get$filterDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_filterDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$fillGapDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_fillGapDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$isNumericAggregations(){var r=this.aggregations,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_isNumericAggregations_closure,e),!0,e._eval$1("Iterable.E"))},get$joinConditionOperators(){switch(this.type.index){case 2:case 0:case 3:return t._setArrayType([u.COMPARISON_OPERATOR_0],d.JSArray_COMPARISON_OPERATOR);case 1:return t._setArrayType([u.COMPARISON_OPERATOR_0,u.COMPARISON_OPERATOR_6],d.JSArray_COMPARISON_OPERATOR)}},toJson$0(){var r,e,n,a,i,s,l,p,c,M=this,b=M.type,O=M.filterOperators,D=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>");return D=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure,D),!0,D._eval$1("ListIterable.E")),O=M.dimensionOptions,r=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),O=M.aggregations,e=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),O=M.get$filterDimensionOptions(),n=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),n=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure2,n),!0,n._eval$1("ListIterable.E")),O=M.get$fillGapDimensionOptions(),a=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),a=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure3,a),!0,a._eval$1("ListIterable.E")),O=M.get$isNumericAggregations(),i=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure4,i),!0,i._eval$1("ListIterable.E")),O=d.JSArray_DATA_TYPE,s=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b),l=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b)||M.get$isNumericAggregations().length!==0?u.List_cWd:t._setArrayType([],d.JSArray_TIME_FORMATTER),p=t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"),p=t.List_List$of(new t.MappedListIterable(l,new t.VisualizationField_toJson_closure5,p),!0,p._eval$1("ListIterable.E")),O=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b)||M.get$isNumericAggregations().length!==0?u.List_IoM:t._setArrayType([],d.JSArray_FORMATTER_TYPE),l=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),l=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure6,l),!0,l._eval$1("ListIterable.E")),O=M.get$joinConditionOperators(),c=t.instanceType(O)._eval$1("MappedListIterable<1,String>"),t.LinkedHashMap_LinkedHashMap$_literal(["name",M.name,"type",b._name,"label",M.label,"schemaName",M.schemaName._name,"filterOperators",D,"dimensionOptions",r,"aggregations",e,"filterDimensionOptions",n,"fillGapDimensionOptions",a,"isNumericAggregations",i,"isNumericType",s,"timeFormatters",p,"formatters",l,"joinConditionOperators",t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure7,c),!0,c._eval$1("ListIterable.E"))],d.String,d.dynamic)},$eq(r,e){return e==null?!1:e instanceof t.VisualizationField&&this.name===e.name&&this.schemaName===e.schemaName},get$hashCode(r){return u.JSString_methods.get$hashCode(this.name)+t.Primitives_objectHashCode(this.schemaName)}},t.VisualizationField_filterDimensionOptions_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__filterDimensionOptions,r)},$signature:38},t.VisualizationField_fillGapDimensionOptions_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__fillGapDimensionOptions,r)},$signature:38},t.VisualizationField_isNumericAggregations_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__isNumericAggregations,r)},$signature:86},t.VisualizationField_toJson_closure.prototype={call$1(r){return r._name},$signature:24},t.VisualizationField_toJson_closure0.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure1.prototype={call$1(r){return r._name},$signature:36},t.VisualizationField_toJson_closure2.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure3.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure4.prototype={call$1(r){return r._name},$signature:36},t.VisualizationField_toJson_closure5.prototype={call$1(r){return r._name},$signature:90},t.VisualizationField_toJson_closure6.prototype={call$1(r){return r._name},$signature:91},t.VisualizationField_toJson_closure7.prototype={call$1(r){return r._name},$signature:24},t.addonFlattenItemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt",e,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Status","status",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Name","name",e,e,e,r),t.Field_Field$string(e,` IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), ' ', @categoryName)
|
|
89
|
+
`}else return E!=null?$+(" (at offset "+t.S(E)+")"):$}},t.Iterable.prototype={cast$1$0(r,e){return t.CastIterable_CastIterable(this,t._instanceType(this)._eval$1("Iterable.E"),e)},map$1$1(r,e,n){return t.MappedIterable_MappedIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"),n)},map$1(r,e){return this.map$1$1(r,e,d.dynamic)},where$1(r,e){return new t.WhereIterable(this,e,t._instanceType(this)._eval$1("WhereIterable<Iterable.E>"))},contains$1(r,e){var n;for(n=this.get$iterator(this);n.moveNext$0();)if(o.$eq$(n.get$current(),e))return!0;return!1},fold$1$2(r,e,n){var a,i;for(a=this.get$iterator(this),i=e;a.moveNext$0();)i=n.call$2(i,a.get$current());return i},fold$2(r,e,n){return this.fold$1$2(r,e,n,d.dynamic)},join$1(r,e){var n,a=this.get$iterator(this);if(!a.moveNext$0())return"";if(e===""){n="";do n+=t.S(o.toString$0$(a.get$current()));while(a.moveNext$0())}else for(n=""+t.S(o.toString$0$(a.get$current()));a.moveNext$0();)n=n+e+t.S(o.toString$0$(a.get$current()));return n.charCodeAt(0)==0,n},toList$1$growable(r,e){return t.List_List$of(this,e,t._instanceType(this)._eval$1("Iterable.E"))},toList$0(r){return this.toList$1$growable(r,!0)},toSet$0(r){var e=t.LinkedHashSet_LinkedHashSet(t._instanceType(this)._eval$1("Iterable.E"));return e.addAll$1(0,this),e},get$length(r){var e,n=this.get$iterator(this);for(e=0;n.moveNext$0();)++e;return e},get$isEmpty(r){return!this.get$iterator(this).moveNext$0()},get$isNotEmpty(r){return!this.get$isEmpty(this)},skip$1(r,e){return t.SkipIterable_SkipIterable(this,e,t._instanceType(this)._eval$1("Iterable.E"))},get$first(r){var e=this.get$iterator(this);if(!e.moveNext$0())throw t.wrapException(t.IterableElementError_noElement());return e.get$current()},firstWhere$1(r,e){var n,a;for(n=this.get$iterator(this);n.moveNext$0();)if(a=n.get$current(),e.call$1(a))return a;throw t.wrapException(t.IterableElementError_noElement())},elementAt$1(r,e){var n,a,i;for(t.RangeError_checkNotNegative(e,"index"),n=this.get$iterator(this),a=0;n.moveNext$0();){if(i=n.get$current(),e===a)return i;++a}throw t.wrapException(t.IndexError$withLength(e,a,this,null,"index"))},toString$0(r){return t.IterableBase_iterableToShortString(this,"(",")")}},t._GeneratorIterable.prototype={elementAt$1(r,e){var n=this.length;return(0>e||e>=n)&&t.throwExpression(t.IndexError$withLength(e,n,this,null,"index")),this._generator.call$1(e)},get$length(r){return this.length}},t.Iterator.prototype={},t.MapEntry.prototype={toString$0(r){return"MapEntry("+t.S(this.key)+": "+t.S(this.value)+")"}},t.Null.prototype={get$hashCode(r){return t.Object.prototype.get$hashCode.call(this,this)},toString$0(r){return"null"}},t.Object.prototype={$isObject:1,$eq(r,e){return this===e},get$hashCode(r){return t.Primitives_objectHashCode(this)},toString$0(r){return"Instance of '"+t.Primitives_objectTypeName(this)+"'"},noSuchMethod$1(r,e){throw t.wrapException(t.NoSuchMethodError$_(this,e.get$memberName(),e.get$positionalArguments(),e.get$namedArguments(),null))},toString(){return this.toString$0(this)}},t.Sink.prototype={},t.StringBuffer.prototype={get$length(r){return this._contents.length},toString$0(r){var e=this._contents;return e.charCodeAt(0)==0,e}},t.Endian.prototype={},t.Digest.prototype={$eq(r,e){var n,a,i,s,l;if(e==null)return!1;if(e instanceof t.Digest){if(n=this.bytes,a=e.bytes,i=n.length,i!==a.length)return!1;for(s=0,l=0;l<i;++l)s|=n[l]^a[l];return s===0}return!1},get$hashCode(r){return t.Object_hashAll(this.bytes)},toString$0(r){return t._hexEncode(this.bytes)}},t.DigestSink.prototype={},t.HashSink.prototype={close$0(r){var e,n,a=this;a._isClosed||(a._isClosed=!0,a._finalizeData$0(),a._iterate$0(),e=a._hash_sink$_sink,n=a._byteDigest$0(),e._value!=null&&t.throwExpression(t.StateError$("add may only be called once.")),e._value=new t.Digest(n))},_byteDigest$0(){var r,e,n,a,i;if(u.C_Endian===q.$get$Endian_host())return t.NativeUint8List_NativeUint8List$view(this.digest.buffer,0,null);for(r=this.digest,e=r.byteLength,n=new Uint8Array(e),a=t.NativeByteData_NativeByteData$view(n.buffer,0,null),i=0;i<5;++i)a.setUint32(i*4,r[i],!1);return n},_iterate$0(){var r,e,n,a=this._pendingData,i=t.NativeByteData_NativeByteData$view(a._buffer.buffer,0,null),s=this._currentChunk,l=u.JSInt_methods.$tdiv(a._typed_buffer$_length,s.byteLength);for(r=s.length,e=0;e<l;++e){for(n=0;n<r;++n)s[n]=i.getUint32(e*s.byteLength+n*4,!1);this.updateHash$1(s)}s=l*s.byteLength,t.RangeError_checkValidRange(0,s,a.get$length(a)),s>0&&a._closeGap$2(a,0,s)},_finalizeData$0(){var r,e,n,a,i,s,l=this,p=l._pendingData;for(p._add$1(128),r=l._lengthInBytes+1+8,e=l._currentChunk.byteLength,e=((r+e-1&-e)>>>0)-r,n=0;n<e;++n)p._add$1(0);if(e=l._lengthInBytes,e>0x3ffffffffffff)throw t.wrapException(t.UnsupportedError$("Hashing is unsupported for messages with more than 2^53 bits."));a=e*8,i=p._typed_buffer$_length,p.addAll$1(0,new Uint8Array(8)),s=t.NativeByteData_NativeByteData$view(p._buffer.buffer,0,null),s.setUint32(i,u.JSInt_methods._tdivFast$1(a,4294967296),!1),s.setUint32(i+4,a>>>0,!1)}},t._Sha1Sink.prototype={updateHash$1(r){var e,n,a,i,s,l=this.digest,p=l[0],c=l[1],M=l[2],b=l[3],O=l[4];for(e=this._extended,n=0;n<80;++n,O=b,b=M,M=s,c=p,p=i)n<16?e[n]=r[n]:(a=e[n-3]^e[n-8]^e[n-14]^e[n-16],e[n]=(a<<1|a>>>31)>>>0),i=(((p<<5|p>>>27)>>>0)+O>>>0)+e[n]>>>0,n<20?i=(i+((c&M|~c&b)>>>0)>>>0)+1518500249>>>0:n<40?i=(i+((c^M^b)>>>0)>>>0)+1859775393>>>0:i=n<60?(i+((c&M|c&b|M&b)>>>0)>>>0)+2400959708>>>0:(i+((c^M^b)>>>0)>>>0)+3395469782>>>0,s=(c<<30|c>>>2)>>>0;l[0]=p+l[0]>>>0,l[1]=c+l[1]>>>0,l[2]=M+l[2]>>>0,l[3]=b+l[3]>>>0,l[4]=O+l[4]>>>0}},t.DateSymbols.prototype={toString$0(r){return this.NAME}},t.DateBuilder.prototype={setYear$1(r){this.year=r},setMonth$1(r){this.month=r},setDay$1(r){this.day=r},setDayOfYear$1(r){this.dayOfYear=r},setHour$1(r){this.hour=r},setMinute$1(r){this.minute=r},setSecond$1(r){this.second=r},setFractionalSecond$1(r){this.fractionalSecond=r},_offsetYear$2(r,e){return this._dateTimeConstructor.call$8(r.get$year()+e,r.get$month(),r.get$day(),r.get$hour(),r.get$minute(),r.get$second(),r.get$millisecond(),r.get$isUtc())},asDate$1$retries(r){var e,n,a,i,s,l,p,c,M,b,O,D=this,$=D._date;return $!=null||(D._hasAmbiguousCentury?($=D.year,e=$<0||$>=100):e=!0,e?($=D.year,n=D.month,a=D.dayOfYear,a===0&&(a=D.day),i=D.pm,s=D.hour,i=i?s+12:s,l=D._dateTimeConstructor.call$8($,n,a,i,D.minute,D.second,D.fractionalSecond,D.utc)):(q.$get$_clockKey(),p=t.systemTime(),D.utc&&(p=p.toUtc$0()),c=D._offsetYear$2(p,-80),M=D._offsetYear$2(p,20),$=u.JSInt_methods._tdivFast$1(c.get$year(),100),n=u.JSInt_methods._tdivFast$1(M.get$year(),100),a=D.year,i=D.month,s=D.dayOfYear,s===0&&(s=D.day),b=D.pm,O=D.hour,b=b?O+12:O,O=D._dateTimeConstructor,l=O.call$8(n*100+a,i,s,b,D.minute,D.second,D.fractionalSecond,D.utc),l.compareTo$1(0,M)<=0||(n=D.year,a=D.month,i=D.dayOfYear,i===0&&(i=D.day),s=D.pm,b=D.hour,s=s?b+12:b,l=O.call$8($*100+n,a,i,s,D.minute,D.second,D.fractionalSecond,D.utc))),D.utc&&e?(D._date=l,$=l):$=D._date=D._correctForErrors$2(l,r)),$},asDate$0(){return this.asDate$1$retries(3)},_correctForErrors$2(r,e){var n,a,i,s,l,p,c,M,b=this;return e<=0?r:(n=r.get$year(),n=t.Primitives_valueFromDecomposedDate(n,2,29,0,0,0,0,!1),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),a=t.Primitives_getMonth(new t.DateTime(n,!1))===2,i=t.dayOfYear(r.get$month(),r.get$day(),a),b.utc?n=!1:r.get$isUtc()?(n=r.get$hour(),s=b.pm,l=b.hour,n===(s?l+12:l)&&r.get$day(),n=!0):n=!1,n?(++b._retried,b.asDate$1$retries(e-1)):b.dateOnly&&r.get$hour()!==0?(p=b.asDate$1$retries(e-1),p.$eq(0,r)?(c=b.dayOfYear,c===0&&(c=t.dayOfYear(b.month,b.day,a)),M=r.add$1(0,t.Duration$(0,(c-i)*24-r.get$hour(),0,0,0,0)),M.get$hour()===0?M:t.dayOfYear(M.get$month(),M.get$day(),a)!==c?r:M):p):r)}},t.DateFormat.prototype={_parse$3$strict$utc(r,e,n){var a,i,s,l=this,p=new t.DateBuilder(l._locale,l.dateTimeConstructor),c=l._dateOnly;for(p.dateOnly=c??(l._dateOnly=l.get$_checkDateOnly()),a=new t.StringStack(r),c=l.get$_formatFields(),i=c.length,s=0;s<c.length;c.length===i||(0,t.throwConcurrentModificationError)(c),++s)c[s].parse$2(a,p);return p.asDate$0()},get$_checkDateOnly(){return u.JSArray_methods.every$1(this.get$_formatFields(),new t.DateFormat__checkDateOnly_closure)},get$_formatFields(){var r,e=this,n=e._formatFieldsPrivate;return n==null&&(e._date_format$_pattern==null&&(e.addPattern$1("yMMMMd"),e.addPattern$1("jms")),n=e._date_format$_pattern,n.toString,n=e._parsePatternHelper$1(n),r=t._arrayInstanceType(n)._eval$1("ReversedListIterable<1>"),r=e._formatFieldsPrivate=t.List_List$of(new t.ReversedListIterable(n,r),!0,r._eval$1("ListIterable.E")),n=r),n},_appendPattern$2(r,e){var n=this._date_format$_pattern;this._date_format$_pattern=n==null?r:n+e+r},addPattern$1(r){var e,n,a=this;return a._formatFieldsPrivate=null,e=q.$get$dateTimePatterns(),n=a._locale,e.toString,(t.canonicalizedLocale(n)==="en_US"?e.fallbackData:e._throwException$0()).containsKey$1(r)?(e=q.$get$dateTimePatterns(),e.toString,a._appendPattern$2((t.canonicalizedLocale(n)==="en_US"?e.fallbackData:e._throwException$0()).$index(0,r)," ")):a._appendPattern$2(r," "),a},get$dateSymbols(){var r,e=this._locale;return e!==q.lastDateSymbolLocale&&(q.lastDateSymbolLocale=e,r=q.$get$_dateTimeSymbols(),r.toString,q.cachedDateSymbols=t.canonicalizedLocale(e)==="en_US"?r.fallbackData:r._throwException$0()),e=q.cachedDateSymbols,e.toString,e},get$useNativeDigits(){var r=this._useNativeDigits;return r==null&&(q.DateFormat__useNativeDigitsByDefault.$index(0,this._locale),r=this._useNativeDigits=!0),r},get$digitMatcher(){var r=this,e=r._digitMatcher;return e!=null||(e=q.DateFormat__digitMatchers.putIfAbsent$2(r.get$localeZero(),r.get$_initDigitMatcher()),r._digitMatcher=e,e.toString),e},get$localeZeroCodeUnit(){var r=this._localeZeroCodeUnit;return r??(this._localeZeroCodeUnit=u.JSString_methods._codeUnitAt$1(this.get$localeZero(),0))},get$localeZero(){var r=this,e=r._localeZero;return e==null&&(r.get$useNativeDigits(),r.get$dateSymbols(),e=r._localeZero="0"),e},_initDigitMatcher$0(){var r,e;return this.get$useNativeDigits(),r=this._localeZeroCodeUnit,e=q.$get$asciiZeroCodeUnit(),r==e?q.$get$asciiDigitMatcher():(r=d.int,t.RegExp_RegExp("^["+t.String_String$fromCharCodes(t.Iterable_Iterable$generate(10,new t.DateFormat__initDigitMatcher_closure,r).map$1$1(0,new t.DateFormat__initDigitMatcher_closure0(this),r).toList$0(0),0,null)+"]+",!1))},_parsePatternHelper$1(r){var e,n;return r.length===0?t._setArrayType([],d.JSArray__DateFormatField):(e=this._date_format$_match$1(r),e==null?t._setArrayType([],d.JSArray__DateFormatField):(n=this._parsePatternHelper$1(u.JSString_methods.substring$1(r,e.fullPattern$0().length)),n.push(e),n))},_date_format$_match$1(r){var e,n,a,i;for(e=0;n=q.$get$DateFormat__matchers(),e<3;++e)if(a=n[e].firstMatch$1(r),a!=null)return n=t.DateFormat__fieldConstructors()[e],i=a._match[0],i.toString,n.call$2(i,this);return null}},t.DateFormat_dateTimeConstructor_closure.prototype={call$8(r,e,n,a,i,s,l,p){var c;return p?(c=t.Primitives_valueFromDecomposedDate(r,e,n,a,i,s,l,!0),t._isInt(c)||t.throwExpression(t.argumentErrorValue(c)),new t.DateTime(c,!0)):(c=t.Primitives_valueFromDecomposedDate(r,e,n,a,i,s,l,!1),t._isInt(c)||t.throwExpression(t.argumentErrorValue(c)),new t.DateTime(c,!1))},"call*":"call$8",$requiredArgCount:8,$signature:56},t.DateFormat__checkDateOnly_closure.prototype={call$1(r){return r.get$forDate()},$signature:51},t.DateFormat__initDigitMatcher_closure.prototype={call$1(r){return r},$signature:46},t.DateFormat__initDigitMatcher_closure0.prototype={call$1(r){return this.$this.get$localeZeroCodeUnit()+r},$signature:46},t.DateFormat__fieldConstructors_closure.prototype={call$2(r,e){var n=t._DateFormatQuotedField__patchQuotes(r);return u.JSString_methods.trim$0(n),new t._DateFormatQuotedField(r,n,e)},$signature:65},t.DateFormat__fieldConstructors_closure0.prototype={call$2(r,e){return u.JSString_methods.trim$0(r),new t._DateFormatPatternField(r,e)},$signature:69},t.DateFormat__fieldConstructors_closure1.prototype={call$2(r,e){return u.JSString_methods.trim$0(r),new t._DateFormatLiteralField(r,e)},$signature:74},t._DateFormatField.prototype={get$forDate(){return!0},fullPattern$0(){return this.pattern},toString$0(r){return this.pattern},parseLiteral$1(r){var e=this.pattern,n=e.length,a=r.peek$1(n);r._string_stack$_index+=n,a!==e&&this.throwFormatException$1(r)},throwFormatException$1(r){throw t.wrapException(t.FormatException$("Trying to read "+this.toString$0(0)+" from "+r.toString$0(0),null,null))}},t._DateFormatLiteralField.prototype={parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatQuotedField.prototype={fullPattern$0(){return this._fullPattern},parse$2(r,e){this.parseLiteral$1(r)}},t._DateFormatPatternField.prototype={parse$2(r,e){this.parseField$2(r,e)},get$forDate(){var r=this._forDate;return r==null&&(r=this.pattern[0],r=this._forDate=t.stringContainsUnchecked("cdDEGLMQvyZz",r,0)),r},parseField$2(r,e){var n,a,i=this;try{switch(n=i.pattern,n[0]){case"a":i.parseEnumeratedString$2(r,i.parent.get$dateSymbols().AMPMS)===1&&(e.pm=!0);break;case"c":i.parseStandaloneDay$1(r);break;case"d":i.handleNumericField$2(r,e.get$setDay());break;case"D":i.handleNumericField$2(r,e.get$setDayOfYear());break;case"E":a=i.parent,i.parseEnumeratedString$2(r,n.length>=4?a.get$dateSymbols().WEEKDAYS:a.get$dateSymbols().SHORTWEEKDAYS);break;case"G":a=i.parent,i.parseEnumeratedString$2(r,n.length>=4?a.get$dateSymbols().ERANAMES:a.get$dateSymbols().ERAS);break;case"h":i.handleNumericField$2(r,e.get$setHour()),e.hour===12&&(e.hour=0);break;case"H":i.handleNumericField$2(r,e.get$setHour());break;case"K":i.handleNumericField$2(r,e.get$setHour());break;case"k":i.handleNumericField$3(r,e.get$setHour(),-1);break;case"L":i.parseStandaloneMonth$2(r,e);break;case"M":i.parseMonth$2(r,e);break;case"m":i.handleNumericField$2(r,e.get$setMinute());break;case"Q":break;case"S":i.handleNumericField$2(r,e.get$setFractionalSecond());break;case"s":i.handleNumericField$2(r,e.get$setSecond());break;case"v":break;case"y":i.handleNumericField$2(r,e.get$setYear()),e._hasAmbiguousCentury=n.length===2;break;case"z":break;case"Z":break;default:return}}catch{i.throwFormatException$1(r)}},handleNumericField$3(r,e,n){var a=this.parent;e.call$1(this._nextInteger$3(r,a.get$digitMatcher(),a.get$localeZeroCodeUnit())+n)},handleNumericField$2(r,e){return this.handleNumericField$3(r,e,0)},_nextInteger$3(r,e,n){var a,i,s,l,p=e.stringMatch$1(r.peek$1(r.contents.length-r._string_stack$_index));if(p==null||p.length===0)return this.throwFormatException$1(r);if(a=p.length,r._string_stack$_index+=a,i=q.$get$asciiZeroCodeUnit(),n!==i){for(a>4294967295&&t.throwExpression(t.RangeError$range(a,0,4294967295,"length",null)),s=o.JSArray_JSArray$markFixed(new Array(a),d.int),l=0;l<a;++l)s[l]=u.JSString_methods._codeUnitAt$1(p,l)-n+i;p=t.String_String$fromCharCodes(s,0,null)}return t.int_parse(p)},parseEnumeratedString$2(r,e){var n,a,i,s,l,p,c,M,b=t._setArrayType([],d.JSArray_int);for(n=e.length,a=r.contents,i=a.length,s=0;s<n;++s)l=e[s],p=r._string_stack$_index,u.JSString_methods.substring$2(a,p,Math.min(p+l.length,i))===l&&b.push(s);for(b.length===0&&this.throwFormatException$1(r),c=u.JSArray_methods.get$first(b),b=t.SubListIterable$(b,1,null,d.int),b=new t.ListIterator(b,b.get$length(b)),n=t._instanceType(b)._precomputed1;b.moveNext$0();)a=b.__internal$_current,M=a??n._as(a),e[M].length>=e[c].length&&(c=M);return r._string_stack$_index+=e[c].length,c},parseMonth$2(r,e){var n,a=this;switch(a.pattern.length){case 5:n=a.parent.get$dateSymbols().NARROWMONTHS;break;case 4:n=a.parent.get$dateSymbols().MONTHS;break;case 3:n=a.parent.get$dateSymbols().SHORTMONTHS;break;default:return a.handleNumericField$2(r,e.get$setMonth())}e.month=a.parseEnumeratedString$2(r,n)+1},parseStandaloneDay$1(r){var e,n=this;switch(n.pattern.length){case 5:e=n.parent.get$dateSymbols().STANDALONENARROWWEEKDAYS;break;case 4:e=n.parent.get$dateSymbols().STANDALONEWEEKDAYS;break;case 3:e=n.parent.get$dateSymbols().STANDALONESHORTWEEKDAYS;break;default:return n.handleNumericField$2(r,new t._DateFormatPatternField_parseStandaloneDay_closure)}n.parseEnumeratedString$2(r,e)},parseStandaloneMonth$2(r,e){var n,a=this;switch(a.pattern.length){case 5:n=a.parent.get$dateSymbols().STANDALONENARROWMONTHS;break;case 4:n=a.parent.get$dateSymbols().STANDALONEMONTHS;break;case 3:n=a.parent.get$dateSymbols().STANDALONESHORTMONTHS;break;default:return a.handleNumericField$2(r,e.get$setMonth())}e.month=a.parseEnumeratedString$2(r,n)+1}},t._DateFormatPatternField_parseStandaloneDay_closure.prototype={call$1(r){return r},$signature:7},t.StringStack.prototype={peek$1(r){var e=this.contents,n=this._string_stack$_index;return u.JSString_methods.substring$2(e,n,Math.min(n+r,e.length))},toString$0(r){return this.contents+" at "+this._string_stack$_index}},t.UninitializedLocaleData.prototype={$index(r,e){return t.canonicalizedLocale(e)==="en_US"?this.fallbackData:this._throwException$0()},_throwException$0(){throw t.wrapException(new t.LocaleDataException("Locale data has not been initialized, call "+this.message+"."))}},t.LocaleDataException.prototype={toString$0(r){return"LocaleDataException: "+this.message}},t.StartOfWeek.prototype={_enumToString$0(){return"StartOfWeek."+this._name}},t.Units.prototype={_enumToString$0(){return"Units."+this._name}},t.Jiffy.prototype={get$dateTime(){var r=this.__Jiffy__dateTime_A;return r===q&&t.throwUnnamedLateFieldNI(),r},_parseMap$1(r){var e,n,a,i,s,l,p;return r.forEach$1(0,new t.Jiffy__parseMap_closure),r.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=r.$index(0,"year"),e==null&&(e=r.$index(0,"years")),e==null&&(e=r.$index(0,"y")),e==null&&(e=t.Primitives_getYear(new t.DateTime(Date.now(),!1))),n=r.$index(0,"month"),n==null&&(n=r.$index(0,"months")),n==null&&(n=r.$index(0,"M")),n==null&&(n=t.Primitives_getMonth(new t.DateTime(Date.now(),!1))),a=r.$index(0,"day"),a==null&&(a=r.$index(0,"days")),a==null&&(a=r.$index(0,"d")),a==null&&(a=t.Primitives_getDay(new t.DateTime(Date.now(),!1))),i=r.$index(0,"hour"),i==null&&(i=r.$index(0,"hours")),i==null&&(i=r.$index(0,"h")),i==null&&(i=t.Primitives_getHours(new t.DateTime(Date.now(),!1))),s=r.$index(0,"minute"),s==null&&(s=r.$index(0,"minutes")),s==null&&(s=r.$index(0,"m")),s==null&&(s=t.Primitives_getMinutes(new t.DateTime(Date.now(),!1))),l=r.$index(0,"second"),l==null&&(l=r.$index(0,"seconds")),l==null&&(l=r.$index(0,"s")),l==null&&(l=t.Primitives_getSeconds(new t.DateTime(Date.now(),!1))),p=r.$index(0,"millisecond"),p==null&&(p=r.$index(0,"milliseconds")),p==null&&(p=r.$index(0,"ms")),p==null&&(p=t.Primitives_getMilliseconds(new t.DateTime(Date.now(),!1))),e=t.Primitives_valueFromDecomposedDate(e,n,a,i,s,l,p,!1),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!1))},_parseList$1(r){var e,n,a,i,s,l,p=o.getInterceptor$asx(r);return p.get$isEmpty(r)?new t.DateTime(Date.now(),!1):(e=p.$index(r,0),n=p.get$length(r)>1?p.$index(r,1):1,a=p.get$length(r)>2?p.$index(r,2):1,i=p.get$length(r)>3?p.$index(r,3):0,s=p.get$length(r)>4?p.$index(r,4):0,l=p.get$length(r)>5?p.$index(r,5):0,p=p.get$length(r)>6?p.$index(r,6):0,p=t.Primitives_valueFromDecomposedDate(e,n,a,i,s,l,p,!1),t._isInt(p)||t.throwExpression(t.argumentErrorValue(p)),new t.DateTime(p,!1))},_parseString$2(r,e){var n="yyyy/MM/dd",a="(\\d{4})(\\d{1,2})(\\d{1,2})$",i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}$",!1);if(i._nativeRegExp.test(r))return t.DateFormat$("yyyy-MM-dd")._parse$3$strict$utc(r,!1,!1);if(i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2} \\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),i._nativeRegExp.test(r)?i=!0:(i=t.RegExp_RegExp("\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}(:\\d{1,2})?(:\\d{1,2})?(.\\d+)?(Z?)",!1),i=i._nativeRegExp.test(r)),i)return t.DateTime_parse(r).toLocal$0();if(i=t.RegExp_RegExp("\\d{4}\\/\\d{1,2}\\/\\d{1,2}$",!1),i._nativeRegExp.test(r))return t.DateFormat$(n)._parse$3$strict$utc(r,!1,!1);if(i=t.RegExp_RegExp(a,!1),i._nativeRegExp.test(r))return t.DateFormat$(n)._parse$3$strict$utc(t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(a,!1),new t.Jiffy__parseString_closure,null),!1,!1);throw t.wrapException(t.JiffyException$('Date time not recognized, a pattern must be passed, e.g. Jiffy("12, Oct", "dd, MMM")').get$cause())},add$1$minutes(r,e){var n=this,a=n.__Jiffy__dateTime_A;return a===q&&t.throwUnnamedLateFieldNI(),a=a.add$1(0,u.Duration_0),n.__Jiffy__dateTime_A=a,a=a.add$1(0,t.Duration$(0,0,0,0,e,0)),n.__Jiffy__dateTime_A=a,a=n._addMonths$2(a,0),n.__Jiffy__dateTime_A=a,n.__Jiffy__dateTime_A=n._addMonths$2(a,0),t.Jiffy$(n)},subtract$1$days(r){var e=this,n=e.__Jiffy__dateTime_A;return n===q&&t.throwUnnamedLateFieldNI(),n=n.subtract$1(u.Duration_0),e.__Jiffy__dateTime_A=n,n=n.subtract$1(t.Duration$(r,0,0,0,0,0)),e.__Jiffy__dateTime_A=n,n=e._addMonths$2(n,-0),e.__Jiffy__dateTime_A=n,e.__Jiffy__dateTime_A=e._addMonths$2(n,-0),t.Jiffy$(e)},_addMonths$2(r,e){var n,a,i,s,l,p,c,M=u.JSInt_methods.$mod(e,12),b=u.JSInt_methods._tdivFast$1(e-M,12),O=r.get$year()+b,D=r.get$month()+M;return D>12&&(++O,D-=12),n=r.get$day(),a=u.List_mC8[D],D===2&&u.JSInt_methods.$mod(O,4)===0?i=u.JSInt_methods.$mod(O,100)!==0||u.JSInt_methods.$mod(O,400)===0:i=!1,i&&++a,s=Math.min(n,a),r.get$isUtc()?(n=r.get$hour(),i=r.get$minute(),l=r.get$second(),p=r.get$millisecond(),c=r.get$microsecond(),n=t.Primitives_valueFromDecomposedDate(O,D,s,n,i,l,p+u.JSNumber_methods.round$0(c/1e3),!0),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),new t.DateTime(n,!0)):(n=r.get$hour(),i=r.get$minute(),l=r.get$second(),p=r.get$millisecond(),c=r.get$microsecond(),n=t.Primitives_valueFromDecomposedDate(O,D,s,n,i,l,p+u.JSNumber_methods.round$0(c/1e3),!1),t._isInt(n)||t.throwExpression(t.argumentErrorValue(n)),new t.DateTime(n,!1))}},t.Jiffy__parseMap_closure.prototype={call$2(r,e){(r==="M"?r:t.normalizeUnits(r))==="0"&&t.throwExpression(t.JiffyException$('Invalid unit passed, the following units are available "year", "month", "week", "day", "hour", "minute", "second", "millisecond"').get$cause())},$signature:33},t.Jiffy__parseString_closure.prototype={call$1(r){return t.S(r.group$1(0,1))+"/"+t.S(r.group$1(0,2))+"/"+t.S(r.group$1(0,3))},$signature:15},t.ArLyLocale.prototype={},t.ArSaMaDzKwTnLocale.prototype={},t.AzLocale.prototype={},t.BnLocale.prototype={},t.DeLocale.prototype={},t.EnLocale.prototype={},t.EsLocale.prototype={},t.FaLocale.prototype={},t.FrLocale.prototype={},t.HiLocale.prototype={},t.IdLocale.prototype={},t.ItLocale.prototype={},t.JaLocale.prototype={},t.KoLocale.prototype={},t.Locale.prototype={},t.NbLocale.prototype={},t.NlLocale.prototype={},t.PlLocale.prototype={},t.PtLocale.prototype={},t.RuLocale.prototype={},t.SvLocale.prototype={},t.ThLocale.prototype={},t.TrLocale.prototype={},t.UkLocale.prototype={},t.ZhCnLocale.prototype={},t.ZhLocale.prototype={},t.JiffyException.prototype={get$cause(){return"JiffyException: "+this._cause}},t.BufferModule.prototype={},t.BufferConstants.prototype={},t.Buffer.prototype={},t.ConsoleModule.prototype={},t.Console.prototype={},t.EventEmitter.prototype={},t.Promise.prototype={},t.Date.prototype={},t.JsError.prototype={},t.Atomics.prototype={},t.Modules.prototype={},t.Module.prototype={},t.Net.prototype={},t.Socket.prototype={},t.NetAddress.prototype={},t.NetServer.prototype={},t.NodeJsError.prototype={},t.JsAssertionError.prototype={},t.JsRangeError.prototype={},t.JsReferenceError.prototype={},t.JsSyntaxError.prototype={},t.JsTypeError.prototype={},t.JsSystemError.prototype={},t.Process.prototype={},t.CPUUsage.prototype={},t.Release.prototype={},t.StreamModule.prototype={},t.Readable.prototype={},t.Writable.prototype={},t.Duplex.prototype={},t.Transform.prototype={},t.WritableOptions.prototype={},t.ReadableOptions.prototype={},t.Immediate.prototype={},t.Timeout.prototype={},t.TTY.prototype={},t.TTYReadStream.prototype={},t.TTYWriteStream.prototype={},t.Util.prototype={},t.Connection.prototype={},t.SchemaLibrary.prototype={SchemaLibrary$2$connection$schemas(r,e){var n,a,i,s,l;for(n=this._schemas,a=r.sourceDatasetId,i=r.targetDatasetId,s=0;s<114;++s)l=n[s],l._rawTablePrefix=a,l._materializeTablePrefix=i},getSchema$1(r){return u.JSArray_methods.firstWhere$1(this._schemas,new t.SchemaLibrary_getSchema_closure(r))},get$visualizationSchemas(){var r=this._schemas,e=t._arrayInstanceType(r),n=e._eval$1("MappedIterable<1,VisualizationSchema>");return t.List_List$of(new t.MappedIterable(new t.WhereIterable(r,new t.SchemaLibrary_visualizationSchemas_closure,e._eval$1("WhereIterable<1>")),new t.SchemaLibrary_visualizationSchemas_closure0,n),!0,n._eval$1("Iterable.E"))}},t.SchemaLibrary_getSchema_closure.prototype={call$1(r){return r.name===this.name},$signature:37},t.SchemaLibrary_visualizationSchemas_closure.prototype={call$1(r){return!r.isMaterializeOnly},$signature:37},t.SchemaLibrary_visualizationSchemas_closure0.prototype={call$1(r){return r.get$visualizationSchema()},$signature:92},t.QueryEngineContext.prototype={},t.Materialize_get_createMaterializedTableSql_closure.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure0.prototype={call$1(r){return"ADD COLUMN IF NOT EXISTS "+r.name+" "+r.type._name},$signature:10},t.Materialize_get_createMaterializedTableSql_closure1.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_get_createMaterializedTableSql_closure2.prototype={call$1(r){return r.name+" "+r.type._name},$signature:10},t.Materialize_getMergeSql_closure.prototype={call$1(r){return"CAST("+r+" AS STRING)"},$signature:3},t.Materialize_getMergeSql_closure0.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure1.prototype={call$1(r){return"SAFE_CAST(JSON_VALUE("+this._this.name._name+", '$."+t.S(r.pointTo)+"') AS "+r.type._name+") AS "+r.name},$signature:10},t.Materialize_getMergeSql_closure2.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure3.prototype={call$1(r){return r.name},$signature:10},t.Materialize_getMergeSql_closure4.prototype={call$1(r){return r.pointTo!=null},$signature:2},t.Materialize_getMergeSql_closure5.prototype={call$1(r){var e=r.name;return e+"=source_table."+e},$signature:10},t.Materialize_getMaterializeInfoSql_closure.prototype={call$1(r){return"CAST("+r+" AS STRING)"},$signature:3},t.Materialize_getMaterializeInfoSql_closure0.prototype={call$1(r){return"TIMESTAMP("+r+", '"+this.tz+"') AS "+r},$signature:3},t.SOURCE_TYPE.prototype={_enumToString$0(){return"SOURCE_TYPE."+this._name}},t.MERGE_FILTER_TYPE.prototype={_enumToString$0(){return"MERGE_FILTER_TYPE."+this._name}},t.FIELD_ROLE.prototype={_enumToString$0(){return"FIELD_ROLE."+this._name}},t.Canonical.prototype={toJson$0(){var r,e=this.predicates;return o.get$isEmpty$asx(e)&&(e=null),r=this.measurePredicates,r.get$isEmpty(r)&&(r=null),t.LinkedHashMap_LinkedHashMap$_literal(["measures",this.measures,"predicates",e,"measurePredicates",r],d.String,d.dynamic)}},t.Canonical_fromJson_closure.prototype={call$2(r,e){return new t.MapEntry(t._asString(r),o.cast$1$0$ax(d.List_dynamic._as(e),d.String),d.MapEntry_of_String_and_List_String)},$signature:114},t.Hierarchy.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["depth",r.depth,"root",r.root,"parent",r.parent,"rootKey",r.rootKey],d.String,d.dynamic)}},t.SCHEMA_NAME.prototype={_enumToString$0(){return"SCHEMA_NAME."+this._name}},t.DATA_TYPE.prototype={_enumToString$0(){return"DATA_TYPE."+this._name}},t.AGGREGATION_TYPE.prototype={_enumToString$0(){return"AGGREGATION_TYPE."+this._name}},t.COMPARISON_OPERATOR.prototype={_enumToString$0(){return"COMPARISON_OPERATOR."+this._name}},t.DIMENSION_OPTION.prototype={_enumToString$0(){return"DIMENSION_OPTION."+this._name}},t.TIME_FORMATTER.prototype={_enumToString$0(){return"TIME_FORMATTER."+this._name}},t.FORMATTER_TYPE.prototype={_enumToString$0(){return"FORMATTER_TYPE."+this._name}},t.PERIOD_TYPE.prototype={_enumToString$0(){return"PERIOD_TYPE."+this._name}},t.SORT_TYPE.prototype={_enumToString$0(){return"SORT_TYPE."+this._name}},t.PermissionType.prototype={_enumToString$0(){return"PermissionType."+this._name}},t.Permission.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["type",this.type._name,"field",this.field],d.String,d.dynamic)}},t.TopLevelFilters.prototype={toJson$0(){var r=this.permissions,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,Map<String,@>>");return t.LinkedHashMap_LinkedHashMap$_literal(["timeControl",this.timeControl,"permissions",t.List_List$of(new t.MappedListIterable(r,new t.TopLevelFilters_toJson_closure,e),!0,e._eval$1("ListIterable.E"))],d.String,d.dynamic)}},t.TopLevelFilters_fromJson_closure.prototype={call$1(r){return new t.Permission(t.EnumByName_byName(u.List_wsa,r.$index(0,"type")),r.$index(0,"field"))},$signature:55},t.TopLevelFilters_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:118},t.Source.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["type",r.type._name,"table",r.table,"field",r.field,"dataset",r.dataset,"uniqueKey",r.uniqueKey,"timeColumn",r.timeColumn,"dateColumns",r.dateColumns],d.String,d.dynamic)}},t.INDEX_METHOD.prototype={_enumToString$0(){return"INDEX_METHOD."+this._name}},t.Index.prototype={toJson$0(){var r=this,e=r.indexMethod;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["column",r.column,"customName",r.customName,"indexMethod",e,"include",r.include],d.String,d.dynamic)}},t.Schema.prototype={setConnection$1(r){this._rawTablePrefix=r.sourceDatasetId,this._materializeTablePrefix=r.targetDatasetId},getTransformedTableQuery$1$getParentDocs(r){var e,n,a=this.source,i=a.type;return i===u.SOURCE_TYPE_2?e="transformBigqueryDoc":e=i===u.SOURCE_TYPE_1?"transformCouchdbDoc":"transformMongodbDoc",n="SAFE.PARSE_JSON("+("`"+this._materializeTablePrefix+"."+e+"`(data, id, db_name, publish_time, deleted, '"+a.table+"')")+", wide_number_mode=>'round')",a=a.field,a!=null&&!r?(a=t.S(a),a="SELECT JSON_QUERY_ARRAY("+n+", '$."+a+"') AS "+a+" FROM docs"):a="SELECT "+n+" AS "+this.name._name+" FROM docs",a},get$fullRawTableName(){var r=this._rawTablePrefix;return r=r!==""?r+".":"",r+this.rawTableName},get$fullMaterializedTableName(){var r=this._materializeTablePrefix;return r=r!==""?r+".":"",r+this.materializedTableName},get$visualizationSchema(){var r=this,e=o.where$1$ax(r.fields,new t.Schema_visualizationSchema_closure),n=e.$ti._eval$1("MappedIterable<1,VisualizationField>");return t.VisualizationSchema$(t.List_List$of(new t.MappedIterable(e,new t.Schema_visualizationSchema_closure0,n),!0,n._eval$1("Iterable.E")),r.isJoinOnly,o.map$1$1$ax(r.joins,new t.Schema_visualizationSchema_closure1,d.SCHEMA_NAME).toList$0(0),r.label,r.name)},toJson$0(){var r,e,n,a,i,s,l=this,p=d.Map_String_dynamic,c=o.map$1$1$ax(l.fields,new t.Schema_toJson_closure,p).toList$0(0);return p=o.map$1$1$ax(l.joins,new t.Schema_toJson_closure0,p).toList$0(0),r=l.topLevelFilters.toJson$0(),e=l.source.toJson$0(),n=l.filters,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(n,new t.Schema_toJson_closure1,a),!0,a._eval$1("ListIterable.E")),n=l.indexes,n==null?n=null:(i=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(n,new t.Schema_toJson_closure2,i),!0,i._eval$1("ListIterable.E")),n=i),i=l.canonical,i=i==null?null:i.toJson$0(),s=l.hierarchy,s=s==null?null:s.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["fields",c,"label",l.label,"name",l.name._name,"joins",p,"topLevelFilters",r,"source",e,"dynamicRawTable",l.dynamicRawTable,"rawTableName",l.rawTableName,"rawTopicName",l.rawTopicName,"materializedTableName",l.materializedTableName,"materializedPostgresqlTableName",l.materializedPostgresqlTableName,"isJoinOnly",l.isJoinOnly,"isMaterializeOnly",l.isMaterializeOnly,"isContinuousUpdate",l.isContinuousUpdate,"interval",l.interval,"partition",l.partition,"requirePartitionFilter",l.requirePartitionFilter,"clusters",l.clusters,"filters",a,"indexes",n,"isGlobal",l.isGlobal,"isAiHidden",l.isAiHidden,"aiKeywords",l.aiKeywords,"aiCategory",l.aiCategory,"aiPriority",l.aiPriority,"mergeFilterType",l.mergeFilterType._name,"description",l.description,"canonical",i,"hierarchy",s,"activityAnchor",l.activityAnchor,"isDeprecated",l.isDeprecated],d.String,d.dynamic)}},t.Schema_visualizationSchema_closure.prototype={call$1(r){return!r.hidden},$signature:2},t.Schema_visualizationSchema_closure0.prototype={call$1(r){var e=r.type,n=r.name,a=r.label,i=r.schemaName,s=t.getFilterOperators(e);return new t.VisualizationField(i,n,a,e,t.getAggregationTypes(e),t.getDimensionOptions(e),s)},$signature:117},t.Schema_visualizationSchema_closure1.prototype={call$1(r){return r.joinSchemaName},$signature:106},t.Schema_fromJson_closure.prototype={call$1(r){return t.Field_fromJson(r)},$signature:105},t.Schema_fromJson_closure0.prototype={call$1(r){return t.Join_fromJson(r)},$signature:104},t.Schema_fromJson_closure1.prototype={call$1(r){var e,n,a="indexMethod",i=d.nullable_List_dynamic,s=i._as(r.$index(0,"column"));return s=s==null?null:o.cast$1$0$ax(s,d.String),s==null&&(s=t._setArrayType([],d.JSArray_String)),e=r.$index(0,"customName"),n=r.$index(0,a)==null?null:t.EnumByName_byName(u.List_88s,r.$index(0,a)),i=i._as(r.$index(0,"include")),new t.Index(s,e,n,i==null?null:o.cast$1$0$ax(i,d.String))},$signature:102},t.Schema_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:16},t.Schema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:99},t.Schema_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:97},t.Schema_toJson_closure1.prototype={call$1(r){return r.toJson$0()},$signature:17},t.Schema_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:95},t.Field.prototype={getSql$3$option$schema$value(r,e,n){var a,i;return n!=null?o.toString$0$(n):(a=this.formula,i=e.name._name,a!=null?(i=t.ReCase$(i)._getCamelCase$0(),t.stringReplaceAllUnchecked(a,"@",i+".")):t.ReCase$(i)._getCamelCase$0()+"."+this.name)},getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(r,e,n,a){var i=n.getSchema$1(this.schemaName),s=o.firstWhere$1$ax(i.fields,new t.Field_getQueryPlainSql_closure(this)),l=i.name._name,p=t.ReCase$(l)._getCamelCase$0()+"."+s.name,c=s.formula;switch(c!=null&&(l=t.ReCase$(l)._getCamelCase$0(),p=t.stringReplaceAllUnchecked(c,"@",l+".")),s.type.index){case 1:p=e==null?T.FORMAT+p+")":t.DimensionOptionExtension_formatSql(e,p,a);break;case 0:p="ANY_VALUE("+p+") OVER (PARTITION BY REGEXP_REPLACE(IFNULL("+p+",''), ' ', ''))";break}return p},toJson$0(){var r=this,e=r.role;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name,"schemaName",r.schemaName._name,"pointTo",r.pointTo,"formula",r.formula,"postgresqlFormula",r.postgresqlFormula,"label",r.label,"hidden",r.hidden,"type",r.type._name,"isAiHidden",r.isAiHidden,"isCompareIgnoreSpaces",r.isCompareIgnoreSpaces,"description",r.description,"role",e,"identityOf",r.identityOf],d.String,d.dynamic)}},t.Field_getQueryPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t._NumericField.prototype={getSql$3$option$schema$value(r,e,n){return this.super$Field$getSql(r,e,n)}},t._TimestampField.prototype={_getExtractTimestampSql$3$part$sql$value(r,e,n){return n!=null?e:"CAST(EXTRACT("+r+" FROM "+e+" AT TIME ZONE @TIMEZONE) as INT64)"},getSql$3$option$schema$value(r,e,n){var a=this,i=a.super$Field$getSql(r,e,n);switch(r){case u.DIMENSION_OPTION_5:i="TIME("+(n!=null?"TIMESTAMP('"+i+"')":i)+", @TIMEZONE)";break;case u.DIMENSION_OPTION_6:i=a._getExtractTimestampSql$3$part$sql$value("HOUR",i,n);break;case u.DIMENSION_OPTION_7:i=a._getExtractTimestampSql$3$part$sql$value("DAYOFWEEK",i,n);break;case u.DIMENSION_OPTION_8:i=a._getExtractTimestampSql$3$part$sql$value("DAY",i,n);break;case u.DIMENSION_OPTION_9:i=a._getExtractTimestampSql$3$part$sql$value("MONTH",i,n);break;case u.DIMENSION_OPTION_10:i=a._getExtractTimestampSql$3$part$sql$value("YEAR",i,n);break;case u.DIMENSION_OPTION_0:case u.DIMENSION_OPTION_1:case u.DIMENSION_OPTION_2:case u.DIMENSION_OPTION_3:case u.DIMENSION_OPTION_4:case u.DIMENSION_OPTION_11:default:n!=null&&(i="TIMESTAMP('"+i+"')");break}return i}},t._BoolField.prototype={getSql$3$option$schema$value(r,e,n){return this.super$Field$getSql(r,e,n)}},t._StringField.prototype={getSql$3$option$schema$value(r,e,n){var a=this.super$Field$getSql(r,e,n);return o.$eq$(n,"NULL")?a:n!=null?"'"+a+"'":a}},t.Join.prototype={getConditionsSql$1(r){return u.JSArray_methods.fold$2(this.conditions,"",new t.Join_getConditionsSql_closure(this,r))},toJson$0(){var r=this,e=r.conditions,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>");return n=t.List_List$of(new t.MappedListIterable(e,new t.Join_toJson_closure,n),!0,n._eval$1("ListIterable.E")),e=r.lateral,e=e==null?null:e.toJson$0(),t.LinkedHashMap_LinkedHashMap$_literal(["joinSchemaName",r.joinSchemaName._name,"mainSchemaName",r.mainSchemaName._name,"conditions",n,"topLevelTimeControl",r.topLevelTimeControl,"lateral",e],d.String,d.dynamic)}},t.Join_getConditionsSql_closure.prototype={call$2(r,e){var n=this.$this,a=t._setArrayType([e.joinField],d.JSArray_String),i=e.option,s=t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(null,a,i,n.joinSchemaName),e.operator,this.schemaLibrary,t._QueryRequestComparisonTargetVariable$(null,e.mainFields,i,n.mainSchemaName)).getSql$0();return r===""?s:r+" and "+s},$signature:89},t.Join_fromJson_closure.prototype={call$1(r){var e=r.$index(0,"joinField"),n=r.$index(0,"mainFields"),a=t.EnumByName_byName(u.List_LO4,r.$index(0,"operator"));return new t.JoinCondition(e,n,a,r.$index(0,"option")!=null?t.EnumByName_byName(u.List_yRY,r.$index(0,"option")):null)},$signature:88},t.Join_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:85},t.JoinLateralSort.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["name",this.name,"type",this.type._name],d.String,d.dynamic)}},t.JoinLateral.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["distinctFields",this.distinctFields,"sorts",o.map$1$1$ax(this.sorts,new t.JoinLateral_toJson_closure,d.Map_String_dynamic).toList$0(0)],d.String,d.dynamic)}},t.JoinLateral_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:78},t.JoinCondition.prototype={toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["joinField",r.joinField,"mainFields",r.mainFields,"operator",r.operator._name,"option",e],d.String,d.dynamic)}},t.QueryRequestComparisonTarget.prototype={},t._QueryRequestComparisonTargetValue.prototype={},t._QueryRequestComparisonTargetVariable.prototype={},t.QueryRequestComparison.prototype={getSql$0(){var r,e,n,a=this,i=a.operator;switch(i.index){case 0:i=a.to,r=i.length,r===0?e="":r===1?(n=i[0],i=a.from,e=n==="NULL"?i+" is "+n:i+"="+n):(r=a.from,e=r+" in ("+u.JSArray_methods.join$1(i,",")+")",u.JSArray_methods.contains$1(i,"NULL")&&(e=e+" OR "+r+" IS NULL"));break;case 1:i=a.to,r=i.length,r===0?e="":r===1?(n=i[0],i=a.from,e=n==="NULL"?i+" is not "+n:i+"!="+n):(r=a.from,e=r+" not in ("+u.JSArray_methods.join$1(i,",")+")",u.JSArray_methods.contains$1(i,"NULL")&&(e=e+" AND "+r+" IS NOT NULL"));break;case 7:i=a.to,e=i.length===0?"":new t.MappedListIterable(i,new t.QueryRequestComparison_getSql_closure(a),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0," or ");break;case 8:i=a.to,e=i.length===0?"":new t.MappedListIterable(i,new t.QueryRequestComparison_getSql_closure0(a),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0," and ");break;case 3:e=a.from+"<"+t.S(a.to[0]);break;case 5:e=a.from+"<="+t.S(a.to[0]);break;case 2:e=a.from+">"+t.S(a.to[0]);break;case 4:e=a.from+">="+t.S(a.to[0]);break;case 6:i=a.to,e=a.from+" between "+t.S(i[0])+" and "+t.S(i[1]);break;case 10:i=t._setArrayType([a.from],d.JSArray_String),u.JSArray_methods.addAll$1(i,a.to),e=u.JSArray_methods.join$1(i," or ");break;case 9:i=t._setArrayType([a.from],d.JSArray_String),u.JSArray_methods.addAll$1(i,a.to),e=u.JSArray_methods.join$1(i," and ");break;default:throw t.wrapException(t.Exception_Exception("invalid operator "+i._name))}return e!==""?"("+e+")":e}},t.QueryRequestComparison_QueryRequestComparison$nested_closure.prototype={call$1(r){return r.getSql$0()},$signature:60},t.QueryRequestComparison_getToValues_closure.prototype={call$1(r){var e=this.toSchema;return o.firstWhere$1$ax(e.fields,new t.QueryRequestComparison_getToValues__closure0(r)).getSql$3$option$schema$value(this.to.option,e,null)},$signature:3},t.QueryRequestComparison_getToValues__closure0.prototype={call$1(r){return r.name===this.name},$signature:2},t.QueryRequestComparison_getToValues_closure0.prototype={call$1(r){var e,n=this.operator;return n===u.COMPARISON_OPERATOR_7||n===u.COMPARISON_OPERATOR_8?"'%"+t.S(r)+"%'":(n=this.toSchema,e=this.to,o.firstWhere$1$ax(n.fields,new t.QueryRequestComparison_getToValues__closure(e)).getSql$3$option$schema$value(e.option,n,r))},$signature:8},t.QueryRequestComparison_getToValues__closure.prototype={call$1(r){return r.name===o.get$first$ax(this.to.names)},$signature:2},t.QueryRequestComparison_getFromValue_closure.prototype={call$1(r){return r.name===o.get$first$ax(this.from.names)},$signature:2},t.QueryRequestComparison_getSql_closure.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') like "+(e+r+"), ' ', '')")},$signature:3},t.QueryRequestComparison_getSql_closure0.prototype={call$1(r){var e="REGEXP_REPLACE(LOWER(";return e+this.$this.from+"), ' ', '') not like "+(e+r+"), ' ', '')")},$signature:3},t.uniqueAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.Primitives_stringFromCharCode(97+t.int_parse(e))},$signature:15},t.QueryRequestCommonField.prototype={getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r,e,n,a,i,s,l,p){var c,M,b=s!=null;if(r!=null)switch(c="ORDER BY "+e+"_sort ASC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING",r.index){case 0:case 10:return"SUM("+e+") OVER ("+i+") "+e;case 2:case 12:return b?"SUM("+e+") OVER ("+i+") "+e:"COUNT("+e+") OVER ("+i+") "+e;case 3:return b?"SUM("+e+") OVER ("+i+") "+e:"COUNT(DISTINCT "+e+") OVER ("+i+") "+e;case 1:case 11:return"AVG("+e+") OVER ("+i+") "+e;case 7:case 13:return b?"'' "+e:"STRING_AGG("+e+") OVER ("+i+") "+e;case 4:return u.JSArray_methods.join$1(t._setArrayType(["FIRST_VALUE("+e+") OVER ("+i+" "+c+") "+e,"LAST_VALUE("+e+"_sort) OVER ("+i+" "+c+") "+e+"_sort"],d.JSArray_String),",");case 5:return M="LAST_VALUE("+e,u.JSArray_methods.join$1(t._setArrayType([M+") OVER ("+i+" "+c+") "+e,M+"_sort) OVER ("+i+" "+c+") "+e+"_sort"],d.JSArray_String),",");case 8:return"MIN("+e+") OVER ("+i+") "+e;case 9:return"MAX("+e+") OVER ("+i+") "+e;case 6:return b?"'' "+e:"ANY_VALUE(CAST("+e+" as STRING)) OVER ("+i+") "+e}else return b&&n>=s?"CAST(NULL as "+t.S(t.DataTypeExtension_get_sqlType(o.firstWhere$1$ax(l.getSchema$1(this.schemaName).fields,new t.QueryRequestCommonField_getAggregatedSql_closure(this)).type))+") "+e:a?"ANY_VALUE("+e+") OVER ("+i+") "+e:e}},t.QueryRequestCommonField_getAggregatedSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension.prototype={toJson$0(){var r,e,n=this,a=n.timeFormatter;return a=a==null?null:a._name,r=n.formatter,r=r==null?null:r._name,e=n.option,e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",n.schemaName._name,"name",n.name,"decimal",n.decimal,"timeFormatter",a,"formatter",r,"label",n.label,"option",e,"fillGap",n.fillGap,"hide",n.hide,"dataFormula",n.dataFormula,"displayFormula",n.displayFormula,"dateComparison",n.dateComparison],d.String,d.dynamic)},copyWith$1$hide(r){var e=this;return new t.QueryRequestDimension(e.option,e.label,e.decimal,e.timeFormatter,e.formatter,e.fillGap,e.dataFormula,e.displayFormula,!0,e.dateComparison,e.schemaName,e.name)},get$idV1(){var r=this.name,e=this.option;return e!=null&&(r=r+"_"+e._name),(this.schemaName._name+"_"+r).toLowerCase()},get$alias(){var r=this,e=r.name,n=r.option;return n!=null&&(e=e+"_"+n._name),n=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0),(r.schemaName._name+"_"+e+"_"+t.stringReplaceAllUnchecked(r.label,n,"")).toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){return o.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestDimension_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,this.option,r,e)},generateTimestampArraySql$2$timeFilters$timezone(r,e){var n,a,i,s,l,p,c;switch(this.option){case u.DIMENSION_OPTION_1:case u.DIMENSION_OPTION_6:n=u.Units_3;break;case u.DIMENSION_OPTION_2:case u.DIMENSION_OPTION_7:case u.DIMENSION_OPTION_8:case u.DIMENSION_OPTION_11:n=u.Units_4;break;case u.DIMENSION_OPTION_3:n=u.Units_5;break;case u.DIMENSION_OPTION_4:case u.DIMENSION_OPTION_9:n=u.Units_6;break;case u.DIMENSION_OPTION_10:n=u.Units_7;break;case u.DIMENSION_OPTION_0:case u.DIMENSION_OPTION_5:default:n=null;break}if(a=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$first(r).values,0)).toUtc$0(),i=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$first(r).values,1)).toUtc$0(),s=new t.QueryRequestDimension_generateTimestampArraySql_closure(r,a).call$0(),l=new t.QueryRequestDimension_generateTimestampArraySql_closure0(r,i).call$0(),s.isAfter$1(l)&&(l=l.add$1(0,t.Duration$(1,0,0,0,0,0))),n!=null)switch(p=t.DateTimeExtension_startOfUtc(s,n,s,e)._toString$1$iso8601(!0),c=t.DateTimeExtension_endOfUtc(l,n,l,e)._toString$1$iso8601(!0),n.index){case 3:case 4:return'UNNEST(GENERATE_TIMESTAMP_ARRAY(TIMESTAMP("'+p+'"),TIMESTAMP("'+c+'"),INTERVAL 1 '+n._name+"))";case 5:case 6:case 7:return'UNNEST(ARRAY(SELECT TIMESTAMP(date, "'+e+'") FROM UNNEST(GENERATE_DATE_ARRAY(DATE(TIMESTAMP "'+p+'", "'+e+'"),DATE(TIMESTAMP "'+c+'", "'+e+'"),INTERVAL 1 '+n._name+")) as date))";default:return"[]"}else return[]},getColumn$1(r){var e=this,n=e.schemaName,a=o.firstWhere$1$ax(r.getSchema$1(n).fields,new t.QueryRequestDimension_getColumn_closure(e)),i=t.uniqueAlias(e.get$alias()),s=a.type;return new t.QueryResponseColumn(n,e.label,s,u.FIELD_TYPE_0,i,null,e.option,e.decimal,e.timeFormatter,e.formatter,!1,e.hide,e.dateComparison===!0)},$eq(r,e){var n=this;return e==null?!1:e instanceof t.QueryRequestDimension&&n.option==e.option&&n.name===e.name&&n.schemaName===e.schemaName&&n.label===e.label},get$hashCode(r){var e=this;return u.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+o.get$hashCode$(e.option)+u.JSString_methods.get$hashCode(e.label)}},t.QueryRequestDimension_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestDimension_generateTimestampArraySql_closure.prototype={call$0(){var r=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$last(this.timeFilters).values,0)).toUtc$0(),e=this.startTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:27},t.QueryRequestDimension_generateTimestampArraySql_closure0.prototype={call$0(){var r=t.DateTime_parse(o.$index$asx(u.JSArray_methods.get$last(this.timeFilters).values,1)).toUtc$0(),e=this.endTimeUtc;return e=t.Primitives_valueFromDecomposedDate(t.Primitives_getYear(r),t.Primitives_getMonth(r),t.Primitives_getDay(r),t.Primitives_getHours(e),t.Primitives_getMinutes(e),t.Primitives_getSeconds(e),t.Primitives_getMilliseconds(e),!0),t._isInt(e)||t.throwExpression(t.argumentErrorValue(e)),new t.DateTime(e,!0)},$signature:27},t.QueryRequestDimension_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric.prototype={toJson$0(){var r,e=this,n=e.timeFormatter;return n=n==null?null:n._name,r=e.formatter,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"label",e.label,"decimal",e.decimal,"aggregation",e.aggregation._name,"nullable",e.nullable,"hide",e.hide,"dataFormula",e.dataFormula,"displayFormula",e.displayFormula,"timeFormatter",n,"formatter",r],d.String,d.dynamic)},get$alias(){var r=this,e=t.RegExp_RegExp("[^\\p{L}\\p{N}_]+",!0);return(r.schemaName._name+"_"+r.name+"_"+r.aggregation._name+"_"+t.stringReplaceAllUnchecked(r.label,e,"")).toLowerCase()},getColumn$1(r){var e=this,n=e.schemaName,a=o.firstWhere$1$ax(r.getSchema$1(n).fields,new t.QueryRequestMetric_getColumn_closure(e)).type,i=e.aggregation;switch(i.index){case 2:case 3:case 0:a=u.DATA_TYPE_3;break}return new t.QueryResponseColumn(n,e.label,a,u.FIELD_TYPE_1,t.uniqueAlias(e.get$alias()),i,null,e.decimal,e.timeFormatter,e.formatter,e.nullable,e.hide,!1)},getPlainSql$2$schemaLibrary$timezone(r,e){return o.firstWhere$1$ax(r.getSchema$1(this.schemaName).fields,new t.QueryRequestMetric_getPlainSql_closure(this)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(this.aggregation,null,r,e)},$eq(r,e){var n=this;return e==null?!1:e instanceof t.QueryRequestMetric&&n.aggregation===e.aggregation&&n.name===e.name&&n.schemaName===e.schemaName&&n.label===e.label},get$hashCode(r){var e=this;return u.JSString_methods.get$hashCode(e.name)+t.Primitives_objectHashCode(e.schemaName)+t.Primitives_objectHashCode(e.aggregation)+u.JSString_methods.get$hashCode(e.label)}},t.QueryRequestMetric_getColumn_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestMetric_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestFilter.prototype={toComparison$2$timezone(r,e){var n,a,i,s,l,p,c,M,b,O=this,D=O.schemaName,$=r.getSchema$1(D),E=O.operator;return E===u.COMPARISON_OPERATOR_6&&O.option===u.DIMENSION_OPTION_5&&(n=O.values,a=o.getInterceptor$asx(n),i=t.Jiffy$(a.$index(n,0)),s=t.Jiffy$(a.$index(n,1)),n=i.__Jiffy__dateTime_A,n===q&&t.throwUnnamedLateFieldNI(),n=n.get$hour(),a=i.__Jiffy__dateTime_A.get$minute(),l=s.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),l.get$hour()*60+s.__Jiffy__dateTime_A.get$minute()<n*60+a)?(D=$.name,E=O.name,n=d.JSArray_String,a=O.option,l=O.dataFormula,p=t._QueryRequestComparisonTargetVariable$(l,t._setArrayType([E],n),a,D),c=t.Jiffy$(i),M=c.__Jiffy__dateTime_A,M===q&&t.throwUnnamedLateFieldNI(),M=M.toUtc$0(),c.__Jiffy__dateTime_A=M,M=M.toIso8601String$0(),c=i.__Jiffy__dateTime_A,c=t.DateTimeExtension_endOfUtc(c,u.Units_4,c,e)._toString$1$iso8601(!0),c=t.QueryRequestComparison_QueryRequestComparison$single(p,u.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([E],n),[M,c],a,null)),l=t._QueryRequestComparisonTargetVariable$(l,t._setArrayType([E],n),a,D),M=s.__Jiffy__dateTime_A,M=t.DateTimeExtension_startOfUtc(M,u.Units_4,M,e)._toString$1$iso8601(!0),p=t.Jiffy$(s),b=p.__Jiffy__dateTime_A,b===q&&t.throwUnnamedLateFieldNI(),b=b.toUtc$0(),p.__Jiffy__dateTime_A=b,b=b.toIso8601String$0(),t.QueryRequestComparison_QueryRequestComparison$nested(u.COMPARISON_OPERATOR_10,t._setArrayType([c,t.QueryRequestComparison_QueryRequestComparison$single(l,u.COMPARISON_OPERATOR_6,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([E],n),[M,b],a,null))],d.JSArray_QueryRequestComparison))):(n=O.name,a=d.JSArray_String,l=O.option,t.QueryRequestComparison_QueryRequestComparison$single(t._QueryRequestComparisonTargetVariable$(O.dataFormula,t._setArrayType([n],a),l,D),E,r,new t._QueryRequestComparisonTargetValue(D,t._setArrayType([n],a),O.values,l,null)))},toJson$0(){var r=this,e=r.option;return e=e==null?null:e._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",r.schemaName._name,"name",r.name,"operator",r.operator._name,"option",e,"dataFormula",r.dataFormula,"isGlobalFilter",r.isGlobalFilter,"values",r.values],d.String,d.dynamic)}},t._GetSourceTableResponse.prototype={},t._PlainSqlColumn.prototype={},t.QueryRequest.prototype={get$populatedSorts(){var r,e,n,a,i=null,s=this.sorts;return s.length!==0?s:(s=this.dimensions,r=o.getInterceptor$asx(s),r.get$isNotEmpty(s)?(e=r.get$first(s),t._setArrayType([new t.QueryRequestSort(u.SORT_TYPE_0,i,i,i,e.schemaName,e.name)],d.JSArray_QueryRequestSort)):(s=this.metrics,r=o.getInterceptor$asx(s),n=d.JSArray_QueryRequestSort,r.get$isNotEmpty(s)?(a=r.get$first(s),t._setArrayType([new t.QueryRequestSort(u.SORT_TYPE_0,i,i,i,a.schemaName,a.name)],n)):t._setArrayType([],n)))},_getJoins$1(r){var e=this.joins,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Join>");return t.List_List$of(new t.MappedListIterable(e,new t.QueryRequest__getJoins_closure(this,r),n),!0,n._eval$1("ListIterable.E"))},toJson$0(){var r,e,n,a,i,s,l=this,p=d.Map_String_dynamic,c=o.map$1$1$ax(l.dimensions,new t.QueryRequest_toJson_closure,p).toList$0(0);return p=o.map$1$1$ax(l.metrics,new t.QueryRequest_toJson_closure0,p).toList$0(0),r=l.joins,e=t._arrayInstanceType(r)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(r,new t.QueryRequest_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),r=l.timeDimension,r=r==null?null:r.toJson$0(),n=l.filters,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),a=t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure2,a),!0,a._eval$1("ListIterable.E")),n=l.sorts,i=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),i=t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure3,i),!0,i._eval$1("ListIterable.E")),n=l.blendConditions,n==null&&(n=t._setArrayType([],d.JSArray_JoinDatasourceCondition)),s=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",l.schemaName._name,"dimensions",c,"metrics",p,"joins",e,"timeDimension",r,"restaurantIds",l.restaurantIds,"warehouseIds",l.warehouseIds,"businessIds",l.businessIds,"filters",a,"sorts",i,"blendConditions",t.List_List$of(new t.MappedListIterable(n,new t.QueryRequest_toJson_closure4,s),!0,s._eval$1("ListIterable.E")),"limit",l.limit,"rollup",l.rollup,"rollupPosition",l.rollupPosition,"timezone",l.timezone],d.String,d.dynamic)},copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,n,a,i){var s=this,l=i??s.sorts,p=n??s.rollup,c=a??s.rollupPosition,M=r??s.blendConditions;return t.QueryRequest$(M,s.businessIds,e,s.filters,s.joins,s.limit,s.metrics,s.restaurantIds,p,c,s.schemaName,l,s.timeDimension,s.timezone,s.warehouseIds)},copyWith$2$dimensions$sorts(r,e){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,e)},copyWith$1$dimensions(r){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,null,null,null)},copyWith$3$blendConditions$dimensions$rollup(r,e,n){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(r,e,n,null,null)},copyWith$3$dimensions$rollup$rollupPosition(r,e,n){return this.copyWith$5$blendConditions$dimensions$rollup$rollupPosition$sorts(null,r,e,n,null)},getColumns$1(r){var e=d.QueryResponseColumn,n=t.List_List$of(o.map$1$1$ax(this.dimensions,new t.QueryRequest_getColumns_closure(r),e),!0,e);return u.JSArray_methods.addAll$1(n,o.map$1$1$ax(this.metrics,new t.QueryRequest_getColumns_closure0(r),e)),n},_getPlainSqlColumns$1(r){var e=this,n=d._PlainSqlColumn,a=t.List_List$of(o.map$1$1$ax(e.dimensions,new t.QueryRequest__getPlainSqlColumns_closure(e,r),n),!0,n),i=e.metrics,s=o.getInterceptor$ax(i);return u.JSArray_methods.addAll$1(a,s.map$1$1(i,new t.QueryRequest__getPlainSqlColumns_closure0(e,r),n)),n=e.sorts,u.JSArray_methods.addAll$1(a,new t.MappedListIterable(n,new t.QueryRequest__getPlainSqlColumns_closure1(e,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,_PlainSqlColumn>"))),u.JSArray_methods.addAll$1(a,s.fold$2(i,t._setArrayType([],d.JSArray__PlainSqlColumn),new t.QueryRequest__getPlainSqlColumns_closure2(e,r))),a},_getPlainSqlSorts$1(r){var e=this.get$populatedSorts(),n=new t.MappedListIterable(e,new t.QueryRequest__getPlainSqlSorts_closure(this,r),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>"));return n.get$length(n)===0?"":" order by "+n.join$1(0,",")},_getTimeFilters$1(r){var e,n,a,i,s,l,p,c,M,b,O,D=null,$=t._setArrayType([],d.JSArray_QueryRequestFilter),E=r.topLevelFilters.timeControl;return E!=null&&(e=this.timeDimension,n=e.timeStart,n!=null&&e.timeEnd!=null?(a=t.Jiffy$(n),i=e.timeEnd,s=t.Jiffy$(i),l=a.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),p=l.get$hour()*60+a.__Jiffy__dateTime_A.get$minute(),l=s.__Jiffy__dateTime_A,l===q&&t.throwUnnamedLateFieldNI(),c=l.get$hour()*60+s.__Jiffy__dateTime_A.get$minute(),M=c-p,M<=0&&(M+=1440),b=p>720&&M>720,O=c<p?s.__Jiffy__dateTime_A.toLocal$0().get$hour()*60+s.__Jiffy__dateTime_A.toLocal$0().get$minute()+1:0,n.toString,i.toString,$.push(new t.QueryRequestFilter(u.COMPARISON_OPERATOR_6,u.DIMENSION_OPTION_5,D,D,[n,i],r.name,E))):(O=0,b=!1),n=t.Jiffy$(e.start),n=n.subtract$1$days(b?1:0).add$1$minutes(0,O),i=n.__Jiffy__dateTime_A,i===q&&t.throwUnnamedLateFieldNI(),i=i.toUtc$0(),n.__Jiffy__dateTime_A=i,i=i.toIso8601String$0(),e=t.Jiffy$(e.end),e=e.subtract$1$days(b?1:0).add$1$minutes(0,O),n=e.__Jiffy__dateTime_A,n===q&&t.throwUnnamedLateFieldNI(),n=n.toUtc$0(),e.__Jiffy__dateTime_A=n,$.push(new t.QueryRequestFilter(u.COMPARISON_OPERATOR_6,u.DIMENSION_OPTION_0,D,D,[i,n.toIso8601String$0()],r.name,E))),$},_getSqlFilters$1(r){var e,n,a,i,s=this,l=t._setArrayType([],d.JSArray_QueryRequestFilter),p=r.getSchema$1(s.schemaName);return s.timeDimension!=null&&(e=t.List_List$of(l,!0,d.QueryRequestFilter),u.JSArray_methods.addAll$1(e,s._getTimeFilters$1(p)),l=e),e=p.topLevelFilters.permissions,e.length!==0?(n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,QueryRequestFilter>"),a=n._eval$1("MappedListIterable<ListIterable.E,QueryRequestComparison>"),i=t.QueryRequestComparison_QueryRequestComparison$nested(u.COMPARISON_OPERATOR_10,t.List_List$of(new t.MappedListIterable(new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure(s),n),new t.QueryRequest__getSqlFilters_closure0(s,r),a),!0,a._eval$1("ListIterable.E"))).getSql$0()):i="id='_'",e=t._setArrayType([i],d.JSArray_String),u.JSArray_methods.addAll$1(e,new t.MappedListIterable(l,new t.QueryRequest__getSqlFilters_closure1(s,r),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"))),n=s.filters,u.JSArray_methods.addAll$1(e,new t.MappedListIterable(n,new t.QueryRequest__getSqlFilters_closure2(s,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),n=p.filters,u.JSArray_methods.addAll$1(e,new t.MappedListIterable(n,new t.QueryRequest__getSqlFilters_closure3(s,r),t._arrayInstanceType(n)._eval$1("MappedListIterable<1,String>"))),e.length!==0?" where "+new t.MappedListIterable(e,new t.QueryRequest__getSqlFilters_closure4,d.MappedListIterable_String_String).join$1(0," and "):""},_getSqlJoins$1(r){return u.JSArray_methods.fold$2(this._getJoins$1(r),"",new t.QueryRequest__getSqlJoins_closure(this,r))},_getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(r,e,n,a){var i,s,l,p,c,M,b,O,D=this,$=r!=null,E=D.dimensions,g=d.QueryRequestDimension,h=t.ListExtensions_whereIndexed(E,new t.QueryRequest__getRollupSelect_closure(r),g),R=h.get$isEmpty(h)?"":"PARTITION BY "+t.MappedIterable_MappedIterable(h,new t.QueryRequest__getRollupSelect_closure0,h.$ti._eval$1("Iterable.E"),d.String).join$1(0,","),L=d.String;return g=t.List_List$of(t.ListExtensions_mapIndexed(E,new t.QueryRequest__getRollupSelect_closure1(D,e,r,R),g,L),!0,L),i=D.metrics,s=d.JSArray_String,u.JSArray_methods.addAll$1(g,t.IterableExtension_foldIndexed(i,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure2(D,e,r,R))),l=D.sorts,p=t._arrayInstanceType(l),c=p._eval$1("MappedListIterable<1,String>"),u.JSArray_methods.addAll$1(g,new t.MappedListIterable(l,new t.QueryRequest__getRollupSelect_closure3(D,e,r,R),c)),g=u.JSArray_methods.join$1(g,","),M=o.getInterceptor$ax(E),b=t.List_List$of(M.map$1$1(E,new t.QueryRequest__getRollupSelect_closure4(a),L),!0,L),u.JSArray_methods.addAll$1(b,o.fold$2$ax(i,t._setArrayType([],s),new t.QueryRequest__getRollupSelect_closure5(a,$))),u.JSArray_methods.addAll$1(b,new t.MappedListIterable(l,new t.QueryRequest__getRollupSelect_closure6,c)),b.push(""+$+" _is_rollup"),O="select "+u.JSArray_methods.join$1(b,",")+" from ("+("select "+g+" from "+n)+")",M.get$isNotEmpty(E)&&(E=t.List_List$of(M.map$1$1(E,new t.QueryRequest__getRollupSelect_closure7,L),!0,L),g=p._eval$1("MappedIterable<1,String>"),u.JSArray_methods.addAll$1(E,t.List_List$of(new t.MappedIterable(new t.WhereIterable(l,new t.QueryRequest__getRollupSelect_closure8,p._eval$1("WhereIterable<1>")),new t.QueryRequest__getRollupSelect_closure9,g),!0,g._eval$1("Iterable.E"))),O=O+" group by "+u.JSArray_methods.join$1(E,",")),O},get$_hasFillGap(){var r=o.where$1$ax(this.dimensions,new t.QueryRequest__hasFillGap_closure);return!r.get$isEmpty(r)},_getSqlSelectSorts$1(r){var e,n=this,a=n.rollup;return a==null&&(a=0),e=d.String,e=t.List_List$of(o.map$1$1$ax(o.sublist$2$ax(n.dimensions,0,a),new t.QueryRequest__getSqlSelectSorts_closure(n,r),e),!0,e),e.push("_is_rollup "+(n.rollupPosition==="BOTTOM"?"ASC":"DESC")),u.JSArray_methods.addAll$1(e,u.JSArray_methods.fold$2(n.sorts,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getSqlSelectSorts_closure0(r)))," ORDER BY "+u.JSArray_methods.join$1(e,",")},_getSortedLimitTable$2$schemaLibrary$sourceTableName(r,e){var n,a=this.limit,i=a!=null?" LIMIT "+t.S(a):"";return a=this.sorts,n=a.length!==0?" ORDER BY "+o.join$1$ax(u.JSArray_methods.fold$2(a,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getSortedLimitTable_closure(r)),","):"","SELECT * from "+e+n+i},getSqlSelect$1(r){var e,n,a,i,s,l,p,c,M=this,b="source_table",O=M.dimensions,D=o.getInterceptor$asx(O);if(D.get$isEmpty(O)&&o.get$isEmpty$asx(M.metrics))throw t.wrapException(t.Exception_Exception("column is empty"));for(e=M._getSourceTable$1$schemaLibrary(r),n="with source_table as ("+e.sql+")",n=M.get$_hasFillGap()?n+",fill_gap_table as ("+M._getFillGapTable$2$schemaLibrary$sourceTableName(r,b)+"),full_table as ("+M._getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName("fill_gap_table",r,b)+")":n+",full_table as (SELECT * FROM source_table)",n=n+",aggregated_table as ("+M._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(null,r,"full_table",!1)+"),sorted_limit_table as ("+M._getSortedLimitTable$2$schemaLibrary$sourceTableName(r,"aggregated_table")+")",a=M.rollup,a!=null&&D.get$isNotEmpty(O)&&a>=D.get$length(O)&&(a=D.get$length(O)-1),i=a!=null?a+1:0,i<0&&t.throwExpression(t.ArgumentError$("Length must be a non-negative integer: "+i)),s=t._setArrayType(new Array(i),d.JSArray_String),l=0;l<i;++l)s[l]=M._getRollupSelect$4$rollupIndex$schemaLibrary$sourceTableName$useFormula(l,r,"sorted_limit_table",!0);return p=d.String,c=t.List_List$of(s,!0,p),O=t.List_List$of(D.map$1$1(O,new t.QueryRequest_getSqlSelect_closure,p),!0,p),u.JSArray_methods.addAll$1(O,o.map$1$1$ax(M.metrics,new t.QueryRequest_getSqlSelect_closure0,p)),p=M.sorts,u.JSArray_methods.addAll$1(O,new t.MappedListIterable(p,new t.QueryRequest_getSqlSelect_closure1,t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"))),O.push("_is_rollup"),c.push("SELECT "+u.JSArray_methods.join$1(O,",")+" FROM sorted_limit_table"),c.length!==0&&(n=n+" "+u.JSArray_methods.join$1(c," UNION ALL ")),O=M._getSqlSelectSorts$1(r),M._transformSqlAlias$2(t.stringReplaceAllUnchecked(n+O,"@TIMEZONE","'"+M.timezone+"'"),e.aliases)},_transformSqlAlias$2(r,e){return e.length===0?r:t.stringReplaceAllFuncUnchecked(r,t.RegExp_RegExp(new t.MappedListIterable(e,t.core_RegExp_escape$closure(),t._arrayInstanceType(e)._eval$1("MappedListIterable<1,String>")).join$1(0,"|"),!1),new t.QueryRequest__transformSqlAlias_closure,null)},_getSourceTable$1$schemaLibrary(r){var e=this,n=r.getSchema$1(e.schemaName),a=e._getPlainSqlColumns$1(r),i=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"),s=new t.MappedListIterable(a,new t.QueryRequest__getSourceTable_closure,i).join$1(0,","),l=n.get$fullMaterializedTableName(),p=t.ReCase$(n.name._name)._getCamelCase$0(),c=e._getSqlJoins$1(r),M=e._getSqlFilters$1(r),b=e._getPlainSqlSorts$1(r),O=t._setArrayType([],d.JSArray_String);return new t._GetSourceTableResponse("SELECT "+new t.MappedListIterable(a,new t.QueryRequest__getSourceTable_closure0(O),i).join$1(0,",")+" FROM ("+("SELECT "+s+" FROM `"+l+"` AS "+p+c+M+b)+")",O)},_getFillGapTable$2$schemaLibrary$sourceTableName(r,e){var n,a,i,s,l,p,c,M,b,O,D,$=this,E=" CROSS JOIN ",g=d.JSArray_String,h=t._setArrayType([],g),R=$._getTimeFilters$1(r.getSchema$1($.schemaName));for(n=$.dimensions,a=o.getInterceptor$ax(n),i=a.get$iterator(n),s=$.timeDimension!=null,l=$.timezone;i.moveNext$0();)p=i.get$current(),c=p.getColumn$1(r),p.fillGap&&c.dataType===u.DATA_TYPE_1&&s&&(M=p.generateTimestampArraySql$2$timeFilters$timezone(R,l),c=p.option,c.toString,h.push("SELECT "+t.DimensionOptionExtension_formatSql(c,t.uniqueAlias(p.get$alias()),l)+" "+t.uniqueAlias(p.get$alias())+" FROM "+t.S(M)+" "+t.uniqueAlias(p.get$alias())+" GROUP BY "+t.uniqueAlias(p.get$alias())));return i=d.String,b=t.ListExtensions_mapIndexed(h,new t.QueryRequest__getFillGapTable_closure,i,i).join$1(0,E),i=t.List_List$of(a.map$1$1(n,new t.QueryRequest__getFillGapTable_closure0,i),!0,i),u.JSArray_methods.addAll$1(i,o.fold$2$ax($.metrics,t._setArrayType([],g),new t.QueryRequest__getFillGapTable_closure1($,r))),s=$.sorts,u.JSArray_methods.addAll$1(i,new t.MappedListIterable(s,new t.QueryRequest__getFillGapTable_closure2($,r),t._arrayInstanceType(s)._eval$1("MappedListIterable<1,String>"))),O=t._setArrayType(["SELECT "+u.JSArray_methods.join$1(i,",")+" FROM ("+b+")"],g),D=a.where$1(n,new t.QueryRequest__getFillGapTable_closure3),D.get$isEmpty(D)||O.push("(SELECT DISTINCT "+new t.MappedIterable(D,new t.QueryRequest__getFillGapTable_closure4,D.$ti._eval$1("MappedIterable<1,String>")).join$1(0,",")+" FROM "+e+")"),u.JSArray_methods.join$1(O,E)},_getFullTable$3$fillGapTableName$schemaLibrary$sourceTableName(r,e,n){var a,i="fill_gap_table",s=this.dimensions,l=d.String,p=o.getInterceptor$ax(s),c=t.List_List$of(p.map$1$1(s,new t.QueryRequest__getFullTable_closure(i,n),l),!0,l);return u.JSArray_methods.addAll$1(c,o.fold$2$ax(this.metrics,t._setArrayType([],d.JSArray_String),new t.QueryRequest__getFullTable_closure0(n,i))),a=this.sorts,u.JSArray_methods.addAll$1(c,new t.MappedListIterable(a,new t.QueryRequest__getFullTable_closure1(n,i),t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>"))),"SELECT "+u.JSArray_methods.join$1(c,",")+" FROM fill_gap_table LEFT JOIN "+n+" ON "+p.map$1$1(s,new t.QueryRequest__getFullTable_closure2(i,n),l).join$1(0," AND ")}},t.QueryRequest_closure.prototype={call$2(r,e){var n=o.getInterceptor$ax(r),a=n.map$1$1(r,new t.QueryRequest__closure0,d.String).toSet$0(0);return u.JSArray_methods.contains$1(t.List_List$of(a,!0,t._instanceType(a)._precomputed1),t.uniqueAlias(e.get$alias()))||n.add$1(r,e),r},$signature:75},t.QueryRequest__closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_closure0.prototype={call$2(r,e){var n=o.getInterceptor$ax(r),a=n.map$1$1(r,new t.QueryRequest__closure,d.String).toSet$0(0);return u.JSArray_methods.contains$1(t.List_List$of(a,!0,t._instanceType(a)._precomputed1),t.uniqueAlias(e.get$alias()))||n.add$1(r,e),r},$signature:57},t.QueryRequest__closure.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:18},t.QueryRequest__getJoins_closure.prototype={call$1(r){return o.firstWhere$1$ax(this.schemaLibrary.getSchema$1(this.$this.schemaName).joins,new t.QueryRequest__getJoins__closure(r))},$signature:54},t.QueryRequest__getJoins__closure.prototype={call$1(r){return r.joinSchemaName===this.joinSchemaName},$signature:52},t.QueryRequest_fromJson_closure.prototype={call$1(r){return t.QueryRequestDimension_fromJson(r)},$signature:19},t.QueryRequest_fromJson_closure0.prototype={call$1(r){return t.QueryRequestMetric_fromJson(r)},$signature:28},t.QueryRequest_fromJson_closure1.prototype={call$1(r){return t.EnumByName_byName(u.List_r5g,r)},$signature:49},t.QueryRequest_fromJson_closure2.prototype={call$1(r){return t.QueryRequestFilter_fromJson(r)},$signature:16},t.QueryRequest_fromJson_closure3.prototype={call$1(r){return t.QueryRequestSort_fromJson(r)},$signature:48},t.QueryRequest_fromJson_closure4.prototype={call$1(r){return t.JoinDatasourceCondition_JoinDatasourceCondition$fromJson(r)},$signature:53},t.QueryRequest_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:47},t.QueryRequest_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:26},t.QueryRequest_toJson_closure1.prototype={call$1(r){return r._name},$signature:13},t.QueryRequest_toJson_closure2.prototype={call$1(r){return r.toJson$0()},$signature:17},t.QueryRequest_toJson_closure3.prototype={call$1(r){return r.toJson$0()},$signature:45},t.QueryRequest_toJson_closure4.prototype={call$1(r){return r.toJson$0()},$signature:44},t.QueryRequest_getColumns_closure.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:59},t.QueryRequest_getColumns_closure0.prototype={call$1(r){return r.getColumn$1(this.schemaLibrary)},$signature:120},t.QueryRequest__getPlainSqlColumns_closure.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=t.uniqueAlias(r.get$alias()),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$alias(),a)},$signature:61},t.QueryRequest__getPlainSqlColumns_closure0.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=t.uniqueAlias(r.get$alias()),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$alias(),a)},$signature:62},t.QueryRequest__getPlainSqlColumns_closure1.prototype={call$1(r){var e=r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone),n=r.get$id(r),a=r.dataFormula;return new t._PlainSqlColumn(e,n,r.get$id(r),a)},$signature:63},t.QueryRequest__getPlainSqlColumns_closure2.prototype={call$2(r,e){var n,a=e.aggregation;return u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),a)&&(a=this.schemaLibrary,n=t.IterableExtension_firstWhereOrNull(a.getSchema$1(e.schemaName).fields,new t.QueryRequest__getPlainSqlColumns__closure),n!=null&&o.add$1$ax(r,new t._PlainSqlColumn(n.getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(null,null,a,this.$this.timezone),t.uniqueAlias(e.get$alias())+"_sort",t.uniqueAlias(e.get$alias())+"_sort",null))),r},$signature:64},t.QueryRequest__getPlainSqlColumns__closure.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getPlainSqlSorts_closure.prototype={call$1(r){return r.getPlainSql$2$schemaLibrary$timezone(this.schemaLibrary,this.$this.timezone)+" "+r.type._name},$signature:9},t.QueryRequest__getSqlFilters_closure.prototype={call$1(r){var e=this.$this,n=r.field;return new t.QueryRequestFilter(u.COMPARISON_OPERATOR_0,null,null,null,new t.QueryRequest__getSqlFilters__closure(e,r).call$0(),e.schemaName,n)},$signature:66},t.QueryRequest__getSqlFilters__closure.prototype={call$0(){var r=this,e=d.JSArray_String,n=t._setArrayType([],e);switch(r.permission.type.index){case 0:n=r.$this.restaurantIds;break;case 1:n=r.$this.warehouseIds;break;case 2:n=r.$this.businessIds;break}return o.get$isEmpty$asx(n)?t._setArrayType(["_"],e):n},$signature:67},t.QueryRequest__getSqlFilters_closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone)},$signature:68},t.QueryRequest__getSqlFilters_closure1.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure2.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure3.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlFilters_closure4.prototype={call$1(r){return"("+r+")"},$signature:3},t.QueryRequest__getSqlJoins_closure.prototype={call$2(r,e){var n,a,i,s,l,p;return r!==""&&(r+=" "),n=this.schemaLibrary,a=n.getSchema$1(e.joinSchemaName),i=t._setArrayType([e.getConditionsSql$1(n)],d.JSArray_String),a.topLevelFilters.timeControl!=null&&(s=t.List_List$of(i,!0,d.String),l=this.$this,p=l._getTimeFilters$1(a),u.JSArray_methods.addAll$1(s,new t.MappedListIterable(p,new t.QueryRequest__getSqlJoins__closure(l,n),t._arrayInstanceType(p)._eval$1("MappedListIterable<1,String>"))),i=s),s=t.List_List$of(i,!0,d.String),l=a.filters,u.JSArray_methods.addAll$1(s,new t.MappedListIterable(l,new t.QueryRequest__getSqlJoins__closure0(this.$this,n),t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>")))," "+(r+"left join `"+a.get$fullMaterializedTableName()+"` as "+t.ReCase$(a.name._name)._getCamelCase$0()+" on "+u.JSArray_methods.join$1(s," and "))},$signature:70},t.QueryRequest__getSqlJoins__closure.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getSqlJoins__closure0.prototype={call$1(r){return r.toComparison$2$timezone(this.schemaLibrary,this.$this.timezone).getSql$0()},$signature:11},t.QueryRequest__getRollupSelect_closure.prototype={call$2(r,e){var n=this.rollupIndex;return!(n!=null&&r>=n)},$signature:119},t.QueryRequest__getRollupSelect_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure1.prototype={call$2(r,e){var n=this;return e.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(null,t.uniqueAlias(e.get$alias()),r,!1,n.partitions,n.rollupIndex,n.schemaLibrary,n.$this.sorts)},$signature:72},t.QueryRequest__getRollupSelect_closure2.prototype={call$3(r,e,n){var a=this,i=t.uniqueAlias(n.get$alias());return o.add$1$ax(e,n.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(n.aggregation,i,r,!1,a.partitions,a.rollupIndex,a.schemaLibrary,a.$this.sorts)),e},$signature:73},t.QueryRequest__getRollupSelect_closure3.prototype={call$1(r){var e=this,n=r.get$id(r);return r.getAggregatedSql$8$aggregation$id$index$isSort$partitions$rollupIndex$schemaLibrary$sorts(r.aggregation,n,9999,!0,e.partitions,e.rollupIndex,e.schemaLibrary,e.$this.sorts)},$signature:9},t.QueryRequest__getRollupSelect_closure4.prototype={call$1(r){var e;return this.useFormula?(e=r.displayFormula,e==null&&(e=t.uniqueAlias(r.get$alias()))):e=t.uniqueAlias(r.get$alias()),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure5.prototype={call$2(r,e){var n,a;return this.useFormula?(n=e.displayFormula,n==null&&(n=t.uniqueAlias(e.get$alias()))):n=t.uniqueAlias(e.get$alias()),a=o.getInterceptor$ax(r),a.add$1(r,"ANY_VALUE("+n+") "+t.uniqueAlias(e.get$alias())),n=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),n)&&!this.isRollup&&a.add$1(r,"ANY_VALUE("+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:20},t.QueryRequest__getRollupSelect_closure6.prototype={call$1(r){return r.aggregation!=null?"ANY_VALUE("+r.get$id(r)+") "+r.get$id(r):r.get$id(r)},$signature:9},t.QueryRequest__getRollupSelect_closure7.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getRollupSelect_closure8.prototype={call$1(r){return r.aggregation==null},$signature:43},t.QueryRequest__getRollupSelect_closure9.prototype={call$1(r){return r.get$id(r)},$signature:9},t.QueryRequest__hasFillGap_closure.prototype={call$1(r){return r.fillGap},$signature:6},t.QueryRequest__getSqlSelectSorts_closure.prototype={call$1(r){var e=this.$this,n=t.IterableExtension_firstWhereOrNull(e.sorts,new t.QueryRequest__getSqlSelectSorts__closure(r)),a=r.schemaName,i=r.name,s=n==null?null:n.type;return s==null&&(s=u.SORT_TYPE_0),i=new t.QueryRequestSort(s,null,r.option,r.dataFormula,a,i).getSortSql$2$id$schemaLibrary(t.uniqueAlias(r.get$alias()),this.schemaLibrary),new t.MappedListIterable(i,new t.QueryRequest__getSqlSelectSorts__closure0(e),t._arrayInstanceType(i)._eval$1("MappedListIterable<1,String>")).join$1(0,",")},$signature:5},t.QueryRequest__getSqlSelectSorts__closure.prototype={call$1(r){var e=this.dimension;return r.schemaName===e.schemaName&&r.name===e.name&&r.dimensionOption==e.option},$signature:43},t.QueryRequest__getSqlSelectSorts__closure0.prototype={call$1(r){var e=this.$this.rollupPosition==="BOTTOM"?"LAST":"FIRST";return r+" NULLS "+e},$signature:3},t.QueryRequest__getSqlSelectSorts_closure0.prototype={call$2(r,e){var n=t.List_List$of(r,!0,d.String);return u.JSArray_methods.addAll$1(n,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),n},$signature:41},t.QueryRequest__getSortedLimitTable_closure.prototype={call$2(r,e){var n=t.List_List$of(r,!0,d.String);return u.JSArray_methods.addAll$1(n,e.getSortSql$1$schemaLibrary(this.schemaLibrary)),n},$signature:41},t.QueryRequest_getSqlSelect_closure.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest_getSqlSelect_closure0.prototype={call$1(r){var e=r.displayFormula;return e==null&&(e=t.uniqueAlias(r.get$alias())),e+" "+t.uniqueAlias(r.get$alias())},$signature:18},t.QueryRequest_getSqlSelect_closure1.prototype={call$1(r){return r.get$id(r)},$signature:9},t.QueryRequest__transformSqlAlias_closure.prototype={call$1(r){var e=r.$index(0,0);return e.toString,t.uniqueAlias(e)},$signature:15},t.QueryRequest__getSourceTable_closure.prototype={call$1(r){return r.field+" "+r.id},$signature:39},t.QueryRequest__getSourceTable_closure0.prototype={call$1(r){var e,n;return this.aliases.push(r.alias),e=r.formula,n=r.id,e!=null?e+" "+n:n},$signature:39},t.QueryRequest__getFillGapTable_closure.prototype={call$2(r,e){return r>0?"("+e+")":e},$signature:79},t.QueryRequest__getFillGapTable_closure0.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFillGapTable_closure1.prototype={call$2(r,e){var n,a,i,s=this.schemaLibrary,l=t.IterableExtension_firstWhereOrNull(s.getSchema$1(this.$this.schemaName).fields,new t.QueryRequest__getFillGapTable__closure1(e));return l!=null&&(n=o.getInterceptor$ax(r),n.add$1(r,t.DataTypeExtension_get_defaultSql(l.type)+" "+t.uniqueAlias(e.get$alias())),a=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),a)&&(i=t.IterableExtension_firstWhereOrNull(s.getSchema$1(e.schemaName).fields,new t.QueryRequest__getFillGapTable__closure2),i!=null&&n.add$1(r,t.DataTypeExtension_get_defaultSql(i.type)+" "+t.uniqueAlias(e.get$alias())+"_sort"))),r},$signature:20},t.QueryRequest__getFillGapTable__closure1.prototype={call$1(r){return r.name===this.metric.name},$signature:2},t.QueryRequest__getFillGapTable__closure2.prototype={call$1(r){return r.name==="createdAt"},$signature:2},t.QueryRequest__getFillGapTable_closure2.prototype={call$1(r){var e,n=t.IterableExtension_firstWhereOrNull(this.$this.dimensions,new t.QueryRequest__getFillGapTable__closure(r)),a=t.IterableExtension_firstWhereOrNull(this.schemaLibrary.getSchema$1(r.schemaName).fields,new t.QueryRequest__getFillGapTable__closure0(r));return n!=null?e=t.uniqueAlias(n.get$alias()):e=t.S(a==null?null:t.DataTypeExtension_get_defaultSql(a.type)),e+" "+r.get$id(r)},$signature:9},t.QueryRequest__getFillGapTable__closure.prototype={call$1(r){var e=this.sort;return r.schemaName===e.schemaName&&r.name===e.name&&r.option==e.dimensionOption},$signature:6},t.QueryRequest__getFillGapTable__closure0.prototype={call$1(r){return r.name===this.sort.name},$signature:2},t.QueryRequest__getFillGapTable_closure3.prototype={call$1(r){return!r.fillGap},$signature:6},t.QueryRequest__getFillGapTable_closure4.prototype={call$1(r){return t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure.prototype={call$1(r){var e=this.fillGapTableName;return r.fillGap?e+"."+t.uniqueAlias(r.get$alias()):"IFNULL("+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())+","+e+"."+t.uniqueAlias(r.get$alias())+") "+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequest__getFullTable_closure0.prototype={call$2(r,e){var n,a="IFNULL("+this.sourceTableName+".",i=this.fillGapTableName,s=o.getInterceptor$ax(r);return s.add$1(r,a+t.uniqueAlias(e.get$alias())+","+i+"."+t.uniqueAlias(e.get$alias())+") "+t.uniqueAlias(e.get$alias())),n=e.aggregation,u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_4,u.AGGREGATION_TYPE_5],d.JSArray_AGGREGATION_TYPE),n)&&s.add$1(r,a+t.uniqueAlias(e.get$alias())+"_sort,"+i+"."+t.uniqueAlias(e.get$alias())+"_sort) "+t.uniqueAlias(e.get$alias())+"_sort"),r},$signature:20},t.QueryRequest__getFullTable_closure1.prototype={call$1(r){return"IFNULL("+this.sourceTableName+"."+r.get$id(r)+","+this.fillGapTableName+"."+r.get$id(r)+") "+r.get$id(r)},$signature:9},t.QueryRequest__getFullTable_closure2.prototype={call$1(r){return this.fillGapTableName+"."+t.uniqueAlias(r.get$alias())+"="+this.sourceTableName+"."+t.uniqueAlias(r.get$alias())},$signature:5},t.QueryRequestSort.prototype={toJson$0(){var r,e=this,n=e.aggregation;return n=n==null?null:n._name,r=e.dimensionOption,r=r==null?null:r._name,t.LinkedHashMap_LinkedHashMap$_literal(["schemaName",e.schemaName._name,"name",e.name,"type",e.type._name,"aggregation",n,"dimensionOption",r,"dataFormula",e.dataFormula],d.String,d.dynamic)},get$id(r){var e=this,n=e.name.toLowerCase(),a=e.dimensionOption;return a!=null?n=n+"_"+a._name.toLowerCase():(a=e.aggregation,a!=null&&(n=n+"_"+a._name.toLowerCase())),e.schemaName._name.toLowerCase()+"_"+n+"_"+e.type._name.toLowerCase()},getPlainSql$2$schemaLibrary$timezone(r,e){var n=this;return o.firstWhere$1$ax(r.getSchema$1(n.schemaName).fields,new t.QueryRequestSort_getPlainSql_closure(n)).getQueryPlainSql$4$aggregation$option$schemaLibrary$timezone(n.aggregation,n.dimensionOption,r,e)},getSortSql$2$id$schemaLibrary(r,e){var n,a=this,i=e.getSchema$1(a.schemaName),s=o.firstWhere$1$ax(i.fields,new t.QueryRequestSort_getSortSql_closure(a)),l=t._setArrayType([],d.JSArray_String),p=r??a.get$id(a);return u.JSArray_methods.contains$1(t._setArrayType([u.AGGREGATION_TYPE_2,u.AGGREGATION_TYPE_3],d.JSArray_AGGREGATION_TYPE),a.aggregation)||(n=s.type,n===u.DATA_TYPE_1?l.push("LENGTH("+p+") "+a.type._name):n===u.DATA_TYPE_0&&(n=i._materializeTablePrefix,l.push("`"+(n!==""?n+".":"")+"stringToSortableNumber`("+p+") "+a.type._name))),l.push(p+" "+a.type._name),l},getSortSql$1$schemaLibrary(r){return this.getSortSql$2$id$schemaLibrary(null,r)}},t.QueryRequestSort_getPlainSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestSort_getSortSql_closure.prototype={call$1(r){return r.name===this.$this.name},$signature:2},t.QueryRequestTimeDimension.prototype={toJson$0(){var r=this;return t.LinkedHashMap_LinkedHashMap$_literal(["start",r.start,"end",r.end,"timeStart",r.timeStart,"timeEnd",r.timeEnd],d.String,d.dynamic)}},t.FIELD_TYPE.prototype={_enumToString$0(){return"FIELD_TYPE."+this._name}},t.QueryResponseColumn.prototype={toJson$0(){var r,e,n,a=this,i=null,s=a.aggregationType;return s=s==null?i:s._name,r=a.optionType,r=r==null?i:r._name,e=a.timeFormatter,e=e==null?i:e._name,n=a.formatter,n=n==null?i:n._name,t.LinkedHashMap_LinkedHashMap$_literal(["id",a.id,"schema",a.schema._name,"label",a.label,"dataType",a.dataType._name,"fieldType",a.fieldType._name,"aggregationType",s,"optionType",r,"decimal",a.decimal,"timeFormatter",e,"formatter",n,"nullable",a.nullable,"hide",a.hide,"dateComparison",a.dateComparison],d.String,d.dynamic)}},t.DateTimeRange.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["start",this.start,"end",this.end],d.String,d.dynamic)}},t.QueryResponse.prototype={QueryResponse$map$4$columns$dateRange$rows$timeRange(r,e,n,a){var i,s,l,p,c=t.LinkedHashMap_LinkedHashMap$_empty(d.String,d.QueryResponseColumn);for(i=this.columns,s=i.length,l=0;l<i.length;i.length===s||(0,t.throwConcurrentModificationError)(i),++l)p=i[l],c.$indexSet(0,p.id,p);this.rows=o.map$1$1$ax(n,new t.QueryResponse$map_closure(c),d.QueryResponseRow).toList$0(0)},toJson$0(){var r,e=this,n=e.columns,a=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>");return a=t.List_List$of(new t.MappedListIterable(n,new t.QueryResponse_toJson_closure,a),!0,a._eval$1("ListIterable.E")),n=e.rows,r=t._arrayInstanceType(n)._eval$1("MappedListIterable<1,Map<String,@>>"),t.LinkedHashMap_LinkedHashMap$_literal(["columns",a,"rows",t.List_List$of(new t.MappedListIterable(n,new t.QueryResponse_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),"dateRange",e.dateRange.toJson$0(),"timeRange",e.timeRange.toJson$0()],d.String,d.dynamic)}},t.QueryResponse$map_closure.prototype={call$1(r){var e,n,a,i,s,l,p,c=r.$index(0,"_is_rollup");for(c==null&&(c=!1),e=t.LinkedHashMap_LinkedHashMap$_empty(d.String,d.dynamic),n=r.get$entries(r),n=n.get$iterator(n),a=this.columnMap;n.moveNext$0();)i=n.get$current(),s=i.key,l=i.value,!u.JSString_methods.endsWith$1(s,"_GROUP")&&(p=a.$index(0,s),e.$indexSet(0,s,p!=null&&p.fieldType===u.FIELD_TYPE_1?t.DataTypeExtension_toData(p.dataType,l,p.nullable):l));return new t.QueryResponseRow(c,e)},$signature:100},t.QueryResponse_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:81},t.QueryResponse_toJson_closure0.prototype={call$1(r){return r.toJson$0()},$signature:82},t.QueryResponseRow.prototype={toJson$0(){return t.LinkedHashMap_LinkedHashMap$_literal(["isRollup",this.isRollup,"value",this.value],d.String,d.dynamic)}},t.VisualizationSchema.prototype={VisualizationSchema$5$fields$isJoinOnly$joins$label$name(r,e,n,a,i){u.JSArray_methods.sort$1(this.fields,new t.VisualizationSchema_closure)},toJson$0(){var r=this,e=r.fields,n=t._arrayInstanceType(e)._eval$1("MappedListIterable<1,Map<String,@>>"),a=r.joins,i=t._arrayInstanceType(a)._eval$1("MappedListIterable<1,String>");return t.LinkedHashMap_LinkedHashMap$_literal(["name",r.name._name,"label",r.label,"fields",t.List_List$of(new t.MappedListIterable(e,new t.VisualizationSchema_toJson_closure,n),!0,n._eval$1("ListIterable.E")),"joins",t.List_List$of(new t.MappedListIterable(a,new t.VisualizationSchema_toJson_closure0,i),!0,i._eval$1("ListIterable.E")),"isJoinOnly",r.isJoinOnly],d.String,d.dynamic)}},t.VisualizationSchema_closure.prototype={call$2(r,e){return u.JSInt_methods.compareTo$1(r.type.index,e.type.index)},$signature:83},t.VisualizationSchema_toJson_closure.prototype={call$1(r){return r.toJson$0()},$signature:84},t.VisualizationSchema_toJson_closure0.prototype={call$1(r){return r._name},$signature:13},t.VisualizationField.prototype={get$filterDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_filterDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$fillGapDimensionOptions(){var r=this.dimensionOptions,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_fillGapDimensionOptions_closure,e),!0,e._eval$1("Iterable.E"))},get$isNumericAggregations(){var r=this.aggregations,e=t._arrayInstanceType(r)._eval$1("WhereIterable<1>");return t.List_List$of(new t.WhereIterable(r,new t.VisualizationField_isNumericAggregations_closure,e),!0,e._eval$1("Iterable.E"))},get$joinConditionOperators(){switch(this.type.index){case 2:case 0:case 3:return t._setArrayType([u.COMPARISON_OPERATOR_0],d.JSArray_COMPARISON_OPERATOR);case 1:return t._setArrayType([u.COMPARISON_OPERATOR_0,u.COMPARISON_OPERATOR_6],d.JSArray_COMPARISON_OPERATOR)}},toJson$0(){var r,e,n,a,i,s,l,p,c,M=this,b=M.type,O=M.filterOperators,D=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>");return D=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure,D),!0,D._eval$1("ListIterable.E")),O=M.dimensionOptions,r=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),r=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure0,r),!0,r._eval$1("ListIterable.E")),O=M.aggregations,e=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),e=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure1,e),!0,e._eval$1("ListIterable.E")),O=M.get$filterDimensionOptions(),n=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),n=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure2,n),!0,n._eval$1("ListIterable.E")),O=M.get$fillGapDimensionOptions(),a=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),a=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure3,a),!0,a._eval$1("ListIterable.E")),O=M.get$isNumericAggregations(),i=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),i=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure4,i),!0,i._eval$1("ListIterable.E")),O=d.JSArray_DATA_TYPE,s=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b),l=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b)||M.get$isNumericAggregations().length!==0?u.List_cWd:t._setArrayType([],d.JSArray_TIME_FORMATTER),p=t._arrayInstanceType(l)._eval$1("MappedListIterable<1,String>"),p=t.List_List$of(new t.MappedListIterable(l,new t.VisualizationField_toJson_closure5,p),!0,p._eval$1("ListIterable.E")),O=u.JSArray_methods.contains$1(t._setArrayType([u.DATA_TYPE_3],O),b)||M.get$isNumericAggregations().length!==0?u.List_IoM:t._setArrayType([],d.JSArray_FORMATTER_TYPE),l=t._arrayInstanceType(O)._eval$1("MappedListIterable<1,String>"),l=t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure6,l),!0,l._eval$1("ListIterable.E")),O=M.get$joinConditionOperators(),c=t.instanceType(O)._eval$1("MappedListIterable<1,String>"),t.LinkedHashMap_LinkedHashMap$_literal(["name",M.name,"type",b._name,"label",M.label,"schemaName",M.schemaName._name,"filterOperators",D,"dimensionOptions",r,"aggregations",e,"filterDimensionOptions",n,"fillGapDimensionOptions",a,"isNumericAggregations",i,"isNumericType",s,"timeFormatters",p,"formatters",l,"joinConditionOperators",t.List_List$of(new t.MappedListIterable(O,new t.VisualizationField_toJson_closure7,c),!0,c._eval$1("ListIterable.E"))],d.String,d.dynamic)},$eq(r,e){return e==null?!1:e instanceof t.VisualizationField&&this.name===e.name&&this.schemaName===e.schemaName},get$hashCode(r){return u.JSString_methods.get$hashCode(this.name)+t.Primitives_objectHashCode(this.schemaName)}},t.VisualizationField_filterDimensionOptions_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__filterDimensionOptions,r)},$signature:38},t.VisualizationField_fillGapDimensionOptions_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__fillGapDimensionOptions,r)},$signature:38},t.VisualizationField_isNumericAggregations_closure.prototype={call$1(r){return u.JSArray_methods.contains$1(q.VisualizationField__isNumericAggregations,r)},$signature:86},t.VisualizationField_toJson_closure.prototype={call$1(r){return r._name},$signature:24},t.VisualizationField_toJson_closure0.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure1.prototype={call$1(r){return r._name},$signature:36},t.VisualizationField_toJson_closure2.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure3.prototype={call$1(r){return r._name},$signature:21},t.VisualizationField_toJson_closure4.prototype={call$1(r){return r._name},$signature:36},t.VisualizationField_toJson_closure5.prototype={call$1(r){return r._name},$signature:90},t.VisualizationField_toJson_closure6.prototype={call$1(r){return r._name},$signature:91},t.VisualizationField_toJson_closure7.prototype={call$1(r){return r._name},$signature:24},t.addonFlattenItemSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt",e,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Status","status",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Name","name",e,e,e,r),t.Field_Field$string(e,` IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), ' ', @categoryName)
|
|
90
90
|
`,!1,e,!1,!1,"Category","categoryName",e,` CASE WHEN @category_name IS NULL OR @produc_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN ' ' ELSE @category_name) END
|
|
91
91
|
`,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Code","code",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Variant","variantName",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Parent ID","parentId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,"SPLIT(@addonId, '/')[OFFSET(0)]",!1,e,!1,!1,"Group ID","groupId",e,"SPLIT_PART(@addon_id, '/',1)",u.FIELD_ROLE_5,r)],d.JSArray_Field)},$signature:0},t.addonFlattenItemSchema_closure0.prototype={call$1(r){return t._setArrayType([],d.JSArray_Join)},$signature:1},t.adjustmentSchema_closure.prototype={call$1(r){var e=null,n="billCompletedAt",a="isRefund",i="quantity",s="returnId",l="referenceId",p="effectId";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,e,"id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!0,e,!1,"Bill time","adjustmentCreatedAt",e,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Bill close time",n,n,e,u.FIELD_ROLE_0,r),t.Field_Field$bool(e,e,!1,e,!1,"Refund",a,a,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId","billId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Item ID","itemId","itemId",e,u.FIELD_ROLE_5,r),t.Field_Field$string("discount amount or percentage. eg, -10%, -5.",e,!1,e,!1,!1,"Name","name","name",e,e,r),t.Field_Field$string(T.discout,e,!1,e,!1,!1,"Cause","cause","cause",e,e,r),t.Field_Field$string(T.discoun,e,!1,e,!1,!1,"Reason","reason","reason",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount user","createdByName","createdBy.name",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"createdById","createdBy.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount approver","approvedByName","createApprovedBy.name",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"approvedById","createApprovedBy.id",e,e,r),t.Field_Field$numeric(e,"IFNULL(@quantity,0)*IF(@isRefund, -1, 1)",!1,e,!1,"Qty",i,i,"COALESCE(@quantity,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IFNULL((@quantity*@total),0)*IF(@isRefund, -1, 1)",!1,e,!1,"Total","total","total","COALESCE((@quantity*@total),0)*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Return ID",s,s,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Ref ID",l,l,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Effect ID",p,p,e,u.FIELD_ROLE_5,r),t.Field_Field$string("Adjusted item name, or 'BILL' for bill-level discounts",e,!1,e,!1,!1,"Target","target",e,"coalesce((select name from flatten_items where flatten_items.id=@item_id and flatten_items.bill_id=@bill_id and flatten_items.restaurant_id=@restaurant_id), 'BILL')",e,r)],d.JSArray_Field)},$signature:0},t.adjustmentSchema_closure0.prototype={call$1(r){var e=null,n="restaurantId",a=d.JSArray_String,i=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["itemId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_66,t._setArrayType([new t.JoinCondition("refId",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("billId",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e)],d.JSArray_Join)},$signature:1},t.billSchema_closure.prototype={call$1(r){var e=null,n="seqNumber",a="deliveryName",i="isRefund",s="isPickup",l="isInHouseDelivery",p="isDelivery",c="completedAt",M="integratedOrderId",b="itemCount",O="taxTotal",D="discountTotal",$="grossTotal",E="rounding",g="takeawayPrice",h="thirdPartyExtraCharge",R="deliveryFee",L="nettTotal",W="deliveryFeeWithTax",B="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",w="discountInclusiveTaxTotal",v="customerName",X="customerPhone",K="customerAddress",M0="customerRemark",A0="fulfillmentAt",z0="(CASE WHEN @refund_from IS NULL THEN NULL ELSE (SELECT ",E0=" FROM bills ob WHERE ob.id=@refund_from AND ob.restaurant_id=@restaurant_id)-COALESCE((SELECT SUM(";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string("Values: COMPLETED, DRAFT, VOIDED, REFUNDED",e,!1,e,!1,!1,"Status","status","status",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"No.",n,n,e,e,r),t.Field_Field$string("Dine-in table name/identifier",e,!1,e,!1,!1,"Table","slot","slot",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Delivery",a,a,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund ID","refundFrom","refundedFrom",e,e,r),t.Field_Field$bool(e,e,!1,e,!1,"Refund",i,i,e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"refundedById","refund.by.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund user","refundedByName","refund.by.name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund reason","refundReason","refund.reason",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member ID","memberId","membership.id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member user ID","memberUserId","membership.userId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member name","memberUserName","membership.name",e,u.FIELD_ROLE_4,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Member birthday","memberBirthday","membership.birthday",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$string("Sales channel. FEEDME is FeedMe's own POS and online ordering (raw ''/POS normalize to it) and is never a delivery platform; a third-party delivery platform passes through under its own name and shows in the sampled values only when the business uses one — no such value sampled means no delivery-platform rows.",e,!1,e,!1,!1,"Source","source","source",T.x28case_x28,e,r),t.Field_Field$string("Order type. PICKUP/DELIVERY/DRIVE THRU/KIOSK/TAKEAWAY are normalized; any other POS-configured value passes through raw — filter with the sampled values, never a guessed label. COUNTER is a dine-in order taken at the counter: a 'Dine-in' choice maps to it.",e,!1,e,!1,!1,"Type","type","type","(case when upper(@type) in ('PICKUP','DELIVERY','DRIVE THRU','KIOSK') then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",e,r),t.Field_Field$bool(e,e,!0,e,!1,"Pickup",s,s,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is in house delivery",l,l,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is other delivery",p,p,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is takeaway","isTakeaway","is.takeaway",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Closed at",c,c,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,e,r),t.Field_Field$numeric("Number of guests. Negated for refund, 0 for voided","IF(@status = 'VOIDED', 0, IFNULL(@pax,0)*IF(@isRefund, -1, 1))",!1,e,!1,"Pax","pax","person","(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (COALESCE(@pax,0)*CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Integrated order ID",M,M,e,u.FIELD_ROLE_5,r),t.Field_Field$numeric(e,T.IFNULLi,!0,e,!1,"Item count",b,b,T.COALESi,e,r),t.Field_Field$numeric(e,T.IFNULLtax,!1,e,!1,"Tax",O,O,T.COALEStax_,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Discount given on the bill, refund sign applied — the discount measure. adjustment is a different grain: it holds a row per discount, bill-level (target = 'BILL') and item-level alike, so summing those per bill counts a bill's discount twice.",T.IFNULLdiT,!1,e,!1,"Discount",D,D,T.COALESdit,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLg,!1,e,!1,"Item gross",$,$,T.COALESg,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-IFNULL(@discountTotal,0)-IFNULL(@thirdPartyExtraCharge,0)-IFNULL(@deliveryFee,0)-IFNULL(@taxTotal,IFNULL(@sstTotal, 0))-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Bill gross","billGrossTotal",e,"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-COALESCE(@discount_total,0)-COALESCE(@third_party_extra_charge,0)-COALESCE(@delivery_fee,0)-COALESCE(@tax_total,@sst_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,e,!1,"Rounding",E,E,T.COALESr,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,e,!1,"SST","sstTotal","nettTaxes.SST.total",T.COALESss,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,e,r),t.Field_Field$numeric(e,T.IFNULLs,!1,e,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",T.COALESse,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,e,r),t.Field_Field$numeric(e,T.x28IFNULo,!1,e,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",T.x28COALEo,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.x28IFNULgx2d,!1,e,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,T.x28COALEgx2d,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLtak,!1,e,!1,"Takeaway",g,g,T.COALEStak,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLth,!1,e,!1,"Extra charge",h,h,T.COALESth,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLde_,!1,e,!1,"Delivery fee",R,R,T.COALESdex2c,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Revenue after discounts and before taxes — the default sales measure.",T.IFNULLn,!1,e,!1,"Nett",L,L,T.COALESn,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@grossTotal,0)+(case when @deliveryFeeWithTax>0 then IFNULL(@deliveryFee,0) else 0 end)+IFNULL(case when @otherChargeWithTax>0 then IFNULL(@thirdPartyExtraCharge,0) else 0 end)+IFNULL(@discountTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Item gross before charges","grossBeforeCharges",e,"(COALESCE(@gross_total,0)+(case when @delivery_fee_with_tax>0 then COALESCE(@delivery_fee,0) else 0 end)+(case when @other_charge_with_tax>0 then COALESCE(@third_party_extra_charge,0) else 0 end)+COALESCE(@discount_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-(case when @otherChargeWithTax>0 then 0 else IFNULL(@thirdPartyExtraCharge,0) end)-(case when @deliveryFeeWithTax>0 then 0 else IFNULL(@deliveryFee,0) end)-IFNULL(@taxTotal,IFNULL(@sstTotal,0))-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Bill gross before charges","billGrossBeforeCharges",e,"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-(case when @other_charge_with_tax>0 then 0 else COALESCE(@third_party_extra_charge,0) end)-(case when @delivery_fee_with_tax>0 then 0 else COALESCE(@delivery_fee,0) end)-COALESCE(@tax_total,@sst_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member Recency","recency",e,T.MIN_EX,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member frequency","frequency",e,T.COUNT_,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member monetary","monetary",e,T.SUM__n,e,r),t.Field_Field$numeric(e,T.IFNULLdeWT,!1,e,!1,"Delivery fee with tax",W,W,T.COALESdex5f_,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLdeWo,!1,e,!1,"Delivery fee without tax",B,B,T.COALESdex5fo,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLoT,!1,e,!1,"Other charge with tax",I,I,T.COALESo_,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLoo,!1,e,!1,"Other charge without tax",x,x,T.COALESoo,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Bill duration in seconds from creation to completion",e,!1,e,!1,"Duration","duration",e,T.EXTRAC,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant","restaurantName",e,T.x28selecn,u.FIELD_ROLE_4,r),t.Field_Field$numeric(e,e,!1,e,!1,"Labour hour","labourHour",e,T.x28selecS,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payments","payments",e,T.x28selecstn,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Items","items",e,"(select string_agg(CONCAT(flatten_items.quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN flatten_items.code='' THEN NULL ELSE flatten_items.code END, flatten_items.name], ' ')), ',') from flatten_items where flatten_items.bill_id=@id and flatten_items.restaurant_id=@restaurant_id and flatten_items.layer=0 and flatten_items.status!='VOIDED')",e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount reasons","discountReasons",e,T.x28selecsta,e,r),t.Field_Field$numeric(e,T.IFNULLdiI,!1,e,!1,"Discount inc tax",w,w,T.COALESdii,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payment Summaries","paymentSummaries",e,"(select string_agg(distinct CONCAT(name, CASE WHEN card_type is not null THEN CONCAT(' (',UPPER(card_type), ')') WHEN payment_gateway_issuer is not null THEN CONCAT(' (',payment_gateway_issuer, ')') ELSE '' END), ',') from payments where payments.bill_id=@id and payments.restaurant_id=@restaurant_id)",e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Is new member","isNewMember",e,"(CASE WHEN EXISTS (SELECT 1 FROM members WHERE members.id=@member_id AND members.created_at::date = @created_at::date) THEN 1 ELSE 0 END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Is 30 days recency","is30DaysRecency",e,"(CASE WHEN EXISTS (SELECT 1 FROM bills WHERE bills.member_id = @member_id AND bills.status != 'VOIDED' AND bills.restaurant_id = @restaurant_id AND bills.created_at >= @created_at - INTERVAL '30 days' AND bills.created_at < @created_at) THEN 1 ELSE 0 END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Is 60 days recency","is60DaysRecency",e,"(CASE WHEN EXISTS (SELECT 1 FROM bills WHERE bills.member_id = @member_id AND bills.status != 'VOIDED' AND bills.restaurant_id = @restaurant_id AND bills.created_at >= @created_at - INTERVAL '60 days' AND bills.created_at < @created_at) THEN 1 ELSE 0 END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric("Bill count flag: 1 normal, -1 refund, 0 voided. Use SUM to count bills","IF(@status = 'VOIDED', 0, IF(@isRefund, -1, 1))",!1,e,!1,"Table count","tableCount",e,"(CASE WHEN @status = 'VOIDED' THEN 0 ELSE (CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric("Member count flag: 1 normal, -1 refund, 0 voided. Use SUM to count members","IF((@status = 'VOIDED' OR @memberId is null), 0, IF(@isRefund, -1, 1))",!1,e,!1,"Member count","memberCount",e,"(CASE WHEN (@status = 'VOIDED' OR @member_id is null) THEN 0 ELSE (CASE WHEN @is_refund THEN -1 ELSE 1 END) END)",u.FIELD_ROLE_1,r),t.Field_Field$string("Customer name from pickup / in-house delivery / delivery channel",e,!1,e,!1,!1,"Customer",v,v,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Customer phone",X,X,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Customer address",K,K,e,e,r),t.Field_Field$string("Remark on the pickup / delivery order",e,!1,e,!1,!1,"Customer remark",M0,M0,e,e,r),t.Field_Field$timestamp("Scheduled pickup / delivery time",e,!1,e,!1,"Fulfillment time",A0,A0,e,u.FIELD_ROLE_0,r),t.Field_Field$string("Pax count by type (e.g. ADULTS, CHILDREN)",e,!1,e,!1,!1,"Pax breakdown","paxBreakdown","personMetaBreakdown",e,e,r),t.Field_Field$numeric("Refund rows only: original bill nett less every earlier refund of it. NULL elsewhere; per-row, do not sum",e,!1,e,!0,"Nett balance before refund","refundNettBalanceBefore",e,"(CASE WHEN @refund_from IS NULL THEN NULL ELSE (SELECT COALESCE(ob.nett_total,0) FROM bills ob WHERE ob.id=@refund_from AND ob.restaurant_id=@restaurant_id)-COALESCE((SELECT SUM(COALESCE(pr.nett_total,0)) FROM bills pr WHERE pr.refund_from=@refund_from AND pr.restaurant_id=@restaurant_id AND pr.status<>'VOIDED' AND (pr.created_at<@created_at OR (pr.created_at=@created_at AND pr.id<@id))),0) END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric("Refund rows only: nett balance before refund less this refund nett. NULL elsewhere; per-row, do not sum",e,!1,e,!0,"Nett balance after refund","refundNettBalanceAfter",e,"(CASE WHEN @refund_from IS NULL THEN NULL ELSE (SELECT COALESCE(ob.nett_total,0) FROM bills ob WHERE ob.id=@refund_from AND ob.restaurant_id=@restaurant_id)-COALESCE((SELECT SUM(COALESCE(pr.nett_total,0)) FROM bills pr WHERE pr.refund_from=@refund_from AND pr.restaurant_id=@restaurant_id AND pr.status<>'VOIDED' AND (pr.created_at<@created_at OR (pr.created_at=@created_at AND pr.id<@id))),0)-CASE WHEN @status='VOIDED' THEN 0 ELSE COALESCE(@nett_total,0) END END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric("Refund rows only: original bill gross less every earlier refund of it. NULL elsewhere; per-row, do not sum",e,!1,e,!0,"Gross balance before refund","refundGrossBalanceBefore",e,z0+t._billGross("ob.")+E0+t._billGross("pr.")+") FROM bills pr WHERE pr.refund_from=@refund_from AND pr.restaurant_id=@restaurant_id AND pr.status<>'VOIDED' AND (pr.created_at<@created_at OR (pr.created_at=@created_at AND pr.id<@id))),0) END)",u.FIELD_ROLE_1,r),t.Field_Field$numeric("Refund rows only: gross balance before refund less this refund gross. NULL elsewhere; per-row, do not sum",e,!1,e,!0,"Gross balance after refund","refundGrossBalanceAfter",e,z0+t._billGross("ob.")+E0+t._billGross("pr.")+") FROM bills pr WHERE pr.refund_from=@refund_from AND pr.restaurant_id=@restaurant_id AND pr.status<>'VOIDED' AND (pr.created_at<@created_at OR (pr.created_at=@created_at AND pr.id<@id))),0)-CASE WHEN @status='VOIDED' THEN 0 ELSE "+t._billGross("@")+" END END)",u.FIELD_ROLE_1,r)],d.JSArray_Field)},$signature:0},t.billSchema_closure0.prototype={call$1(r){var e="id",n="restaurantId",a=null,i="billId",s=d.JSArray_String,l=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_72,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_45,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_83,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_109,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_114,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_84,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition("createdAt",t._setArrayType(["createdAt"],s),u.COMPARISON_OPERATOR_0,u.DIMENSION_OPTION_2)],l),!1,r,a)],d.JSArray_Join)},$signature:1},t.businessSchema_closure.prototype={call$1(r){var e=null,n="expiredAt",a="restaurantQuota",i="warehouseQuota",s="internal";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Name","name","name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Agent ID","agentId","agentId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Owner ID","ownerId","ownerId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Expired at",n,n,e,u.FIELD_ROLE_0,r),t.Field_Field$numeric(e,e,!0,e,!1,e,a,a,e,e,r),t.Field_Field$numeric(e,e,!0,e,!1,e,i,i,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,e,s,s,e,e,r)],d.JSArray_Field)},$signature:0},t.businessSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],d.JSArray_String),u.COMPARISON_OPERATOR_0,null)],d.JSArray_JoinCondition),!1,r,null)],d.JSArray_Join)},$signature:1},t.campaignSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="restaurantId",i="description",s="collectibleId",l="templateId";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string("Campaign kind: VOUCHER, PROMOTION, POINT, CREDIT, MEMBERSHIP, BROADCAST, COIN, REWARD_POOL, GAME or MISSION. POINT is the experience collectible and COIN the one the portal calls Point.",e,!1,e,!1,!1,"Type","type","type",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,"id",!1,!1,"Name","name","name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Description",i,i,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Started at","startedAt","start",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Ended at","endedAt","end",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Collectible ID",s,s,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Template ID",l,l,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Group ID","groupId","groupId",e,u.FIELD_ROLE_5,r),t.Field_Field$bool(e,e,!1,e,!1,"Active","active",e,"((@ended_at is null or @ended_at >= !end) and (@started_at is null or @started_at <= !start))",e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Code","code","code",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Event type","eventType","event.type",e,e,r)],d.JSArray_Field)},$signature:0},t.campaignSchema_closure0.prototype={call$1(r){var e="businessId",n=null,a=d.JSArray_String,i=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n),new t.Join(u.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),u.COMPARISON_OPERATOR_0,n),new t.JoinCondition("id",t._setArrayType(["collectibleId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n),new t.Join(u.SCHEMA_NAME_66,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),u.COMPARISON_OPERATOR_0,n),new t.JoinCondition("campaignId",t._setArrayType(["id"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n)],d.JSArray_Join)},$signature:1},t.campaignTierSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="campaignId",i="memberCount";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Campaign ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Name","name","name",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"From","fromPoint","from",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"To","toPoint","to",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member count",i,i,e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Rank","rank","no",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Range","range",e,"concat(@from_point,' - ',@to_point)",e,r)],d.JSArray_Field)},$signature:0},t.campaignTierSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_64,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("docId",t._setArrayType(["campaignId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.changePaymentActivitySchema_closure.prototype={call$1(r){var e=null,n="paymentId";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Changed at","changedAt","timeStamp",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId","billId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payment ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"User","byName","name",e,e,r),t.Field_Field$string("Original payment method name before the change",e,!1,e,!1,!1,"From","fromName","from.name",e,e,r),t.Field_Field$string("New payment method name after the change",e,!1,e,!1,!1,"To","toName","to.name",e,e,r)],d.JSArray_Field)},$signature:0},t.changePaymentActivitySchema_closure0.prototype={call$1(r){var e=null,n="restaurantId",a=d.JSArray_String,i=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["paymentId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e)],d.JSArray_Join)},$signature:1},t.chargeSchema_closure.prototype={call$1(r){var e=null,n="parentId",a="isRefund",i="beforeDiscount",s="inclusive",l="percentage";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId","billId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Parent ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Code","code","code",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Variant","variant","variant",e,e,r),t.Field_Field$string("Charge type, e.g. SERVICE_CHARGE, SST, VAT, OTHER_CHARGE",e,!1,e,!1,!1,"Type","type","type",e,e,r),t.Field_Field$bool(e,e,!1,e,!1,"Refund",a,a,e,e,r),t.Field_Field$bool(e,e,!1,e,!1,"Before Discount",i,i,e,e,r),t.Field_Field$bool("Whether the charge is already included in item prices",e,!1,e,!1,"Inclusive",s,s,e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Percentage",l,l,e,e,r),t.Field_Field$numeric(e,"@total*IF(@isRefund, -1, 1)",!1,e,!1,"Total","total","total","@total*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r)],d.JSArray_Field)},$signature:0},t.chargeSchema_closure0.prototype={call$1(r){var e=null,n="restaurantId",a=d.JSArray_String,i=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_5,t._setArrayType([new t.JoinCondition("billId",t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition(n,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("id",t._setArrayType(["parentId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,e)],i),!1,r,e)],d.JSArray_Join)},$signature:1},t.closingDraftSchema_closure.prototype={call$1(r){var e=null,n="locationId",a="closingId",i="closingAdjustmentId",s="approveRemark",l="effectiveAt",p="approvedAt",c="updatedAt";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Location ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Closing ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Adjustment ID",i,i,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Approved remark",s,s,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Effective time",l,l,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Status","status","status",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Create user","createdByName","createdBy.name",e,u.FIELD_ROLE_4,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Create user ID","createdById","createdBy.id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Approve user","approvedByName","approvedBy.name",e,u.FIELD_ROLE_4,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Approve user ID","approvedById","approvedBy.id",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Approve time",p,p,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Update user","updatedByName","updatedBy.name",e,u.FIELD_ROLE_4,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Update user ID","updatedById","updatedBy.id",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Update time",c,c,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Formatted ID","formattedId",e,e,u.FIELD_ROLE_5,r)],d.JSArray_Field)},$signature:0},t.closingDraftSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(u.SCHEMA_NAME_47,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],d.JSArray_String),u.COMPARISON_OPERATOR_0,null)],d.JSArray_JoinCondition),!1,r,null)],d.JSArray_Join)},$signature:1},t.closingDraftSkuSchema_closure.prototype={call$1(r){var e=null,n="locationId",a="closingDraftId",i="closingAdjustmentId",s="effectiveAt";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,e,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Location ID",n,n,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Closing draft ID",a,a,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Adjustment ID",i,i,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Effective time",s,s,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"SKU ID","skuId","skuId",e,e,r)],d.JSArray_Field)},$signature:0},t.closingDraftSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([],d.JSArray_Join)},$signature:1},t.closingSkuSchema_closure.prototype={call$1(r){var e=null,n="locationId",a="closingId",i="weightedAverage";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Warehouse ID","warehouseId","_warehouseId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Location ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Closing ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"SKU ID","skuId","skuId",e,u.FIELD_ROLE_5,r),t.Field_Field$numeric(e,e,!1,e,!1,"Balance","balance","balance",e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Cost","cost","cost",e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Weighted average",i,i,e,u.FIELD_ROLE_1,r)],d.JSArray_Field)},$signature:0},t.closingSkuSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(u.SCHEMA_NAME_47,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["locationId"],d.JSArray_String),u.COMPARISON_OPERATOR_0,null)],d.JSArray_JoinCondition),!1,r,null)],d.JSArray_Join)},$signature:1},t.collectibleCollectionSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="collectibleId",i="expiredAt";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Collectible ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"User ID","userId","userId",e,u.FIELD_ROLE_5,r),t.Field_Field$string("Collectible kind of this holding: VOUCHER, CREDIT, POINT, COIN, TIER, TITLE, GAME, STAMP or REFERRAL. The portal shows COIN as Point, POINT as Experience and GAME as Token; VOUCHER is the v2 voucher.",e,!1,e,!1,!1,"Type","type","type",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Max use","maxUse","options.maxUse",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Expired time",i,i,T.x28case_x40,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Code","code","code",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Applied time","appliedAt",e,"(select created_at from collectible_transactions where (collectible_transactions.source!='CYCLE' AND collectible_transactions.amount<0 AND collectible_transactions.refunded is not true) AND collectible_transactions.collection_id=@id order by collectible_transactions.created_at desc limit 1)",u.FIELD_ROLE_0,r),t.Field_Field$bool(e,e,!1,e,!1,"Is expired","isExpired",e,T.CASE_Wx28,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Applied count","appliedCount",e,"(select -sum(collectible_transactions.amount) from collectible_transactions where collectible_transactions.collection_id=@id and collectible_transactions.refunded is not true and collectible_transactions.amount<0 and collectible_transactions.source!='CYCLE')",u.FIELD_ROLE_1,r)],d.JSArray_Field)},$signature:0},t.collectibleCollectionSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["collectibleId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_45,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["userId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_66,t._setArrayType([new t.JoinCondition("collectionId",t._setArrayType(["id"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.collectibleConfigSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="description";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Name","name","name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Description",a,a,e,e,r),t.Field_Field$string("Collectible kind: VOUCHER, CREDIT, POINT, COIN, TIER, TITLE, GAME, STAMP or REFERRAL. The portal shows COIN as Point, POINT as Experience and GAME as Token; VOUCHER is the v2 voucher.",e,!1,e,!1,!1,"Type","type","type",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Max distribution","maxDistribution","options.maxReceive",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Max distribution per user","maxDistributePerUser","options.maxPerUser",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Max use per collectible","maxUsePerCollectible","options.maxUse",e,e,r)],d.JSArray_Field)},$signature:0},t.collectibleConfigSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_64,t._setArrayType([new t.JoinCondition("businessId",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("collectibleId",t._setArrayType(["id"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.collectibleTransactionSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="collectionId",i="collectibleId",s="fromBalance",l="toBalance",p="expiredAt",c="refundedFrom",M="refunded",b="expiryAmountId",O="docAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Collection ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Collectible ID",i,i,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"User ID","userId","userId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Ref ID","refId","refId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Source","source","source",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Amount","amount","amount",e,u.FIELD_ROLE_2,r),t.Field_Field$numeric(e,e,!1,e,!1,"From balance",s,s,e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"To balance",l,l,e,u.FIELD_ROLE_1,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Expired at",p,p,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund ref ID",c,c,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Campaign ID","campaignId","metadata.campaign","(case when @campaign_id is not null then @campaign_id else (select min(child.id) from campaigns child where child.collectible_id=@collectible_id AND child.type != 'CREDIT') end)",u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Quantity distributed","qtyDistributed",e,"case when @amount>=0 and @refunded is not true and @refunded_from is null then @amount else 0 end",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Quantity usage","qtyUsage",e,"case when @amount<0 and @source!='CYCLE' and @refunded is not true then -@amount else 0 end",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Quantity expired","qtyExpired",e,"case when @amount<0 and @source='CYCLE' and @refunded is not true then -@amount else 0 end",u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Transaction ID","transactionId",e,"@doc_id",u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Transformed source","transformedSource",e,"(case when @source='PORTAL' then 'ADMIN' when @source='BENEFIT' then 'MEMBERSHIP' when @source='CYCLE' then 'EXPIRED' when @source in ('BILL','ORDER') then (case when @amount<0 then 'USAGE' when @refunded_from is not null then 'RETURN' else 'DISTRIBUTE' end) else @source end)",e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Credit type","creditType",e,"case when @expired_at is null then 'NORMAL' else 'FREE' end",e,r),t.Field_Field$bool(e,e,!0,e,!1,"Refunded",M,M,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Location ID","locationId","metadata.location",e,u.FIELD_ROLE_5,r),t.Field_Field$string("Identity of the expiry bucket this row came from (expiryAmount[]._id)",e,!1,e,!1,!1,"Expiry amount ID",b,b,e,u.FIELD_ROLE_5,r),t.Field_Field$numeric("Amount as stated on the source document for this row, before the query engine recomputes it",e,!1,e,!1,"Original amount",O,O,e,e,r)],d.JSArray_Field)},$signature:0},t.collectibleTransactionSchema_closure0.prototype={call$1(r){var e="id",n="businessId",a=null,i=d.JSArray_String,s=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["refId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_65,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectibleId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_70,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["collectionId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_64,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["businessId"],i),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(e,t._setArrayType(["campaignId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_45,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["businessId"],i),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(e,t._setArrayType(["userId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_68,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["businessId"],i),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(e,t._setArrayType(["refId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["locationId"],i),u.COMPARISON_OPERATOR_0,a)],s),!1,r,a)],d.JSArray_Join)},$signature:1},t.completeTimeBillSchema_closure.prototype={call$1(r){var e=null,n="seqNumber",a="deliveryName",i="isRefund",s="isPickup",l="isInHouseDelivery",p="isDelivery",c="completedAt",M="integratedOrderId",b="itemCount",O="taxTotal",D="discountTotal",$="grossTotal",E="rounding",g="takeawayPrice",h="thirdPartyExtraCharge",R="deliveryFee",L="nettTotal",W="deliveryFeeWithTax",B="deliveryFeeWithoutTax",I="otherChargeWithTax",x="otherChargeWithoutTax",w="discountInclusiveTaxTotal";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Status","status","status",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"No.",n,n,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Table","slot","slot",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Delivery",a,a,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund ID","refundFrom","refundedFrom",e,e,r),t.Field_Field$bool(e,e,!1,e,!1,"Refund",i,i,e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"refundApprovedById","refund.approvedBy.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund approver","refundApprovedByName","refund.approvedBy.name",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"refundedById","refund.by.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund user","refundedByName","refund.by.name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund reason","refundReason","refund.reason",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member ID","memberId","membership.id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member user ID","memberUserId","membership.userId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member name","memberUserName","membership.name",e,u.FIELD_ROLE_4,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Member phone","memberPhoneNumber","membership.phoneNumber",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Member birthday","memberBirthday","membership.birthday",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Source","source","source",T.x28case_x28,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Type","type","type","(case when upper(@type)='PICKUP' then upper(@type) when upper(@type)='DELIVERY' then upper(@type) when @is_takeaway is true then 'TAKEAWAY' else upper(@type) end)",e,r),t.Field_Field$bool(e,e,!0,e,!1,"Pickup",s,s,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is in house delivery",l,l,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is other delivery",p,p,e,e,r),t.Field_Field$bool(e,e,!0,e,!1,"Is takeaway","isTakeaway","is.takeaway",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Closed at",c,c,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Inclusive SST","sstInclusive","nettTaxes.SST.inclusive",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SST before discount","sstBeforeDiscount","nettTaxes.SST.beforeDiscount",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"Inclusive SC","serviceChargeInclusive","nettTaxes.SERVICE_CHARGE.inclusive",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SC before discount","serviceChargeBeforeDiscount","nettTaxes.SERVICE_CHARGE.beforeDiscount",e,e,r),t.Field_Field$numeric(e,"IFNULL(@pax,0)*IF(@isRefund, -1, 1)",!1,e,!1,"Pax","pax","person",T.COALESp,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Integrated order ID",M,M,e,u.FIELD_ROLE_5,r),t.Field_Field$numeric(e,T.IFNULLi,!0,e,!1,"Item count",b,b,T.COALESi,e,r),t.Field_Field$numeric(e,"IFNULL(@taxTotal,0)*IF(@isRefund, -1, 1)",!1,e,!1,"Tax",O,O,T.COALEStax0,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLdiT,!1,e,!1,"Discount",D,D,T.COALESdit,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLg,!1,e,!1,"Item gross",$,$,T.COALESg,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-IFNULL(@discountTotal,0)-IFNULL(@thirdPartyExtraCharge,0)-IFNULL(@deliveryFee,0)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Bill gross","billGrossTotal",e,"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-COALESCE(@discount_total,0)-COALESCE(@third_party_extra_charge,0)-COALESCE(@delivery_fee,0)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IFNULL(@rounding,0)*IF(@isRefund, -1, 1)",!1,e,!1,"Rounding",E,E,T.COALESr,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IFNULL(@sstTotal,0)*IF(@isRefund, -1, 1)",!0,e,!1,"SST","sstTotal","nettTaxes.SST.total",T.COALESss,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SST %","sstPercentage","nettTaxes.SST.percentage",e,e,r),t.Field_Field$numeric(e,T.IFNULLs,!1,e,!1,"SC","serviceChargeTotal","nettTaxes.SERVICE_CHARGE.total",T.COALESse,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!0,e,!1,!1,"SC %","serviceChargePercentage","nettTaxes.SERVICE_CHARGE.percentage",e,e,r),t.Field_Field$numeric(e,T.x28IFNULo,!1,e,!1,"Other charge","otherChargeTotal","nettTaxes.OTHER_CHARGE.total",T.x28COALEo,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.x28IFNULgx2d,!1,e,!1,"Gross w/ takeaway","subTotalWithoutTakeaway",e,T.x28COALEgx2d,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLtak,!1,e,!1,"Takeaway",g,g,T.COALEStak,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLth,!1,e,!1,"Extra charge",h,h,T.COALESth,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLde_,!1,e,!1,"Delivery fee",R,R,T.COALESdex2c,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLn,!1,e,!1,"Nett",L,L,T.COALESn,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@grossTotal,0)+IFNULL(@deliveryFeeWithTax,0)+IFNULL(@otherChargeWithTax,0)+IFNULL(@discountTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Item gross before charges","grossBeforeCharges",e,"(COALESCE(@gross_total,0)+COALESCE(@delivery_fee_with_tax,0)+COALESCE(@other_charge_with_tax,0)+COALESCE(@discount_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"(IFNULL(@nettTotal,0)-IFNULL(@rounding,0)-(case when @otherChargeWithTax>0 then 0 else IFNULL(@thirdPartyExtraCharge,0) end)-(case when @deliveryFeeWithTax>0 then 0 else IFNULL(@deliveryFee,0) end)-IFNULL(@taxTotal,0)-IFNULL(@serviceChargeTotal,0))*IF(@isRefund, -1, 1)",!1,e,!1,"Bill gross before charges","billGrossBeforeCharges",e,"(COALESCE(@nett_total,0)-COALESCE(@rounding,0)-(case when @other_charge_with_tax>0 then 0 else COALESCE(@third_party_extra_charge,0) end)-(case when @delivery_fee_with_tax>0 then 0 else COALESCE(@delivery_fee,0) end)-COALESCE(@tax_total,0)-COALESCE(@service_charge_total,0))*CASE WHEN @is_refund THEN -1 ELSE 1 END",u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member Recency","recency",e,T.MIN_EX,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member frequency","frequency",e,T.COUNT_,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Member monetary","monetary",e,T.SUM__n,e,r),t.Field_Field$numeric(e,T.IFNULLdeWT,!1,e,!1,"Delivery fee with tax",W,W,T.COALESdex5f_,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLdeWo,!1,e,!1,"Delivery fee without tax",B,B,T.COALESdex5fo,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLoT,!1,e,!1,"Other charge with tax",I,I,T.COALESo_,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,T.IFNULLoo,!1,e,!1,"Other charge without tax",x,x,T.COALESoo,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Duration","duration",e,T.EXTRAC,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant","restaurantName",e,T.x28selecn,u.FIELD_ROLE_4,r),t.Field_Field$numeric(e,e,!1,e,!1,"Labour hour","labourHour",e,T.x28selecS,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payments","payments",e,T.x28selecstn,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Items","items",e,"(select string_agg(CONCAT(flatten_items.quantity,'x ',ARRAY_TO_STRING(ARRAY[CASE WHEN flatten_items.code='' THEN NULL ELSE flatten_items.code END, flatten_items.name], ' ')), ',') from flatten_items where flatten_items.bill_id=@id and flatten_items.restaurant_id=@restaurant_id and flatten_items.layer=0)",e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount reasons","discountReasons",e,T.x28selecsta,e,r),t.Field_Field$numeric(e,T.IFNULLdiI,!1,e,!1,"Discount inc tax",w,w,T.COALESdii,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payment Summaries","paymentSummaries",e,"(select string_agg(distinct CONCAT(name, CASE WHEN card_type is not null THEN CONCAT(' (',card_type, ')') WHEN payment_gateway_issuer is not null THEN CONCAT(' (',payment_gateway_issuer, ')') ELSE '' END), ',') from payments where payments.bill_id=@id and payments.restaurant_id=@restaurant_id)",e,r)],d.JSArray_Field)},$signature:0},t.completeTimeBillSchema_closure0.prototype={call$1(r){var e="id",n="restaurantId",a=null,i="billId",s=d.JSArray_String,l=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_72,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(e,t._setArrayType(["refundFrom"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_10,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_12,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_8,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_45,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_44,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["memberUserId"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a),new t.Join(u.SCHEMA_NAME_21,t._setArrayType([new t.JoinCondition(n,t._setArrayType(["restaurantId"],s),u.COMPARISON_OPERATOR_0,a),new t.JoinCondition(i,t._setArrayType(["id"],s),u.COMPARISON_OPERATOR_0,a)],l),!1,r,a)],d.JSArray_Join)},$signature:1},t.counterSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Type","type","type",e,e,r),t.Field_Field$string(e,e,!1,"id",!1,!1,"Name","name","name",e,e,r)],d.JSArray_Field)},$signature:0},t.counterSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],d.JSArray_String),u.COMPARISON_OPERATOR_0,null)],d.JSArray_JoinCondition),!1,r,null)],d.JSArray_Join)},$signature:1},t.creditTransactionSchema_closure.prototype={call$1(r){var e=null,n="refunded",a="freeAmount",i="normalAmount",s="totalAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID","businessId","business",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","restaurant",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Member ID","memberId","member",e,u.FIELD_ROLE_5,r),t.Field_Field$bool(e,e,!1,e,!1,"Is refund",n,n,e,e,r),t.Field_Field$string("Transaction source, e.g. POS, ADMIN, REWARD",e,!1,e,!1,!1,"Source","source","source",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Ref","ref","ref",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$numeric("Bonus/complimentary credit amount",e,!1,e,!1,"Free",a,a,e,u.FIELD_ROLE_2,r),t.Field_Field$numeric("Earned/paid credit amount",e,!1,e,!1,"Normal",i,i,e,u.FIELD_ROLE_2,r),t.Field_Field$numeric("The movement as a whole and its direction: positive earns credit, negative redeems it. normal_amount and free_amount are its two parts, so sum the total or the parts, never both.",e,!1,e,!1,"Total",s,s,e,u.FIELD_ROLE_2,r)],d.JSArray_Field)},$signature:0},t.creditTransactionSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_45,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["memberId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.dailyForecastSalesSchema_closure.prototype={call$1(r){var e=null,n="predicted";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Training date cutoff","trainingDateCutoff","training_date_cutoff",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Training period","trainingPeriod","training_period",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Forecast period","forecastPeriod","forecast_period",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Predicted",n,n,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Model version","modelVersion","model_version",e,e,r)],d.JSArray_Field)},$signature:0},t.dailyForecastSalesSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("createdAt",t._setArrayType(["createdAt"],n),u.COMPARISON_OPERATOR_0,u.DIMENSION_OPTION_2)],a),!0,r,e)],d.JSArray_Join)},$signature:1},t.depositSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="restaurantId",i="referenceNo",s="targetDate",l="currency",p="customerName",c="customerPhone",M="createdByName",b="createdById",O="paymentName",D="paidAmount",$="collectedAmount",E="appliedAt",g="appliedAmount",h="appliedBillId",R="excessAmount",L="excessHandling",W="refundedAt",B="refundedAmount",I="retainedAmount",x="refundReason",w="refundPercentage",v="refundDaysBefore",X="forfeitedAt",K="forfeitedAmount",M0="forfeitReason",A0="cashOutAmount",z0="outstandingAmount",E0="depositIncomeAmount";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string("Outlet that created the deposit",e,!1,e,!1,!1,"Restaurant ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Reference no",i,i,e,e,r),t.Field_Field$string("draft, active, applied, refunded or forfeited",e,!1,e,!1,!1,"Status","status","status",e,e,r),t.Field_Field$timestamp("Date the deposit is reserved for",e,!1,e,!1,"Target date",s,s,e,u.FIELD_ROLE_0,r),t.Field_Field$numeric(e,e,!1,e,!1,"Deposit amount","amount","amount",e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,l,l,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Customer",p,p,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Customer phone",c,c,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Remark","remark","remark",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Created by",M,M,e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,b,b,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Paid time","paidAt","paidAt",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payment method",O,O,e,e,r),t.Field_Field$numeric("Amount tendered, which can exceed the deposit amount",e,!0,e,!1,e,D,D,e,e,r),t.Field_Field$numeric("Deposit amount once paid, 0 while still a draft",e,!1,e,!1,"Collected",$,$,e,u.FIELD_ROLE_1,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Applied time",E,E,e,u.FIELD_ROLE_0,r),t.Field_Field$numeric("Part of the deposit spent on the bill",e,!1,e,!1,"Applied",g,g,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Applied bill ID",h,h,e,u.FIELD_ROLE_5,r),t.Field_Field$numeric("Deposit left over after the bill was paid",e,!1,e,!1,"Excess",R,R,e,u.FIELD_ROLE_1,r),t.Field_Field$string("retain keeps the excess, returnBalance pays it back",e,!1,e,!1,!1,"Excess handling",L,L,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Refunded time",W,W,e,u.FIELD_ROLE_0,r),t.Field_Field$numeric(e,e,!1,e,!1,"Refunded",B,B,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Retained on refund",I,I,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Refund reason",x,x,e,e,r),t.Field_Field$numeric("Refund policy tier applied, as a percentage",e,!0,e,!1,e,w,w,e,e,r),t.Field_Field$numeric(e,e,!0,e,!1,e,v,v,e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Forfeited time",X,X,e,u.FIELD_ROLE_0,r),t.Field_Field$numeric(e,e,!1,e,!1,"Forfeited",K,K,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Forfeit reason",M0,M0,e,e,r),t.Field_Field$numeric("Refund plus any excess returned to the customer",e,!1,e,!1,"Cash out",A0,A0,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Collected deposit not yet applied, refunded or forfeited",e,!1,e,!1,"Outstanding",z0,z0,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(T.Forfei,e,!1,e,!1,"Deposit income",E0,E0,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant","restaurantName",e,T.x28selecn,e,r)],d.JSArray_Field)},$signature:0},t.depositSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["businessId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["appliedBillId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_117,t._setArrayType([new t.JoinCondition("depositId",t._setArrayType(["id"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.depositTransactionSchema_closure.prototype={call$1(r){var e=null,n="businessId",a="restaurantId",i="Outlet where this event happened",s="depositId",l="performedByName",p="performedById",c="approvedByName",M="cashInAmount",b="cashOutAmount",O="netCashAmount",D="appliedAmount",$="excessAmount",E="excessHandling",g="incomeAmount",h="liabilityChange",R="paymentName";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Deposit created time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp("When this deposit event happened",e,!1,e,!1,"Time","eventAt","eventAt",e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Business ID",n,n,e,u.FIELD_ROLE_5,r),t.Field_Field$string(i,e,!1,e,!1,!1,"Restaurant ID",a,a,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Deposit ID",s,s,e,u.FIELD_ROLE_5,r),t.Field_Field$string("created, paid, applied, refunded or forfeited",e,!1,e,!1,!1,"Action","action","action",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Performed by",l,l,e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,p,p,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Approved by",c,c,e,e,r),t.Field_Field$numeric("Money received from the customer by this event",e,!1,e,!1,"Cash in",M,M,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Money paid back to the customer by this event",e,!1,e,!1,"Cash out",b,b,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Cash in less cash out — the bank statement line",e,!1,e,!1,"Net cash",O,O,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Applied",D,D,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Excess",$,$,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Excess handling",E,E,e,e,r),t.Field_Field$numeric(T.Forfei,e,!1,e,!1,"Deposit income",g,g,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric("Deposit owed to customers, added on paid and released on close",e,!1,e,!1,"Liability change",h,h,e,u.FIELD_ROLE_1,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId","billId",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Payment method",R,R,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Reason","reason","reason",e,e,r),t.Field_Field$string(i,e,!1,e,!1,!1,"Restaurant","restaurantName",e,T.x28selecn,e,r)],d.JSArray_Field)},$signature:0},t.depositTransactionSchema_closure0.prototype={call$1(r){var e="id",n=null,a=d.JSArray_String,i=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_2,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["businessId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n),new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["restaurantId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n),new t.Join(u.SCHEMA_NAME_116,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["depositId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n),new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition(e,t._setArrayType(["billId"],a),u.COMPARISON_OPERATOR_0,n)],i),!1,r,n)],d.JSArray_Join)},$signature:1},t.discountSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt",e,e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Bill close time","billCompletedAt",e,e,u.FIELD_ROLE_0,r),t.Field_Field$bool(e,e,!1,e,!1,"Refund","isRefund",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Item ID","itemId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string("Discount amount/percentage or payment method. eg, -10%, -5, PAYMENT VOUCHER.",e,!1,e,!1,!1,"Name","name",e,e,e,r),t.Field_Field$string(T.discout,e,!1,e,!1,!1,"Cause","cause",e,e,e,r),t.Field_Field$string(T.discoun,e,!1,e,!1,!1,"Reason","reason",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount user","createdByName",e,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Discount approver","approvedByName",e,e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Qty","quantity",e,e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,e,!1,e,!1,"Total","total",e,e,u.FIELD_ROLE_1,r),t.Field_Field$string("Adjusted item name, 'BILL' for bill-level discounts, or 'PAYMENT' for payment vouchers.",e,!1,e,!1,!1,"Target","target",e,e,e,r),t.Field_Field$string("Collectible collection id: bill effect returnId, or the payment voucher reference.",e,!1,e,!1,!1,"Return ID","returnId",e,e,u.FIELD_ROLE_5,r),t.Field_Field$string("Adjustment reference id; null for payment vouchers.",e,!1,e,!1,!1,"Ref ID","referenceId",e,e,u.FIELD_ROLE_5,r)],d.JSArray_Field)},$signature:0},t.discountSchema_closure0.prototype={call$1(r){var e=null,n=d.JSArray_String,a=d.JSArray_JoinCondition;return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e),new t.Join(u.SCHEMA_NAME_0,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["billId"],n),u.COMPARISON_OPERATOR_0,e),new t.JoinCondition("restaurantId",t._setArrayType(["restaurantId"],n),u.COMPARISON_OPERATOR_0,e)],a),!1,r,e)],d.JSArray_Join)},$signature:1},t.drawerSchema_closure.prototype={call$1(r){var e=null;return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"userId","user.id",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"User","userName","user.name",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Reason","reason","reason",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Counter ID","counterId","counter.id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Counter","counterName","counter.name",e,u.FIELD_ROLE_4,r),t.Field_Field$numeric("Cash in/out amount. Positive = in, negative = out",e,!1,e,!1,"Total","amount","amount",e,u.FIELD_ROLE_2,r),t.Field_Field$string("Values: IN or OUT. Derived from amount sign","IF(@amount>=0, 'IN', 'OUT')",!1,e,!1,!1,"Type","type",e,"CASE WHEN @amount>=0 THEN 'IN' ELSE 'OUT' END",e,r),t.Field_Field$numeric(e,"IF(@amount>=0, @amount, 0)",!1,e,!1,"In","in",e,T.CASE_Wx40ax3e,u.FIELD_ROLE_1,r),t.Field_Field$numeric(e,"IF(@amount<0, @amount, 0)",!1,e,!1,"Out","out",e,T.CASE_Wx40ax3c,u.FIELD_ROLE_1,r)],d.JSArray_Field)},$signature:0},t.drawerSchema_closure0.prototype={call$1(r){return t._setArrayType([new t.Join(u.SCHEMA_NAME_14,t._setArrayType([new t.JoinCondition("id",t._setArrayType(["restaurantId"],d.JSArray_String),u.COMPARISON_OPERATOR_0,null)],d.JSArray_JoinCondition),!1,r,null)],d.JSArray_Join)},$signature:1},t.flattenItemSchema_closure.prototype={call$1(r){var e=null,n="itemCreatedAt",a="billCompletedAt",i="productId",s="perXUnit",l="takeawayId",p="takeawayName",c="isRefund",M="servedAt",b="isTakeaway",O="quantity",D="unitQuantity",$="billAdjustmentTotal",E="itemAdjustmentTotal",g="grossTotal",h="takeawayPrice",R="nettTotal",L="parentId",W="layerNettTotal",B="layerBillAdjustmentTotal",I="layerItemAdjustmentTotal",x="layerGrossTotal",w="layerTakeawayPrice",v="layerTaxTotal",X="layerScTotal",K="layerOtherChargeTotal",M0="customAttributes",A0="layerZeroParentId",z0="collectedAt",E0="subCategories",g0="billAdjustmentInclusiveTaxTotal",e0="itemAdjustmentInclusiveTaxTotal",W0="layerBillAdjustmentInclusiveTaxTotal",T0="layerItemAdjustmentInclusiveTaxTotal",w0="billAdjustmentExclusiveTaxTotal",v0="itemAdjustmentExclusiveTaxTotal",I0="layerBillAdjustmentExclusiveTaxTotal",V0="layerItemAdjustmentExclusiveTaxTotal",pe="priceGroup",ce="originalPrice",ir="catalogId",or="baseItemPrice",sr="catalogName",ur="priceExclusiveTax",lr="originalPriceExclusiveTax",pr="baseItemPriceExclusiveTax",cr="serveDelayId",_r="serveDelayName",Mr="serveDelayInMins";return t._setArrayType([t.Field_Field$string(e,e,!1,e,!1,!1,"ID","id","_id",e,u.FIELD_ROLE_5,r),t.Field_Field$string(e,e,!0,e,!1,!1,e,"docId","_docId",e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Restaurant ID","restaurantId","_restaurantId",e,u.FIELD_ROLE_5,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Time","createdAt","_createdAt",e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!0,e,!1,e,"publishedAt","_publishedAt",e,e,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Item time",n,n,e,u.FIELD_ROLE_0,r),t.Field_Field$timestamp(e,e,!1,e,!1,"Bill close time",a,a,e,u.FIELD_ROLE_0,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Bill ID","billId","billId",e,u.FIELD_ROLE_5,r),t.Field_Field$string("Values: DRAFT, VOIDED, SENT. DRAFT and SENT both considered valid sales.",e,!1,e,!1,!1,"Status","status","status",e,e,r),t.Field_Field$string(e,e,!1,i,!1,!0,"Name","name","name",e,e,r),t.Field_Field$numeric(e,e,!1,e,!1,"Per unit",s,s,e,e,r),t.Field_Field$string(e,e,!1,e,!1,!1,"Unit","unit","unit",e,e,r),t.Field_Field$string(e,`IF(@categoryName IS NULL OR @productId IS NULL OR REGEXP_CONTAINS(@productId, r'^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$'), 'Other', @categoryName)
|
|
92
92
|
`,!1,e,!1,!0,"Category","categoryName","category",`CASE WHEN @category_name IS NULL OR @product_id IS NULL OR @product_id ~ '^\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z)$' THEN 'Other' ELSE @category_name END
|