@squidcloud/backend 1.0.482 → 1.0.484
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/backend/src/actions.d.ts +14 -1
- package/dist/backend/src/cli-agent/claude-code.adapter.d.ts +74 -0
- package/dist/backend/src/cli-agent/cli-agent-adapter.types.d.ts +112 -0
- package/dist/backend/src/cli-agent/cli-agent-process-launcher.d.ts +22 -0
- package/dist/backend/src/cli-agent/cli-agent-process-runner.d.ts +35 -0
- package/dist/backend/src/cli-agent/codex.adapter.d.ts +67 -0
- package/dist/backend/src/cli-agent/index.d.ts +7 -0
- package/dist/backend/src/cli-agent/nsjail-source-process-launcher.d.ts +45 -0
- package/dist/backend/src/cli-agent/workspace.utils.d.ts +20 -0
- package/dist/backend/src/internal/source-code.d.ts +3 -0
- package/dist/backend/src/public-types.d.ts +5 -0
- package/dist/backend/src/source-code/index.d.ts +17 -0
- package/dist/backend/src/source-code/providers/bitbucket-cloud.client.d.ts +20 -0
- package/dist/backend/src/source-code/providers/github-app.client.d.ts +45 -0
- package/dist/backend/src/source-code/providers/index.d.ts +2 -0
- package/dist/backend/src/source-code/restricted-source-runner.d.ts +95 -0
- package/dist/backend/src/source-code/source-analysis-admission-controller.d.ts +35 -0
- package/dist/backend/src/source-code/source-code-analyzer.d.ts +60 -0
- package/dist/backend/src/source-code/source-code-errors.d.ts +13 -0
- package/dist/backend/src/source-code/source-code-limits.d.ts +33 -0
- package/dist/backend/src/source-code/source-code-telemetry.d.ts +35 -0
- package/dist/backend/src/source-code/source-egress-proxy.d.ts +123 -0
- package/dist/backend/src/source-code/source-evidence-verifier.d.ts +30 -0
- package/dist/backend/src/source-code/source-git-command.d.ts +57 -0
- package/dist/backend/src/source-code/source-git-credential-helper.d.ts +5 -0
- package/dist/backend/src/source-code/source-provider-adapter.d.ts +87 -0
- package/dist/backend/src/source-code/source-provider-operation-broker.d.ts +111 -0
- package/dist/backend/src/source-code/source-repository-snapshot.d.ts +15 -0
- package/dist/backend/src/source-code/source-run-filesystem.d.ts +82 -0
- package/dist/backend/src/source-code/source-socket-admission.d.ts +17 -0
- package/dist/backend/src/source-code/source-workspace-manager.d.ts +179 -0
- package/dist/backend/src/source-code/source-workspace-manifest.d.ts +43 -0
- package/dist/backend/src/squid.service.d.ts +16 -0
- package/dist/backend/src/workspace-client.d.ts +126 -8
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal/source-code.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/internal/source-code.js +1 -0
- package/dist/internal-common/src/public-types-backend/bundle-api.public-types.d.ts +5 -0
- package/dist/internal-common/src/public-types-backend/bundle-data.public-types.d.ts +1 -1
- package/dist/internal-common/src/public-types-backend/langgraph.public-context.d.ts +16 -0
- package/package.json +14 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import{AI_AGENTS_INTEGRATION_ID as t,BUILT_IN_DB_INTEGRATION_ID as e,BUILT_IN_QUEUE_INTEGRATION_ID as n,BUILT_IN_STORAGE_INTEGRATION_ID as r,Squid as o}from"@squidcloud/client";import{join as i,resolve as u}from"path";import{AsyncLocalStorage as a}from"node:async_hooks";import"node:stream";import{execFile as s}from"child_process";import{randomUUID as c}from"crypto";import{access as l,mkdir as f,readFile as p,rm as d,writeFile as h}from"fs/promises";import{tmpdir as g}from"os";import{promisify as y}from"util";var _={243(t,e,n){var r;t=n.nmd(t),function(){var o,i="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",s=32,c=128,l=1/0,f=9007199254740991,p=NaN,d=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],g="[object Arguments]",y="[object Array]",_="[object Boolean]",m="[object Date]",v="[object Error]",k="[object Function]",b="[object GeneratorFunction]",T="[object Map]",O="[object Number]",w="[object Object]",C="[object Promise]",A="[object RegExp]",E="[object Set]",R="[object String]",x="[object Symbol]",I="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",N="[object Float32Array]",D="[object Float64Array]",L="[object Int8Array]",G="[object Int16Array]",j="[object Int32Array]",Y="[object Uint8Array]",P="[object Uint8ClampedArray]",Q="[object Uint16Array]",$="[object Uint32Array]",W=/\b__p \+= '';/g,B=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,V=RegExp(F.source),z=RegExp(U.source),H=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,ot=/\s/,it=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ut=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,yt=/^0o[0-7]+$/i,_t=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",Tt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ot="\\u2700-\\u27bf",wt="a-z\\xdf-\\xf6\\xf8-\\xff",Ct="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",Et="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rt="["+bt+"]",xt="["+Et+"]",It="["+Tt+"]",St="\\d+",Mt="["+Ot+"]",Nt="["+wt+"]",Dt="[^"+bt+Et+St+Ot+wt+Ct+"]",Lt="\\ud83c[\\udffb-\\udfff]",Gt="[^"+bt+"]",jt="(?:\\ud83c[\\udde6-\\uddff]){2}",Yt="[\\ud800-\\udbff][\\udc00-\\udfff]",Pt="["+Ct+"]",Qt="\\u200d",$t="(?:"+Nt+"|"+Dt+")",Wt="(?:"+Pt+"|"+Dt+")",Bt="(?:['’](?:d|ll|m|re|s|t|ve))?",qt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ft="(?:"+It+"|"+Lt+")?",Ut="["+At+"]?",Vt=Ut+Ft+"(?:"+Qt+"(?:"+[Gt,jt,Yt].join("|")+")"+Ut+Ft+")*",zt="(?:"+[Mt,jt,Yt].join("|")+")"+Vt,Ht="(?:"+[Gt+It+"?",It,jt,Yt,Rt].join("|")+")",Kt=RegExp("['’]","g"),Zt=RegExp(It,"g"),Jt=RegExp(Lt+"(?="+Lt+")|"+Ht+Vt,"g"),Xt=RegExp([Pt+"?"+Nt+"+"+Bt+"(?="+[xt,Pt,"$"].join("|")+")",Wt+"+"+qt+"(?="+[xt,Pt+$t,"$"].join("|")+")",Pt+"?"+$t+"+"+Bt,Pt+"+"+qt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",St,zt].join("|"),"g"),te=RegExp("["+Qt+bt+Tt+At+"]"),ee=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],re=-1,oe={};oe[N]=oe[D]=oe[L]=oe[G]=oe[j]=oe[Y]=oe[P]=oe[Q]=oe[$]=!0,oe[g]=oe[y]=oe[S]=oe[_]=oe[M]=oe[m]=oe[v]=oe[k]=oe[T]=oe[O]=oe[w]=oe[A]=oe[E]=oe[R]=oe[I]=!1;var ie={};ie[g]=ie[y]=ie[S]=ie[M]=ie[_]=ie[m]=ie[N]=ie[D]=ie[L]=ie[G]=ie[j]=ie[T]=ie[O]=ie[w]=ie[A]=ie[E]=ie[R]=ie[x]=ie[Y]=ie[P]=ie[Q]=ie[$]=!0,ie[v]=ie[k]=ie[I]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ae=parseFloat,se=parseInt,ce="object"==typeof global&&global&&global.Object===Object&&global,le="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||le||Function("return this")(),pe=e&&!e.nodeType&&e,de=pe&&t&&!t.nodeType&&t,he=de&&de.exports===pe,ge=he&&ce.process,ye=function(){try{return de&&de.require&&de.require("util").types||ge&&ge.binding&&ge.binding("util")}catch(t){}}(),_e=ye&&ye.isArrayBuffer,me=ye&&ye.isDate,ve=ye&&ye.isMap,ke=ye&&ye.isRegExp,be=ye&&ye.isSet,Te=ye&&ye.isTypedArray;function Oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function we(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var u=t[o];e(r,u,n(u),t)}return r}function Ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Ae(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ee(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Re(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var u=t[n];e(u,n,t)&&(i[o++]=u)}return i}function xe(t,e){return!(null==t||!t.length)&&Pe(t,e,0)>-1}function Ie(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}function Se(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function Me(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}function Ne(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function De(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}function Le(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Ge=Be("length");function je(t,e,n){var r;return n(t,function(t,n,o){if(e(t,n,o))return r=n,!1}),r}function Ye(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function Pe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):Ye(t,$e,n)}function Qe(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}function $e(t){return t!=t}function We(t,e){var n=null==t?0:t.length;return n?Ue(t,e)/n:p}function Be(t){return function(e){return null==e?o:e[t]}}function qe(t){return function(e){return null==t?o:t[e]}}function Fe(t,e,n,r,o){return o(t,function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)}),n}function Ue(t,e){for(var n,r=-1,i=t.length;++r<i;){var u=e(t[r]);u!==o&&(n=n===o?u:n+u)}return n}function Ve(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function ze(t){return t?t.slice(0,pn(t)+1).replace(rt,""):t}function He(t){return function(e){return t(e)}}function Ke(t,e){return Se(e,function(e){return t[e]})}function Ze(t,e){return t.has(e)}function Je(t,e){for(var n=-1,r=t.length;++n<r&&Pe(e,t[n],0)>-1;);return n}function Xe(t,e){for(var n=t.length;n--&&Pe(e,t[n],0)>-1;);return n}var tn=qe({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),en=qe({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(t){return"\\"+ue[t]}function rn(t){return te.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function un(t,e){return function(n){return t(e(n))}}function an(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var u=t[n];u!==e&&u!==a||(t[n]=a,i[o++]=n)}return i}function sn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function ln(t){return rn(t)?function(t){for(var e=Jt.lastIndex=0;Jt.test(t);)++e;return e}(t):Ge(t)}function fn(t){return rn(t)?function(t){return t.match(Jt)||[]}(t):function(t){return t.split("")}(t)}function pn(t){for(var e=t.length;e--&&ot.test(t.charAt(e)););return e}var dn=qe({"&":"&","<":"<",">":">",""":'"',"'":"'"}),hn=function t(e){var n,r=(e=null==e?fe:hn.defaults(fe.Object(),e,hn.pick(fe,ne))).Array,ot=e.Date,bt=e.Error,Tt=e.Function,Ot=e.Math,wt=e.Object,Ct=e.RegExp,At=e.String,Et=e.TypeError,Rt=r.prototype,xt=Tt.prototype,It=wt.prototype,St=e["__core-js_shared__"],Mt=xt.toString,Nt=It.hasOwnProperty,Dt=0,Lt=(n=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Gt=It.toString,jt=Mt.call(wt),Yt=fe._,Pt=Ct("^"+Mt.call(Nt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=he?e.Buffer:o,$t=e.Symbol,Wt=e.Uint8Array,Bt=Qt?Qt.allocUnsafe:o,qt=un(wt.getPrototypeOf,wt),Ft=wt.create,Ut=It.propertyIsEnumerable,Vt=Rt.splice,zt=$t?$t.isConcatSpreadable:o,Ht=$t?$t.iterator:o,Jt=$t?$t.toStringTag:o,te=function(){try{var t=ci(wt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=e.clearTimeout!==fe.clearTimeout&&e.clearTimeout,ce=ot&&ot.now!==fe.Date.now&&ot.now,le=e.setTimeout!==fe.setTimeout&&e.setTimeout,pe=Ot.ceil,de=Ot.floor,ge=wt.getOwnPropertySymbols,ye=Qt?Qt.isBuffer:o,Ge=e.isFinite,qe=Rt.join,gn=un(wt.keys,wt),yn=Ot.max,_n=Ot.min,mn=ot.now,vn=e.parseInt,kn=Ot.random,bn=Rt.reverse,Tn=ci(e,"DataView"),On=ci(e,"Map"),wn=ci(e,"Promise"),Cn=ci(e,"Set"),An=ci(e,"WeakMap"),En=ci(wt,"create"),Rn=An&&new An,xn={},In=ji(Tn),Sn=ji(On),Mn=ji(wn),Nn=ji(Cn),Dn=ji(An),Ln=$t?$t.prototype:o,Gn=Ln?Ln.valueOf:o,jn=Ln?Ln.toString:o;function Yn(t){if(ta(t)&&!Bu(t)&&!(t instanceof Wn)){if(t instanceof $n)return t;if(Nt.call(t,"__wrapped__"))return Yi(t)}return new $n(t)}var Pn=function(){function t(){}return function(e){if(!Xu(e))return{};if(Ft)return Ft(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function Qn(){}function $n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Wn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Bn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Fn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Un(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Fn;++e<n;)this.add(t[e])}function Vn(t){var e=this.__data__=new qn(t);this.size=e.size}function zn(t,e){var n=Bu(t),r=!n&&Wu(t),o=!n&&!r&&Vu(t),i=!n&&!r&&!o&&sa(t),u=n||r||o||i,a=u?Ve(t.length,At):[],s=a.length;for(var c in t)!e&&!Nt.call(t,c)||u&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yi(c,s))||a.push(c);return a}function Hn(t){var e=t.length;return e?t[Fr(0,e-1)]:o}function Kn(t,e){return Mi(Eo(t),ir(e,0,t.length))}function Zn(t){return Mi(Eo(t))}function Jn(t,e,n){(n!==o&&!Pu(t[e],n)||n===o&&!(e in t))&&rr(t,e,n)}function Xn(t,e,n){var r=t[e];Nt.call(t,e)&&Pu(r,n)&&(n!==o||e in t)||rr(t,e,n)}function tr(t,e){for(var n=t.length;n--;)if(Pu(t[n][0],e))return n;return-1}function er(t,e,n,r){return lr(t,function(t,o,i){e(r,t,n(t),i)}),r}function nr(t,e){return t&&Ro(e,Ia(e),t)}function rr(t,e,n){"__proto__"==e&&te?te(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function or(t,e){for(var n=-1,i=e.length,u=r(i),a=null==t;++n<i;)u[n]=a?o:Ca(t,e[n]);return u}function ir(t,e,n){return t==t&&(n!==o&&(t=t<=n?t:n),e!==o&&(t=t>=e?t:e)),t}function ur(t,e,n,r,i,u){var a,s=1&e,c=2&e,l=4&e;if(n&&(a=i?n(t,r,i,u):n(t)),a!==o)return a;if(!Xu(t))return t;var f=Bu(t);if(f){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Nt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Eo(t,a)}else{var p=pi(t),d=p==k||p==b;if(Vu(t))return bo(t,s);if(p==w||p==g||d&&!i){if(a=c||d?{}:hi(t),!s)return c?function(t,e){return Ro(t,fi(t),e)}(t,function(t,e){return t&&Ro(e,Sa(e),t)}(a,t)):function(t,e){return Ro(t,li(t),e)}(t,nr(a,t))}else{if(!ie[p])return i?t:{};a=function(t,e,n){var r,o=t.constructor;switch(e){case S:return To(t);case _:case m:return new o(+t);case M:return function(t,e){var n=e?To(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case N:case D:case L:case G:case j:case Y:case P:case Q:case $:return Oo(t,n);case T:return new o;case O:case R:return new o(t);case A:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case E:return new o;case x:return r=t,Gn?wt(Gn.call(r)):{}}}(t,p,s)}}u||(u=new Vn);var h=u.get(t);if(h)return h;u.set(t,a),ia(t)?t.forEach(function(r){a.add(ur(r,e,n,r,t,u))}):ea(t)&&t.forEach(function(r,o){a.set(o,ur(r,e,n,o,t,u))});var y=f?o:(l?c?ni:ei:c?Sa:Ia)(t);return Ce(y||t,function(r,o){y&&(r=t[o=r]),Xn(a,o,ur(r,e,n,o,t,u))}),a}function ar(t,e,n){var r=n.length;if(null==t)return!r;for(t=wt(t);r--;){var i=n[r],u=e[i],a=t[i];if(a===o&&!(i in t)||!u(a))return!1}return!0}function sr(t,e,n){if("function"!=typeof t)throw new Et(i);return Ri(function(){t.apply(o,n)},e)}function cr(t,e,n,r){var o=-1,i=xe,u=!0,a=t.length,s=[],c=e.length;if(!a)return s;n&&(e=Se(e,He(n))),r?(i=Ie,u=!1):e.length>=200&&(i=Ze,u=!1,e=new Un(e));t:for(;++o<a;){var l=t[o],f=null==n?l:n(l);if(l=r||0!==l?l:0,u&&f==f){for(var p=c;p--;)if(e[p]===f)continue t;s.push(l)}else i(e,f,r)||s.push(l)}return s}Yn.templateSettings={escape:H,evaluate:K,interpolate:Z,variable:"",imports:{_:Yn}},Yn.prototype=Qn.prototype,Yn.prototype.constructor=Yn,$n.prototype=Pn(Qn.prototype),$n.prototype.constructor=$n,Wn.prototype=Pn(Qn.prototype),Wn.prototype.constructor=Wn,Bn.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Bn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Bn.prototype.get=function(t){var e=this.__data__;if(En){var n=e[t];return n===u?o:n}return Nt.call(e,t)?e[t]:o},Bn.prototype.has=function(t){var e=this.__data__;return En?e[t]!==o:Nt.call(e,t)},Bn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=En&&e===o?u:e,this},qn.prototype.clear=function(){this.__data__=[],this.size=0},qn.prototype.delete=function(t){var e=this.__data__,n=tr(e,t);return!(n<0||(n==e.length-1?e.pop():Vt.call(e,n,1),--this.size,0))},qn.prototype.get=function(t){var e=this.__data__,n=tr(e,t);return n<0?o:e[n][1]},qn.prototype.has=function(t){return tr(this.__data__,t)>-1},qn.prototype.set=function(t,e){var n=this.__data__,r=tr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Bn,map:new(On||qn),string:new Bn}},Fn.prototype.delete=function(t){var e=ai(this,t).delete(t);return this.size-=e?1:0,e},Fn.prototype.get=function(t){return ai(this,t).get(t)},Fn.prototype.has=function(t){return ai(this,t).has(t)},Fn.prototype.set=function(t,e){var n=ai(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Un.prototype.add=Un.prototype.push=function(t){return this.__data__.set(t,u),this},Un.prototype.has=function(t){return this.__data__.has(t)},Vn.prototype.clear=function(){this.__data__=new qn,this.size=0},Vn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Vn.prototype.get=function(t){return this.__data__.get(t)},Vn.prototype.has=function(t){return this.__data__.has(t)},Vn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!On||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Fn(r)}return n.set(t,e),this.size=n.size,this};var lr=So(mr),fr=So(vr,!0);function pr(t,e){var n=!0;return lr(t,function(t,r,o){return n=!!e(t,r,o)}),n}function dr(t,e,n){for(var r=-1,i=t.length;++r<i;){var u=t[r],a=e(u);if(null!=a&&(s===o?a==a&&!aa(a):n(a,s)))var s=a,c=u}return c}function hr(t,e){var n=[];return lr(t,function(t,r,o){e(t,r,o)&&n.push(t)}),n}function gr(t,e,n,r,o){var i=-1,u=t.length;for(n||(n=gi),o||(o=[]);++i<u;){var a=t[i];e>0&&n(a)?e>1?gr(a,e-1,n,r,o):Me(o,a):r||(o[o.length]=a)}return o}var yr=Mo(),_r=Mo(!0);function mr(t,e){return t&&yr(t,e,Ia)}function vr(t,e){return t&&_r(t,e,Ia)}function kr(t,e){return Re(e,function(e){return Ku(t[e])})}function br(t,e){for(var n=0,r=(e=_o(e,t)).length;null!=t&&n<r;)t=t[Gi(e[n++])];return n&&n==r?t:o}function Tr(t,e,n){var r=e(t);return Bu(t)?r:Me(r,n(t))}function Or(t){return null==t?t===o?"[object Undefined]":"[object Null]":Jt&&Jt in wt(t)?function(t){var e=Nt.call(t,Jt),n=t[Jt];try{t[Jt]=o;var r=!0}catch(t){}var i=Gt.call(t);return r&&(e?t[Jt]=n:delete t[Jt]),i}(t):function(t){return Gt.call(t)}(t)}function wr(t,e){return t>e}function Cr(t,e){return null!=t&&Nt.call(t,e)}function Ar(t,e){return null!=t&&e in wt(t)}function Er(t,e,n){for(var i=n?Ie:xe,u=t[0].length,a=t.length,s=a,c=r(a),l=1/0,f=[];s--;){var p=t[s];s&&e&&(p=Se(p,He(e))),l=_n(p.length,l),c[s]=!n&&(e||u>=120&&p.length>=120)?new Un(s&&p):o}p=t[0];var d=-1,h=c[0];t:for(;++d<u&&f.length<l;){var g=p[d],y=e?e(g):g;if(g=n||0!==g?g:0,!(h?Ze(h,y):i(f,y,n))){for(s=a;--s;){var _=c[s];if(!(_?Ze(_,y):i(t[s],y,n)))continue t}h&&h.push(y),f.push(g)}}return f}function Rr(t,e,n){var r=null==(t=Ci(t,e=_o(e,t)))?t:t[Gi(Hi(e))];return null==r?o:Oe(r,t,n)}function xr(t){return ta(t)&&Or(t)==g}function Ir(t,e,n,r,i){return t===e||(null==t||null==e||!ta(t)&&!ta(e)?t!=t&&e!=e:function(t,e,n,r,i,u){var a=Bu(t),s=Bu(e),c=a?y:pi(t),l=s?y:pi(e),f=(c=c==g?w:c)==w,p=(l=l==g?w:l)==w,d=c==l;if(d&&Vu(t)){if(!Vu(e))return!1;a=!0,f=!1}if(d&&!f)return u||(u=new Vn),a||sa(t)?Xo(t,e,n,r,i,u):function(t,e,n,r,o,i,u){switch(n){case M:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case S:return!(t.byteLength!=e.byteLength||!i(new Wt(t),new Wt(e)));case _:case m:case O:return Pu(+t,+e);case v:return t.name==e.name&&t.message==e.message;case A:case R:return t==e+"";case T:var a=on;case E:var s=1&r;if(a||(a=sn),t.size!=e.size&&!s)return!1;var c=u.get(t);if(c)return c==e;r|=2,u.set(t,e);var l=Xo(a(t),a(e),r,o,i,u);return u.delete(t),l;case x:if(Gn)return Gn.call(t)==Gn.call(e)}return!1}(t,e,c,n,r,i,u);if(!(1&n)){var h=f&&Nt.call(t,"__wrapped__"),k=p&&Nt.call(e,"__wrapped__");if(h||k){var b=h?t.value():t,C=k?e.value():e;return u||(u=new Vn),i(b,C,n,r,u)}}return!!d&&(u||(u=new Vn),function(t,e,n,r,i,u){var a=1&n,s=ei(t),c=s.length;if(c!=ei(e).length&&!a)return!1;for(var l=c;l--;){var f=s[l];if(!(a?f in e:Nt.call(e,f)))return!1}var p=u.get(t),d=u.get(e);if(p&&d)return p==e&&d==t;var h=!0;u.set(t,e),u.set(e,t);for(var g=a;++l<c;){var y=t[f=s[l]],_=e[f];if(r)var m=a?r(_,y,f,e,t,u):r(y,_,f,t,e,u);if(!(m===o?y===_||i(y,_,n,r,u):m)){h=!1;break}g||(g="constructor"==f)}if(h&&!g){var v=t.constructor,k=e.constructor;v==k||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof k&&k instanceof k||(h=!1)}return u.delete(t),u.delete(e),h}(t,e,n,r,i,u))}(t,e,n,r,Ir,i))}function Sr(t,e,n,r){var i=n.length,u=i,a=!r;if(null==t)return!u;for(t=wt(t);i--;){var s=n[i];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<u;){var c=(s=n[i])[0],l=t[c],f=s[1];if(a&&s[2]){if(l===o&&!(c in t))return!1}else{var p=new Vn;if(r)var d=r(l,f,c,t,e,p);if(!(d===o?Ir(f,l,3,r,p):d))return!1}}return!0}function Mr(t){return!(!Xu(t)||(e=t,Lt&&Lt in e))&&(Ku(t)?Pt:gt).test(ji(t));var e}function Nr(t){return"function"==typeof t?t:null==t?ns:"object"==typeof t?Bu(t)?Yr(t[0],t[1]):jr(t):fs(t)}function Dr(t){if(!bi(t))return gn(t);var e=[];for(var n in wt(t))Nt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Lr(t,e){return t<e}function Gr(t,e){var n=-1,o=Fu(t)?r(t.length):[];return lr(t,function(t,r,i){o[++n]=e(t,r,i)}),o}function jr(t){var e=si(t);return 1==e.length&&e[0][2]?Oi(e[0][0],e[0][1]):function(n){return n===t||Sr(n,t,e)}}function Yr(t,e){return mi(t)&&Ti(e)?Oi(Gi(t),e):function(n){var r=Ca(n,t);return r===o&&r===e?Aa(n,t):Ir(e,r,3)}}function Pr(t,e,n,r,i){t!==e&&yr(e,function(u,a){if(i||(i=new Vn),Xu(u))!function(t,e,n,r,i,u,a){var s=Ai(t,n),c=Ai(e,n),l=a.get(c);if(l)Jn(t,n,l);else{var f=u?u(s,c,n+"",t,e,a):o,p=f===o;if(p){var d=Bu(c),h=!d&&Vu(c),g=!d&&!h&&sa(c);f=c,d||h||g?Bu(s)?f=s:Uu(s)?f=Eo(s):h?(p=!1,f=bo(c,!0)):g?(p=!1,f=Oo(c,!0)):f=[]:ra(c)||Wu(c)?(f=s,Wu(s)?f=ya(s):Xu(s)&&!Ku(s)||(f=hi(c))):p=!1}p&&(a.set(c,f),i(f,c,r,u,a),a.delete(c)),Jn(t,n,f)}}(t,e,a,n,Pr,r,i);else{var s=r?r(Ai(t,a),u,a+"",t,e,i):o;s===o&&(s=u),Jn(t,a,s)}},Sa)}function Qr(t,e){var n=t.length;if(n)return yi(e+=e<0?n:0,n)?t[e]:o}function $r(t,e,n){e=e.length?Se(e,function(t){return Bu(t)?function(e){return br(e,1===t.length?t[0]:t)}:t}):[ns];var r=-1;e=Se(e,He(ui()));var o=Gr(t,function(t,n,o){var i=Se(e,function(e){return e(t)});return{criteria:i,index:++r,value:t}});return function(t){var e=t.length;for(t.sort(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,u=o.length,a=n.length;++r<u;){var s=wo(o[r],i[r]);if(s)return r>=a?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)});e--;)t[e]=t[e].value;return t}(o)}function Wr(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var u=e[r],a=br(t,u);n(a,u)&&Kr(i,_o(u,t),a)}return i}function Br(t,e,n,r){var o=r?Qe:Pe,i=-1,u=e.length,a=t;for(t===e&&(e=Eo(e)),n&&(a=Se(t,He(n)));++i<u;)for(var s=0,c=e[i],l=n?n(c):c;(s=o(a,l,s,r))>-1;)a!==t&&Vt.call(a,s,1),Vt.call(t,s,1);return t}function qr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;yi(o)?Vt.call(t,o,1):so(t,o)}}return t}function Fr(t,e){return t+de(kn()*(e-t+1))}function Ur(t,e){var n="";if(!t||e<1||e>f)return n;do{e%2&&(n+=t),(e=de(e/2))&&(t+=t)}while(e);return n}function Vr(t,e){return xi(wi(t,e,ns),t+"")}function zr(t){return Hn(Pa(t))}function Hr(t,e){var n=Pa(t);return Mi(n,ir(e,0,n.length))}function Kr(t,e,n,r){if(!Xu(t))return t;for(var i=-1,u=(e=_o(e,t)).length,a=u-1,s=t;null!=s&&++i<u;){var c=Gi(e[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(i!=a){var f=s[c];(l=r?r(f,c,s):o)===o&&(l=Xu(f)?f:yi(e[i+1])?[]:{})}Xn(s,c,l),s=s[c]}return t}var Zr=Rn?function(t,e){return Rn.set(t,e),t}:ns,Jr=te?function(t,e){return te(t,"toString",{configurable:!0,enumerable:!1,value:Xa(e),writable:!0})}:ns;function Xr(t){return Mi(Pa(t))}function to(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var u=r(i);++o<i;)u[o]=t[o+e];return u}function eo(t,e){var n;return lr(t,function(t,r,o){return!(n=e(t,r,o))}),!!n}function no(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=2147483647){for(;r<o;){var i=r+o>>>1,u=t[i];null!==u&&!aa(u)&&(n?u<=e:u<e)?r=i+1:o=i}return o}return ro(t,e,ns,n)}function ro(t,e,n,r){var i=0,u=null==t?0:t.length;if(0===u)return 0;for(var a=(e=n(e))!=e,s=null===e,c=aa(e),l=e===o;i<u;){var f=de((i+u)/2),p=n(t[f]),d=p!==o,h=null===p,g=p==p,y=aa(p);if(a)var _=r||g;else _=l?g&&(r||d):s?g&&d&&(r||!h):c?g&&d&&!h&&(r||!y):!h&&!y&&(r?p<=e:p<e);_?i=f+1:u=f}return _n(u,4294967294)}function oo(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var u=t[n],a=e?e(u):u;if(!n||!Pu(a,s)){var s=a;i[o++]=0===u?0:u}}return i}function io(t){return"number"==typeof t?t:aa(t)?p:+t}function uo(t){if("string"==typeof t)return t;if(Bu(t))return Se(t,uo)+"";if(aa(t))return jn?jn.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ao(t,e,n){var r=-1,o=xe,i=t.length,u=!0,a=[],s=a;if(n)u=!1,o=Ie;else if(i>=200){var c=e?null:Vo(t);if(c)return sn(c);u=!1,o=Ze,s=new Un}else s=e?[]:a;t:for(;++r<i;){var l=t[r],f=e?e(l):l;if(l=n||0!==l?l:0,u&&f==f){for(var p=s.length;p--;)if(s[p]===f)continue t;e&&s.push(f),a.push(l)}else o(s,f,n)||(s!==a&&s.push(f),a.push(l))}return a}function so(t,e){var n=-1,r=(e=_o(e,t)).length;if(!r)return!0;for(;++n<r;){var o=Gi(e[n]);if("__proto__"===o&&!Nt.call(t,"__proto__"))return!1;if(("constructor"===o||"prototype"===o)&&n<r-1)return!1}var i=Ci(t,e);return null==i||delete i[Gi(Hi(e))]}function co(t,e,n,r){return Kr(t,e,n(br(t,e)),r)}function lo(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?to(t,r?0:i,r?i+1:o):to(t,r?i+1:0,r?o:i)}function fo(t,e){var n=t;return n instanceof Wn&&(n=n.value()),Ne(e,function(t,e){return e.func.apply(e.thisArg,Me([t],e.args))},n)}function po(t,e,n){var o=t.length;if(o<2)return o?ao(t[0]):[];for(var i=-1,u=r(o);++i<o;)for(var a=t[i],s=-1;++s<o;)s!=i&&(u[i]=cr(u[i]||a,t[s],e,n));return ao(gr(u,1),e,n)}function ho(t,e,n){for(var r=-1,i=t.length,u=e.length,a={};++r<i;){var s=r<u?e[r]:o;n(a,t[r],s)}return a}function go(t){return Uu(t)?t:[]}function yo(t){return"function"==typeof t?t:ns}function _o(t,e){return Bu(t)?t:mi(t,e)?[t]:Li(_a(t))}var mo=Vr;function vo(t,e,n){var r=t.length;return n=n===o?r:n,!e&&n>=r?t:to(t,e,n)}var ko=ue||function(t){return fe.clearTimeout(t)};function bo(t,e){if(e)return t.slice();var n=t.length,r=Bt?Bt(n):new t.constructor(n);return t.copy(r),r}function To(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Oo(t,e){var n=e?To(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function wo(t,e){if(t!==e){var n=t!==o,r=null===t,i=t==t,u=aa(t),a=e!==o,s=null===e,c=e==e,l=aa(e);if(!s&&!l&&!u&&t>e||u&&a&&c&&!s&&!l||r&&a&&c||!n&&c||!i)return 1;if(!r&&!u&&!l&&t<e||l&&n&&i&&!r&&!u||s&&n&&i||!a&&i||!c)return-1}return 0}function Co(t,e,n,o){for(var i=-1,u=t.length,a=n.length,s=-1,c=e.length,l=yn(u-a,0),f=r(c+l),p=!o;++s<c;)f[s]=e[s];for(;++i<a;)(p||i<u)&&(f[n[i]]=t[i]);for(;l--;)f[s++]=t[i++];return f}function Ao(t,e,n,o){for(var i=-1,u=t.length,a=-1,s=n.length,c=-1,l=e.length,f=yn(u-s,0),p=r(f+l),d=!o;++i<f;)p[i]=t[i];for(var h=i;++c<l;)p[h+c]=e[c];for(;++a<s;)(d||i<u)&&(p[h+n[a]]=t[i++]);return p}function Eo(t,e){var n=-1,o=t.length;for(e||(e=r(o));++n<o;)e[n]=t[n];return e}function Ro(t,e,n,r){var i=!n;n||(n={});for(var u=-1,a=e.length;++u<a;){var s=e[u],c=r?r(n[s],t[s],s,n,t):o;c===o&&(c=t[s]),i?rr(n,s,c):Xn(n,s,c)}return n}function xo(t,e){return function(n,r){var o=Bu(n)?we:er,i=e?e():{};return o(n,t,ui(r,2),i)}}function Io(t){return Vr(function(e,n){var r=-1,i=n.length,u=i>1?n[i-1]:o,a=i>2?n[2]:o;for(u=t.length>3&&"function"==typeof u?(i--,u):o,a&&_i(n[0],n[1],a)&&(u=i<3?o:u,i=1),e=wt(e);++r<i;){var s=n[r];s&&t(e,s,r,u)}return e})}function So(t,e){return function(n,r){if(null==n)return n;if(!Fu(n))return t(n,r);for(var o=n.length,i=e?o:-1,u=wt(n);(e?i--:++i<o)&&!1!==r(u[i],i,u););return n}}function Mo(t){return function(e,n,r){for(var o=-1,i=wt(e),u=r(e),a=u.length;a--;){var s=u[t?a:++o];if(!1===n(i[s],s,i))break}return e}}function No(t){return function(e){var n=rn(e=_a(e))?fn(e):o,r=n?n[0]:e.charAt(0),i=n?vo(n,1).join(""):e.slice(1);return r[t]()+i}}function Do(t){return function(e){return Ne(Ka(Wa(e).replace(Kt,"")),t,"")}}function Lo(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Pn(t.prototype),r=t.apply(n,e);return Xu(r)?r:n}}function Go(t){return function(e,n,r){var i=wt(e);if(!Fu(e)){var u=ui(n,3);e=Ia(e),n=function(t){return u(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[u?e[a]:a]:o}}function jo(t){return ti(function(e){var n=e.length,r=n,u=$n.prototype.thru;for(t&&e.reverse();r--;){var a=e[r];if("function"!=typeof a)throw new Et(i);if(u&&!s&&"wrapper"==oi(a))var s=new $n([],!0)}for(r=s?r:n;++r<n;){var c=oi(a=e[r]),l="wrapper"==c?ri(a):o;s=l&&vi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?s[oi(l[0])].apply(s,l[3]):1==a.length&&vi(a)?s[c]():s.thru(a)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&Bu(r))return s.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}})}function Yo(t,e,n,i,u,a,s,l,f,p){var d=e&c,h=1&e,g=2&e,y=24&e,_=512&e,m=g?o:Lo(t);return function c(){for(var v=arguments.length,k=r(v),b=v;b--;)k[b]=arguments[b];if(y)var T=ii(c),O=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(k,T);if(i&&(k=Co(k,i,u,y)),a&&(k=Ao(k,a,s,y)),v-=O,y&&v<p){var w=an(k,T);return Fo(t,e,Yo,c.placeholder,n,k,w,l,f,p-v)}var C=h?n:this,A=g?C[t]:t;return v=k.length,l?k=function(t,e){for(var n=t.length,r=_n(e.length,n),i=Eo(t);r--;){var u=e[r];t[r]=yi(u,n)?i[u]:o}return t}(k,l):_&&v>1&&k.reverse(),d&&f<v&&(k.length=f),this&&this!==fe&&this instanceof c&&(A=m||Lo(A)),A.apply(C,k)}}function Po(t,e){return function(n,r){return function(t,e,n,r){return mr(t,function(t,o,i){e(r,n(t),o,i)}),r}(n,t,e(r),{})}}function Qo(t,e){return function(n,r){var i;if(n===o&&r===o)return e;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=uo(n),r=uo(r)):(n=io(n),r=io(r)),i=t(n,r)}return i}}function $o(t){return ti(function(e){return e=Se(e,He(ui())),Vr(function(n){var r=this;return t(e,function(t){return Oe(t,r,n)})})})}function Wo(t,e){var n=(e=e===o?" ":uo(e)).length;if(n<2)return n?Ur(e,t):e;var r=Ur(e,pe(t/ln(e)));return rn(e)?vo(fn(r),0,t).join(""):r.slice(0,t)}function Bo(t){return function(e,n,i){return i&&"number"!=typeof i&&_i(e,n,i)&&(n=i=o),e=pa(e),n===o?(n=e,e=0):n=pa(n),function(t,e,n,o){for(var i=-1,u=yn(pe((e-t)/(n||1)),0),a=r(u);u--;)a[o?u:++i]=t,t+=n;return a}(e,n,i=i===o?e<n?1:-1:pa(i),t)}}function qo(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ga(e),n=ga(n)),t(e,n)}}function Fo(t,e,n,r,i,u,a,c,l,f){var p=8&e;e|=p?s:64,4&(e&=~(p?64:s))||(e&=-4);var d=[t,e,i,p?u:o,p?a:o,p?o:u,p?o:a,c,l,f],h=n.apply(o,d);return vi(t)&&Ei(h,d),h.placeholder=r,Ii(h,t,e)}function Uo(t){var e=Ot[t];return function(t,n){if(t=ga(t),(n=null==n?0:_n(da(n),292))&&Ge(t)){var r=(_a(t)+"e").split("e");return+((r=(_a(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Vo=Cn&&1/sn(new Cn([,-0]))[1]==l?function(t){return new Cn(t)}:as;function zo(t){return function(e){var n=pi(e);return n==T?on(e):n==E?cn(e):function(t,e){return Se(e,function(e){return[e,t[e]]})}(e,t(e))}}function Ho(t,e,n,u,l,f,p,d){var h=2&e;if(!h&&"function"!=typeof t)throw new Et(i);var g=u?u.length:0;if(g||(e&=-97,u=l=o),p=p===o?p:yn(da(p),0),d=d===o?d:da(d),g-=l?l.length:0,64&e){var y=u,_=l;u=l=o}var m=h?o:ri(t),v=[t,e,n,u,l,y,_,f,p,d];if(m&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<131,u=r==c&&8==n||r==c&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!i&&!u)return t;1&r&&(t[2]=e[2],o|=1&n?0:4);var s=e[3];if(s){var l=t[3];t[3]=l?Co(l,s,e[4]):s,t[4]=l?an(t[3],a):e[4]}(s=e[5])&&(l=t[5],t[5]=l?Ao(l,s,e[6]):s,t[6]=l?an(t[5],a):e[6]),(s=e[7])&&(t[7]=s),r&c&&(t[8]=null==t[8]?e[8]:_n(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(v,m),t=v[0],e=v[1],n=v[2],u=v[3],l=v[4],!(d=v[9]=v[9]===o?h?0:t.length:yn(v[9]-g,0))&&24&e&&(e&=-25),e&&1!=e)k=8==e||16==e?function(t,e,n){var i=Lo(t);return function u(){for(var a=arguments.length,s=r(a),c=a,l=ii(u);c--;)s[c]=arguments[c];var f=a<3&&s[0]!==l&&s[a-1]!==l?[]:an(s,l);return(a-=f.length)<n?Fo(t,e,Yo,u.placeholder,o,s,f,o,o,n-a):Oe(this&&this!==fe&&this instanceof u?i:t,this,s)}}(t,e,d):e!=s&&33!=e||l.length?Yo.apply(o,v):function(t,e,n,o){var i=1&e,u=Lo(t);return function e(){for(var a=-1,s=arguments.length,c=-1,l=o.length,f=r(l+s),p=this&&this!==fe&&this instanceof e?u:t;++c<l;)f[c]=o[c];for(;s--;)f[c++]=arguments[++a];return Oe(p,i?n:this,f)}}(t,e,n,u);else var k=function(t,e,n){var r=1&e,o=Lo(t);return function e(){return(this&&this!==fe&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return Ii((m?Zr:Ei)(k,v),t,e)}function Ko(t,e,n,r){return t===o||Pu(t,It[n])&&!Nt.call(r,n)?e:t}function Zo(t,e,n,r,i,u){return Xu(t)&&Xu(e)&&(u.set(e,t),Pr(t,e,o,Zo,u),u.delete(e)),t}function Jo(t){return ra(t)?o:t}function Xo(t,e,n,r,i,u){var a=1&n,s=t.length,c=e.length;if(s!=c&&!(a&&c>s))return!1;var l=u.get(t),f=u.get(e);if(l&&f)return l==e&&f==t;var p=-1,d=!0,h=2&n?new Un:o;for(u.set(t,e),u.set(e,t);++p<s;){var g=t[p],y=e[p];if(r)var _=a?r(y,g,p,e,t,u):r(g,y,p,t,e,u);if(_!==o){if(_)continue;d=!1;break}if(h){if(!Le(e,function(t,e){if(!Ze(h,e)&&(g===t||i(g,t,n,r,u)))return h.push(e)})){d=!1;break}}else if(g!==y&&!i(g,y,n,r,u)){d=!1;break}}return u.delete(t),u.delete(e),d}function ti(t){return xi(wi(t,o,qi),t+"")}function ei(t){return Tr(t,Ia,li)}function ni(t){return Tr(t,Sa,fi)}var ri=Rn?function(t){return Rn.get(t)}:as;function oi(t){for(var e=t.name+"",n=xn[e],r=Nt.call(xn,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function ii(t){return(Nt.call(Yn,"placeholder")?Yn:t).placeholder}function ui(){var t=Yn.iteratee||rs;return t=t===rs?Nr:t,arguments.length?t(arguments[0],arguments[1]):t}function ai(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function si(t){for(var e=Ia(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ti(o)]}return e}function ci(t,e){var n=function(t,e){return null==t?o:t[e]}(t,e);return Mr(n)?n:o}var li=ge?function(t){return null==t?[]:(t=wt(t),Re(ge(t),function(e){return Ut.call(t,e)}))}:hs,fi=ge?function(t){for(var e=[];t;)Me(e,li(t)),t=qt(t);return e}:hs,pi=Or;function di(t,e,n){for(var r=-1,o=(e=_o(e,t)).length,i=!1;++r<o;){var u=Gi(e[r]);if(!(i=null!=t&&n(t,u)))break;t=t[u]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&Ju(o)&&yi(u,o)&&(Bu(t)||Wu(t))}function hi(t){return"function"!=typeof t.constructor||bi(t)?{}:Pn(qt(t))}function gi(t){return Bu(t)||Wu(t)||!!(zt&&t&&t[zt])}function yi(t,e){var n=typeof t;return!!(e=e??f)&&("number"==n||"symbol"!=n&&_t.test(t))&&t>-1&&t%1==0&&t<e}function _i(t,e,n){if(!Xu(n))return!1;var r=typeof e;return!!("number"==r?Fu(n)&&yi(e,n.length):"string"==r&&e in n)&&Pu(n[e],t)}function mi(t,e){if(Bu(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!aa(t))||X.test(t)||!J.test(t)||null!=e&&t in wt(e)}function vi(t){var e=oi(t),n=Yn[e];if("function"!=typeof n||!(e in Wn.prototype))return!1;if(t===n)return!0;var r=ri(n);return!!r&&t===r[0]}(Tn&&pi(new Tn(new ArrayBuffer(1)))!=M||On&&pi(new On)!=T||wn&&pi(wn.resolve())!=C||Cn&&pi(new Cn)!=E||An&&pi(new An)!=I)&&(pi=function(t){var e=Or(t),n=e==w?t.constructor:o,r=n?ji(n):"";if(r)switch(r){case In:return M;case Sn:return T;case Mn:return C;case Nn:return E;case Dn:return I}return e});var ki=St?Ku:gs;function bi(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||It)}function Ti(t){return t==t&&!Xu(t)}function Oi(t,e){return function(n){return null!=n&&n[t]===e&&(e!==o||t in wt(n))}}function wi(t,e,n){return e=yn(e===o?t.length-1:e,0),function(){for(var o=arguments,i=-1,u=yn(o.length-e,0),a=r(u);++i<u;)a[i]=o[e+i];i=-1;for(var s=r(e+1);++i<e;)s[i]=o[i];return s[e]=n(a),Oe(t,this,s)}}function Ci(t,e){return e.length<2?t:br(t,to(e,0,-1))}function Ai(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ei=Si(Zr),Ri=le||function(t,e){return fe.setTimeout(t,e)},xi=Si(Jr);function Ii(t,e,n){var r=e+"";return xi(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(it,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ce(h,function(n){var r="_."+n[0];e&n[1]&&!xe(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(ut);return e?e[1].split(at):[]}(r),n)))}function Si(t){var e=0,n=0;return function(){var r=mn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Mi(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n<e;){var u=Fr(n,i),a=t[u];t[u]=t[n],t[n]=a}return t.length=e,t}var Ni,Di,Li=(Ni=Nu(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,function(t,n,r,o){e.push(r?o.replace(lt,"$1"):n||t)}),e},function(t){return 500===Di.size&&Di.clear(),t}),Di=Ni.cache,Ni);function Gi(t){if("string"==typeof t||aa(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ji(t){if(null!=t){try{return Mt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Yi(t){if(t instanceof Wn)return t.clone();var e=new $n(t.__wrapped__,t.__chain__);return e.__actions__=Eo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Pi=Vr(function(t,e){return Uu(t)?cr(t,gr(e,1,Uu,!0)):[]}),Qi=Vr(function(t,e){var n=Hi(e);return Uu(n)&&(n=o),Uu(t)?cr(t,gr(e,1,Uu,!0),ui(n,2)):[]}),$i=Vr(function(t,e){var n=Hi(e);return Uu(n)&&(n=o),Uu(t)?cr(t,gr(e,1,Uu,!0),o,n):[]});function Wi(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=yn(r+o,0)),Ye(t,ui(e,3),o)}function Bi(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==o&&(i=da(n),i=n<0?yn(r+i,0):_n(i,r-1)),Ye(t,ui(e,3),i,!0)}function qi(t){return null!=t&&t.length?gr(t,1):[]}function Fi(t){return t&&t.length?t[0]:o}var Ui=Vr(function(t){var e=Se(t,go);return e.length&&e[0]===t[0]?Er(e):[]}),Vi=Vr(function(t){var e=Hi(t),n=Se(t,go);return e===Hi(n)?e=o:n.pop(),n.length&&n[0]===t[0]?Er(n,ui(e,2)):[]}),zi=Vr(function(t){var e=Hi(t),n=Se(t,go);return(e="function"==typeof e?e:o)&&n.pop(),n.length&&n[0]===t[0]?Er(n,o,e):[]});function Hi(t){var e=null==t?0:t.length;return e?t[e-1]:o}var Ki=Vr(Zi);function Zi(t,e){return t&&t.length&&e&&e.length?Br(t,e):t}var Ji=ti(function(t,e){var n=null==t?0:t.length,r=or(t,e);return qr(t,Se(e,function(t){return yi(t,n)?+t:t}).sort(wo)),r});function Xi(t){return null==t?t:bn.call(t)}var tu=Vr(function(t){return ao(gr(t,1,Uu,!0))}),eu=Vr(function(t){var e=Hi(t);return Uu(e)&&(e=o),ao(gr(t,1,Uu,!0),ui(e,2))}),nu=Vr(function(t){var e=Hi(t);return e="function"==typeof e?e:o,ao(gr(t,1,Uu,!0),o,e)});function ru(t){if(!t||!t.length)return[];var e=0;return t=Re(t,function(t){if(Uu(t))return e=yn(t.length,e),!0}),Ve(e,function(e){return Se(t,Be(e))})}function ou(t,e){if(!t||!t.length)return[];var n=ru(t);return null==e?n:Se(n,function(t){return Oe(e,o,t)})}var iu=Vr(function(t,e){return Uu(t)?cr(t,e):[]}),uu=Vr(function(t){return po(Re(t,Uu))}),au=Vr(function(t){var e=Hi(t);return Uu(e)&&(e=o),po(Re(t,Uu),ui(e,2))}),su=Vr(function(t){var e=Hi(t);return e="function"==typeof e?e:o,po(Re(t,Uu),o,e)}),cu=Vr(ru),lu=Vr(function(t){var e=t.length,n=e>1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,ou(t,n)});function fu(t){var e=Yn(t);return e.__chain__=!0,e}function pu(t,e){return e(t)}var du=ti(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return or(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Wn&&yi(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pu,args:[i],thisArg:o}),new $n(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(o),t})):this.thru(i)}),hu=xo(function(t,e,n){Nt.call(t,n)?++t[n]:rr(t,n,1)}),gu=Go(Wi),yu=Go(Bi);function _u(t,e){return(Bu(t)?Ce:lr)(t,ui(e,3))}function mu(t,e){return(Bu(t)?Ae:fr)(t,ui(e,3))}var vu=xo(function(t,e,n){Nt.call(t,n)?t[n].push(e):rr(t,n,[e])}),ku=Vr(function(t,e,n){var o=-1,i="function"==typeof e,u=Fu(t)?r(t.length):[];return lr(t,function(t){u[++o]=i?Oe(e,t,n):Rr(t,e,n)}),u}),bu=xo(function(t,e,n){rr(t,n,e)});function Tu(t,e){return(Bu(t)?Se:Gr)(t,ui(e,3))}var Ou=xo(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]}),wu=Vr(function(t,e){if(null==t)return[];var n=e.length;return n>1&&_i(t,e[0],e[1])?e=[]:n>2&&_i(e[0],e[1],e[2])&&(e=[e[0]]),$r(t,gr(e,1),[])}),Cu=ce||function(){return fe.Date.now()};function Au(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Ho(t,c,o,o,o,o,e)}function Eu(t,e){var n;if("function"!=typeof e)throw new Et(i);return t=da(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var Ru=Vr(function(t,e,n){var r=1;if(n.length){var o=an(n,ii(Ru));r|=s}return Ho(t,r,e,n,o)}),xu=Vr(function(t,e,n){var r=3;if(n.length){var o=an(n,ii(xu));r|=s}return Ho(e,r,t,n,o)});function Iu(t,e,n){var r,u,a,s,c,l,f=0,p=!1,d=!1,h=!0;if("function"!=typeof t)throw new Et(i);function g(e){var n=r,i=u;return r=u=o,f=e,s=t.apply(i,n)}function y(t){var n=t-l;return l===o||n>=e||n<0||d&&t-f>=a}function _(){var t=Cu();if(y(t))return m(t);c=Ri(_,function(t){var n=e-(t-l);return d?_n(n,a-(t-f)):n}(t))}function m(t){return c=o,h&&r?g(t):(r=u=o,s)}function v(){var t=Cu(),n=y(t);if(r=arguments,u=this,l=t,n){if(c===o)return function(t){return f=t,c=Ri(_,e),p?g(t):s}(l);if(d)return ko(c),c=Ri(_,e),g(l)}return c===o&&(c=Ri(_,e)),s}return e=ga(e)||0,Xu(n)&&(p=!!n.leading,a=(d="maxWait"in n)?yn(ga(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),v.cancel=function(){c!==o&&ko(c),f=0,r=l=u=c=o},v.flush=function(){return c===o?s:m(Cu())},v}var Su=Vr(function(t,e){return sr(t,1,e)}),Mu=Vr(function(t,e,n){return sr(t,ga(e)||0,n)});function Nu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Et(i);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var u=t.apply(this,r);return n.cache=i.set(o,u)||i,u};return n.cache=new(Nu.Cache||Fn),n}function Du(t){if("function"!=typeof t)throw new Et(i);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Nu.Cache=Fn;var Lu=mo(function(t,e){var n=(e=1==e.length&&Bu(e[0])?Se(e[0],He(ui())):Se(gr(e,1),He(ui()))).length;return Vr(function(r){for(var o=-1,i=_n(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Oe(t,this,r)})}),Gu=Vr(function(t,e){var n=an(e,ii(Gu));return Ho(t,s,o,e,n)}),ju=Vr(function(t,e){var n=an(e,ii(ju));return Ho(t,64,o,e,n)}),Yu=ti(function(t,e){return Ho(t,256,o,o,o,e)});function Pu(t,e){return t===e||t!=t&&e!=e}var Qu=qo(wr),$u=qo(function(t,e){return t>=e}),Wu=xr(function(){return arguments}())?xr:function(t){return ta(t)&&Nt.call(t,"callee")&&!Ut.call(t,"callee")},Bu=r.isArray,qu=_e?He(_e):function(t){return ta(t)&&Or(t)==S};function Fu(t){return null!=t&&Ju(t.length)&&!Ku(t)}function Uu(t){return ta(t)&&Fu(t)}var Vu=ye||gs,zu=me?He(me):function(t){return ta(t)&&Or(t)==m};function Hu(t){if(!ta(t))return!1;var e=Or(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ra(t)}function Ku(t){if(!Xu(t))return!1;var e=Or(t);return e==k||e==b||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Zu(t){return"number"==typeof t&&t==da(t)}function Ju(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function Xu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ta(t){return null!=t&&"object"==typeof t}var ea=ve?He(ve):function(t){return ta(t)&&pi(t)==T};function na(t){return"number"==typeof t||ta(t)&&Or(t)==O}function ra(t){if(!ta(t)||Or(t)!=w)return!1;var e=qt(t);if(null===e)return!0;var n=Nt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Mt.call(n)==jt}var oa=ke?He(ke):function(t){return ta(t)&&Or(t)==A},ia=be?He(be):function(t){return ta(t)&&pi(t)==E};function ua(t){return"string"==typeof t||!Bu(t)&&ta(t)&&Or(t)==R}function aa(t){return"symbol"==typeof t||ta(t)&&Or(t)==x}var sa=Te?He(Te):function(t){return ta(t)&&Ju(t.length)&&!!oe[Or(t)]},ca=qo(Lr),la=qo(function(t,e){return t<=e});function fa(t){if(!t)return[];if(Fu(t))return ua(t)?fn(t):Eo(t);if(Ht&&t[Ht])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Ht]());var e=pi(t);return(e==T?on:e==E?sn:Pa)(t)}function pa(t){return t?(t=ga(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function da(t){var e=pa(t),n=e%1;return e==e?n?e-n:e:0}function ha(t){return t?ir(da(t),0,d):0}function ga(t){if("number"==typeof t)return t;if(aa(t))return p;if(Xu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Xu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ze(t);var n=ht.test(t);return n||yt.test(t)?se(t.slice(2),n?2:8):dt.test(t)?p:+t}function ya(t){return Ro(t,Sa(t))}function _a(t){return null==t?"":uo(t)}var ma=Io(function(t,e){if(bi(e)||Fu(e))Ro(e,Ia(e),t);else for(var n in e)Nt.call(e,n)&&Xn(t,n,e[n])}),va=Io(function(t,e){Ro(e,Sa(e),t)}),ka=Io(function(t,e,n,r){Ro(e,Sa(e),t,r)}),ba=Io(function(t,e,n,r){Ro(e,Ia(e),t,r)}),Ta=ti(or),Oa=Vr(function(t,e){t=wt(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&_i(e[0],e[1],i)&&(r=1);++n<r;)for(var u=e[n],a=Sa(u),s=-1,c=a.length;++s<c;){var l=a[s],f=t[l];(f===o||Pu(f,It[l])&&!Nt.call(t,l))&&(t[l]=u[l])}return t}),wa=Vr(function(t){return t.push(o,Zo),Oe(Na,o,t)});function Ca(t,e,n){var r=null==t?o:br(t,e);return r===o?n:r}function Aa(t,e){return null!=t&&di(t,e,Ar)}var Ea=Po(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),t[e]=n},Xa(ns)),Ra=Po(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Gt.call(e)),Nt.call(t,e)?t[e].push(n):t[e]=[n]},ui),xa=Vr(Rr);function Ia(t){return Fu(t)?zn(t):Dr(t)}function Sa(t){return Fu(t)?zn(t,!0):function(t){if(!Xu(t))return function(t){var e=[];if(null!=t)for(var n in wt(t))e.push(n);return e}(t);var e=bi(t),n=[];for(var r in t)("constructor"!=r||!e&&Nt.call(t,r))&&n.push(r);return n}(t)}var Ma=Io(function(t,e,n){Pr(t,e,n)}),Na=Io(function(t,e,n,r){Pr(t,e,n,r)}),Da=ti(function(t,e){var n={};if(null==t)return n;var r=!1;e=Se(e,function(e){return e=_o(e,t),r||(r=e.length>1),e}),Ro(t,ni(t),n),r&&(n=ur(n,7,Jo));for(var o=e.length;o--;)so(n,e[o]);return n}),La=ti(function(t,e){return null==t?{}:function(t,e){return Wr(t,e,function(e,n){return Aa(t,n)})}(t,e)});function Ga(t,e){if(null==t)return{};var n=Se(ni(t),function(t){return[t]});return e=ui(e),Wr(t,n,function(t,n){return e(t,n[0])})}var ja=zo(Ia),Ya=zo(Sa);function Pa(t){return null==t?[]:Ke(t,Ia(t))}var Qa=Do(function(t,e,n){return e=e.toLowerCase(),t+(n?$a(e):e)});function $a(t){return Ha(_a(t).toLowerCase())}function Wa(t){return(t=_a(t))&&t.replace(mt,tn).replace(Zt,"")}var Ba=Do(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),qa=Do(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),Fa=No("toLowerCase"),Ua=Do(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}),Va=Do(function(t,e,n){return t+(n?" ":"")+Ha(e)}),za=Do(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Ha=No("toUpperCase");function Ka(t,e,n){return t=_a(t),(e=n?o:e)===o?function(t){return ee.test(t)}(t)?function(t){return t.match(Xt)||[]}(t):function(t){return t.match(st)||[]}(t):t.match(e)||[]}var Za=Vr(function(t,e){try{return Oe(t,o,e)}catch(t){return Hu(t)?t:new bt(t)}}),Ja=ti(function(t,e){return Ce(e,function(e){e=Gi(e),rr(t,e,Ru(t[e],t))}),t});function Xa(t){return function(){return t}}var ts=jo(),es=jo(!0);function ns(t){return t}function rs(t){return Nr("function"==typeof t?t:ur(t,1))}var os=Vr(function(t,e){return function(n){return Rr(n,t,e)}}),is=Vr(function(t,e){return function(n){return Rr(t,n,e)}});function us(t,e,n){var r=Ia(e),o=kr(e,r);null!=n||Xu(e)&&(o.length||!r.length)||(n=e,e=t,t=this,o=kr(e,Ia(e)));var i=!(Xu(n)&&"chain"in n&&!n.chain),u=Ku(t);return Ce(o,function(n){var r=e[n];t[n]=r,u&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Eo(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Me([this.value()],arguments))})}),t}function as(){}var ss=$o(Se),cs=$o(Ee),ls=$o(Le);function fs(t){return mi(t)?Be(Gi(t)):function(t){return function(e){return br(e,t)}}(t)}var ps=Bo(),ds=Bo(!0);function hs(){return[]}function gs(){return!1}var ys,_s=Qo(function(t,e){return t+e},0),ms=Uo("ceil"),vs=Qo(function(t,e){return t/e},1),ks=Uo("floor"),bs=Qo(function(t,e){return t*e},1),Ts=Uo("round"),Os=Qo(function(t,e){return t-e},0);return Yn.after=function(t,e){if("function"!=typeof e)throw new Et(i);return t=da(t),function(){if(--t<1)return e.apply(this,arguments)}},Yn.ary=Au,Yn.assign=ma,Yn.assignIn=va,Yn.assignInWith=ka,Yn.assignWith=ba,Yn.at=Ta,Yn.before=Eu,Yn.bind=Ru,Yn.bindAll=Ja,Yn.bindKey=xu,Yn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Bu(t)?t:[t]},Yn.chain=fu,Yn.chunk=function(t,e,n){e=(n?_i(t,e,n):e===o)?1:yn(da(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var u=0,a=0,s=r(pe(i/e));u<i;)s[a++]=to(t,u,u+=e);return s},Yn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},Yn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],o=t;o--;)e[o-1]=arguments[o];return Me(Bu(n)?Eo(n):[n],gr(e,1))},Yn.cond=function(t){var e=null==t?0:t.length,n=ui();return t=e?Se(t,function(t){if("function"!=typeof t[1])throw new Et(i);return[n(t[0]),t[1]]}):[],Vr(function(n){for(var r=-1;++r<e;){var o=t[r];if(Oe(o[0],this,n))return Oe(o[1],this,n)}})},Yn.conforms=function(t){return function(t){var e=Ia(t);return function(n){return ar(n,t,e)}}(ur(t,1))},Yn.constant=Xa,Yn.countBy=hu,Yn.create=function(t,e){var n=Pn(t);return null==e?n:nr(n,e)},Yn.curry=function t(e,n,r){var i=Ho(e,8,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Yn.curryRight=function t(e,n,r){var i=Ho(e,16,o,o,o,o,o,n=r?o:n);return i.placeholder=t.placeholder,i},Yn.debounce=Iu,Yn.defaults=Oa,Yn.defaultsDeep=wa,Yn.defer=Su,Yn.delay=Mu,Yn.difference=Pi,Yn.differenceBy=Qi,Yn.differenceWith=$i,Yn.drop=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=n||e===o?1:da(e))<0?0:e,r):[]},Yn.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,0,(e=r-(e=n||e===o?1:da(e)))<0?0:e):[]},Yn.dropRightWhile=function(t,e){return t&&t.length?lo(t,ui(e,3),!0,!0):[]},Yn.dropWhile=function(t,e){return t&&t.length?lo(t,ui(e,3),!0):[]},Yn.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&_i(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=da(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:da(r))<0&&(r+=i),r=n>r?0:ha(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},Yn.filter=function(t,e){return(Bu(t)?Re:hr)(t,ui(e,3))},Yn.flatMap=function(t,e){return gr(Tu(t,e),1)},Yn.flatMapDeep=function(t,e){return gr(Tu(t,e),l)},Yn.flatMapDepth=function(t,e,n){return n=n===o?1:da(n),gr(Tu(t,e),n)},Yn.flatten=qi,Yn.flattenDeep=function(t){return null!=t&&t.length?gr(t,l):[]},Yn.flattenDepth=function(t,e){return null!=t&&t.length?gr(t,e=e===o?1:da(e)):[]},Yn.flip=function(t){return Ho(t,512)},Yn.flow=ts,Yn.flowRight=es,Yn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];rr(r,o[0],o[1])}return r},Yn.functions=function(t){return null==t?[]:kr(t,Ia(t))},Yn.functionsIn=function(t){return null==t?[]:kr(t,Sa(t))},Yn.groupBy=vu,Yn.initial=function(t){return null!=t&&t.length?to(t,0,-1):[]},Yn.intersection=Ui,Yn.intersectionBy=Vi,Yn.intersectionWith=zi,Yn.invert=Ea,Yn.invertBy=Ra,Yn.invokeMap=ku,Yn.iteratee=rs,Yn.keyBy=bu,Yn.keys=Ia,Yn.keysIn=Sa,Yn.map=Tu,Yn.mapKeys=function(t,e){var n={};return e=ui(e,3),mr(t,function(t,r,o){rr(n,e(t,r,o),t)}),n},Yn.mapValues=function(t,e){var n={};return e=ui(e,3),mr(t,function(t,r,o){rr(n,r,e(t,r,o))}),n},Yn.matches=function(t){return jr(ur(t,1))},Yn.matchesProperty=function(t,e){return Yr(t,ur(e,1))},Yn.memoize=Nu,Yn.merge=Ma,Yn.mergeWith=Na,Yn.method=os,Yn.methodOf=is,Yn.mixin=us,Yn.negate=Du,Yn.nthArg=function(t){return t=da(t),Vr(function(e){return Qr(e,t)})},Yn.omit=Da,Yn.omitBy=function(t,e){return Ga(t,Du(ui(e)))},Yn.once=function(t){return Eu(2,t)},Yn.orderBy=function(t,e,n,r){return null==t?[]:(Bu(e)||(e=null==e?[]:[e]),Bu(n=r?o:n)||(n=null==n?[]:[n]),$r(t,e,n))},Yn.over=ss,Yn.overArgs=Lu,Yn.overEvery=cs,Yn.overSome=ls,Yn.partial=Gu,Yn.partialRight=ju,Yn.partition=Ou,Yn.pick=La,Yn.pickBy=Ga,Yn.property=fs,Yn.propertyOf=function(t){return function(e){return null==t?o:br(t,e)}},Yn.pull=Ki,Yn.pullAll=Zi,Yn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Br(t,e,ui(n,2)):t},Yn.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Br(t,e,o,n):t},Yn.pullAt=Ji,Yn.range=ps,Yn.rangeRight=ds,Yn.rearg=Yu,Yn.reject=function(t,e){return(Bu(t)?Re:hr)(t,Du(ui(e,3)))},Yn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=ui(e,3);++r<i;){var u=t[r];e(u,r,t)&&(n.push(u),o.push(r))}return qr(t,o),n},Yn.rest=function(t,e){if("function"!=typeof t)throw new Et(i);return Vr(t,e=e===o?e:da(e))},Yn.reverse=Xi,Yn.sampleSize=function(t,e,n){return e=(n?_i(t,e,n):e===o)?1:da(e),(Bu(t)?Kn:Hr)(t,e)},Yn.set=function(t,e,n){return null==t?t:Kr(t,e,n)},Yn.setWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:Kr(t,e,n,r)},Yn.shuffle=function(t){return(Bu(t)?Zn:Xr)(t)},Yn.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&_i(t,e,n)?(e=0,n=r):(e=null==e?0:da(e),n=n===o?r:da(n)),to(t,e,n)):[]},Yn.sortBy=wu,Yn.sortedUniq=function(t){return t&&t.length?oo(t):[]},Yn.sortedUniqBy=function(t,e){return t&&t.length?oo(t,ui(e,2)):[]},Yn.split=function(t,e,n){return n&&"number"!=typeof n&&_i(t,e,n)&&(e=n=o),(n=n===o?d:n>>>0)?(t=_a(t))&&("string"==typeof e||null!=e&&!oa(e))&&!(e=uo(e))&&rn(t)?vo(fn(t),0,n):t.split(e,n):[]},Yn.spread=function(t,e){if("function"!=typeof t)throw new Et(i);return e=null==e?0:yn(da(e),0),Vr(function(n){var r=n[e],o=vo(n,0,e);return r&&Me(o,r),Oe(t,this,o)})},Yn.tail=function(t){var e=null==t?0:t.length;return e?to(t,1,e):[]},Yn.take=function(t,e,n){return t&&t.length?to(t,0,(e=n||e===o?1:da(e))<0?0:e):[]},Yn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?to(t,(e=r-(e=n||e===o?1:da(e)))<0?0:e,r):[]},Yn.takeRightWhile=function(t,e){return t&&t.length?lo(t,ui(e,3),!1,!0):[]},Yn.takeWhile=function(t,e){return t&&t.length?lo(t,ui(e,3)):[]},Yn.tap=function(t,e){return e(t),t},Yn.throttle=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new Et(i);return Xu(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Iu(t,e,{leading:r,maxWait:e,trailing:o})},Yn.thru=pu,Yn.toArray=fa,Yn.toPairs=ja,Yn.toPairsIn=Ya,Yn.toPath=function(t){return Bu(t)?Se(t,Gi):aa(t)?[t]:Eo(Li(_a(t)))},Yn.toPlainObject=ya,Yn.transform=function(t,e,n){var r=Bu(t),o=r||Vu(t)||sa(t);if(e=ui(e,4),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Xu(t)&&Ku(i)?Pn(qt(t)):{}}return(o?Ce:mr)(t,function(t,r,o){return e(n,t,r,o)}),n},Yn.unary=function(t){return Au(t,1)},Yn.union=tu,Yn.unionBy=eu,Yn.unionWith=nu,Yn.uniq=function(t){return t&&t.length?ao(t):[]},Yn.uniqBy=function(t,e){return t&&t.length?ao(t,ui(e,2)):[]},Yn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?ao(t,o,e):[]},Yn.unset=function(t,e){return null==t||so(t,e)},Yn.unzip=ru,Yn.unzipWith=ou,Yn.update=function(t,e,n){return null==t?t:co(t,e,yo(n))},Yn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:co(t,e,yo(n),r)},Yn.values=Pa,Yn.valuesIn=function(t){return null==t?[]:Ke(t,Sa(t))},Yn.without=iu,Yn.words=Ka,Yn.wrap=function(t,e){return Gu(yo(e),t)},Yn.xor=uu,Yn.xorBy=au,Yn.xorWith=su,Yn.zip=cu,Yn.zipObject=function(t,e){return ho(t||[],e||[],Xn)},Yn.zipObjectDeep=function(t,e){return ho(t||[],e||[],Kr)},Yn.zipWith=lu,Yn.entries=ja,Yn.entriesIn=Ya,Yn.extend=va,Yn.extendWith=ka,us(Yn,Yn),Yn.add=_s,Yn.attempt=Za,Yn.camelCase=Qa,Yn.capitalize=$a,Yn.ceil=ms,Yn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=ga(n))==n?n:0),e!==o&&(e=(e=ga(e))==e?e:0),ir(ga(t),e,n)},Yn.clone=function(t){return ur(t,4)},Yn.cloneDeep=function(t){return ur(t,5)},Yn.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:o)},Yn.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:o)},Yn.conformsTo=function(t,e){return null==e||ar(t,e,Ia(e))},Yn.deburr=Wa,Yn.defaultTo=function(t,e){return null==t||t!=t?e:t},Yn.divide=vs,Yn.endsWith=function(t,e,n){t=_a(t),e=uo(e);var r=t.length,i=n=n===o?r:ir(da(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Yn.eq=Pu,Yn.escape=function(t){return(t=_a(t))&&z.test(t)?t.replace(U,en):t},Yn.escapeRegExp=function(t){return(t=_a(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Yn.every=function(t,e,n){var r=Bu(t)?Ee:pr;return n&&_i(t,e,n)&&(e=o),r(t,ui(e,3))},Yn.find=gu,Yn.findIndex=Wi,Yn.findKey=function(t,e){return je(t,ui(e,3),mr)},Yn.findLast=yu,Yn.findLastIndex=Bi,Yn.findLastKey=function(t,e){return je(t,ui(e,3),vr)},Yn.floor=ks,Yn.forEach=_u,Yn.forEachRight=mu,Yn.forIn=function(t,e){return null==t?t:yr(t,ui(e,3),Sa)},Yn.forInRight=function(t,e){return null==t?t:_r(t,ui(e,3),Sa)},Yn.forOwn=function(t,e){return t&&mr(t,ui(e,3))},Yn.forOwnRight=function(t,e){return t&&vr(t,ui(e,3))},Yn.get=Ca,Yn.gt=Qu,Yn.gte=$u,Yn.has=function(t,e){return null!=t&&di(t,e,Cr)},Yn.hasIn=Aa,Yn.head=Fi,Yn.identity=ns,Yn.includes=function(t,e,n,r){t=Fu(t)?t:Pa(t),n=n&&!r?da(n):0;var o=t.length;return n<0&&(n=yn(o+n,0)),ua(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&Pe(t,e,n)>-1},Yn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:da(n);return o<0&&(o=yn(r+o,0)),Pe(t,e,o)},Yn.inRange=function(t,e,n){return e=pa(e),n===o?(n=e,e=0):n=pa(n),function(t,e,n){return t>=_n(e,n)&&t<yn(e,n)}(t=ga(t),e,n)},Yn.invoke=xa,Yn.isArguments=Wu,Yn.isArray=Bu,Yn.isArrayBuffer=qu,Yn.isArrayLike=Fu,Yn.isArrayLikeObject=Uu,Yn.isBoolean=function(t){return!0===t||!1===t||ta(t)&&Or(t)==_},Yn.isBuffer=Vu,Yn.isDate=zu,Yn.isElement=function(t){return ta(t)&&1===t.nodeType&&!ra(t)},Yn.isEmpty=function(t){if(null==t)return!0;if(Fu(t)&&(Bu(t)||"string"==typeof t||"function"==typeof t.splice||Vu(t)||sa(t)||Wu(t)))return!t.length;var e=pi(t);if(e==T||e==E)return!t.size;if(bi(t))return!Dr(t).length;for(var n in t)if(Nt.call(t,n))return!1;return!0},Yn.isEqual=function(t,e){return Ir(t,e)},Yn.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:o)?n(t,e):o;return r===o?Ir(t,e,o,n):!!r},Yn.isError=Hu,Yn.isFinite=function(t){return"number"==typeof t&&Ge(t)},Yn.isFunction=Ku,Yn.isInteger=Zu,Yn.isLength=Ju,Yn.isMap=ea,Yn.isMatch=function(t,e){return t===e||Sr(t,e,si(e))},Yn.isMatchWith=function(t,e,n){return n="function"==typeof n?n:o,Sr(t,e,si(e),n)},Yn.isNaN=function(t){return na(t)&&t!=+t},Yn.isNative=function(t){if(ki(t))throw new bt("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(t)},Yn.isNil=function(t){return null==t},Yn.isNull=function(t){return null===t},Yn.isNumber=na,Yn.isObject=Xu,Yn.isObjectLike=ta,Yn.isPlainObject=ra,Yn.isRegExp=oa,Yn.isSafeInteger=function(t){return Zu(t)&&t>=-9007199254740991&&t<=f},Yn.isSet=ia,Yn.isString=ua,Yn.isSymbol=aa,Yn.isTypedArray=sa,Yn.isUndefined=function(t){return t===o},Yn.isWeakMap=function(t){return ta(t)&&pi(t)==I},Yn.isWeakSet=function(t){return ta(t)&&"[object WeakSet]"==Or(t)},Yn.join=function(t,e){return null==t?"":qe.call(t,e)},Yn.kebabCase=Ba,Yn.last=Hi,Yn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=da(n))<0?yn(r+i,0):_n(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Ye(t,$e,i,!0)},Yn.lowerCase=qa,Yn.lowerFirst=Fa,Yn.lt=ca,Yn.lte=la,Yn.max=function(t){return t&&t.length?dr(t,ns,wr):o},Yn.maxBy=function(t,e){return t&&t.length?dr(t,ui(e,2),wr):o},Yn.mean=function(t){return We(t,ns)},Yn.meanBy=function(t,e){return We(t,ui(e,2))},Yn.min=function(t){return t&&t.length?dr(t,ns,Lr):o},Yn.minBy=function(t,e){return t&&t.length?dr(t,ui(e,2),Lr):o},Yn.stubArray=hs,Yn.stubFalse=gs,Yn.stubObject=function(){return{}},Yn.stubString=function(){return""},Yn.stubTrue=function(){return!0},Yn.multiply=bs,Yn.nth=function(t,e){return t&&t.length?Qr(t,da(e)):o},Yn.noConflict=function(){return fe._===this&&(fe._=Yt),this},Yn.noop=as,Yn.now=Cu,Yn.pad=function(t,e,n){t=_a(t);var r=(e=da(e))?ln(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Wo(de(o),n)+t+Wo(pe(o),n)},Yn.padEnd=function(t,e,n){t=_a(t);var r=(e=da(e))?ln(t):0;return e&&r<e?t+Wo(e-r,n):t},Yn.padStart=function(t,e,n){t=_a(t);var r=(e=da(e))?ln(t):0;return e&&r<e?Wo(e-r,n)+t:t},Yn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),vn(_a(t).replace(rt,""),e||0)},Yn.random=function(t,e,n){if(n&&"boolean"!=typeof n&&_i(t,e,n)&&(e=n=o),n===o&&("boolean"==typeof e?(n=e,e=o):"boolean"==typeof t&&(n=t,t=o)),t===o&&e===o?(t=0,e=1):(t=pa(t),e===o?(e=t,t=0):e=pa(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=kn();return _n(t+i*(e-t+ae("1e-"+((i+"").length-1))),e)}return Fr(t,e)},Yn.reduce=function(t,e,n){var r=Bu(t)?Ne:Fe,o=arguments.length<3;return r(t,ui(e,4),n,o,lr)},Yn.reduceRight=function(t,e,n){var r=Bu(t)?De:Fe,o=arguments.length<3;return r(t,ui(e,4),n,o,fr)},Yn.repeat=function(t,e,n){return e=(n?_i(t,e,n):e===o)?1:da(e),Ur(_a(t),e)},Yn.replace=function(){var t=arguments,e=_a(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Yn.result=function(t,e,n){var r=-1,i=(e=_o(e,t)).length;for(i||(i=1,t=o);++r<i;){var u=null==t?o:t[Gi(e[r])];u===o&&(r=i,u=n),t=Ku(u)?u.call(t):u}return t},Yn.round=Ts,Yn.runInContext=t,Yn.sample=function(t){return(Bu(t)?Hn:zr)(t)},Yn.size=function(t){if(null==t)return 0;if(Fu(t))return ua(t)?ln(t):t.length;var e=pi(t);return e==T||e==E?t.size:Dr(t).length},Yn.snakeCase=Ua,Yn.some=function(t,e,n){var r=Bu(t)?Le:eo;return n&&_i(t,e,n)&&(e=o),r(t,ui(e,3))},Yn.sortedIndex=function(t,e){return no(t,e)},Yn.sortedIndexBy=function(t,e,n){return ro(t,e,ui(n,2))},Yn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=no(t,e);if(r<n&&Pu(t[r],e))return r}return-1},Yn.sortedLastIndex=function(t,e){return no(t,e,!0)},Yn.sortedLastIndexBy=function(t,e,n){return ro(t,e,ui(n,2),!0)},Yn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=no(t,e,!0)-1;if(Pu(t[n],e))return n}return-1},Yn.startCase=Va,Yn.startsWith=function(t,e,n){return t=_a(t),n=null==n?0:ir(da(n),0,t.length),e=uo(e),t.slice(n,n+e.length)==e},Yn.subtract=Os,Yn.sum=function(t){return t&&t.length?Ue(t,ns):0},Yn.sumBy=function(t,e){return t&&t.length?Ue(t,ui(e,2)):0},Yn.template=function(t,e,n){var r=Yn.templateSettings;n&&_i(t,e,n)&&(e=o),t=_a(t),e=ba({},e,r,Ko);var i=ba({},e.imports,r.imports,Ko),u=Ia(i),a=Ke(i,u);Ce(u,function(t){if(ct.test(t))throw new bt("Invalid `imports` option passed into `_.template`")});var s,c,l=0,f=e.interpolate||vt,p="__p += '",d=Ct((e.escape||vt).source+"|"+f.source+"|"+(f===Z?ft:vt).source+"|"+(e.evaluate||vt).source+"|$","g"),h="//# sourceURL="+(Nt.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++re+"]")+"\n";t.replace(d,function(e,n,r,o,i,u){return r||(r=o),p+=t.slice(l,u).replace(kt,nn),n&&(s=!0,p+="' +\n__e("+n+") +\n'"),i&&(c=!0,p+="';\n"+i+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e}),p+="';\n";var g=Nt.call(e,"variable")&&e.variable;if(g){if(ct.test(g))throw new bt("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(c?p.replace(W,""):p).replace(B,"$1").replace(q,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Za(function(){return Tt(u,h+"return "+p).apply(o,a)});if(y.source=p,Hu(y))throw y;return y},Yn.times=function(t,e){if((t=da(t))<1||t>f)return[];var n=d,r=_n(t,d);e=ui(e),t-=d;for(var o=Ve(r,e);++n<t;)e(n);return o},Yn.toFinite=pa,Yn.toInteger=da,Yn.toLength=ha,Yn.toLower=function(t){return _a(t).toLowerCase()},Yn.toNumber=ga,Yn.toSafeInteger=function(t){return t?ir(da(t),-9007199254740991,f):0===t?t:0},Yn.toString=_a,Yn.toUpper=function(t){return _a(t).toUpperCase()},Yn.trim=function(t,e,n){if((t=_a(t))&&(n||e===o))return ze(t);if(!t||!(e=uo(e)))return t;var r=fn(t),i=fn(e);return vo(r,Je(r,i),Xe(r,i)+1).join("")},Yn.trimEnd=function(t,e,n){if((t=_a(t))&&(n||e===o))return t.slice(0,pn(t)+1);if(!t||!(e=uo(e)))return t;var r=fn(t);return vo(r,0,Xe(r,fn(e))+1).join("")},Yn.trimStart=function(t,e,n){if((t=_a(t))&&(n||e===o))return t.replace(rt,"");if(!t||!(e=uo(e)))return t;var r=fn(t);return vo(r,Je(r,fn(e))).join("")},Yn.truncate=function(t,e){var n=30,r="...";if(Xu(e)){var i="separator"in e?e.separator:i;n="length"in e?da(e.length):n,r="omission"in e?uo(e.omission):r}var u=(t=_a(t)).length;if(rn(t)){var a=fn(t);u=a.length}if(n>=u)return t;var s=n-ln(r);if(s<1)return r;var c=a?vo(a,0,s).join(""):t.slice(0,s);if(i===o)return c+r;if(a&&(s+=c.length-s),oa(i)){if(t.slice(s).search(i)){var l,f=c;for(i.global||(i=Ct(i.source,_a(pt.exec(i))+"g")),i.lastIndex=0;l=i.exec(f);)var p=l.index;c=c.slice(0,p===o?s:p)}}else if(t.indexOf(uo(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},Yn.unescape=function(t){return(t=_a(t))&&V.test(t)?t.replace(F,dn):t},Yn.uniqueId=function(t){var e=++Dt;return _a(t)+e},Yn.upperCase=za,Yn.upperFirst=Ha,Yn.each=_u,Yn.eachRight=mu,Yn.first=Fi,us(Yn,(ys={},mr(Yn,function(t,e){Nt.call(Yn.prototype,e)||(ys[e]=t)}),ys),{chain:!1}),Yn.VERSION="4.18.1",Ce(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){Yn[t].placeholder=Yn}),Ce(["drop","take"],function(t,e){Wn.prototype[t]=function(n){n=n===o?1:yn(da(n),0);var r=this.__filtered__&&!e?new Wn(this):this.clone();return r.__filtered__?r.__takeCount__=_n(n,r.__takeCount__):r.__views__.push({size:_n(n,d),type:t+(r.__dir__<0?"Right":"")}),r},Wn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ce(["filter","map","takeWhile"],function(t,e){var n=e+1,r=1==n||3==n;Wn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ui(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Ce(["head","last"],function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}}),Ce(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");Wn.prototype[t]=function(){return this.__filtered__?new Wn(this):this[n](1)}}),Wn.prototype.compact=function(){return this.filter(ns)},Wn.prototype.find=function(t){return this.filter(t).head()},Wn.prototype.findLast=function(t){return this.reverse().find(t)},Wn.prototype.invokeMap=Vr(function(t,e){return"function"==typeof t?new Wn(this):this.map(function(n){return Rr(n,t,e)})}),Wn.prototype.reject=function(t){return this.filter(Du(ui(t)))},Wn.prototype.slice=function(t,e){t=da(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Wn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=da(e))<0?n.dropRight(-e):n.take(e-t)),n)},Wn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Wn.prototype.toArray=function(){return this.take(d)},mr(Wn.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Yn[r?"take"+("last"==e?"Right":""):e],u=r||/^find/.test(e);i&&(Yn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Wn,c=a[0],l=s||Bu(e),f=function(t){var e=i.apply(Yn,Me([t],a));return r&&p?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=u&&!p,g=s&&!d;if(!u&&l){e=g?e:new Wn(this);var y=t.apply(e,a);return y.__actions__.push({func:pu,args:[f],thisArg:o}),new $n(y,p)}return h&&g?t.apply(this,a):(y=this.thru(f),h?r?y.value()[0]:y.value():y)})}),Ce(["pop","push","shift","sort","splice","unshift"],function(t){var e=Rt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Yn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(Bu(o)?o:[],t)}return this[n](function(n){return e.apply(Bu(n)?n:[],t)})}}),mr(Wn.prototype,function(t,e){var n=Yn[e];if(n){var r=n.name+"";Nt.call(xn,r)||(xn[r]=[]),xn[r].push({name:e,func:n})}}),xn[Yo(o,2).name]=[{name:"wrapper",func:o}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Eo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Eo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Eo(this.__views__),t},Wn.prototype.reverse=function(){if(this.__filtered__){var t=new Wn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Wn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Bu(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],u=i.size;switch(i.type){case"drop":t+=u;break;case"dropRight":e-=u;break;case"take":e=_n(e,t+u);break;case"takeRight":t=yn(t,e-u)}}return{start:t,end:e}}(0,o,this.__views__),u=i.start,a=i.end,s=a-u,c=r?a:u-1,l=this.__iteratees__,f=l.length,p=0,d=_n(s,this.__takeCount__);if(!n||!r&&o==s&&d==s)return fo(t,this.__actions__);var h=[];t:for(;s--&&p<d;){for(var g=-1,y=t[c+=e];++g<f;){var _=l[g],m=_.iteratee,v=_.type,k=m(y);if(2==v)y=k;else if(!k){if(1==v)continue t;break t}}h[p++]=y}return h},Yn.prototype.at=du,Yn.prototype.chain=function(){return fu(this)},Yn.prototype.commit=function(){return new $n(this.value(),this.__chain__)},Yn.prototype.next=function(){this.__values__===o&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Yn.prototype.plant=function(t){for(var e,n=this;n instanceof Qn;){var r=Yi(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Yn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Wn){var e=t;return this.__actions__.length&&(e=new Wn(this)),(e=e.reverse()).__actions__.push({func:pu,args:[Xi],thisArg:o}),new $n(e,this.__chain__)}return this.thru(Xi)},Yn.prototype.toJSON=Yn.prototype.valueOf=Yn.prototype.value=function(){return fo(this.__wrapped__,this.__actions__)},Yn.prototype.first=Yn.prototype.head,Ht&&(Yn.prototype[Ht]=function(){return this}),Yn}();fe._=hn,(r=function(){return hn}.call(e,n,e,t))===o||(t.exports=r)}.call(this)}},m={};function v(t){var e=m[t];if(void 0!==e)return e.exports;var n=m[t]={id:t,loaded:!1,exports:{}};return _[t].call(n.exports,n,n.exports,v),n.loaded=!0,n.exports}v.d=(t,e)=>{for(var n in e)v.o(e,n)&&!v.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},v.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),v.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);let k=t=>new Error(t);function b(t,e,...n){t||function(t,...e){const n=O(t);if("object"==typeof n)throw n;throw k(n||"Assertion error",...e)}(e,...n)}function T(t,e,...n){return b(t,e,...n),t}function O(t){return void 0===t?"":"string"==typeof t?t:t()}const w=(t,e=void 0)=>{b(function(t){return"string"==typeof t}(t),()=>function(t,e,n){const r=O(t);if("object"==typeof r)throw r;return`${r?`${r}: `:""}${e} ${function(t){return void 0===t?"<undefined>":"symbol"==typeof t?t.toString():null===t?"<null>":`<${typeof t}:${t}>`}(n)}`}(e,"Not a string",t))};function C(t,e){return t instanceof Error?t.message:null!=e?e:`${t}`}const A=/^[A-Za-z0-9_-]{1,64}$/;function E(t,e){b(function(t){return A.test(t)}(t),`Invalid @aiFunction id "${t}"${e?` on ${e}`:""}: it must be 1–64 characters of letters, digits, "_" and "-" — the tool-name charset LLM providers accept.`)}function R(t){const e=t.split(":");return b(2===e.length,`Invalid service function name: ${t}`),e[1]}var x=v(243);const I=["gpt-5.4-mini","gpt-5.4-nano","gpt-5.5","gpt-5.5-pro","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-4o","gpt-4o-mini","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","o1","o3","o3-mini","o4-mini","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5.1","gpt-5.2","gpt-5.2-pro","gpt-5.4","claude-haiku-4-5-20251001","claude-opus-4-8","claude-sonnet-5","claude-3-7-sonnet-latest","claude-opus-4-1-20250805","claude-opus-4-20250514","claude-opus-4-5-20251101","claude-opus-4-6","claude-opus-4-7","claude-sonnet-4-20250514","claude-sonnet-4-5-20250929","claude-sonnet-4-6","gemini-3.1-pro","gemini-3.5-flash","gemini-3.1-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite","gemini-3-flash","gemini-3-pro","grok-4.3","grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","grok-3","grok-3-fast","grok-3-mini","grok-3-mini-fast","grok-4","grok-4-fast-reasoning","grok-4-fast-non-reasoning","bedrock-claude-sonnet-4-5"];function S(t){return I.includes(t)}const M={"gpt-4o":{name:"gpt-4o",displayName:"GPT-4o",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4o-mini":{name:"gpt-4o-mini",displayName:"GPT-4o Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1":{name:"gpt-4.1",displayName:"GPT-4.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4.1-mini":{name:"gpt-4.1-mini",displayName:"GPT-4.1 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1-nano":{name:"gpt-4.1-nano",displayName:"GPT-4.1 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-nano"},o1:{name:"o1",displayName:"GPT-o1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},o3:{name:"o3",displayName:"GPT-o3",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o3-mini":{name:"o3-mini",displayName:"GPT-o3 Mini",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o4-mini":{name:"o4-mini",displayName:"GPT-o4 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-5":{name:"gpt-5",displayName:"GPT-5",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-5-mini":{name:"gpt-5-mini",displayName:"GPT-5 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-mini"},"gpt-5-nano":{name:"gpt-5-nano",displayName:"GPT-5 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-nano"},"gpt-5.1":{name:"gpt-5.1",displayName:"GPT-5.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2":{name:"gpt-5.2",displayName:"GPT-5.2",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2-pro":{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"Legacy most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5-pro"},"gpt-5.4":{name:"gpt-5.4",displayName:"GPT-5.4",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.4-mini":{name:"gpt-5.4-mini",displayName:"GPT-5.4 Mini",description:"Fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.4-nano":{name:"gpt-5.4-nano",displayName:"GPT-5.4 Nano",description:"Lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5":{name:"gpt-5.5",displayName:"GPT-5.5",description:"Powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5-pro":{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",description:"Most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-sol":{name:"gpt-5.6-sol",displayName:"GPT-5.6 Sol",description:"Flagship model for complex tasks",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-terra":{name:"gpt-5.6-terra",displayName:"GPT-5.6 Terra",description:"Balanced and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-luna":{name:"gpt-5.6-luna",displayName:"GPT-5.6 Luna",description:"Fast and affordable",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-sonnet-5":{name:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Balanced performance",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-6":{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-sonnet-4-5-20250929":{name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-3-7-sonnet-latest":{name:"claude-3-7-sonnet-latest",displayName:"Claude Sonnet 3.7",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-haiku-4-5-20251001":{name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",description:"Fastest responses",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-20250514":{name:"claude-opus-4-20250514",displayName:"Claude Opus 4",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-1-20250805":{name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-4-8",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-opus-4-5-20251101":{name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-6":{name:"claude-opus-4-6",displayName:"Claude Opus 4.6",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-7":{name:"claude-opus-4-7",displayName:"Claude Opus 4.7",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0,replacedBy:"claude-opus-4-8"},"claude-opus-4-8":{name:"claude-opus-4-8",displayName:"Claude Opus 4.8",description:"Most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-20250514":{name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"bedrock-claude-sonnet-4-5":{name:"bedrock-claude-sonnet-4-5",vendorModelName:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",displayName:"Claude Sonnet 4.5 (Bedrock)",description:"Claude Sonnet hosted on AWS Bedrock",providerType:"bedrock",requiresExplicitAvailability:!0,maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-2.5-flash":{name:"gemini-2.5-flash",displayName:"Gemini Flash 2.5",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.5-flash"},"gemini-2.5-pro":{name:"gemini-2.5-pro",displayName:"Gemini Pro 2.5",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-pro"},"gemini-2.5-flash-lite":{name:"gemini-2.5-flash-lite",displayName:"Gemini Flash 2.5 Lite",description:"Legacy lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-flash-lite"},"gemini-3-flash":{name:"gemini-3-flash",vendorModelName:"gemini-3-flash-preview",displayName:"Gemini Flash 3",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.5-flash"},"gemini-3.1-flash-lite":{name:"gemini-3.1-flash-lite",displayName:"Gemini Flash 3.1 Lite",description:"Lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3.5-flash":{name:"gemini-3.5-flash",displayName:"Gemini Flash 3.5",description:"Fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3-pro":{name:"gemini-3-pro",vendorModelName:"gemini-3-pro-preview",displayName:"Gemini Pro 3",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.1-pro"},"gemini-3.1-pro":{name:"gemini-3.1-pro",vendorModelName:"gemini-3.1-pro-preview",displayName:"Gemini Pro 3.1",description:"Most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"grok-3":{name:"grok-3",displayName:"Grok-3",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-fast":{name:"grok-3-fast",displayName:"Grok-3 Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini":{name:"grok-3-mini",displayName:"Grok-3 Mini",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini-fast":{name:"grok-3-mini-fast",displayName:"Grok-3 Mini Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4":{name:"grok-4",displayName:"Grok-4",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4.3":{name:"grok-4.3",displayName:"Grok-4.3",description:"Most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,reasoning:{kind:"levels",supported:["low","medium","high"]}},"grok-4-fast-reasoning":{name:"grok-4-fast-reasoning",displayName:"Grok-4 Fast Reasoning",description:"Legacy optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-reasoning",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-fast-non-reasoning":{name:"grok-4-fast-non-reasoning",displayName:"Grok-4 Fast Non-Reasoning",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-reasoning":{name:"grok-4-1-fast-reasoning",displayName:"Grok-4.1 Fast Reasoning",description:"Optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-non-reasoning":{name:"grok-4-1-fast-non-reasoning",displayName:"Grok-4.1 Fast Non-Reasoning",description:"Fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1}};for(const t of Object.values(M))b(!t.replacedBy||!M[t.replacedBy]?.replacedBy,`Model ${t.name} is replaced by ${t.replacedBy}, which is also marked as replaced (is not active).`),b(!t.replacedBy||t.description.startsWith("Legacy"),`Model ${t.name} is deprecated and its description must start with 'Legacy': '${t.description}'.`);const N=(t,e)=>Array.isArray(t)?t.concat(e):void 0;class D{constructor(){this.data={codeChecksum:"initial",databases:{},storage:{},executables:{},apis:{},graphql:{},triggers:{},schedulers:{},webhooks:{},nativeQueries:{},distributedLocks:{},aiChatbots:{},clientConnectionStateChangeHandlers:[],aiFunctions:{},openApiControllersMap:{},queues:{},queueMessageHandlers:{},eventHandlers:{},metrics:{security:{write:[],all:[]}},limits:{},llms:{},mcp:{},integrationLifecycleHooks:{onIntegrationCreated:!1,onIntegrationDeleted:!1,onIntegrationChanged:!1}}}secureDatabase(t,n,r=e){L(this.data,{databases:{[r]:{security:{[t]:[n]}}}})}secureAiQuery(t,n=e){L(this.data,{databases:{[n]:{security:{aiQuery:[t]}}}})}secureCollection(t,n,r,o=e){L(this.data,{databases:{[o]:{collections:{[t]:{security:{[n]:[r]}}}}}})}publicCollection(t,n,r=e){L(this.data,{databases:{[r]:{collections:{[t]:{publicAccess:{[n]:!0}}}}}})}secureStorage(t,e,n=r){L(this.data,{storage:{[n]:{security:{[t]:[e]}}}})}secureTopic(t,e,r,o=n){L(this.data,{queues:{[o]:{topics:{[t]:{security:{[e]:[r]}}}}}})}queueMessage(t,e,r=n){L(this.data,{queueMessageHandlers:{[r]:{[t]:[e]}}})}eventHandler(t,e){L(this.data,{eventHandlers:{[t]:[e]}})}secureMetric(t,e,n){L(this.data,{metrics:{security:{[e]:[{namePrefix:t,serviceFunction:n}]}}})}secureApi(t,e,n){L(this.data,e?{apis:{[t]:{endpoints:{[e]:{security:[n]}}}}}:{apis:{[t]:{security:[n]}}})}secureGraphQL(t,e){L(this.data,{graphql:{[t]:{security:[e]}}})}transformDatabase(t,n,r=e){L(this.data,{databases:{[r]:{transform:{[t]:{type:t,serviceFunction:n}}}}})}transformCollection(t,n,r,o=e){L(this.data,{databases:{[o]:{collections:{[t]:{transform:{[n]:{type:n,serviceFunction:r}}}}}}})}executable(t){const e=t.split(":")[1],n={serviceFunction:t},r=this.data.executables[e];r&&r.serviceFunction!==t&&console.warn(`Executable name collision: "${e}" is registered by both "${r.serviceFunction}" and "${t}". Use qualified names to avoid ambiguity.`),L(this.data,{executables:{[e]:n,[t]:n}})}aiFunction(t,{id:e,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}){const s={aiFunctions:{[e]:{serviceFunction:t,description:n,promptId:r,params:o,attributes:i,categories:u,internal:a}}};L(this.data,s)}aiFunctionsConfigurator(t,{id:e,integrationTypes:n}){const r={aiFunctionsConfigurators:{[e]:{serviceFunction:t,integrationTypes:n}}};L(this.data,r)}trigger(t,e,n,r,o){b(!this.data.triggers[t],`Duplicate Trigger IDs: ${t}`),this.data.triggers[t]={integrationId:r,collectionName:e,functionName:n,mutationTypes:o}}scheduler(t,e,n,r){b(!this.data.schedulers[t],`Duplicate Scheduler IDs: ${t}`),this.data.schedulers[t]={cronExpression:e,functionName:n,exclusive:r}}webhook(t,e){b(!this.data.webhooks[t],`Duplicate Webhook IDs: ${t}`),this.data.webhooks[t]={functionName:e}}secureNativeQuery(t,e){L(this.data,{nativeQueries:{[t]:[e]}})}secureDistributedLock(t,e){L(this.data,t?{distributedLocks:{mutexes:{[t]:{security:[e]}}}}:{distributedLocks:{security:[e]}})}secureAiAgent(e,n){L(this.data,e?{aiChatbots:{[t]:{profiles:{[e]:{security:{chat:[n]}}}}}}:{aiChatbots:{[t]:{security:{chat:[n]}}}})}limits(t,e){L(this.data,{limits:{[t]:e}})}clientConnectionChangeHandler(t){L(this.data,{clientConnectionStateChangeHandlers:[t]})}llmService(t,e){const n=e.models;b(void 0===this.data.llms?.[t]?.models,`LLM service '${t}' is already registered.`);const r=Object.keys(n);b(r.length>0,`LLM service '${t}' must declare at least one model.`);for(const e of r)b(!S(e),`LLM service '${t}' cannot declare an already-defined model: '${e}'.`);const o=Object.values(this.data.llms??{}).flatMap(t=>Object.keys(t.models??{}));for(const t of r)b(!o.includes(t),`Model '${t}' is already defined by another LLM service.`);L(this.data,{llms:{[t]:{models:n,...void 0!==e.supportsFunctions&&{supportsFunctions:e.supportsFunctions}}}})}llmAsk(t){const e=t.split(":")[0];b(void 0===this.data.llms?.[e]?.ask,`LLM service '${e}' already has an 'ask' function defined.`),L(this.data,{llms:{[e]:{ask:t}}})}mcpServer(t,e){const n=e.id;b(void 0===Object.values(this.data.mcp||{}).find(t=>t.options?.id===n),`MCP server with id ${n} already exists (${t}).`),L(this.data,{mcp:{[t]:{options:e,tools:[]}}})}mcpAuthorizer(t){const[e,n]=t.split(":");b(!this.data.mcp?.[e]?.authorizer,`MCP server '${e}' already has authorizer: ${n}.`),L(this.data,{mcp:{[e]:{authorizer:t}}})}mcpTool(t,e){const[n,r]=t.split(":");b(void 0===this.data.mcp?.[n]?.tools?.find(e=>e.serviceFunctionName===t),`MCP server '${n}' already has tool ${r}.`),L(this.data,{mcp:{[n]:{tools:[{serviceFunctionName:t,description:e.description,inputSchema:e.inputSchema,outputSchema:e.outputSchema}]}}})}setIntegrationLifecycleHooks(t){this.data.integrationLifecycleHooks={onIntegrationCreated:t.onIntegrationCreated,onIntegrationChanged:t.onIntegrationChanged,onIntegrationDeleted:t.onIntegrationDeleted}}}function L(t,e){(0,x.mergeWith)(t,e,N)}const G=new D;function j(t,e){return ft(n=>G.secureDatabase(t,n,e))}function Y(t){return ft(e=>G.secureAiQuery(e,t))}function P(t,e,n){return ft(r=>G.secureCollection(t,e,r,n))}function Q(t,e,n){return()=>{G.publicCollection(t,e,n)}}function $(t,e){return ft(n=>G.secureStorage(t,n,e))}function W(t,e,n){return ft(r=>G.secureTopic(t,e,r,n))}function B(t){return ft(e=>G.secureMetric(t.metricNamePrefix||"",t.type,e))}function q(t,e){return ft(n=>G.secureApi(t,e,n))}function F(t){return ft(e=>G.secureGraphQL(t,e))}function U(t,e){return ft(n=>G.queueMessage(t,n,e))}function V(t){return ft(e=>G.eventHandler(t,e))}function z(){return ft(t=>G.executable(t))}function H(t,e=[],n={},r=[],o=!1){return function(i,u,a){const s=lt(i,u),c=R(s);let l;return"object"==typeof t?(T(t.description??t.promptId,`AI function definition requires either "description" or "promptId" to be defined: ${u}`),void 0!==t.id&&E(t.id,u),l={id:t.id??c,description:t.description,promptId:t.promptId,params:T(t.params,`AI function definition requires "params" to be defined: ${u}`),attributes:t.attributes||{},categories:t.categories||[],internal:t.internal||!1}):l={id:c,description:t,promptId:void 0,params:e,attributes:n,categories:r,internal:o},G.aiFunction(s,l),a}}function K(t){return function(e,n,r){const o=lt(e,n);void 0!==t.id&&E(t.id,n);const i={id:t.id??R(o),integrationTypes:t.integrationTypes};return G.aiFunctionsConfigurator(o,i),r}}function Z(t,n="",r){const o="object"==typeof t?{...t}:{id:t,collection:n,integrationId:r};return b(o.collection,"Collection name can't be empty"),function(t,n,r){return o.id||(o.id=lt(t,n)),G.trigger(o.id,o.collection,lt(t,n),o.integrationId||e,o.mutationTypes),r}}function J(t,e,n=!0){return function(r,o,i){const u=lt(r,o);let a;return a="object"==typeof t?{cron:t.cron,id:t.id||u,exclusive:t.exclusive??!0}:{id:t,cron:T(e,"cronExpression must be defined"),exclusive:n},G.scheduler(a.id,a.cron,u,a.exclusive),i}}function X(t){return ft(e=>G.webhook(t,e))}function tt(t){return ft(e=>G.secureNativeQuery(t,e))}function et(t){return ft(e=>G.secureDistributedLock(t,e))}function nt(t){return ft(e=>G.secureAiAgent(t,e))}function rt(t){return ft(e=>G.limits(e,pt(t)))}function ot(t){return e=>{G.llmService(e.name,t)}}function it(){return ft(t=>G.llmAsk(t))}function ut(t){return e=>{G.mcpServer(e.name,t)}}function at(t){return ft(e=>G.mcpTool(e,t))}function st(){return ft(t=>G.mcpAuthorizer(t))}function ct(){return ft(t=>G.clientConnectionChangeHandler(t))}function lt(t,e){return`${t.constructor.name}:${e}`}function ft(t){return function(e,n,r){return t(lt(e,n)),r}}function pt(t){return void 0!==t.rateLimit&&("number"==typeof t.rateLimit?t.rateLimit=[{value:t.rateLimit,scope:"global"}]:"object"!=typeof t.rateLimit||Array.isArray(t.rateLimit)||(t.rateLimit=[t.rateLimit]),t.rateLimit.forEach(t=>{void 0===t.scope&&(t.scope="global")})),void 0!==t.quotaLimit&&("number"==typeof t.quotaLimit?t.quotaLimit=[{value:t.quotaLimit,scope:"global",renewPeriod:"monthly"}]:"object"!=typeof t.quotaLimit||Array.isArray(t.quotaLimit)||(t.quotaLimit=[t.quotaLimit]),t.quotaLimit.forEach(t=>{void 0===t.scope&&(t.scope="global"),void 0===t.renewPeriod&&(t.renewPeriod="monthly")})),t}const dt="user-code",ht="user-code-python";function gt(t){w(t,"Invalid application ID");const[e,n,r,o]=t.split("-");return b(!o,`Invalid application ID: ${t}`),{appId:e,environmentId:n??"prod",squidDeveloperId:r}}const yt=["application","auth","mutation","native-query","query","queue","notification"];const _t="__docId__",mt=/[.\[\]]/;function vt(t,e){if(!t)return;const n=e.split(mt);let r,o=t;for(;o&&n.length;){const t=n.shift();if(t){if("object"!=typeof o||!(t in o))return;r=o[t],o=r}}return r}function kt(t){return null==t}function bt(t,e){if(t===e)return!0;if(null===t||null===e)return!1;const n=typeof t;if(n!==typeof e)return!1;if("object"!==n)return t===e;if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!1;for(const n of r)if(!o.includes(n)||!bt(t[n],e[n]))return!1;return!0}function Tt(t,e){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Ot(t[r],e);return n}function Ot(t,e){const n=e?e(t):void 0;if(void 0!==n)return n;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t);if(Array.isArray(t))return Tt(t,e);if(t instanceof Map)return new Map(Tt(Array.from(t),e));if(t instanceof Set)return new Set(Tt(Array.from(t),e));if(ArrayBuffer.isView(t))return r=t,"undefined"!=typeof Buffer&&r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length);var r;const o={};for(const n in t)Object.hasOwnProperty.call(t,n)&&(o[n]=Ot(t[n],e));return o}function wt(t){if(Array.isArray(t))return t.map(t=>wt(t));if("object"!=typeof t||null===t||t instanceof Date)return t;const e=Object.keys(t),n={};return e.sort().forEach(e=>{n[e]=wt(t[e])}),n}function Ct(t){return function(t){if(void 0===t)return null;const e=Ot(t,t=>function(t){return"[object Date]"===Object.prototype.toString.call(t)}(t)?{$date:t.toISOString()}:void 0);return JSON.stringify(e)}(wt(t))}function At(t){return Ot(JSON.parse(t),t=>{if(null===t||"object"!=typeof t)return;const e=t,n=e.$date;return n&&1===Object.keys(e).length?new Date(n):void 0})}function Et(t,e,n){if(t=t instanceof Date?t.getTime():t??null,e=e instanceof Date?e.getTime():e??null,"=="===n)return bt(t,e);if("!="===n)return!bt(t,e);switch(n){case"<":return!kt(t)&&(!!kt(e)||e<t);case"<=":return!!kt(e)||!kt(t)&&e<=t;case">":return!kt(e)&&(!!kt(t)||e>t);case">=":return!!kt(t)||!kt(e)&&e>=t;case"like":return"string"==typeof e&&"string"==typeof t&&Rt(e,t,!1);case"not like":return!("string"==typeof e&&"string"==typeof t&&Rt(e,t,!1));case"like_cs":return"string"==typeof e&&"string"==typeof t&&Rt(e,t,!0);case"not like_cs":return!("string"==typeof e&&"string"==typeof t&&Rt(e,t,!0));case"array_includes_some":{const n=e;return Array.isArray(e)&&Array.isArray(t)&&t.some(t=>T(n,"VALUE_CANNOT_BE_NULL").some(e=>bt(e,t)))}case"array_includes_all":{const n=e;return Array.isArray(t)&&Array.isArray(e)&&t.every(t=>T(n,"VALUE_CANNOT_BE_NULL").some(e=>bt(e,t)))}case"array_not_includes":{const n=e;return Array.isArray(e)&&Array.isArray(t)&&t.every(t=>!T(n,"VALUE_CANNOT_BE_NULL").some(e=>bt(e,t)))}default:throw new Error(`Unsupported operator comparison: ${n}`)}}function Rt(t,e,n){n||(t=t.toLowerCase(),e=e.toLowerCase());const r=function(t){let e="";for(let n=0;n<t.length;++n)"\\"===t[n]?n+1<t.length&&["%","_"].includes(t[n+1])?(e+=t[n+1],n++):n+1<t.length&&"\\"===t[n+1]?(e+="\\\\",n++):e+="\\":"%"===t[n]?e+="[\\s\\S]*":"_"===t[n]?e+="[\\s\\S]":("/-\\^$*+?.()[]{}|".includes(t[n])&&(e+="\\"),e+=t[n]);return e}(e);return new RegExp(`^${r}$`).test(t)}function xt(t){return"fieldName"in t}function It(t){return"docIds"in t}function St(t,e,n){const r=t.docIds.some(t=>Object.entries(t).every(([t,r])=>Et(r,n(e,t)??null,"==")));switch(t.operator){case"==":case"in":return r;case"!=":case"not in":return!r}}function Mt(t,e,n,r){const o=t,i=r(e,_t);if("string"!=typeof i)return Et(o,i??null,n);let u;try{u=At(i)}catch{return Et(o,i,n)}if(!u||"object"!=typeof u||Array.isArray(u))return Et(o,i,n);const a=Object.keys(u);if(1===a.length&&"__id"===a[0]){const t=u.__id,e=function(t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){const e=Object.keys(t);return 1===e.length&&"__id"===e[0]?t.__id:Ct(t)}if("string"==typeof t)try{const e=At(t);if(e&&"object"==typeof e&&!Array.isArray(e)){const t=Object.keys(e);if(1===t.length&&"__id"===t[0])return e.__id}}catch{}return t}(o);return Et(e,t,n)}if(1===a.length){const t=function(t,e){if("object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Object.keys(t);if(1===n.length&&n[0]===e)return t[e]}if("string"==typeof t)try{const n=At(t);if(n&&"object"==typeof n&&!Array.isArray(n)){const t=Object.keys(n);if(1===t.length&&t[0]===e)return n[e]}}catch{}return t}(o,a[0]);return Et(t,u[a[0]],n)}return"object"!=typeof o||null===o||Array.isArray(o)?Et(o,i,n):Et(Ct(o),i,n)}const Nt={"in:in":(t,e)=>t.every(t=>e.includes(t)),"in:not in":(t,e)=>t.every(t=>!e.includes(t)),"not in:not in":(t,e)=>e.every(e=>t.includes(e)),">:not in":(t,e)=>e.every(e=>t>=e),">=:not in":(t,e)=>e.every(e=>t>e),"<:not in":(t,e)=>e.every(e=>t<=e),"<=:not in":(t,e)=>e.every(e=>t<e),">:>":(t,e)=>t>=e,">=:>":(t,e)=>t>e,"in:>":(t,e)=>t.every(t=>t>e),">:>=":(t,e)=>t>=e,">=:>=":(t,e)=>t>=e,"in:>=":(t,e)=>t.every(t=>t>=e),"<:<":(t,e)=>t<=e,"<=:<":(t,e)=>t<e,"in:<":(t,e)=>t.every(t=>t<e),"<:<=":(t,e)=>t<=e,"<=:<=":(t,e)=>t<=e,"in:<=":(t,e)=>t.every(t=>t<=e),"like:like":(t,e)=>Dt(t.toLowerCase(),e.toLowerCase()),"like_cs:like":(t,e)=>Dt(t.toLowerCase(),e.toLowerCase()),"like:like_cs":(t,e)=>Dt(t,e)&&Gt(e),"like_cs:like_cs":(t,e)=>Dt(t,e),"like:not like":(t,e)=>!Lt(t.toLowerCase(),e.toLowerCase()),"like_cs:not like":(t,e)=>!Lt(t.toLowerCase(),e.toLowerCase()),"like:not like_cs":(t,e)=>!Lt(t.toLowerCase(),e.toLowerCase()),"like_cs:not like_cs":(t,e)=>!Lt(t,e),"not like:like":(t,e)=>Yt(t,e),"not like_cs:like":(t,e)=>Yt(t,e),"not like:like_cs":(t,e)=>Yt(t,e),"not like_cs:like_cs":(t,e)=>Yt(t,e),"not like:not like":(t,e)=>Dt(e.toLowerCase(),t.toLowerCase()),"not like_cs:not like":(t,e)=>Dt(e,t)&&Gt(t),"not like:not like_cs":(t,e)=>Dt(e.toLowerCase(),t.toLowerCase()),"not like_cs:not like_cs":(t,e)=>Dt(e,t),"in:like":(t,e)=>t.every(t=>Et(e,t,"like")),"in:like_cs":(t,e)=>t.every(t=>Et(e,t,"like_cs")),"in:not like":(t,e)=>t.every(t=>Et(e,t,"not like")),"in:not like_cs":(t,e)=>t.every(t=>Et(e,t,"not like_cs")),"like:in":(t,e)=>!t.includes("%")&&!t.includes("_")&&!!e.find(e=>e.toLowerCase()===t.toLowerCase()),"like_cs:in":(t,e)=>!t.includes("%")&&!t.includes("_")&&e.includes(t),"not like:in":(t,e)=>t.length>0&&jt(t)||Pt(t)&&e.includes(""),"not like_cs:in":(t,e)=>t.length>0&&jt(t)||Pt(t)&&e.includes(""),"not in:like":(t,e)=>e.length>0&&jt(e)||Pt(e)&&t.includes(""),"not in:like_cs":(t,e)=>e.length>0&&jt(e)||Pt(e)&&t.includes(""),"not in:not like":(t,e)=>!e.includes("%")&&!e.includes("_")&&!!t.find(t=>t.toLowerCase()===e.toLowerCase()),"not in:not like_cs":(t,e)=>!e.includes("%")&&!e.includes("_")&&t.includes(e),"like:not in":(t,e)=>e.every(e=>Et(t,e,"not like")),"like_cs:not in":(t,e)=>e.every(e=>Et(t,e,"not like_cs")),"not like:not in":(t,e)=>e.every(e=>Et(t,e,"like")),"not like_cs:not in":(t,e)=>e.every(e=>Et(t,e,"like_cs")),"array_includes_some:array_includes_some":(t,e)=>t.every(t=>e.includes(t)),"array_includes_all:array_includes_all":(t,e)=>t.every(t=>e.includes(t)),"array_not_includes:array_not_includes":(t,e)=>e.every(e=>t.includes(e)),"array_includes_some:array_not_includes":(t,e)=>t.every(t=>!e.includes(t)),"array_not_includes:array_includes_some":(t,e)=>e.every(e=>!t.includes(e)),"array_includes_all:array_includes_some":(t,e)=>t.every(t=>e.includes(t)),"array_includes_some:array_includes_all":(t,e)=>t.every(t=>e.includes(t)),"array_not_includes:array_includes_all":(t,e)=>e.every(e=>!t.includes(e)),"array_includes_all:array_not_includes":(t,e)=>t.every(t=>!e.includes(t))};function Dt(t,e,n=0,r=0){if(r>=e.length)return n>=t.length;if(n>=t.length)return jt(e.substring(r));const o=t[n],i=e[r];return"%"===o&&"%"===i?Dt(t,e,n+1,r+1)||Dt(t,e,n+1,r):"%"!==o&&("%"===i?Dt(t,e,n,r+1)||Dt(t,e,n+1,r):(o===i||"_"===i)&&Dt(t,e,n+1,r+1))}function Lt(t,e,n=0,r=0){if(n>=t.length&&r>=e.length)return!0;if(n>=t.length)return jt(e.substring(r));if(r>=e.length)return jt(t.substring(n));const o=n<t.length?t[n]:"",i=r<e.length?e[r]:"";return"%"===o&&"%"===i?Lt(t,e,n+1,r+1)||Lt(t,e,n,r+1)||Lt(t,e,n+1,r):"%"===o||"%"===i?Lt(t,e,n,r+1)||Lt(t,e,n+1,r):(o===i||"_"===o||"_"===i)&&Lt(t,e,n+1,r+1)}function Gt(t){return!/[a-zA-Z]/.test(t)}function jt(t){return t.split("").every(t=>"%"===t)}function Yt(t,e){return t.length>0&&jt(t)||e.length>0&&jt(e)||Pt(t)&&0===e.length}function Pt(t){let e=!1,n=!1;for(const r of t)switch(r){case"%":e=!0;break;case"_":if(n)return!1;n=!0;break;default:return!1}return e&&n}function Qt(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!bt(t[r],e[r]))return!1}return!0}function $t(t,e){return e.every(e=>{const n=Object.keys(e).sort();if(n.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(n[e]!==t[e])return!1;return!0})}class Wt{constructor(t){this.query=t,this.query=t;const e=this.query.conditions.filter(xt),n=this.query.conditions.filter(It),r=n.flatMap(t=>function(t){if("=="!==t.operator&&"in"!==t.operator)return[];if(0===t.docIds.length)return[];const e=[],n=t.docIds[0];for(const r of Object.keys(n)){const o=n[r];t.docIds.every(t=>Object.prototype.hasOwnProperty.call(t,r)&&bt(t[r],o))&&e.push({fieldName:r,operator:"==",value:o})}return e}(t));this.exactSimpleConditions=this.parseConditions(e),this.exactDocIdConditions=n,this.subqueryConditions=this.parseConditions([...e,...r])}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}get projectFields(){return this.query.projectFields}sortedBy(t){return!t.find((t,e)=>!bt(this.query.sortOrder[e],{...t,asc:t.asc??!0}))}sortedByExact(t){return t.length===this.query.sortOrder.length&&this.sortedBy(t)}isSubqueryOf(t,e,n){return this.isSubqueryOfCondition({fieldName:t,operator:e,value:n})}isSubqueryOfCondition(t){return!!this.subqueryConditions.filter(e=>e.fieldName===t.fieldName).find(e=>this.evaluateSubset(e,t))}isSubqueryOfConditions(t){return this.parseConditions(t).every(t=>this.isSubqueryOfCondition(t))}isSubqueryOfQuery(t){if(t.collectionName!==this.collectionName||t.integrationId!==this.integrationId)return!1;for(const e of t.conditions.filter(It))if(!this.childImpliesParentDocIdCondition(e))return!1;const e=t.conditions.filter(xt),n=this.isSubqueryOfConditions(e),r=this.sortedBy(t.sortOrder),o=-1===t.limit||this.limit>-1&&this.limit<t.limit,i=this.isProjectFieldsSubset(this.query.projectFields,t.projectFields);return n&&r&&o&&i}childImpliesParentDocIdCondition(t){const e=t.docIds;if(0===e.length)return!1;const n="=="===t.operator||"in"===t.operator,r=Object.keys(e[0]).sort(),o=[];for(const t of this.query.conditions)It(t)&&o.push(...t.docIds);if(!$t(r,e)||!$t(r,o))return!1;const i=this.buildChildEffectiveTupleSet();return n?void 0!==i.allowed&&i.allowed.every(t=>e.some(e=>Qt(t,e))):void 0!==i.allowed?i.allowed.every(t=>!e.some(e=>Qt(t,e))):e.every(t=>i.excluded.some(e=>Qt(t,e)))}buildChildEffectiveTupleSet(){let t;const e=[];for(const n of this.query.conditions)if(It(n))if("=="===n.operator||"in"===n.operator)t=void 0===t?[...n.docIds]:t.filter(t=>n.docIds.some(e=>Qt(t,e)));else for(const t of n.docIds)e.some(e=>Qt(e,t))||e.push(t);return void 0!==t&&e.length>0&&(t=t.filter(t=>!e.some(e=>Qt(t,e)))),{allowed:t,excluded:e}}isProjectFieldsSubset(t,e){if(!e)return!0;if(!t)return!1;const n=new Set(e);return t.every(t=>n.has(t))}getConditionsFor(...t){return this.subqueryConditions.filter(e=>t.includes(e.fieldName))}getConditionsForField(t){return this.subqueryConditions.filter(e=>e.fieldName===t)}documentMatchesQuery(t){for(const e of this.exactSimpleConditions){const n=e.fieldName,r=e.operator;if(n===_t){const n=e.value;if("in"===r||"not in"===r){const e=(Array.isArray(n)?n:[n]).some(e=>Mt(e,t,"==",vt));if(!("in"===r?e:!e))return!1;continue}if(!Mt(n,t,r,vt))return!1;continue}const o=vt(t,n);if("in"===r){if(e.value.includes(o))continue;return!1}if("not in"!==r){if(!Et(e.value,o,r))return!1}else if(e.value.includes(o))return!1}for(const e of this.exactDocIdConditions)if(!St(e,t,vt))return!1;return!0}evaluateSubset(t,e){const{operator:n,value:r}=t,{operator:o,value:i}=this.parseConditions([e])[0],u=Nt[`${n}:${o}`];return!!u&&u(r,i)}parseConditions(t){const e=[],n=new Map,r=new Map;return t.forEach(t=>{switch(t.operator){case"==":case"in":n.set(t.fieldName,(n.get(t.fieldName)||[]).concat(t.value));break;case"!=":case"not in":r.set(t.fieldName,(r.get(t.fieldName)||[]).concat(t.value));break;default:e.push(t)}}),n.forEach((t,n)=>{e.push({fieldName:n,operator:"in",value:t})}),r.forEach((t,n)=>{e.push({fieldName:n,operator:"not in",value:t})}),e}}function Bt(){if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}void 0===Bt()?.SQUID_LOG_DEBUG_ENABLED&&function(t=!0){Bt().SQUID_LOG_DEBUG_ENABLED=t}(function(){let t="";return"undefined"!=typeof window&&window.location?t=new URLSearchParams(window.location.search).get("SQUID_DEBUG")||"":"undefined"!=typeof process&&process.env&&(t=process.env.SQUID_DEBUG||""),"1"===t||"true"===t}());const qt="__squidMetadata",Ft=(new a,[]);function Ut(t,e,n){const r=zt();r.codeDirByServiceClassName.set(t.name,n);let o=r.serviceInstanceByCtor.get(t);if(!o||function(t){return t[qt]||{version:0}}(o).version<=1){const n=zt(),r={...n,...e};b(!Ft.includes(t),()=>`CIRCULAR_DEPENDENCY: ${Ft[Ft.length-1]?.name} => ${t.name}`),Ft.push(t);try{o=n.requestLocalStorage.run(e,()=>new t(r))}finally{Ft.pop()}n.serviceInstanceByCtor.set(t,o)}else(function(t,e){b(t.backendApiKey===e.backendApiKey,"backendApiKey does not match."),b(t.requestLocalStorage===e.requestLocalStorage,"requestLocalStorage does not match"),b(t.environmentId===e.environmentId,"environmentId does not match"),b(t.squidDeveloperId===e.squidDeveloperId,"squidDeveloperId does not match");const n=gt(t.appId),r=gt(e.appId);b(n.appId===r.appId,`appId does not match! Before: ${n.appId}, after ${r.appId}`)})(o.config,r),o.config.secrets=r.secrets,o.config.apiKeys=r.apiKeys;return o}const Vt="SQUID_GLOBAL_CONFIG";function zt(){return T(Bt()[Vt],"Squid global config is not defined! Make sure you are not trying to use Squid at module load time.")}const Ht=i(g(),"squid-workspaces"),Kt=/^[A-Za-z0-9_-]{1,200}$/;function Zt(t){return"string"==typeof t&&Kt.test(t)}function Jt(t){return function(t,e){return i(Ht,"workspaces",e)}(0,t)}const Xt=y(s),te="SQUID_WORKSPACE_SERVER_HOST",ee=i(g(),"squid-workspace-ssh","id_ed25519");function ne(){return!!process.env[te]}class re{constructor(){this.lp="WorkspaceClient"}async create(t){const e=t??c();b(Zt(e),()=>`Invalid workspace id "${e}"`);const n=Jt(e);return await f(n,{recursive:!0}),await this.pull(e,n),this.buildMetadata(e,n)}async push(t){b(Zt(t),()=>`Invalid workspace id "${t}"`);const e=Jt(t);return await this.pushDir(t,e),this.buildMetadata(t,e)}async delete(t){b(Zt(t),()=>`Invalid workspace id "${t}"`);const e=`${this.lp}.delete:`,n=Jt(t);try{await this.rsyncEmptyTo(t)}catch(n){throw new Error(`${e} Failed to clear server-side workspace "${t}": ${C(n)}`)}await d(n,{recursive:!0,force:!0})}buildMetadata(t,e){return{id:t,path:e}}async pull(t,e){const n=`${this.lp}.pull:`;try{await this.rsync(t,["--delete",`${this.remoteTarget()}/`,`${e}/`])}catch(e){if(this.isMissingRemoteError(e))return;throw new Error(`${n} Failed to pull workspace "${t}": ${C(e)}`)}}async pushDir(t,e){const n=`${this.lp}.push:`;try{await this.rsync(t,["--delete",`${e}/`,`${this.remoteTarget()}/`])}catch(e){throw new Error(`${n} Failed to push workspace "${t}": ${C(e)}`)}}async rsyncEmptyTo(t){const e=Jt(`.empty-${c()}`);await f(e,{recursive:!0});try{await this.rsync(t,["--delete",`${e}/`,`${this.remoteTarget()}/`])}finally{await d(e,{recursive:!0,force:!0})}}async rsync(t,e){await this.ensurePodKeypair();const n=`${this.sshKeyPath()}-cert-${c()}.pub`;try{await this.issueCert(t,n);const r=`ssh -i ${this.sshKeyPath()} -o CertificateFile=${n} -p ${this.sshPort()} -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=3`;await Xt("rsync",["-a","-e",r,...e],{timeout:3e5})}finally{await d(n,{force:!0}).catch(()=>{})}}ensurePodKeypair(){return this.podKeypairReady||(this.podKeypairReady=this.generatePodKeypair().catch(t=>{throw this.podKeypairReady=void 0,t})),this.podKeypairReady}async generatePodKeypair(){const t=this.sshKeyPath();await this.fileExists(t)||(await f(i(t,".."),{recursive:!0}),await Xt("ssh-keygen",["-t","ed25519","-N","","-f",t,"-C","squid-workspace"],{timeout:3e4}))}async issueCert(t,e){const n=`${this.lp}.issueCert:`,r=(await p(`${this.sshKeyPath()}.pub`,"utf8")).trim();try{const{certificate:n}=await le().rpcManager.post("workspaces/issueCert",{workspaceId:t,ephemeralPublicKey:r});await h(e,`${n}\n`,{mode:420})}catch(e){throw new Error(`${n} Failed to obtain certificate for workspace "${t}": ${C(e)}`)}}async fileExists(t){try{return await l(t),!0}catch{return!1}}remoteTarget(){return`${this.sshUser()}@${this.sshHost()}:.`}isMissingRemoteError(t){return 23===(t&&"object"==typeof t&&"code"in t?t.code:void 0)&&/no such file or directory/i.test(C(t))}sshHost(){return this.getEnv(te)}sshPort(){return process.env.SQUID_WORKSPACE_SERVER_PORT||"22"}sshUser(){return process.env.SQUID_WORKSPACE_SSH_USER||"workspace"}sshKeyPath(){return process.env.SQUID_WORKSPACE_SSH_KEY_PATH||ee}getEnv(t){const e=process.env[t];return b(e,()=>`Missing required env var "${t}" for WorkspaceClient`),e}}function oe(t,e,n){return{body:e.body||"",statusCode:e.statusCode||n,headers:e.headers||{},[t]:!0}}class ie{constructor(){this.region=process.env.SQUID_REGION||"local",this.config=zt(),this[qt]={version:2},this.backendBaseUrl=function(t,e,n,r,o,i){let u="https",a=`${r||e}.${o||t}.${new URL("https://squid.cloud").host}`,s="";/^local/.test(t)&&(u="http",s=i||function(t){const e=t.replace(/^\/+/,"").split("/")[0]||"";return yt.includes(e)}(n)?"8001":"8000",/android$/.test(t)?a="10.0.2.2":(c=t,/ios$/.test(c)&&(a="localhost")));var c;const l=u+"://"+a+(s?`:${s}`:""),f=n.replace(/^\/+/,"");return f?`${l}/${f}`:l}(this.region,this.config.appId,"")}get secrets(){return this.config.secrets}get apiKeys(){return this.config.apiKeys}get context(){return this.getRequestConfig().context}get squid(){return le()}get assetsDirectory(){const t=Object.getPrototypeOf(this).constructor.name,e=this.config.codeDir||this.config.codeDirByServiceClassName.get(t);return b(e,()=>`No codeDir found for service: ${t}`),u(e,"public")}get workspace(){return new re}getApiKey(){return this.config.backendApiKey}getUserAuth(){const{auth:t}=this.getRequestConfig();return"Bearer"===t?.type?t:void 0}getApiKeyAuth(){const{auth:t}=this.getRequestConfig();return"ApiKey"===t?.type?t:void 0}isAuthenticated(){const{auth:t}=this.getRequestConfig();return!!t}assertIsAuthenticated(){this.assertInRequestScope(),b(this.isAuthenticated(),"UNAUTHORIZED")}assertInRequestScope(){b(this.config.requestLocalStorage.getStore(),"This method can only be called with a valid request scope.")}assertApiKeyCall(){b(this.getApiKeyAuth(),"This method can only be called with API key")}createWebhookResponse(t,e,n){return oe("__isWebhookResponse__",{body:t,statusCode:e,headers:n},t?200:204)}throwWebhookResponse(t){throw oe("__isWebhookResponse__",t,500)}createOpenApiResponse(t,e,n){return oe("__isOpenApiResponse__",{body:t,statusCode:e,headers:n},t?200:204)}throwOpenApiResponse(t){throw oe("__isOpenApiResponse__",t,500)}async convertToSquidFile(t){return{__isSquidFile__:!0,data:new Uint8Array(await t.arrayBuffer()),fieldName:t.name,mimetype:t.type,originalName:t.name,size:t.size,encoding:t.type}}async publishAiStatusUpdate(t,e){const n={type:"aiStatus",agentId:t.agentId,messageId:t.messageId,chatId:t.chatId,jobId:t.jobId,payload:{title:t.title,body:t.body,parentStatusUpdateId:t.parentStatusUpdateId,tags:t.tags}};await this.squid.getNotificationClient().publishSystemNotification(n,[e])}getRequestConfig(){return this.assertInRequestScope(),T(this.config.requestLocalStorage.getStore(),"Failed to access request data outside of the request's scope")}}function ue(t,e){return Ut(t,{},e)}function ae(t,e){const n=Object.getPrototypeOf(e).constructor.name,r=zt().codeDirByServiceClassName.get(n);return b(r,()=>`Caller class codeDir is not set: ${n}`),ue(t,r)}function se(t,e=dt){return ue(t,T(zt().moduleById.get(e),"Module not found: "+e).codeDir)}function ce(){const t=zt(),e=process.env.SQUID_REGION||"local",n=process.env.SQUID_CONSOLE_REGION,r=gt(t.appId);return{appId:r.appId,apiKey:t.backendApiKey,squidDeveloperId:r.squidDeveloperId,environmentId:r.environmentId,region:e,consoleRegion:n}}function le(){return o.getInstance(ce())}function fe(){return o.getInstance({...ce(),isPassiveMode:!0})}class pe extends ie{}class de{constructor(){G.setIntegrationLifecycleHooks({onIntegrationCreated:this.onIntegrationCreated!==de.prototype.onIntegrationCreated,onIntegrationDeleted:this.onIntegrationDeleted!==de.prototype.onIntegrationDeleted,onIntegrationChanged:this.onIntegrationChanged!==de.prototype.onIntegrationChanged})}get squid(){return le()}metadata(){return G.data}async onIntegrationCreated(t){}async onIntegrationChanged(t){}async onIntegrationDeleted(t){}async cleanup(){for(const t of o.getInstances())await t.destruct()}}class he{constructor(t){this.agentId=t.agentId,this.prompt=t.prompt,this.options=t.options}}class ge{constructor(t){this.integrationId=t.integrationId,this.endpointId=t.endpointId,this.url=t.url,this.method=t.method,this.body=t.body,this.options=t.options}}var ye;!function(t){t.EVERY_SECOND="* * * * * *",t.EVERY_5_SECONDS="*/5 * * * * *",t.EVERY_10_SECONDS="*/10 * * * * *",t.EVERY_30_SECONDS="*/30 * * * * *",t.EVERY_MINUTE="*/1 * * * *",t.EVERY_5_MINUTES="0 */5 * * * *",t.EVERY_10_MINUTES="0 */10 * * * *",t.EVERY_30_MINUTES="0 */30 * * * *",t.EVERY_HOUR="0 0-23/1 * * *",t.EVERY_2_HOURS="0 0-23/2 * * *",t.EVERY_3_HOURS="0 0-23/3 * * *",t.EVERY_4_HOURS="0 0-23/4 * * *",t.EVERY_5_HOURS="0 0-23/5 * * *",t.EVERY_6_HOURS="0 0-23/6 * * *",t.EVERY_7_HOURS="0 0-23/7 * * *",t.EVERY_8_HOURS="0 0-23/8 * * *",t.EVERY_9_HOURS="0 0-23/9 * * *",t.EVERY_10_HOURS="0 0-23/10 * * *",t.EVERY_11_HOURS="0 0-23/11 * * *",t.EVERY_12_HOURS="0 0-23/12 * * *",t.EVERY_DAY_AT_1AM="0 01 * * *",t.EVERY_DAY_AT_2AM="0 02 * * *",t.EVERY_DAY_AT_3AM="0 03 * * *",t.EVERY_DAY_AT_4AM="0 04 * * *",t.EVERY_DAY_AT_5AM="0 05 * * *",t.EVERY_DAY_AT_6AM="0 06 * * *",t.EVERY_DAY_AT_7AM="0 07 * * *",t.EVERY_DAY_AT_8AM="0 08 * * *",t.EVERY_DAY_AT_9AM="0 09 * * *",t.EVERY_DAY_AT_10AM="0 10 * * *",t.EVERY_DAY_AT_11AM="0 11 * * *",t.EVERY_DAY_AT_NOON="0 12 * * *",t.EVERY_DAY_AT_1PM="0 13 * * *",t.EVERY_DAY_AT_2PM="0 14 * * *",t.EVERY_DAY_AT_3PM="0 15 * * *",t.EVERY_DAY_AT_4PM="0 16 * * *",t.EVERY_DAY_AT_5PM="0 17 * * *",t.EVERY_DAY_AT_6PM="0 18 * * *",t.EVERY_DAY_AT_7PM="0 19 * * *",t.EVERY_DAY_AT_8PM="0 20 * * *",t.EVERY_DAY_AT_9PM="0 21 * * *",t.EVERY_DAY_AT_10PM="0 22 * * *",t.EVERY_DAY_AT_11PM="0 23 * * *",t.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",t.EVERY_WEEK="0 0 * * 7",t.EVERY_WEEKDAY="0 0 * * 1-5",t.EVERY_WEEKEND="0 0 * * 6,7",t.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",t.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",t.EVERY_2ND_HOUR="0 */2 * * *",t.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",t.EVERY_2ND_MONTH="0 0 1 */2 *",t.EVERY_QUARTER="0 0 1 */3 *",t.EVERY_6_MONTHS="0 0 1 */6 *",t.EVERY_YEAR="0 0 1 1 *",t.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",t.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",t.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",t.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",t.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",t.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",t.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",t.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",t.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",t.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",t.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",t.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",t.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",t.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",t.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",t.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",t.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",t.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",t.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",t.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",t.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",t.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",t.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",t.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",t.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",t.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",t.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",t.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(ye||(ye={}));class _e{constructor(t){this.mutex=t}}class me{constructor(t){this.isGraphiQL=t.isGraphiQL,this.query=t.query,this.operationName=t.operationName,this.variables=t.variables}}const ve=["insert","update","delete"];class ke{constructor(t,e,n){this.mutation=t,this.beforeAndAfterDocs=e,this.serverTimeStamp=n}get before(){return this.beforeAndAfterDocs.before}get after(){return this.beforeAndAfterDocs.after}getMutationType(){return this.mutation.type}affectsPath(t){return!bt(vt(this.before,t),vt(this.after,t))}affectedPaths(t=""){b("update"===this.mutation.type,"affectedPaths can only be used with update mutations");const e=[];return this.checkPath(t,e),e}checkPath(t,e){const n=vt(this.before,t),r=vt(this.after,t);if(!bt(n,r)&&(""!==t&&e.push(t),"object"==typeof n&&null!==n&&"object"==typeof r&&null!==r)){const o=Object.keys(n),i=Object.keys(r);new Set([...o,...i]).forEach(n=>{const r=t?`${t}.${n}`:n;this.checkPath(r,e)})}}}function be(t){return{__isWebhookResponse__:!0,body:"",statusCode:204,headers:{},...t}}export{ge as ApiCallContext,ye as CronExpression,_e as DistributedLockContext,me as GraphqlContext,ve as MUTATION_TYPES,D as Meta,ke as MutationContext,Wt as QueryContext,he as SecureAiAgentContext,pe as SquidLlmService,de as SquidProject,ie as SquidService,dt as USER_CODE_MODULE_ID,ht as USER_CODE_PYTHON_MODULE_ID,re as WorkspaceClient,H as aiFunction,K as aiFunctionsConfigurator,ct as clientConnectionStateHandler,be as createWebhookResponse,V as eventHandler,z as executable,fe as getPassiveSquid,le as getSquid,ae as getSquidService,ne as isWorkspaceServerConfigured,pt as limiterConfigToOptions,rt as limits,it as llmAsk,ot as llmService,st as mcpAuthorizer,ut as mcpServer,at as mcpTool,G as metadata,U as onQueueMessage,Q as publicCollection,J as scheduler,nt as secureAiAgent,Y as secureAiQuery,q as secureApi,P as secureCollection,j as secureDatabase,et as secureDistributedLock,F as secureGraphQL,B as secureMetric,tt as secureNativeQuery,$ as secureStorage,W as secureTopic,se as squidInject,Z as trigger,X as webhook};
|
|
2
|
+
import{AI_AGENTS_INTEGRATION_ID as e,BUILT_IN_DB_INTEGRATION_ID as t,BUILT_IN_QUEUE_INTEGRATION_ID as n,BUILT_IN_STORAGE_INTEGRATION_ID as r,SOURCE_CODE_ANALYZER_MODELS as o,SOURCE_CODE_ANALYZE_FUNCTION_ID as i,SOURCE_CODE_INTEGRATION_TYPES as a,SOURCE_CODE_MAX_REPOSITORIES as u,SOURCE_CODE_MAX_SUPPLEMENTAL_INSTRUCTIONS_LENGTH as s,SOURCE_CONTROL_PROVIDERS as c,Squid as l,normalizeGitHubRepositorySelection as p}from"@squidcloud/client";import{isAbsolute as f,join as d,resolve as h}from"path";import{AsyncLocalStorage as g}from"node:async_hooks";import"node:stream";import{execFile as y}from"child_process";import{randomUUID as _}from"crypto";import{access as m,mkdir as v,readFile as k,rm as T,writeFile as b}from"fs/promises";import{tmpdir as O}from"os";import{promisify as w}from"util";var C={243(e,t,n){var r;e=n.nmd(e),function(){var o,i="Expected a function",a="__lodash_hash_undefined__",u="__lodash_placeholder__",s=32,c=128,l=1/0,p=9007199254740991,f=NaN,d=4294967295,h=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],g="[object Arguments]",y="[object Array]",_="[object Boolean]",m="[object Date]",v="[object Error]",k="[object Function]",T="[object GeneratorFunction]",b="[object Map]",O="[object Number]",w="[object Object]",C="[object Promise]",A="[object RegExp]",E="[object Set]",I="[object String]",S="[object Symbol]",R="[object WeakMap]",x="[object ArrayBuffer]",M="[object DataView]",L="[object Float32Array]",N="[object Float64Array]",D="[object Int8Array]",P="[object Int16Array]",G="[object Int32Array]",$="[object Uint8Array]",W="[object Uint8ClampedArray]",Y="[object Uint16Array]",j="[object Uint32Array]",Q=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,V=RegExp(F.source),H=RegExp(q.source),K=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),re=/^\s+/,oe=/\s/,ie=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,ge=/^\[object .+?Constructor\]$/,ye=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ke=/['\n\r\u2028\u2029\\]/g,Te="\\ud800-\\udfff",be="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Oe="\\u2700-\\u27bf",we="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Ee="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="["+Te+"]",Se="["+Ee+"]",Re="["+be+"]",xe="\\d+",Me="["+Oe+"]",Le="["+we+"]",Ne="[^"+Te+Ee+xe+Oe+we+Ce+"]",De="\\ud83c[\\udffb-\\udfff]",Pe="[^"+Te+"]",Ge="(?:\\ud83c[\\udde6-\\uddff]){2}",$e="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Ce+"]",Ye="\\u200d",je="(?:"+Le+"|"+Ne+")",Qe="(?:"+We+"|"+Ne+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Be="(?:['’](?:D|LL|M|RE|S|T|VE))?",Fe="(?:"+Re+"|"+De+")?",qe="["+Ae+"]?",Ve=qe+Fe+"(?:"+Ye+"(?:"+[Pe,Ge,$e].join("|")+")"+qe+Fe+")*",He="(?:"+[Me,Ge,$e].join("|")+")"+Ve,Ke="(?:"+[Pe+Re+"?",Re,Ge,$e,Ie].join("|")+")",ze=RegExp("['’]","g"),Ze=RegExp(Re,"g"),Xe=RegExp(De+"(?="+De+")|"+Ke+Ve,"g"),Je=RegExp([We+"?"+Le+"+"+Ue+"(?="+[Se,We,"$"].join("|")+")",Qe+"+"+Be+"(?="+[Se,We+je,"$"].join("|")+")",We+"?"+je+"+"+Ue,We+"+"+Be,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xe,He].join("|"),"g"),et=RegExp("["+Ye+Te+be+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,ot={};ot[L]=ot[N]=ot[D]=ot[P]=ot[G]=ot[$]=ot[W]=ot[Y]=ot[j]=!0,ot[g]=ot[y]=ot[x]=ot[_]=ot[M]=ot[m]=ot[v]=ot[k]=ot[b]=ot[O]=ot[w]=ot[A]=ot[E]=ot[I]=ot[R]=!1;var it={};it[g]=it[y]=it[x]=it[M]=it[_]=it[m]=it[L]=it[N]=it[D]=it[P]=it[G]=it[b]=it[O]=it[w]=it[A]=it[E]=it[I]=it[S]=it[$]=it[W]=it[Y]=it[j]=!0,it[v]=it[k]=it[R]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,st=parseInt,ct="object"==typeof global&&global&&global.Object===Object&&global,lt="object"==typeof self&&self&&self.Object===Object&&self,pt=ct||lt||Function("return this")(),ft=t&&!t.nodeType&&t,dt=ft&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ft,gt=ht&&ct.process,yt=function(){try{return dt&&dt.require&&dt.require("util").types||gt&>.binding&>.binding("util")}catch(e){}}(),_t=yt&&yt.isArrayBuffer,mt=yt&&yt.isDate,vt=yt&&yt.isMap,kt=yt&&yt.isRegExp,Tt=yt&&yt.isSet,bt=yt&&yt.isTypedArray;function Ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function wt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var a=e[o];t(r,a,n(a),e)}return r}function Ct(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function At(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Et(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function It(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}function St(e,t){return!(null==e||!e.length)&&Wt(e,t,0)>-1}function Rt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function xt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function Mt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function Lt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function Nt(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function Dt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Pt=Ut("length");function Gt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function $t(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function Wt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):$t(e,jt,n)}function Yt(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function jt(e){return e!=e}function Qt(e,t){var n=null==e?0:e.length;return n?qt(e,t)/n:f}function Ut(e){return function(t){return null==t?o:t[e]}}function Bt(e){return function(t){return null==e?o:e[t]}}function Ft(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function qt(e,t){for(var n,r=-1,i=e.length;++r<i;){var a=t(e[r]);a!==o&&(n=n===o?a:n+a)}return n}function Vt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ht(e){return e?e.slice(0,fn(e)+1).replace(re,""):e}function Kt(e){return function(t){return e(t)}}function zt(e,t){return xt(t,function(t){return e[t]})}function Zt(e,t){return e.has(t)}function Xt(e,t){for(var n=-1,r=e.length;++n<r&&Wt(t,e[n],0)>-1;);return n}function Jt(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}var en=Bt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tn=Bt({"&":"&","<":"<",">":">",'"':""","'":"'"});function nn(e){return"\\"+at[e]}function rn(e){return et.test(e)}function on(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function an(e,t){return function(n){return e(t(n))}}function un(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n];a!==t&&a!==u||(e[n]=u,i[o++]=n)}return i}function sn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function cn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function ln(e){return rn(e)?function(e){for(var t=Xe.lastIndex=0;Xe.test(e);)++t;return t}(e):Pt(e)}function pn(e){return rn(e)?function(e){return e.match(Xe)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var dn=Bt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),hn=function e(t){var n,r=(t=null==t?pt:hn.defaults(pt.Object(),t,hn.pick(pt,nt))).Array,oe=t.Date,Te=t.Error,be=t.Function,Oe=t.Math,we=t.Object,Ce=t.RegExp,Ae=t.String,Ee=t.TypeError,Ie=r.prototype,Se=be.prototype,Re=we.prototype,xe=t["__core-js_shared__"],Me=Se.toString,Le=Re.hasOwnProperty,Ne=0,De=(n=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Pe=Re.toString,Ge=Me.call(we),$e=pt._,We=Ce("^"+Me.call(Le).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ye=ht?t.Buffer:o,je=t.Symbol,Qe=t.Uint8Array,Ue=Ye?Ye.allocUnsafe:o,Be=an(we.getPrototypeOf,we),Fe=we.create,qe=Re.propertyIsEnumerable,Ve=Ie.splice,He=je?je.isConcatSpreadable:o,Ke=je?je.iterator:o,Xe=je?je.toStringTag:o,et=function(){try{var e=ci(we,"defineProperty");return e({},"",{}),e}catch(e){}}(),at=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,ct=oe&&oe.now!==pt.Date.now&&oe.now,lt=t.setTimeout!==pt.setTimeout&&t.setTimeout,ft=Oe.ceil,dt=Oe.floor,gt=we.getOwnPropertySymbols,yt=Ye?Ye.isBuffer:o,Pt=t.isFinite,Bt=Ie.join,gn=an(we.keys,we),yn=Oe.max,_n=Oe.min,mn=oe.now,vn=t.parseInt,kn=Oe.random,Tn=Ie.reverse,bn=ci(t,"DataView"),On=ci(t,"Map"),wn=ci(t,"Promise"),Cn=ci(t,"Set"),An=ci(t,"WeakMap"),En=ci(we,"create"),In=An&&new An,Sn={},Rn=Gi(bn),xn=Gi(On),Mn=Gi(wn),Ln=Gi(Cn),Nn=Gi(An),Dn=je?je.prototype:o,Pn=Dn?Dn.valueOf:o,Gn=Dn?Dn.toString:o;function $n(e){if(eu(e)&&!Ua(e)&&!(e instanceof Qn)){if(e instanceof jn)return e;if(Le.call(e,"__wrapped__"))return $i(e)}return new jn(e)}var Wn=function(){function e(){}return function(t){if(!Ja(t))return{};if(Fe)return Fe(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Yn(){}function jn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function Qn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Bn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function qn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Fn;++t<n;)this.add(e[t])}function Vn(e){var t=this.__data__=new Bn(e);this.size=t.size}function Hn(e,t){var n=Ua(e),r=!n&&Qa(e),o=!n&&!r&&Va(e),i=!n&&!r&&!o&&su(e),a=n||r||o||i,u=a?Vt(e.length,Ae):[],s=u.length;for(var c in e)!t&&!Le.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||yi(c,s))||u.push(c);return u}function Kn(e){var t=e.length;return t?e[Fr(0,t-1)]:o}function zn(e,t){return Mi(Eo(e),ir(t,0,e.length))}function Zn(e){return Mi(Eo(e))}function Xn(e,t,n){(n!==o&&!Wa(e[t],n)||n===o&&!(t in e))&&rr(e,t,n)}function Jn(e,t,n){var r=e[t];Le.call(e,t)&&Wa(r,n)&&(n!==o||t in e)||rr(e,t,n)}function er(e,t){for(var n=e.length;n--;)if(Wa(e[n][0],t))return n;return-1}function tr(e,t,n,r){return lr(e,function(e,o,i){t(r,e,n(e),i)}),r}function nr(e,t){return e&&Io(t,Ru(t),e)}function rr(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function or(e,t){for(var n=-1,i=t.length,a=r(i),u=null==e;++n<i;)a[n]=u?o:Cu(e,t[n]);return a}function ir(e,t,n){return e==e&&(n!==o&&(e=e<=n?e:n),t!==o&&(e=e>=t?e:t)),e}function ar(e,t,n,r,i,a){var u,s=1&t,c=2&t,l=4&t;if(n&&(u=i?n(e,r,i,a):n(e)),u!==o)return u;if(!Ja(e))return e;var p=Ua(e);if(p){if(u=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Le.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return Eo(e,u)}else{var f=fi(e),d=f==k||f==T;if(Va(e))return To(e,s);if(f==w||f==g||d&&!i){if(u=c||d?{}:hi(e),!s)return c?function(e,t){return Io(e,pi(e),t)}(e,function(e,t){return e&&Io(t,xu(t),e)}(u,e)):function(e,t){return Io(e,li(e),t)}(e,nr(u,e))}else{if(!it[f])return i?e:{};u=function(e,t,n){var r,o=e.constructor;switch(t){case x:return bo(e);case _:case m:return new o(+e);case M:return function(e,t){var n=t?bo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case L:case N:case D:case P:case G:case $:case W:case Y:case j:return Oo(e,n);case b:return new o;case O:case I:return new o(e);case A:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case E:return new o;case S:return r=e,Pn?we(Pn.call(r)):{}}}(e,f,s)}}a||(a=new Vn);var h=a.get(e);if(h)return h;a.set(e,u),iu(e)?e.forEach(function(r){u.add(ar(r,t,n,r,e,a))}):tu(e)&&e.forEach(function(r,o){u.set(o,ar(r,t,n,o,e,a))});var y=p?o:(l?c?ni:ti:c?xu:Ru)(e);return Ct(y||e,function(r,o){y&&(r=e[o=r]),Jn(u,o,ar(r,t,n,o,e,a))}),u}function ur(e,t,n){var r=n.length;if(null==e)return!r;for(e=we(e);r--;){var i=n[r],a=t[i],u=e[i];if(u===o&&!(i in e)||!a(u))return!1}return!0}function sr(e,t,n){if("function"!=typeof e)throw new Ee(i);return Ii(function(){e.apply(o,n)},t)}function cr(e,t,n,r){var o=-1,i=St,a=!0,u=e.length,s=[],c=t.length;if(!u)return s;n&&(t=xt(t,Kt(n))),r?(i=Rt,a=!1):t.length>=200&&(i=Zt,a=!1,t=new qn(t));e:for(;++o<u;){var l=e[o],p=null==n?l:n(l);if(l=r||0!==l?l:0,a&&p==p){for(var f=c;f--;)if(t[f]===p)continue e;s.push(l)}else i(t,p,r)||s.push(l)}return s}$n.templateSettings={escape:K,evaluate:z,interpolate:Z,variable:"",imports:{_:$n}},$n.prototype=Yn.prototype,$n.prototype.constructor=$n,jn.prototype=Wn(Yn.prototype),jn.prototype.constructor=jn,Qn.prototype=Wn(Yn.prototype),Qn.prototype.constructor=Qn,Un.prototype.clear=function(){this.__data__=En?En(null):{},this.size=0},Un.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Un.prototype.get=function(e){var t=this.__data__;if(En){var n=t[e];return n===a?o:n}return Le.call(t,e)?t[e]:o},Un.prototype.has=function(e){var t=this.__data__;return En?t[e]!==o:Le.call(t,e)},Un.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=En&&t===o?a:t,this},Bn.prototype.clear=function(){this.__data__=[],this.size=0},Bn.prototype.delete=function(e){var t=this.__data__,n=er(t,e);return!(n<0||(n==t.length-1?t.pop():Ve.call(t,n,1),--this.size,0))},Bn.prototype.get=function(e){var t=this.__data__,n=er(t,e);return n<0?o:t[n][1]},Bn.prototype.has=function(e){return er(this.__data__,e)>-1},Bn.prototype.set=function(e,t){var n=this.__data__,r=er(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(On||Bn),string:new Un}},Fn.prototype.delete=function(e){var t=ui(this,e).delete(e);return this.size-=t?1:0,t},Fn.prototype.get=function(e){return ui(this,e).get(e)},Fn.prototype.has=function(e){return ui(this,e).has(e)},Fn.prototype.set=function(e,t){var n=ui(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},qn.prototype.add=qn.prototype.push=function(e){return this.__data__.set(e,a),this},qn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.clear=function(){this.__data__=new Bn,this.size=0},Vn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Vn.prototype.get=function(e){return this.__data__.get(e)},Vn.prototype.has=function(e){return this.__data__.has(e)},Vn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Bn){var r=n.__data__;if(!On||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Fn(r)}return n.set(e,t),this.size=n.size,this};var lr=xo(mr),pr=xo(vr,!0);function fr(e,t){var n=!0;return lr(e,function(e,r,o){return n=!!t(e,r,o)}),n}function dr(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],u=t(a);if(null!=u&&(s===o?u==u&&!uu(u):n(u,s)))var s=u,c=a}return c}function hr(e,t){var n=[];return lr(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function gr(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=gi),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?gr(u,t-1,n,r,o):Mt(o,u):r||(o[o.length]=u)}return o}var yr=Mo(),_r=Mo(!0);function mr(e,t){return e&&yr(e,t,Ru)}function vr(e,t){return e&&_r(e,t,Ru)}function kr(e,t){return It(t,function(t){return za(e[t])})}function Tr(e,t){for(var n=0,r=(t=_o(t,e)).length;null!=e&&n<r;)e=e[Pi(t[n++])];return n&&n==r?e:o}function br(e,t,n){var r=t(e);return Ua(e)?r:Mt(r,n(e))}function Or(e){return null==e?e===o?"[object Undefined]":"[object Null]":Xe&&Xe in we(e)?function(e){var t=Le.call(e,Xe),n=e[Xe];try{e[Xe]=o;var r=!0}catch(e){}var i=Pe.call(e);return r&&(t?e[Xe]=n:delete e[Xe]),i}(e):function(e){return Pe.call(e)}(e)}function wr(e,t){return e>t}function Cr(e,t){return null!=e&&Le.call(e,t)}function Ar(e,t){return null!=e&&t in we(e)}function Er(e,t,n){for(var i=n?Rt:St,a=e[0].length,u=e.length,s=u,c=r(u),l=1/0,p=[];s--;){var f=e[s];s&&t&&(f=xt(f,Kt(t))),l=_n(f.length,l),c[s]=!n&&(t||a>=120&&f.length>=120)?new qn(s&&f):o}f=e[0];var d=-1,h=c[0];e:for(;++d<a&&p.length<l;){var g=f[d],y=t?t(g):g;if(g=n||0!==g?g:0,!(h?Zt(h,y):i(p,y,n))){for(s=u;--s;){var _=c[s];if(!(_?Zt(_,y):i(e[s],y,n)))continue e}h&&h.push(y),p.push(g)}}return p}function Ir(e,t,n){var r=null==(e=Ci(e,t=_o(t,e)))?e:e[Pi(Ki(t))];return null==r?o:Ot(r,e,n)}function Sr(e){return eu(e)&&Or(e)==g}function Rr(e,t,n,r,i){return e===t||(null==e||null==t||!eu(e)&&!eu(t)?e!=e&&t!=t:function(e,t,n,r,i,a){var u=Ua(e),s=Ua(t),c=u?y:fi(e),l=s?y:fi(t),p=(c=c==g?w:c)==w,f=(l=l==g?w:l)==w,d=c==l;if(d&&Va(e)){if(!Va(t))return!1;u=!0,p=!1}if(d&&!p)return a||(a=new Vn),u||su(e)?Jo(e,t,n,r,i,a):function(e,t,n,r,o,i,a){switch(n){case M:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case x:return!(e.byteLength!=t.byteLength||!i(new Qe(e),new Qe(t)));case _:case m:case O:return Wa(+e,+t);case v:return e.name==t.name&&e.message==t.message;case A:case I:return e==t+"";case b:var u=on;case E:var s=1&r;if(u||(u=sn),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=Jo(u(e),u(t),r,o,i,a);return a.delete(e),l;case S:if(Pn)return Pn.call(e)==Pn.call(t)}return!1}(e,t,c,n,r,i,a);if(!(1&n)){var h=p&&Le.call(e,"__wrapped__"),k=f&&Le.call(t,"__wrapped__");if(h||k){var T=h?e.value():e,C=k?t.value():t;return a||(a=new Vn),i(T,C,n,r,a)}}return!!d&&(a||(a=new Vn),function(e,t,n,r,i,a){var u=1&n,s=ti(e),c=s.length;if(c!=ti(t).length&&!u)return!1;for(var l=c;l--;){var p=s[l];if(!(u?p in t:Le.call(t,p)))return!1}var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var h=!0;a.set(e,t),a.set(t,e);for(var g=u;++l<c;){var y=e[p=s[l]],_=t[p];if(r)var m=u?r(_,y,p,t,e,a):r(y,_,p,e,t,a);if(!(m===o?y===_||i(y,_,n,r,a):m)){h=!1;break}g||(g="constructor"==p)}if(h&&!g){var v=e.constructor,k=t.constructor;v==k||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof k&&k instanceof k||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,r,i,a))}(e,t,n,r,Rr,i))}function xr(e,t,n,r){var i=n.length,a=i,u=!r;if(null==e)return!a;for(e=we(e);i--;){var s=n[i];if(u&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],l=e[c],p=s[1];if(u&&s[2]){if(l===o&&!(c in e))return!1}else{var f=new Vn;if(r)var d=r(l,p,c,e,t,f);if(!(d===o?Rr(p,l,3,r,f):d))return!1}}return!0}function Mr(e){return!(!Ja(e)||(t=e,De&&De in t))&&(za(e)?We:ge).test(Gi(e));var t}function Lr(e){return"function"==typeof e?e:null==e?ns:"object"==typeof e?Ua(e)?$r(e[0],e[1]):Gr(e):ps(e)}function Nr(e){if(!Ti(e))return gn(e);var t=[];for(var n in we(e))Le.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Dr(e,t){return e<t}function Pr(e,t){var n=-1,o=Fa(e)?r(e.length):[];return lr(e,function(e,r,i){o[++n]=t(e,r,i)}),o}function Gr(e){var t=si(e);return 1==t.length&&t[0][2]?Oi(t[0][0],t[0][1]):function(n){return n===e||xr(n,e,t)}}function $r(e,t){return mi(e)&&bi(t)?Oi(Pi(e),t):function(n){var r=Cu(n,e);return r===o&&r===t?Au(n,e):Rr(t,r,3)}}function Wr(e,t,n,r,i){e!==t&&yr(t,function(a,u){if(i||(i=new Vn),Ja(a))!function(e,t,n,r,i,a,u){var s=Ai(e,n),c=Ai(t,n),l=u.get(c);if(l)Xn(e,n,l);else{var p=a?a(s,c,n+"",e,t,u):o,f=p===o;if(f){var d=Ua(c),h=!d&&Va(c),g=!d&&!h&&su(c);p=c,d||h||g?Ua(s)?p=s:qa(s)?p=Eo(s):h?(f=!1,p=To(c,!0)):g?(f=!1,p=Oo(c,!0)):p=[]:ru(c)||Qa(c)?(p=s,Qa(s)?p=yu(s):Ja(s)&&!za(s)||(p=hi(c))):f=!1}f&&(u.set(c,p),i(p,c,r,a,u),u.delete(c)),Xn(e,n,p)}}(e,t,u,n,Wr,r,i);else{var s=r?r(Ai(e,u),a,u+"",e,t,i):o;s===o&&(s=a),Xn(e,u,s)}},xu)}function Yr(e,t){var n=e.length;if(n)return yi(t+=t<0?n:0,n)?e[t]:o}function jr(e,t,n){t=t.length?xt(t,function(e){return Ua(e)?function(t){return Tr(t,1===e.length?e[0]:e)}:e}):[ns];var r=-1;t=xt(t,Kt(ai()));var o=Pr(e,function(e,n,o){var i=xt(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return function(e){var t=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,u=n.length;++r<a;){var s=wo(o[r],i[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});t--;)e[t]=e[t].value;return e}(o)}function Qr(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var a=t[r],u=Tr(e,a);n(u,a)&&zr(i,_o(a,e),u)}return i}function Ur(e,t,n,r){var o=r?Yt:Wt,i=-1,a=t.length,u=e;for(e===t&&(t=Eo(t)),n&&(u=xt(e,Kt(n)));++i<a;)for(var s=0,c=t[i],l=n?n(c):c;(s=o(u,l,s,r))>-1;)u!==e&&Ve.call(u,s,1),Ve.call(e,s,1);return e}function Br(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;yi(o)?Ve.call(e,o,1):so(e,o)}}return e}function Fr(e,t){return e+dt(kn()*(t-e+1))}function qr(e,t){var n="";if(!e||t<1||t>p)return n;do{t%2&&(n+=e),(t=dt(t/2))&&(e+=e)}while(t);return n}function Vr(e,t){return Si(wi(e,t,ns),e+"")}function Hr(e){return Kn(Wu(e))}function Kr(e,t){var n=Wu(e);return Mi(n,ir(t,0,n.length))}function zr(e,t,n,r){if(!Ja(e))return e;for(var i=-1,a=(t=_o(t,e)).length,u=a-1,s=e;null!=s&&++i<a;){var c=Pi(t[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=u){var p=s[c];(l=r?r(p,c,s):o)===o&&(l=Ja(p)?p:yi(t[i+1])?[]:{})}Jn(s,c,l),s=s[c]}return e}var Zr=In?function(e,t){return In.set(e,t),e}:ns,Xr=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Ju(t),writable:!0})}:ns;function Jr(e){return Mi(Wu(e))}function eo(e,t,n){var o=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=r(i);++o<i;)a[o]=e[o+t];return a}function to(e,t){var n;return lr(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function no(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,a=e[i];null!==a&&!uu(a)&&(n?a<=t:a<t)?r=i+1:o=i}return o}return ro(e,t,ns,n)}function ro(e,t,n,r){var i=0,a=null==e?0:e.length;if(0===a)return 0;for(var u=(t=n(t))!=t,s=null===t,c=uu(t),l=t===o;i<a;){var p=dt((i+a)/2),f=n(e[p]),d=f!==o,h=null===f,g=f==f,y=uu(f);if(u)var _=r||g;else _=l?g&&(r||d):s?g&&d&&(r||!h):c?g&&d&&!h&&(r||!y):!h&&!y&&(r?f<=t:f<t);_?i=p+1:a=p}return _n(a,4294967294)}function oo(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var a=e[n],u=t?t(a):a;if(!n||!Wa(u,s)){var s=u;i[o++]=0===a?0:a}}return i}function io(e){return"number"==typeof e?e:uu(e)?f:+e}function ao(e){if("string"==typeof e)return e;if(Ua(e))return xt(e,ao)+"";if(uu(e))return Gn?Gn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function uo(e,t,n){var r=-1,o=St,i=e.length,a=!0,u=[],s=u;if(n)a=!1,o=Rt;else if(i>=200){var c=t?null:Vo(e);if(c)return sn(c);a=!1,o=Zt,s=new qn}else s=t?[]:u;e:for(;++r<i;){var l=e[r],p=t?t(l):l;if(l=n||0!==l?l:0,a&&p==p){for(var f=s.length;f--;)if(s[f]===p)continue e;t&&s.push(p),u.push(l)}else o(s,p,n)||(s!==u&&s.push(p),u.push(l))}return u}function so(e,t){var n=-1,r=(t=_o(t,e)).length;if(!r)return!0;for(;++n<r;){var o=Pi(t[n]);if("__proto__"===o&&!Le.call(e,"__proto__"))return!1;if(("constructor"===o||"prototype"===o)&&n<r-1)return!1}var i=Ci(e,t);return null==i||delete i[Pi(Ki(t))]}function co(e,t,n,r){return zr(e,t,n(Tr(e,t)),r)}function lo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?eo(e,r?0:i,r?i+1:o):eo(e,r?i+1:0,r?o:i)}function po(e,t){var n=e;return n instanceof Qn&&(n=n.value()),Lt(t,function(e,t){return t.func.apply(t.thisArg,Mt([e],t.args))},n)}function fo(e,t,n){var o=e.length;if(o<2)return o?uo(e[0]):[];for(var i=-1,a=r(o);++i<o;)for(var u=e[i],s=-1;++s<o;)s!=i&&(a[i]=cr(a[i]||u,e[s],t,n));return uo(gr(a,1),t,n)}function ho(e,t,n){for(var r=-1,i=e.length,a=t.length,u={};++r<i;){var s=r<a?t[r]:o;n(u,e[r],s)}return u}function go(e){return qa(e)?e:[]}function yo(e){return"function"==typeof e?e:ns}function _o(e,t){return Ua(e)?e:mi(e,t)?[e]:Di(_u(e))}var mo=Vr;function vo(e,t,n){var r=e.length;return n=n===o?r:n,!t&&n>=r?e:eo(e,t,n)}var ko=at||function(e){return pt.clearTimeout(e)};function To(e,t){if(t)return e.slice();var n=e.length,r=Ue?Ue(n):new e.constructor(n);return e.copy(r),r}function bo(e){var t=new e.constructor(e.byteLength);return new Qe(t).set(new Qe(e)),t}function Oo(e,t){var n=t?bo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function wo(e,t){if(e!==t){var n=e!==o,r=null===e,i=e==e,a=uu(e),u=t!==o,s=null===t,c=t==t,l=uu(t);if(!s&&!l&&!a&&e>t||a&&u&&c&&!s&&!l||r&&u&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!u&&i||!c)return-1}return 0}function Co(e,t,n,o){for(var i=-1,a=e.length,u=n.length,s=-1,c=t.length,l=yn(a-u,0),p=r(c+l),f=!o;++s<c;)p[s]=t[s];for(;++i<u;)(f||i<a)&&(p[n[i]]=e[i]);for(;l--;)p[s++]=e[i++];return p}function Ao(e,t,n,o){for(var i=-1,a=e.length,u=-1,s=n.length,c=-1,l=t.length,p=yn(a-s,0),f=r(p+l),d=!o;++i<p;)f[i]=e[i];for(var h=i;++c<l;)f[h+c]=t[c];for(;++u<s;)(d||i<a)&&(f[h+n[u]]=e[i++]);return f}function Eo(e,t){var n=-1,o=e.length;for(t||(t=r(o));++n<o;)t[n]=e[n];return t}function Io(e,t,n,r){var i=!n;n||(n={});for(var a=-1,u=t.length;++a<u;){var s=t[a],c=r?r(n[s],e[s],s,n,e):o;c===o&&(c=e[s]),i?rr(n,s,c):Jn(n,s,c)}return n}function So(e,t){return function(n,r){var o=Ua(n)?wt:tr,i=t?t():{};return o(n,e,ai(r,2),i)}}function Ro(e){return Vr(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:o,u=i>2?n[2]:o;for(a=e.length>3&&"function"==typeof a?(i--,a):o,u&&_i(n[0],n[1],u)&&(a=i<3?o:a,i=1),t=we(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function xo(e,t){return function(n,r){if(null==n)return n;if(!Fa(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=we(n);(t?i--:++i<o)&&!1!==r(a[i],i,a););return n}}function Mo(e){return function(t,n,r){for(var o=-1,i=we(t),a=r(t),u=a.length;u--;){var s=a[e?u:++o];if(!1===n(i[s],s,i))break}return t}}function Lo(e){return function(t){var n=rn(t=_u(t))?pn(t):o,r=n?n[0]:t.charAt(0),i=n?vo(n,1).join(""):t.slice(1);return r[e]()+i}}function No(e){return function(t){return Lt(zu(Qu(t).replace(ze,"")),e,"")}}function Do(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Wn(e.prototype),r=e.apply(n,t);return Ja(r)?r:n}}function Po(e){return function(t,n,r){var i=we(t);if(!Fa(t)){var a=ai(n,3);t=Ru(t),n=function(e){return a(i[e],e,i)}}var u=e(t,n,r);return u>-1?i[a?t[u]:u]:o}}function Go(e){return ei(function(t){var n=t.length,r=n,a=jn.prototype.thru;for(e&&t.reverse();r--;){var u=t[r];if("function"!=typeof u)throw new Ee(i);if(a&&!s&&"wrapper"==oi(u))var s=new jn([],!0)}for(r=s?r:n;++r<n;){var c=oi(u=t[r]),l="wrapper"==c?ri(u):o;s=l&&vi(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?s[oi(l[0])].apply(s,l[3]):1==u.length&&vi(u)?s[c]():s.thru(u)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&Ua(r))return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++o<n;)i=t[o].call(this,i);return i}})}function $o(e,t,n,i,a,u,s,l,p,f){var d=t&c,h=1&t,g=2&t,y=24&t,_=512&t,m=g?o:Do(e);return function c(){for(var v=arguments.length,k=r(v),T=v;T--;)k[T]=arguments[T];if(y)var b=ii(c),O=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(k,b);if(i&&(k=Co(k,i,a,y)),u&&(k=Ao(k,u,s,y)),v-=O,y&&v<f){var w=un(k,b);return Fo(e,t,$o,c.placeholder,n,k,w,l,p,f-v)}var C=h?n:this,A=g?C[e]:e;return v=k.length,l?k=function(e,t){for(var n=e.length,r=_n(t.length,n),i=Eo(e);r--;){var a=t[r];e[r]=yi(a,n)?i[a]:o}return e}(k,l):_&&v>1&&k.reverse(),d&&p<v&&(k.length=p),this&&this!==pt&&this instanceof c&&(A=m||Do(A)),A.apply(C,k)}}function Wo(e,t){return function(n,r){return function(e,t,n,r){return mr(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Yo(e,t){return function(n,r){var i;if(n===o&&r===o)return t;if(n!==o&&(i=n),r!==o){if(i===o)return r;"string"==typeof n||"string"==typeof r?(n=ao(n),r=ao(r)):(n=io(n),r=io(r)),i=e(n,r)}return i}}function jo(e){return ei(function(t){return t=xt(t,Kt(ai())),Vr(function(n){var r=this;return e(t,function(e){return Ot(e,r,n)})})})}function Qo(e,t){var n=(t=t===o?" ":ao(t)).length;if(n<2)return n?qr(t,e):t;var r=qr(t,ft(e/ln(t)));return rn(t)?vo(pn(r),0,e).join(""):r.slice(0,e)}function Uo(e){return function(t,n,i){return i&&"number"!=typeof i&&_i(t,n,i)&&(n=i=o),t=fu(t),n===o?(n=t,t=0):n=fu(n),function(e,t,n,o){for(var i=-1,a=yn(ft((t-e)/(n||1)),0),u=r(a);a--;)u[o?a:++i]=e,e+=n;return u}(t,n,i=i===o?t<n?1:-1:fu(i),e)}}function Bo(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=gu(t),n=gu(n)),e(t,n)}}function Fo(e,t,n,r,i,a,u,c,l,p){var f=8&t;t|=f?s:64,4&(t&=~(f?64:s))||(t&=-4);var d=[e,t,i,f?a:o,f?u:o,f?o:a,f?o:u,c,l,p],h=n.apply(o,d);return vi(e)&&Ei(h,d),h.placeholder=r,Ri(h,e,t)}function qo(e){var t=Oe[e];return function(e,n){if(e=gu(e),(n=null==n?0:_n(du(n),292))&&Pt(e)){var r=(_u(e)+"e").split("e");return+((r=(_u(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Vo=Cn&&1/sn(new Cn([,-0]))[1]==l?function(e){return new Cn(e)}:us;function Ho(e){return function(t){var n=fi(t);return n==b?on(t):n==E?cn(t):function(e,t){return xt(t,function(t){return[t,e[t]]})}(t,e(t))}}function Ko(e,t,n,a,l,p,f,d){var h=2&t;if(!h&&"function"!=typeof e)throw new Ee(i);var g=a?a.length:0;if(g||(t&=-97,a=l=o),f=f===o?f:yn(du(f),0),d=d===o?d:du(d),g-=l?l.length:0,64&t){var y=a,_=l;a=l=o}var m=h?o:ri(e),v=[e,t,n,a,l,y,_,p,f,d];if(m&&function(e,t){var n=e[1],r=t[1],o=n|r,i=o<131,a=r==c&&8==n||r==c&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!i&&!a)return e;1&r&&(e[2]=t[2],o|=1&n?0:4);var s=t[3];if(s){var l=e[3];e[3]=l?Co(l,s,t[4]):s,e[4]=l?un(e[3],u):t[4]}(s=t[5])&&(l=e[5],e[5]=l?Ao(l,s,t[6]):s,e[6]=l?un(e[5],u):t[6]),(s=t[7])&&(e[7]=s),r&c&&(e[8]=null==e[8]?t[8]:_n(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o}(v,m),e=v[0],t=v[1],n=v[2],a=v[3],l=v[4],!(d=v[9]=v[9]===o?h?0:e.length:yn(v[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)k=8==t||16==t?function(e,t,n){var i=Do(e);return function a(){for(var u=arguments.length,s=r(u),c=u,l=ii(a);c--;)s[c]=arguments[c];var p=u<3&&s[0]!==l&&s[u-1]!==l?[]:un(s,l);return(u-=p.length)<n?Fo(e,t,$o,a.placeholder,o,s,p,o,o,n-u):Ot(this&&this!==pt&&this instanceof a?i:e,this,s)}}(e,t,d):t!=s&&33!=t||l.length?$o.apply(o,v):function(e,t,n,o){var i=1&t,a=Do(e);return function t(){for(var u=-1,s=arguments.length,c=-1,l=o.length,p=r(l+s),f=this&&this!==pt&&this instanceof t?a:e;++c<l;)p[c]=o[c];for(;s--;)p[c++]=arguments[++u];return Ot(f,i?n:this,p)}}(e,t,n,a);else var k=function(e,t,n){var r=1&t,o=Do(e);return function t(){return(this&&this!==pt&&this instanceof t?o:e).apply(r?n:this,arguments)}}(e,t,n);return Ri((m?Zr:Ei)(k,v),e,t)}function zo(e,t,n,r){return e===o||Wa(e,Re[n])&&!Le.call(r,n)?t:e}function Zo(e,t,n,r,i,a){return Ja(e)&&Ja(t)&&(a.set(t,e),Wr(e,t,o,Zo,a),a.delete(t)),e}function Xo(e){return ru(e)?o:e}function Jo(e,t,n,r,i,a){var u=1&n,s=e.length,c=t.length;if(s!=c&&!(u&&c>s))return!1;var l=a.get(e),p=a.get(t);if(l&&p)return l==t&&p==e;var f=-1,d=!0,h=2&n?new qn:o;for(a.set(e,t),a.set(t,e);++f<s;){var g=e[f],y=t[f];if(r)var _=u?r(y,g,f,t,e,a):r(g,y,f,e,t,a);if(_!==o){if(_)continue;d=!1;break}if(h){if(!Dt(t,function(e,t){if(!Zt(h,t)&&(g===e||i(g,e,n,r,a)))return h.push(t)})){d=!1;break}}else if(g!==y&&!i(g,y,n,r,a)){d=!1;break}}return a.delete(e),a.delete(t),d}function ei(e){return Si(wi(e,o,Bi),e+"")}function ti(e){return br(e,Ru,li)}function ni(e){return br(e,xu,pi)}var ri=In?function(e){return In.get(e)}:us;function oi(e){for(var t=e.name+"",n=Sn[t],r=Le.call(Sn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function ii(e){return(Le.call($n,"placeholder")?$n:e).placeholder}function ai(){var e=$n.iteratee||rs;return e=e===rs?Lr:e,arguments.length?e(arguments[0],arguments[1]):e}function ui(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function si(e){for(var t=Ru(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,bi(o)]}return t}function ci(e,t){var n=function(e,t){return null==e?o:e[t]}(e,t);return Mr(n)?n:o}var li=gt?function(e){return null==e?[]:(e=we(e),It(gt(e),function(t){return qe.call(e,t)}))}:hs,pi=gt?function(e){for(var t=[];e;)Mt(t,li(e)),e=Be(e);return t}:hs,fi=Or;function di(e,t,n){for(var r=-1,o=(t=_o(t,e)).length,i=!1;++r<o;){var a=Pi(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Xa(o)&&yi(a,o)&&(Ua(e)||Qa(e))}function hi(e){return"function"!=typeof e.constructor||Ti(e)?{}:Wn(Be(e))}function gi(e){return Ua(e)||Qa(e)||!!(He&&e&&e[He])}function yi(e,t){var n=typeof e;return!!(t=t??p)&&("number"==n||"symbol"!=n&&_e.test(e))&&e>-1&&e%1==0&&e<t}function _i(e,t,n){if(!Ja(n))return!1;var r=typeof t;return!!("number"==r?Fa(n)&&yi(t,n.length):"string"==r&&t in n)&&Wa(n[t],e)}function mi(e,t){if(Ua(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!uu(e))||J.test(e)||!X.test(e)||null!=t&&e in we(t)}function vi(e){var t=oi(e),n=$n[t];if("function"!=typeof n||!(t in Qn.prototype))return!1;if(e===n)return!0;var r=ri(n);return!!r&&e===r[0]}(bn&&fi(new bn(new ArrayBuffer(1)))!=M||On&&fi(new On)!=b||wn&&fi(wn.resolve())!=C||Cn&&fi(new Cn)!=E||An&&fi(new An)!=R)&&(fi=function(e){var t=Or(e),n=t==w?e.constructor:o,r=n?Gi(n):"";if(r)switch(r){case Rn:return M;case xn:return b;case Mn:return C;case Ln:return E;case Nn:return R}return t});var ki=xe?za:gs;function Ti(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Re)}function bi(e){return e==e&&!Ja(e)}function Oi(e,t){return function(n){return null!=n&&n[e]===t&&(t!==o||e in we(n))}}function wi(e,t,n){return t=yn(t===o?e.length-1:t,0),function(){for(var o=arguments,i=-1,a=yn(o.length-t,0),u=r(a);++i<a;)u[i]=o[t+i];i=-1;for(var s=r(t+1);++i<t;)s[i]=o[i];return s[t]=n(u),Ot(e,this,s)}}function Ci(e,t){return t.length<2?e:Tr(e,eo(t,0,-1))}function Ai(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ei=xi(Zr),Ii=lt||function(e,t){return pt.setTimeout(e,t)},Si=xi(Xr);function Ri(e,t,n){var r=t+"";return Si(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ie,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ct(h,function(n){var r="_."+n[0];t&n[1]&&!St(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(ue):[]}(r),n)))}function xi(e){var t=0,n=0;return function(){var r=mn(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(o,arguments)}}function Mi(e,t){var n=-1,r=e.length,i=r-1;for(t=t===o?r:t;++n<t;){var a=Fr(n,i),u=e[a];e[a]=e[n],e[n]=u}return e.length=t,e}var Li,Ni,Di=(Li=La(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,function(e,n,r,o){t.push(r?o.replace(le,"$1"):n||e)}),t},function(e){return 500===Ni.size&&Ni.clear(),e}),Ni=Li.cache,Li);function Pi(e){if("string"==typeof e||uu(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Gi(e){if(null!=e){try{return Me.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function $i(e){if(e instanceof Qn)return e.clone();var t=new jn(e.__wrapped__,e.__chain__);return t.__actions__=Eo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Wi=Vr(function(e,t){return qa(e)?cr(e,gr(t,1,qa,!0)):[]}),Yi=Vr(function(e,t){var n=Ki(t);return qa(n)&&(n=o),qa(e)?cr(e,gr(t,1,qa,!0),ai(n,2)):[]}),ji=Vr(function(e,t){var n=Ki(t);return qa(n)&&(n=o),qa(e)?cr(e,gr(t,1,qa,!0),o,n):[]});function Qi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:du(n);return o<0&&(o=yn(r+o,0)),$t(e,ai(t,3),o)}function Ui(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return n!==o&&(i=du(n),i=n<0?yn(r+i,0):_n(i,r-1)),$t(e,ai(t,3),i,!0)}function Bi(e){return null!=e&&e.length?gr(e,1):[]}function Fi(e){return e&&e.length?e[0]:o}var qi=Vr(function(e){var t=xt(e,go);return t.length&&t[0]===e[0]?Er(t):[]}),Vi=Vr(function(e){var t=Ki(e),n=xt(e,go);return t===Ki(n)?t=o:n.pop(),n.length&&n[0]===e[0]?Er(n,ai(t,2)):[]}),Hi=Vr(function(e){var t=Ki(e),n=xt(e,go);return(t="function"==typeof t?t:o)&&n.pop(),n.length&&n[0]===e[0]?Er(n,o,t):[]});function Ki(e){var t=null==e?0:e.length;return t?e[t-1]:o}var zi=Vr(Zi);function Zi(e,t){return e&&e.length&&t&&t.length?Ur(e,t):e}var Xi=ei(function(e,t){var n=null==e?0:e.length,r=or(e,t);return Br(e,xt(t,function(e){return yi(e,n)?+e:e}).sort(wo)),r});function Ji(e){return null==e?e:Tn.call(e)}var ea=Vr(function(e){return uo(gr(e,1,qa,!0))}),ta=Vr(function(e){var t=Ki(e);return qa(t)&&(t=o),uo(gr(e,1,qa,!0),ai(t,2))}),na=Vr(function(e){var t=Ki(e);return t="function"==typeof t?t:o,uo(gr(e,1,qa,!0),o,t)});function ra(e){if(!e||!e.length)return[];var t=0;return e=It(e,function(e){if(qa(e))return t=yn(e.length,t),!0}),Vt(t,function(t){return xt(e,Ut(t))})}function oa(e,t){if(!e||!e.length)return[];var n=ra(e);return null==t?n:xt(n,function(e){return Ot(t,o,e)})}var ia=Vr(function(e,t){return qa(e)?cr(e,t):[]}),aa=Vr(function(e){return fo(It(e,qa))}),ua=Vr(function(e){var t=Ki(e);return qa(t)&&(t=o),fo(It(e,qa),ai(t,2))}),sa=Vr(function(e){var t=Ki(e);return t="function"==typeof t?t:o,fo(It(e,qa),o,t)}),ca=Vr(ra),la=Vr(function(e){var t=e.length,n=t>1?e[t-1]:o;return n="function"==typeof n?(e.pop(),n):o,oa(e,n)});function pa(e){var t=$n(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var da=ei(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return or(t,e)};return!(t>1||this.__actions__.length)&&r instanceof Qn&&yi(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:fa,args:[i],thisArg:o}),new jn(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(o),e})):this.thru(i)}),ha=So(function(e,t,n){Le.call(e,n)?++e[n]:rr(e,n,1)}),ga=Po(Qi),ya=Po(Ui);function _a(e,t){return(Ua(e)?Ct:lr)(e,ai(t,3))}function ma(e,t){return(Ua(e)?At:pr)(e,ai(t,3))}var va=So(function(e,t,n){Le.call(e,n)?e[n].push(t):rr(e,n,[t])}),ka=Vr(function(e,t,n){var o=-1,i="function"==typeof t,a=Fa(e)?r(e.length):[];return lr(e,function(e){a[++o]=i?Ot(t,e,n):Ir(e,t,n)}),a}),Ta=So(function(e,t,n){rr(e,n,t)});function ba(e,t){return(Ua(e)?xt:Pr)(e,ai(t,3))}var Oa=So(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),wa=Vr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&_i(e,t[0],t[1])?t=[]:n>2&&_i(t[0],t[1],t[2])&&(t=[t[0]]),jr(e,gr(t,1),[])}),Ca=ct||function(){return pt.Date.now()};function Aa(e,t,n){return t=n?o:t,t=e&&null==t?e.length:t,Ko(e,c,o,o,o,o,t)}function Ea(e,t){var n;if("function"!=typeof t)throw new Ee(i);return e=du(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=o),n}}var Ia=Vr(function(e,t,n){var r=1;if(n.length){var o=un(n,ii(Ia));r|=s}return Ko(e,r,t,n,o)}),Sa=Vr(function(e,t,n){var r=3;if(n.length){var o=un(n,ii(Sa));r|=s}return Ko(t,r,e,n,o)});function Ra(e,t,n){var r,a,u,s,c,l,p=0,f=!1,d=!1,h=!0;if("function"!=typeof e)throw new Ee(i);function g(t){var n=r,i=a;return r=a=o,p=t,s=e.apply(i,n)}function y(e){var n=e-l;return l===o||n>=t||n<0||d&&e-p>=u}function _(){var e=Ca();if(y(e))return m(e);c=Ii(_,function(e){var n=t-(e-l);return d?_n(n,u-(e-p)):n}(e))}function m(e){return c=o,h&&r?g(e):(r=a=o,s)}function v(){var e=Ca(),n=y(e);if(r=arguments,a=this,l=e,n){if(c===o)return function(e){return p=e,c=Ii(_,t),f?g(e):s}(l);if(d)return ko(c),c=Ii(_,t),g(l)}return c===o&&(c=Ii(_,t)),s}return t=gu(t)||0,Ja(n)&&(f=!!n.leading,u=(d="maxWait"in n)?yn(gu(n.maxWait)||0,t):u,h="trailing"in n?!!n.trailing:h),v.cancel=function(){c!==o&&ko(c),p=0,r=l=a=c=o},v.flush=function(){return c===o?s:m(Ca())},v}var xa=Vr(function(e,t){return sr(e,1,t)}),Ma=Vr(function(e,t,n){return sr(e,gu(t)||0,n)});function La(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ee(i);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(La.Cache||Fn),n}function Na(e){if("function"!=typeof e)throw new Ee(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}La.Cache=Fn;var Da=mo(function(e,t){var n=(t=1==t.length&&Ua(t[0])?xt(t[0],Kt(ai())):xt(gr(t,1),Kt(ai()))).length;return Vr(function(r){for(var o=-1,i=_n(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return Ot(e,this,r)})}),Pa=Vr(function(e,t){var n=un(t,ii(Pa));return Ko(e,s,o,t,n)}),Ga=Vr(function(e,t){var n=un(t,ii(Ga));return Ko(e,64,o,t,n)}),$a=ei(function(e,t){return Ko(e,256,o,o,o,t)});function Wa(e,t){return e===t||e!=e&&t!=t}var Ya=Bo(wr),ja=Bo(function(e,t){return e>=t}),Qa=Sr(function(){return arguments}())?Sr:function(e){return eu(e)&&Le.call(e,"callee")&&!qe.call(e,"callee")},Ua=r.isArray,Ba=_t?Kt(_t):function(e){return eu(e)&&Or(e)==x};function Fa(e){return null!=e&&Xa(e.length)&&!za(e)}function qa(e){return eu(e)&&Fa(e)}var Va=yt||gs,Ha=mt?Kt(mt):function(e){return eu(e)&&Or(e)==m};function Ka(e){if(!eu(e))return!1;var t=Or(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ru(e)}function za(e){if(!Ja(e))return!1;var t=Or(e);return t==k||t==T||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==du(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function Ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eu(e){return null!=e&&"object"==typeof e}var tu=vt?Kt(vt):function(e){return eu(e)&&fi(e)==b};function nu(e){return"number"==typeof e||eu(e)&&Or(e)==O}function ru(e){if(!eu(e)||Or(e)!=w)return!1;var t=Be(e);if(null===t)return!0;var n=Le.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Me.call(n)==Ge}var ou=kt?Kt(kt):function(e){return eu(e)&&Or(e)==A},iu=Tt?Kt(Tt):function(e){return eu(e)&&fi(e)==E};function au(e){return"string"==typeof e||!Ua(e)&&eu(e)&&Or(e)==I}function uu(e){return"symbol"==typeof e||eu(e)&&Or(e)==S}var su=bt?Kt(bt):function(e){return eu(e)&&Xa(e.length)&&!!ot[Or(e)]},cu=Bo(Dr),lu=Bo(function(e,t){return e<=t});function pu(e){if(!e)return[];if(Fa(e))return au(e)?pn(e):Eo(e);if(Ke&&e[Ke])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ke]());var t=fi(e);return(t==b?on:t==E?sn:Wu)(e)}function fu(e){return e?(e=gu(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function du(e){var t=fu(e),n=t%1;return t==t?n?t-n:t:0}function hu(e){return e?ir(du(e),0,d):0}function gu(e){if("number"==typeof e)return e;if(uu(e))return f;if(Ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var n=he.test(e);return n||ye.test(e)?st(e.slice(2),n?2:8):de.test(e)?f:+e}function yu(e){return Io(e,xu(e))}function _u(e){return null==e?"":ao(e)}var mu=Ro(function(e,t){if(Ti(t)||Fa(t))Io(t,Ru(t),e);else for(var n in t)Le.call(t,n)&&Jn(e,n,t[n])}),vu=Ro(function(e,t){Io(t,xu(t),e)}),ku=Ro(function(e,t,n,r){Io(t,xu(t),e,r)}),Tu=Ro(function(e,t,n,r){Io(t,Ru(t),e,r)}),bu=ei(or),Ou=Vr(function(e,t){e=we(e);var n=-1,r=t.length,i=r>2?t[2]:o;for(i&&_i(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],u=xu(a),s=-1,c=u.length;++s<c;){var l=u[s],p=e[l];(p===o||Wa(p,Re[l])&&!Le.call(e,l))&&(e[l]=a[l])}return e}),wu=Vr(function(e){return e.push(o,Zo),Ot(Lu,o,e)});function Cu(e,t,n){var r=null==e?o:Tr(e,t);return r===o?n:r}function Au(e,t){return null!=e&&di(e,t,Ar)}var Eu=Wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),e[t]=n},Ju(ns)),Iu=Wo(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Pe.call(t)),Le.call(e,t)?e[t].push(n):e[t]=[n]},ai),Su=Vr(Ir);function Ru(e){return Fa(e)?Hn(e):Nr(e)}function xu(e){return Fa(e)?Hn(e,!0):function(e){if(!Ja(e))return function(e){var t=[];if(null!=e)for(var n in we(e))t.push(n);return t}(e);var t=Ti(e),n=[];for(var r in e)("constructor"!=r||!t&&Le.call(e,r))&&n.push(r);return n}(e)}var Mu=Ro(function(e,t,n){Wr(e,t,n)}),Lu=Ro(function(e,t,n,r){Wr(e,t,n,r)}),Nu=ei(function(e,t){var n={};if(null==e)return n;var r=!1;t=xt(t,function(t){return t=_o(t,e),r||(r=t.length>1),t}),Io(e,ni(e),n),r&&(n=ar(n,7,Xo));for(var o=t.length;o--;)so(n,t[o]);return n}),Du=ei(function(e,t){return null==e?{}:function(e,t){return Qr(e,t,function(t,n){return Au(e,n)})}(e,t)});function Pu(e,t){if(null==e)return{};var n=xt(ni(e),function(e){return[e]});return t=ai(t),Qr(e,n,function(e,n){return t(e,n[0])})}var Gu=Ho(Ru),$u=Ho(xu);function Wu(e){return null==e?[]:zt(e,Ru(e))}var Yu=No(function(e,t,n){return t=t.toLowerCase(),e+(n?ju(t):t)});function ju(e){return Ku(_u(e).toLowerCase())}function Qu(e){return(e=_u(e))&&e.replace(me,en).replace(Ze,"")}var Uu=No(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Bu=No(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Fu=Lo("toLowerCase"),qu=No(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Vu=No(function(e,t,n){return e+(n?" ":"")+Ku(t)}),Hu=No(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ku=Lo("toUpperCase");function zu(e,t,n){return e=_u(e),(t=n?o:t)===o?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(se)||[]}(e):e.match(t)||[]}var Zu=Vr(function(e,t){try{return Ot(e,o,t)}catch(e){return Ka(e)?e:new Te(e)}}),Xu=ei(function(e,t){return Ct(t,function(t){t=Pi(t),rr(e,t,Ia(e[t],e))}),e});function Ju(e){return function(){return e}}var es=Go(),ts=Go(!0);function ns(e){return e}function rs(e){return Lr("function"==typeof e?e:ar(e,1))}var os=Vr(function(e,t){return function(n){return Ir(n,e,t)}}),is=Vr(function(e,t){return function(n){return Ir(e,n,t)}});function as(e,t,n){var r=Ru(t),o=kr(t,r);null!=n||Ja(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=kr(t,Ru(t)));var i=!(Ja(n)&&"chain"in n&&!n.chain),a=za(e);return Ct(o,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__);return(n.__actions__=Eo(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Mt([this.value()],arguments))})}),e}function us(){}var ss=jo(xt),cs=jo(Et),ls=jo(Dt);function ps(e){return mi(e)?Ut(Pi(e)):function(e){return function(t){return Tr(t,e)}}(e)}var fs=Uo(),ds=Uo(!0);function hs(){return[]}function gs(){return!1}var ys,_s=Yo(function(e,t){return e+t},0),ms=qo("ceil"),vs=Yo(function(e,t){return e/t},1),ks=qo("floor"),Ts=Yo(function(e,t){return e*t},1),bs=qo("round"),Os=Yo(function(e,t){return e-t},0);return $n.after=function(e,t){if("function"!=typeof t)throw new Ee(i);return e=du(e),function(){if(--e<1)return t.apply(this,arguments)}},$n.ary=Aa,$n.assign=mu,$n.assignIn=vu,$n.assignInWith=ku,$n.assignWith=Tu,$n.at=bu,$n.before=Ea,$n.bind=Ia,$n.bindAll=Xu,$n.bindKey=Sa,$n.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},$n.chain=pa,$n.chunk=function(e,t,n){t=(n?_i(e,t,n):t===o)?1:yn(du(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,u=0,s=r(ft(i/t));a<i;)s[u++]=eo(e,a,a+=t);return s},$n.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},$n.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Mt(Ua(n)?Eo(n):[n],gr(t,1))},$n.cond=function(e){var t=null==e?0:e.length,n=ai();return e=t?xt(e,function(e){if("function"!=typeof e[1])throw new Ee(i);return[n(e[0]),e[1]]}):[],Vr(function(n){for(var r=-1;++r<t;){var o=e[r];if(Ot(o[0],this,n))return Ot(o[1],this,n)}})},$n.conforms=function(e){return function(e){var t=Ru(e);return function(n){return ur(n,e,t)}}(ar(e,1))},$n.constant=Ju,$n.countBy=ha,$n.create=function(e,t){var n=Wn(e);return null==t?n:nr(n,t)},$n.curry=function e(t,n,r){var i=Ko(t,8,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},$n.curryRight=function e(t,n,r){var i=Ko(t,16,o,o,o,o,o,n=r?o:n);return i.placeholder=e.placeholder,i},$n.debounce=Ra,$n.defaults=Ou,$n.defaultsDeep=wu,$n.defer=xa,$n.delay=Ma,$n.difference=Wi,$n.differenceBy=Yi,$n.differenceWith=ji,$n.drop=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=n||t===o?1:du(t))<0?0:t,r):[]},$n.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,0,(t=r-(t=n||t===o?1:du(t)))<0?0:t):[]},$n.dropRightWhile=function(e,t){return e&&e.length?lo(e,ai(t,3),!0,!0):[]},$n.dropWhile=function(e,t){return e&&e.length?lo(e,ai(t,3),!0):[]},$n.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&_i(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=du(n))<0&&(n=-n>i?0:i+n),(r=r===o||r>i?i:du(r))<0&&(r+=i),r=n>r?0:hu(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},$n.filter=function(e,t){return(Ua(e)?It:hr)(e,ai(t,3))},$n.flatMap=function(e,t){return gr(ba(e,t),1)},$n.flatMapDeep=function(e,t){return gr(ba(e,t),l)},$n.flatMapDepth=function(e,t,n){return n=n===o?1:du(n),gr(ba(e,t),n)},$n.flatten=Bi,$n.flattenDeep=function(e){return null!=e&&e.length?gr(e,l):[]},$n.flattenDepth=function(e,t){return null!=e&&e.length?gr(e,t=t===o?1:du(t)):[]},$n.flip=function(e){return Ko(e,512)},$n.flow=es,$n.flowRight=ts,$n.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];rr(r,o[0],o[1])}return r},$n.functions=function(e){return null==e?[]:kr(e,Ru(e))},$n.functionsIn=function(e){return null==e?[]:kr(e,xu(e))},$n.groupBy=va,$n.initial=function(e){return null!=e&&e.length?eo(e,0,-1):[]},$n.intersection=qi,$n.intersectionBy=Vi,$n.intersectionWith=Hi,$n.invert=Eu,$n.invertBy=Iu,$n.invokeMap=ka,$n.iteratee=rs,$n.keyBy=Ta,$n.keys=Ru,$n.keysIn=xu,$n.map=ba,$n.mapKeys=function(e,t){var n={};return t=ai(t,3),mr(e,function(e,r,o){rr(n,t(e,r,o),e)}),n},$n.mapValues=function(e,t){var n={};return t=ai(t,3),mr(e,function(e,r,o){rr(n,r,t(e,r,o))}),n},$n.matches=function(e){return Gr(ar(e,1))},$n.matchesProperty=function(e,t){return $r(e,ar(t,1))},$n.memoize=La,$n.merge=Mu,$n.mergeWith=Lu,$n.method=os,$n.methodOf=is,$n.mixin=as,$n.negate=Na,$n.nthArg=function(e){return e=du(e),Vr(function(t){return Yr(t,e)})},$n.omit=Nu,$n.omitBy=function(e,t){return Pu(e,Na(ai(t)))},$n.once=function(e){return Ea(2,e)},$n.orderBy=function(e,t,n,r){return null==e?[]:(Ua(t)||(t=null==t?[]:[t]),Ua(n=r?o:n)||(n=null==n?[]:[n]),jr(e,t,n))},$n.over=ss,$n.overArgs=Da,$n.overEvery=cs,$n.overSome=ls,$n.partial=Pa,$n.partialRight=Ga,$n.partition=Oa,$n.pick=Du,$n.pickBy=Pu,$n.property=ps,$n.propertyOf=function(e){return function(t){return null==e?o:Tr(e,t)}},$n.pull=zi,$n.pullAll=Zi,$n.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ur(e,t,ai(n,2)):e},$n.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?Ur(e,t,o,n):e},$n.pullAt=Xi,$n.range=fs,$n.rangeRight=ds,$n.rearg=$a,$n.reject=function(e,t){return(Ua(e)?It:hr)(e,Na(ai(t,3)))},$n.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=ai(t,3);++r<i;){var a=e[r];t(a,r,e)&&(n.push(a),o.push(r))}return Br(e,o),n},$n.rest=function(e,t){if("function"!=typeof e)throw new Ee(i);return Vr(e,t=t===o?t:du(t))},$n.reverse=Ji,$n.sampleSize=function(e,t,n){return t=(n?_i(e,t,n):t===o)?1:du(t),(Ua(e)?zn:Kr)(e,t)},$n.set=function(e,t,n){return null==e?e:zr(e,t,n)},$n.setWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:zr(e,t,n,r)},$n.shuffle=function(e){return(Ua(e)?Zn:Jr)(e)},$n.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&_i(e,t,n)?(t=0,n=r):(t=null==t?0:du(t),n=n===o?r:du(n)),eo(e,t,n)):[]},$n.sortBy=wa,$n.sortedUniq=function(e){return e&&e.length?oo(e):[]},$n.sortedUniqBy=function(e,t){return e&&e.length?oo(e,ai(t,2)):[]},$n.split=function(e,t,n){return n&&"number"!=typeof n&&_i(e,t,n)&&(t=n=o),(n=n===o?d:n>>>0)?(e=_u(e))&&("string"==typeof t||null!=t&&!ou(t))&&!(t=ao(t))&&rn(e)?vo(pn(e),0,n):e.split(t,n):[]},$n.spread=function(e,t){if("function"!=typeof e)throw new Ee(i);return t=null==t?0:yn(du(t),0),Vr(function(n){var r=n[t],o=vo(n,0,t);return r&&Mt(o,r),Ot(e,this,o)})},$n.tail=function(e){var t=null==e?0:e.length;return t?eo(e,1,t):[]},$n.take=function(e,t,n){return e&&e.length?eo(e,0,(t=n||t===o?1:du(t))<0?0:t):[]},$n.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?eo(e,(t=r-(t=n||t===o?1:du(t)))<0?0:t,r):[]},$n.takeRightWhile=function(e,t){return e&&e.length?lo(e,ai(t,3),!1,!0):[]},$n.takeWhile=function(e,t){return e&&e.length?lo(e,ai(t,3)):[]},$n.tap=function(e,t){return t(e),e},$n.throttle=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new Ee(i);return Ja(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ra(e,t,{leading:r,maxWait:t,trailing:o})},$n.thru=fa,$n.toArray=pu,$n.toPairs=Gu,$n.toPairsIn=$u,$n.toPath=function(e){return Ua(e)?xt(e,Pi):uu(e)?[e]:Eo(Di(_u(e)))},$n.toPlainObject=yu,$n.transform=function(e,t,n){var r=Ua(e),o=r||Va(e)||su(e);if(t=ai(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Ja(e)&&za(i)?Wn(Be(e)):{}}return(o?Ct:mr)(e,function(e,r,o){return t(n,e,r,o)}),n},$n.unary=function(e){return Aa(e,1)},$n.union=ea,$n.unionBy=ta,$n.unionWith=na,$n.uniq=function(e){return e&&e.length?uo(e):[]},$n.uniqBy=function(e,t){return e&&e.length?uo(e,ai(t,2)):[]},$n.uniqWith=function(e,t){return t="function"==typeof t?t:o,e&&e.length?uo(e,o,t):[]},$n.unset=function(e,t){return null==e||so(e,t)},$n.unzip=ra,$n.unzipWith=oa,$n.update=function(e,t,n){return null==e?e:co(e,t,yo(n))},$n.updateWith=function(e,t,n,r){return r="function"==typeof r?r:o,null==e?e:co(e,t,yo(n),r)},$n.values=Wu,$n.valuesIn=function(e){return null==e?[]:zt(e,xu(e))},$n.without=ia,$n.words=zu,$n.wrap=function(e,t){return Pa(yo(t),e)},$n.xor=aa,$n.xorBy=ua,$n.xorWith=sa,$n.zip=ca,$n.zipObject=function(e,t){return ho(e||[],t||[],Jn)},$n.zipObjectDeep=function(e,t){return ho(e||[],t||[],zr)},$n.zipWith=la,$n.entries=Gu,$n.entriesIn=$u,$n.extend=vu,$n.extendWith=ku,as($n,$n),$n.add=_s,$n.attempt=Zu,$n.camelCase=Yu,$n.capitalize=ju,$n.ceil=ms,$n.clamp=function(e,t,n){return n===o&&(n=t,t=o),n!==o&&(n=(n=gu(n))==n?n:0),t!==o&&(t=(t=gu(t))==t?t:0),ir(gu(e),t,n)},$n.clone=function(e){return ar(e,4)},$n.cloneDeep=function(e){return ar(e,5)},$n.cloneDeepWith=function(e,t){return ar(e,5,t="function"==typeof t?t:o)},$n.cloneWith=function(e,t){return ar(e,4,t="function"==typeof t?t:o)},$n.conformsTo=function(e,t){return null==t||ur(e,t,Ru(t))},$n.deburr=Qu,$n.defaultTo=function(e,t){return null==e||e!=e?t:e},$n.divide=vs,$n.endsWith=function(e,t,n){e=_u(e),t=ao(t);var r=e.length,i=n=n===o?r:ir(du(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},$n.eq=Wa,$n.escape=function(e){return(e=_u(e))&&H.test(e)?e.replace(q,tn):e},$n.escapeRegExp=function(e){return(e=_u(e))&&ne.test(e)?e.replace(te,"\\$&"):e},$n.every=function(e,t,n){var r=Ua(e)?Et:fr;return n&&_i(e,t,n)&&(t=o),r(e,ai(t,3))},$n.find=ga,$n.findIndex=Qi,$n.findKey=function(e,t){return Gt(e,ai(t,3),mr)},$n.findLast=ya,$n.findLastIndex=Ui,$n.findLastKey=function(e,t){return Gt(e,ai(t,3),vr)},$n.floor=ks,$n.forEach=_a,$n.forEachRight=ma,$n.forIn=function(e,t){return null==e?e:yr(e,ai(t,3),xu)},$n.forInRight=function(e,t){return null==e?e:_r(e,ai(t,3),xu)},$n.forOwn=function(e,t){return e&&mr(e,ai(t,3))},$n.forOwnRight=function(e,t){return e&&vr(e,ai(t,3))},$n.get=Cu,$n.gt=Ya,$n.gte=ja,$n.has=function(e,t){return null!=e&&di(e,t,Cr)},$n.hasIn=Au,$n.head=Fi,$n.identity=ns,$n.includes=function(e,t,n,r){e=Fa(e)?e:Wu(e),n=n&&!r?du(n):0;var o=e.length;return n<0&&(n=yn(o+n,0)),au(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Wt(e,t,n)>-1},$n.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:du(n);return o<0&&(o=yn(r+o,0)),Wt(e,t,o)},$n.inRange=function(e,t,n){return t=fu(t),n===o?(n=t,t=0):n=fu(n),function(e,t,n){return e>=_n(t,n)&&e<yn(t,n)}(e=gu(e),t,n)},$n.invoke=Su,$n.isArguments=Qa,$n.isArray=Ua,$n.isArrayBuffer=Ba,$n.isArrayLike=Fa,$n.isArrayLikeObject=qa,$n.isBoolean=function(e){return!0===e||!1===e||eu(e)&&Or(e)==_},$n.isBuffer=Va,$n.isDate=Ha,$n.isElement=function(e){return eu(e)&&1===e.nodeType&&!ru(e)},$n.isEmpty=function(e){if(null==e)return!0;if(Fa(e)&&(Ua(e)||"string"==typeof e||"function"==typeof e.splice||Va(e)||su(e)||Qa(e)))return!e.length;var t=fi(e);if(t==b||t==E)return!e.size;if(Ti(e))return!Nr(e).length;for(var n in e)if(Le.call(e,n))return!1;return!0},$n.isEqual=function(e,t){return Rr(e,t)},$n.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:o)?n(e,t):o;return r===o?Rr(e,t,o,n):!!r},$n.isError=Ka,$n.isFinite=function(e){return"number"==typeof e&&Pt(e)},$n.isFunction=za,$n.isInteger=Za,$n.isLength=Xa,$n.isMap=tu,$n.isMatch=function(e,t){return e===t||xr(e,t,si(t))},$n.isMatchWith=function(e,t,n){return n="function"==typeof n?n:o,xr(e,t,si(t),n)},$n.isNaN=function(e){return nu(e)&&e!=+e},$n.isNative=function(e){if(ki(e))throw new Te("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Mr(e)},$n.isNil=function(e){return null==e},$n.isNull=function(e){return null===e},$n.isNumber=nu,$n.isObject=Ja,$n.isObjectLike=eu,$n.isPlainObject=ru,$n.isRegExp=ou,$n.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=p},$n.isSet=iu,$n.isString=au,$n.isSymbol=uu,$n.isTypedArray=su,$n.isUndefined=function(e){return e===o},$n.isWeakMap=function(e){return eu(e)&&fi(e)==R},$n.isWeakSet=function(e){return eu(e)&&"[object WeakSet]"==Or(e)},$n.join=function(e,t){return null==e?"":Bt.call(e,t)},$n.kebabCase=Uu,$n.last=Ki,$n.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=du(n))<0?yn(r+i,0):_n(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):$t(e,jt,i,!0)},$n.lowerCase=Bu,$n.lowerFirst=Fu,$n.lt=cu,$n.lte=lu,$n.max=function(e){return e&&e.length?dr(e,ns,wr):o},$n.maxBy=function(e,t){return e&&e.length?dr(e,ai(t,2),wr):o},$n.mean=function(e){return Qt(e,ns)},$n.meanBy=function(e,t){return Qt(e,ai(t,2))},$n.min=function(e){return e&&e.length?dr(e,ns,Dr):o},$n.minBy=function(e,t){return e&&e.length?dr(e,ai(t,2),Dr):o},$n.stubArray=hs,$n.stubFalse=gs,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=Ts,$n.nth=function(e,t){return e&&e.length?Yr(e,du(t)):o},$n.noConflict=function(){return pt._===this&&(pt._=$e),this},$n.noop=us,$n.now=Ca,$n.pad=function(e,t,n){e=_u(e);var r=(t=du(t))?ln(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Qo(dt(o),n)+e+Qo(ft(o),n)},$n.padEnd=function(e,t,n){e=_u(e);var r=(t=du(t))?ln(e):0;return t&&r<t?e+Qo(t-r,n):e},$n.padStart=function(e,t,n){e=_u(e);var r=(t=du(t))?ln(e):0;return t&&r<t?Qo(t-r,n)+e:e},$n.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),vn(_u(e).replace(re,""),t||0)},$n.random=function(e,t,n){if(n&&"boolean"!=typeof n&&_i(e,t,n)&&(t=n=o),n===o&&("boolean"==typeof t?(n=t,t=o):"boolean"==typeof e&&(n=e,e=o)),e===o&&t===o?(e=0,t=1):(e=fu(e),t===o?(t=e,e=0):t=fu(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=kn();return _n(e+i*(t-e+ut("1e-"+((i+"").length-1))),t)}return Fr(e,t)},$n.reduce=function(e,t,n){var r=Ua(e)?Lt:Ft,o=arguments.length<3;return r(e,ai(t,4),n,o,lr)},$n.reduceRight=function(e,t,n){var r=Ua(e)?Nt:Ft,o=arguments.length<3;return r(e,ai(t,4),n,o,pr)},$n.repeat=function(e,t,n){return t=(n?_i(e,t,n):t===o)?1:du(t),qr(_u(e),t)},$n.replace=function(){var e=arguments,t=_u(e[0]);return e.length<3?t:t.replace(e[1],e[2])},$n.result=function(e,t,n){var r=-1,i=(t=_o(t,e)).length;for(i||(i=1,e=o);++r<i;){var a=null==e?o:e[Pi(t[r])];a===o&&(r=i,a=n),e=za(a)?a.call(e):a}return e},$n.round=bs,$n.runInContext=e,$n.sample=function(e){return(Ua(e)?Kn:Hr)(e)},$n.size=function(e){if(null==e)return 0;if(Fa(e))return au(e)?ln(e):e.length;var t=fi(e);return t==b||t==E?e.size:Nr(e).length},$n.snakeCase=qu,$n.some=function(e,t,n){var r=Ua(e)?Dt:to;return n&&_i(e,t,n)&&(t=o),r(e,ai(t,3))},$n.sortedIndex=function(e,t){return no(e,t)},$n.sortedIndexBy=function(e,t,n){return ro(e,t,ai(n,2))},$n.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=no(e,t);if(r<n&&Wa(e[r],t))return r}return-1},$n.sortedLastIndex=function(e,t){return no(e,t,!0)},$n.sortedLastIndexBy=function(e,t,n){return ro(e,t,ai(n,2),!0)},$n.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=no(e,t,!0)-1;if(Wa(e[n],t))return n}return-1},$n.startCase=Vu,$n.startsWith=function(e,t,n){return e=_u(e),n=null==n?0:ir(du(n),0,e.length),t=ao(t),e.slice(n,n+t.length)==t},$n.subtract=Os,$n.sum=function(e){return e&&e.length?qt(e,ns):0},$n.sumBy=function(e,t){return e&&e.length?qt(e,ai(t,2)):0},$n.template=function(e,t,n){var r=$n.templateSettings;n&&_i(e,t,n)&&(t=o),e=_u(e),t=Tu({},t,r,zo);var i=Tu({},t.imports,r.imports,zo),a=Ru(i),u=zt(i,a);Ct(a,function(e){if(ce.test(e))throw new Te("Invalid `imports` option passed into `_.template`")});var s,c,l=0,p=t.interpolate||ve,f="__p += '",d=Ce((t.escape||ve).source+"|"+p.source+"|"+(p===Z?pe:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),h="//# sourceURL="+(Le.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";e.replace(d,function(t,n,r,o,i,a){return r||(r=o),f+=e.slice(l,a).replace(ke,nn),n&&(s=!0,f+="' +\n__e("+n+") +\n'"),i&&(c=!0,f+="';\n"+i+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+t.length,t}),f+="';\n";var g=Le.call(t,"variable")&&t.variable;if(g){if(ce.test(g))throw new Te("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(c?f.replace(Q,""):f).replace(U,"$1").replace(B,"$1;"),f="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(c?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var y=Zu(function(){return be(a,h+"return "+f).apply(o,u)});if(y.source=f,Ka(y))throw y;return y},$n.times=function(e,t){if((e=du(e))<1||e>p)return[];var n=d,r=_n(e,d);t=ai(t),e-=d;for(var o=Vt(r,t);++n<e;)t(n);return o},$n.toFinite=fu,$n.toInteger=du,$n.toLength=hu,$n.toLower=function(e){return _u(e).toLowerCase()},$n.toNumber=gu,$n.toSafeInteger=function(e){return e?ir(du(e),-9007199254740991,p):0===e?e:0},$n.toString=_u,$n.toUpper=function(e){return _u(e).toUpperCase()},$n.trim=function(e,t,n){if((e=_u(e))&&(n||t===o))return Ht(e);if(!e||!(t=ao(t)))return e;var r=pn(e),i=pn(t);return vo(r,Xt(r,i),Jt(r,i)+1).join("")},$n.trimEnd=function(e,t,n){if((e=_u(e))&&(n||t===o))return e.slice(0,fn(e)+1);if(!e||!(t=ao(t)))return e;var r=pn(e);return vo(r,0,Jt(r,pn(t))+1).join("")},$n.trimStart=function(e,t,n){if((e=_u(e))&&(n||t===o))return e.replace(re,"");if(!e||!(t=ao(t)))return e;var r=pn(e);return vo(r,Xt(r,pn(t))).join("")},$n.truncate=function(e,t){var n=30,r="...";if(Ja(t)){var i="separator"in t?t.separator:i;n="length"in t?du(t.length):n,r="omission"in t?ao(t.omission):r}var a=(e=_u(e)).length;if(rn(e)){var u=pn(e);a=u.length}if(n>=a)return e;var s=n-ln(r);if(s<1)return r;var c=u?vo(u,0,s).join(""):e.slice(0,s);if(i===o)return c+r;if(u&&(s+=c.length-s),ou(i)){if(e.slice(s).search(i)){var l,p=c;for(i.global||(i=Ce(i.source,_u(fe.exec(i))+"g")),i.lastIndex=0;l=i.exec(p);)var f=l.index;c=c.slice(0,f===o?s:f)}}else if(e.indexOf(ao(i),s)!=s){var d=c.lastIndexOf(i);d>-1&&(c=c.slice(0,d))}return c+r},$n.unescape=function(e){return(e=_u(e))&&V.test(e)?e.replace(F,dn):e},$n.uniqueId=function(e){var t=++Ne;return _u(e)+t},$n.upperCase=Hu,$n.upperFirst=Ku,$n.each=_a,$n.eachRight=ma,$n.first=Fi,as($n,(ys={},mr($n,function(e,t){Le.call($n.prototype,t)||(ys[t]=e)}),ys),{chain:!1}),$n.VERSION="4.18.1",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){$n[e].placeholder=$n}),Ct(["drop","take"],function(e,t){Qn.prototype[e]=function(n){n=n===o?1:yn(du(n),0);var r=this.__filtered__&&!t?new Qn(this):this.clone();return r.__filtered__?r.__takeCount__=_n(n,r.__takeCount__):r.__views__.push({size:_n(n,d),type:e+(r.__dir__<0?"Right":"")}),r},Qn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ct(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Qn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ai(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),Ct(["head","last"],function(e,t){var n="take"+(t?"Right":"");Qn.prototype[e]=function(){return this[n](1).value()[0]}}),Ct(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Qn.prototype[e]=function(){return this.__filtered__?new Qn(this):this[n](1)}}),Qn.prototype.compact=function(){return this.filter(ns)},Qn.prototype.find=function(e){return this.filter(e).head()},Qn.prototype.findLast=function(e){return this.reverse().find(e)},Qn.prototype.invokeMap=Vr(function(e,t){return"function"==typeof e?new Qn(this):this.map(function(n){return Ir(n,e,t)})}),Qn.prototype.reject=function(e){return this.filter(Na(ai(e)))},Qn.prototype.slice=function(e,t){e=du(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Qn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(n=(t=du(t))<0?n.dropRight(-t):n.take(t-e)),n)},Qn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Qn.prototype.toArray=function(){return this.take(d)},mr(Qn.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=$n[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&($n.prototype[t]=function(){var t=this.__wrapped__,u=r?[1]:arguments,s=t instanceof Qn,c=u[0],l=s||Ua(t),p=function(e){var t=i.apply($n,Mt([e],u));return r&&f?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var f=this.__chain__,d=!!this.__actions__.length,h=a&&!f,g=s&&!d;if(!a&&l){t=g?t:new Qn(this);var y=e.apply(t,u);return y.__actions__.push({func:fa,args:[p],thisArg:o}),new jn(y,f)}return h&&g?e.apply(this,u):(y=this.thru(p),h?r?y.value()[0]:y.value():y)})}),Ct(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ie[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);$n.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Ua(o)?o:[],e)}return this[n](function(n){return t.apply(Ua(n)?n:[],e)})}}),mr(Qn.prototype,function(e,t){var n=$n[t];if(n){var r=n.name+"";Le.call(Sn,r)||(Sn[r]=[]),Sn[r].push({name:t,func:n})}}),Sn[$o(o,2).name]=[{name:"wrapper",func:o}],Qn.prototype.clone=function(){var e=new Qn(this.__wrapped__);return e.__actions__=Eo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Eo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Eo(this.__views__),e},Qn.prototype.reverse=function(){if(this.__filtered__){var e=new Qn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Qn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ua(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=_n(t,e+a);break;case"takeRight":e=yn(e,t-a)}}return{start:e,end:t}}(0,o,this.__views__),a=i.start,u=i.end,s=u-a,c=r?u:a-1,l=this.__iteratees__,p=l.length,f=0,d=_n(s,this.__takeCount__);if(!n||!r&&o==s&&d==s)return po(e,this.__actions__);var h=[];e:for(;s--&&f<d;){for(var g=-1,y=e[c+=t];++g<p;){var _=l[g],m=_.iteratee,v=_.type,k=m(y);if(2==v)y=k;else if(!k){if(1==v)continue e;break e}}h[f++]=y}return h},$n.prototype.at=da,$n.prototype.chain=function(){return pa(this)},$n.prototype.commit=function(){return new jn(this.value(),this.__chain__)},$n.prototype.next=function(){this.__values__===o&&(this.__values__=pu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?o:this.__values__[this.__index__++]}},$n.prototype.plant=function(e){for(var t,n=this;n instanceof Yn;){var r=$i(n);r.__index__=0,r.__values__=o,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},$n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Qn){var t=e;return this.__actions__.length&&(t=new Qn(this)),(t=t.reverse()).__actions__.push({func:fa,args:[Ji],thisArg:o}),new jn(t,this.__chain__)}return this.thru(Ji)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return po(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Ke&&($n.prototype[Ke]=function(){return this}),$n}();pt._=hn,(r=function(){return hn}.call(t,n,t,e))===o||(e.exports=r)}.call(this)}},A={};function E(e){var t=A[e];if(void 0!==t)return t.exports;var n=A[e]={id:e,loaded:!1,exports:{}};return C[e].call(n.exports,n,n.exports,E),n.loaded=!0,n.exports}E.d=(e,t)=>{for(var n in t)E.o(t,n)&&!E.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},E.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),E.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let I=e=>new Error(e);function S(e,t,...n){e||function(e,...t){const n=x(e);if("object"==typeof n)throw n;throw I(n||"Assertion error",...t)}(t,...n)}function R(e,t,...n){return S(e,t,...n),e}function x(e){return void 0===e?"":"string"==typeof e?e:e()}const M=(e,t=void 0)=>{S(function(e){return"string"==typeof e}(e),()=>function(e,t,n){const r=x(e);if("object"==typeof r)throw r;return`${r?`${r}: `:""}${t} ${function(e){return void 0===e?"<undefined>":"symbol"==typeof e?e.toString():null===e?"<null>":`<${typeof e}:${e}>`}(n)}`}(t,"Not a string",e))};function L(e,t){return e instanceof Error?e.message:null!=t?t:`${e}`}const N=/^[A-Za-z0-9_-]{1,64}$/;function D(e,t){S(function(e){return N.test(e)}(e),`Invalid @aiFunction id "${e}"${t?` on ${t}`:""}: it must be 1–64 characters of letters, digits, "_" and "-" — the tool-name charset LLM providers accept.`)}function P(e){const t=e.split(":");return S(2===t.length,`Invalid service function name: ${e}`),t[1]}Object.keys({cpuMillis:{min:100,max:2e3},memoryMi:{min:512,max:8192},pythonMemoryMb:{min:256,max:8192},pythonMaxCpus:{min:1,max:4},forcedPythonsPerPod:{min:2,max:100},minPods:{min:1,max:20},maxPods:{min:1,max:50}});var G=E(243);const $=[...["gpt-5.4-mini","gpt-5.4-nano","gpt-5.5","gpt-5.5-pro","gpt-5.6-sol","gpt-5.6-terra","gpt-5.6-luna","gpt-4o","gpt-4o-mini","gpt-4.1","gpt-4.1-mini","gpt-4.1-nano","o1","o3","o3-mini","o4-mini","gpt-5","gpt-5-mini","gpt-5-nano","gpt-5.1","gpt-5.2","gpt-5.2-pro","gpt-5.4"],...["claude-haiku-4-5-20251001","claude-opus-5","claude-sonnet-5","claude-3-7-sonnet-latest","claude-opus-4-1-20250805","claude-opus-4-20250514","claude-opus-4-5-20251101","claude-opus-4-6","claude-opus-4-7","claude-opus-4-8","claude-sonnet-4-20250514","claude-sonnet-4-5-20250929","claude-sonnet-4-6"],...["gemini-3.1-pro","gemini-3.6-flash","gemini-3.5-flash-lite","gemini-2.5-pro","gemini-2.5-flash","gemini-2.5-flash-lite","gemini-3-flash","gemini-3-pro","gemini-3.1-flash-lite","gemini-3.5-flash"],...["grok-4.3","grok-4-1-fast-reasoning","grok-4-1-fast-non-reasoning","grok-3","grok-3-fast","grok-3-mini","grok-3-mini-fast","grok-4","grok-4-fast-reasoning","grok-4-fast-non-reasoning"],"bedrock-claude-sonnet-4-5"];function W(e){return $.includes(e)}const Y={"gpt-4o":{name:"gpt-4o",displayName:"GPT-4o",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4o-mini":{name:"gpt-4o-mini",displayName:"GPT-4o Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:16384,contextWindowTokens:128e3,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1":{name:"gpt-4.1",displayName:"GPT-4.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-4.1-mini":{name:"gpt-4.1-mini",displayName:"GPT-4.1 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-4.1-nano":{name:"gpt-4.1-nano",displayName:"GPT-4.1 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:32768,contextWindowTokens:1047576,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-nano"},o1:{name:"o1",displayName:"GPT-o1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},o3:{name:"o3",displayName:"GPT-o3",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o3-mini":{name:"o3-mini",displayName:"GPT-o3 Mini",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"o4-mini":{name:"o4-mini",displayName:"GPT-o4 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:1e5,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!0,supportsStructuredOutput:!1,replacedBy:"gpt-5.4-mini"},"gpt-5":{name:"gpt-5",displayName:"GPT-5",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gpt-5.5"},"gpt-5-mini":{name:"gpt-5-mini",displayName:"GPT-5 Mini",description:"Legacy fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-mini"},"gpt-5-nano":{name:"gpt-5-nano",displayName:"GPT-5 Nano",description:"Legacy lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.4-nano"},"gpt-5.1":{name:"gpt-5.1",displayName:"GPT-5.1",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2":{name:"gpt-5.2",displayName:"GPT-5.2",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.2-pro":{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",description:"Legacy most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5-pro"},"gpt-5.4":{name:"gpt-5.4",displayName:"GPT-5.4",description:"Legacy powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gpt-5.5"},"gpt-5.4-mini":{name:"gpt-5.4-mini",displayName:"GPT-5.4 Mini",description:"Fast and efficient",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.4-nano":{name:"gpt-5.4-nano",displayName:"GPT-5.4 Nano",description:"Lightweight and quick",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:4e5,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5":{name:"gpt-5.5",displayName:"GPT-5.5",description:"Powerful and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.5-pro":{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",description:"Most advanced OpenAI model",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-sol":{name:"gpt-5.6-sol",displayName:"GPT-5.6 Sol",description:"Flagship model for complex tasks",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-terra":{name:"gpt-5.6-terra",displayName:"GPT-5.6 Terra",description:"Balanced and versatile",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"gpt-5.6-luna":{name:"gpt-5.6-luna",displayName:"GPT-5.6 Luna",description:"Fast and affordable",providerType:"openai",maxOutputTokens:128e3,contextWindowTokens:105e4,tokenQuotaCategory:"numberOfGpt4Tokens",chatQuotaCategory:"numberOfGpt4Chats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-sonnet-5":{name:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Balanced performance",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-6":{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!0,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-sonnet-4-5-20250929":{name:"claude-sonnet-4-5-20250929",displayName:"Claude Sonnet 4.5",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-sonnet-5"},"claude-3-7-sonnet-latest":{name:"claude-3-7-sonnet-latest",displayName:"Claude Sonnet 3.7",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-haiku-4-5-20251001":{name:"claude-haiku-4-5-20251001",displayName:"Claude Haiku 4.5",description:"Fastest responses",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-20250514":{name:"claude-opus-4-20250514",displayName:"Claude Opus 4",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"claude-opus-4-1-20250805":{name:"claude-opus-4-1-20250805",displayName:"Claude Opus 4.1",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:32e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-opus-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"claude-opus-4-5-20251101":{name:"claude-opus-4-5-20251101",displayName:"Claude Opus 4.5",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-5"},"claude-opus-4-6":{name:"claude-opus-4-6",displayName:"Claude Opus 4.6",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"claude-opus-5"},"claude-opus-4-7":{name:"claude-opus-4-7",displayName:"Claude Opus 4.7",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0,replacedBy:"claude-opus-5"},"claude-opus-4-8":{name:"claude-opus-4-8",displayName:"Claude Opus 4.8",description:"Legacy most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0,replacedBy:"claude-opus-5"},"claude-opus-5":{name:"claude-opus-5",displayName:"Claude Opus 5",description:"Most capable Anthropic model",providerType:"anthropic",maxOutputTokens:128e3,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,usesAdaptiveThinking:!0},"claude-sonnet-4-20250514":{name:"claude-sonnet-4-20250514",displayName:"Claude Sonnet 4",description:"Legacy balanced performance",providerType:"anthropic",maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",replacedBy:"claude-sonnet-5",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"bedrock-claude-sonnet-4-5":{name:"bedrock-claude-sonnet-4-5",vendorModelName:"us.anthropic.claude-sonnet-4-5-20250929-v1:0",displayName:"Claude Sonnet 4.5 (Bedrock)",description:"Claude Sonnet hosted on AWS Bedrock",providerType:"bedrock",requiresExplicitAvailability:!0,maxOutputTokens:64e3,contextWindowTokens:2e5,tokenQuotaCategory:"numberOfClaude2Tokens",chatQuotaCategory:"numberOfClaude2Chats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-2.5-flash":{name:"gemini-2.5-flash",displayName:"Gemini Flash 2.5",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.6-flash"},"gemini-2.5-pro":{name:"gemini-2.5-pro",displayName:"Gemini Pro 2.5",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.1-pro"},"gemini-2.5-flash-lite":{name:"gemini-2.5-flash-lite",displayName:"Gemini Flash 2.5 Lite",description:"Legacy lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1,replacedBy:"gemini-3.5-flash-lite"},"gemini-3-flash":{name:"gemini-3-flash",vendorModelName:"gemini-3-flash-preview",displayName:"Gemini Flash 3",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.6-flash"},"gemini-3.1-flash-lite":{name:"gemini-3.1-flash-lite",displayName:"Gemini Flash 3.1 Lite",description:"Legacy lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.5-flash-lite"},"gemini-3.5-flash":{name:"gemini-3.5-flash",displayName:"Gemini Flash 3.5",description:"Legacy fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.6-flash"},"gemini-3.5-flash-lite":{name:"gemini-3.5-flash-lite",displayName:"Gemini Flash 3.5 Lite",description:"Lightweight Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3.6-flash":{name:"gemini-3.6-flash",displayName:"Gemini Flash 3.6",description:"Fast and efficient",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"gemini-3-pro":{name:"gemini-3-pro",vendorModelName:"gemini-3-pro-preview",displayName:"Gemini Pro 3",description:"Legacy most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0,replacedBy:"gemini-3.1-pro"},"gemini-3.1-pro":{name:"gemini-3.1-pro",vendorModelName:"gemini-3.1-pro-preview",displayName:"Gemini Pro 3.1",description:"Most capable Gemini model",providerType:"gemini",maxOutputTokens:65535,contextWindowTokens:1048576,tokenQuotaCategory:"numberOfGeminiProTokens",chatQuotaCategory:"numberOfGeminiProChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!0},"grok-3":{name:"grok-3",displayName:"Grok-3",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-fast":{name:"grok-3-fast",displayName:"Grok-3 Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini":{name:"grok-3-mini",displayName:"Grok-3 Mini",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-3-mini-fast":{name:"grok-3-mini-fast",displayName:"Grok-3 Mini Fast",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:16e3,contextWindowTokens:131072,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4":{name:"grok-4",displayName:"Grok-4",description:"Legacy most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4.3",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4.3":{name:"grok-4.3",displayName:"Grok-4.3",description:"Most capable Grok model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:1e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!0,reasoning:{kind:"levels",supported:["low","medium","high"]}},"grok-4-fast-reasoning":{name:"grok-4-fast-reasoning",displayName:"Grok-4 Fast Reasoning",description:"Legacy optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-reasoning",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-fast-non-reasoning":{name:"grok-4-fast-non-reasoning",displayName:"Grok-4 Fast Non-Reasoning",description:"Legacy fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:256e3,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",replacedBy:"grok-4-1-fast-non-reasoning",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-reasoning":{name:"grok-4-1-fast-reasoning",displayName:"Grok-4.1 Fast Reasoning",description:"Optimized for reasoning tasks",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!0,supportsTemperature:!1,supportsStructuredOutput:!1},"grok-4-1-fast-non-reasoning":{name:"grok-4-1-fast-non-reasoning",displayName:"Grok-4.1 Fast Non-Reasoning",description:"Fast general-purpose model",providerType:"grok",maxOutputTokens:3e4,contextWindowTokens:2e6,tokenQuotaCategory:"numberOfGrokTokens",chatQuotaCategory:"numberOfGrokChats",isReasoningModel:!1,supportsTemperature:!1,supportsStructuredOutput:!1}};for(const e of Object.values(Y))S(!e.replacedBy||!Y[e.replacedBy]?.replacedBy,`Model ${e.name} is replaced by ${e.replacedBy}, which is also marked as replaced (is not active).`),S(!e.replacedBy||e.description.startsWith("Legacy"),`Model ${e.name} is deprecated and its description must start with 'Legacy': '${e.description}'.`);const j=["pod","worker"],Q=(e,t)=>Array.isArray(e)?e.concat(t):void 0;class U{constructor(){this.data={codeChecksum:"initial",databases:{},storage:{},executables:{},apis:{},graphql:{},triggers:{},schedulers:{},webhooks:{},nativeQueries:{},distributedLocks:{},aiChatbots:{},clientConnectionStateChangeHandlers:[],aiFunctions:{},openApiControllersMap:{},queues:{},queueMessageHandlers:{},eventHandlers:{},metrics:{security:{write:[],all:[]}},limits:{},llms:{},mcp:{},integrationLifecycleHooks:{onIntegrationCreated:!1,onIntegrationDeleted:!1,onIntegrationChanged:!1}}}secureDatabase(e,n,r=t){B(this.data,{databases:{[r]:{security:{[e]:[n]}}}})}secureAiQuery(e,n=t){B(this.data,{databases:{[n]:{security:{aiQuery:[e]}}}})}secureCollection(e,n,r,o=t){B(this.data,{databases:{[o]:{collections:{[e]:{security:{[n]:[r]}}}}}})}publicCollection(e,n,r=t){B(this.data,{databases:{[r]:{collections:{[e]:{publicAccess:{[n]:!0}}}}}})}secureStorage(e,t,n=r){B(this.data,{storage:{[n]:{security:{[e]:[t]}}}})}secureTopic(e,t,r,o=n){B(this.data,{queues:{[o]:{topics:{[e]:{security:{[t]:[r]}}}}}})}queueMessage(e,t,r=n){B(this.data,{queueMessageHandlers:{[r]:{[e]:[t]}}})}eventHandler(e,t){B(this.data,{eventHandlers:{[e]:[t]}})}secureMetric(e,t,n){B(this.data,{metrics:{security:{[t]:[{namePrefix:e,serviceFunction:n}]}}})}secureApi(e,t,n){B(this.data,t?{apis:{[e]:{endpoints:{[t]:{security:[n]}}}}}:{apis:{[e]:{security:[n]}}})}secureGraphQL(e,t){B(this.data,{graphql:{[e]:{security:[t]}}})}transformDatabase(e,n,r=t){B(this.data,{databases:{[r]:{transform:{[e]:{type:e,serviceFunction:n}}}}})}transformCollection(e,n,r,o=t){B(this.data,{databases:{[o]:{collections:{[e]:{transform:{[n]:{type:n,serviceFunction:r}}}}}}})}executable(e){const t=e.split(":")[1],n={serviceFunction:e},r=this.data.executables[t];r&&r.serviceFunction!==e&&console.warn(`Executable name collision: "${t}" is registered by both "${r.serviceFunction}" and "${e}". Use qualified names to avoid ambiguity.`),B(this.data,{executables:{[t]:n,[e]:n}})}aiFunction(e,{id:t,description:n,promptId:r,params:o,attributes:i,categories:a,internal:u}){!function(e,t){const n=t.filter(e=>void 0!==e.affinity&&null!==e.affinity);S(n.length<=1,()=>`Function '${e}' declares affinity on more than one parameter (${n.map(e=>e.name).join(", ")}); a function has at most one affinity key.`);for(const t of n)S("string"===t.type,`Affinity parameter '${t.name}' of '${e}' must be of type 'string', got '${t.type}'.`),S(j.includes(t.affinity),`Affinity parameter '${t.name}' of '${e}' declares an unknown scope '${t.affinity}'; expected one of ${j.map(e=>`'${e}'`).join(", ")}.`)}(e,o);const s={aiFunctions:{[t]:{serviceFunction:e,description:n,promptId:r,params:o,attributes:i,categories:a,internal:u}}};B(this.data,s)}aiFunctionsConfigurator(e,{id:t,integrationTypes:n}){const r={aiFunctionsConfigurators:{[t]:{serviceFunction:e,integrationTypes:n}}};B(this.data,r)}trigger(e,t,n,r,o){S(!this.data.triggers[e],`Duplicate Trigger IDs: ${e}`),this.data.triggers[e]={integrationId:r,collectionName:t,functionName:n,mutationTypes:o}}scheduler(e,t,n,r){S(!this.data.schedulers[e],`Duplicate Scheduler IDs: ${e}`),this.data.schedulers[e]={cronExpression:t,functionName:n,exclusive:r}}webhook(e,t){S(!this.data.webhooks[e],`Duplicate Webhook IDs: ${e}`),this.data.webhooks[e]={functionName:t}}secureNativeQuery(e,t){B(this.data,{nativeQueries:{[e]:[t]}})}secureDistributedLock(e,t){B(this.data,e?{distributedLocks:{mutexes:{[e]:{security:[t]}}}}:{distributedLocks:{security:[t]}})}secureAiAgent(t,n){B(this.data,t?{aiChatbots:{[e]:{profiles:{[t]:{security:{chat:[n]}}}}}}:{aiChatbots:{[e]:{security:{chat:[n]}}}})}secureLangGraph(e,t){B(this.data,{langgraphs:e?{[e]:{security:{invoke:[t]}}}:{security:{invoke:[t]}}})}limits(e,t){B(this.data,{limits:{[e]:t}})}clientConnectionChangeHandler(e){B(this.data,{clientConnectionStateChangeHandlers:[e]})}llmService(e,t){const n=t.models;S(void 0===this.data.llms?.[e]?.models,`LLM service '${e}' is already registered.`);const r=Object.keys(n);S(r.length>0,`LLM service '${e}' must declare at least one model.`);for(const t of r)S(!W(t),`LLM service '${e}' cannot declare an already-defined model: '${t}'.`);const o=Object.values(this.data.llms??{}).flatMap(e=>Object.keys(e.models??{}));for(const e of r)S(!o.includes(e),`Model '${e}' is already defined by another LLM service.`);B(this.data,{llms:{[e]:{models:n,...void 0!==t.supportsFunctions&&{supportsFunctions:t.supportsFunctions}}}})}llmAsk(e){const t=e.split(":")[0];S(void 0===this.data.llms?.[t]?.ask,`LLM service '${t}' already has an 'ask' function defined.`),B(this.data,{llms:{[t]:{ask:e}}})}mcpServer(e,t){const n=t.id;S(void 0===Object.values(this.data.mcp||{}).find(e=>e.options?.id===n),`MCP server with id ${n} already exists (${e}).`),B(this.data,{mcp:{[e]:{options:t,tools:[]}}})}mcpAuthorizer(e){const[t,n]=e.split(":");S(!this.data.mcp?.[t]?.authorizer,`MCP server '${t}' already has authorizer: ${n}.`),B(this.data,{mcp:{[t]:{authorizer:e}}})}mcpTool(e,t){const[n,r]=e.split(":");S(void 0===this.data.mcp?.[n]?.tools?.find(t=>t.serviceFunctionName===e),`MCP server '${n}' already has tool ${r}.`),B(this.data,{mcp:{[n]:{tools:[{serviceFunctionName:e,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema}]}}})}setIntegrationLifecycleHooks(e){this.data.integrationLifecycleHooks={onIntegrationCreated:e.onIntegrationCreated,onIntegrationChanged:e.onIntegrationChanged,onIntegrationDeleted:e.onIntegrationDeleted}}}function B(e,t){(0,G.mergeWith)(e,t,Q)}const F=new U;function q(e,t){return Te(n=>F.secureDatabase(e,n,t))}function V(e){return Te(t=>F.secureAiQuery(t,e))}function H(e,t,n){return Te(r=>F.secureCollection(e,t,r,n))}function K(e,t,n){return()=>{F.publicCollection(e,t,n)}}function z(e,t){return Te(n=>F.secureStorage(e,n,t))}function Z(e,t,n){return Te(r=>F.secureTopic(e,t,r,n))}function X(e){return Te(t=>F.secureMetric(e.metricNamePrefix||"",e.type,t))}function J(e,t){return Te(n=>F.secureApi(e,t,n))}function ee(e){return Te(t=>F.secureGraphQL(e,t))}function te(e,t){return Te(n=>F.queueMessage(e,n,t))}function ne(e){return Te(t=>F.eventHandler(e,t))}function re(){return Te(e=>F.executable(e))}function oe(e,t=[],n={},r=[],o=!1){return function(i,a,u){const s=ke(i,a),c=P(s);let l;return"object"==typeof e?(R(e.description??e.promptId,`AI function definition requires either "description" or "promptId" to be defined: ${a}`),void 0!==e.id&&D(e.id,a),l={id:e.id??c,description:e.description,promptId:e.promptId,params:R(e.params,`AI function definition requires "params" to be defined: ${a}`),attributes:e.attributes||{},categories:e.categories||[],internal:e.internal||!1}):l={id:c,description:e,promptId:void 0,params:t,attributes:n,categories:r,internal:o},F.aiFunction(s,l),u}}function ie(e){return function(t,n,r){const o=ke(t,n);void 0!==e.id&&D(e.id,n);const i={id:e.id??P(o),integrationTypes:e.integrationTypes};return F.aiFunctionsConfigurator(o,i),r}}function ae(e,n="",r){const o="object"==typeof e?{...e}:{id:e,collection:n,integrationId:r};return S(o.collection,"Collection name can't be empty"),function(e,n,r){return o.id||(o.id=ke(e,n)),F.trigger(o.id,o.collection,ke(e,n),o.integrationId||t,o.mutationTypes),r}}function ue(e,t,n=!0){return function(r,o,i){const a=ke(r,o);let u;return u="object"==typeof e?{cron:e.cron,id:e.id||a,exclusive:e.exclusive??!0}:{id:e,cron:R(t,"cronExpression must be defined"),exclusive:n},F.scheduler(u.id,u.cron,a,u.exclusive),i}}function se(e){return Te(t=>F.webhook(e,t))}function ce(e){return Te(t=>F.secureNativeQuery(e,t))}function le(e){return Te(t=>F.secureDistributedLock(e,t))}function pe(e){return Te(t=>F.secureAiAgent(e,t))}function fe(e){return function(t,n,r){return F.secureLangGraph(e,ke(t,n)),r}}function de(e){return Te(t=>F.limits(t,be(e)))}function he(e){return t=>{F.llmService(t.name,e)}}function ge(){return Te(e=>F.llmAsk(e))}function ye(e){return t=>{F.mcpServer(t.name,e)}}function _e(e){return Te(t=>F.mcpTool(t,e))}function me(){return Te(e=>F.mcpAuthorizer(e))}function ve(){return Te(e=>F.clientConnectionChangeHandler(e))}function ke(e,t){return`${e.constructor.name}:${t}`}function Te(e){return function(t,n,r){return e(ke(t,n)),r}}function be(e){return void 0!==e.rateLimit&&("number"==typeof e.rateLimit?e.rateLimit=[{value:e.rateLimit,scope:"global"}]:"object"!=typeof e.rateLimit||Array.isArray(e.rateLimit)||(e.rateLimit=[e.rateLimit]),e.rateLimit.forEach(e=>{void 0===e.scope&&(e.scope="global")})),void 0!==e.quotaLimit&&("number"==typeof e.quotaLimit?e.quotaLimit=[{value:e.quotaLimit,scope:"global",renewPeriod:"monthly"}]:"object"!=typeof e.quotaLimit||Array.isArray(e.quotaLimit)||(e.quotaLimit=[e.quotaLimit]),e.quotaLimit.forEach(e=>{void 0===e.scope&&(e.scope="global"),void 0===e.renewPeriod&&(e.renewPeriod="monthly")})),e}const Oe="user-code",we="user-code-python";function Ce(e){M(e,"Invalid application ID");const[t,n,r,o]=e.split("-");return S(!o,`Invalid application ID: ${e}`),{appId:t,environmentId:n??"prod",squidDeveloperId:r}}const Ae=["application","auth","mutation","native-query","query","queue","notification"];const Ee="__docId__",Ie=/[.\[\]]/;function Se(e,t){if(!e)return;const n=t.split(Ie);let r,o=e;for(;o&&n.length;){const e=n.shift();if(e){if("object"!=typeof o||!(e in o))return;r=o[e],o=r}}return r}function Re(e){return null==e}function xe(e,t){if(e===t)return!0;if(null===e||null===t)return!1;const n=typeof e;if(n!==typeof t)return!1;if("object"!==n)return e===t;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(const n of r)if(!o.includes(n)||!xe(e[n],t[n]))return!1;return!0}function Me(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Le(e[r],t);return n}function Le(e,t){const n=t?t(e):void 0;if(void 0!==n)return n;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return Me(e,t);if(e instanceof Map)return new Map(Me(Array.from(e),t));if(e instanceof Set)return new Set(Me(Array.from(e),t));if(ArrayBuffer.isView(e))return r=e,"undefined"!=typeof Buffer&&r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length);var r;const o={};for(const n in e)Object.hasOwnProperty.call(e,n)&&(o[n]=Le(e[n],t));return o}function Ne(e){if(Array.isArray(e))return e.map(e=>Ne(e));if("object"!=typeof e||null===e||e instanceof Date)return e;const t=Object.keys(e),n={};return t.sort().forEach(t=>{n[t]=Ne(e[t])}),n}function De(e){return function(e){if(void 0===e)return null;const t=Le(e,e=>function(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?{$date:e.toISOString()}:void 0);return JSON.stringify(t)}(Ne(e))}function Pe(e){return Le(JSON.parse(e),e=>{if(null===e||"object"!=typeof e)return;const t=e,n=t.$date;return n&&1===Object.keys(t).length?new Date(n):void 0})}function Ge(e,t,n){if(e=e instanceof Date?e.getTime():e??null,t=t instanceof Date?t.getTime():t??null,"=="===n)return xe(e,t);if("!="===n)return!xe(e,t);switch(n){case"<":return!Re(e)&&(!!Re(t)||t<e);case"<=":return!!Re(t)||!Re(e)&&t<=e;case">":return!Re(t)&&(!!Re(e)||t>e);case">=":return!!Re(e)||!Re(t)&&t>=e;case"like":return"string"==typeof t&&"string"==typeof e&&$e(t,e,!1);case"not like":return!("string"==typeof t&&"string"==typeof e&&$e(t,e,!1));case"like_cs":return"string"==typeof t&&"string"==typeof e&&$e(t,e,!0);case"not like_cs":return!("string"==typeof t&&"string"==typeof e&&$e(t,e,!0));case"array_includes_some":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.some(e=>R(n,"VALUE_CANNOT_BE_NULL").some(t=>xe(t,e)))}case"array_includes_all":{const n=t;return Array.isArray(e)&&Array.isArray(t)&&e.every(e=>R(n,"VALUE_CANNOT_BE_NULL").some(t=>xe(t,e)))}case"array_not_includes":{const n=t;return Array.isArray(t)&&Array.isArray(e)&&e.every(e=>!R(n,"VALUE_CANNOT_BE_NULL").some(t=>xe(t,e)))}default:throw new Error(`Unsupported operator comparison: ${n}`)}}function $e(e,t,n){n||(e=e.toLowerCase(),t=t.toLowerCase());const r=function(e){let t="";for(let n=0;n<e.length;++n)"\\"===e[n]?n+1<e.length&&["%","_"].includes(e[n+1])?(t+=e[n+1],n++):n+1<e.length&&"\\"===e[n+1]?(t+="\\\\",n++):t+="\\":"%"===e[n]?t+="[\\s\\S]*":"_"===e[n]?t+="[\\s\\S]":("/-\\^$*+?.()[]{}|".includes(e[n])&&(t+="\\"),t+=e[n]);return t}(t);return new RegExp(`^${r}$`).test(e)}function We(e){return"fieldName"in e}function Ye(e){return"docIds"in e}function je(e,t,n){const r=e.docIds.some(e=>Object.entries(e).every(([e,r])=>Ge(r,n(t,e)??null,"==")));switch(e.operator){case"==":case"in":return r;case"!=":case"not in":return!r}}function Qe(e,t,n,r){const o=e,i=r(t,Ee);if("string"!=typeof i)return Ge(o,i??null,n);let a;try{a=Pe(i)}catch{return Ge(o,i,n)}if(!a||"object"!=typeof a||Array.isArray(a))return Ge(o,i,n);const u=Object.keys(a);if(1===u.length&&"__id"===u[0]){const e=a.__id,t=function(e){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=Object.keys(e);return 1===t.length&&"__id"===t[0]?e.__id:De(e)}if("string"==typeof e)try{const t=Pe(e);if(t&&"object"==typeof t&&!Array.isArray(t)){const e=Object.keys(t);if(1===e.length&&"__id"===e[0])return t.__id}}catch{}return e}(o);return Ge(t,e,n)}if(1===u.length){const e=function(e,t){if("object"==typeof e&&null!==e&&!Array.isArray(e)){const n=Object.keys(e);if(1===n.length&&n[0]===t)return e[t]}if("string"==typeof e)try{const n=Pe(e);if(n&&"object"==typeof n&&!Array.isArray(n)){const e=Object.keys(n);if(1===e.length&&e[0]===t)return n[t]}}catch{}return e}(o,u[0]);return Ge(e,a[u[0]],n)}return"object"!=typeof o||null===o||Array.isArray(o)?Ge(o,i,n):Ge(De(o),i,n)}const Ue={"in:in":(e,t)=>e.every(e=>t.includes(e)),"in:not in":(e,t)=>e.every(e=>!t.includes(e)),"not in:not in":(e,t)=>t.every(t=>e.includes(t)),">:not in":(e,t)=>t.every(t=>e>=t),">=:not in":(e,t)=>t.every(t=>e>t),"<:not in":(e,t)=>t.every(t=>e<=t),"<=:not in":(e,t)=>t.every(t=>e<t),">:>":(e,t)=>e>=t,">=:>":(e,t)=>e>t,"in:>":(e,t)=>e.every(e=>e>t),">:>=":(e,t)=>e>=t,">=:>=":(e,t)=>e>=t,"in:>=":(e,t)=>e.every(e=>e>=t),"<:<":(e,t)=>e<=t,"<=:<":(e,t)=>e<t,"in:<":(e,t)=>e.every(e=>e<t),"<:<=":(e,t)=>e<=t,"<=:<=":(e,t)=>e<=t,"in:<=":(e,t)=>e.every(e=>e<=t),"like:like":(e,t)=>Be(e.toLowerCase(),t.toLowerCase()),"like_cs:like":(e,t)=>Be(e.toLowerCase(),t.toLowerCase()),"like:like_cs":(e,t)=>Be(e,t)&&qe(t),"like_cs:like_cs":(e,t)=>Be(e,t),"like:not like":(e,t)=>!Fe(e.toLowerCase(),t.toLowerCase()),"like_cs:not like":(e,t)=>!Fe(e.toLowerCase(),t.toLowerCase()),"like:not like_cs":(e,t)=>!Fe(e.toLowerCase(),t.toLowerCase()),"like_cs:not like_cs":(e,t)=>!Fe(e,t),"not like:like":(e,t)=>He(e,t),"not like_cs:like":(e,t)=>He(e,t),"not like:like_cs":(e,t)=>He(e,t),"not like_cs:like_cs":(e,t)=>He(e,t),"not like:not like":(e,t)=>Be(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like":(e,t)=>Be(t,e)&&qe(e),"not like:not like_cs":(e,t)=>Be(t.toLowerCase(),e.toLowerCase()),"not like_cs:not like_cs":(e,t)=>Be(t,e),"in:like":(e,t)=>e.every(e=>Ge(t,e,"like")),"in:like_cs":(e,t)=>e.every(e=>Ge(t,e,"like_cs")),"in:not like":(e,t)=>e.every(e=>Ge(t,e,"not like")),"in:not like_cs":(e,t)=>e.every(e=>Ge(t,e,"not like_cs")),"like:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&!!t.find(t=>t.toLowerCase()===e.toLowerCase()),"like_cs:in":(e,t)=>!e.includes("%")&&!e.includes("_")&&t.includes(e),"not like:in":(e,t)=>e.length>0&&Ve(e)||Ke(e)&&t.includes(""),"not like_cs:in":(e,t)=>e.length>0&&Ve(e)||Ke(e)&&t.includes(""),"not in:like":(e,t)=>t.length>0&&Ve(t)||Ke(t)&&e.includes(""),"not in:like_cs":(e,t)=>t.length>0&&Ve(t)||Ke(t)&&e.includes(""),"not in:not like":(e,t)=>!t.includes("%")&&!t.includes("_")&&!!e.find(e=>e.toLowerCase()===t.toLowerCase()),"not in:not like_cs":(e,t)=>!t.includes("%")&&!t.includes("_")&&e.includes(t),"like:not in":(e,t)=>t.every(t=>Ge(e,t,"not like")),"like_cs:not in":(e,t)=>t.every(t=>Ge(e,t,"not like_cs")),"not like:not in":(e,t)=>t.every(t=>Ge(e,t,"like")),"not like_cs:not in":(e,t)=>t.every(t=>Ge(e,t,"like_cs")),"array_includes_some:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_all:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_not_includes":(e,t)=>t.every(t=>e.includes(t)),"array_includes_some:array_not_includes":(e,t)=>e.every(e=>!t.includes(e)),"array_not_includes:array_includes_some":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_includes_some":(e,t)=>e.every(e=>t.includes(e)),"array_includes_some:array_includes_all":(e,t)=>e.every(e=>t.includes(e)),"array_not_includes:array_includes_all":(e,t)=>t.every(t=>!e.includes(t)),"array_includes_all:array_not_includes":(e,t)=>e.every(e=>!t.includes(e))};function Be(e,t,n=0,r=0){if(r>=t.length)return n>=e.length;if(n>=e.length)return Ve(t.substring(r));const o=e[n],i=t[r];return"%"===o&&"%"===i?Be(e,t,n+1,r+1)||Be(e,t,n+1,r):"%"!==o&&("%"===i?Be(e,t,n,r+1)||Be(e,t,n+1,r):(o===i||"_"===i)&&Be(e,t,n+1,r+1))}function Fe(e,t,n=0,r=0){if(n>=e.length&&r>=t.length)return!0;if(n>=e.length)return Ve(t.substring(r));if(r>=t.length)return Ve(e.substring(n));const o=n<e.length?e[n]:"",i=r<t.length?t[r]:"";return"%"===o&&"%"===i?Fe(e,t,n+1,r+1)||Fe(e,t,n,r+1)||Fe(e,t,n+1,r):"%"===o||"%"===i?Fe(e,t,n,r+1)||Fe(e,t,n+1,r):(o===i||"_"===o||"_"===i)&&Fe(e,t,n+1,r+1)}function qe(e){return!/[a-zA-Z]/.test(e)}function Ve(e){return e.split("").every(e=>"%"===e)}function He(e,t){return e.length>0&&Ve(e)||t.length>0&&Ve(t)||Ke(e)&&0===t.length}function Ke(e){let t=!1,n=!1;for(const r of e)switch(r){case"%":t=!0;break;case"_":if(n)return!1;n=!0;break;default:return!1}return t&&n}function ze(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const r of n){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!xe(e[r],t[r]))return!1}return!0}function Ze(e,t){return t.every(t=>{const n=Object.keys(t).sort();if(n.length!==e.length)return!1;for(let t=0;t<e.length;t++)if(n[t]!==e[t])return!1;return!0})}class Xe{constructor(e){this.query=e,this.query=e;const t=this.query.conditions.filter(We),n=this.query.conditions.filter(Ye),r=n.flatMap(e=>function(e){if("=="!==e.operator&&"in"!==e.operator)return[];if(0===e.docIds.length)return[];const t=[],n=e.docIds[0];for(const r of Object.keys(n)){const o=n[r];e.docIds.every(e=>Object.prototype.hasOwnProperty.call(e,r)&&xe(e[r],o))&&t.push({fieldName:r,operator:"==",value:o})}return t}(e));this.exactSimpleConditions=this.parseConditions(t),this.exactDocIdConditions=n,this.subqueryConditions=this.parseConditions([...t,...r])}get integrationId(){return this.query.integrationId}get collectionName(){return this.query.collectionName}get limit(){return this.query.limit}get projectFields(){return this.query.projectFields}sortedBy(e){return!e.find((e,t)=>!xe(this.query.sortOrder[t],{...e,asc:e.asc??!0}))}sortedByExact(e){return e.length===this.query.sortOrder.length&&this.sortedBy(e)}isSubqueryOf(e,t,n){return this.isSubqueryOfCondition({fieldName:e,operator:t,value:n})}isSubqueryOfCondition(e){return!!this.subqueryConditions.filter(t=>t.fieldName===e.fieldName).find(t=>this.evaluateSubset(t,e))}isSubqueryOfConditions(e){return this.parseConditions(e).every(e=>this.isSubqueryOfCondition(e))}isSubqueryOfQuery(e){if(e.collectionName!==this.collectionName||e.integrationId!==this.integrationId)return!1;for(const t of e.conditions.filter(Ye))if(!this.childImpliesParentDocIdCondition(t))return!1;const t=e.conditions.filter(We),n=this.isSubqueryOfConditions(t),r=this.sortedBy(e.sortOrder),o=-1===e.limit||this.limit>-1&&this.limit<e.limit,i=this.isProjectFieldsSubset(this.query.projectFields,e.projectFields);return n&&r&&o&&i}childImpliesParentDocIdCondition(e){const t=e.docIds;if(0===t.length)return!1;const n="=="===e.operator||"in"===e.operator,r=Object.keys(t[0]).sort(),o=[];for(const e of this.query.conditions)Ye(e)&&o.push(...e.docIds);if(!Ze(r,t)||!Ze(r,o))return!1;const i=this.buildChildEffectiveTupleSet();return n?void 0!==i.allowed&&i.allowed.every(e=>t.some(t=>ze(e,t))):void 0!==i.allowed?i.allowed.every(e=>!t.some(t=>ze(e,t))):t.every(e=>i.excluded.some(t=>ze(e,t)))}buildChildEffectiveTupleSet(){let e;const t=[];for(const n of this.query.conditions)if(Ye(n))if("=="===n.operator||"in"===n.operator)e=void 0===e?[...n.docIds]:e.filter(e=>n.docIds.some(t=>ze(e,t)));else for(const e of n.docIds)t.some(t=>ze(t,e))||t.push(e);return void 0!==e&&t.length>0&&(e=e.filter(e=>!t.some(t=>ze(e,t)))),{allowed:e,excluded:t}}isProjectFieldsSubset(e,t){if(!t)return!0;if(!e)return!1;const n=new Set(t);return e.every(e=>n.has(e))}getConditionsFor(...e){return this.subqueryConditions.filter(t=>e.includes(t.fieldName))}getConditionsForField(e){return this.subqueryConditions.filter(t=>t.fieldName===e)}documentMatchesQuery(e){for(const t of this.exactSimpleConditions){const n=t.fieldName,r=t.operator;if(n===Ee){const n=t.value;if("in"===r||"not in"===r){const t=(Array.isArray(n)?n:[n]).some(t=>Qe(t,e,"==",Se));if(!("in"===r?t:!t))return!1;continue}if(!Qe(n,e,r,Se))return!1;continue}const o=Se(e,n);if("in"===r){if(t.value.includes(o))continue;return!1}if("not in"!==r){if(!Ge(t.value,o,r))return!1}else if(t.value.includes(o))return!1}for(const t of this.exactDocIdConditions)if(!je(t,e,Se))return!1;return!0}evaluateSubset(e,t){const{operator:n,value:r}=e,{operator:o,value:i}=this.parseConditions([t])[0],a=Ue[`${n}:${o}`];return!!a&&a(r,i)}parseConditions(e){const t=[],n=new Map,r=new Map;return e.forEach(e=>{switch(e.operator){case"==":case"in":n.set(e.fieldName,(n.get(e.fieldName)||[]).concat(e.value));break;case"!=":case"not in":r.set(e.fieldName,(r.get(e.fieldName)||[]).concat(e.value));break;default:t.push(e)}}),n.forEach((e,n)=>{t.push({fieldName:n,operator:"in",value:e})}),r.forEach((e,n)=>{t.push({fieldName:n,operator:"not in",value:e})}),t}}function Je(){if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;throw new Error("Unable to locate global object")}void 0===Je()?.SQUID_LOG_DEBUG_ENABLED&&function(e=!0){Je().SQUID_LOG_DEBUG_ENABLED=e}(function(){let e="";return"undefined"!=typeof window&&window.location?e=new URLSearchParams(window.location.search).get("SQUID_DEBUG")||"":"undefined"!=typeof process&&process.env&&(e=process.env.SQUID_DEBUG||""),"1"===e||"true"===e}());const et="__squidMetadata",tt=(new g,[]);function nt(e,t,n){const r=ot();r.codeDirByServiceClassName.set(e.name,n);let o=r.serviceInstanceByCtor.get(e);if(!o||function(e){return e[et]||{version:0}}(o).version<=1){const n=ot(),r={...n,...t};S(!tt.includes(e),()=>`CIRCULAR_DEPENDENCY: ${tt[tt.length-1]?.name} => ${e.name}`),tt.push(e);try{o=n.requestLocalStorage.run(t,()=>new e(r))}finally{tt.pop()}n.serviceInstanceByCtor.set(e,o)}else(function(e,t){S(e.backendApiKey===t.backendApiKey,"backendApiKey does not match."),S(e.requestLocalStorage===t.requestLocalStorage,"requestLocalStorage does not match"),S(e.environmentId===t.environmentId,"environmentId does not match"),S(e.squidDeveloperId===t.squidDeveloperId,"squidDeveloperId does not match");const n=Ce(e.appId),r=Ce(t.appId);S(n.appId===r.appId,`appId does not match! Before: ${n.appId}, after ${r.appId}`)})(o.config,r),o.config.secrets=r.secrets,o.config.apiKeys=r.apiKeys;return o}const rt="SQUID_GLOBAL_CONFIG";function ot(){return R(Je()[rt],"Squid global config is not defined! Make sure you are not trying to use Squid at module load time.")}function it(e){return e<=0?Promise.resolve():new Promise(t=>setTimeout(t,e))}const at=d(O(),"squid-workspaces"),ut=/^[A-Za-z0-9_-]{1,200}$/;function st(e){return"string"==typeof e&&ut.test(e)}const ct=w(y),lt="SQUID_WORKSPACE_SERVER_HOST",pt=d(O(),"squid-workspace-ssh","id_ed25519"),ft=60,dt=2e4,ht=3e5,gt="markers",yt=3e5,_t=["set -eu",'key_path=$(wslpath -u "$1")','certificate_path=$(wslpath -u "$2")','local_path=$(wslpath -u "$3")',"remote_path=$4","port=$5","direction=$6","temporary_directory=$(mktemp -d /tmp/squid-workspace-rsync.XXXXXX)","cleanup() {",' rm -f -- "$temporary_directory/id_ed25519" "$temporary_directory/id_ed25519-cert.pub" "$temporary_directory/known_hosts"',' rmdir -- "$temporary_directory" 2>/dev/null || true',"}","trap cleanup EXIT","trap 'exit 129' HUP","trap 'exit 130' INT","trap 'exit 143' TERM",'install -m 600 "$key_path" "$temporary_directory/id_ed25519"','install -m 644 "$certificate_path" "$temporary_directory/id_ed25519-cert.pub"','ssh_command="ssh -i $temporary_directory/id_ed25519 -o CertificateFile=$temporary_directory/id_ed25519-cert.pub -p $port -o UserKnownHostsFile=$temporary_directory/known_hosts -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=3"','if [ "$direction" = pull ]; then',' rsync -a -e "$ssh_command" --delete "$remote_path" "$local_path/"','elif [ "$direction" = push ]; then',' rsync -a --fsync -e "$ssh_command" --delete "$local_path/" "$remote_path"',"else"," exit 64","fi"].join("\n");function mt(){return!!process.env[lt]}class vt{constructor(e,t,n,r){this.leaseTtlSeconds=t,this.heartbeatIntervalMs=n,this.rpcTransport=r,this.abortController=new AbortController,this.state="active",this.workspaceId=e.workspaceId,this.ownerId=e.ownerId,this.fencingToken=e.fencingToken,this.expiresAtValue=e.expiresAt,this.signal=this.abortController.signal,this.assertMatchingIdentity(e),this.scheduleExpiry(),this.startHeartbeat()}get expiresAt(){return this.expiresAtValue}async heartbeat(){if(this.assertActive(),this.heartbeatPromise)return void await this.heartbeatPromise;const e=this.performHeartbeat().finally(()=>{this.heartbeatPromise===e&&(this.heartbeatPromise=void 0)});this.heartbeatPromise=e,await e}async release(){if("active"===this.state&&(this.stopHeartbeat(),await(this.heartbeatPromise?.catch(()=>{})),"active"===this.state)){try{await this.postWhileActive("workspaces/releaseLease",{workspaceId:this.workspaceId,ownerId:this.ownerId,fencingToken:this.fencingToken})}catch(e){if("active"!==this.state)return;throw this.startHeartbeat(),e}this.markInactive("released")}}assertActive(){if("released"===this.state)throw new Error("WORKSPACE_LEASE_LOST");if("lost"===this.state||new Date(this.expiresAtValue).getTime()<=Date.now())throw this.markInactive("lost"),new Error("WORKSPACE_LEASE_LOST")}async assertActiveRemotely(){this.assertActive();try{const{lease:e}=await this.postWhileActive("workspaces/assertLease",{workspaceId:this.workspaceId,ownerId:this.ownerId,fencingToken:this.fencingToken});this.applyIdentity(e)}catch(e){throw this.markInactive("lost"),this.leaseLostError(e)}}startHeartbeat(){this.heartbeatTimer||"active"!==this.state||(this.heartbeatTimer=setInterval(()=>{this.heartbeat().catch(()=>{})},this.heartbeatIntervalMs),this.heartbeatTimer.unref?.())}scheduleExpiry(){this.stopExpiryTimer();const e=Math.max(0,new Date(this.expiresAtValue).getTime()-Date.now());this.expiryTimer=setTimeout(()=>{this.expiryTimer=void 0,"active"===this.state&&(new Date(this.expiresAtValue).getTime()>Date.now()?this.scheduleExpiry():this.markInactive("lost"))},e),this.expiryTimer.unref?.()}stopExpiryTimer(){this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=void 0)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0)}async performHeartbeat(){try{const{lease:e}=await this.postWhileActive("workspaces/heartbeatLease",{workspaceId:this.workspaceId,ownerId:this.ownerId,fencingToken:this.fencingToken,leaseTtlSeconds:this.leaseTtlSeconds});this.applyIdentity(e)}catch(e){throw this.markInactive("lost"),this.leaseLostError(e)}}async postWhileActive(e,t){this.assertActive();const{signal:n}=this.abortController;let r=()=>{};const o=new Promise((e,t)=>{r=t}),i=()=>{r(n.reason??new Error("WORKSPACE_LEASE_LOST"))};n.aborted?i():n.addEventListener("abort",i,{once:!0});try{return await Promise.race([this.rpcTransport.post(e,t,n),o])}finally{n.removeEventListener("abort",i)}}applyIdentity(e){this.assertMatchingIdentity(e),"active"===this.state&&new Date(e.expiresAt).getTime()>new Date(this.expiresAtValue).getTime()&&(this.expiresAtValue=e.expiresAt,this.scheduleExpiry())}assertMatchingIdentity(e){const t=new Date(e.expiresAt).getTime();S(st(e.workspaceId)&&st(e.ownerId)&&Number.isSafeInteger(e.fencingToken)&&e.fencingToken>0&&e.workspaceId===this.workspaceId&&e.ownerId===this.ownerId&&e.fencingToken===this.fencingToken&&Number.isFinite(t),"WORKSPACE_LEASE_LOST: Core returned a mismatched lease identity")}markInactive(e){this.state=e,this.stopExpiryTimer(),this.stopHeartbeat(),this.abortController.signal.aborted||this.abortController.abort(new Error("released"===e?"WORKSPACE_LEASE_RELEASED":"WORKSPACE_LEASE_LOST"))}leaseLostError(e){return new Error(`WORKSPACE_LEASE_LOST: ${L(e)}`)}}class kt{constructor(e={}){this.lp="WorkspaceClient";const{rpcTransport:t,leaseOwnerId:n=_(),leaseHeartbeatIntervalMs:r=dt,localCacheRoot:o=at}=e;S(st(n),()=>`Invalid leaseOwnerId "${n}"`),S(Number.isSafeInteger(r)&&r>0,()=>`Invalid leaseHeartbeatIntervalMs ${r}`),S(f(o),()=>`localCacheRoot must be absolute: "${o}"`),this.rpcTransport=t??{post:async(e,t,n)=>await It().rpcManager.post(e,t,[],"files",{},n)},this.leaseOwnerIdPrefix=n,this.leaseHeartbeatIntervalMs=r,this.localCacheRoot=o}async acquireLease(e,t={}){S(st(e),()=>`Invalid workspace id "${e}"`);const{leaseTtlSeconds:n=ft,acquisitionTimeoutMs:r=ht}=t;S(Number.isSafeInteger(n)&&n>=1&&n<=300,()=>`Invalid leaseTtlSeconds ${n}`),S(Number.isSafeInteger(r)&&r>=0&&r<=3e5,()=>`Invalid acquisitionTimeoutMs ${r}`);const o=Date.now()+r,i=this.createLeaseOwnerId();for(;;){const t=Math.max(0,o-Date.now()),r=AbortSignal.timeout(Math.max(1,t));try{const{lease:t}=await this.rpcTransport.post("workspaces/acquireLease",{workspaceId:e,ownerId:i,leaseTtlSeconds:n},r);return new vt(t,n,this.resolveLeaseHeartbeatIntervalMs(n),this.rpcTransport)}catch(e){if(r.aborted&&this.isTimeoutError(e))throw new Error("WORKSPACE_BUSY");if(!this.isWorkspaceBusyError(e))throw e;const t=o-Date.now();if(t<=0)throw new Error("WORKSPACE_BUSY");const n=Math.min(t,25+Math.floor(50*Math.random()));await it(n)}}}async create(e,t){const n=e??_();S(st(n),()=>`Invalid workspace id "${n}"`);const{idleTtlSeconds:r,signal:o}=t??{};var i;S(void 0===r||"number"==typeof(i=r)&&Number.isInteger(i)&&i>=600&&i<=2592e3,()=>`Invalid idleTtlSeconds ${r}`),Tt(o);const a=this.resolveLocalWorkspaceDir(n);return await this.markLocalWorkspaceUsed(n),Tt(o),await v(a,{recursive:!0}),Tt(o),await this.pull(n,a,r,o),Tt(o),this.buildMetadata(n,a)}async push(e,t={}){S(st(e),()=>`Invalid workspace id "${e}"`);const n=this.resolveLocalWorkspaceDir(e);return await this.markLocalWorkspaceUsed(e),t.lease?(this.assertLeaseForWorkspace(e,t.lease),await this.stagePush(e,t.lease),await t.lease.assertActiveRemotely(),await this.commitStagedPush(e,t.lease),this.buildMetadata(e,n)):(await this.pushDir(e,n,"legacy-write"),this.buildMetadata(e,n))}async stagePush(e,t){S(st(e),()=>`Invalid workspace id "${e}"`),this.assertLeaseForWorkspace(e,t);const n=this.resolveLocalWorkspaceDir(e);await this.markLocalWorkspaceUsed(e),await this.pushDir(e,n,"staged-write",t),await this.rpcTransport.post("workspaces/completePush",this.buildCommitPushRequest(e,t),t.signal)}async commitStagedPush(e,t){S(st(e),()=>`Invalid workspace id "${e}"`),this.assertLeaseForWorkspace(e,t),await this.rpcTransport.post("workspaces/commitPush",this.buildCommitPushRequest(e,t),t.signal)}async discardLocal(e){S(st(e),()=>`Invalid workspace id "${e}"`),await T(this.resolveLocalWorkspaceDir(e),{recursive:!0,force:!0}),await T(this.resolveLocalWorkspaceMarkerPath(e),{force:!0}),await T(this.resolveLocalWorkspaceQuarantineDir(e),{recursive:!0,force:!0})}async delete(e){S(st(e),()=>`Invalid workspace id "${e}"`);const t=`${this.lp}.delete:`;try{await this.rpcTransport.post("workspaces/delete",{workspaceId:e})}catch(n){throw new Error(`${t} Failed to delete workspace "${e}" on the server: ${L(n)}`)}await T(this.resolveLocalWorkspaceDir(e),{recursive:!0,force:!0}),await T(this.resolveLocalWorkspaceMarkerPath(e),{force:!0}),await T(this.resolveLocalWorkspaceQuarantineDir(e),{recursive:!0,force:!0})}buildMetadata(e,t){return{id:e,path:t}}buildCommitPushRequest(e,t){return{workspaceId:e,ownerId:t.ownerId,fencingToken:t.fencingToken}}assertLeaseForWorkspace(e,t){S(t.workspaceId===e,"WORKSPACE_LEASE_LOST: lease belongs to another workspace"),t.assertActive()}resolveLocalWorkspaceDir(e){return d(this.localCacheRoot,"workspaces",e)}resolveLocalWorkspaceMarkerPath(e){return d(this.localCacheRoot,gt,e)}resolveLocalWorkspaceQuarantineDir(e){return d(this.localCacheRoot,".evicting",e)}async markLocalWorkspaceUsed(e){const t=this.resolveLocalWorkspaceMarkerPath(e);await v(d(this.localCacheRoot,gt),{recursive:!0}),await b(t,"")}async pull(e,t,n,r){const o=`${this.lp}.pull:`;try{await this.rsync(e,["--delete",`${this.remoteTarget()}/`,`${t}/`],"read",void 0,n,r)}catch(t){if(this.isMissingRemoteError(t))return;throw new Error(`${o} Failed to pull workspace "${e}": ${L(t)}`)}}async pushDir(e,t,n,r){const o=`${this.lp}.push:`;try{await this.rsync(e,["--delete",`${t}/`,`${this.remoteTarget()}/`],n,r)}catch(t){throw new Error(`${o} Failed to push workspace "${e}": ${L(t)}`)}}async rsync(e,t,n,r,o,i){Tt(i),await this.ensurePodKeypair(),Tt(i);const a=`${this.sshKeyPath()}-cert-${_()}.pub`;try{await this.issueCert(e,a,n,r,o,i),Tt(i);const u=`ssh -i ${this.sshKeyPath()} -o CertificateFile=${a} -p ${this.sshPort()} -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=3`;if("win32"===process.platform&&"true"===process.env.SQUID_WORKSPACE_USE_WSL_RSYNC)await this.rsyncThroughWsl(t,a,i);else{const e="read"===n?[]:["--fsync"];await ct("rsync",["-a",...e,"-e",u,...t],{signal:i,timeout:yt})}}finally{await T(a,{force:!0}).catch(()=>{})}}async rsyncThroughWsl(e,t,n){const r=`${this.remoteTarget()}/`,[o,i,a]=e;S(3===e.length&&"--delete"===o&&(i===r&&!!a||a===r&&!!i),"WORKSPACE_WSL_RSYNC_ARGUMENTS_INVALID");const u=i===r?"pull":"push",s=(S("string"==typeof(c="pull"===u?a:i)&&c.length>0,"WORKSPACE_WSL_RSYNC_PATH_INVALID"),c.replace(/[\\/]+$/u,""));var c;S(f(s)&&!s.includes("\0"),"WORKSPACE_WSL_RSYNC_PATH_INVALID");const l=this.sshPort();S(/^\d{1,5}$/.test(l)&&Number(l)<=65535,"WORKSPACE_WSL_RSYNC_PORT_INVALID"),await ct("wsl.exe",["--exec","sh","-c",_t,"workspace-rsync",this.sshKeyPath(),t,s,r,l,u],{signal:n,timeout:yt})}ensurePodKeypair(){return this.podKeypairReady||(this.podKeypairReady=this.generatePodKeypair().catch(e=>{throw this.podKeypairReady=void 0,e})),this.podKeypairReady}async generatePodKeypair(){const e=this.sshKeyPath();await this.fileExists(e)||(await v(d(e,".."),{recursive:!0}),await ct("ssh-keygen",["-t","ed25519","-N","","-f",e,"-C","squid-workspace"],{timeout:3e4}))}async issueCert(e,t,n,r,o,i){const a=`${this.lp}.issueCert:`,u=(await k(`${this.sshKeyPath()}.pub`,"utf8")).trim();try{const{certificate:a}=await this.rpcTransport.post("workspaces/issueCert",{workspaceId:e,ephemeralPublicKey:u,idleTtlSeconds:o,accessMode:n,ownerId:r?.ownerId,fencingToken:r?.fencingToken},i??r?.signal);Tt(i),await b(t,`${a}\n`,{mode:420})}catch(t){throw new Error(`${a} Failed to obtain certificate for workspace "${e}": ${L(t)}`)}}async fileExists(e){try{return await m(e),!0}catch{return!1}}remoteTarget(){return`${this.sshUser()}@${this.sshHost()}:.`}isMissingRemoteError(e){const t=e&&"object"==typeof e&&"code"in e?e.code:void 0,n=L(e);return 23===t&&/no such file or directory/i.test(n)||12===t&&n.includes("Restricted directory does not exist!")}isWorkspaceBusyError(e){return 409===(e&&"object"==typeof e&&"statusCode"in e?e.statusCode:void 0)&&L(e).includes("WORKSPACE_BUSY")}isTimeoutError(e){return e instanceof Error&&"TimeoutError"===e.name}createLeaseOwnerId(){const e=_(),t=200-e.length-1;return`${this.leaseOwnerIdPrefix.slice(0,t)}-${e}`}resolveLeaseHeartbeatIntervalMs(e){const t=Math.floor(1e3*e/3);return Math.min(this.leaseHeartbeatIntervalMs,Math.max(1,t))}sshHost(){return this.getEnv(lt)}sshPort(){return process.env.SQUID_WORKSPACE_SERVER_PORT||"22"}sshUser(){return process.env.SQUID_WORKSPACE_SSH_USER||"workspace"}sshKeyPath(){return process.env.SQUID_WORKSPACE_SSH_KEY_PATH||pt}getEnv(e){const t=process.env[e];return S(t,()=>`Missing required env var "${e}" for WorkspaceClient`),t}}function Tt(e){if(e?.aborted)throw e.reason instanceof Error?e.reason:new Error("WORKSPACE_OPERATION_ABORTED")}function bt(e,t,n){return{body:t.body||"",statusCode:t.statusCode||n,headers:t.headers||{},[e]:!0}}class Ot{constructor(){this.region=process.env.SQUID_REGION||"local",this.config=ot(),this[et]={version:2},this.backendBaseUrl=function(e,t,n,r,o,i){let a="https",u=`${r||t}.${o||e}.${new URL("https://squid.cloud").host}`,s="";/^local/.test(e)&&(a="http",s=i||function(e){const t=e.replace(/^\/+/,"").split("/")[0]||"";return Ae.includes(t)}(n)?"8001":"8000",/android$/.test(e)?u="10.0.2.2":(c=e,/ios$/.test(c)&&(u="localhost")));var c;const l=a+"://"+u+(s?`:${s}`:""),p=n.replace(/^\/+/,"");return p?`${l}/${p}`:l}(this.region,this.config.appId,"")}get secrets(){return this.config.secrets}get apiKeys(){return this.config.apiKeys}get context(){return this.getRequestConfig().context}get squid(){return It()}get assetsDirectory(){const e=Object.getPrototypeOf(this).constructor.name,t=this.config.codeDir||this.config.codeDirByServiceClassName.get(e);return S(t,()=>`No codeDir found for service: ${e}`),h(t,"public")}get workspace(){return new kt}getApiKey(){return this.config.backendApiKey}getUserAuth(){const{auth:e}=this.getRequestConfig();return"Bearer"===e?.type?e:void 0}getApiKeyAuth(){const{auth:e}=this.getRequestConfig();return"ApiKey"===e?.type?e:void 0}hasLiveState(){return!1}async releaseLiveState(){}isAuthenticated(){const{auth:e}=this.getRequestConfig();return!!e}assertIsAuthenticated(){this.assertInRequestScope(),S(this.isAuthenticated(),"UNAUTHORIZED")}assertInRequestScope(){S(this.config.requestLocalStorage.getStore(),"This method can only be called with a valid request scope.")}assertApiKeyCall(){S(this.getApiKeyAuth(),"This method can only be called with API key")}createWebhookResponse(e,t,n){return bt("__isWebhookResponse__",{body:e,statusCode:t,headers:n},e?200:204)}throwWebhookResponse(e){throw bt("__isWebhookResponse__",e,500)}createOpenApiResponse(e,t,n){return bt("__isOpenApiResponse__",{body:e,statusCode:t,headers:n},e?200:204)}throwOpenApiResponse(e){throw bt("__isOpenApiResponse__",e,500)}async convertToSquidFile(e){return{__isSquidFile__:!0,data:new Uint8Array(await e.arrayBuffer()),fieldName:e.name,mimetype:e.type,originalName:e.name,size:e.size,encoding:e.type}}async publishAiStatusUpdate(e,t){const n={type:"aiStatus",agentId:e.agentId,messageId:e.messageId,chatId:e.chatId,jobId:e.jobId,payload:{title:e.title,body:e.body,parentStatusUpdateId:e.parentStatusUpdateId,tags:e.tags}};await this.squid.getNotificationClient().publishSystemNotification(n,[t])}getRequestConfig(){return this.assertInRequestScope(),R(this.config.requestLocalStorage.getStore(),"Failed to access request data outside of the request's scope")}}function wt(e,t){return nt(e,{},t)}function Ct(e,t){const n=Object.getPrototypeOf(t).constructor.name,r=ot().codeDirByServiceClassName.get(n);return S(r,()=>`Caller class codeDir is not set: ${n}`),wt(e,r)}function At(e,t=Oe){return wt(e,R(ot().moduleById.get(t),"Module not found: "+t).codeDir)}function Et(){const e=ot(),t=process.env.SQUID_REGION||"local",n=process.env.SQUID_CONSOLE_REGION,r=Ce(e.appId);return{appId:r.appId,apiKey:e.backendApiKey,squidDeveloperId:r.squidDeveloperId,environmentId:r.environmentId,region:t,consoleRegion:n}}function It(){return l.getInstance(Et())}function St(){return l.getInstance({...Et(),isPassiveMode:!0})}class Rt extends Ot{}class xt{constructor(){F.setIntegrationLifecycleHooks({onIntegrationCreated:this.onIntegrationCreated!==xt.prototype.onIntegrationCreated,onIntegrationDeleted:this.onIntegrationDeleted!==xt.prototype.onIntegrationDeleted,onIntegrationChanged:this.onIntegrationChanged!==xt.prototype.onIntegrationChanged})}get squid(){return It()}metadata(){return F.data}async onIntegrationCreated(e){}async onIntegrationChanged(e){}async onIntegrationDeleted(e){}async cleanup(){for(const e of l.getInstances())await e.destruct()}}class Mt{constructor(e){this.agentId=e.agentId,this.prompt=e.prompt,this.options=e.options}}class Lt{constructor(e){this.integrationId=e.integrationId,this.endpointId=e.endpointId,this.url=e.url,this.method=e.method,this.body=e.body,this.options=e.options}}var Nt;!function(e){e.EVERY_SECOND="* * * * * *",e.EVERY_5_SECONDS="*/5 * * * * *",e.EVERY_10_SECONDS="*/10 * * * * *",e.EVERY_30_SECONDS="*/30 * * * * *",e.EVERY_MINUTE="*/1 * * * *",e.EVERY_5_MINUTES="0 */5 * * * *",e.EVERY_10_MINUTES="0 */10 * * * *",e.EVERY_30_MINUTES="0 */30 * * * *",e.EVERY_HOUR="0 0-23/1 * * *",e.EVERY_2_HOURS="0 0-23/2 * * *",e.EVERY_3_HOURS="0 0-23/3 * * *",e.EVERY_4_HOURS="0 0-23/4 * * *",e.EVERY_5_HOURS="0 0-23/5 * * *",e.EVERY_6_HOURS="0 0-23/6 * * *",e.EVERY_7_HOURS="0 0-23/7 * * *",e.EVERY_8_HOURS="0 0-23/8 * * *",e.EVERY_9_HOURS="0 0-23/9 * * *",e.EVERY_10_HOURS="0 0-23/10 * * *",e.EVERY_11_HOURS="0 0-23/11 * * *",e.EVERY_12_HOURS="0 0-23/12 * * *",e.EVERY_DAY_AT_1AM="0 01 * * *",e.EVERY_DAY_AT_2AM="0 02 * * *",e.EVERY_DAY_AT_3AM="0 03 * * *",e.EVERY_DAY_AT_4AM="0 04 * * *",e.EVERY_DAY_AT_5AM="0 05 * * *",e.EVERY_DAY_AT_6AM="0 06 * * *",e.EVERY_DAY_AT_7AM="0 07 * * *",e.EVERY_DAY_AT_8AM="0 08 * * *",e.EVERY_DAY_AT_9AM="0 09 * * *",e.EVERY_DAY_AT_10AM="0 10 * * *",e.EVERY_DAY_AT_11AM="0 11 * * *",e.EVERY_DAY_AT_NOON="0 12 * * *",e.EVERY_DAY_AT_1PM="0 13 * * *",e.EVERY_DAY_AT_2PM="0 14 * * *",e.EVERY_DAY_AT_3PM="0 15 * * *",e.EVERY_DAY_AT_4PM="0 16 * * *",e.EVERY_DAY_AT_5PM="0 17 * * *",e.EVERY_DAY_AT_6PM="0 18 * * *",e.EVERY_DAY_AT_7PM="0 19 * * *",e.EVERY_DAY_AT_8PM="0 20 * * *",e.EVERY_DAY_AT_9PM="0 21 * * *",e.EVERY_DAY_AT_10PM="0 22 * * *",e.EVERY_DAY_AT_11PM="0 23 * * *",e.EVERY_DAY_AT_MIDNIGHT="0 0 * * *",e.EVERY_WEEK="0 0 * * 7",e.EVERY_WEEKDAY="0 0 * * 1-5",e.EVERY_WEEKEND="0 0 * * 6,7",e.EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT="0 0 1 * *",e.EVERY_1ST_DAY_OF_MONTH_AT_NOON="0 12 1 * *",e.EVERY_2ND_HOUR="0 */2 * * *",e.EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM="0 1-23/2 * * *",e.EVERY_2ND_MONTH="0 0 1 */2 *",e.EVERY_QUARTER="0 0 1 */3 *",e.EVERY_6_MONTHS="0 0 1 */6 *",e.EVERY_YEAR="0 0 1 1 *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM="0 */30 9-17 * * *",e.EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM="0 */30 9-18 * * *",e.EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM="0 */30 10-19 * * *",e.MONDAY_TO_FRIDAY_AT_1AM="0 0 01 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2AM="0 0 02 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3AM="0 0 03 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4AM="0 0 04 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5AM="0 0 05 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6AM="0 0 06 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7AM="0 0 07 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8AM="0 0 08 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9AM="0 0 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_09_30AM="0 30 09 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10AM="0 0 10 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11AM="0 0 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11_30AM="0 30 11 * * 1-5",e.MONDAY_TO_FRIDAY_AT_12PM="0 0 12 * * 1-5",e.MONDAY_TO_FRIDAY_AT_1PM="0 0 13 * * 1-5",e.MONDAY_TO_FRIDAY_AT_2PM="0 0 14 * * 1-5",e.MONDAY_TO_FRIDAY_AT_3PM="0 0 15 * * 1-5",e.MONDAY_TO_FRIDAY_AT_4PM="0 0 16 * * 1-5",e.MONDAY_TO_FRIDAY_AT_5PM="0 0 17 * * 1-5",e.MONDAY_TO_FRIDAY_AT_6PM="0 0 18 * * 1-5",e.MONDAY_TO_FRIDAY_AT_7PM="0 0 19 * * 1-5",e.MONDAY_TO_FRIDAY_AT_8PM="0 0 20 * * 1-5",e.MONDAY_TO_FRIDAY_AT_9PM="0 0 21 * * 1-5",e.MONDAY_TO_FRIDAY_AT_10PM="0 0 22 * * 1-5",e.MONDAY_TO_FRIDAY_AT_11PM="0 0 23 * * 1-5"}(Nt||(Nt={}));class Dt{constructor(e){this.mutex=e}}class Pt{constructor(e){this.isGraphiQL=e.isGraphiQL,this.query=e.query,this.operationName=e.operationName,this.variables=e.variables}}class Gt{constructor(e){this.operation=e.operation,this.graphId=e.graphId,this.threadId=e.threadId,this.input=e.input,this.resumePayload=e.resumePayload}}const $t=["insert","update","delete"];class Wt{constructor(e,t,n){this.mutation=e,this.beforeAndAfterDocs=t,this.serverTimeStamp=n}get before(){return this.beforeAndAfterDocs.before}get after(){return this.beforeAndAfterDocs.after}getMutationType(){return this.mutation.type}affectsPath(e){return!xe(Se(this.before,e),Se(this.after,e))}affectedPaths(e=""){S("update"===this.mutation.type,"affectedPaths can only be used with update mutations");const t=[];return this.checkPath(e,t),t}checkPath(e,t){const n=Se(this.before,e),r=Se(this.after,e);if(!xe(n,r)&&(""!==e&&t.push(e),"object"==typeof n&&null!==n&&"object"==typeof r&&null!==r)){const o=Object.keys(n),i=Object.keys(r);new Set([...o,...i]).forEach(n=>{const r=e?`${e}.${n}`:n;this.checkPath(r,t)})}}}function Yt(e){return{__isWebhookResponse__:!0,body:"",statusCode:204,headers:{},...e}}export{Lt as ApiCallContext,Nt as CronExpression,Dt as DistributedLockContext,j as FUNCTION_AFFINITY_SCOPES,Pt as GraphqlContext,$t as MUTATION_TYPES,U as Meta,Wt as MutationContext,Xe as QueryContext,o as SOURCE_CODE_ANALYZER_MODELS,i as SOURCE_CODE_ANALYZE_FUNCTION_ID,a as SOURCE_CODE_INTEGRATION_TYPES,u as SOURCE_CODE_MAX_REPOSITORIES,s as SOURCE_CODE_MAX_SUPPLEMENTAL_INSTRUCTIONS_LENGTH,c as SOURCE_CONTROL_PROVIDERS,Mt as SecureAiAgentContext,Gt as SecureLangGraphContext,Rt as SquidLlmService,xt as SquidProject,Ot as SquidService,Oe as USER_CODE_MODULE_ID,we as USER_CODE_PYTHON_MODULE_ID,kt as WorkspaceClient,vt as WorkspaceLease,oe as aiFunction,ie as aiFunctionsConfigurator,ve as clientConnectionStateHandler,Yt as createWebhookResponse,ne as eventHandler,re as executable,St as getPassiveSquid,It as getSquid,Ct as getSquidService,mt as isWorkspaceServerConfigured,be as limiterConfigToOptions,de as limits,ge as llmAsk,he as llmService,me as mcpAuthorizer,ye as mcpServer,_e as mcpTool,F as metadata,p as normalizeGitHubRepositorySelection,te as onQueueMessage,K as publicCollection,ue as scheduler,pe as secureAiAgent,V as secureAiQuery,J as secureApi,H as secureCollection,q as secureDatabase,le as secureDistributedLock,ee as secureGraphQL,fe as secureLangGraph,X as secureMetric,ce as secureNativeQuery,z as secureStorage,Z as secureTopic,At as squidInject,ae as trigger,se as webhook};
|