-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle.js.map
1 lines (1 loc) · 713 KB
/
bundle.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/App.fs.js","webpack:///./src/Assets.fs.js","webpack:///./src/Audio.fs.js","webpack:///./src/CrossPlatform/AI.fs.js","webpack:///./src/CrossPlatform/Compression.fs.js","webpack:///./src/CrossPlatform/Game.fs.js","webpack:///./src/CrossPlatform/Map.fs.js","webpack:///./src/CrossPlatform/Ray.fs.js","webpack:///./src/CrossPlatform/Render.fs.js","webpack:///./src/CrossPlatform/Update.fs.js","webpack:///./src/Graphics.Common.fs.js","webpack:///./src/Graphics.fs.js","webpack:///./src/Model.Platform.fs.js","webpack:///./src/Model.fs.js","webpack:///./src/Render.Primitives.fs.js","webpack:///./src/Scene.fs.js","webpack:///./src/Utils.fs.js","webpack:///./src/fable_modules/Fable.SimpleHttp.3.1.0/Http.fs.js","webpack:///./src/fable_modules/Fable.SimpleHttp.3.1.0/Types.fs.js","webpack:///./src/fable_modules/fable-library.3.7.9/Array.js","webpack:///./src/fable_modules/fable-library.3.7.9/Async.js","webpack:///./src/fable_modules/fable-library.3.7.9/AsyncBuilder.js","webpack:///./src/fable_modules/fable-library.3.7.9/BigInt.js","webpack:///./src/fable_modules/fable-library.3.7.9/BigInt/n.js","webpack:///./src/fable_modules/fable-library.3.7.9/BigInt/z.js","webpack:///./src/fable_modules/fable-library.3.7.9/Choice.js","webpack:///./src/fable_modules/fable-library.3.7.9/Date.js","webpack:///./src/fable_modules/fable-library.3.7.9/Decimal.js","webpack:///./src/fable_modules/fable-library.3.7.9/FSharp.Collections.js","webpack:///./src/fable_modules/fable-library.3.7.9/FSharp.Core.js","webpack:///./src/fable_modules/fable-library.3.7.9/Global.js","webpack:///./src/fable_modules/fable-library.3.7.9/Int32.js","webpack:///./src/fable_modules/fable-library.3.7.9/List.js","webpack:///./src/fable_modules/fable-library.3.7.9/Long.js","webpack:///./src/fable_modules/fable-library.3.7.9/Map.js","webpack:///./src/fable_modules/fable-library.3.7.9/Numeric.js","webpack:///./src/fable_modules/fable-library.3.7.9/Option.js","webpack:///./src/fable_modules/fable-library.3.7.9/Random.js","webpack:///./src/fable_modules/fable-library.3.7.9/Range.js","webpack:///./src/fable_modules/fable-library.3.7.9/Reflection.js","webpack:///./src/fable_modules/fable-library.3.7.9/RegExp.js","webpack:///./src/fable_modules/fable-library.3.7.9/Seq.js","webpack:///./src/fable_modules/fable-library.3.7.9/String.js","webpack:///./src/fable_modules/fable-library.3.7.9/System.Text.js","webpack:///./src/fable_modules/fable-library.3.7.9/SystemException.js","webpack:///./src/fable_modules/fable-library.3.7.9/Types.js","webpack:///./src/fable_modules/fable-library.3.7.9/Util.js","webpack:///./src/fable_modules/fable-library.3.7.9/lib/big.js","webpack:///./src/fable_modules/fable-library.3.7.9/lib/long.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA8E;AAC5B;AACR;AAC2B;;AAE9D;;AAEA;AACP;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,8BAA8B,kGAAc,CAAC,sEAAI,OAAO,8DAAS;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD,kBAAkB,yFAAI,8BAA8B,IAAI;AACxD,CAAC;;;;;;;;;;;;;;;;;;;;;;;AChFM;;AAEA;;AAEA,6BAA6B,UAAU;;AAEvC,2BAA2B,UAAU;;AAErC,uBAAuB,UAAU;;AAEjC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,cAAc,OAAO,GAAG,YAAY;AACpC;;;;;;;;;;;;;;AC1BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0E;AACA;AACC;AACc;AACC;AACZ;AAC/B;AACgC;AACnC;;AAE5C,eAAe,8FAAS;;AAExB;AACA,yBAAyB,yFAAO,CAAC,qFAAG,+BAA+B,+FAAW;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB,wFAAM,CAAC,sFAAK,2EAA2E,sFAAK;AACjH;AACA,sCAAsC,kGAAe,CAAC,mEAAa,2BAA2B,2FAAM,CAAC,2FAAM;AAC3G,CAAC,EAAE,0FAAO,MAAM,wDAAW,SAAS,wDAAW,SAAS,wDAAW,SAAS,wDAAW,SAAS,wDAAW,SAAS,wDAAW;;AAExH;AACP,IAAI,qGAAmB;AACvB;;AAEO;AACP,IAAI,qGAAmB;AACvB;;AAEO;AACP,oCAAoC,uFAAI,kBAAkB,0FAAO,MAAM,wDAAW,SAAS,wDAAW,SAAS,wDAAW;AAC1H;;;;;;;;;;;;;;ACrCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2E;AACU;AAC4E;AAC9H;AACmC;;AAEtE,6BAA6B,8FAAS;;AAE/B;AACP,WAAW,uFAAI,+BAA+B,yFAAM;AACpD;;AAEO;AACP;AACA;AACA;AACA;AACA,gCAAgC,8EAAyB,CAAC,wEAAmB;AAC7E,gCAAgC,8EAAyB,CAAC,wEAAmB;AAC7E,eAAe,wEAAmB,CAAC,wEAAmB,KAAK,qDAAQ;AACnE;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,kCAAkC,qDAAQ;AAC1C,iCAAiC,kEAAa;AAC9C,6BAA6B,wEAAmB;AAChD,gBAAgB,uDAAI;AACpB;AACA;AACA,6DAA6D,yFAAM,CAAC,uFAAI,4CAA4C,yFAAM;AAC1H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0FAAO,aAAa,2DAAc,iBAAiB,2DAAc;AAChG;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,uDAAU,MAAM,yFAAM,gCAAgC,kDAAK;AAC9E;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC7FA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAsE;AACM;AACA;;AAErE;AACP;AACA;AACA,IAAI,yFAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yFAAO;AACnB;AACA,aAAa,EAAE,+FAAW;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEO;AACP;AACA;AACA,IAAI,yFAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,sFAAI;AAClD;AACA;AACA,iBAAiB,aAAa,+FAAW;AACzC;AACA;AACA;AACA,8CAA8C,sFAAI;AAClD;AACA;AACA,iBAAiB,aAAa,+FAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;;ACtEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA8E;AACsB;AACnB;AACR;AACjB;AACK;AAChB;;AAE7C,6BAA6B,iDAAI,CAAC,wFAAK,IAAI,wFAAK,QAAQ,mDAAQ,sBAAsB,wFAAK,SAAS,mDAAQ,KAAK,qDAAQ,aAAa,qDAAQ,aAAa,qDAAQ,8BAA8B,wFAAK;;AAE/L;AACP,WAAW,4FAAS,aAAa,4FAAS,MAAM,6DAAU,gBAAgB,4FAAS,MAAM,2EAAY,eAAe,4FAAS,MAAM,mEAAW;AAC9I;AACA;AACA;AACA;AACA,sBAAsB,sEAAmB;AACzC,8BAA8B,iDAAI,8EAA8E,mDAAQ,uFAAuF,0FAAO,EAAE,4DAAS,cAAc,uDAAU,gBAAgB,mEAAW,sCAAsC,4DAAS,cAAc,uDAAU,kBAAkB,mEAAW;AACxX,eAAe,4FAAS,mCAAmC,iEAAW,+FAA+F,iDAAI;AACzK,KAAK;AACL;;;;;;;;;;;;;;ACpBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgF;AACA;AAC0B;AACiD;AAC4M;AAC9P;AACT;AACpB;AACK;AACjC;AACI;AACY;;AAEzD,+BAA+B,2FAAe;AACrD;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU,uDAAuD,mGAAU;AACtF;;AAEA;AACA,SAAS,yFAAM;AACf,aAAa,yFAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yFAAM;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEO,sDAAsD,2FAAe;AAC5E;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU,qGAAqG,mGAAU;AACpI;;AAEA;AACA,SAAS,yFAAM;AACf,aAAa,yFAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yFAAM;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEO,mCAAmC,2FAAe;AACzD;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU,+DAA+D,mGAAU;AAC9F;;AAEA;AACA,SAAS,yFAAM;AACf,aAAa,yFAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yFAAM;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,sFAAG,UAAU,sFAAG;AAC3B;AACA,uBAAuB,iDAAI,QAAQ,iDAAI;AACvC;AACA;AACA,uBAAuB,iDAAI;AAC3B;AACA,KAAK;AACL;;AAEO;AACP;AACA;;AAEA;AACA;AACA,WAAW,wFAAM,CAAC,qFAAK,eAAe,qFAAK,CAAC,kFAAO,EAAE,wFAAM,+BAA+B,qFAAK,yFAAyF,+FAAW,wBAAwB,+FAAW;AACtO;;AAEA;AACA,yBAAyB,sFAAI,6BAA6B,sFAAI;AAC9D;AACA;AACA;AACA,2DAA2D,qDAAQ,qCAAqC,qDAAQ,qCAAqC,qDAAQ,oCAAoC,qDAAQ,eAAe,qDAAQ;AAChO;AACA,2BAA2B,mDAAM,KAAK,qDAAQ,kDAAkD,mFAA8B,CAAC,+EAA0B;AACzJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,qBAAqB,+FAAW,0BAA0B,+FAAW;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,4FAAS;AACpB;AACA,eAAe,4FAAS,MAAM,8DAAS,CAAC,uDAAQ,cAAc,4FAAS,MAAM,8DAAS,CAAC,sDAAO;AAC9F;AACA,mBAAmB,4FAAS,8VAA8V,wDAAG,IAAI,6BAA6B,mXAAmX,mDAAM,KAAK,sEAAU,8BAA8B,yEAAa,+BAA+B,sEAAU,8BAA8B,yEAAa,+BAA+B,sEAAU,8BAA8B,yEAAa;AACz/B;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;;AAEO;AACP,2BAA2B,sFAAI;AAC/B,+BAA+B,sFAAI,CAAC,0FAAO;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yFAAM,MAAM,4FAAW,KAAK,iDAAI,QAAQ,iDAAI;AACxE;AACA;AACA;AACA;AACA,gDAAgD,0DAAa;AAC7D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA,gDAAgD,0DAAa;AAC7D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA,iDAAiD,0DAAa;AAC9D;AACA;AACA;AACA;AACA,0CAA0C,sDAAS,uCAAuC,uDAAU;AACpG,4BAA4B,yFAAM,MAAM,4FAAW,KAAK,iDAAI,IAAI,yFAAM,iBAAiB,yFAAM,aAAa,4FAAW;AACrH;AACA;AACA,4BAA4B,yFAAM,MAAM,4FAAW,KAAK,iDAAI;AAC5D;AACA;AACA,SAAS,IAAI,wFAAK,mBAAmB,+FAAW;AAChD,gBAAgB,yFAAM,eAAe,4FAAW;AAChD,KAAK,GAAG,wFAAK,IAAI,wFAAK,KAAK,+FAAW;AACtC;AACA,0BAA0B,6FAAU,wBAAwB,6FAAU;AACtE;AACA;AACA,uBAAuB,iDAAI,QAAQ,iDAAI,GAAG,0FAAO,kBAAkB,8FAAW,mFAAmF,0FAAO,kBAAkB,8FAAW,iHAAiH,0FAAO,kBAAkB,8FAAW,mFAAmF,0FAAO,kBAAkB,8FAAW;AACjd;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,6BAA6B,qDAAQ;AACrC,mBAAmB,kDAAK,gBAAgB,4DAAiB,WAAW,qFAAgC,6CAA6C,8FAAyC,mEAAmE,wFAAK;AAClQ;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,+BAA+B,qDAAQ;AACvC;AACA;AACA,SAAS,uBAAuB,wFAAK,sHAAsH,2DAAc;AACzK;AACA,uBAAuB,+FAAY,4BAA4B,0FAAO,wBAAwB,0FAAO,oBAAoB,sDAAS;AAClI,qBAAqB,+FAAY,4BAA4B,0FAAO,wBAAwB,0FAAO,uBAAuB,sDAAS;AACnI,oBAAoB,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,uBAAuB,sDAAS;AACnI,wBAAwB,+FAAY,6BAA6B,0FAAO,6BAA6B,0FAAO,4BAA4B,sDAAS;AACjJ,yBAAyB,+FAAY,6BAA6B,0FAAO,6BAA6B,0FAAO,uBAAuB,sDAAS;AAC7I,sBAAsB,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,uBAAuB,sDAAS;AACrI,yBAAyB,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,kBAAkB,sDAAS;AACnI,4BAA4B,+FAAY,6BAA6B,0FAAO,kCAAkC,wFAAK,QAAQ,sDAAS;AACpI,wBAAwB,+FAAY,6BAA6B,0FAAO,4CAA4C,0FAAO,uBAAuB,sDAAS;AAC3J,sBAAsB,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,kBAAkB,sDAAS;AAChI,wBAAwB,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,uBAAuB,sDAAS;AACvI,6BAA6B,+FAAY,6BAA6B,0FAAO,wBAAwB,0FAAO,4BAA4B,sDAAS;AACjJ,kBAAkB,wFAAM;AACxB;AACA;AACA,mCAAmC,qDAAQ;AAC3C,uBAAuB,uDAAU,mDAAmD,4DAAiB,aAAa,qFAAgC,+CAA+C,8FAAyC;AAC1O;AACA;AACA,mBAAmB,wFAAK,aAAa,uDAAU;AAC/C;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,2DAAc,2BAA2B,sFAAG,CAAC,kFAAO;AACnE;;AAEO;AACP,sCAAsC,wFAAM,CAAC,qFAAK;AAClD;AACA;AACA,uBAAuB,yDAAY,CAAC,yFAAM,aAAa,+FAAW,4BAA4B,+FAAW;AACzG;AACA;AACA,uBAAuB,yDAAY,aAAa,+FAAW;AAC3D;AACA;AACA,uBAAuB,yDAAY,aAAa,+FAAW;AAC3D;AACA;AACA,uBAAuB,yDAAY,aAAa,+FAAW;AAC3D;AACA;AACA;;;;;;;;;;;;;;ACpTA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwG;AACzB;AACzC;AAC8B;;AAE7D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sFAAI,CAAC,2FAAS,aAAa,sFAAI,CAAC,0FAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4HAA4H,iDAAI,8CAA8C,iDAAI;AAClL;AACA;AACA;AACA;AACA,sCAAsC,uFAAI,UAAU,uFAAI,+FAA+F,uFAAI,gNAAgN,yFAAM,cAAc,iDAAI,8DAA8D,yFAAM,cAAc,iDAAI,iSAAiS,yFAAM,cAAc,iDAAI;AAClxB;AACA;AACA,KAAK,iEAAiE,iDAAI,MAAM,oGAAkB;AAClG;AACA;;;;;;;;;;;;;;AC3CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmG;AACwK;AACxO;AACmF;AACV;AAChC;AACW;AACN;AACJ;;AAEtE;AACP;AACA;AACA;AACA;AACA,WAAW,sFAAI;AACf;AACA,iCAAiC,qDAAQ;AACzC,6BAA6B,uDAAI;AACjC;AACA;AACA;AACA,4CAA4C,yFAAM,CAAC,uFAAI;AACvD,kCAAkC,yFAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,6CAA6C,uFAAI,UAAU,uFAAI;AAC/D;AACA,uBAAuB,sFAAG,CAAC,4FAAiB;AAC5C,qBAAqB,sFAAG,CAAC,4FAAiB;AAC1C,6BAA6B,uFAAI,UAAU,uFAAI;AAC/C;AACA;AACA;AACA;AACA,uEAAuE,yDAAY;AACnF,wCAAwC,yFAAM,WAAW,iDAAI,mCAAmC,yDAAY,sDAAsD,yFAAM,WAAW,iDAAI,mCAAmC,yDAAY,gEAAgE,yFAAM,WAAW,iDAAI;AAC3T;AACA,kCAAkC,0DAAa;AAC/C;AACA;AACA,gBAAgB,yFAAO;AACvB,mGAAmG,0DAAa;AAChH,iBAAiB,EAAE,+FAAW;AAC9B;AACA;AACA;AACA,6BAA6B,uFAAI;AACjC,gCAAgC,yFAAM,WAAW,iDAAI;AACrD;AACA,oCAAoC,0DAAa;AACjD;AACA,oFAAoF,sFAAG,CAAC,4FAAiB,OAAO,yDAAY,0CAA0C,yDAAY;AAClL,gBAAgB,yFAAO;AACvB,2GAA2G,0DAAa;AACxH,iBAAiB,EAAE,+FAAW;AAC9B;AACA;AACA;AACA;AACA;AACA,mBAAmB,gEAAmB,CAAC,yFAAM,0BAA0B,4FAAS;AAChF,KAAK,MAAM,gEAAmB,CAAC,wFAAK,2BAA2B,+FAAW;AAC1E;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,6DAA6D,4DAAe;AAC5E,kDAAkD,4DAAe;AACjE,eAAe,gEAAmB,kHAAkH,uFAAM,CAAC,0FAAO;AAClK;AACA;AACA,4BAA4B,oFAA+B;AAC3D,4BAA4B,oFAA+B;AAC3D;AACA;AACA;AACA;AACA,+BAA+B,sFAAG,CAAC,4FAAiB,UAAU,0GAAsB;AACpF,6BAA6B,sFAAG,CAAC,4FAAiB;AAClD;AACA,+BAA+B,sFAAG,CAAC,4FAAiB,UAAU,0GAAsB;AACpF,6BAA6B,sFAAG,CAAC,4FAAiB;AAClD;AACA;AACA;AACA;AACA,+BAA+B,uEAAkB,MAAM,+FAAU,CAAC,wFAAG;AACrE;AACA,yCAAyC,qEAAgB;AACzD,mDAAmD,wEAAmB,KAAK,qDAAQ;AACnF,gDAAgD,qDAAQ;AACxD,mCAAmC,qDAAQ;AAC3C,4DAA4D,+FAAU,CAAC,gGAAY,4FAA4F,yFAAO,CAAC,qFAAK;AAC5L;AACA;AACA,gCAAgC,8EAAyB,qDAAqD,8EAAyB;AACvI,qBAAqB,EAAE,+FAAW;AAClC,iBAAiB,uDAAuD,uFAAI;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0DAAa;AAC3C,sEAAsE,sFAAI;AAC1E,+DAA+D,0GAAsB;AACrF,oGAAoG,uFAAI;AACxG;AACA,wBAAwB,yFAAO;AAC/B;AACA;AACA;AACA;AACA,yBAAyB,EAAE,+FAAW;AACtC,6BAA6B,oFAA+B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB,+FAAW;AAC1C;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA,qBAAqB,oFAA+B,CAAC,uFAAI;AACzD;;;;;;;;;;;;;;ACtKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAsE;AACyC;AACuV;AAC7W;AACC;AACrD;;AAErC;;AAEA;;AAEA;;AAEA;;AAEA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,yFAAI;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uFAAI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iDAAI,gGAAgG,mDAAQ,KAAK,qDAAQ,aAAa,uFAAI,8BAA8B,uFAAI,qEAAqE,uFAAI,WAAW,uFAAI;AACvR;AACA;AACA;AACA,gCAAgC,+EAA0B;AAC1D;AACA;AACA,mBAAmB,iDAAI,wGAAwG,mDAAQ,KAAK,qDAAQ,CAAC,yFAAM,CAAC,uFAAI,mCAAmC,uFAAI,2BAA2B,iDAAI,4CAA4C,yFAAM,CAAC,uFAAI,WAAW,uFAAI,mDAAmD,iDAAI;AACnW;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,iDAAI,wGAAwG,mDAAQ,6BAA6B,qDAAQ,oOAAoO,qDAAQ;AAC/Z;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,mDAAQ,8HAA8H,6FAAU;AACnK;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,0BAA0B,uFAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,yDAAY;AAClD,YAAY,oEAAe,KAAK,wDAAW;AAC3C,6BAA6B,iDAAI;AACjC;AACA;AACA;AACA;AACA,uFAAuF,sFAAiC,kGAAkG,iDAAI,4DAA4D,yDAAY,sNAAsN,iDAAI,4DAA4D,yDAAY,8JAA8J,iDAAI;AAC1uB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAI,aAAa,6FAAU;AAC7C;AACA,mBAAmB,yDAAO,2DAA2D,uDAAU,2IAA2I,uDAAU,IAAI,uEAAkB,mOAAmO,4FAAuC,SAAS,kDAAK,sDAAsD,4DAAiB,6RAA6R,2DAAc,uDAAuD,yFAAM,2EAA2E,kDAAK,uPAAuP,kDAAK;AAC7xC;AACA,eAAe,+FAA0C,sBAAsB,oFAA+B,qCAAqC,8FAAyC,yBAAyB,oFAA+B,oBAAoB,4DAAiB,yBAAyB,qFAAgC,CAAC,oFAA+B;AAClX,KAAK;AACL;AACA;AACA,6BAA6B,uFAAI,kBAAkB,uFAAI;AACvD;AACA;AACA;AACA,gBAAgB,uFAAI;AACpB,gBAAgB,oEAAe,KAAK,wDAAW;AAC/C,sCAAsC,uFAAI;AAC1C,oCAAoC,sDAAS,8DAA8D,uDAAU;AACrH;AACA;AACA,+BAA+B,uFAAI;AACnC;AACA,0BAA0B,iDAAI,mIAAmI,6FAAU;AAC3K;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAI,mIAAmI,sFAAG;AAC5J;AACA;AACA;AACA;AACA;AACA,+BAA+B,sDAAS,0DAA0D,uDAAU;AAC5G;AACA;AACA,+BAA+B,sDAAS;AACxC;AACA;AACA;AACA;AACA,oBAAoB,oEAAe,KAAK,wDAAW;AACnD,+BAA+B,sDAAS,0DAA0D,uDAAU;AAC5G;AACA;AACA,+BAA+B,sDAAS;AACxC;AACA;AACA;AACA;AACA,+BAA+B,sDAAS,0DAA0D,uDAAU;AAC5G;AACA;AACA,+BAA+B,sDAAS;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,iDAAI,aAAa,mGAAgB,QAAQ,oFAA+B;AACvF,iBAAiB,4FAAiB;AAClC,KAAK;AACL;;;;;;;;;;;;;;AC1OA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA+E;AACA;AACV;AACxB;AACO;AAC0B;AACE;AACtC;;AAEnC,2CAA2C,2FAAe;AACjE;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU,0FAA0F,mGAAU;AACzH;;AAEA;AACA,SAAS,yFAAM;AACf,aAAa,yFAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yFAAM;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEO;;AAEA;AACP;AACA;AACA;AACA;AACA,eAAe,yDAAY;AAC3B;;AAEO;AACP,0CAA0C,yDAAW;AACrD;;AAEO;AACP;AACA;AACA;;AAEO;AACP,IAAI,+EAAiB;AACrB;;AAEO;AACP,WAAW,+EAAiB;AAC5B;;AAEO;AACP,WAAW,4FAAS,aAAa,4FAAS,MAAM,8DAAS,CAAC,mDAAK;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4FAAS;AACxB,KAAK;AACL;;;;;;;;;;;;;;ACjFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgF;AACG;AACd;AACL;AACf;AAC0B;AACU;AAChB;AACY;AACpB;;AAEtD;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,WAAW,4FAAS;AACpB;AACA;AACA,+BAA+B,wFAAI;AACnC,QAAQ,yFAAO;AACf;AACA,sCAAsC,uEAAiB,mBAAmB,yDAAW;AACrF;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6DAAO;AACxD,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,6DAAO;AACpD,aAAa;AACb,SAAS,EAAE,+FAAW;AACtB,eAAe,4FAAS,SAAS,4FAAS,aAAa,4FAAQ;AAC/D,oBAAoB,iFAAM;AAC1B,yBAAyB,yFAAc;AACvC,SAAS,GAAG,4FAAS,aAAa,4FAAS,MAAM,yFAAK,aAAa,4FAAS,cAAc,4FAAS,aAAa,4FAAS,QAAQ,uFAAG,CAAC,kFAAO;AAC5I,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA,IAAI,yFAAO;AACX,QAAQ,yFAAO;AACf,yCAAyC,uEAAQ;AACjD,gBAAgB,uEAAQ;AACxB;AACA,SAAS,EAAE,+FAAW;AACtB,KAAK,EAAE,+FAAW;AAClB;AACA;AACA;AACA;;;;;;;;;;;;;;AC7EA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAsE;AAC2D;;AAE1H,sBAAsB,kFAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,2DAA2D,mGAAU,gCAAgC,4FAAW,qBAAqB,mGAAU,gCAAgC,2FAAU,eAAe,2FAAU,cAAc,2FAAU;AAChQ;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;;;;;;;;;;;;;ACzBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6E;AAC4H;AAC7I;AACe;;AAEpE,kCAAkC,kFAAM;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,+EAA+E,kGAAS,CAAC,6FAAY,4BAA4B,mGAAU,CAAC,2FAAU,EAAE,2FAAU,sCAAsC,6FAAY,wCAAwC,oGAAW,CAAC,2FAAU;AACxS;;AAEO,uBAAuB,kFAAM;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,mDAAmD,6FAAY,UAAU,6FAAY;AAC3G;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP,aAAa,OAAO,SAAS,QAAQ,SAAS,EAAE;AAChD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO,mBAAmB,iFAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,mBAAmB,kFAAM;AAChC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,+DAA+D,2FAAU,4BAA4B,2FAAU;AACrI;;AAEO,0BAA0B,iFAAK;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,4BAA4B,iFAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,yBAAyB,iFAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,wBAAwB,kFAAM;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,+DAA+D,2FAAU,kGAAkG,6FAAY,qCAAqC,6FAAY,mBAAmB,mGAAU,CAAC,2FAAU,EAAE,2FAAU;AAClT;;AAEO,mBAAmB,iFAAK;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU,6EAA6E,2FAAU;AAC5G;;AAEO,wBAAwB,iFAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,6BAA6B,iFAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,8BAA8B,kFAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,kLAAkL,6FAAY,mBAAmB,2FAAU,2BAA2B,0FAAS;AACrR;;AAEO,oBAAoB,kFAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,oJAAoJ,oGAAW,wCAAwC,oGAAW,CAAC,2FAAU,2BAA2B,kGAAS,CAAC,2FAAU,4BAA4B,kGAAS,CAAC,2FAAU,qBAAqB,2FAAU,sBAAsB,2FAAU,6BAA6B,2FAAU,mCAAmC,6FAAY;AACve;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,yBAAyB,iFAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO,2BAA2B,kFAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,gEAAgE,kGAAS,CAAC,gFAAkB,uBAAuB,2FAAU,cAAc,2FAAU,kBAAkB,0FAAS;AACtM;;AAEO;AACP,WAAW,yFAAM;AACjB;;AAEO;AACP,WAAW,uFAAI;AACf;;AAEO,yBAAyB,iFAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,mGAAU;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,qBAAqB,kFAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,kDAAkD,2FAAU,cAAc,2FAAU,cAAc,6FAAY,0BAA0B,2FAAU,kBAAkB,2FAAU,eAAe,kGAAS;AAC5N;;AAEO,qBAAqB,kFAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,qKAAqK,6FAAY;AACvM;;AAEO,2BAA2B,kFAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,+DAA+D,4FAAW,mBAAmB,4FAAW,kBAAkB,4FAAW,uBAAuB,4FAAW;AAC7L;;AAEO,qBAAqB,kFAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,oGAAW,oDAAoD,2FAAU,cAAc,mGAAU,wCAAwC,mGAAU,wCAAwC,mGAAU;AAChN;;AAEO,6BAA6B,kFAAM;AAC1C;AACA;AACA;AACA;AACA;AAC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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiE;AACqC;AACpD;;AAE3C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,uDAAI;AACnB;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,yBAAyB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;AAEO;AACP,oBAAoB,oDAAK,CAAC,0DAAiB;AAC3C;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,8BAA8B;AAC3D;AACA;AACA;AACA;AACA,+BAA+B,gCAAgC;AAC/D;AACA,+BAA+B,yBAAyB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP,uBAAuB,8DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA,uBAAuB,8DAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,6BAA6B,kCAAkC;AAC/D;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB,6DAAU;AAC9B;AACA,4CAA4C,wDAAO;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wDAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA,sBAAsB,wDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,mBAAmB,yBAAyB;AAC5C;AACA;AACA;;AAEO;AACP,mBAAmB,yBAAyB;AAC5C;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEO;AACP,oBAAoB,6DAAU;AAC9B,oBAAoB,6DAAU;AAC9B;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,sBAAsB;AACzC,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sDAAsD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,eAAe,uDAAI;AACnB;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,uDAAI;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,uDAAI;AACnB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,gBAAgB,oDAAK,CAAC,0DAAiB;AACvC;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oDAAK,CAAC,0DAAiB;AAChD;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA,kDAAkD,oDAAK,CAAC,0DAAiB;AACzE;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;;;;;;;;;;;;;;AC5yCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuE;AACjB;AACJ;AACA;AACE;AACuB;AACnB;AACxD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sEAAa;AACxB;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP,WAAW,sEAAa;AACxB;AACO;AACP,sBAAsB,kEAAiB;AACvC;AACA,0BAA0B,gBAAgB,EAAE;AAC5C;AACA;AACA;AACO;AACP;AACA;AACO;AACP,sBAAsB,gBAAgB,EAAE;AACxC;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,sEAAa;AACxB;AACA;AACA;AACA,4BAA4B,oEAAgB;AAC5C,SAAS;AACT;AACA;AACA,6BAA6B,uEAAsB;AACnD,SAAS;AACT,KAAK;AACL;AACO;AACP;AACA,uCAAuC,sEAAa,+CAA+C,wEAAe;AAClH;AACA;AACA;AACA;AACA;AACA,WAAW,sEAAa,UAAU,wEAAe;AACjD;AACO;AACP,wFAAwF,uEAAsB;AAC9G;AACA;AACO;AACP,WAAW,sEAAa;AACxB;AACO,qCAAqC,kEAAiB;AACtD;AACP,WAAW,sEAAa;AACxB;AACA,4CAA4C,wEAAqB;AACjE,2CAA2C,wEAAqB;AAChE;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACO;AACP,WAAW,sEAAa;AACxB;AACO;AACP,WAAW,sEAAa,sBAAsB,wEAAe;AAC7D;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,WAAW,sEAAa;AACxB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,6BAA6B,uEAAsB;AACnD,SAAS;AACT,KAAK;AACL;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,2DAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACe,oEAAK,EAAC;;;;;;;;;;;;;AC7JrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY,sBAAsB,EAAE;AACpD;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb,SAAS;A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CL;;AAEO;;AAEA;;AAEA;;AAEA;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,WAAW,4DAAW;AACtB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,mBAAmB,yDAAQ;AAC3B;AACA;AACA,oBAAoB,4DAAW;AAC/B;AACA;AACA;AACA;AACA,mBAAmB,4DAAW,uBAAuB,4DAAW;AAChE;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;;AAEA;;AAEA;;AAEA,8BAA8B,yDAAQ;;AAEtC,iCAAiC,yDAAQ;;AAEzC,+BAA+B,yDAAQ;;AAEvC;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,+BAA+B,sDAAI;AACnC;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;;AAEA;;AAEA;;AAEA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kCAAkC;AACzD;AACA;AACA;AACA;AACA;;AAEO;AACP,iBAAiB,wDAAO,IAAI,yDAAQ,sBAAsB,yDAAQ;AAClE;AACA,mBAAmB,oCAAoC;AACvD,2BAA2B,sDAAK,CAAC,2DAAU,CAAC,4DAAW;AACvD;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,eAAe,4DAAW;AAC1B;AACA;AACA,kBAAkB,yDAAQ;AAC1B,iCAAiC,QAAQ;AACzC,kBAAkB,4DAAW,CAAC,4DAAW,yBAAyB,4DAAW;AAC7E;AACA;AACA;AACA;;AAEO;;AAEA;;AAEA;AACP;AACA;;AAEO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,kBAAkB,4DAAW,CAAC,4DAAW;AACzC,oBAAoB,4DAAW;AAC/B,wBAAwB,sDAAK,CAAC,8DAAa;AAC3C;AACA,YAAY,wDAAO,MAAM,yDAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,gBAAgB,4DAAW;AAC3B,mBAAmB,oBAAoB;AACvC,gDAAgD,4DAAW,MAAM,4DAAW;AAC5E;AACA;AACA;;AAEO;AACP;AACA,gBAAgB,4DAAW,CAAC,4DAAW,eAAe,4DAAW;AACjE,mCAAmC,sDAAK,CAAC,8DAAa;AACtD,mCAAmC,sDAAK,CAAC,4DAAW;AACpD;AACA;;AAEO;AACP;AACA;AACA;AACA,YAAY,wDAAO,IAAI,yDAAQ;AAC/B,wBAAwB,4DAAW;AACnC,2CAA2C,sDAAK,CAAC,8DAAa;AAC9D;AACA,oBAAoB,4DAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,gBAAgB,4DAAW;AAC3B,YAAY,yDAAQ;AACpB,mBAAmB,eAAe;AAClC,oBAAoB,4DAAW,CAAC,4DAAW,iCAAiC,4DAAW;AACvF,uCAAuC,sDAAK,CAAC,8DAAa;AAC1D,YAAY,4DAAW;AACvB;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,oBAAoB;AACvC,oBAAoB,4DAAW;AAC/B,gBAAgB,yDAAQ;AACxB;AACA,uBAAuB,oBAAoB;AAC3C,wBAAwB,4DAAW;AACnC,wBAAwB,4DAAW,CAAC,4DAAW,CAAC,4DAAW,uBAAuB,4DAAW;AAC7F,yBAAyB,sDAAK,CAAC,8DAAa;AAC5C,gBAAgB,4DAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,oCAAoC,gDAAM;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,kEAAW,4EAA4E,yDAAU,iBAAiB,yDAAU,SAAS,yDAAU,YAAY,yDAAU,YAAY,yDAAU,aAAa,yDAAU,cAAc,iEAAU,CAAC,yDAAU;AAChQ;;AAEO;AACP,2HAA2H,4DAAU;AACrI;;AAEO;;AAEA;AACP;AACA,oCAAoC,yDAAQ;AAC5C,2BAA2B,4DAAW,OAAO,4DAAW;AACxD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,6BAA6B,4DAAU;;AAEvC,+BAA+B,4DAAU;;AAEzC,kCAAkC,4DAAU,kDAAkD,yDAAQ;;AAEtG;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,iBAAiB,sDAAI;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,4DAAW,CAAC,4DAAW;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;;AAEA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;;AAEA;;AAEA;;AAEA;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA,YAAY,4DAAW,MAAM,4DAAW;AACxC,YAAY,wDAAO,IAAI,yDAAQ;AAC/B;AACA;AACA;AACA,qBAAqB,sDAAK,CAAC,8DAAa;AACxC,kBAAkB,4DAAW;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB,4DAAW,MAAM,yDAAQ;AAC3C;AACA;AACA,gBAAgB,4DAAW,MAAM,4DAAW,MAAM,4DAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA,YAAY,4DAAW,MAAM,4DAAW;AACxC,YAAY,wDAAO,IAAI,yDAAQ;AAC/B;AACA;AACA;AACA,qBAAqB,sDAAK,CAAC,8DAAa;AACxC,kBAAkB,4DAAW;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB,4DAAW,MAAM,yDAAQ;AAC3C;AACA;AACA,gBAAgB,4DAAW,MAAM,4DAAW,MAAM,4DAAW;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8EAA8E,sDAAK,CAAC,4DAAW,CAAC,4DAAW,CAAC,4DAAW,CAAC,4DAAW,8CAA8C,4DAAW,2BAA2B,4DAAW,0FAA0F,sDAAK,CAAC,4DAAW,CAAC,4DAAW,CAAC,4DAAW,CAAC,4DAAW,8CAA8C,4DAAW,2BAA2B,4DAAW,CAAC,4DAAW,sBAAsB,yDAAQ;AAC1f;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;;AAEA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,yDAAQ;AAC3B;AACA;AACA,mBAAmB,4DAAW;AAC9B;AACA;AACA;AACA,mBAAmB,4DAAW,CAAC,4DAAW,uDAAuD,6DAAY,CAAC,4DAAW;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,4DAAW,CAAC,4DAAW,CAAC,4DAAW,yDAAyD,6DAAY,CAAC,4DAAW,sFAAsF,6DAAY,CAAC,4DAAW;AACrP;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qDAAI;AAC3B;AACA;AACA,4BAA4B,qDAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAO;AACxB,gCAAgC,qDAAI;AACpC,8DAA8D,qDAAI;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,qDAAI,CAAC,8DAAa;AAC7C;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAK,aAAa,sDAAK;AAC1D,QAAQ,wDAAO;AACf;AACA;AACA;AACA,eAAe,uDAAI,KAAK,wDAAO;AAC/B;AACA;;AAEO;AACP;AACA,QAAQ,gEAAa;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC16CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAwoB;AACzlB;AACD;AACL;AACkF;AACtE;AACjB;;AAE7B,yBAAyB,gDAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iEAAmB,sCAAsC,mEAAqB;AACrG;AACA;AACA;AACA;AACA;AACA,uBAAuB,mEAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0DAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU,0CAA0C,iEAAU;AACzE;;AAEO;AACP;AACA;;AAEA;AACA;AACA,6BAA6B,4DAAU,sBAAsB,0DAAoB;AACjF;AACA;AACA;AACA,CAAC;;AAEM;AACP,QAAQ,kEAAoB,QAAQ,mEAAqB;AACzD,sCAAsC,mEAAqB;AAC3D;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gEAAkB;AACrC;AACA;AACA,mBAAmB,gEAAkB;AACrC;AACA;AACA,gBAAgB,iEAAmB;AACnC,uBAAuB,iEAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAmB;AACnC,uBAAuB,iEAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA;AACA;AACA;AACA,iBAAiB,iEAAmB;AACpC;AACA;AACA;AACA,wBAAwB,iEAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iEAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iEAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA,iBAAiB,iEAAmB;AACpC;AACA;AACA;AACA,wBAAwB,iEAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iEAAmB;AACvC;AACA;AACA,oBAAoB,iEAAmB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,6CAA6C,+DAAiB;AAC9D;AACA;;AAEO;AACP,WAAW,0DAAQ;AACnB;;AAEO;AACP;AACA,qEAAqE,kEAAoB;AACzF;AACA;AACA,sEAAsE,kEAAoB,CAAC,iEAAgB,CAAC,4DAAW;AACvH;AACA;AACA,sEAAsE,kEAAoB,CAAC,wEAAsB;AACjH;AACA;;AAEO;AACP,QAAQ,wDAAO,IAAI,yDAAQ;AAC3B,qEAAqE,kEAAoB;AACzF;AACA,aAAa,uDAAM,IAAI,yDAAQ;AAC/B,sEAAsE,8DAAgB,CAAC,kEAAoB,CAAC,yDAAQ,kCAAkC,sDAAgB;AACtK;AACA;AACA,sEAAsE,kEAAoB,CAAC,iEAAgB;AAC3G;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,0CAA0C,wEAAsB;AAChE;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,0CAA0C,wEAAsB,8BAA8B,gEAAkB,CAAC,wEAAsB;AACvI;AACA;AACA,sEAAsE,gEAAkB;AACxF;AACA;;AAEO;AACP,QAAQ,8DAAgB;AACxB,yCAAyC,8DAAgB;AACzD;AACA;AACA,yCAAyC,8DAAgB;AACzD;AACA;;AAEO;AACP,qCAAqC,8DAAgB;AACrD;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,iEAAmB;AAClC;AACA;;AAEO;AACP;AACA,eAAe,gEAAkB;AACjC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8DAAgB;AAClC;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iEAAmB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,qCAAqC,iEAAmB;AACxD;;AAEO;AACP,qCAAqC,gEAAkB;AACvD;;AAEO;AACP,qCAAqC,iEAAmB;AACxD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,8DAAgB;AACzD;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA,gBAAgB,iEAAmB;AACnC,uBAAuB,iEAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA;AACA;AACA;AACA,gBAAgB,iEAAmB;AACnC,uBAAuB,iEAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA,mBAAmB,iEAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,iEAAmB,CAAC,8DAAgB,0BAA0B,sDAAgB,qCAAqC,8DAAgB;AAC7K;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,kBAAkB,mEAAqB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,mEAAqB;AACpC;AACA;;AAEO;AACP;AACA,eAAe,yDAAQ;AACvB;AACA;AACA,kBAAkB,mEAAqB;AACvC,YAAY,wDAAO,IAAI,0DAAS,CAAC,yDAAQ;AACzC,mBAAmB,4DAAW,CAAC,4DAAW,wCAAwC,0DAAS;AAC3F;AACA,wDAAwD,uDAAM,IAAI,0DAAS,CAAC,4DAAW,CAAC,yDAAQ,iCAAiC,yDAAQ;AACzI,mBAAmB,yDAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,eAAe,yDAAQ;AACvB;AACA;AACA,eAAe,mEAAqB;AACpC;AACA;;AAEO;AACP;AACA;AACA;AACA,oBAAoB,kEAAoB;AACxC;AACA;AACA;AACA;AACA;AACA,mBAAmB,kEAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,eAAe,mDAAO;AACtB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mEAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mEAAqB;AAClE;AACA;AACA;AACA,yCAAyC,mEAAqB;AAC9D;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,kEAAoB;AACnC;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,yCAAyC,oEAAsB;AAC/D;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;;;;;;;;;;;;;AChlCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACU;AACV;;AAE5B,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO,6BAA6B,+CAAK;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,eAAe,uDAAI;AACnB;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,eAAe,uDAAI;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AChKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACkG;AAC/B;AAC5D;AACP;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAY;AACpB,QAAQ,6DAAY;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAY;AAC3B,YAAY,6DAAY;AACxB,YAAY,6DAAY;AACxB,YAAY,6DAAY;AACxB,YAAY,6DAAY;AACxB,YAAY,6DAAY;AACxB,YAAY,6DAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP,YAAY,0DAAS;AACrB,+CAA+C;AAC/C,wBAAwB,6EAA4B;AACpD;AACA;AACA;AACA;AACA,yCAAyC,2DAAU;AACnD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,2DAAU;AACpD;AACA;AACO;AACP,WAAW,6EAA4B,iBAAiB,2DAAU;AAClE;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA,2DAA2D,MAAM;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO,gBAAgB,qDAAY;AAC5B,kBAAkB,qDAAY;AAC9B;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACe,uEAAQ,EAAC;;;;;;;;;;;;;ACpbxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACI;AACxB,kHAAO,EAAC;AAChB,qBAAqB,mDAAO;AAC5B,oBAAoB,mDAAO;AAC3B,yBAAyB,mDAAO;AAChC,yBAAyB,mDAAO;AAChC,yBAAyB,mDAAO;AAChC;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP,mBAAmB,mDAAO;AAC1B;AACA;AACA;AACO;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACO;AACP;AACA,gCAAgC,mDAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACO;AACP,yBAAyB,mDAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA,uBAAuB,cAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mDAAO;AAC3B;AACA;AACA;AACA,kBAAkB,mDAAO;AACzB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;;;;;;;;;;;;ACrLA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0E;;AAEnE;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEO;AACP,sCAAsC,uDAAc,EAAE,+CAAM;AAC5D;;AAEO;AACP,sCAAsC,qDAAY;AAClD;;AAEO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEO;AACP,2CAA2C,gDAAO;AAClD;;;;;;;;;;;;;;AC/BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgE;AACiC;AAC9B;;AAE5D;AACP;AACA,eAAe,uDAAM;AACrB,KAAK;AACL;AACA,eAAe,+DAAc;AAC7B,KAAK;AACL;;AAEO;AACP;AACA,eAAe,uDAAM;AACrB,KAAK;AACL;AACA,eAAe,+DAAc;AAC7B,KAAK;AACL;;AAEO;AACP,WAAW,4FAA6B;AACxC;;AAEO;AACP,WAAW,4FAA6B;AACxC;;AAEO;AACP,WAAW,sFAAuB;AAClC;;AAEO;AACP,WAAW,sFAAuB;AAClC;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,YAAY,uDAAM;AAClB;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,QAAQ,uFAA+B;AACvC;AACA,KAAK;AACL;;AAEO;AACP;AACA,KAAK;AACL;;;;;;;;;;;;;;;;;;;;;;;;AChFO;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;ACfP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC9HA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmC;AACuF;AACtF;AACmC;AACsI;AAC5I;AACuR;;AAEjV,yBAAyB,gDAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uDAAI,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uDAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,+DAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,wDAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAU;AACzB;AACA;AACA;AACA,eAAe,8DAAa;AAC5B;AACA;;AAEO;AACP,WAAW,kEAAW,8EAA8E,kEAAW;AAC/G;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAgB;AAC1C;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAgB;AAC1C;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,eAAe,uDAAI;AACnB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,yBAAyB,2DAAgB;AACzC;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,gBAAgB,sDAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP,WAAW,0DAAU;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,2DAAW;AACtB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA,+BAA+B,QAAQ;AACvC;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,QAAQ,4DAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8DAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ,4DAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8DAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,mBAAmB,0DAAU;AAC7B;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,yBAAyB,4DAAiB;AAC1C;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP,kCAAkC,uDAAI;AACtC;;AAEO;AACP;AACA;AACA,yBAAyB,4DAAiB;AAC1C;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP,WAAW,6DAAa;AACxB;;AAEO;AACP;AACA;AACA,yBAAyB,4DAAiB;AAC1C;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,yBAAyB,4DAAiB;AAC1C;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,kEAAkB;AAC7B;;AAEO;AACP;AACA;AACA,yBAAyB,4DAAiB;AAC1C;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA,gCAAgC,wDAAO;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,wDAAO;AAC5C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,yBAAyB,2DAAgB;AACzC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,yBAAyB,2DAAgB;AACzC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEO;AACP,mBAAmB,yDAAS;AAC5B;;AAEO;AACP,mBAAmB,qDAAK,UAAU,6DAAa;AAC/C;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,0BAA0B,oEAAyB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,+DAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,yBAAyB,6DAAU;AACnC,uBAAuB,6DAAU;AACjC;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,0BAA0B,oEAAyB;AACnD;AACA;AACA,0BAA0B,+DAAoB;AAC9C;AACA;AACA;;AAEO;AACP;AACA,0BAA0B,gEAAqB;AAC/C;AACA;AACA;AACA;AACA;AACA,0BAA0B,kEAAuB;AACjD;AACA;;AAEO;AACP;AACA,eAAe,uDAAI;AACnB;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP,mBAAmB,0DAAU;AAC7B;;AAEO;AACP,mBAAmB,qDAAK,UAAU,0DAAU;AAC5C;;AAEO;AACP,mBAAmB,qDAAK,UAAU,2DAAW;AAC7C;;AAEO;AACP,mBAAmB,qDAAK,UAAU,2DAAW,CAAC,qDAAK;AACnD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,0BAA0B,8DAAmB;AAC7C,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,0BAA0B,8DAAmB;AAC7C,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6F;AACxC;AACwF;AAC7F;AACiE;AAC7E;AACqF;AAC9E;AAC+B;;AAEnE;AACP;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wDAAO;AAClC;AACA;AACA,qCAAqC,wDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wDAAO;AACpC;AACA;AACA,qCAAqC,wDAAO;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uDAAI;AAC3C;AACA,2DAA2D,wDAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wDAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,uDAAI;AAC3C;AACA,yDAAyD,wDAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,wDAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,wDAAO;AACxD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,qDAAI;AAClC;AACA;AACA;AACA,2BAA2B,qDAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sDAAO;AAC1B;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA,gBAAgB,sDAAI;AACpB;AACA;AACA;;AAEO;AACP,WAAW,qDAAM;AACjB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA,qBAAqB,yBAAyB;AAC9C;AACA;AACA;AACA;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB;AACA;AACA,0BAA0B,mDAAU;AACpC;AACA;AACA;AACA,mBAAmB,8DAAa;AAChC;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO,0CAA0C,gDAAM;AACvD;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,kEAAW,gGAAgG,gEAAS,CAAC,kEAAW,sDAAsD,wDAAS;AAC1M;;AAEO;AACP;AACA;AACA;AACA,aAAa,wDAAS;AACtB,yBAAyB,qDAAI;AAC7B,sBAAsB,qDAAI;AAC1B;AACA;AACA;AACA,gCAAgC,gEAAe;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,sDAAO;AAC1B;AACA;AACA;AACA;;AAEO;AACP,qEAAqE,0DAAS;AAC9E;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,aAAa,wDAAS;AACtB,gBAAgB,qDAAI;AACpB,0BAA0B,qDAAI;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,aAAa,wDAAS;AACtB,gBAAgB,qDAAI;AACpB,0BAA0B,qDAAI;AAC9B;AACA;AACA;AACA;AACA,wDAAwD,qDAAI;AAC5D,4BAA4B,wDAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wDAAS;AACzB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;;AAEO;AACP,WAAW,sDAAM;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,8DAAa;AACpC;AACA,2BAA2B,8DAAa;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,uDAAM,oBAAoB,uDAAM;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAW;AAC/B;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uDAAI,GAAG,IAAI,mDAAK,SAAS,yDAAM,IAAI,EAAE,GAAG,EAAE;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAW;AAC9B;AACA,wCAAwC,wDAAO;AAC/C,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAM;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mDAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mDAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mDAAK;AACpB;AACA;AACA;AACA,QAAQ,uDAAS;AACjB;AACA,SAAS;AACT;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEA;AACA,sCAAsC,8FAAsC;AAC5E,CAAC;;AAEM;AACP;AACA;;AAEO;AACP,qBAAqB,8FAAsC;AAC3D;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,kBAAkB,wDAAO;AACzB;AACA;AACA;AACA;;AAEO;AACP,WAAW,qDAAK;AAChB;;AAEO;AACP,WAAW,qDAAK;AAChB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,uBAAuB,8DAAa;AACpC;AACA;AACA;AACA,oCAAoC,+DAAc;AAClD,oCAAoC,+DAAc;AAClD;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,eAAe,wDAAO;AACtB;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,WAAW,mDAAK;AAChB;;AAEO;AACP,WAAW,oDAAM;AACjB;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP,WAAW,uDAAS;AACpB;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,qBAAqB,8FAAsC;AAC3D;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;;;;;;;;;;;;;ACt5CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO;AACA;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA4D;AAC5D;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+DAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAM;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAO;AAC1B;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtFA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6C;AAC8C;;AAE3F;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA,gEAAgE;AAChE,iDAAiD;AACjD,2BAA2B,gCAAgC;AAC3D,8BAA8B,SAAS;AACvC;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ;AAC/B,6BAA6B,WAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAW;AACjC,iBAAiB,wDAAO,QAAQ,4DAAW,8DAA8D,yDAAQ,6BAA6B,sDAAK,CAAC,4DAAW,CAAC,2DAAU,yCAAyC,yDAAQ,iBAAiB,4DAAW;AACvP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;;;;;;;;;;;;;ACzLA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoC;AACK;AACW;AACmB;AACJ;;AAE5D;AACP,iCAAiC,wDAAO;AACxC;AACA;AACA;AACA;AACA;AACA,iCAAiC,wDAAO;AACxC;AACA;AACA;;AAEO;AACP;AACA,WAAW,qDAAK,OAAO,sDAAM;AAC7B;;AAEO;AACP,gDAAgD,2DAAQ,IAAI,sDAAW;AACvE;;AAEO;AACP,gDAAgD,6DAAS,qBAAqB,uDAAa;AAC3F;;AAEO;AACP;AACA;;AAEO;AACP,gDAAgD,yDAAQ,eAAe,oDAAa;AACpF;;AAEO;AACP,gDAAgD,yDAAQ,cAAc,oDAAa;AACnF;;AAEO;AACP;AACA,WAAW,qDAAK,OAAO,sDAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;ACrDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA2C;AAC+B;AACvC;AACiB;AAC7C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,yBAAyB,2DAAU;AACnC;AACA,WAAW,iEAAgB;AAC3B;AACO;AACP,6BAA6B;AAC7B;AACA,eAAe,gEAAe;AAC9B;AACA;AACA;AACA,eAAe,gEAAe;AAC9B;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,EAAE,qBAAqB,WAAW;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACO;AACP,kEAAkE,+CAAK;AACvE;AACO;AACP,mEAAmE,gDAAM;AACzE;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,uDAAuD,eAAe,WAAW,cAAc;AAC/F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,uDAAuD,cAAc,WAAW,cAAc;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wDAAY;AACnC;AACA,2BAA2B,mDAAO;AAClC;AACA;AACA;AACA;AACA,gEAAgE,WAAW;AAC3E;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,uBAAuB,+CAAK;AAC5B;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;;;;;;;;;;;;;ACnbA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACO;AACP,mCAAmC,EAAE;AACrC;AACO;AACP,sCAAsC,EAAE;AACxC;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,sBAAsB;AACtB;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,KAAK;AAC3D,6BAA6B,IAAI,IAAI;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjIA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA6G;AACvE;AACO;AACQ;AACgB;AAC6Z;AACvS;AACzI;;AAE3C;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8DAAa;AAC/B;AACA;AACA;AACA,mCAAmC;AACnC;AACA,6BAA6B,0DAAQ;AACrC;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA,YAAY,6DAAY;AACxB,YAAY,4DAAW;AACvB;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAO;AAC1B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,uDAAI;AACvC;AACA;AACA;AACA;AACA,gCAAgC,4DAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,8DAAa;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8DAAa;AAC5C;AACA;AACA,mBAAmB,wDAAO;AAC1B;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA,gBAAgB,uDAAI;AACpB;AACA;AACA,wBAAwB,wDAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,wDAAO;AAC1B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,sBAAsB,wDAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA,QAAQ,yEAAiB;AACzB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA,WAAW,8DAAa;AACxB;;AAEO;AACP,uBAAuB,8DAAa;AACpC;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,uBAAuB,2DAAW;AAClC;;AAEO;AACP;AACA;;AAEO;AACP,sBAAsB,mDAAU;AAChC,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB,eAAe,wDAAS;AACxB;AACA,2BAA2B,mDAAU;AACrC;AACA;AACA;AACA,eAAe,sDAAO;AACtB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,+BAA+B,8DAAa;AAC5C,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP,kDAAkD,uDAAI;AACtD;AACA,YAAY,6DAAY;AACxB,YAAY,4DAAW;AACvB;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA,YAAY,uDAAM;AAClB;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,+EAA+E,uDAAI;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uDAAI;AAC1B;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP,WAAW,6DAAa;AACxB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,WAAW,kEAAkB;AAC7B;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP,WAAW,0DAAU;AACrB;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP,WAAW,2DAAW;AACtB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB,eAAe,yDAAS;AACxB;AACA,2BAA2B,mDAAU;AACrC,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA,oEAAoE,uDAAI;AACxE;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB;AACA;AACA,2BAA2B,mDAAU;AACrC,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB,eAAe,yDAAS;AACxB;AACA,2BAA2B,mDAAU;AACrC,eAAe,wDAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uDAAI;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,uDAAI;AACpE;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP,QAAQ,4DAAW;AACnB;AACA;AACA,2BAA2B,mDAAU;AACrC,eAAe,uDAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA;;AAEO;AACP,8FAA8F,uDAAI;AAClG,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP,wGAAwG,uDAAI;AAC5G,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA,sHAAsH,uDAAI;AAC1H,KAAK;AACL;AACA,YAAY,4DAAW;AACvB;AACA;AACA,YAAY,4DAAW;AACvB;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA,sHAAsH,uDAAI;AAC1H,KAAK;AACL;AACA,YAAY,4DAAW;AACvB;AACA;AACA,YAAY,4DAAW;AACvB;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA,2KAA2K,uDAAI;AAC/K,KAAK;AACL;AACA,YAAY,4DAAW;AACvB;AACA;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA;AACA,gBAAgB,4DAAW;AAC3B;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAAa;AAC5B;AACA;AACA,eAAe,2DAAU;AACzB;AACA;AACA;AACA,eAAe,8DAAa;AAC5B;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,QAAQ,sEAAc;AACtB,YAAY,sDAAK;AACjB;AACA;AACA,oBAAoB,wDAAO;AAC3B;AACA,wBAAwB,wDAAO;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,4DAAW;AAC/B;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK,kBAAkB,sEAAc;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wDAAO;AAC7C;AACA;AACA,0CAA0C,8DAAa;AACvD,kCAAkC,uDAAI;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4DAAW;AACnC,sCAAsC,uDAAI;AAC1C;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;;AAEO;AACP,yBAAyB,yDAAS;AAClC;AACA;;AAEO;AACP,yBAAyB,6DAAa;AACtC;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,eAAe,wDAAO;AACtB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP,+BAA+B,yDAAS;AACxC;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEO;AACP,+BAA+B,0DAAU;AACzC;;AAEO;AACP;AACA;AACA;AACA,2BAA2B,YAAY;AACvC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,YAAY,4DAAW;AACvB;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP,0KAA0K,uDAAI;AAC9K,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP,yHAAyH,uDAAI;AAC7H,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP,+BAA+B,0DAAU;AACzC;;AAEO;AACP,+BAA+B,qDAAK,UAAU,2DAAW;AACzD;;AAEO;AACP,+BAA+B,qDAAK,UAAU,0DAAU;AACxD;;AAEO;AACP,+BAA+B,qDAAK,UAAU,2DAAW,CAAC,qDAAK;AAC/D;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP,+BAA+B,yDAAS;AACxC;;AAEO;AACP,+BAA+B,qDAAK,UAAU,6DAAa;AAC3D;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uDAAI;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA;AACA,sCAAsC,8DAAmB;AACzD;AACA;AACA;AACA;AACA;AACA,mBAAmB,uDAAI,CAAC,wDAAO;AAC/B;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA,oEAAoE,uDAAI;AACxE;AACA;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA;AACA,uBAAuB,uDAAI;AAC3B;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C;AACA,0CAA0C,8DAAmB;AAC7D;AACA;AACA;AACA,oEAAoE,uDAAI;AACxE;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;AAEO;AACP;AACA;AACA,0BAA0B,8DAAmB;AAC7C;AACA;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA,mBAAmB,uDAAI;AACvB;AACA;AACA;AACA,kCAAkC,8DAAmB;AACrD;AACA;AACA;AACA,KAAK;AACL,QAAQ,4DAAW;AACnB,KAAK;AACL;;;;;;;;;;;;;;ACn+CA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqD;AACqE;AACrF;AACC;AACtC;AACA;AACA,wBAAwB,iCAAiC,IAAI,aAAa;AAC1E;AACA,WAAW,2DAAc;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAS;AACjB;AACA;AACA,sBAAsB,4DAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAO;AAC7B;AACA;AACA;AACA,0CAA0C,+DAAW,mBAAmB,+DAAW;AACnF;AACA;AACA;AACA,0CAA0C,iEAAa,mBAAmB,iEAAa;AACvF;AACA;AACA,sBAAsB,yDAAK;AAC3B;AACA;AACA,sBAAsB,yDAAK;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAY;AAC1B;AACA;AACA,cAAc,0DAAQ;AACtB;AACA;AACA;AACA,iDAAiD;AACjD,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAS;AACrB;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAO;AACjC;AACA;AACA;AACA,8CAA8C,+DAAW,mBAAmB,+DAAW;AACvF;AACA;AACA;AACA,8CAA8C,iEAAa,mBAAmB,iEAAa;AAC3F;AACA;AACA;AACA;AACA,0BAA0B,2DAAO,CAAC,4DAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,yDAAK,yBAAyB,yDAAK;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,4DAAQ;AAC9C;AACA;AACA;AACA,kCAAkC,2DAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,oBAAoB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,kBAAkB,yDAAY;AAC9B;AACA;AACA,kBAAkB,0DAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACO;AACP;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACO;AACP;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,kCAAkC,yDAAM;AACxC;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,iDAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACO;AACP;AACA;AACA;AACA,0BAA0B,yDAAM;AAChC;AACA;AACO;AACP;AACA;AACA,wCAAwC,yDAAM;AAC9C;AACO;AACP;AACA;AACA,uCAAuC,yDAAM;AAC7C;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP,aAAa,aAAa;AAC1B;AACO;AACP,gCAAgC,mBAAmB;AACnD;AACO;AACP;AACA,yDAAyD,EAAE,uCAAuC;AAClG,yDAAyD,EAAE,WAAW;AACtE;;;;;;;;;;;;;AC3gBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAqE;AACxB;AACI;AACX;;AAE/B;AACP;AACA;AACA,aAAa,gEAAa;AAC1B;AACA;AACA;AACA;AACA;AACA,eAAe,uDAAI;AACnB;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP,qBAAqB,8DAAa;AAClC;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP,qBAAqB,0DAAQ;AAC7B;AACA;;AAEO;AACP,qBAAqB,0DAAQ;AAC7B;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP,qBAAqB,0DAAQ;AAC7B;AACA;;AAEO;AACP,qBAAqB,yDAAM;AAC3B;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;;AAEO;AACP,WAAW,4DAAS,CAAC,0DAAQ;AAC7B;;AAEO;AACP,IAAI,sDAAK;AACT;AACA;;;;;;;;;;;;;;AC7GA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuC;AACM;;AAEtC,8BAA8B,mDAAS;AAC9C;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU,oDAAoD,iEAAU;AACnF;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP,WAAW,iEAAU;AACrB;;AAEO;AACP;AACA;;;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuI;AAChI;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,oBAAoB,iGAAiG;AACrH;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,+DAAc;AAC5D,4BAA4B,2DAAU;AACtC,eAAe,iEAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA,kBAAkB,gEAAe;AACjC;AACA;AACA;AACA,mBAAmB,4DAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,gEAAe;AACjC;AACA;AACA;AACA,mBAAmB,8DAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA,aAAa,qFAAqF;AAClG;AACA;AACA,kDAAkD,+DAAc;AAChE,WAAW,iEAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA,cAAc,gEAAe;AAC7B;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C,iBAAiB,uDAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gEAAe;AAC7B;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C,2BAA2B,wDAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,cAAc,2BAA2B;AACzC,gBAAgB,6BAA6B;AAC7C,mBAAmB,gCAAgC;AACnD,mBAAmB,kCAAkC;AACrD,sBAAsB,qCAAqC;AAC3D;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sBAAsB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP,cAAc,2BAA2B;AACzC,gBAAgB,6BAA6B;AAC7C,mBAAmB,gCAAgC;AACnD,mBAAmB,kCAAkC;AACrD,sBAAsB,qCAAqC;AAC3D;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;;;;;;;;;;;;;ACxMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA,6BAA6B,aAAa,EAAE;AAC5C;AACA;AACA;AACA,oBAAoB;AACpB,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA,0DAA0D,SAAS,aAAa,OAAO;AACvF;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA,0DAA0D,SAAS,aAAa,OAAO;AACvF;AACA;AACA,SAAS;AACT;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,kBAAkB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3jBA;AAAA;AAAA;AAAA;AAAA;AACA;AAC8C;AACP;AACvC;AACA;AACA,mBAAmB,QAAQ,iEAAgB,kCAAkC,EAAE;AAC/E,eAAe,qBAAqB,EAAE;AACtC,kBAAkB,oBAAoB,EAAE;AACxC,KAAK,kDAAM;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,kBAAkB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI;AACV,MAAM,cAAc;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uCAAuC;AACtD;AACA;AACA;AACA,kBAAkB,8BAA8B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA,iBAAiB,iCAAiC;AAClD;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAI;AACV,OAAO,OAAO;AACd,OAAO,OAAO;AACd,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA,wBAAwB,KAAK;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,SAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA;AACA,UAAU,WAAW;AACrB;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA,sCAAsC,WAAW;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,IAAI;AAChD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,KAAK;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA,eAAe,OAAO;AACtB;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,eAAe;AACzB;AACA;AACA,UAAU,aAAa;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,OAAO;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,OAAO;AACd,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,OAAO;AACf,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,OAAO;AACf,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,OAAO;AACf,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,OAAO;AACd,QAAQ,OAAO;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACe,kEAAG,EAAC;;;;;;;;;;;;;ACv0BnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACO;AACP;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D,yCAAyC,yBAAyB;AAClE,4CAA4C,8BAA8B;AAC1E,qCAAqC,uBAAuB;AAC5D,eAAe,kDAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,qDAAqD,cAAc;AACnE;AACA;AACA,WAAW,EAAE;AACb,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa,MAAM;AACnB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa,MAAM;AACnB;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA,uBAAuB;AACvB;AACA,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,WAAW,sBAAsB,8CAA8C;AAC/E,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB,8CAA8C;AAC/E,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACO;AACP;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,QAAQ;AACnB,aAAa;AACb;AACA,YAAY,WAAW;AACvB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,OAAO;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,OAAO;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,OAAO;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,OAAO;AACpB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,kBAAkB;AAC7F;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,iFAAiF,qBAAqB;AACtG;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA,iFAAiF,qBAAqB;AACtG;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,iFAAiF,oBAAoB;AACrG;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,0FAA0F,2BAA2B;AACrH;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA,0FAA0F,2BAA2B;AACrH;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,oFAAoF,uBAAuB;AAC3G;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA,6FAA6F,8BAA8B;AAC3H;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA,6FAA6F,8BAA8B;AAC3H;AACA,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,OAAO;AACpB;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,mBAAmB;AAC5F;AACA,WAAW,oBAAoB;AAC/B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,oBAAoB;AACnG;AACA,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,oBAAoB;AAChG;AACA,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,mBAAmB;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,kBAAkB;AACtF;AACA,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF;AACA,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACA;AACA;AACA,gEAAgE,kBAAkB;AAClF;AACA,WAAW,oBAAoB;AAC/B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,oBAAoB;AAC/B,aAAa;AACb;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,qBAAqB;AAClH;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6GAA6G,sBAAsB;AACnI;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wGAAwG,8BAA8B;AACtI;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA,wGAAwG,8BAA8B;AACtI;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6FAA6F,sBAAsB;AACnH;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8FAA8F,uBAAuB;AACrH;AACA,WAAW,aAAa;AACxB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,MAAM;AACnB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,UAAU;AACV,aAAa,gBAAgB;AAC7B;AACO;AACP;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,gBAAgB;AAC7B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,aAAa,gBAAgB;AAC7B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa,KAAK;AAClB;AACO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,aAAa,KAAK;AAClB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,aAAa,KAAK;AAClB;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/App.fs.js\");\n","import { startAsPromise } from \"./fable_modules/fable-library.3.7.9/Async.js\";\nimport { init } from \"./CrossPlatform/Game.fs.js\";\nimport { initScene } from \"./Scene.fs.js\";\nimport { some } from \"./fable_modules/fable-library.3.7.9/Option.js\";\n\nexport const canvas = document.querySelector(\".game-canvas\");\n\nexport function setCanvasSize(_arg1) {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}\n\nwindow.onresize = ((arg00$0040) => {\n setCanvasSize(arg00$0040);\n});\n\nsetCanvasSize();\n\nfunction controlStateFromKeyCode(keyCode) {\n switch (keyCode) {\n case \"ArrowUp\": {\n return 1;\n }\n case \"ArrowLeft\": {\n return 2;\n }\n case \"ArrowRight\": {\n return 4;\n }\n case \"KeyQ\": {\n return 8;\n }\n case \"KeyE\": {\n return 16;\n }\n case \"ArrowDown\": {\n return 32;\n }\n case \"ControlLeft\": {\n return 64;\n }\n case \"Space\": {\n return 128;\n }\n default: {\n return 0;\n }\n }\n}\n\nexport const initialisationPromise = startAsPromise(init(() => initScene(canvas, void 0)));\n\ninitialisationPromise.then((tupledArg) => {\n const controlStateHandler = tupledArg[1];\n let previousTimestamp = 0;\n let currentGameState = tupledArg[2];\n const wrappedGameLoop = (timestamp) => {\n const timeInFrame = timestamp - previousTimestamp;\n previousTimestamp = timestamp;\n currentGameState = tupledArg[0](currentGameState)(timeInFrame * 1);\n window.requestAnimationFrame(wrappedGameLoop);\n };\n window.onkeydown = ((ke) => {\n if (!ke.repeat) {\n const controlState = controlStateFromKeyCode(ke.code) | 0;\n if (controlState !== 0) {\n ke.preventDefault();\n currentGameState = controlStateHandler(currentGameState)(controlState);\n }\n }\n });\n window.onkeyup = ((ke_1) => {\n const controlState_1 = controlStateFromKeyCode(ke_1.code) | 0;\n if (controlState_1 !== 0) {\n ke_1.preventDefault();\n currentGameState = controlStateHandler(currentGameState)(controlState_1);\n }\n });\n window.requestAnimationFrame(wrappedGameLoop);\n}).catch((exn) => {\n console.error(some(`Error initialising engine ${exn}`));\n});\n\n","\nexport const isShareware = true;\n\nexport const extension = isShareware ? \"WL1\" : \"WL6\";\n\nexport const GAMEMAPS = `GAMEMAPS.${extension}`;\n\nexport const MAPHEAD = `MAPHEAD.${extension}`;\n\nexport const VSWAP = `VSWAP.${extension}`;\n\nexport function isSharewareSprite(index) {\n if ((index <= 186) ? true : ((index >= 296) && (index <= 306))) {\n return true;\n }\n else if (index >= 408) {\n return index <= 435;\n }\n else {\n return false;\n }\n}\n\nexport function audioFilename(extension_1, soundEffect) {\n const prefix = (soundEffect.tag === 1) ? \"Aarrrgh (enemy death)\" : ((soundEffect.tag === 2) ? \"Aieeee1 (enemy death)\" : ((soundEffect.tag === 3) ? \"Aieeee2 (enemy death)\" : ((soundEffect.tag === 4) ? \"DoorOpen\" : ((soundEffect.tag === 5) ? \"DoorClose\" : \"Pistol\"))));\n return `${prefix}.${extension_1}`;\n}\n\n","import { nonSeeded } from \"./fable_modules/fable-library.3.7.9/Random.js\";\nimport { map, toArray } from \"./fable_modules/fable-library.3.7.9/Seq.js\";\nimport { rangeDouble } from \"./fable_modules/fable-library.3.7.9/Range.js\";\nimport { FSharpMap__get_Item, ofList } from \"./fable_modules/fable-library.3.7.9/Map.js\";\nimport { item, ofArray, map as map_1 } from \"./fable_modules/fable-library.3.7.9/List.js\";\nimport { escapeUriString } from \"./fable_modules/fable-library.3.7.9/Util.js\";\nimport { audioFilename } from \"./Assets.fs.js\";\nimport { printf, toText } from \"./fable_modules/fable-library.3.7.9/String.js\";\nimport { SoundEffect } from \"./Model.fs.js\";\n\nconst random = nonSeeded();\n\nfunction createOverlayingAudioPlayer(path) {\n const audioPlayers = toArray(map((_arg1) => (new Audio(path)), rangeDouble(0, 1, 4)));\n let currentIndex = 0;\n return (volume) => {\n audioPlayers[currentIndex].volume = volume;\n audioPlayers[currentIndex].play();\n currentIndex = (((currentIndex === (audioPlayers.length - 1)) ? 0 : (currentIndex + 1)) | 0);\n };\n}\n\nconst soundEffects = ofList(map_1((tupledArg) => [tupledArg[0], createOverlayingAudioPlayer(tupledArg[1])], map_1((soundEffectType) => {\n let arg10;\n return [soundEffectType, (arg10 = escapeUriString(audioFilename(\"mp3\", soundEffectType)), toText(printf(\"assets/sounds/%s\"))(arg10))];\n}, ofArray([new SoundEffect(0), new SoundEffect(1), new SoundEffect(2), new SoundEffect(3), new SoundEffect(4), new SoundEffect(5)]))));\n\nexport function playSoundEffect(soundEffect) {\n FSharpMap__get_Item(soundEffects, soundEffect)(1);\n}\n\nexport function playSoundEffectAtVolume(volume, soundEffect) {\n FSharpMap__get_Item(soundEffects, soundEffect)(volume);\n}\n\nexport function playRandomEnemyDeathSoundEffectAtVolume(volume) {\n playSoundEffectAtVolume(volume, item(random.Next1(3), ofArray([new SoundEffect(1), new SoundEffect(3), new SoundEffect(2)])));\n}\n\n","import { nonSeeded } from \"../fable_modules/fable-library.3.7.9/Random.js\";\nimport { ofArray, length, item } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { GameObject, Enemy, EnemyStateType, Vector2D__Abs, Vector2D, Vector2D__IsBetween, Vector2D__Normalize, Vector2D__Rotate_Z114CB6F } from \"../Model.fs.js\";\nimport { cast } from \"./Ray.fs.js\";\nimport { equals } from \"../fable_modules/fable-library.3.7.9/Util.js\";\n\nconst List_randomGenerator = nonSeeded();\n\nexport function List_random(values) {\n return item(List_randomGenerator.Next2(0, length(values)), values);\n}\n\nexport function inFieldOfView(game, enemy) {\n const matchValue = enemy.DirectionVector;\n if (matchValue != null) {\n const directionVector = matchValue;\n const fieldOfViewAngle = ((45 * 3.141592653589793) / 180) * 1;\n const boundingVectorA = Vector2D__Rotate_Z114CB6F(Vector2D__Normalize(directionVector), -fieldOfViewAngle);\n const boundingVectorB = Vector2D__Rotate_Z114CB6F(Vector2D__Normalize(directionVector), fieldOfViewAngle);\n return Vector2D__IsBetween(Vector2D__Normalize(new Vector2D(game.Camera.Position.vX - enemy.BasicGameObject.Position.vX, game.Camera.Position.vY - enemy.BasicGameObject.Position.vY)), boundingVectorA, boundingVectorB);\n }\n else {\n return true;\n }\n}\n\nexport function isPlayerVisibleToEnemy(game, enemy) {\n if (inFieldOfView(game, enemy)) {\n const vectorToEnemy = new Vector2D(game.Camera.Position.vX - enemy.BasicGameObject.Position.vX, game.Camera.Position.vY - enemy.BasicGameObject.Position.vY);\n const absVectorToEnemy = Vector2D__Abs(vectorToEnemy);\n const rayDirection = Vector2D__Normalize(vectorToEnemy);\n return !cast(() => [enemy.BasicGameObject.Position.vX, enemy.BasicGameObject.Position.vY, rayDirection], (tupledArg) => {\n const mapX = tupledArg[3] | 0;\n const mapY = tupledArg[4] | 0;\n if ((!tupledArg[0]) && ((((mapX >= 0) && (mapX < length(item(0, game.Map)))) && (mapY >= 0)) && (mapY < length(game.Map)))) {\n if (Math.abs(tupledArg[1]) < absVectorToEnemy.vX) {\n return true;\n }\n else {\n return Math.abs(tupledArg[2]) < absVectorToEnemy.vY;\n }\n }\n else {\n return false;\n }\n }, game)[0];\n }\n else {\n return false;\n }\n}\n\nexport function getNextState(canSeePlayer, enemy) {\n const matchValue = [enemy.State, canSeePlayer];\n let pattern_matching_result;\n if (matchValue[0].tag === 0) {\n if (matchValue[1]) {\n pattern_matching_result = 0;\n }\n else {\n pattern_matching_result = 1;\n }\n }\n else if (matchValue[0].tag === 1) {\n if (matchValue[1]) {\n pattern_matching_result = 0;\n }\n else {\n pattern_matching_result = 1;\n }\n }\n else {\n pattern_matching_result = 1;\n }\n switch (pattern_matching_result) {\n case 0: {\n return List_random(ofArray([() => (new EnemyStateType(2)), () => (new EnemyStateType(6))]))();\n }\n case 1: {\n return enemy.State;\n }\n }\n}\n\nexport function applyAi(game, gameObject) {\n if (gameObject.tag === 1) {\n const enemy = gameObject.fields[0];\n const newState = getNextState(isPlayerVisibleToEnemy(game, enemy), enemy);\n return new GameObject(1, (!equals(newState, enemy.State)) ? (new Enemy(enemy.EnemyType, enemy.BasicGameObject, enemy.DirectionVector, enemy.Direction, enemy.DeathSpriteIndexes, enemy.AttackSpriteIndexes, enemy.SpriteBlocks, enemy.FramesPerBlock, enemy.CurrentAnimationFrame, enemy.TimeUntilNextAnimationFrame, newState)) : enemy);\n }\n else {\n return gameObject;\n }\n}\n\n","import { unfold } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { fold, iterate } from \"../fable_modules/fable-library.3.7.9/Seq.js\";\nimport { rangeDouble } from \"../fable_modules/fable-library.3.7.9/Range.js\";\n\nexport function rlewDecode(createDataView, mapHeadView, inView) {\n const rlewTag = mapHeadView.getUint16(0, true);\n const outView = createDataView(~(~inView.getUint16(0, true)));\n unfold((tupledArg) => {\n const inOffset = tupledArg[0] | 0;\n const outOffset = tupledArg[1] | 0;\n let patternInput;\n const w = inView.getUint16(inOffset, true);\n const newInOffset = (inOffset + 2) | 0;\n if (w === rlewTag) {\n const n = inView.getUint16(newInOffset, true);\n const x = inView.getUint16(newInOffset + 2, true);\n iterate((i) => {\n outView.setUint16(outOffset + (i * 2), x, true);\n }, rangeDouble(0, 1, (~(~n)) - 1));\n patternInput = [newInOffset + 4, outOffset + (2 * (~(~n)))];\n }\n else {\n outView.setUint16(outOffset, w, true);\n patternInput = [newInOffset, outOffset + 2];\n }\n const nextInOffset = patternInput[0] | 0;\n return (nextInOffset < inView.byteLength) ? [void 0, [nextInOffset, patternInput[1]]] : (void 0);\n }, [2, 0]);\n return outView;\n}\n\nexport function carmackDecode(createDataView, inView) {\n const outView = createDataView(~(~inView.getUint16(0, true)));\n const isNearPointer = (possiblePointer) => (possiblePointer === 167);\n unfold((tupledArg) => {\n let possiblePointer_1;\n const inOffset = tupledArg[0] | 0;\n const outOffset = tupledArg[1] | 0;\n let patternInput;\n const x = inView.getUint8(inOffset + 1);\n if ((possiblePointer_1 = x, isNearPointer(possiblePointer_1) ? true : (possiblePointer_1 === 168))) {\n const n = inView.getUint8(inOffset);\n if (n === 0) {\n outView.setUint8(outOffset, inView.getUint8(inOffset + 2));\n outView.setUint8(outOffset + 1, x);\n patternInput = [inOffset + 3, outOffset + 2];\n }\n else if (isNearPointer(x)) {\n const offset = (2 * (~(~inView.getUint8(inOffset + 2)))) | 0;\n patternInput = [inOffset + 3, fold((foldOffset, _arg1) => {\n outView.setUint16(foldOffset, outView.getUint16(foldOffset - offset, true), true);\n return (foldOffset + 2) | 0;\n }, outOffset, rangeDouble(0, 1, (~(~n)) - 1))];\n }\n else {\n const offset_1 = (2 * (~(~inView.getUint16(inOffset + 2, true)))) | 0;\n patternInput = [inOffset + 4, fold((foldOffset_1, i) => {\n outView.setUint16(foldOffset_1, outView.getUint16(offset_1 + (2 * i), true), true);\n return (foldOffset_1 + 2) | 0;\n }, outOffset, rangeDouble(0, 1, (~(~n)) - 1))];\n }\n }\n else {\n outView.setUint16(outOffset, inView.getUint16(inOffset, true), true);\n patternInput = [inOffset + 2, outOffset + 2];\n }\n const newInOffset = patternInput[0] | 0;\n return (newInOffset >= inView.byteLength) ? (void 0) : [void 0, [newInOffset, patternInput[1]]];\n }, [2, 0]);\n return outView;\n}\n\n","import { ofArray, empty } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { WeaponType, Game, Camera as Camera_1, Vector2D, Player as Player_1 } from \"../Model.fs.js\";\nimport { singleton } from \"../fable_modules/fable-library.3.7.9/AsyncBuilder.js\";\nimport { getWeapon, loadLevelFromRawMap, loadRawMap } from \"./Map.fs.js\";\nimport { loadGraphics } from \"../Graphics.Common.fs.js\";\nimport { scaleSprite, loadSprites } from \"../Graphics.fs.js\";\nimport { updateFrame } from \"./Update.fs.js\";\n\nconst initialGameState = new Game(empty(), empty(), new Player_1(0, 100, 0.5, -1, 99, empty()), new Camera_1(new Vector2D(12, 6), new Vector2D(-1, 0), new Vector2D(0, 1), 1), 0, false, void 0, empty());\n\nexport function init(initScene) {\n return singleton.Delay(() => singleton.Bind(loadRawMap(0), (_arg1) => singleton.Bind(loadGraphics(), (_arg2) => singleton.Bind(loadSprites(), (_arg3) => {\n let inputRecord;\n const sprites = _arg3;\n const patternInput = initScene();\n const canvasHeight = patternInput[2] | 0;\n const level = loadLevelFromRawMap(_arg1);\n const gameState = new Game(level.Plane0, level.GameObjects, (inputRecord = initialGameState.Player, new Player_1(inputRecord.Score, inputRecord.Health, inputRecord.Radius, 1, inputRecord.Ammunition, ofArray([getWeapon(sprites, new WeaponType(0), (image) => scaleSprite(canvasHeight, canvasHeight, image)), getWeapon(sprites, new WeaponType(1), (image_1) => scaleSprite(canvasHeight, canvasHeight, image_1))]))), level.PlayerStartingPosition, initialGameState.ControlState, initialGameState.IsFiring, initialGameState.TimeToNextWeaponFrame, level.Doors);\n return singleton.Return([(game) => ((frameTime) => updateFrame(game, frameTime, patternInput[0](_arg2)(sprites)(game))), (game_1) => ((controlState) => (new Game(game_1.Map, game_1.GameObjects, game_1.Player, game_1.Camera, game_1.ControlState ^ controlState, game_1.IsFiring, game_1.TimeToNextWeaponFrame, game_1.Doors))), gameState]);\n }))));\n}\n\n","import { FSharpException } from \"../fable_modules/fable-library.3.7.9/Types.js\";\nimport { class_type } from \"../fable_modules/fable-library.3.7.9/Reflection.js\";\nimport { partialApply, equalArrays, uncurry, equals } from \"../fable_modules/fable-library.3.7.9/Util.js\";\nimport { reverse, ofArray, tryFind, mapIndexed, empty, length, singleton as singleton_1, append, map } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { PlayerWeapon, WolfensteinMap, GameObject, EnemyType, Enemy, EnemyStateType, BasicGameObject as BasicGameObject_1, Vector2D__UnsquaredDistanceFrom_Z41DD997C, Vector2D_op_Subtraction_3C4D5180, DoorState, DoorStatus, DoorDirection, RawMap, Camera, Vector2D__get_CrossProduct, Vector2D_op_Multiply_Z23A8CFC1, Vector2D, Cell, Wall } from \"../Model.fs.js\";\nimport { toList, fold, filter, map as map_1, concat } from \"../fable_modules/fable-library.3.7.9/Seq.js\";\nimport { map as map_2, value as value_6 } from \"../fable_modules/fable-library.3.7.9/Option.js\";\nimport { rangeDouble } from \"../fable_modules/fable-library.3.7.9/Range.js\";\nimport { singleton } from \"../fable_modules/fable-library.3.7.9/AsyncBuilder.js\";\nimport { log, loadAsset } from \"../Utils.fs.js\";\nimport { MAPHEAD, GAMEMAPS } from \"../Assets.fs.js\";\nimport { carmackDecode, rlewDecode } from \"./Compression.fs.js\";\n\nexport class MapLoadException extends FSharpException {\n constructor() {\n super();\n }\n}\n\nexport function MapLoadException$reflection() {\n return class_type(\"App.Map.MapLoadException\", void 0, MapLoadException, class_type(\"System.Exception\"));\n}\n\nfunction MapLoadException__Equals_229D3F39(this$, obj) {\n if (!equals(this$, null)) {\n if (!equals(obj, null)) {\n if (obj instanceof MapLoadException) {\n return 1;\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }\n else if (!equals(obj, null)) {\n return false;\n }\n else {\n return true;\n }\n}\n\nexport class PlayerStartingPositionNotFoundException extends FSharpException {\n constructor() {\n super();\n }\n}\n\nexport function PlayerStartingPositionNotFoundException$reflection() {\n return class_type(\"App.Map.PlayerStartingPositionNotFoundException\", void 0, PlayerStartingPositionNotFoundException, class_type(\"System.Exception\"));\n}\n\nfunction PlayerStartingPositionNotFoundException__Equals_229D3F39(this$, obj) {\n if (!equals(this$, null)) {\n if (!equals(obj, null)) {\n if (obj instanceof PlayerStartingPositionNotFoundException) {\n return 1;\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }\n else if (!equals(obj, null)) {\n return false;\n }\n else {\n return true;\n }\n}\n\nexport class InvalidDoorException extends FSharpException {\n constructor() {\n super();\n }\n}\n\nexport function InvalidDoorException$reflection() {\n return class_type(\"App.Map.InvalidDoorException\", void 0, InvalidDoorException, class_type(\"System.Exception\"));\n}\n\nfunction InvalidDoorException__Equals_229D3F39(this$, obj) {\n if (!equals(this$, null)) {\n if (!equals(obj, null)) {\n if (obj instanceof InvalidDoorException) {\n return 1;\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }\n else if (!equals(obj, null)) {\n return false;\n }\n else {\n return true;\n }\n}\n\nexport function mapFromTextures(source) {\n return map((row) => map((textureIndex) => {\n if (textureIndex > 0) {\n return new Cell(0, new Wall(textureIndex, textureIndex));\n }\n else {\n return new Cell(2);\n }\n }, row), source);\n}\n\nexport function getPlaneValue(plane, x, y) {\n return plane.getUint16(2 * (x + (64 * y)), true);\n}\n\nfunction traverseMap(handler, mapPlane) {\n const mapSize = (~(~Math.sqrt(~(~(mapPlane.byteLength / 2))))) | 0;\n return concat(map_1((rowIndex) => map_1(value_6, filter((option) => (option != null), map_1((colIndex) => handler(colIndex, rowIndex, getPlaneValue(mapPlane, colIndex, rowIndex)), rangeDouble(0, 1, mapSize - 1)))), rangeDouble(0, 1, mapSize - 1)));\n}\n\nfunction getStartingPosition(mapSize, plane1) {\n const cameraOption = fold((outerCameraOption, row) => fold((innerCameraOption, column) => {\n if (innerCameraOption == null) {\n const mapValue = getPlaneValue(plane1, column, row);\n if ((19 <= mapValue) && (mapValue <= 22)) {\n const direction = (mapValue === 19) ? (new Vector2D(0, -1)) : ((mapValue === 20) ? (new Vector2D(-1, 0)) : ((mapValue === 21) ? (new Vector2D(0, 1)) : ((mapValue === 22) ? (new Vector2D(1, 0)) : (new Vector2D(1, 0)))));\n const fieldOfView = 1;\n return new Camera(new Vector2D((mapSize - column) - 0.5, row + 0.5), direction, Vector2D_op_Multiply_Z23A8CFC1(Vector2D__get_CrossProduct(direction), fieldOfView), fieldOfView);\n }\n else {\n return void 0;\n }\n }\n else {\n return innerCameraOption;\n }\n }, outerCameraOption, rangeDouble(0, 1, mapSize)), void 0, rangeDouble(0, 1, mapSize));\n if (cameraOption != null) {\n return cameraOption;\n }\n else {\n throw (new PlayerStartingPositionNotFoundException());\n }\n}\n\nexport function loadRawMap(levelIndex) {\n return singleton.Delay(() => {\n const createDataView = (size) => (new DataView(new ArrayBuffer(size)));\n return singleton.Bind(loadAsset(GAMEMAPS), (_arg1) => singleton.Bind(loadAsset(MAPHEAD), (_arg2) => {\n let matchValue, copyOfStruct, copyOfStruct_1, mapHeadView, offset, mapHeader, plane0View, plane1View, plane2View;\n return singleton.Return((matchValue = [_arg1, _arg2], (copyOfStruct = matchValue[0], (copyOfStruct.tag === 0) ? ((copyOfStruct_1 = matchValue[1], (copyOfStruct_1.tag === 0) ? ((mapHeadView = (new DataView(copyOfStruct_1.fields[0])), (offset = mapHeadView.getUint32(2 + (4 * levelIndex), true), (mapHeader = (new DataView(copyOfStruct.fields[0], (~(~offset)), 42)), (log(`${mapHeader.getUint32(0, true)}`), (plane0View = (new DataView(copyOfStruct.fields[0], (~(~mapHeader.getUint32(0, true))), mapHeader.getUint16(12, true))), (plane1View = (new DataView(copyOfStruct.fields[0], (~(~mapHeader.getUint32(4, true))), mapHeader.getUint16(14, true))), (plane2View = (new DataView(copyOfStruct.fields[0], (~(~mapHeader.getUint32(4, true))), mapHeader.getUint16(14, true))), new RawMap(64, rlewDecode(createDataView, mapHeadView, carmackDecode(createDataView, plane0View)), rlewDecode(createDataView, mapHeadView, carmackDecode(createDataView, plane1View)), rlewDecode(createDataView, mapHeadView, carmackDecode(createDataView, plane2View))))))))))) : (() => {\n throw (new MapLoadException());\n })())) : (() => {\n throw (new MapLoadException());\n })())));\n }));\n });\n}\n\nexport function loadLevelFromRawMap(raw) {\n const patternInput_2 = fold((tupledArg, rowIndex) => {\n const patternInput_1 = fold(uncurry(2, (tupledArg_1) => {\n const row = tupledArg_1[0];\n const innerDoors = tupledArg_1[1];\n return (colIndex) => {\n const rawMapCell = raw.Plane0.getUint16(2 * (colIndex + (64 * rowIndex)), true);\n if (rawMapCell <= 63) {\n const textureIndex = ((2 * (~(~rawMapCell))) - 1) | 0;\n return [append(row, singleton_1(new Cell(0, new Wall(textureIndex, textureIndex - 1)))), innerDoors];\n }\n else if ((rawMapCell >= 90) && (rawMapCell <= 101)) {\n let patternInput;\n if (rawMapCell === 90) {\n patternInput = [99, new DoorDirection(0)];\n }\n else if (rawMapCell === 92) {\n patternInput = [105, new DoorDirection(0)];\n }\n else if (rawMapCell === 94) {\n patternInput = [105, new DoorDirection(0)];\n }\n else if (rawMapCell === 100) {\n patternInput = [103, new DoorDirection(0)];\n }\n else if (rawMapCell === 91) {\n patternInput = [98, new DoorDirection(1)];\n }\n else if (rawMapCell === 93) {\n patternInput = [104, new DoorDirection(1)];\n }\n else if (rawMapCell === 95) {\n patternInput = [104, new DoorDirection(1)];\n }\n else if (rawMapCell === 101) {\n patternInput = [102, new DoorDirection(1)];\n }\n else {\n throw (new InvalidDoorException());\n }\n const doorState = new DoorState(patternInput[0], patternInput[1], new DoorStatus(3), 0, 0, [colIndex, rowIndex]);\n return [append(row, singleton_1(new Cell(1, length(innerDoors)))), append(innerDoors, singleton_1(doorState))];\n }\n else {\n return [append(row, singleton_1(new Cell(2))), innerDoors];\n }\n };\n }), [empty(), tupledArg[1]], rangeDouble(0, 1, raw.MapSize - 1));\n return [append(tupledArg[0], singleton_1(patternInput_1[0])), patternInput_1[1]];\n }, [empty(), empty()], rangeDouble(0, 1, raw.MapSize - 1));\n const doors = patternInput_2[1];\n const patchedPlane0 = mapIndexed((rowIndex_1, row_1) => mapIndexed((colIndex_1, cell) => {\n if (cell.tag === 0) {\n const wall = cell.fields[0];\n return new Cell(0, new Wall(((tryFind((doorState_1) => equalArrays(doorState_1.MapPosition, [colIndex_1 + 1, rowIndex_1]), doors) != null) ? true : (tryFind((doorState_2) => equalArrays(doorState_2.MapPosition, [colIndex_1 - 1, rowIndex_1]), doors) != null)) ? 100 : wall.NorthSouthTextureIndex, ((tryFind((doorState_3) => equalArrays(doorState_3.MapPosition, [colIndex_1, rowIndex_1 + 1]), doors) != null) ? true : (tryFind((doorState_4) => equalArrays(doorState_4.MapPosition, [colIndex_1, rowIndex_1 - 1]), doors) != null)) ? 101 : wall.EastWestTextureIndex));\n }\n else {\n return cell;\n }\n }, row_1), patternInput_2[0]);\n const playerStartingPosition = getStartingPosition(raw.MapSize, raw.Plane1);\n let gameObjects;\n const createEnemy = (spriteIndex_1, spriteBlocks, framesPerBlock, deathSprites, attackingSprites, enemyType, x, y, directionIntOption) => {\n const position = new Vector2D((raw.MapSize - x) - 0.5, y + 0.5);\n return new Enemy(enemyType, new BasicGameObject_1(position, Vector2D_op_Subtraction_3C4D5180(position, playerStartingPosition.Position), Vector2D__UnsquaredDistanceFrom_Z41DD997C(position, playerStartingPosition.Position), spriteIndex_1, true), map_2((direction_1) => {\n switch (direction_1) {\n case 0: {\n return new Vector2D(0, 0);\n }\n case 1: {\n return new Vector2D(0, 0);\n }\n case 2: {\n return new Vector2D(1, 0);\n }\n case 3: {\n return new Vector2D(0, 0);\n }\n case 4: {\n return new Vector2D(0, 0);\n }\n case 5: {\n return new Vector2D(0, 0);\n }\n case 6: {\n return new Vector2D(0, 0);\n }\n case 7: {\n return new Vector2D(0, 0);\n }\n default: {\n return new Vector2D(1, 0);\n }\n }\n }, directionIntOption), map_2((value) => (~(~value)), directionIntOption), deathSprites, attackingSprites, spriteBlocks, framesPerBlock, 0, 0, new EnemyStateType(0));\n };\n const guardEnemy = partialApply(3, createEnemy, [50, 4, 8, ofArray([90, 91, 92, 93, 95]), ofArray([96, 97, 98]), new EnemyType(0)]);\n const dogEnemy = partialApply(3, createEnemy, [99, 3, 8, ofArray([131, 132, 133, 134]), ofArray([135, 136, 137]), new EnemyType(3)]);\n const ssEnemy = partialApply(3, createEnemy, [138, 4, 8, ofArray([179, 180, 181, 183]), ofArray([184, 185, 186]), new EnemyType(2)]);\n const zombieEnemy = partialApply(3, createEnemy, [187, 4, 8, ofArray([228, 229, 230, 232, 233]), ofArray([234, 235, 236, 237]), new EnemyType(4)]);\n const officerEnemy = partialApply(3, createEnemy, [238, 4, 8, ofArray([279, 280, 281, 283, 284]), ofArray([285, 286, 287]), new EnemyType(1)]);\n const hansEnemy = partialApply(3, createEnemy, [296, 1, 4, ofArray([304, 305, 306, 303]), ofArray([300, 301, 302]), new EnemyType(10)]);\n const schabbsEnemy = partialApply(3, createEnemy, [307, 1, 4, ofArray([313, 314, 315, 316]), ofArray([311, 312]), new EnemyType(8)]);\n const fakeHitlerEnemy = partialApply(3, createEnemy, [321, 1, 4, ofArray([328, 329, 330, 331, 332, 333]), empty(), new EnemyType(5)]);\n const hitlerEnemy = partialApply(3, createEnemy, [345, 1, 4, ofArray([353, 354, 355, 356, 357, 358, 359, 352]), ofArray([349, 350, 351]), new EnemyType(6)]);\n const ottoEnemy = partialApply(3, createEnemy, [360, 1, 4, ofArray([366, 367, 368, 369]), ofArray([364, 365]), new EnemyType(11)]);\n const gretelEnemy = partialApply(3, createEnemy, [385, 1, 4, ofArray([393, 394, 395, 392]), ofArray([389, 390, 391]), new EnemyType(9)]);\n const fettgesichtEnemy = partialApply(3, createEnemy, [396, 1, 4, ofArray([404, 405, 406, 407]), ofArray([400, 401, 402, 403]), new EnemyType(7)]);\n gameObjects = toList(traverseMap((colIndex_2, rowIndex_2, value_1) => {\n let SpriteIndex;\n if ((value_1 >= 23) && (value_1 <= 70)) {\n const position_1 = new Vector2D((raw.MapSize - colIndex_2) - 0.5, rowIndex_2 + 0.5);\n return new GameObject(0, (SpriteIndex = (((~(~value_1)) - 21) | 0), new BasicGameObject_1(position_1, Vector2D_op_Subtraction_3C4D5180(position_1, playerStartingPosition.Position), Vector2D__UnsquaredDistanceFrom_Z41DD997C(position_1, playerStartingPosition.Position), SpriteIndex, false)));\n }\n else if (value_1 >= 108) {\n return map_2((e) => (new GameObject(1, e)), ((108 <= value_1) && (value_1 < 116)) ? guardEnemy(colIndex_2)(rowIndex_2)((value_1 - 108) % 4) : (((144 <= value_1) && (value_1 < 152)) ? guardEnemy(colIndex_2)(rowIndex_2)((value_1 - 144) % 4) : (((116 <= value_1) && (value_1 < 124)) ? officerEnemy(colIndex_2)(rowIndex_2)((value_1 - 116) % 4) : (((152 <= value_1) && (value_1 < 160)) ? officerEnemy(colIndex_2)(rowIndex_2)((value_1 - 152) % 4) : (((126 <= value_1) && (value_1 < 134)) ? ssEnemy(colIndex_2)(rowIndex_2)((value_1 - 126) % 4) : (((162 <= value_1) && (value_1 < 170)) ? ssEnemy(colIndex_2)(rowIndex_2)((value_1 - 162) % 4) : (((134 <= value_1) && (value_1 < 142)) ? dogEnemy(colIndex_2)(rowIndex_2)((value_1 - 134) % 4) : (((170 <= value_1) && (value_1 < 178)) ? dogEnemy(colIndex_2)(rowIndex_2)((value_1 - 170) % 4) : (((216 <= value_1) && (value_1 < 224)) ? zombieEnemy(colIndex_2)(rowIndex_2)((value_1 - 216) % 4) : (((234 <= value_1) && (value_1 < 242)) ? zombieEnemy(colIndex_2)(rowIndex_2)((value_1 - 234) % 4) : ((value_1 === 160) ? fakeHitlerEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 178) ? hitlerEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 179) ? fettgesichtEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 196) ? schabbsEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 197) ? gretelEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 214) ? hansEnemy(colIndex_2)(rowIndex_2)(void 0) : ((value_1 === 215) ? ottoEnemy(colIndex_2)(rowIndex_2)(void 0) : (void 0))))))))))))))))));\n }\n else {\n return void 0;\n }\n }, raw.Plane1));\n return new WolfensteinMap(raw.MapSize, raw.MapSize, map(reverse, patchedPlane0), gameObjects, playerStartingPosition, doors);\n}\n\nexport function getWeapon(sprites, weaponType, scaleSprite) {\n const toSpriteSet = (sequence) => toList(map_1((i) => scaleSprite(sprites[i]), sequence));\n switch (weaponType.tag) {\n case 1: {\n return new PlayerWeapon(append(toSpriteSet(rangeDouble(421, 1, 425)), toSpriteSet(rangeDouble(424, 1, 422))), 0, 25, false);\n }\n case 2: {\n return new PlayerWeapon(toSpriteSet(rangeDouble(426, 1, 430)), 0, 25, true);\n }\n case 3: {\n return new PlayerWeapon(toSpriteSet(rangeDouble(431, 1, 435)), 0, 25, true);\n }\n default: {\n return new PlayerWeapon(toSpriteSet(rangeDouble(416, 1, 420)), 0, 25, false);\n }\n }\n}\n\n","import { initializeInfinite, scan, skipWhile, head } from \"../fable_modules/fable-library.3.7.9/Seq.js\";\nimport { equals, uncurry } from \"../fable_modules/fable-library.3.7.9/Util.js\";\nimport { Side } from \"../Model.fs.js\";\nimport { item } from \"../fable_modules/fable-library.3.7.9/List.js\";\n\nexport function cast(setup, terminator, game) {\n const patternInput = setup();\n const rayDirection = patternInput[2];\n const posY = patternInput[1];\n const posX = patternInput[0];\n const mapX = (~(~posX)) | 0;\n const mapY = (~(~posY)) | 0;\n const deltaDistX = (rayDirection.vX === 0) ? 1.7976931348623157E+308 : Math.abs(1 / rayDirection.vX);\n const deltaDistY = (rayDirection.vY === 0) ? 1.7976931348623157E+308 : Math.abs(1 / rayDirection.vY);\n const halfStepDeltaX = (rayDirection.vX === 0) ? 1.7976931348623157E+308 : Math.sqrt(1 + (((rayDirection.vY * rayDirection.vY) / rayDirection.vX) * rayDirection.vX));\n const halfStepDeltaY = (rayDirection.vY === 0) ? 1.7976931348623157E+308 : Math.sqrt(1 + (((rayDirection.vX * rayDirection.vX) / rayDirection.vY) * rayDirection.vY));\n const patternInput_1 = (rayDirection.vX < 0) ? [-1, (posX - mapX) * deltaDistX] : [1, ((mapX + 1) - posX) * deltaDistX];\n const stepX = patternInput_1[0] | 0;\n const patternInput_2 = (rayDirection.vY < 0) ? [-1, (posY - mapY) * deltaDistY] : [1, ((mapY + 1) - posY) * deltaDistY];\n const stepY = patternInput_2[0] | 0;\n const patternInput_5 = head(skipWhile(terminator, scan(uncurry(2, (tupledArg) => {\n const isHit = tupledArg[0];\n const currentRayDistanceX = tupledArg[1];\n const currentRayDistanceY = tupledArg[2];\n const currentMapX = tupledArg[3] | 0;\n const currentMapY = tupledArg[4] | 0;\n const currentSide = tupledArg[5];\n return (_arg2) => {\n let matchValue, doorState, map_x2, map_y2, adj, ray_mult, rxe2, rye2, true_delta_x, true_delta_y, half_step_in_y, half_step_in_x;\n if (!terminator([isHit, currentRayDistanceX, currentRayDistanceY, currentMapX, currentMapY, currentSide])) {\n return [isHit, currentRayDistanceX, currentRayDistanceY, currentMapX, currentMapY, currentSide];\n }\n else {\n const patternInput_3 = (currentRayDistanceX < currentRayDistanceY) ? [currentMapX + stepX, currentMapY, new Side(0)] : [currentMapX, currentMapY + stepY, new Side(1)];\n const newSide = patternInput_3[2];\n const newMapY = patternInput_3[1] | 0;\n const newMapX = patternInput_3[0] | 0;\n const patternInput_4 = (currentRayDistanceX < currentRayDistanceY) ? [currentRayDistanceX + deltaDistX, currentRayDistanceY] : [currentRayDistanceX, currentRayDistanceY + deltaDistY];\n return [(matchValue = item(newMapX, item(newMapY, game.Map)), (matchValue.tag === 0) ? true : ((matchValue.tag === 1) && ((doorState = item(matchValue.fields[0], game.Doors), (doorState.Status.tag === 2) ? false : ((map_x2 = (((posX < newMapX) ? (newMapX - 1) : newMapX) | 0), (map_y2 = (((posY > newMapY) ? (newMapY + 1) : newMapY) | 0), (adj = (equals(newSide, new Side(1)) ? (map_y2 - posY) : ((map_x2 - posX) + 1)), (ray_mult = (equals(newSide, new Side(1)) ? (adj / rayDirection.vY) : (adj / rayDirection.vX)), (rxe2 = (posX + (rayDirection.vX * ray_mult)), (rye2 = (posY + (rayDirection.vY * ray_mult)), (true_delta_x = ((halfStepDeltaX < 0.0001) ? 100 : halfStepDeltaX), (true_delta_y = ((halfStepDeltaY < 0.0001) ? 100 : halfStepDeltaY), equals(newSide, new Side(0)) ? ((half_step_in_y = (rye2 + ((stepY * Math.sqrt((true_delta_x * true_delta_x) - 1)) / 2)), (Math.floor(half_step_in_y) === newMapY) && ((half_step_in_y - newMapY) < (1 - (doorState.Offset / 64))))) : ((half_step_in_x = (rxe2 + ((stepX * Math.sqrt((true_delta_y * true_delta_y) - 1)) / 2)), (Math.floor(half_step_in_x) === newMapX) && ((half_step_in_x - newMapX) < (1 - (doorState.Offset / 64)))))))))))))))))), patternInput_4[0], patternInput_4[1], newMapX, newMapY, newSide];\n }\n };\n }), [false, patternInput_1[1], patternInput_2[1], mapX, mapY, new Side(0)], initializeInfinite((_arg1) => 0))));\n return [patternInput_5[0], deltaDistX, deltaDistY, patternInput_5[1], patternInput_5[2], patternInput_5[3], patternInput_5[4], patternInput_5[5]];\n}\n\n","import { map as map_1, toArray, iterate, fold } from \"../fable_modules/fable-library.3.7.9/Seq.js\";\nimport { PlayerWeapon__get_CurrentSprite, Vector2D__Rotate_Z114CB6F, Vector2D__Normalize, degreesToRadians, Enemy__get_IsAlive, GameObject__get_BasicGameObject, firingTolerance, WallRenderingResult, textureHeight, Side, textureWidth, Vector2D } from \"../Model.fs.js\";\nimport { cast } from \"./Ray.fs.js\";\nimport { fold as fold_1, empty, singleton, append, item, length } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { uncurry, equals, min, comparePrimitives, max } from \"../fable_modules/fable-library.3.7.9/Util.js\";\nimport { rangeDouble } from \"../fable_modules/fable-library.3.7.9/Range.js\";\nimport { op_UnaryNegation_Int32 } from \"../fable_modules/fable-library.3.7.9/Int32.js\";\nimport { map, defaultArg } from \"../fable_modules/fable-library.3.7.9/Option.js\";\nimport { tryFindIndex } from \"../fable_modules/fable-library.3.7.9/Array.js\";\n\nexport function Walls_draw(width, height, setPixel, getTextureStripOffset, getTextureColor, game) {\n const posX = game.Camera.Position.vX;\n const posY = game.Camera.Position.vY;\n const viewportWidth = width;\n const viewportHeight = height;\n return fold((previousResult, viewportX) => {\n const cameraX = ((2 * viewportX) / viewportWidth) - 1;\n const rayDirection = new Vector2D(game.Camera.Direction.vX + (game.Camera.Plane.vX * cameraX), game.Camera.Direction.vY + (game.Camera.Plane.vY * cameraX));\n const patternInput = cast(() => [posX, posY, rayDirection], (tupledArg) => {\n const mapX = tupledArg[3] | 0;\n const mapY = tupledArg[4] | 0;\n if (!tupledArg[0]) {\n if (((mapX >= 0) && (mapX < length(item(0, game.Map)))) && (mapY >= 0)) {\n return mapY < length(game.Map);\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }, game);\n const side = patternInput[7];\n const hitMapY = patternInput[6] | 0;\n const hitMapX = patternInput[5] | 0;\n const perpendicularWallDistance = (side.tag === 1) ? (patternInput[4] - patternInput[2]) : (patternInput[3] - patternInput[1]);\n const perpendicularWallDistance_1 = (item(hitMapX, item(hitMapY, game.Map)).tag === 1) ? (perpendicularWallDistance + 0.5) : perpendicularWallDistance;\n const lineHeight = viewportHeight / perpendicularWallDistance_1;\n const startY = max(comparePrimitives, ((-lineHeight) / 2) + (viewportHeight / 2), 0);\n const endY = min(comparePrimitives, (lineHeight / 2) + (viewportHeight / 2), viewportHeight - 1);\n const matchValue_1 = item(hitMapX, item(hitMapY, game.Map));\n switch (matchValue_1.tag) {\n case 0: {\n const wall = matchValue_1.fields[0];\n const wallX = (side.tag === 1) ? (posX + (perpendicularWallDistance_1 * rayDirection.vX)) : (posY + (perpendicularWallDistance_1 * rayDirection.vY));\n const rawTextureX = (~(~((wallX - Math.floor(wallX)) * textureWidth))) | 0;\n const patternInput_1 = (equals(side, new Side(0)) && (rayDirection.vX > 0)) ? [(textureWidth - rawTextureX) - 1, wall.NorthSouthTextureIndex] : ((equals(side, new Side(1)) && (rayDirection.vY < 0)) ? [(textureWidth - rawTextureX) - 1, wall.EastWestTextureIndex] : [rawTextureX, equals(side, new Side(0)) ? wall.NorthSouthTextureIndex : wall.EastWestTextureIndex]);\n const lineHeight_1 = viewportHeight / perpendicularWallDistance_1;\n const step = (1 * textureHeight) / lineHeight_1;\n const texPos = ((startY - (viewportHeight / 2)) + (lineHeight_1 / 2)) * step;\n const textureOffset = getTextureStripOffset(patternInput_1[1], ~(~patternInput_1[0]));\n iterate((drawY) => {\n setPixel(getTextureColor(textureOffset, (~(~(texPos + (step * drawY)))) & ((~(~textureHeight)) - 1)), ~(~viewportX), drawY + (~(~startY)));\n }, rangeDouble(0, 1, ~(~(endY - startY))));\n break;\n }\n case 1: {\n const door = item(matchValue_1.fields[0], game.Doors);\n const wallX_1 = equals(side, new Side(0)) ? (posY + (perpendicularWallDistance_1 * rayDirection.vY)) : (posX + (perpendicularWallDistance_1 * rayDirection.vX));\n const lineHeight_2 = viewportHeight / perpendicularWallDistance_1;\n const step_1 = (1 * textureHeight) / lineHeight_2;\n const texPos_1 = ((startY - (viewportHeight / 2)) + (lineHeight_2 / 2)) * step_1;\n const textureOffset_1 = getTextureStripOffset(door.TextureIndex, ~(~max(comparePrimitives, 0, ((textureWidth - (~(~((wallX_1 - Math.floor(wallX_1)) * textureWidth)))) - 1) - door.Offset)));\n iterate((drawY_1) => {\n setPixel(getTextureColor(textureOffset_1, (~(~(texPos_1 + (step_1 * drawY_1)))) & ((~(~textureHeight)) - 1)), ~(~viewportX), drawY_1 + (~(~startY)));\n }, rangeDouble(0, 1, ~(~(endY - startY))));\n break;\n }\n default: {\n }\n }\n return new WallRenderingResult(append(previousResult.ZIndexes, singleton(perpendicularWallDistance_1)), (viewportX === (viewportWidth / 2)) ? [hitMapX, hitMapY] : previousResult.WallInFrontOfPlayer, (viewportX === (viewportWidth / 2)) ? perpendicularWallDistance_1 : previousResult.DistanceToWallInFrontOfPlayer, previousResult.SpriteInFrontOfPlayerIndexOption);\n }, new WallRenderingResult(empty(), [-1, -1], -1, void 0), rangeDouble(0, 1, viewportWidth - 1));\n}\n\nexport function Objects_isPointInTriangle(p1, p2, p3, testPoint) {\n const a = (((p2.vY - p3.vY) * (testPoint.vX - p3.vX)) + ((p3.vX - p2.vX) * (testPoint.vY - p3.vY))) / (((p2.vY - p3.vY) * (p1.vX - p3.vX)) + ((p3.vX - p2.vX) * (p1.vY - p3.vY)));\n const b = (((p3.vY - p1.vY) * (testPoint.vX - p3.vX)) + ((p1.vX - p3.vX) * (testPoint.vY - p3.vY))) / (((p2.vY - p3.vY) * (p1.vX - p3.vX)) + ((p3.vX - p2.vX) * (p1.vY - p3.vY)));\n const c = (1 - a) - b;\n if (((((a >= 0) && (a <= 1)) && (b >= 0)) && (b <= 1)) && (c >= 0)) {\n return c <= 1;\n }\n else {\n return false;\n }\n}\n\nexport function Objects_draw(width, height, getPixel, setPixel, isTransparent, getSpriteOffsets, game, sprites, wallRenderResult) {\n const planeX = game.Camera.Plane.vX;\n const planeY = game.Camera.Plane.vY;\n const dirX = game.Camera.Direction.vX;\n const dirY = game.Camera.Direction.vY;\n const hitDetectionLeft = ((~(~((~(~width)) / 2))) - (~(~(firingTolerance / 2)))) | 0;\n const hitDetectionRight = (hitDetectionLeft + firingTolerance) | 0;\n return new WallRenderingResult(wallRenderResult.ZIndexes, wallRenderResult.WallInFrontOfPlayer, wallRenderResult.DistanceToWallInFrontOfPlayer, fold_1(uncurry(2, (tupledArg_1) => {\n const gameObjectIndex = tupledArg_1[1] | 0;\n return (sprite) => {\n const spriteX = GameObject__get_BasicGameObject(sprite).Position.vX - game.Camera.Position.vX;\n const spriteY = GameObject__get_BasicGameObject(sprite).Position.vY - game.Camera.Position.vY;\n const invDet = 1 / ((planeX * dirY) - (planeY * dirX));\n const transformY = invDet * (((-planeY) * spriteX) + (planeX * spriteY));\n const spriteScreenX = (width / 2) * (1 + ((invDet * ((dirY * spriteX) - (dirX * spriteY))) / transformY));\n const spriteHeight = (~(~Math.abs(height / transformY))) | 0;\n const drawStartY = max(comparePrimitives, 0, (~(~(op_UnaryNegation_Int32(spriteHeight) / 2))) + (~(~((~(~height)) / 2)))) | 0;\n const drawEndY = min(comparePrimitives, (~(~height)) - 1, (~(~(spriteHeight / 2))) + (~(~((~(~height)) / 2)))) | 0;\n const spriteWidth = (~(~Math.abs(height / transformY))) | 0;\n const drawStartX = max(comparePrimitives, 0, (~(~(op_UnaryNegation_Int32(spriteWidth) / 2))) + (~(~spriteScreenX))) | 0;\n const drawEndX = min(comparePrimitives, (~(~width)) - 1, (~(~(spriteWidth / 2))) + (~(~spriteScreenX))) | 0;\n let spriteIndex;\n const gameObject = sprite;\n if (gameObject.tag === 1) {\n const e = gameObject.fields[0];\n spriteIndex = (Enemy__get_IsAlive(e) ? defaultArg(map((directionVector) => {\n const spriteQuadrants = 8;\n const quadrantSize = degreesToRadians(360 / spriteQuadrants);\n const playerRelativePosition = Vector2D__Normalize(new Vector2D(game.Camera.Position.vX - e.BasicGameObject.Position.vX, game.Camera.Position.vY - e.BasicGameObject.Position.vY));\n const playerTestPoint = new Vector2D(playerRelativePosition.vX / 2, playerRelativePosition.vY / 2);\n const p1 = new Vector2D(0, 0);\n return (e.BasicGameObject.SpriteIndex + defaultArg(tryFindIndex((tupledArg) => Objects_isPointInTriangle(p1, tupledArg[0], tupledArg[1], playerTestPoint), toArray(map_1((quadrant) => {\n const centerAngle = quadrant * quadrantSize;\n const endAngle = centerAngle + (quadrantSize / 2);\n return [Vector2D__Rotate_Z114CB6F(directionVector, centerAngle - (quadrantSize / 2)), Vector2D__Rotate_Z114CB6F(directionVector, endAngle)];\n }, rangeDouble(0, 1, spriteQuadrants - 1)))), 0)) | 0;\n }, e.DirectionVector), e.BasicGameObject.SpriteIndex) : item(e.CurrentAnimationFrame, e.DeathSpriteIndexes));\n }\n else {\n spriteIndex = gameObject.fields[0].SpriteIndex;\n }\n const spriteOffsets = getSpriteOffsets(spriteIndex);\n const spriteTexture = sprites[spriteIndex];\n const lineHeight = height / transformY;\n const step = (1 * textureHeight) / lineHeight;\n return ((drawStartX >= 0) && (drawEndX < (~(~width)))) ? [fold((gameObjectHitIndex, stripe) => {\n const textureX = (~(~((~(~(((256 * (stripe - ((op_UnaryNegation_Int32(spriteWidth) / 2) + spriteScreenX))) * 64) / spriteWidth))) / 256))) | 0;\n if ((((transformY > 0) && (stripe > 0)) && (stripe < (~(~width)))) && (transformY < item(stripe, wallRenderResult.ZIndexes))) {\n if ((textureX >= (~(~spriteOffsets.FirstColumn))) && (textureX <= (~(~spriteOffsets.LastColumn)))) {\n iterate((y_4) => {\n const color = getPixel(spriteTexture, textureX, ~(~(((y_4 - (height / 2)) + (lineHeight / 2)) * step)));\n if (!isTransparent(color)) {\n setPixel(color, stripe, y_4);\n }\n }, rangeDouble(drawStartY, 1, drawEndY - 1));\n if ((GameObject__get_BasicGameObject(sprite).CollidesWithBullets && (stripe > hitDetectionLeft)) && (stripe < hitDetectionRight)) {\n return gameObjectIndex;\n }\n else {\n return gameObjectHitIndex;\n }\n }\n else {\n return gameObjectHitIndex;\n }\n }\n else {\n return gameObjectHitIndex;\n }\n }, tupledArg_1[0], rangeDouble(drawStartX, 1, drawEndX - 1)), gameObjectIndex + 1] : [void 0, 0];\n };\n }), [void 0, 0], game.GameObjects)[0]);\n}\n\nexport function Weapons_drawPlayerWeapon(canvasWidth, canvasHeight, drawImage, game) {\n const height = canvasHeight;\n const xPos = (canvasWidth / 2) - (height / 2);\n return drawImage(PlayerWeapon__get_CurrentSprite(item(game.Player.CurrentWeaponIndex, game.Player.Weapons)), xPos, 0, height, height);\n}\n\n","import { some } from \"../fable_modules/fable-library.3.7.9/Option.js\";\nimport { sortByDescending, map, length, mapIndexed, item } from \"../fable_modules/fable-library.3.7.9/List.js\";\nimport { DoorState, DoorStatus, Vector2D_op_Subtraction_3C4D5180, Vector2D__UnsquaredDistanceFrom_Z41DD997C, GameObject__get_BasicGameObject, GameObject__UpdateBasicGameObject_6358EEEA, Enemy, EnemyStateType, BasicGameObject as BasicGameObject_1, Enemy__get_IsAlive, GameObject, PlayerWeapon__get_AnimationFrames, SoundEffect, PlayerWeapon, Player as Player_3, Cell, Vector2D__get_CrossProduct, Game, Camera as Camera_3, Vector2D } from \"../Model.fs.js\";\nimport { comparePrimitives, equals } from \"../fable_modules/fable-library.3.7.9/Util.js\";\nimport { playRandomEnemyDeathSoundEffectAtVolume, playSoundEffect } from \"../Audio.fs.js\";\nimport { applyAi } from \"./AI.fs.js\";\n\nconst weaponAnimationFrameTime = 100;\n\nconst deathAnimationFrameTime = 100;\n\nconst actionDistanceTolerance = 0.75;\n\nconst doorOpeningTime = 1000;\n\nconst doorOpenTime = 5000;\n\nexport function updateFrame(game, frameTime, renderingResult) {\n let inputRecord_4, TimeToNextWeaponFrame_1;\n const $007CIsActive$007C_$007C = (controlState, game_1) => {\n if ((game_1.ControlState & controlState) > 0) {\n return some(void 0);\n }\n else {\n return void 0;\n }\n };\n const frameMultiplier = frameTime / 1000;\n const movementSpeed = 6 * frameMultiplier;\n const rotationSpeed = 4 * frameMultiplier;\n const posX = game.Camera.Position.vX;\n const posY = game.Camera.Position.vY;\n const dirX = game.Camera.Direction.vX;\n const dirY = game.Camera.Direction.vY;\n const move = (speed, inputGame) => {\n let inputRecord_1;\n const canTraverse = (cell) => {\n switch (cell.tag) {\n case 1: {\n const matchValue = item(cell.fields[0], game.Doors).Status;\n switch (matchValue.tag) {\n case 2:\n case 0: {\n return true;\n }\n default: {\n return false;\n }\n }\n }\n case 0: {\n return false;\n }\n default: {\n return true;\n }\n }\n };\n return new Game(inputGame.Map, inputGame.GameObjects, inputGame.Player, (inputRecord_1 = inputGame.Camera, new Camera_3(new Vector2D(canTraverse(item(~(~(posX + (dirX * speed))), item(~(~posY), game.Map))) ? (posX + (dirX * speed)) : posX, canTraverse(item(~(~posX), item(~(~(posY + (dirY * speed))), game.Map))) ? (posY + (dirY * speed)) : posY), inputRecord_1.Direction, inputRecord_1.Plane, inputRecord_1.FieldOfView)), inputGame.ControlState, inputGame.IsFiring, inputGame.TimeToNextWeaponFrame, inputGame.Doors);\n };\n const strafe = (speed_1, inputGame_1) => {\n let inputRecord_3;\n const strafeDirection = Vector2D__get_CrossProduct(game.Camera.Direction);\n const strafeX = strafeDirection.vX;\n const strafeY = strafeDirection.vY;\n return new Game(inputGame_1.Map, inputGame_1.GameObjects, inputGame_1.Player, (inputRecord_3 = inputGame_1.Camera, new Camera_3(new Vector2D(equals(item(~(~(posX + (strafeX * speed_1))), item(~(~posY), game.Map)), new Cell(2)) ? (posX + (strafeX * speed_1)) : posX, equals(item(~(~posX), item(~(~(posY + (strafeY * speed_1))), game.Map)), new Cell(2)) ? (posY + (strafeY * speed_1)) : posY), inputRecord_3.Direction, inputRecord_3.Plane, inputRecord_3.FieldOfView)), inputGame_1.ControlState, inputGame_1.IsFiring, inputGame_1.TimeToNextWeaponFrame, inputGame_1.Doors);\n };\n let game_7;\n let game_4;\n let game_3;\n let tupledArg;\n let game_5;\n let g_4;\n let g_3;\n let g_2;\n let g_1;\n const g = game;\n g_1 = (($007CIsActive$007C_$007C(1, g) != null) ? move(movementSpeed, g) : g);\n g_2 = (($007CIsActive$007C_$007C(32, g_1) != null) ? move((-movementSpeed) / 2, g_1) : g_1);\n g_3 = (($007CIsActive$007C_$007C(8, g_2) != null) ? strafe(-movementSpeed, g_2) : g_2);\n g_4 = (($007CIsActive$007C_$007C(16, g_3) != null) ? strafe(movementSpeed, g_3) : g_3);\n let pattern_matching_result;\n if ($007CIsActive$007C_$007C(2, g_4) != null) {\n pattern_matching_result = 0;\n }\n else if ($007CIsActive$007C_$007C(4, g_4) != null) {\n pattern_matching_result = 0;\n }\n else {\n pattern_matching_result = 1;\n }\n switch (pattern_matching_result) {\n case 0: {\n const inputGame_2 = g_4;\n const rotationMultiplier = ($007CIsActive$007C_$007C(4, inputGame_2) != null) ? -1 : (($007CIsActive$007C_$007C(2, inputGame_2) != null) ? 1 : 0);\n const planeX = game.Camera.Plane.vX;\n const planeY = game.Camera.Plane.vY;\n game_5 = (new Game(inputGame_2.Map, inputGame_2.GameObjects, inputGame_2.Player, (inputRecord_4 = inputGame_2.Camera, new Camera_3(inputRecord_4.Position, new Vector2D((dirX * Math.cos(rotationMultiplier * rotationSpeed)) - (dirY * Math.sin(rotationMultiplier * rotationSpeed)), (dirX * Math.sin(rotationMultiplier * rotationSpeed)) + (dirY * Math.cos(rotationMultiplier * rotationSpeed))), new Vector2D((planeX * Math.cos(rotationMultiplier * rotationSpeed)) - (planeY * Math.sin(rotationMultiplier * rotationSpeed)), (planeX * Math.sin(rotationMultiplier * rotationSpeed)) + (planeY * Math.cos(rotationMultiplier * rotationSpeed))), inputRecord_4.FieldOfView)), inputGame_2.ControlState, inputGame_2.IsFiring, inputGame_2.TimeToNextWeaponFrame, inputGame_2.Doors));\n break;\n }\n case 1: {\n game_5 = g_4;\n break;\n }\n }\n const isFireKeyPressed = (game_5.ControlState & 64) > 0;\n const updatePlayerWithWeapon = (weapon) => {\n const inputRecord_7 = game_5.Player;\n return new Player_3(inputRecord_7.Score, inputRecord_7.Health, inputRecord_7.Radius, inputRecord_7.CurrentWeaponIndex, inputRecord_7.Ammunition, mapIndexed((i_1, wp) => {\n if (i_1 === game_5.Player.CurrentWeaponIndex) {\n return weapon;\n }\n else {\n return wp;\n }\n }, game_5.Player.Weapons));\n };\n const currentWeapon = item(game_5.Player.CurrentWeaponIndex, game_5.Player.Weapons);\n const matchValue_4 = [game_5.IsFiring, game_5.TimeToNextWeaponFrame, isFireKeyPressed];\n let pattern_matching_result_1;\n if (matchValue_4[0]) {\n if (matchValue_4[1] == null) {\n pattern_matching_result_1 = 2;\n }\n else {\n pattern_matching_result_1 = 1;\n }\n }\n else if (matchValue_4[1] == null) {\n if (matchValue_4[2]) {\n pattern_matching_result_1 = 0;\n }\n else {\n pattern_matching_result_1 = 3;\n }\n }\n else {\n pattern_matching_result_1 = 3;\n }\n switch (pattern_matching_result_1) {\n case 0: {\n const updatedWeapon = new PlayerWeapon(currentWeapon.Sprites, 1, currentWeapon.Damage, currentWeapon.AutoRepeat);\n playSoundEffect(new SoundEffect(0));\n tupledArg = [new Game(game_5.Map, game_5.GameObjects, updatePlayerWithWeapon(updatedWeapon), game_5.Camera, game_5.ControlState, true, weaponAnimationFrameTime, game_5.Doors), true];\n break;\n }\n case 1: {\n const newTimeRemaining = matchValue_4[1] - frameTime;\n tupledArg = ((newTimeRemaining < 0) ? (((currentWeapon.CurrentFrame + 1) < PlayerWeapon__get_AnimationFrames(currentWeapon)) ? [(TimeToNextWeaponFrame_1 = (weaponAnimationFrameTime + newTimeRemaining), new Game(game_5.Map, game_5.GameObjects, updatePlayerWithWeapon(new PlayerWeapon(currentWeapon.Sprites, currentWeapon.CurrentFrame + 1, currentWeapon.Damage, currentWeapon.AutoRepeat)), game_5.Camera, game_5.ControlState, game_5.IsFiring, TimeToNextWeaponFrame_1, game_5.Doors)), false] : [new Game(game_5.Map, game_5.GameObjects, updatePlayerWithWeapon(new PlayerWeapon(currentWeapon.Sprites, 0, currentWeapon.Damage, currentWeapon.AutoRepeat)), game_5.Camera, game_5.ControlState, false, void 0, game_5.Doors), false]) : [new Game(game_5.Map, game_5.GameObjects, game_5.Player, game_5.Camera, game_5.ControlState, game_5.IsFiring, newTimeRemaining, game_5.Doors), false]);\n break;\n }\n case 2: {\n tupledArg = [game_5, false];\n break;\n }\n case 3: {\n tupledArg = [game_5, false];\n break;\n }\n }\n const game_6 = tupledArg[0];\n game_3 = (new Game(game_6.Map, mapIndexed((i_2, go_1) => {\n let gameObject, e, timeRemainingInAnimationFrame, matchValue_5, firingHitGameObjectIndex, inputRecord_8, inputRecord_5, UnsquaredDistanceFromPlayer;\n const go = applyAi(game_6, (gameObject = go_1, (gameObject.tag === 0) ? (new GameObject(0, gameObject.fields[0])) : ((e = gameObject.fields[0], (timeRemainingInAnimationFrame = (e.TimeUntilNextAnimationFrame - frameTime), new GameObject(1, Enemy__get_IsAlive(e) ? ((matchValue_5 = [renderingResult.SpriteInFrontOfPlayerIndexOption, tupledArg[1]], (matchValue_5[0] != null) ? (matchValue_5[1] ? ((firingHitGameObjectIndex = (matchValue_5[0] | 0), (firingHitGameObjectIndex === i_2) ? ((playRandomEnemyDeathSoundEffectAtVolume(1), new Enemy(e.EnemyType, (inputRecord_8 = e.BasicGameObject, new BasicGameObject_1(inputRecord_8.Position, inputRecord_8.PlayerRelativePosition, inputRecord_8.UnsquaredDistanceFromPlayer, inputRecord_8.SpriteIndex, false)), e.DirectionVector, e.Direction, e.DeathSpriteIndexes, e.AttackSpriteIndexes, e.SpriteBlocks, e.FramesPerBlock, 0, deathAnimationFrameTime, new EnemyStateType(7)))) : e)) : e) : e)) : ((e.CurrentAnimationFrame < (length(e.DeathSpriteIndexes) - 1)) ? ((timeRemainingInAnimationFrame < 0) ? (new Enemy(e.EnemyType, e.BasicGameObject, e.DirectionVector, e.Direction, e.DeathSpriteIndexes, e.AttackSpriteIndexes, e.SpriteBlocks, e.FramesPerBlock, e.CurrentAnimationFrame + 1, deathAnimationFrameTime + timeRemainingInAnimationFrame, e.State)) : (new Enemy(e.EnemyType, e.BasicGameObject, e.DirectionVector, e.Direction, e.DeathSpriteIndexes, e.AttackSpriteIndexes, e.SpriteBlocks, e.FramesPerBlock, e.CurrentAnimationFrame, timeRemainingInAnimationFrame, e.State))) : e)))))));\n const game_2 = game_6;\n return GameObject__UpdateBasicGameObject_6358EEEA(go, (inputRecord_5 = GameObject__get_BasicGameObject(go), (UnsquaredDistanceFromPlayer = Vector2D__UnsquaredDistanceFrom_Z41DD997C(game_2.Camera.Position, GameObject__get_BasicGameObject(go).Position), new BasicGameObject_1(inputRecord_5.Position, Vector2D_op_Subtraction_3C4D5180(GameObject__get_BasicGameObject(go).Position, game_2.Camera.Position), UnsquaredDistanceFromPlayer, inputRecord_5.SpriteIndex, inputRecord_5.CollidesWithBullets))));\n }, game_6.GameObjects), game_6.Player, game_6.Camera, game_6.ControlState, game_6.IsFiring, game_6.TimeToNextWeaponFrame, game_6.Doors));\n if ((renderingResult.DistanceToWallInFrontOfPlayer <= actionDistanceTolerance) && ((game_3.ControlState & 128) > 0)) {\n const patternInput = renderingResult.WallInFrontOfPlayer;\n const matchValue_1 = item(patternInput[0], item(patternInput[1], game_3.Map));\n if (matchValue_1.tag === 1) {\n const doorIndex_1 = matchValue_1.fields[0] | 0;\n let newDoorState;\n if (item(doorIndex_1, game_3.Doors).Status.tag === 3) {\n playSoundEffect(new SoundEffect(4));\n const inputRecord_6 = item(doorIndex_1, game_3.Doors);\n newDoorState = (new DoorState(inputRecord_6.TextureIndex, inputRecord_6.DoorDirection, new DoorStatus(0), inputRecord_6.Offset, doorOpeningTime, inputRecord_6.MapPosition));\n }\n else {\n newDoorState = item(doorIndex_1, game_3.Doors);\n }\n game_4 = (new Game(game_3.Map, game_3.GameObjects, game_3.Player, game_3.Camera, game_3.ControlState, game_3.IsFiring, game_3.TimeToNextWeaponFrame, mapIndexed((i, d) => {\n if (i === doorIndex_1) {\n return newDoorState;\n }\n else {\n return d;\n }\n }, game_3.Doors)));\n }\n else {\n game_4 = game_3;\n }\n }\n else {\n game_4 = game_3;\n }\n game_7 = (new Game(game_4.Map, game_4.GameObjects, game_4.Player, game_4.Camera, game_4.ControlState, game_4.IsFiring, game_4.TimeToNextWeaponFrame, map((doorState_1) => {\n const newTimeRemainingInAnimationState = doorState_1.TimeRemainingInAnimationState - frameTime;\n const matchValue_3 = doorState_1.Status;\n switch (matchValue_3.tag) {\n case 0: {\n if (newTimeRemainingInAnimationState < 0) {\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, new DoorStatus(2), 64, doorOpenTime, doorState_1.MapPosition);\n }\n else {\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, doorState_1.Status, ((doorOpeningTime - newTimeRemainingInAnimationState) / doorOpeningTime) * 64, newTimeRemainingInAnimationState, doorState_1.MapPosition);\n }\n }\n case 2: {\n if (newTimeRemainingInAnimationState < 0) {\n playSoundEffect(new SoundEffect(5));\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, new DoorStatus(1), doorState_1.Offset, doorOpeningTime, doorState_1.MapPosition);\n }\n else {\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, doorState_1.Status, doorState_1.Offset, newTimeRemainingInAnimationState, doorState_1.MapPosition);\n }\n }\n case 1: {\n if (newTimeRemainingInAnimationState < 0) {\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, new DoorStatus(3), 0, doorOpeningTime, doorState_1.MapPosition);\n }\n else {\n return new DoorState(doorState_1.TextureIndex, doorState_1.DoorDirection, doorState_1.Status, 64 - (((doorOpeningTime - newTimeRemainingInAnimationState) / doorOpeningTime) * 64), newTimeRemainingInAnimationState, doorState_1.MapPosition);\n }\n }\n default: {\n return doorState_1;\n }\n }\n }, game_4.Doors)));\n return new Game(game_7.Map, sortByDescending((s) => GameObject__get_BasicGameObject(s).UnsquaredDistanceFromPlayer, game_7.GameObjects, {\n Compare: comparePrimitives,\n }), game_7.Player, game_7.Camera, game_7.ControlState, game_7.IsFiring, game_7.TimeToNextWeaponFrame, game_7.Doors);\n}\n\n","import { FSharpException } from \"./fable_modules/fable-library.3.7.9/Types.js\";\nimport { class_type } from \"./fable_modules/fable-library.3.7.9/Reflection.js\";\nimport { equals } from \"./fable_modules/fable-library.3.7.9/Util.js\";\nimport { SpriteLayout } from \"./Model.fs.js\";\nimport { VSWAP, isShareware } from \"./Assets.fs.js\";\nimport { Texture__getPixel, Texture__setPixel } from \"./Model.Platform.fs.js\";\nimport { singleton } from \"./fable_modules/fable-library.3.7.9/AsyncBuilder.js\";\nimport { loadAsset } from \"./Utils.fs.js\";\n\nexport class MissingGraphicsPackException extends FSharpException {\n constructor() {\n super();\n }\n}\n\nexport function MissingGraphicsPackException$reflection() {\n return class_type(\"App.GraphicsCommon.MissingGraphicsPackException\", void 0, MissingGraphicsPackException, class_type(\"System.Exception\"));\n}\n\nfunction MissingGraphicsPackException__Equals_229D3F39(this$, obj) {\n if (!equals(this$, null)) {\n if (!equals(obj, null)) {\n if (obj instanceof MissingGraphicsPackException) {\n return 1;\n }\n else {\n return false;\n }\n }\n else {\n return false;\n }\n }\n else if (!equals(obj, null)) {\n return false;\n }\n else {\n return true;\n }\n}\n\nexport const gamePalette = new Uint32Array([4278190080, 4289200128, 4278233088, 4289243136, 4278190248, 4289200296, 4278211752, 4289243304, 4283716692, 4294726740, 4283759700, 4294769748, 4283716860, 4294726908, 4283759868, 4294769916, 4293717228, 4292664540, 4291875024, 4290822336, 4290032820, 4289243304, 4288190616, 4287401100, 4286348412, 4285558896, 4284769380, 4283716692, 4282927176, 4281874488, 4281084972, 4280295456, 4278190332, 4278190316, 4278190304, 4278190292, 4278190280, 4278190268, 4278190256, 4278190244, 4278190232, 4278190216, 4278190204, 4278190192, 4278190180, 4278190168, 4278190156, 4278190144, 4292401404, 4290296060, 4288453884, 4286348540, 4284243196, 4282401020, 4280295676, 4278190332, 4284262652, 4282423548, 4280322300, 4278221052, 4278217956, 4278214860, 4278211764, 4278209692, 4292410620, 4290313468, 4288478460, 4286381308, 4284283132, 4282447100, 4280349948, 4278252796, 4278245604, 4278240460, 4278234292, 4278230172, 4278224004, 4278217840, 4278211672, 4278206528, 4284284112, 4282449092, 4280351924, 4278254752, 4278248592, 4278242432, 4278236276, 4278230112, 4292410584, 4290313404, 4288478364, 4286381184, 4284284000, 4282448960, 4280351776, 4278254592, 4278254592, 4278250496, 4278247424, 4278244352, 4278241284, 4278238212, 4278235140, 4278232068, 4278228996, 4278224900, 4278221828, 4278218756, 4278215684, 4278212612, 4278209540, 4278206468, 4294769880, 4294769848, 4294769820, 4294507644, 4294769756, 4294769728, 4294769696, 4294769664, 4293190656, 4291611648, 4290032640, 4288453632, 4286874624, 4285558784, 4283979776, 4282400768, 4294753372, 4294750272, 4294748192, 4294745088, 4293168128, 4291591168, 4290014208, 4288437248, 4294760664, 4294753464, 4294745244, 4294738044, 4294729820, 4294721600, 4294714400, 4294706176, 4294705152, 4293656576, 4292870144, 4292083712, 4291297280, 4290510848, 4289724416, 4288937984, 4288151552, 4287102976, 4286316544, 4285530112, 4284743680, 4283957248, 4283170816, 4282384384, 4280821800, 4281655548, 4280603900, 4279815420, 4278763772, 4278236412, 4294713524, 4294705320, 4293132440, 4291559552, 4289986676, 4288413792, 4286840912, 4285530180, 4283957300, 4282384424, 4294760700, 4294752508, 4294745340, 4294737148, 4294728956, 4294721788, 4294713596, 4294705404, 4293132512, 4291559624, 4289986740, 4288413852, 4286840964, 4285530220, 4283957336, 4282384448, 4292667644, 4291879164, 4291090684, 4290565372, 4289776892, 4288988412, 4288462076, 4287674620, 4286623996, 4285572348, 4284521724, 4284257520, 4283993320, 4283730140, 4283465936, 4283202760, 4282939580, 4282675380, 4282411176, 4282148000, 4281884828, 4281621648, 4281358472, 4281094272, 4280831092, 4280567916, 4280303708, 4280040532, 4279777352, 4279775296, 4279512120, 4278984744, 4284743776, 4284769280, 4284506112, 4280025088, 4281073664, 4279247920, 4282908744, 4283433040, 4281597952, 4280032284, 4283190348, 4284243036, 4282400832, 4281348144, 4281611316, 4294243544, 4293454008, 4292664476, 4291348596, 4290822216, 4290032672, 4289769504, 4288979968, 4288190464, 4287400960, 4286874624, 4286348288, 4286085120, 4285821952, 4285558784, 4285295616, 4287103128]);\n\nexport function spriteOffsets(vswapView, _arg1, spriteIndex) {\n const firstSprite = vswapView.getUint16(2, true);\n const spriteOffset = vswapView.getUint32(6 + (4 * ((~(~firstSprite)) + spriteIndex)), true);\n const firstColumnOffset = vswapView.getUint16(~(~spriteOffset), true);\n const lastColumnOffset = vswapView.getUint16((~(~spriteOffset)) + 2, true);\n return new SpriteLayout(spriteOffset, firstColumnOffset, lastColumnOffset, (spriteOffset + 4) + (2 * ((lastColumnOffset - firstColumnOffset) + 1)));\n}\n\nexport function textureStripOffset(_arg1, wallTextureOffset, textureIndex, textureX) {\n return (wallTextureOffset + (4096 * ((isShareware && (textureIndex >= 98)) ? ((56 + textureIndex) - 98) : textureIndex))) + (64 * textureX);\n}\n\nexport function textureColor(vswapView, _arg1, textureOffset, textureY) {\n const paletteIndex = vswapView.getUint8(textureOffset + textureY);\n return gamePalette[~(~paletteIndex)];\n}\n\nexport function setPixel(imageData, color, x, y) {\n Texture__setPixel(imageData, color, x, y);\n}\n\nexport function getPixel(imageData, x, y) {\n return Texture__getPixel(imageData, x, y);\n}\n\nexport function loadGraphics() {\n return singleton.Delay(() => singleton.Bind(loadAsset(VSWAP), (_arg1) => {\n const vswapResult = _arg1;\n let result;\n if (vswapResult.tag === 1) {\n throw (new MissingGraphicsPackException());\n }\n else {\n const vswapView = new DataView(vswapResult.fields[0]);\n result = [vswapView, ~(~vswapView.getUint32(6, true))];\n }\n return singleton.Return(result);\n }));\n}\n\n","import { singleton } from \"./fable_modules/fable-library.3.7.9/AsyncBuilder.js\";\nimport { map, contains, fill } from \"./fable_modules/fable-library.3.7.9/Array.js\";\nimport { iterate } from \"./fable_modules/fable-library.3.7.9/Seq.js\";\nimport { isShareware, isSharewareSprite } from \"./Assets.fs.js\";\nimport { Texture } from \"./Model.Platform.fs.js\";\nimport { rangeDouble } from \"./fable_modules/fable-library.3.7.9/Range.js\";\nimport { structuralHash, equals } from \"./fable_modules/fable-library.3.7.9/Util.js\";\nimport { sleep } from \"./fable_modules/fable-library.3.7.9/Async.js\";\nimport { value as value_1 } from \"./fable_modules/fable-library.3.7.9/Option.js\";\nimport { setPixel, getPixel } from \"./Graphics.Common.fs.js\";\n\nexport function spriteColorIsTransparent(color) {\n return color === 4287234202;\n}\n\nexport function scaleSprite(_arg2, _arg1, image) {\n return image;\n}\n\nexport function loadSprites() {\n return singleton.Delay(() => {\n const textureWidth = 64;\n const textureHeight = 64;\n const imageDataArray = fill(new Array(436), 0, 436, void 0);\n iterate((index) => {\n let image;\n const spriteFileIndex = ((isSharewareSprite(index) ? true : (!isShareware)) ? index : 0) | 0;\n try {\n let returnVal = new Image(textureWidth, textureHeight);\n returnVal.src = (`assets/sprites/s${spriteFileIndex}.png`);\n returnVal.onerror = ((_arg1) => {\n const canvas = window.document.createElement(\"canvas\");\n canvas.width = 64;\n canvas.height = 64;\n const context = canvas.getContext('2d');\n const buffer = context.getImageData(0, 0, 64, 64).data.buffer;\n imageDataArray[index] = (new Texture(new Uint32Array(buffer), new Uint8ClampedArray(buffer), 64, 64));\n });\n image = returnVal;\n }\n catch (matchValue) {\n let returnVal_1 = new Image(textureWidth, textureHeight);\n returnVal_1.src = \"assets/sprites/s0.png\";\n image = returnVal_1;\n }\n const canvas_1 = window.document.createElement(\"canvas\");\n canvas_1.width = image.width;\n canvas_1.height = image.height;\n image.onload = ((_arg2) => {\n const context_1 = canvas_1.getContext('2d');\n context_1.drawImage(image, 0, 0, image.width, image.height);\n const buffer_1 = context_1.getImageData(0, 0, image.width, image.height).data.buffer;\n imageDataArray[index] = (new Texture(new Uint32Array(buffer_1), new Uint8ClampedArray(buffer_1), ~(~image.width), ~(~image.height)));\n });\n }, rangeDouble(0, 1, 435));\n return singleton.Combine(singleton.While(() => contains(void 0, imageDataArray, {\n Equals: equals,\n GetHashCode: structuralHash,\n }), singleton.Delay(() => singleton.Bind(sleep(500), () => singleton.Return()))), singleton.Delay(() => singleton.Return(map(value_1, imageDataArray))));\n });\n}\n\nexport function canvasFromTexture(texture) {\n const canvas = window.document.createElement(\"canvas\");\n canvas.width = texture.Width;\n canvas.height = texture.Height;\n const context = canvas.getContext('2d');\n iterate((y) => {\n iterate((x) => {\n if (spriteColorIsTransparent(getPixel(texture, x, y))) {\n setPixel(texture, 255, x, y);\n }\n }, rangeDouble(0, 1, 63));\n }, rangeDouble(0, 1, 63));\n const imageData = new ImageData(texture.ClampedData,texture.Width,texture.Height);\n context.putImageData(imageData, 0, 0);\n return canvas;\n}\n\n","import { Record } from \"./fable_modules/fable-library.3.7.9/Types.js\";\nimport { record_type, int32_type, uint8_type, class_type, uint32_type } from \"./fable_modules/fable-library.3.7.9/Reflection.js\";\n\nexport class Texture extends Record {\n constructor(Data, ClampedData, Width, Height) {\n super();\n this.Data = Data;\n this.ClampedData = ClampedData;\n this.Width = (Width | 0);\n this.Height = (Height | 0);\n }\n}\n\nexport function Texture$reflection() {\n return record_type(\"App.PlatformModel.Texture\", [], Texture, () => [[\"Data\", class_type(\"Fable.Core.JS.TypedArray`1\", [uint32_type])], [\"ClampedData\", class_type(\"Fable.Core.JS.TypedArray`1\", [uint8_type])], [\"Width\", int32_type], [\"Height\", int32_type]]);\n}\n\nexport function Texture__setPixel(this$, color, x, y) {\n const offset = ((y * this$.Width) + x) | 0;\n this$.Data[offset]=color;\n}\n\nexport function Texture__getPixel(this$, x, y) {\n const offset = ((y * this$.Width) + x) | 0;\n return this$.Data[offset];\n}\n\n","import { Union, Record } from \"./fable_modules/fable-library.3.7.9/Types.js\";\nimport { enum_type, class_type, uint32_type, bool_type, union_type, record_type, option_type, tuple_type, int32_type, list_type, float64_type } from \"./fable_modules/fable-library.3.7.9/Reflection.js\";\nimport { Texture$reflection } from \"./Model.Platform.fs.js\";\nimport { item, length } from \"./fable_modules/fable-library.3.7.9/List.js\";\n\nexport class WallRenderingResult extends Record {\n constructor(ZIndexes, WallInFrontOfPlayer, DistanceToWallInFrontOfPlayer, SpriteInFrontOfPlayerIndexOption) {\n super();\n this.ZIndexes = ZIndexes;\n this.WallInFrontOfPlayer = WallInFrontOfPlayer;\n this.DistanceToWallInFrontOfPlayer = DistanceToWallInFrontOfPlayer;\n this.SpriteInFrontOfPlayerIndexOption = SpriteInFrontOfPlayerIndexOption;\n }\n}\n\nexport function WallRenderingResult$reflection() {\n return record_type(\"App.Model.WallRenderingResult\", [], WallRenderingResult, () => [[\"ZIndexes\", list_type(float64_type)], [\"WallInFrontOfPlayer\", tuple_type(int32_type, int32_type)], [\"DistanceToWallInFrontOfPlayer\", float64_type], [\"SpriteInFrontOfPlayerIndexOption\", option_type(int32_type)]]);\n}\n\nexport class Vector2D extends Record {\n constructor(vX, vY) {\n super();\n this.vX = vX;\n this.vY = vY;\n }\n}\n\nexport function Vector2D$reflection() {\n return record_type(\"App.Model.Vector2D\", [], Vector2D, () => [[\"vX\", float64_type], [\"vY\", float64_type]]);\n}\n\nexport function Vector2D__get_CrossProduct(x) {\n return new Vector2D(x.vY, -x.vX);\n}\n\nexport function Vector2D_op_Subtraction_3C4D5180(a, b) {\n return new Vector2D(a.vX - b.vX, a.vY - b.vY);\n}\n\nexport function Vector2D_op_Multiply_Z23A8CFC1(a, b) {\n return new Vector2D(a.vX * b, a.vY * b);\n}\n\nexport function Vector2D__UnsquaredDistanceFrom_Z41DD997C(this$, other) {\n return ((this$.vX - other.vX) * (this$.vX - other.vX)) + ((this$.vY - other.vY) * (this$.vY - other.vY));\n}\n\nexport function Vector2D__Normalize(this$) {\n const distance = Math.sqrt((this$.vX * this$.vX) + (this$.vY * this$.vY));\n return new Vector2D(this$.vX / distance, this$.vY / distance);\n}\n\nexport function Vector2D__Abs(this$) {\n return new Vector2D(Math.abs(this$.vX), Math.abs(this$.vY));\n}\n\nexport function Vector2D__Rotate_Z114CB6F(this$, angle) {\n const ca = Math.cos(angle);\n const sa = Math.sin(angle);\n return new Vector2D((ca * this$.vX) - (sa * this$.vY), (sa * this$.vX) + (ca * this$.vY));\n}\n\nexport function Vector2D__get_StringValue(this$) {\n return `{ vX: ${this$.vX}, vY: ${this$.vY} }`;\n}\n\nexport function Vector2D__IsBetween(this$, a, b) {\n if ((((a.vY * b.vX) - (a.vX * b.vY)) * ((a.vY * this$.vX) - (a.vX * this$.vY))) >= 0) {\n return (((this$.vX * b.vX) - (this$.vX * b.vY)) * ((this$.vY * a.vX) - (this$.vX * a.vY))) >= 0;\n }\n else {\n return false;\n }\n}\n\nexport function Vector2D__get_Magnitude(this$) {\n return Math.sqrt((this$.vX * this$.vX) + (this$.vY * this$.vY));\n}\n\nexport function Vector2D__AngleBetween_Z41DD997C(a, b) {\n return Math.acos((((a.vX * b.vX) + (a.vY * b.vY)) / Vector2D__get_Magnitude(a)) * Vector2D__get_Magnitude(b)) * 1;\n}\n\nexport function radiansToDegrees(r) {\n return (r * 180) / (3.141592653589793 * 1);\n}\n\nexport function degreesToRadians(d) {\n return ((d * 3.141592653589793) / 180) * 1;\n}\n\nexport class Side extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"NorthSouth\", \"EastWest\"];\n }\n}\n\nexport function Side$reflection() {\n return union_type(\"App.Model.Side\", [], Side, () => [[], []]);\n}\n\nexport class Wall extends Record {\n constructor(NorthSouthTextureIndex, EastWestTextureIndex) {\n super();\n this.NorthSouthTextureIndex = (NorthSouthTextureIndex | 0);\n this.EastWestTextureIndex = (EastWestTextureIndex | 0);\n }\n}\n\nexport function Wall$reflection() {\n return record_type(\"App.Model.Wall\", [], Wall, () => [[\"NorthSouthTextureIndex\", int32_type], [\"EastWestTextureIndex\", int32_type]]);\n}\n\nexport class SoundEffect extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"PlayerPistol\", \"EnemyDeathAaarrrg\", \"EnemyDeathAieeeeLow\", \"EnemyDeathAieeeeHigh\", \"DoorOpen\", \"DoorClose\"];\n }\n}\n\nexport function SoundEffect$reflection() {\n return union_type(\"App.Model.SoundEffect\", [], SoundEffect, () => [[], [], [], [], [], []]);\n}\n\nexport class DoorDirection extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"NorthSouth\", \"EastWest\"];\n }\n}\n\nexport function DoorDirection$reflection() {\n return union_type(\"App.Model.DoorDirection\", [], DoorDirection, () => [[], []]);\n}\n\nexport class DoorStatus extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Opening\", \"Closing\", \"Open\", \"Closed\"];\n }\n}\n\nexport function DoorStatus$reflection() {\n return union_type(\"App.Model.DoorStatus\", [], DoorStatus, () => [[], [], [], []]);\n}\n\nexport class DoorState extends Record {\n constructor(TextureIndex, DoorDirection, Status, Offset, TimeRemainingInAnimationState, MapPosition) {\n super();\n this.TextureIndex = (TextureIndex | 0);\n this.DoorDirection = DoorDirection;\n this.Status = Status;\n this.Offset = Offset;\n this.TimeRemainingInAnimationState = TimeRemainingInAnimationState;\n this.MapPosition = MapPosition;\n }\n}\n\nexport function DoorState$reflection() {\n return record_type(\"App.Model.DoorState\", [], DoorState, () => [[\"TextureIndex\", int32_type], [\"DoorDirection\", DoorDirection$reflection()], [\"Status\", DoorStatus$reflection()], [\"Offset\", float64_type], [\"TimeRemainingInAnimationState\", float64_type], [\"MapPosition\", tuple_type(int32_type, int32_type)]]);\n}\n\nexport class Cell extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Wall\", \"Door\", \"Empty\"];\n }\n}\n\nexport function Cell$reflection() {\n return union_type(\"App.Model.Cell\", [], Cell, () => [[[\"Item\", Wall$reflection()]], [[\"Item\", int32_type]], []]);\n}\n\nexport class EnemyType extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Guard\", \"Officer\", \"SS\", \"Dog\", \"Zombie\", \"FakeHitler\", \"Hitler\", \"Fettgesicht\", \"Schabbs\", \"Gretel\", \"Hans\", \"Otto\", \"Ghost\"];\n }\n}\n\nexport function EnemyType$reflection() {\n return union_type(\"App.Model.EnemyType\", [], EnemyType, () => [[], [], [], [], [], [], [], [], [], [], [], [], []]);\n}\n\nexport class EnemyStateType extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Standing\", \"Ambushing\", \"Attack\", \"Path\", \"Pain\", \"Shoot\", \"Chase\", \"Die\", \"Dead\"];\n }\n}\n\nexport function EnemyStateType$reflection() {\n return union_type(\"App.Model.EnemyStateType\", [], EnemyStateType, () => [[], [], [], [], [], [], [], [], []]);\n}\n\nexport class BasicGameObject extends Record {\n constructor(Position, PlayerRelativePosition, UnsquaredDistanceFromPlayer, SpriteIndex, CollidesWithBullets) {\n super();\n this.Position = Position;\n this.PlayerRelativePosition = PlayerRelativePosition;\n this.UnsquaredDistanceFromPlayer = UnsquaredDistanceFromPlayer;\n this.SpriteIndex = (SpriteIndex | 0);\n this.CollidesWithBullets = CollidesWithBullets;\n }\n}\n\nexport function BasicGameObject$reflection() {\n return record_type(\"App.Model.BasicGameObject\", [], BasicGameObject, () => [[\"Position\", Vector2D$reflection()], [\"PlayerRelativePosition\", Vector2D$reflection()], [\"UnsquaredDistanceFromPlayer\", float64_type], [\"SpriteIndex\", int32_type], [\"CollidesWithBullets\", bool_type]]);\n}\n\nexport class Enemy extends Record {\n constructor(EnemyType, BasicGameObject, DirectionVector, Direction, DeathSpriteIndexes, AttackSpriteIndexes, SpriteBlocks, FramesPerBlock, CurrentAnimationFrame, TimeUntilNextAnimationFrame, State) {\n super();\n this.EnemyType = EnemyType;\n this.BasicGameObject = BasicGameObject;\n this.DirectionVector = DirectionVector;\n this.Direction = Direction;\n this.DeathSpriteIndexes = DeathSpriteIndexes;\n this.AttackSpriteIndexes = AttackSpriteIndexes;\n this.SpriteBlocks = (SpriteBlocks | 0);\n this.FramesPerBlock = (FramesPerBlock | 0);\n this.CurrentAnimationFrame = (CurrentAnimationFrame | 0);\n this.TimeUntilNextAnimationFrame = TimeUntilNextAnimationFrame;\n this.State = State;\n }\n}\n\nexport function Enemy$reflection() {\n return record_type(\"App.Model.Enemy\", [], Enemy, () => [[\"EnemyType\", EnemyType$reflection()], [\"BasicGameObject\", BasicGameObject$reflection()], [\"DirectionVector\", option_type(Vector2D$reflection())], [\"Direction\", option_type(int32_type)], [\"DeathSpriteIndexes\", list_type(int32_type)], [\"AttackSpriteIndexes\", list_type(int32_type)], [\"SpriteBlocks\", int32_type], [\"FramesPerBlock\", int32_type], [\"CurrentAnimationFrame\", int32_type], [\"TimeUntilNextAnimationFrame\", float64_type], [\"State\", EnemyStateType$reflection()]]);\n}\n\nexport function Enemy__get_StationarySpriteBlockIndex(this$) {\n return this$.BasicGameObject.SpriteIndex;\n}\n\nexport function Enemy__MovementSpriteBlockIndex_Z524259A4(this$, frame) {\n return this$.BasicGameObject.SpriteIndex + (frame * this$.FramesPerBlock);\n}\n\nexport function Enemy__get_NumberOfAnimationFrames(this$) {\n return this$.SpriteBlocks - 1;\n}\n\nexport function Enemy__get_IsAlive(this$) {\n const matchValue = this$.State;\n switch (matchValue.tag) {\n case 8:\n case 7: {\n return false;\n }\n default: {\n return true;\n }\n }\n}\n\nexport class WeaponType extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Knife\", \"Pistol\", \"MachineGun\", \"ChainGun\"];\n }\n}\n\nexport function WeaponType$reflection() {\n return union_type(\"App.Model.WeaponType\", [], WeaponType, () => [[], [], [], []]);\n}\n\nexport class PlayerWeapon extends Record {\n constructor(Sprites, CurrentFrame, Damage, AutoRepeat) {\n super();\n this.Sprites = Sprites;\n this.CurrentFrame = (CurrentFrame | 0);\n this.Damage = (Damage | 0);\n this.AutoRepeat = AutoRepeat;\n }\n}\n\nexport function PlayerWeapon$reflection() {\n return record_type(\"App.Model.PlayerWeapon\", [], PlayerWeapon, () => [[\"Sprites\", list_type(Texture$reflection())], [\"CurrentFrame\", int32_type], [\"Damage\", int32_type], [\"AutoRepeat\", bool_type]]);\n}\n\nexport function PlayerWeapon__get_AnimationFrames(x) {\n return length(x.Sprites);\n}\n\nexport function PlayerWeapon__get_CurrentSprite(x) {\n return item(x.CurrentFrame, x.Sprites);\n}\n\nexport class GameObject extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Treasure\", \"Enemy\"];\n }\n}\n\nexport function GameObject$reflection() {\n return union_type(\"App.Model.GameObject\", [], GameObject, () => [[[\"Item\", BasicGameObject$reflection()]], [[\"Item\", Enemy$reflection()]]]);\n}\n\nexport function GameObject__get_BasicGameObject(x) {\n if (x.tag === 1) {\n return x.fields[0].BasicGameObject;\n }\n else {\n return x.fields[0];\n }\n}\n\nexport function GameObject__UpdateBasicGameObject_6358EEEA(x, go) {\n if (x.tag === 1) {\n const e = x.fields[0];\n return new GameObject(1, new Enemy(e.EnemyType, go, e.DirectionVector, e.Direction, e.DeathSpriteIndexes, e.AttackSpriteIndexes, e.SpriteBlocks, e.FramesPerBlock, e.CurrentAnimationFrame, e.TimeUntilNextAnimationFrame, e.State));\n }\n else {\n return new GameObject(0, go);\n }\n}\n\nexport class Player extends Record {\n constructor(Score, Health, Radius, CurrentWeaponIndex, Ammunition, Weapons) {\n super();\n this.Score = (Score | 0);\n this.Health = (Health | 0);\n this.Radius = Radius;\n this.CurrentWeaponIndex = (CurrentWeaponIndex | 0);\n this.Ammunition = (Ammunition | 0);\n this.Weapons = Weapons;\n }\n}\n\nexport function Player$reflection() {\n return record_type(\"App.Model.Player\", [], Player, () => [[\"Score\", int32_type], [\"Health\", int32_type], [\"Radius\", float64_type], [\"CurrentWeaponIndex\", int32_type], [\"Ammunition\", int32_type], [\"Weapons\", list_type(PlayerWeapon$reflection())]]);\n}\n\nexport class Camera extends Record {\n constructor(Position, Direction, Plane, FieldOfView) {\n super();\n this.Position = Position;\n this.Direction = Direction;\n this.Plane = Plane;\n this.FieldOfView = FieldOfView;\n }\n}\n\nexport function Camera$reflection() {\n return record_type(\"App.Model.Camera\", [], Camera, () => [[\"Position\", Vector2D$reflection()], [\"Direction\", Vector2D$reflection()], [\"Plane\", Vector2D$reflection()], [\"FieldOfView\", float64_type]]);\n}\n\nexport class SpriteLayout extends Record {\n constructor(Offset, FirstColumn, LastColumn, PixelPoolOffset) {\n super();\n this.Offset = Offset;\n this.FirstColumn = FirstColumn;\n this.LastColumn = LastColumn;\n this.PixelPoolOffset = PixelPoolOffset;\n }\n}\n\nexport function SpriteLayout$reflection() {\n return record_type(\"App.Model.SpriteLayout\", [], SpriteLayout, () => [[\"Offset\", uint32_type], [\"FirstColumn\", uint32_type], [\"LastColumn\", uint32_type], [\"PixelPoolOffset\", uint32_type]]);\n}\n\nexport class RawMap extends Record {\n constructor(MapSize, Plane0, Plane1, Plane2) {\n super();\n this.MapSize = (MapSize | 0);\n this.Plane0 = Plane0;\n this.Plane1 = Plane1;\n this.Plane2 = Plane2;\n }\n}\n\nexport function RawMap$reflection() {\n return record_type(\"App.Model.RawMap\", [], RawMap, () => [[\"MapSize\", int32_type], [\"Plane0\", class_type(\"Fable.Core.JS.DataView\")], [\"Plane1\", class_type(\"Fable.Core.JS.DataView\")], [\"Plane2\", class_type(\"Fable.Core.JS.DataView\")]]);\n}\n\nexport class WolfensteinMap extends Record {\n constructor(Width, Height, Plane0, GameObjects, PlayerStartingPosition, Doors) {\n super();\n this.Width = (Width | 0);\n this.Height = (Height | 0);\n this.Plane0 = Plane0;\n this.GameObjects = GameObjects;\n this.PlayerStartingPosition = PlayerStartingPosition;\n this.Doors = Doors;\n }\n}\n\nexport function WolfensteinMap$reflection() {\n return record_type(\"App.Model.WolfensteinMap\", [], WolfensteinMap, () => [[\"Width\", int32_type], [\"Height\", int32_type], [\"Plane0\", list_type(list_type(Cell$reflection()))], [\"GameObjects\", list_type(GameObject$reflection())], [\"PlayerStartingPosition\", Camera$reflection()], [\"Doors\", list_type(DoorState$reflection())]]);\n}\n\nexport class Game extends Record {\n constructor(Map$, GameObjects, Player, Camera, ControlState, IsFiring, TimeToNextWeaponFrame, Doors) {\n super();\n this.Map = Map$;\n this.GameObjects = GameObjects;\n this.Player = Player;\n this.Camera = Camera;\n this.ControlState = (ControlState | 0);\n this.IsFiring = IsFiring;\n this.TimeToNextWeaponFrame = TimeToNextWeaponFrame;\n this.Doors = Doors;\n }\n}\n\nexport function Game$reflection() {\n return record_type(\"App.Model.Game\", [], Game, () => [[\"Map\", list_type(list_type(Cell$reflection()))], [\"GameObjects\", list_type(GameObject$reflection())], [\"Player\", Player$reflection()], [\"Camera\", Camera$reflection()], [\"ControlState\", enum_type(\"App.Model.ControlState\", int32_type, [[\"None\", 0], [\"Forward\", 1], [\"TurningLeft\", 2], [\"TurningRight\", 4], [\"StrafingLeft\", 8], [\"StrafingRight\", 16], [\"Backward\", 32], [\"Fire\", 64], [\"Action\", 128]])], [\"IsFiring\", bool_type], [\"TimeToNextWeaponFrame\", option_type(float64_type)], [\"Doors\", list_type(DoorState$reflection())]]);\n}\n\nexport const textureWidth = 64;\n\nexport const textureHeight = 64;\n\nexport const firingTolerance = 40;\n\n","\nexport function toColorString(color) {\n const r = (color >> 16) | 0;\n const g = ((color >> 8) & 255) | 0;\n const b = (color & 255) | 0;\n return `rgb(${r},${g},${b})`;\n}\n\nexport function adjustColor(color, value) {\n return (((color & 255) + value) | ((((color >> 8) & 255) + value) << 8)) | (((color >> 16) + value) << 16);\n}\n\nexport function fill(context, color, left, top, width, height) {\n context.fillStyle = toColorString(color);\n context.fillRect(left, top, width, height);\n}\n\nexport function clearCanvas(context) {\n fill(context, 0, -1, -1, context.canvas.width + 2, context.canvas.height + 2);\n}\n\nexport function fillText(context, text, x, y) {\n context.textAlign = \"start\";\n context.fillStyle = \"#e0e0e0\";\n context.fillText(text, x, y);\n}\n\n","import { defaultArg } from \"./fable_modules/fable-library.3.7.9/Option.js\";\nimport { fillText, fill } from \"./Render.Primitives.fs.js\";\nimport { Texture } from \"./Model.Platform.fs.js\";\nimport { textureColor, textureStripOffset, spriteOffsets, getPixel as getPixel_1, setPixel as setPixel_1 } from \"./Graphics.Common.fs.js\";\nimport { Weapons_drawPlayerWeapon, Walls_draw, Objects_draw } from \"./CrossPlatform/Render.fs.js\";\nimport { canvasFromTexture, spriteColorIsTransparent } from \"./Graphics.fs.js\";\nimport { interpolate, toText } from \"./fable_modules/fable-library.3.7.9/String.js\";\n\nexport function draw(context, bufferContextOption, graphics_0, graphics_1, sprites, game) {\n const graphics = [graphics_0, graphics_1];\n const startTime = performance.now();\n context.save();\n context.imageSmoothingEnabled = false;\n context.lineCap = \"square\";\n context.translate(0.5, 0.5);\n context.font = \"30px Consolas, Menlo, monospace\";\n const bufferContext = defaultArg(bufferContextOption, context);\n bufferContext.imageSmoothingEnabled = false;\n const viewportWidth = bufferContext.canvas.width;\n const viewportHeight = bufferContext.canvas.height;\n fill(bufferContext, 3750201, -1, -1, viewportWidth + 1, viewportHeight / 2);\n fill(bufferContext, 7566195, -1, viewportHeight / 2, viewportWidth + 1, (viewportHeight / 2) + 1);\n const outputImageData = bufferContext.getImageData(0, 0, viewportWidth, viewportHeight);\n const outputTexture = new Texture(new Uint32Array(outputImageData.data.buffer), new Uint8ClampedArray(outputImageData.data.buffer), ~(~viewportWidth), ~(~viewportHeight));\n const setPixel = (color, x_1, y_1) => {\n setPixel_1(outputTexture, color, x_1, y_1);\n };\n const firingHitGameObjectIndexOption = Objects_draw(viewportWidth, viewportHeight, getPixel_1, setPixel, spriteColorIsTransparent, (spriteIndex) => spriteOffsets(graphics[0], graphics[1], spriteIndex), game, sprites, Walls_draw(viewportWidth, viewportHeight, setPixel, (textureIndex, textureX) => textureStripOffset(graphics[0], graphics[1], textureIndex, textureX), (textureOffset, textureY) => textureColor(graphics[0], graphics[1], textureOffset, textureY), game));\n if (bufferContextOption != null) {\n const imageData_1 = new ImageData(outputTexture.ClampedData,outputTexture.Width,outputTexture.Height);\n bufferContext.putImageData(imageData_1, 0, 0);\n Weapons_drawPlayerWeapon(bufferContext.canvas.width, bufferContext.canvas.height, (texture, x_2, y_2, width, height) => {\n bufferContext.drawImage(canvasFromTexture(texture), x_2, y_2, width, height);\n }, game);\n context.drawImage(bufferContext.canvas, 0, 0, viewportWidth * 2, viewportHeight * 2);\n }\n else {\n const imageData_2 = new ImageData(outputTexture.ClampedData,outputTexture.Width,outputTexture.Height);\n context.putImageData(imageData_2, 0, 0);\n }\n fillText(context, toText(interpolate(\"Render length: %.0f%P()ms\", [performance.now() - startTime])), 32, 32);\n context.restore();\n return firingHitGameObjectIndexOption;\n}\n\nexport function initScene(canvas, _arg1) {\n const context = canvas.getContext('2d');\n let patternInput;\n const bufferCanvas = document.createElement(\"canvas\");\n bufferCanvas.width = (304 * 2);\n bufferCanvas.height = (152 * 2);\n patternInput = [bufferCanvas.getContext('2d'), ~(~bufferCanvas.width), ~(~bufferCanvas.height)];\n return [(tupledArg) => ((sprites) => ((game) => draw(context, patternInput[0], tupledArg[0], tupledArg[1], sprites, game))), patternInput[1], patternInput[2]];\n}\n\n","import { singleton } from \"./fable_modules/fable-library.3.7.9/AsyncBuilder.js\";\nimport { Http_request, Http_method, Http_overrideResponseType, Http_send } from \"./fable_modules/Fable.SimpleHttp.3.1.0/Http.fs.js\";\nimport { HttpMethod, ResponseTypes } from \"./fable_modules/Fable.SimpleHttp.3.1.0/Types.fs.js\";\nimport { FSharpResult$2 } from \"./fable_modules/fable-library.3.7.9/Choice.js\";\nimport { some } from \"./fable_modules/fable-library.3.7.9/Option.js\";\n\nexport function loadAsset(assetName) {\n return singleton.Delay(() => singleton.Bind(Http_send(Http_overrideResponseType(new ResponseTypes(2), Http_method(new HttpMethod(0), Http_request(`assets/${assetName}`)))), (_arg1) => {\n let matchValue;\n return singleton.Return((matchValue = _arg1.content, (matchValue.tag === 2) ? (new FSharpResult$2(0, matchValue.fields[0])) : ((console.error(some(\"Unable to load asset\")), new FSharpResult$2(1, \"\")))));\n }));\n}\n\nexport function log(message) {\n console.log(some(message));\n}\n\n","import { fromContinuations } from \"../fable-library.3.7.9/Async.js\";\nimport { HttpResponse, ResponseContent, HttpRequest, BodyContent, HttpMethod, Header } from \"./Types.fs.js\";\nimport { tail, head, isEmpty, ofArray as ofArray_1, singleton, append, empty } from \"../fable-library.3.7.9/List.js\";\nimport { ofArray, empty as empty_1 } from \"../fable-library.3.7.9/Map.js\";\nimport { join, split, isNullOrEmpty } from \"../fable-library.3.7.9/String.js\";\nimport { choose } from \"../fable-library.3.7.9/Array.js\";\nimport { disposeSafe, getEnumerator } from \"../fable-library.3.7.9/Util.js\";\nimport { some } from \"../fable-library.3.7.9/Option.js\";\nimport { singleton as singleton_1 } from \"../fable-library.3.7.9/AsyncBuilder.js\";\n\nexport function FileReader_readBlobAsText(blob) {\n return fromContinuations((tupledArg) => {\n const reader = new FileReader();\n reader.onload = ((_arg1) => {\n if (reader.readyState === 2) {\n tupledArg[0](reader.result);\n }\n });\n reader.readAsText(blob);\n });\n}\n\nexport function FileReader_readFileAsText(file) {\n return fromContinuations((tupledArg) => {\n const reader = new FileReader();\n reader.onload = ((_arg1) => {\n if (reader.readyState === 2) {\n tupledArg[0](reader.result);\n }\n });\n reader.readAsText(file);\n });\n}\n\nexport function FormData_append(key, value, form) {\n form.append(key, value);\n return form;\n}\n\nexport function FormData_appendFile(key, file, form) {\n form.append(key, file);\n return form;\n}\n\nexport function FormData_appendNamedFile(key, fileName, file, form) {\n form.append(key, file, fileName);\n return form;\n}\n\nexport function FormData_appendBlob(key, blob, form) {\n form.append(key, blob);\n return form;\n}\n\nexport function FormData_appendNamedBlob(key, fileName, blob, form) {\n form.append(key, blob, fileName);\n return form;\n}\n\nexport function Headers_contentType(value) {\n return new Header(0, \"Content-Type\", value);\n}\n\nexport function Headers_accept(value) {\n return new Header(0, \"Accept\", value);\n}\n\nexport function Headers_acceptCharset(value) {\n return new Header(0, \"Accept-Charset\", value);\n}\n\nexport function Headers_acceptEncoding(value) {\n return new Header(0, \"Accept-Encoding\", value);\n}\n\nexport function Headers_acceptLanguage(value) {\n return new Header(0, \"Accept-Language\", value);\n}\n\nexport function Headers_acceptDateTime(value) {\n return new Header(0, \"Accept-Datetime\", value);\n}\n\nexport function Headers_authorization(value) {\n return new Header(0, \"Authorization\", value);\n}\n\nexport function Headers_cacheControl(value) {\n return new Header(0, \"Cache-Control\", value);\n}\n\nexport function Headers_connection(value) {\n return new Header(0, \"Connection\", value);\n}\n\nexport function Headers_cookie(value) {\n return new Header(0, \"Cookie\", value);\n}\n\nexport function Headers_contentMD5(value) {\n return new Header(0, \"Content-MD5\", value);\n}\n\nexport function Headers_date(value) {\n return new Header(0, \"Date\", value);\n}\n\nexport function Headers_expect(value) {\n return new Header(0, \"Expect\", value);\n}\n\nexport function Headers_ifMatch(value) {\n return new Header(0, \"If-Match\", value);\n}\n\nexport function Headers_ifModifiedSince(value) {\n return new Header(0, \"If-Modified-Since\", value);\n}\n\nexport function Headers_ifNoneMatch(value) {\n return new Header(0, \"If-None-Match\", value);\n}\n\nexport function Headers_ifRange(value) {\n return new Header(0, \"If-Range\", value);\n}\n\nexport function Headers_IfUnmodifiedSince(value) {\n return new Header(0, \"If-Unmodified-Since\", value);\n}\n\nexport function Headers_maxForwards(value) {\n return new Header(0, \"Max-Forwards\", value);\n}\n\nexport function Headers_origin(value) {\n return new Header(0, \"Origin\", value);\n}\n\nexport function Headers_pragma(value) {\n return new Header(0, \"Pragma\", value);\n}\n\nexport function Headers_proxyAuthorization(value) {\n return new Header(0, \"Proxy-Authorization\", value);\n}\n\nexport function Headers_range(value) {\n return new Header(0, \"Range\", value);\n}\n\nexport function Headers_referer(value) {\n return new Header(0, \"Referer\", value);\n}\n\nexport function Headers_userAgent(value) {\n return new Header(0, \"User-Agent\", value);\n}\n\nexport function Headers_create(key, value) {\n return new Header(0, key, value);\n}\n\nconst Http_defaultRequest = new HttpRequest(\"\", new HttpMethod(0), empty(), false, void 0, void 0, void 0, new BodyContent(0));\n\nconst Http_emptyResponse = new HttpResponse(0, \"\", \"\", empty_1(), new ResponseContent(0, \"\"));\n\nfunction Http_splitAt(delimiter, input) {\n if (isNullOrEmpty(input)) {\n return [input];\n }\n else {\n return split(input, [delimiter], null, 0);\n }\n}\n\nfunction Http_serializeMethod(_arg1) {\n switch (_arg1.tag) {\n case 1: {\n return \"POST\";\n }\n case 3: {\n return \"PATCH\";\n }\n case 2: {\n return \"PUT\";\n }\n case 4: {\n return \"DELETE\";\n }\n case 6: {\n return \"OPTIONS\";\n }\n case 5: {\n return \"HEAD\";\n }\n default: {\n return \"GET\";\n }\n }\n}\n\nexport function Http_request(url) {\n return new HttpRequest(url, Http_defaultRequest.method, Http_defaultRequest.headers, Http_defaultRequest.withCredentials, Http_defaultRequest.overridenMimeType, Http_defaultRequest.overridenResponseType, Http_defaultRequest.timeout, Http_defaultRequest.content);\n}\n\nexport function Http_method(httpVerb, req) {\n return new HttpRequest(req.url, httpVerb, req.headers, req.withCredentials, req.overridenMimeType, req.overridenResponseType, req.timeout, req.content);\n}\n\nexport function Http_header(singleHeader, req) {\n return new HttpRequest(req.url, req.method, append(req.headers, singleton(singleHeader)), req.withCredentials, req.overridenMimeType, req.overridenResponseType, req.timeout, req.content);\n}\n\nexport function Http_headers(values, req) {\n return new HttpRequest(req.url, req.method, append(req.headers, values), req.withCredentials, req.overridenMimeType, req.overridenResponseType, req.timeout, req.content);\n}\n\nexport function Http_withCredentials(enabled, req) {\n return new HttpRequest(req.url, req.method, req.headers, enabled, req.overridenMimeType, req.overridenResponseType, req.timeout, req.content);\n}\n\nexport function Http_withTimeout(timeoutInMilliseconds, req) {\n return new HttpRequest(req.url, req.method, req.headers, req.withCredentials, req.overridenMimeType, req.overridenResponseType, timeoutInMilliseconds, req.content);\n}\n\nexport function Http_overrideMimeType(value, req) {\n return new HttpRequest(req.url, req.method, req.headers, req.withCredentials, value, req.overridenResponseType, req.timeout, req.content);\n}\n\nexport function Http_overrideResponseType(value, req) {\n return new HttpRequest(req.url, req.method, req.headers, req.withCredentials, req.overridenMimeType, value, req.timeout, req.content);\n}\n\nexport function Http_content(bodyContent, req) {\n return new HttpRequest(req.url, req.method, req.headers, req.withCredentials, req.overridenMimeType, req.overridenResponseType, req.timeout, bodyContent);\n}\n\nexport function Http_send(req) {\n return fromContinuations((tupledArg) => {\n const xhr = new XMLHttpRequest();\n xhr.open(Http_serializeMethod(req.method), req.url);\n xhr.onreadystatechange = (() => {\n let responseText, matchValue, statusCode, responseType, content, matchValue_1;\n if (xhr.readyState === 4) {\n tupledArg[0]((responseText = ((matchValue = xhr.responseType, (matchValue === \"\") ? xhr.responseText : ((matchValue === \"text\") ? xhr.responseText : \"\"))), (statusCode = (xhr.status | 0), (responseType = xhr.responseType, (content = ((matchValue_1 = xhr.responseType, (matchValue_1 === \"\") ? (new ResponseContent(0, xhr.responseText)) : ((matchValue_1 === \"text\") ? (new ResponseContent(0, xhr.responseText)) : ((matchValue_1 === \"arraybuffer\") ? (new ResponseContent(2, xhr.response)) : ((matchValue_1 === \"blob\") ? (new ResponseContent(1, xhr.response)) : (new ResponseContent(3, xhr.response))))))), new HttpResponse(statusCode, responseText, responseType, ofArray(choose((headerLine) => {\n const matchValue_2 = ofArray_1(Http_splitAt(\":\", headerLine));\n if (!isEmpty(matchValue_2)) {\n return [head(matchValue_2).toLocaleLowerCase(), join(\":\", tail(matchValue_2)).trim()];\n }\n else {\n return void 0;\n }\n }, Http_splitAt(\"\\r\\n\", xhr.getAllResponseHeaders()))), content))))));\n }\n });\n const enumerator = getEnumerator(req.headers);\n try {\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\n const forLoopVar = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\n xhr.setRequestHeader(forLoopVar.fields[0], forLoopVar.fields[1]);\n }\n }\n finally {\n disposeSafe(enumerator);\n }\n xhr.withCredentials = req.withCredentials;\n const matchValue_3 = req.overridenMimeType;\n if (matchValue_3 == null) {\n }\n else {\n const mimeType = matchValue_3;\n xhr.overrideMimeType(mimeType);\n }\n const matchValue_4 = req.overridenResponseType;\n if (matchValue_4 == null) {\n }\n else if (matchValue_4.tag === 1) {\n xhr.responseType = \"blob\";\n }\n else if (matchValue_4.tag === 2) {\n xhr.responseType = \"arraybuffer\";\n }\n else {\n xhr.responseType = \"text\";\n }\n const matchValue_5 = req.timeout;\n if (matchValue_5 == null) {\n }\n else {\n const timeout = matchValue_5 | 0;\n xhr.timeout = (timeout | 0);\n }\n const matchValue_6 = [req.method, req.content];\n if (matchValue_6[0].tag === 0) {\n xhr.send(some(void 0));\n }\n else if (matchValue_6[1].tag === 1) {\n xhr.send(some(matchValue_6[1].fields[0]));\n }\n else if (matchValue_6[1].tag === 3) {\n xhr.send(some(matchValue_6[1].fields[0]));\n }\n else if (matchValue_6[1].tag === 2) {\n xhr.send(some(matchValue_6[1].fields[0]));\n }\n else {\n xhr.send(some(void 0));\n }\n });\n}\n\nexport function Http_get(url) {\n return singleton_1.Delay(() => singleton_1.Bind(Http_send(Http_method(new HttpMethod(0), Http_request(url))), (_arg1) => {\n const response = _arg1;\n return singleton_1.Return([response.statusCode, response.responseText]);\n }));\n}\n\nexport function Http_put(url, data) {\n return singleton_1.Delay(() => singleton_1.Bind(Http_send(Http_content(new BodyContent(1, data), Http_method(new HttpMethod(2), Http_request(url)))), (_arg1) => {\n const response = _arg1;\n return singleton_1.Return([response.statusCode, response.responseText]);\n }));\n}\n\nexport function Http_delete(url) {\n return singleton_1.Delay(() => singleton_1.Bind(Http_send(Http_method(new HttpMethod(4), Http_request(url))), (_arg1) => {\n const response = _arg1;\n return singleton_1.Return([response.statusCode, response.responseText]);\n }));\n}\n\nexport function Http_patch(url, data) {\n return singleton_1.Delay(() => singleton_1.Bind(Http_send(Http_content(new BodyContent(1, data), Http_method(new HttpMethod(3), Http_request(url)))), (_arg1) => {\n const response = _arg1;\n return singleton_1.Return([response.statusCode, response.responseText]);\n }));\n}\n\nexport function Http_post(url, data) {\n return singleton_1.Delay(() => singleton_1.Bind(Http_send(Http_content(new BodyContent(1, data), Http_method(new HttpMethod(1), Http_request(url)))), (_arg1) => {\n const response = _arg1;\n return singleton_1.Return([response.statusCode, response.responseText]);\n }));\n}\n\n","import { Record, Union } from \"../fable-library.3.7.9/Types.js\";\nimport { obj_type, record_type, int32_type, option_type, bool_type, list_type, class_type, string_type, union_type } from \"../fable-library.3.7.9/Reflection.js\";\n\nexport class HttpMethod extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"HEAD\", \"OPTIONS\"];\n }\n}\n\nexport function HttpMethod$reflection() {\n return union_type(\"Fable.SimpleHttp.HttpMethod\", [], HttpMethod, () => [[], [], [], [], [], [], []]);\n}\n\nexport class Header extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Header\"];\n }\n}\n\nexport function Header$reflection() {\n return union_type(\"Fable.SimpleHttp.Header\", [], Header, () => [[[\"Item1\", string_type], [\"Item2\", string_type]]]);\n}\n\nexport class BodyContent extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Empty\", \"Text\", \"Binary\", \"Form\"];\n }\n}\n\nexport function BodyContent$reflection() {\n return union_type(\"Fable.SimpleHttp.BodyContent\", [], BodyContent, () => [[], [[\"Item\", string_type]], [[\"Item\", class_type(\"Browser.Types.Blob\", void 0, Blob)]], [[\"Item\", class_type(\"Browser.Types.FormData\", void 0, FormData)]]]);\n}\n\nexport class ResponseTypes extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Text\", \"Blob\", \"ArrayBuffer\"];\n }\n}\n\nexport function ResponseTypes$reflection() {\n return union_type(\"Fable.SimpleHttp.ResponseTypes\", [], ResponseTypes, () => [[], [], []]);\n}\n\nexport class HttpRequest extends Record {\n constructor(url, method, headers, withCredentials, overridenMimeType, overridenResponseType, timeout, content) {\n super();\n this.url = url;\n this.method = method;\n this.headers = headers;\n this.withCredentials = withCredentials;\n this.overridenMimeType = overridenMimeType;\n this.overridenResponseType = overridenResponseType;\n this.timeout = timeout;\n this.content = content;\n }\n}\n\nexport function HttpRequest$reflection() {\n return record_type(\"Fable.SimpleHttp.HttpRequest\", [], HttpRequest, () => [[\"url\", string_type], [\"method\", HttpMethod$reflection()], [\"headers\", list_type(Header$reflection())], [\"withCredentials\", bool_type], [\"overridenMimeType\", option_type(string_type)], [\"overridenResponseType\", option_type(ResponseTypes$reflection())], [\"timeout\", option_type(int32_type)], [\"content\", BodyContent$reflection()]]);\n}\n\nexport class ResponseContent extends Union {\n constructor(tag, ...fields) {\n super();\n this.tag = (tag | 0);\n this.fields = fields;\n }\n cases() {\n return [\"Text\", \"Blob\", \"ArrayBuffer\", \"Unknown\"];\n }\n}\n\nexport function ResponseContent$reflection() {\n return union_type(\"Fable.SimpleHttp.ResponseContent\", [], ResponseContent, () => [[[\"Item\", string_type]], [[\"Item\", class_type(\"Browser.Types.Blob\", void 0, Blob)]], [[\"Item\", class_type(\"Fable.Core.JS.ArrayBuffer\")]], [[\"Item\", obj_type]]]);\n}\n\nexport class HttpResponse extends Record {\n constructor(statusCode, responseText, responseType, responseHeaders, content) {\n super();\n this.statusCode = (statusCode | 0);\n this.responseText = responseText;\n this.responseType = responseType;\n this.responseHeaders = responseHeaders;\n this.content = content;\n }\n}\n\nexport function HttpResponse$reflection() {\n return record_type(\"Fable.SimpleHttp.HttpResponse\", [], HttpResponse, () => [[\"statusCode\", int32_type], [\"responseText\", string_type], [\"responseType\", string_type], [\"responseHeaders\", class_type(\"Microsoft.FSharp.Collections.FSharpMap`2\", [string_type, string_type])], [\"content\", ResponseContent$reflection()]]);\n}\n\n","import { value as value_2, defaultArg, some } from \"./Option.js\";\r\nimport { min as min_1, disposeSafe, getEnumerator, comparePrimitives, max as max_1 } from \"./Util.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport function Helpers_allocateArrayFromCons(cons, len) {\r\n if ((typeof cons) === \"function\") {\r\n return new cons(len);\r\n }\r\n else {\r\n return new Array(len);\r\n }\r\n}\r\n\r\nfunction indexNotFound() {\r\n throw (new Error(\"An index satisfying the predicate was not found in the collection.\"));\r\n}\r\n\r\nfunction differentLengths() {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n}\r\n\r\nexport function append(array1, array2, cons) {\r\n const len1 = array1.length | 0;\r\n const len2 = array2.length | 0;\r\n const newArray = Helpers_allocateArrayFromCons(cons, len1 + len2);\r\n for (let i = 0; i <= (len1 - 1); i++) {\r\n newArray[i] = array1[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n newArray[i_1 + len1] = array2[i_1];\r\n }\r\n return newArray;\r\n}\r\n\r\nexport function filter(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function fill(target, targetIndex, count, value) {\r\n const start = targetIndex | 0;\r\n return target.fill(value, start, (start + count));\r\n}\r\n\r\nexport function getSubArray(array, start, count) {\r\n const start_1 = start | 0;\r\n return array.slice(start_1, (start_1 + count));\r\n}\r\n\r\nexport function last(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n return array[array.length - 1];\r\n}\r\n\r\nexport function tryLast(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[array.length - 1]);\r\n }\r\n}\r\n\r\nexport function mapIndexed(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(i, source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function map(f, source, cons) {\r\n const len = source.length | 0;\r\n const target = Helpers_allocateArrayFromCons(cons, len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = f(source[i]);\r\n }\r\n return target;\r\n}\r\n\r\nexport function mapIndexed2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map2(f, source1, source2, cons) {\r\n if (source1.length !== source2.length) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapIndexed3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(i, source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function map3(f, source1, source2, source3, cons) {\r\n if ((source1.length !== source2.length) ? true : (source2.length !== source3.length)) {\r\n throw (new Error(\"Arrays had different lengths\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, source1.length);\r\n for (let i = 0; i <= (source1.length - 1); i++) {\r\n result[i] = f(source1[i], source2[i], source3[i]);\r\n }\r\n return result;\r\n}\r\n\r\nexport function mapFold(mapping, state, array, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const patternInput = mapping(acc, array[i]);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function mapFoldBack(mapping, array, state, cons) {\r\n const matchValue = array.length | 0;\r\n if (matchValue === 0) {\r\n return [[], state];\r\n }\r\n else {\r\n let acc = state;\r\n const res = Helpers_allocateArrayFromCons(cons, matchValue);\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n const patternInput = mapping(array[i], acc);\r\n res[i] = patternInput[0];\r\n acc = patternInput[1];\r\n }\r\n return [res, acc];\r\n }\r\n}\r\n\r\nexport function indexed(source) {\r\n const len = source.length | 0;\r\n const target = new Array(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = [i, source[i]];\r\n }\r\n return target;\r\n}\r\n\r\nexport function truncate(count, array) {\r\n const count_1 = max_1(comparePrimitives, 0, count) | 0;\r\n const start = 0;\r\n return array.slice(start, (start + count_1));\r\n}\r\n\r\nexport function concat(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const matchValue = arrays_1.length | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n case 1: {\r\n return arrays_1[0];\r\n }\r\n default: {\r\n let totalIdx = 0;\r\n let totalLength = 0;\r\n for (let idx = 0; idx <= (arrays_1.length - 1); idx++) {\r\n const arr_1 = arrays_1[idx];\r\n totalLength = ((totalLength + arr_1.length) | 0);\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, totalLength);\r\n for (let idx_1 = 0; idx_1 <= (arrays_1.length - 1); idx_1++) {\r\n const arr_2 = arrays_1[idx_1];\r\n for (let j = 0; j <= (arr_2.length - 1); j++) {\r\n result[totalIdx] = arr_2[j];\r\n totalIdx = ((totalIdx + 1) | 0);\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function collect(mapping, array, cons) {\r\n return concat(map(mapping, array, null), cons);\r\n}\r\n\r\nexport function where(predicate, array) {\r\n return array.filter(predicate);\r\n}\r\n\r\nexport function contains(value, array, eq) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return false;\r\n }\r\n else if (eq.Equals(value, array[i])) {\r\n return true;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function empty(cons) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n}\r\n\r\nexport function singleton(value, cons) {\r\n const ar = Helpers_allocateArrayFromCons(cons, 1);\r\n ar[0] = value;\r\n return ar;\r\n}\r\n\r\nexport function initialize(count, initializer, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = initializer(i);\r\n }\r\n return result;\r\n}\r\n\r\nexport function pairwise(array) {\r\n if (array.length < 2) {\r\n return [];\r\n }\r\n else {\r\n const count = (array.length - 1) | 0;\r\n const result = new Array(count);\r\n for (let i = 0; i <= (count - 1); i++) {\r\n result[i] = [array[i], array[i + 1]];\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function replicate(count, initial, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n const result = Helpers_allocateArrayFromCons(cons, count);\r\n for (let i = 0; i <= (result.length - 1); i++) {\r\n result[i] = initial;\r\n }\r\n return result;\r\n}\r\n\r\nexport function copy(array) {\r\n return array.slice();\r\n}\r\n\r\nexport function reverse(array) {\r\n const array_2 = array.slice();\r\n return array_2.reverse();\r\n}\r\n\r\nexport function scan(folder, state, array, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[0] = state;\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n res[i + 1] = folder(res[i], array[i]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function scanBack(folder, array, state, cons) {\r\n const res = Helpers_allocateArrayFromCons(cons, array.length + 1);\r\n res[array.length] = state;\r\n for (let i = array.length - 1; i >= 0; i--) {\r\n res[i] = folder(array[i], res[i + 1]);\r\n }\r\n return res;\r\n}\r\n\r\nexport function skip(count, array, cons) {\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = ((count < 0) ? 0 : count) | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === array.length) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const count_1 = count | 0;\r\n return array.slice(count_1);\r\n }\r\n}\r\n\r\nexport function take(count, array, cons) {\r\n if (count < 0) {\r\n throw (new Error(\"The input must be non-negative\\\\nParameter name: count\"));\r\n }\r\n if (count > array.length) {\r\n throw (new Error(\"count is greater than array length\\\\nParameter name: count\"));\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n return array.slice(start, (start + count));\r\n }\r\n}\r\n\r\nexport function takeWhile(predicate, array, cons) {\r\n let count = 0;\r\n while ((count < array.length) && predicate(array[count])) {\r\n count = ((count + 1) | 0);\r\n }\r\n if (count === 0) {\r\n return Helpers_allocateArrayFromCons(cons, 0);\r\n }\r\n else {\r\n const start = 0;\r\n const count_1 = count | 0;\r\n return array.slice(start, (start + count_1));\r\n }\r\n}\r\n\r\nexport function addInPlace(x, array) {\r\n array.push(x);\r\n}\r\n\r\nexport function addRangeInPlace(range, array) {\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n addInPlace(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), array);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n}\r\n\r\nexport function insertRangeInPlace(index, range, array) {\r\n let index_1;\r\n let i = index;\r\n const enumerator = getEnumerator(range);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n (index_1 = (i | 0), array.splice(index_1, 0, x));\r\n i = ((i + 1) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n}\r\n\r\nexport function removeInPlace(item_1, array) {\r\n const i = (array.indexOf(item_1, 0)) | 0;\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function removeAllInPlace(predicate, array) {\r\n const countRemoveAll = (count) => {\r\n const i = (array.findIndex(predicate)) | 0;\r\n if (i > -1) {\r\n array.splice(i, 1);\r\n return (countRemoveAll(count) + 1) | 0;\r\n }\r\n else {\r\n return count | 0;\r\n }\r\n };\r\n return countRemoveAll(0) | 0;\r\n}\r\n\r\nexport function copyTo(source, sourceIndex, target, targetIndex, count) {\r\n const diff = (targetIndex - sourceIndex) | 0;\r\n for (let i = sourceIndex; i <= ((sourceIndex + count) - 1); i++) {\r\n target[i + diff] = source[i];\r\n }\r\n}\r\n\r\nexport function copyToTypedArray(source, sourceIndex, target, targetIndex, count) {\r\n try {\r\n target.set(source.subarray(sourceIndex, sourceIndex + count), targetIndex);\r\n }\r\n catch (matchValue) {\r\n copyTo(source, sourceIndex, target, targetIndex, count);\r\n }\r\n}\r\n\r\nexport function indexOf(array, item_1, start, count) {\r\n const start_1 = defaultArg(start, 0) | 0;\r\n const i = (array.indexOf(item_1, start_1)) | 0;\r\n if ((count != null) && (i >= (start_1 + value_2(count)))) {\r\n return -1;\r\n }\r\n else {\r\n return i | 0;\r\n }\r\n}\r\n\r\nexport function partition(f, source, cons) {\r\n const len = source.length | 0;\r\n const res1 = Helpers_allocateArrayFromCons(cons, len);\r\n const res2 = Helpers_allocateArrayFromCons(cons, len);\r\n let iTrue = 0;\r\n let iFalse = 0;\r\n for (let i = 0; i <= (len - 1); i++) {\r\n if (f(source[i])) {\r\n res1[iTrue] = source[i];\r\n iTrue = ((iTrue + 1) | 0);\r\n }\r\n else {\r\n res2[iFalse] = source[i];\r\n iFalse = ((iFalse + 1) | 0);\r\n }\r\n }\r\n return [truncate(iTrue, res1), truncate(iFalse, res2)];\r\n}\r\n\r\nexport function find(predicate, array) {\r\n const matchValue = array.find(predicate);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_2(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, array) {\r\n return array.find(predicate);\r\n}\r\n\r\nexport function findIndex(predicate, array) {\r\n const matchValue = (array.findIndex(predicate)) | 0;\r\n if (matchValue > -1) {\r\n return matchValue | 0;\r\n }\r\n else {\r\n return indexNotFound() | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, array) {\r\n const matchValue = (array.findIndex(predicate)) | 0;\r\n if (matchValue > -1) {\r\n return matchValue;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function pick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return indexNotFound();\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n return value_2(matchValue);\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function tryPick(chooser, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i >= array.length) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue == null) {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n}\r\n\r\nexport function findBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound();\r\n }\r\n else if (predicate(array[i])) {\r\n return array[i];\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function tryFindBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return some(array[i]);\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function findLastIndex(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return -1;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function findIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return indexNotFound() | 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i | 0;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1) | 0;\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, array) {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (i < 0) {\r\n return void 0;\r\n }\r\n else if (predicate(array[i])) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(array.length - 1);\r\n}\r\n\r\nexport function choose(chooser, array, cons) {\r\n const res = [];\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n const matchValue = chooser(array[i]);\r\n if (matchValue != null) {\r\n const y = value_2(matchValue);\r\n res.push(y);\r\n }\r\n }\r\n if ((typeof cons) === \"function\") {\r\n return map((x) => x, res, cons);\r\n }\r\n else {\r\n return res;\r\n }\r\n}\r\n\r\nexport function foldIndexed(folder, state, array) {\r\n return array.reduce(((delegateArg0, delegateArg1, delegateArg2) => folder(delegateArg2, delegateArg0, delegateArg1)), state);\r\n}\r\n\r\nexport function fold(folder, state, array) {\r\n return array.reduce((folder), state);\r\n}\r\n\r\nexport function iterate(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(array[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed(action, array) {\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n action(i, array[i]);\r\n }\r\n}\r\n\r\nexport function iterate2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function iterateIndexed2(action, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n action(i, array1[i], array2[i]);\r\n }\r\n}\r\n\r\nexport function isEmpty(array) {\r\n return array.length === 0;\r\n}\r\n\r\nexport function forAll(predicate, array) {\r\n return array.every(predicate);\r\n}\r\n\r\nexport function permute(f, array) {\r\n const size = array.length | 0;\r\n const res = array.slice();\r\n const checkFlags = new Array(size);\r\n iterateIndexed((i, x) => {\r\n const j = f(i) | 0;\r\n if ((j < 0) ? true : (j >= size)) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n res[j] = x;\r\n checkFlags[j] = 1;\r\n }, array);\r\n if (!(checkFlags.every((y) => (1 === y)))) {\r\n throw (new Error(\"Not a valid permutation\"));\r\n }\r\n return res;\r\n}\r\n\r\nexport function setSlice(target, lower, upper, source) {\r\n const lower_1 = defaultArg(lower, 0) | 0;\r\n const upper_1 = defaultArg(upper, -1) | 0;\r\n const length = (((upper_1 >= 0) ? upper_1 : (target.length - 1)) - lower_1) | 0;\r\n for (let i = 0; i <= length; i++) {\r\n target[i + lower_1] = source[i];\r\n }\r\n}\r\n\r\nexport function sortInPlaceBy(projection, xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(projection(x), projection(y)));\r\n}\r\n\r\nexport function sortInPlace(xs, comparer) {\r\n xs.sort((x, y) => comparer.Compare(x, y));\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => comparer.Compare(x, y));\r\n return xs_1;\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n return (xs_1.sort((x, y) => comparer.Compare(projection(x), projection(y))), xs_1);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n const xs_1 = xs.slice();\r\n xs_1.sort((x, y) => (comparer.Compare(x, y) * -1));\r\n return xs_1;\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n const xs_1 = xs.slice();\r\n return (xs_1.sort((x, y) => (comparer.Compare(projection(x), projection(y)) * -1)), xs_1);\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const comparer_1 = comparer;\r\n const xs_1 = xs.slice();\r\n xs_1.sort(comparer_1);\r\n return xs_1;\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const len1 = xs.length | 0;\r\n const len2 = ys.length | 0;\r\n const res = new Array(len1 * len2);\r\n for (let i = 0; i <= (xs.length - 1); i++) {\r\n for (let j = 0; j <= (ys.length - 1); j++) {\r\n res[(i * len2) + j] = [xs[i], ys[j]];\r\n }\r\n }\r\n return res;\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n const res = [];\r\n const loop = (state_1_mut) => {\r\n loop:\r\n while (true) {\r\n const state_1 = state_1_mut;\r\n const matchValue = generator(state_1);\r\n if (matchValue != null) {\r\n const x = matchValue[0];\r\n const s = matchValue[1];\r\n res.push(x);\r\n state_1_mut = s;\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(state);\r\n return res;\r\n}\r\n\r\nexport function unzip(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n }, array);\r\n return [res1, res2];\r\n}\r\n\r\nexport function unzip3(array) {\r\n const len = array.length | 0;\r\n const res1 = new Array(len);\r\n const res2 = new Array(len);\r\n const res3 = new Array(len);\r\n iterateIndexed((i, tupledArg) => {\r\n res1[i] = tupledArg[0];\r\n res2[i] = tupledArg[1];\r\n res3[i] = tupledArg[2];\r\n }, array);\r\n return [res1, res2, res3];\r\n}\r\n\r\nexport function zip(array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function zip3(array1, array2, array3) {\r\n if ((array1.length !== array2.length) ? true : (array2.length !== array3.length)) {\r\n differentLengths();\r\n }\r\n const result = new Array(array1.length);\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n result[i] = [array1[i], array2[i], array3[i]];\r\n }\r\n return result;\r\n}\r\n\r\nexport function chunkBySize(chunkSize, array) {\r\n if (chunkSize < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: size\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n for (let x = 0; x <= ((~(~Math.ceil(array.length / chunkSize))) - 1); x++) {\r\n let slice;\r\n const start_1 = (x * chunkSize) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function splitAt(index, array) {\r\n let start;\r\n if ((index < 0) ? true : (index > array.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [(start = 0, array.slice(start, (start + index))), array.slice(index)];\r\n}\r\n\r\nexport function compareWith(comparer, array1, array2) {\r\n if (array1 == null) {\r\n if (array2 == null) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (array2 == null) {\r\n return 1;\r\n }\r\n else {\r\n let i = 0;\r\n let result = 0;\r\n const length1 = array1.length | 0;\r\n const length2 = array2.length | 0;\r\n if (length1 > length2) {\r\n return 1;\r\n }\r\n else if (length1 < length2) {\r\n return -1;\r\n }\r\n else {\r\n while ((i < length1) && (result === 0)) {\r\n result = (comparer(array1[i], array2[i]) | 0);\r\n i = ((i + 1) | 0);\r\n }\r\n return result | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function equalsWith(equals, array1, array2) {\r\n if (array1 == null) {\r\n if (array2 == null) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (array2 == null) {\r\n return false;\r\n }\r\n else {\r\n let i = 0;\r\n let result = true;\r\n const length1 = array1.length | 0;\r\n const length2 = array2.length | 0;\r\n if (length1 > length2) {\r\n return false;\r\n }\r\n else if (length1 < length2) {\r\n return false;\r\n }\r\n else {\r\n while ((i < length1) && result) {\r\n result = equals(array1[i], array2[i]);\r\n i = ((i + 1) | 0);\r\n }\r\n return result;\r\n }\r\n }\r\n}\r\n\r\nexport function exactlyOne(array) {\r\n if (array.length === 1) {\r\n return array[0];\r\n }\r\n else if (array.length === 0) {\r\n throw (new Error(\"The input sequence was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n throw (new Error(\"Input array too long\\\\nParameter name: array\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(array) {\r\n if (array.length === 1) {\r\n return some(array[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function head(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n else {\r\n return array[0];\r\n }\r\n}\r\n\r\nexport function tryHead(array) {\r\n if (array.length === 0) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[0]);\r\n }\r\n}\r\n\r\nexport function tail(array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"Not enough elements\\\\nParameter name: array\"));\r\n }\r\n return array.slice(1);\r\n}\r\n\r\nexport function item(index, array) {\r\n return array[index];\r\n}\r\n\r\nexport function tryItem(index, array) {\r\n if ((index < 0) ? true : (index >= array.length)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(array[index]);\r\n }\r\n}\r\n\r\nexport function foldBackIndexed(folder, array, state) {\r\n return array.reduceRight(((delegateArg0, delegateArg1, delegateArg2) => folder(delegateArg2, delegateArg1, delegateArg0)), state);\r\n}\r\n\r\nexport function foldBack(folder, array, state) {\r\n return array.reduceRight(((delegateArg0, delegateArg1) => folder(delegateArg1, delegateArg0)), state);\r\n}\r\n\r\nexport function foldIndexed2(folder, state, array1, array2) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n throw (new Error(\"Arrays have different lengths\"));\r\n }\r\n for (let i = 0; i <= (array1.length - 1); i++) {\r\n acc = folder(i, acc, array1[i], array2[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function fold2(folder, state, array1, array2) {\r\n return foldIndexed2((_arg1, acc, x, y) => folder(acc, x, y), state, array1, array2);\r\n}\r\n\r\nexport function foldBackIndexed2(folder, array1, array2, state) {\r\n let acc = state;\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n const size = array1.length | 0;\r\n for (let i = 1; i <= size; i++) {\r\n acc = folder(i - 1, array1[size - i], array2[size - i], acc);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(f, array1, array2, state) {\r\n return foldBackIndexed2((_arg1, x, y, acc) => f(x, y, acc), array1, array2, state);\r\n}\r\n\r\nexport function reduce(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduce(reduction_1);\r\n}\r\n\r\nexport function reduceBack(reduction, array) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\"));\r\n }\r\n const reduction_1 = reduction;\r\n return array.reduceRight(reduction_1);\r\n}\r\n\r\nexport function forAll2(predicate, array1, array2) {\r\n return fold2((acc, x, y) => (acc && predicate(x, y)), true, array1, array2);\r\n}\r\n\r\nexport function existsOffset(predicate_mut, array_mut, index_mut) {\r\n existsOffset:\r\n while (true) {\r\n const predicate = predicate_mut, array = array_mut, index = index_mut;\r\n if (index === array.length) {\r\n return false;\r\n }\r\n else if (predicate(array[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array_mut = array;\r\n index_mut = (index + 1);\r\n continue existsOffset;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists(predicate, array) {\r\n return existsOffset(predicate, array, 0);\r\n}\r\n\r\nexport function existsOffset2(predicate_mut, array1_mut, array2_mut, index_mut) {\r\n existsOffset2:\r\n while (true) {\r\n const predicate = predicate_mut, array1 = array1_mut, array2 = array2_mut, index = index_mut;\r\n if (index === array1.length) {\r\n return false;\r\n }\r\n else if (predicate(array1[index], array2[index])) {\r\n return true;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n array1_mut = array1;\r\n array2_mut = array2;\r\n index_mut = (index + 1);\r\n continue existsOffset2;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function exists2(predicate, array1, array2) {\r\n if (array1.length !== array2.length) {\r\n differentLengths();\r\n }\r\n return existsOffset2(predicate, array1, array2, 0);\r\n}\r\n\r\nexport function sum(array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, array[i]);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function sumBy(projection, array, adder) {\r\n let acc = adder.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n acc = adder.Add(acc, projection(array[i]));\r\n }\r\n return acc;\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, array[i]);\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function averageBy(projection, array, averager) {\r\n if (array.length === 0) {\r\n throw (new Error(\"The input array was empty\\\\nParameter name: array\"));\r\n }\r\n let total = averager.GetZero();\r\n for (let i = 0; i <= (array.length - 1); i++) {\r\n total = averager.Add(total, projection(array[i]));\r\n }\r\n return averager.DivideByInt(total, array.length);\r\n}\r\n\r\nexport function windowed(windowSize, source) {\r\n if (windowSize <= 0) {\r\n throw (new Error(\"windowSize must be positive\"));\r\n }\r\n let res;\r\n const len = max_1(comparePrimitives, 0, (source.length - windowSize) + 1) | 0;\r\n res = (new Array(len));\r\n for (let i = windowSize; i <= source.length; i++) {\r\n res[i - windowSize] = source.slice(i - windowSize, (i - 1) + 1);\r\n }\r\n return res;\r\n}\r\n\r\nexport function splitInto(chunks, array) {\r\n if (chunks < 1) {\r\n throw (new Error(\"The input must be positive.\\\\nParameter name: chunks\"));\r\n }\r\n if (array.length === 0) {\r\n return [[]];\r\n }\r\n else {\r\n const result = [];\r\n const chunks_1 = min_1(comparePrimitives, chunks, array.length) | 0;\r\n const minChunkSize = (~(~(array.length / chunks_1))) | 0;\r\n const chunksWithExtraItem = (array.length % chunks_1) | 0;\r\n for (let i = 0; i <= (chunks_1 - 1); i++) {\r\n const chunkSize = ((i < chunksWithExtraItem) ? (minChunkSize + 1) : minChunkSize) | 0;\r\n let slice;\r\n const start_1 = ((i * minChunkSize) + min_1(comparePrimitives, chunksWithExtraItem, i)) | 0;\r\n slice = (array.slice(start_1, (start_1 + chunkSize)));\r\n result.push(slice);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function transpose(arrays, cons) {\r\n const arrays_1 = Array.isArray(arrays) ? arrays : (Array.from(arrays));\r\n const len = arrays_1.length | 0;\r\n if (len === 0) {\r\n return new Array(0);\r\n }\r\n else {\r\n const firstArray = arrays_1[0];\r\n const lenInner = firstArray.length | 0;\r\n if (!forAll((a) => (a.length === lenInner), arrays_1)) {\r\n differentLengths();\r\n }\r\n const result = new Array(lenInner);\r\n for (let i = 0; i <= (lenInner - 1); i++) {\r\n result[i] = Helpers_allocateArrayFromCons(cons, len);\r\n for (let j = 0; j <= (len - 1); j++) {\r\n result[i][j] = arrays_1[j][i];\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len + 1);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n target[index] = y;\r\n for (let i_1 = index; i_1 <= (len - 1); i_1++) {\r\n target[i_1 + 1] = xs[i_1];\r\n }\r\n return target;\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index > len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const ys_1 = Array.from(ys);\r\n const len2 = ys_1.length | 0;\r\n const target = new xs.constructor(len + len2);\r\n for (let i = 0; i <= (index - 1); i++) {\r\n target[i] = xs[i];\r\n }\r\n for (let i_1 = 0; i_1 <= (len2 - 1); i_1++) {\r\n target[index + i_1] = ys_1[i_1];\r\n }\r\n for (let i_2 = index; i_2 <= (len - 1); i_2++) {\r\n target[i_2 + len2] = xs[i_2];\r\n }\r\n return target;\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n if ((index < 0) ? true : (index >= xs.length)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n let i = -1;\r\n return filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n return i !== index;\r\n }, xs);\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n const len = xs.length | 0;\r\n if ((index < 0) ? true : (index >= len)) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n const target = new xs.constructor(len);\r\n for (let i = 0; i <= (len - 1); i++) {\r\n target[i] = ((i === index) ? y : xs[i]);\r\n }\r\n return target;\r\n}\r\n\r\n","import { OperationCanceledError, Trampoline } from \"./AsyncBuilder.js\";\nimport { CancellationToken } from \"./AsyncBuilder.js\";\nimport { protectedCont } from \"./AsyncBuilder.js\";\nimport { protectedBind } from \"./AsyncBuilder.js\";\nimport { protectedReturn } from \"./AsyncBuilder.js\";\nimport { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from \"./Choice.js\";\nimport { TimeoutException } from \"./SystemException.js\";\n// Implemented just for type references\nexport class Async {\n}\nfunction emptyContinuation(_x) {\n // NOP\n}\n// see AsyncBuilder.Delay\nfunction delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n}\n// MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T>\nexport function makeAsync(body) {\n return body;\n}\n// Invoke: computation: Async<'T> -> ctxt:AsyncActivation<'T> -> AsyncReturn\nexport function invoke(computation, ctx) {\n return computation(ctx);\n}\n// CallThenInvoke: ctxt:AsyncActivation<'T> -> result1:'U -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function callThenInvoke(ctx, result1, part2) {\n return part2(result1)(ctx);\n}\n// Bind: ctxt:AsyncActivation<'T> -> part1:Async<'U> -> part2:('U -> Async<'T>) -> AsyncReturn\nexport function bind(ctx, part1, part2) {\n return protectedBind(part1, part2)(ctx);\n}\nexport function createCancellationToken(arg) {\n const token = new CancellationToken(typeof arg === \"boolean\" ? arg : false);\n if (typeof arg === \"number\") {\n setTimeout(() => { token.cancel(); }, arg);\n }\n return token;\n}\nexport function cancel(token) {\n token.cancel();\n}\nexport function cancelAfter(token, ms) {\n setTimeout(() => { token.cancel(); }, ms);\n}\nexport function isCancellationRequested(token) {\n return token != null && token.isCancelled;\n}\nexport function throwIfCancellationRequested(token) {\n if (token != null && token.isCancelled) {\n throw new Error(\"Operation is cancelled\");\n }\n}\nfunction throwAfter(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onError(new TimeoutException());\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function startChild(computation, ms) {\n if (ms) {\n const computationWithTimeout = protectedBind(parallel2(computation, throwAfter(ms)), xs => protectedReturn(xs[0]));\n return startChild(computationWithTimeout);\n }\n const promise = startAsPromise(computation);\n // JS Promises are hot, computation has already started\n // but we delay returning the result\n return protectedCont((ctx) => protectedReturn(awaitPromise(promise))(ctx));\n}\nexport function awaitPromise(p) {\n return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledError\n ? conts[2] : conts[1])(err)));\n}\nexport function cancellationToken() {\n return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken));\n}\nexport const defaultCancellationToken = new CancellationToken();\nexport function catchAsync(work) {\n return protectedCont((ctx) => {\n work({\n onSuccess: (x) => ctx.onSuccess(Choice_makeChoice1Of2(x)),\n onError: (ex) => ctx.onSuccess(Choice_makeChoice2Of2(ex)),\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function fromContinuations(f) {\n return protectedCont((ctx) => f([ctx.onSuccess, ctx.onError, ctx.onCancel]));\n}\nexport function ignore(computation) {\n return protectedBind(computation, (_x) => protectedReturn(void 0));\n}\nexport function parallel(computations) {\n return delay(() => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w)))));\n}\nfunction parallel2(a, b) {\n return delay(() => awaitPromise(Promise.all([startAsPromise(a), startAsPromise(b)])));\n}\nexport function sequential(computations) {\n function _sequential(computations) {\n let pr = Promise.resolve([]);\n for (const c of computations) {\n pr = pr.then(results => startAsPromise(c).then(r => results.concat([r])));\n }\n return pr;\n }\n return delay(() => awaitPromise(_sequential(computations)));\n}\nexport function sleep(millisecondsDueTime) {\n return protectedCont((ctx) => {\n let tokenId;\n const timeoutId = setTimeout(() => {\n ctx.cancelToken.removeListener(tokenId);\n ctx.onSuccess(void 0);\n }, millisecondsDueTime);\n tokenId = ctx.cancelToken.addListener(() => {\n clearTimeout(timeoutId);\n ctx.onCancel(new OperationCanceledError());\n });\n });\n}\nexport function runSynchronously() {\n throw new Error(\"Asynchronous code cannot be run synchronously in JS\");\n}\nexport function start(computation, cancellationToken) {\n return startWithContinuations(computation, cancellationToken);\n}\nexport function startImmediate(computation, cancellationToken) {\n return start(computation, cancellationToken);\n}\nexport function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {\n if (typeof continuation !== \"function\") {\n cancelToken = continuation;\n continuation = undefined;\n }\n const trampoline = new Trampoline();\n computation({\n onSuccess: continuation ? continuation : emptyContinuation,\n onError: exceptionContinuation ? exceptionContinuation : emptyContinuation,\n onCancel: cancellationContinuation ? cancellationContinuation : emptyContinuation,\n cancelToken: cancelToken ? cancelToken : defaultCancellationToken,\n trampoline,\n });\n}\nexport function startAsPromise(computation, cancellationToken) {\n return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken));\n}\nexport default Async;\n","export class CancellationToken {\n constructor(cancelled = false) {\n this._id = 0;\n this._cancelled = cancelled;\n this._listeners = new Map();\n }\n get isCancelled() {\n return this._cancelled;\n }\n cancel() {\n if (!this._cancelled) {\n this._cancelled = true;\n for (const [, listener] of this._listeners) {\n listener();\n }\n }\n }\n addListener(f) {\n const id = this._id;\n this._listeners.set(this._id++, f);\n return id;\n }\n removeListener(id) {\n return this._listeners.delete(id);\n }\n register(f, state) {\n const $ = this;\n const id = this.addListener(state == null ? f : () => f(state));\n return { Dispose() { $.removeListener(id); } };\n }\n}\nexport class OperationCanceledError extends Error {\n constructor() {\n super(\"The operation was canceled\");\n Object.setPrototypeOf(this, OperationCanceledError.prototype);\n }\n}\nexport class Trampoline {\n constructor() {\n this.callCount = 0;\n }\n static get maxTrampolineCallCount() {\n return 2000;\n }\n incrementAndCheck() {\n return this.callCount++ > Trampoline.maxTrampolineCallCount;\n }\n hijack(f) {\n this.callCount = 0;\n setTimeout(f, 0);\n }\n}\nexport function protectedCont(f) {\n return (ctx) => {\n if (ctx.cancelToken.isCancelled) {\n ctx.onCancel(new OperationCanceledError());\n }\n else if (ctx.trampoline.incrementAndCheck()) {\n ctx.trampoline.hijack(() => {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(err);\n }\n });\n }\n else {\n try {\n f(ctx);\n }\n catch (err) {\n ctx.onError(err);\n }\n }\n };\n}\nexport function protectedBind(computation, binder) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n try {\n binder(x)(ctx);\n }\n catch (ex) {\n ctx.onError(ex);\n }\n },\n onError: ctx.onError,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n}\nexport function protectedReturn(value) {\n return protectedCont((ctx) => ctx.onSuccess(value));\n}\nexport class AsyncBuilder {\n Bind(computation, binder) {\n return protectedBind(computation, binder);\n }\n Combine(computation1, computation2) {\n return this.Bind(computation1, () => computation2);\n }\n Delay(generator) {\n return protectedCont((ctx) => generator()(ctx));\n }\n For(sequence, body) {\n const iter = sequence[Symbol.iterator]();\n let cur = iter.next();\n return this.While(() => !cur.done, this.Delay(() => {\n const res = body(cur.value);\n cur = iter.next();\n return res;\n }));\n }\n Return(value) {\n return protectedReturn(value);\n }\n ReturnFrom(computation) {\n return computation;\n }\n TryFinally(computation, compensation) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: (x) => {\n compensation();\n ctx.onSuccess(x);\n },\n onError: (x) => {\n compensation();\n ctx.onError(x);\n },\n onCancel: (x) => {\n compensation();\n ctx.onCancel(x);\n },\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n });\n });\n }\n TryWith(computation, catchHandler) {\n return protectedCont((ctx) => {\n computation({\n onSuccess: ctx.onSuccess,\n onCancel: ctx.onCancel,\n cancelToken: ctx.cancelToken,\n trampoline: ctx.trampoline,\n onError: (ex) => {\n try {\n catchHandler(ex)(ctx);\n }\n catch (ex2) {\n ctx.onError(ex2);\n }\n },\n });\n });\n }\n Using(resource, binder) {\n return this.TryFinally(binder(resource), () => resource.Dispose());\n }\n While(guard, computation) {\n if (guard()) {\n return this.Bind(computation, () => this.While(guard, computation));\n }\n else {\n return this.Return(void 0);\n }\n }\n Zero() {\n return protectedCont((ctx) => ctx.onSuccess(void 0));\n }\n}\nexport const singleton = new AsyncBuilder();\n","import { BigInteger_op_Inequality_56F059C0, BigInteger_op_Equality_56F059C0, BigInteger_op_GreaterThanOrEqual_56F059C0, BigInteger_op_GreaterThan_56F059C0, BigInteger_op_LessThanOrEqual_56F059C0, BigInteger_op_LessThan_56F059C0, BigInteger_op_ExclusiveOr_56F059C0, BigInteger_op_BitwiseOr_56F059C0, BigInteger_op_BitwiseAnd_56F059C0, BigInteger_op_LeftShift_62E082A2, BigInteger_op_RightShift_62E082A2, BigInteger_op_UnaryPlus_Z665282C2, BigInteger_op_UnaryNegation_Z665282C2, BigInteger_op_Modulus_56F059C0, BigInteger_op_Division_56F059C0, BigInteger_op_Multiply_56F059C0, BigInteger_op_Subtraction_56F059C0, BigInteger_op_Addition_56F059C0, BigInteger__get_IsOne, BigInteger__get_IsZero, BigInteger__get_Sign, BigInteger__get_ToDecimal, BigInteger__get_ToDouble, BigInteger__get_ToSingle, BigInteger__get_ToUInt64, BigInteger__get_ToInt64, BigInteger__get_ToUInt32, BigInteger__get_ToInt32, BigInteger__get_ToUInt16, BigInteger__get_ToInt16, BigInteger__get_ToByte, BigInteger__get_ToSByte, BigInteger_$ctor_Z524259A4, BigInteger_$ctor_Z524259C1, BigInteger_get_Two, BigInteger_get_One, BigInteger_get_Zero, BigInteger_Abs_Z665282C2, BigInteger_Pow_62E082A2, BigInteger_GreatestCommonDivisor_56F059C0, BigInteger_DivRem_56F059C0, BigInteger_Parse_Z721C83C5, BigInteger } from \"./BigInt/z.js\";\r\nimport { fromInteger } from \"./Long.js\";\r\nimport { comparePrimitives, min, compare as compare_1, equals as equals_1, safeHash } from \"./Util.js\";\r\nimport { toString as toString_1 } from \"./Types.js\";\r\nimport { fold, empty, ofArrayWithTail, cons, toArray, head, skipWhile } from \"./List.js\";\r\nimport { fill, reverse } from \"./Array.js\";\r\n\r\nexport function isBigInt(x) {\r\n return x instanceof BigInteger;\r\n}\r\n\r\nexport function tryParse(str, res) {\r\n try {\r\n res.contents = BigInteger_Parse_Z721C83C5(str);\r\n return true;\r\n }\r\n catch (matchValue) {\r\n return false;\r\n }\r\n}\r\n\r\nexport function divRem(x, y, remainder) {\r\n const patternInput = BigInteger_DivRem_56F059C0(x, y);\r\n remainder.contents = patternInput[1];\r\n return patternInput[0];\r\n}\r\n\r\nexport function parse(arg00) {\r\n return BigInteger_Parse_Z721C83C5(arg00);\r\n}\r\n\r\nexport function greatestCommonDivisor(arg00, arg01) {\r\n return BigInteger_GreatestCommonDivisor_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function pow(arg00, arg01) {\r\n return BigInteger_Pow_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function abs(arg00) {\r\n return BigInteger_Abs_Z665282C2(arg00);\r\n}\r\n\r\nexport const zero = BigInteger_get_Zero();\r\n\r\nexport const one = BigInteger_get_One();\r\n\r\nexport const two = BigInteger_get_Two();\r\n\r\nexport function fromString(s) {\r\n return BigInteger_Parse_Z721C83C5(s);\r\n}\r\n\r\nexport function fromZero() {\r\n return BigInteger_get_Zero();\r\n}\r\n\r\nexport function fromOne() {\r\n return BigInteger_get_One();\r\n}\r\n\r\nexport function fromInt64(i) {\r\n return BigInteger_$ctor_Z524259C1(i);\r\n}\r\n\r\nexport function fromInt32(i) {\r\n if (i > 2147483647) {\r\n return BigInteger_$ctor_Z524259C1(fromInteger(i, false, 6));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z524259A4(i);\r\n }\r\n}\r\n\r\nexport function toSByte(x) {\r\n return BigInteger__get_ToSByte(x);\r\n}\r\n\r\nexport function toByte(x) {\r\n return BigInteger__get_ToByte(x);\r\n}\r\n\r\nexport function toInt16(x) {\r\n return BigInteger__get_ToInt16(x);\r\n}\r\n\r\nexport function toUInt16(x) {\r\n return BigInteger__get_ToUInt16(x);\r\n}\r\n\r\nexport function toInt32(x) {\r\n return BigInteger__get_ToInt32(x);\r\n}\r\n\r\nexport function toUInt32(x) {\r\n return BigInteger__get_ToUInt32(x);\r\n}\r\n\r\nexport function toInt64(x) {\r\n return BigInteger__get_ToInt64(x);\r\n}\r\n\r\nexport function toUInt64(x) {\r\n return BigInteger__get_ToUInt64(x);\r\n}\r\n\r\nexport function toSingle(x) {\r\n return BigInteger__get_ToSingle(x);\r\n}\r\n\r\nexport function toDouble(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function toDecimal(x) {\r\n return BigInteger__get_ToDecimal(x);\r\n}\r\n\r\nexport function sign(x) {\r\n return BigInteger__get_Sign(x);\r\n}\r\n\r\nexport function isZero(x) {\r\n return BigInteger__get_IsZero(x);\r\n}\r\n\r\nexport function isOne(x) {\r\n return BigInteger__get_IsOne(x);\r\n}\r\n\r\nexport function hash(x) {\r\n return safeHash(x);\r\n}\r\n\r\nexport function compare(x, y) {\r\n return x.CompareTo(y);\r\n}\r\n\r\nexport function equals(x, y) {\r\n return equals_1(x, y);\r\n}\r\n\r\nexport function toString(x) {\r\n return toString_1(x);\r\n}\r\n\r\nexport const get_Zero = BigInteger_get_Zero();\r\n\r\nexport const get_One = BigInteger_get_One();\r\n\r\nexport function op_Addition(arg00, arg01) {\r\n return BigInteger_op_Addition_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Subtraction(arg00, arg01) {\r\n return BigInteger_op_Subtraction_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Multiply(arg00, arg01) {\r\n return BigInteger_op_Multiply_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Division(arg00, arg01) {\r\n return BigInteger_op_Division_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Modulus(arg00, arg01) {\r\n return BigInteger_op_Modulus_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_UnaryNegation(arg00) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(arg00);\r\n}\r\n\r\nexport function op_UnaryPlus(arg00) {\r\n return BigInteger_op_UnaryPlus_Z665282C2(arg00);\r\n}\r\n\r\nexport function op_RightShift(arg00, arg01) {\r\n return BigInteger_op_RightShift_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function op_LeftShift(arg00, arg01) {\r\n return BigInteger_op_LeftShift_62E082A2(arg00, arg01);\r\n}\r\n\r\nexport function op_BitwiseAnd(arg00, arg01) {\r\n return BigInteger_op_BitwiseAnd_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_BitwiseOr(arg00, arg01) {\r\n return BigInteger_op_BitwiseOr_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_ExclusiveOr(arg00, arg01) {\r\n return BigInteger_op_ExclusiveOr_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_LessThan(arg00, arg01) {\r\n return BigInteger_op_LessThan_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_LessThanOrEqual(arg00, arg01) {\r\n return BigInteger_op_LessThanOrEqual_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_GreaterThan(arg00, arg01) {\r\n return BigInteger_op_GreaterThan_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_GreaterThanOrEqual(arg00, arg01) {\r\n return BigInteger_op_GreaterThanOrEqual_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Equality(arg00, arg01) {\r\n return BigInteger_op_Equality_56F059C0(arg00, arg01);\r\n}\r\n\r\nexport function op_Inequality(arg00, arg01) {\r\n return BigInteger_op_Inequality_56F059C0(arg00, arg01);\r\n}\r\n\r\nfunction flipTwosComplement(currByte, lowBitFound) {\r\n let array;\r\n const matchValue = [currByte, lowBitFound];\r\n if (matchValue[1]) {\r\n return [(currByte ^ 255) & 255, true];\r\n }\r\n else if (matchValue[0] === 0) {\r\n return [0, false];\r\n }\r\n else {\r\n return [(currByte ^ (254 << ((array = (new Int32Array([0, 1, 2, 3, 4, 5, 6, 7])), array.find((i) => ((currByte & (1 << i)) > 0)))))) & 255, true];\r\n }\r\n}\r\n\r\nexport function toByteArray(value) {\r\n if (equals_1(value, zero)) {\r\n return new Uint8Array([0]);\r\n }\r\n else {\r\n const isPositive = compare_1(value, zero) > 0;\r\n const value_1 = isPositive ? value : BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value);\r\n const mask32 = fromInt64(fromInteger(4294967295, false, 6));\r\n const loop = (accumBytes_mut, consumeValue_mut, lowBitFound_mut) => {\r\n let value_6, value_8, value_9, value_10;\r\n loop:\r\n while (true) {\r\n const accumBytes = accumBytes_mut, consumeValue = consumeValue_mut, lowBitFound = lowBitFound_mut;\r\n if (compare_1(consumeValue, zero) <= 0) {\r\n const accumBytes_1 = isPositive ? skipWhile((b) => (b === 0), accumBytes) : skipWhile((b_1) => (b_1 === 255), accumBytes);\r\n const isHighBitOne = (head(accumBytes_1) & 128) !== 0;\r\n return reverse(toArray((isPositive && isHighBitOne) ? cons(0, accumBytes_1) : (((!isPositive) && (!isHighBitOne)) ? cons(255, accumBytes_1) : accumBytes_1)));\r\n }\r\n else {\r\n const currValue = toUInt32(BigInteger_op_BitwiseAnd_56F059C0(consumeValue, mask32));\r\n if (isPositive) {\r\n const b0 = currValue & 0xFF;\r\n let b1;\r\n const value_4 = currValue >>> 8;\r\n b1 = (value_4 & 0xFF);\r\n let b2;\r\n const value_5 = currValue >>> 16;\r\n b2 = (value_5 & 0xFF);\r\n accumBytes_mut = ofArrayWithTail([(value_6 = (currValue >>> 24), value_6 & 0xFF), b2, b1, b0], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n const patternInput = flipTwosComplement(currValue & 0xFF, lowBitFound);\r\n const patternInput_1 = flipTwosComplement((value_8 = (currValue >>> 8), value_8 & 0xFF), patternInput[1]);\r\n const patternInput_2 = flipTwosComplement((value_9 = (currValue >>> 16), value_9 & 0xFF), patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement((value_10 = (currValue >>> 24), value_10 & 0xFF), patternInput_2[1]);\r\n accumBytes_mut = ofArrayWithTail([patternInput_3[0], patternInput_2[0], patternInput_1[0], patternInput[0]], accumBytes);\r\n consumeValue_mut = BigInteger_op_RightShift_62E082A2(consumeValue, 32);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), value_1, false);\r\n }\r\n}\r\n\r\nexport function fromByteArray(bytes) {\r\n if (bytes == null) {\r\n throw (new Error(\"bytes\"));\r\n }\r\n if (bytes.length === 0) {\r\n return zero;\r\n }\r\n else {\r\n const isPositive = (bytes[bytes.length - 1] & 128) === 0;\r\n const buffer = fill(new Uint8Array(4), 0, 4, 0);\r\n const loop = (accumUInt32_mut, currIndex_mut, bytesRemaining_mut, lowBitFound_mut) => {\r\n loop:\r\n while (true) {\r\n const accumUInt32 = accumUInt32_mut, currIndex = currIndex_mut, bytesRemaining = bytesRemaining_mut, lowBitFound = lowBitFound_mut;\r\n if (bytesRemaining === 0) {\r\n const value_2 = fold((acc, value) => BigInteger_op_Addition_56F059C0(BigInteger_op_LeftShift_62E082A2(acc, 32), fromInt64(fromInteger(value, false, 6))), zero, accumUInt32);\r\n if (isPositive) {\r\n return value_2;\r\n }\r\n else {\r\n return BigInteger_op_Multiply_56F059C0(BigInteger_$ctor_Z524259A4(-1), value_2);\r\n }\r\n }\r\n else {\r\n const bytesToProcess = min(comparePrimitives, bytesRemaining, 4) | 0;\r\n for (let i_1 = 0; i_1 <= (bytesToProcess - 1); i_1++) {\r\n buffer[i_1] = bytes[currIndex + i_1];\r\n }\r\n if (isPositive) {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 0);\r\n accumUInt32_mut = cons((((((buffer[0] | ((buffer[1] << 8) >>> 0)) >>> 0) | ((buffer[2] << 16) >>> 0)) >>> 0) | ((buffer[3] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = false;\r\n continue loop;\r\n }\r\n else {\r\n fill(buffer, bytesToProcess, 4 - bytesToProcess, 255);\r\n const patternInput = flipTwosComplement(buffer[0], lowBitFound);\r\n const patternInput_1 = flipTwosComplement(buffer[1], patternInput[1]);\r\n const patternInput_2 = flipTwosComplement(buffer[2], patternInput_1[1]);\r\n const patternInput_3 = flipTwosComplement(buffer[3], patternInput_2[1]);\r\n accumUInt32_mut = cons((((((patternInput[0] | ((patternInput_1[0] << 8) >>> 0)) >>> 0) | ((patternInput_2[0] << 16) >>> 0)) >>> 0) | ((patternInput_3[0] << 24) >>> 0)) >>> 0, accumUInt32);\r\n currIndex_mut = (currIndex + bytesToProcess);\r\n bytesRemaining_mut = (bytesRemaining - bytesToProcess);\r\n lowBitFound_mut = patternInput_3[1];\r\n continue loop;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(empty(), 0, bytes.length, false);\r\n }\r\n}\r\n\r\n","import { Record } from \"../Types.js\";\r\nimport { record_type, array_type, int32_type } from \"../Reflection.js\";\r\nimport { op_LeftShift, op_BitwiseAnd, op_Addition, compare, op_Subtraction, op_Division, equals, fromInteger, op_Multiply, op_Modulus, toInt, fromBits } from \"../Long.js\";\r\nimport { copy, initialize, map, fill } from \"../Array.js\";\r\nimport { toArray, empty, head, tail, isEmpty, cons } from \"../List.js\";\r\nimport { int32ToString } from \"../Util.js\";\r\nimport { isNullOrEmpty, join } from \"../String.js\";\r\n\r\nexport class BigNat extends Record {\r\n constructor(bound, digits) {\r\n super();\r\n this.bound = (bound | 0);\r\n this.digits = digits;\r\n }\r\n}\r\n\r\nexport function BigNat$reflection() {\r\n return record_type(\"BigInt.BigNat\", [], BigNat, () => [[\"bound\", int32_type], [\"digits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_FFT_pow32(x_mut, n_mut) {\r\n BigNatModule_FFT_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_FFT_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_leastBounding2Power(b) {\r\n const findBounding2Power = (b_1_mut, tp_mut, i_mut) => {\r\n findBounding2Power:\r\n while (true) {\r\n const b_1 = b_1_mut, tp = tp_mut, i = i_mut;\r\n if (b_1 <= tp) {\r\n return [tp, i];\r\n }\r\n else {\r\n b_1_mut = b_1;\r\n tp_mut = (tp * 2);\r\n i_mut = (i + 1);\r\n continue findBounding2Power;\r\n }\r\n break;\r\n }\r\n };\r\n return findBounding2Power(b, 1, 0);\r\n}\r\n\r\nexport const BigNatModule_FFT_p = fromBits(2013265921, 0, false);\r\n\r\nconst BigNatModule_FFT_patternInput$004075 = [27, 15, 31, 440564289];\r\n\r\nexport const BigNatModule_FFT_w = BigNatModule_FFT_patternInput$004075[3];\r\n\r\nexport const BigNatModule_FFT_m = BigNatModule_FFT_patternInput$004075[1];\r\n\r\nexport const BigNatModule_FFT_k = BigNatModule_FFT_patternInput$004075[0];\r\n\r\nexport const BigNatModule_FFT_g = BigNatModule_FFT_patternInput$004075[2];\r\n\r\nexport const BigNatModule_FFT_primeP = BigNatModule_FFT_p;\r\n\r\nexport const BigNatModule_FFT_maxBitsInsideFp = 30;\r\n\r\nexport const BigNatModule_FFT_Fp_p = 2013265921;\r\n\r\nexport const BigNatModule_FFT_Fp_p64 = fromBits(2013265921, 0, true);\r\n\r\nexport function BigNatModule_FFT_Fp_toInt(x) {\r\n return ~(~x);\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_ofInt32(x) {\r\n return x >>> 0;\r\n}\r\n\r\nexport const BigNatModule_FFT_Fp_mzero = 0;\r\n\r\nexport const BigNatModule_FFT_Fp_mone = 1;\r\n\r\nexport const BigNatModule_FFT_Fp_mtwo = 2;\r\n\r\nexport function BigNatModule_FFT_Fp_mpow(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpow:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_FFT_Fp_mpow;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpow(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, ~(~(n / 2)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_mpowL(x_mut, n_mut) {\r\n BigNatModule_FFT_Fp_mpowL:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (equals(n, fromBits(0, 0, false))) {\r\n return BigNatModule_FFT_Fp_mone;\r\n }\r\n else if (equals(op_Modulus(n, fromBits(2, 0, false)), fromBits(0, 0, false))) {\r\n x_mut = (toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0);\r\n n_mut = op_Division(n, fromBits(2, 0, false));\r\n continue BigNatModule_FFT_Fp_mpowL;\r\n }\r\n else {\r\n const y_2 = BigNatModule_FFT_Fp_mpowL(toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(x, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0, op_Division(n, fromBits(2, 0, false)));\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y_2, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_m2PowNthRoot(n) {\r\n return BigNatModule_FFT_Fp_mpow(BigNatModule_FFT_w >>> 0, BigNatModule_FFT_pow32(2, BigNatModule_FFT_k - n));\r\n}\r\n\r\nexport function BigNatModule_FFT_Fp_minv(x) {\r\n return BigNatModule_FFT_Fp_mpowL(x, op_Subtraction(BigNatModule_FFT_primeP, fromBits(2, 0, false)));\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFFT(lambda, mu, n, w, u, res, offset) {\r\n let x_1, x_3, y_5;\r\n if (n === 1) {\r\n res[offset] = u[mu];\r\n }\r\n else {\r\n const halfN = (~(~(n / 2))) | 0;\r\n const ww = toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(w, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n const offsetHalfN = (offset + halfN) | 0;\r\n BigNatModule_FFT_computeFFT(lambda * 2, mu, halfN, ww, u, res, offset);\r\n BigNatModule_FFT_computeFFT(lambda * 2, lambda + mu, halfN, ww, u, res, offsetHalfN);\r\n let wj = BigNatModule_FFT_Fp_mone;\r\n for (let j = 0; j <= (halfN - 1); j++) {\r\n const even = res[offset + j];\r\n const odd = res[offsetHalfN + j];\r\n res[offset + j] = ((even + ((x_1 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_1, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n res[offsetHalfN + j] = (((even + BigNatModule_FFT_Fp_p) - ((x_3 = wj, toInt(op_Modulus(op_Multiply(fromInteger(x_3, true, 6), fromInteger(odd, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0))) % BigNatModule_FFT_Fp_p);\r\n wj = ((y_5 = wj, toInt(op_Modulus(op_Multiply(fromInteger(w, true, 6), fromInteger(y_5, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0));\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_FFT_computFftInPlace(n, w, u) {\r\n const res = fill(new Uint32Array(n), 0, n, BigNatModule_FFT_Fp_mzero);\r\n BigNatModule_FFT_computeFFT(1, 0, n, w, u, res, 0);\r\n return res;\r\n}\r\n\r\nexport function BigNatModule_FFT_computeInverseFftInPlace(n, w, uT) {\r\n const bigKInv = BigNatModule_FFT_Fp_minv(n >>> 0);\r\n return map((y) => (toInt(op_Modulus(op_Multiply(fromInteger(bigKInv, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0), BigNatModule_FFT_computFftInPlace(n, BigNatModule_FFT_Fp_minv(w), uT), Uint32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_maxTwoPower = 29;\r\n\r\nexport const BigNatModule_FFT_twoPowerTable = initialize(BigNatModule_FFT_maxTwoPower - 1, (i) => BigNatModule_FFT_pow32(2, i), Int32Array);\r\n\r\nexport function BigNatModule_FFT_computeFftPaddedPolynomialProduct(bigK, k, u, v) {\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(k);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v);\r\n return BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array));\r\n}\r\n\r\nexport function BigNatModule_FFT_padTo(n, u) {\r\n const uBound = u.length | 0;\r\n return initialize(n, (i) => ((i < uBound) ? BigNatModule_FFT_Fp_ofInt32(u[i]) : BigNatModule_FFT_Fp_mzero), Uint32Array);\r\n}\r\n\r\nexport function BigNatModule_FFT_computeFftPolynomialProduct(degu, u, degv, v) {\r\n const patternInput = BigNatModule_FFT_leastBounding2Power((degu + degv) + 1);\r\n const bigK = patternInput[0] | 0;\r\n const w = BigNatModule_FFT_Fp_m2PowNthRoot(patternInput[1]);\r\n const u_1 = BigNatModule_FFT_padTo(bigK, u);\r\n const v_1 = BigNatModule_FFT_padTo(bigK, v);\r\n const n = bigK | 0;\r\n const uT = BigNatModule_FFT_computFftInPlace(n, w, u_1);\r\n const vT = BigNatModule_FFT_computFftInPlace(n, w, v_1);\r\n return map(BigNatModule_FFT_Fp_toInt, BigNatModule_FFT_computeInverseFftInPlace(n, w, initialize(n, (i) => {\r\n const x = uT[i];\r\n const y = vT[i];\r\n return toInt(op_Modulus(op_Multiply(fromInteger(x, true, 6), fromInteger(y, true, 6)), BigNatModule_FFT_Fp_p64)) >>> 0;\r\n }, Uint32Array)), Int32Array);\r\n}\r\n\r\nexport const BigNatModule_FFT_mzero = BigNatModule_FFT_Fp_mzero;\r\n\r\nexport const BigNatModule_FFT_mone = BigNatModule_FFT_Fp_mone;\r\n\r\nexport const BigNatModule_FFT_maxFp = ((BigNatModule_FFT_Fp_p + BigNatModule_FFT_Fp_p) - BigNatModule_FFT_mone) % BigNatModule_FFT_Fp_p;\r\n\r\nexport function BigNatModule_bound(n) {\r\n return n.bound;\r\n}\r\n\r\nexport function BigNatModule_setBound(n, v) {\r\n n.bound = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_coeff(n, i) {\r\n return n.digits[i];\r\n}\r\n\r\nexport function BigNatModule_coeff64(n, i) {\r\n return fromInteger(BigNatModule_coeff(n, i), false, 2);\r\n}\r\n\r\nexport function BigNatModule_setCoeff(n, i, v) {\r\n n.digits[i] = (v | 0);\r\n}\r\n\r\nexport function BigNatModule_pow64(x_mut, n_mut) {\r\n BigNatModule_pow64:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return fromBits(1, 0, false);\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = op_Multiply(x, x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow64;\r\n }\r\n else {\r\n return op_Multiply(x, BigNatModule_pow64(op_Multiply(x, x), ~(~(n / 2))));\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_pow32(x_mut, n_mut) {\r\n BigNatModule_pow32:\r\n while (true) {\r\n const x = x_mut, n = n_mut;\r\n if (n === 0) {\r\n return 1;\r\n }\r\n else if ((n % 2) === 0) {\r\n x_mut = (x * x);\r\n n_mut = (~(~(n / 2)));\r\n continue BigNatModule_pow32;\r\n }\r\n else {\r\n return (x * BigNatModule_pow32(x * x, ~(~(n / 2)))) | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_hash(n) {\r\n let res = 0;\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n res = ((n.digits[i] + (res << 3)) | 0);\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function BigNatModule_maxInt(a, b) {\r\n if (a < b) {\r\n return b | 0;\r\n }\r\n else {\r\n return a | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_minInt(a, b) {\r\n if (a < b) {\r\n return a | 0;\r\n }\r\n else {\r\n return b | 0;\r\n }\r\n}\r\n\r\nexport const BigNatModule_baseBits = 24;\r\n\r\nexport const BigNatModule_baseN = 16777216;\r\n\r\nexport const BigNatModule_baseMask = 16777215;\r\n\r\nexport const BigNatModule_baseNi64 = fromBits(16777216, 0, false);\r\n\r\nexport const BigNatModule_baseMaski64 = fromBits(16777215, 0, false);\r\n\r\nexport const BigNatModule_baseMaskU = fromBits(16777215, 0, true);\r\n\r\nexport const BigNatModule_baseMask32A = 16777215;\r\n\r\nexport const BigNatModule_baseMask32B = 255;\r\n\r\nexport const BigNatModule_baseShift32B = 24;\r\n\r\nexport const BigNatModule_baseMask64A = 16777215;\r\n\r\nexport const BigNatModule_baseMask64B = 16777215;\r\n\r\nexport const BigNatModule_baseMask64C = 65535;\r\n\r\nexport const BigNatModule_baseShift64B = 24;\r\n\r\nexport const BigNatModule_baseShift64C = 48;\r\n\r\nexport function BigNatModule_divbase(x) {\r\n return ~(~((x >>> 0) >>> BigNatModule_baseBits));\r\n}\r\n\r\nexport function BigNatModule_modbase(x) {\r\n return x & BigNatModule_baseMask;\r\n}\r\n\r\nexport function BigNatModule_createN(b) {\r\n return new BigNat(b, new Int32Array(b));\r\n}\r\n\r\nexport function BigNatModule_copyN(x) {\r\n return new BigNat(x.bound, copy(x.digits));\r\n}\r\n\r\nexport function BigNatModule_normN(n) {\r\n const findLeastBound = (na_mut, i_mut) => {\r\n findLeastBound:\r\n while (true) {\r\n const na = na_mut, i = i_mut;\r\n if ((i === -1) ? true : (na[i] !== 0)) {\r\n return (i + 1) | 0;\r\n }\r\n else {\r\n na_mut = na;\r\n i_mut = (i - 1);\r\n continue findLeastBound;\r\n }\r\n break;\r\n }\r\n };\r\n const bound = findLeastBound(n.digits, n.bound - 1) | 0;\r\n n.bound = (bound | 0);\r\n return n;\r\n}\r\n\r\nexport const BigNatModule_boundInt = 2;\r\n\r\nexport const BigNatModule_boundInt64 = 3;\r\n\r\nexport const BigNatModule_boundBase = 1;\r\n\r\nexport function BigNatModule_embed(x) {\r\n const x_1 = ((x < 0) ? 0 : x) | 0;\r\n if (x_1 < BigNatModule_baseN) {\r\n const r = BigNatModule_createN(1);\r\n r.digits[0] = (x_1 | 0);\r\n return BigNatModule_normN(r);\r\n }\r\n else {\r\n const r_1 = BigNatModule_createN(BigNatModule_boundInt);\r\n for (let i = 0; i <= (BigNatModule_boundInt - 1); i++) {\r\n r_1.digits[i] = (((~(~(x_1 / BigNatModule_pow32(BigNatModule_baseN, i)))) % BigNatModule_baseN) | 0);\r\n }\r\n return BigNatModule_normN(r_1);\r\n }\r\n}\r\n\r\nexport function BigNatModule_embed64(x) {\r\n const x_1 = (compare(x, fromBits(0, 0, false)) < 0) ? fromBits(0, 0, false) : x;\r\n const r = BigNatModule_createN(BigNatModule_boundInt64);\r\n for (let i = 0; i <= (BigNatModule_boundInt64 - 1); i++) {\r\n r.digits[i] = ((~(~toInt(op_Modulus(op_Division(x_1, BigNatModule_pow64(BigNatModule_baseNi64, i)), BigNatModule_baseNi64)))) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_eval32(n) {\r\n if (n.bound === 1) {\r\n return n.digits[0] | 0;\r\n }\r\n else {\r\n let acc = 0;\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = ((n.digits[i] + (BigNatModule_baseN * acc)) | 0);\r\n }\r\n return acc | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_eval64(n) {\r\n if (n.bound === 1) {\r\n return fromInteger(n.digits[0], false, 2);\r\n }\r\n else {\r\n let acc = fromBits(0, 0, false);\r\n for (let i = n.bound - 1; i >= 0; i--) {\r\n acc = op_Addition(fromInteger(n.digits[i], false, 2), op_Multiply(BigNatModule_baseNi64, acc));\r\n }\r\n return acc;\r\n }\r\n}\r\n\r\nexport const BigNatModule_one = BigNatModule_embed(1);\r\n\r\nexport const BigNatModule_zero = BigNatModule_embed(0);\r\n\r\nexport function BigNatModule_restrictTo(d, n) {\r\n return new BigNat(BigNatModule_minInt(d, n.bound), n.digits);\r\n}\r\n\r\nexport function BigNatModule_shiftUp(d, n) {\r\n const m = BigNatModule_createN(n.bound + d);\r\n for (let i = 0; i <= (n.bound - 1); i++) {\r\n m.digits[i + d] = (n.digits[i] | 0);\r\n }\r\n return m;\r\n}\r\n\r\nexport function BigNatModule_shiftDown(d, n) {\r\n if ((n.bound - d) <= 0) {\r\n return BigNatModule_zero;\r\n }\r\n else {\r\n const m = BigNatModule_createN(n.bound - d);\r\n for (let i = 0; i <= (m.bound - 1); i++) {\r\n m.digits[i] = (n.digits[i + d] | 0);\r\n }\r\n return m;\r\n }\r\n}\r\n\r\nexport function BigNatModule_degree(n) {\r\n return n.bound - 1;\r\n}\r\n\r\nexport function BigNatModule_addP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_addP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) + ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_addP;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_add(p, q) {\r\n const rbound = (1 + BigNatModule_maxInt(p.bound, q.bound)) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n BigNatModule_addP(0, rbound, 0, p, q, r);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_subP(i_mut, n_mut, c_mut, p_mut, q_mut, r_mut) {\r\n let z, i_1, z_1, i_2;\r\n BigNatModule_subP:\r\n while (true) {\r\n const i = i_mut, n = n_mut, c = c_mut, p = p_mut, q = q_mut, r = r_mut;\r\n if (i < n) {\r\n const x = ((((z = p, (i_1 = (i | 0), (i_1 < z.bound) ? z.digits[i_1] : 0))) - ((z_1 = q, (i_2 = (i | 0), (i_2 < z_1.bound) ? z_1.digits[i_2] : 0)))) + c) | 0;\r\n if (x > 0) {\r\n r.digits[i] = (BigNatModule_modbase(x) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = BigNatModule_divbase(x);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n else {\r\n const x_1 = (x + BigNatModule_baseN) | 0;\r\n r.digits[i] = (BigNatModule_modbase(x_1) | 0);\r\n i_mut = (i + 1);\r\n n_mut = n;\r\n c_mut = (BigNatModule_divbase(x_1) - 1);\r\n p_mut = p;\r\n q_mut = q;\r\n r_mut = r;\r\n continue BigNatModule_subP;\r\n }\r\n }\r\n else {\r\n return c !== 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_sub(p, q) {\r\n const rbound = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n if (BigNatModule_subP(0, rbound, 0, p, q, r)) {\r\n return BigNatModule_embed(0);\r\n }\r\n else {\r\n return BigNatModule_normN(r);\r\n }\r\n}\r\n\r\nexport function BigNatModule_isZero(p) {\r\n return p.bound === 0;\r\n}\r\n\r\nexport function BigNatModule_IsZero(p) {\r\n return BigNatModule_isZero(p);\r\n}\r\n\r\nexport function BigNatModule_isOne(p) {\r\n if (p.bound === 1) {\r\n return p.digits[0] === 1;\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_equal(p, q) {\r\n if (p.bound === q.bound) {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return true;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigNatModule_shiftCompare(p, pn, q, qn) {\r\n if ((p.bound + pn) < (q.bound + qn)) {\r\n return -1;\r\n }\r\n else if ((p.bound + pn) > (q.bound + pn)) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else {\r\n const pai = ((i < pn) ? 0 : pa[i - pn]) | 0;\r\n const qai = ((i < qn) ? 0 : qa[i - qn]) | 0;\r\n if (pai === qai) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pai < qai) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, (p.bound + pn) - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_compare(p, q) {\r\n if (p.bound < q.bound) {\r\n return -1;\r\n }\r\n else if (p.bound > q.bound) {\r\n return 1;\r\n }\r\n else {\r\n const check = (pa_mut, qa_mut, i_mut) => {\r\n check:\r\n while (true) {\r\n const pa = pa_mut, qa = qa_mut, i = i_mut;\r\n if (i === -1) {\r\n return 0;\r\n }\r\n else if (pa[i] === qa[i]) {\r\n pa_mut = pa;\r\n qa_mut = qa;\r\n i_mut = (i - 1);\r\n continue check;\r\n }\r\n else if (pa[i] < qa[i]) {\r\n return -1;\r\n }\r\n else {\r\n return 1;\r\n }\r\n break;\r\n }\r\n };\r\n return check(p.digits, q.digits, p.bound - 1) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_lt(p, q) {\r\n return BigNatModule_compare(p, q) === -1;\r\n}\r\n\r\nexport function BigNatModule_gt(p, q) {\r\n return BigNatModule_compare(p, q) === 1;\r\n}\r\n\r\nexport function BigNatModule_lte(p, q) {\r\n return BigNatModule_compare(p, q) !== 1;\r\n}\r\n\r\nexport function BigNatModule_gte(p, q) {\r\n return BigNatModule_compare(p, q) !== -1;\r\n}\r\n\r\nexport function BigNatModule_min(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return a;\r\n }\r\n else {\r\n return b;\r\n }\r\n}\r\n\r\nexport function BigNatModule_max(a, b) {\r\n if (BigNatModule_lt(a, b)) {\r\n return b;\r\n }\r\n else {\r\n return a;\r\n }\r\n}\r\n\r\nexport function BigNatModule_contributeArr(a_mut, i_mut, c_mut) {\r\n BigNatModule_contributeArr:\r\n while (true) {\r\n const a = a_mut, i = i_mut, c = c_mut;\r\n const x = op_Addition(fromInteger(a[i], false, 2), c);\r\n const c_1 = op_Division(x, BigNatModule_baseNi64);\r\n const x_3 = (~(~toInt(op_BitwiseAnd(x, BigNatModule_baseMaski64)))) | 0;\r\n a[i] = (x_3 | 0);\r\n if (compare(c_1, fromBits(0, 0, false)) > 0) {\r\n a_mut = a;\r\n i_mut = (i + 1);\r\n c_mut = c_1;\r\n continue BigNatModule_contributeArr;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_scale(k, p) {\r\n const r = BigNatModule_createN(p.bound + BigNatModule_boundInt);\r\n const k_1 = fromInteger(k, false, 2);\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n BigNatModule_contributeArr(r.digits, i, op_Multiply(k_1, fromInteger(p.digits[i], false, 2)));\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookBothSmall(p, q) {\r\n const r = BigNatModule_createN(2);\r\n const rak = op_Multiply(fromInteger(p, false, 2), fromInteger(q, false, 2));\r\n BigNatModule_setCoeff(r, 0, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n BigNatModule_setCoeff(r, 1, ~(~toInt(op_Division(rak, BigNatModule_baseNi64))));\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookCarry(r_mut, c_mut, k_mut) {\r\n BigNatModule_mulSchoolBookCarry:\r\n while (true) {\r\n const r = r_mut, c = c_mut, k = k_mut;\r\n if (compare(c, fromBits(0, 0, false)) > 0) {\r\n const rak = op_Addition(BigNatModule_coeff64(r, k), c);\r\n BigNatModule_setCoeff(r, k, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n r_mut = r;\r\n c_mut = op_Division(rak, BigNatModule_baseNi64);\r\n k_mut = (k + 1);\r\n continue BigNatModule_mulSchoolBookCarry;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookOneSmall(p, q) {\r\n const bp = BigNatModule_bound(p) | 0;\r\n const r = BigNatModule_createN(bp + 1);\r\n const q_1 = fromInteger(q, false, 2);\r\n let c = fromBits(0, 0, false);\r\n for (let i = 0; i <= (bp - 1); i++) {\r\n const rak = op_Addition(op_Addition(c, BigNatModule_coeff64(r, i)), op_Multiply(BigNatModule_coeff64(p, i), q_1));\r\n BigNatModule_setCoeff(r, i, ~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64))));\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, bp);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBookNeitherSmall(p, q) {\r\n const r = BigNatModule_createN(p.bound + q.bound);\r\n const ra = r.digits;\r\n for (let i = 0; i <= (p.bound - 1); i++) {\r\n const pai = fromInteger(p.digits[i], false, 2);\r\n let c = fromBits(0, 0, false);\r\n let k = i;\r\n for (let j = 0; j <= (q.bound - 1); j++) {\r\n const qaj = fromInteger(q.digits[j], false, 2);\r\n const rak = op_Addition(op_Addition(fromInteger(ra[k], false, 2), c), op_Multiply(pai, qaj));\r\n ra[k] = ((~(~toInt(op_BitwiseAnd(rak, BigNatModule_baseMaski64)))) | 0);\r\n c = op_Division(rak, BigNatModule_baseNi64);\r\n k = ((k + 1) | 0);\r\n }\r\n BigNatModule_mulSchoolBookCarry(r, c, k);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_mulSchoolBook(p, q) {\r\n const pSmall = BigNatModule_bound(p) === 1;\r\n const qSmall = BigNatModule_bound(q) === 1;\r\n if (pSmall && qSmall) {\r\n return BigNatModule_mulSchoolBookBothSmall(BigNatModule_coeff(p, 0), BigNatModule_coeff(q, 0));\r\n }\r\n else if (pSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(q, BigNatModule_coeff(p, 0));\r\n }\r\n else if (qSmall) {\r\n return BigNatModule_mulSchoolBookOneSmall(p, BigNatModule_coeff(q, 0));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBookNeitherSmall(p, q);\r\n }\r\n}\r\n\r\nexport class BigNatModule_encoding extends Record {\r\n constructor(bigL, twoToBigL, k, bigK, bigN, split, splits) {\r\n super();\r\n this.bigL = (bigL | 0);\r\n this.twoToBigL = (twoToBigL | 0);\r\n this.k = (k | 0);\r\n this.bigK = (bigK | 0);\r\n this.bigN = (bigN | 0);\r\n this.split = (split | 0);\r\n this.splits = splits;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encoding$reflection() {\r\n return record_type(\"BigInt.BigNatModule.encoding\", [], BigNatModule_encoding, () => [[\"bigL\", int32_type], [\"twoToBigL\", int32_type], [\"k\", int32_type], [\"bigK\", int32_type], [\"bigN\", int32_type], [\"split\", int32_type], [\"splits\", array_type(int32_type)]]);\r\n}\r\n\r\nexport function BigNatModule_mkEncoding(bigL, k, bigK, bigN) {\r\n return new BigNatModule_encoding(bigL, BigNatModule_pow32(2, bigL), k, bigK, bigN, ~(~(BigNatModule_baseBits / bigL)), initialize(~(~(BigNatModule_baseBits / bigL)), (i) => BigNatModule_pow32(2, bigL * i), Int32Array));\r\n}\r\n\r\nexport const BigNatModule_table = [BigNatModule_mkEncoding(1, 28, 268435456, 268435456), BigNatModule_mkEncoding(2, 26, 67108864, 134217728), BigNatModule_mkEncoding(3, 24, 16777216, 50331648), BigNatModule_mkEncoding(4, 22, 4194304, 16777216), BigNatModule_mkEncoding(5, 20, 1048576, 5242880), BigNatModule_mkEncoding(6, 18, 262144, 1572864), BigNatModule_mkEncoding(7, 16, 65536, 458752), BigNatModule_mkEncoding(8, 14, 16384, 131072), BigNatModule_mkEncoding(9, 12, 4096, 36864), BigNatModule_mkEncoding(10, 10, 1024, 10240), BigNatModule_mkEncoding(11, 8, 256, 2816), BigNatModule_mkEncoding(12, 6, 64, 768), BigNatModule_mkEncoding(13, 4, 16, 208)];\r\n\r\nexport function BigNatModule_calculateTableTow(bigL) {\r\n const k = (BigNatModule_FFT_maxBitsInsideFp - (2 * bigL)) | 0;\r\n const bigK = BigNatModule_pow64(fromBits(2, 0, false), k);\r\n return [bigL, k, bigK, op_Multiply(bigK, fromInteger(bigL, false, 2))];\r\n}\r\n\r\nexport function BigNatModule_encodingGivenResultBits(bitsRes) {\r\n const selectFrom = (i_mut) => {\r\n selectFrom:\r\n while (true) {\r\n const i = i_mut;\r\n if (((i + 1) < BigNatModule_table.length) && (bitsRes < BigNatModule_table[i + 1].bigN)) {\r\n i_mut = (i + 1);\r\n continue selectFrom;\r\n }\r\n else {\r\n return BigNatModule_table[i];\r\n }\r\n break;\r\n }\r\n };\r\n if (bitsRes >= BigNatModule_table[0].bigN) {\r\n throw (new Error(\"Product is huge, around 268435456 bits, beyond quickmul\"));\r\n }\r\n else {\r\n return selectFrom(0);\r\n }\r\n}\r\n\r\nexport const BigNatModule_bitmask = initialize(BigNatModule_baseBits, (i) => (BigNatModule_pow32(2, i) - 1), Int32Array);\r\n\r\nexport const BigNatModule_twopowers = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow32(2, i), Int32Array);\r\n\r\nexport const BigNatModule_twopowersI64 = initialize(BigNatModule_baseBits, (i) => BigNatModule_pow64(fromBits(2, 0, false), i));\r\n\r\nexport function BigNatModule_wordBits(word) {\r\n const hi = (k_mut) => {\r\n hi:\r\n while (true) {\r\n const k = k_mut;\r\n if (k === 0) {\r\n return 0;\r\n }\r\n else if ((word & BigNatModule_twopowers[k - 1]) !== 0) {\r\n return k | 0;\r\n }\r\n else {\r\n k_mut = (k - 1);\r\n continue hi;\r\n }\r\n break;\r\n }\r\n };\r\n return hi(BigNatModule_baseBits) | 0;\r\n}\r\n\r\nexport function BigNatModule_bits(u) {\r\n if (u.bound === 0) {\r\n return 0;\r\n }\r\n else {\r\n return ((BigNatModule_degree(u) * BigNatModule_baseBits) + BigNatModule_wordBits(u.digits[BigNatModule_degree(u)])) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_extractBits(n, enc, bi) {\r\n let z, i, z_1, i_1, z_2, i_2;\r\n const biw = (~(~(bi / BigNatModule_baseBits))) | 0;\r\n const bjw = (~(~(((bi + enc.bigL) - 1) / BigNatModule_baseBits))) | 0;\r\n if (biw !== bjw) {\r\n const xbit = (bi % BigNatModule_baseBits) | 0;\r\n return (((((z = n, (i = (biw | 0), (i < z.bound) ? z.digits[i] : 0))) >> xbit) | (((z_1 = n, (i_1 = (bjw | 0), (i_1 < z_1.bound) ? z_1.digits[i_1] : 0))) << (BigNatModule_baseBits - xbit))) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n else {\r\n return ((((z_2 = n, (i_2 = (biw | 0), (i_2 < z_2.bound) ? z_2.digits[i_2] : 0))) >> (bi % BigNatModule_baseBits)) & BigNatModule_bitmask[enc.bigL]) | 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_encodePoly(enc, n) {\r\n const poly = fill(new Uint32Array(enc.bigK), 0, enc.bigK, BigNatModule_FFT_Fp_ofInt32(0));\r\n const biMax = (n.bound * BigNatModule_baseBits) | 0;\r\n const encoder = (i_mut, bi_mut) => {\r\n encoder:\r\n while (true) {\r\n const i = i_mut, bi = bi_mut;\r\n if ((i === enc.bigK) ? true : (bi > biMax)) {\r\n }\r\n else {\r\n const pi = BigNatModule_extractBits(n, enc, bi) | 0;\r\n poly[i] = BigNatModule_FFT_Fp_ofInt32(pi);\r\n i_mut = (i + 1);\r\n bi_mut = (bi + enc.bigL);\r\n continue encoder;\r\n }\r\n break;\r\n }\r\n };\r\n encoder(0, 0);\r\n return poly;\r\n}\r\n\r\nexport function BigNatModule_decodeResultBits(enc, poly) {\r\n let n = 0;\r\n for (let i = 0; i <= (poly.length - 1); i++) {\r\n if (poly[i] !== BigNatModule_FFT_mzero) {\r\n n = (i | 0);\r\n }\r\n }\r\n return (((BigNatModule_FFT_maxBitsInsideFp + (enc.bigL * n)) + 1) + 1) | 0;\r\n}\r\n\r\nexport function BigNatModule_decodePoly(enc, poly) {\r\n const rbound = ((~(~(BigNatModule_decodeResultBits(enc, poly) / BigNatModule_baseBits))) + 1) | 0;\r\n const r = BigNatModule_createN(rbound);\r\n const evaluate = (i_mut, j_mut, d_mut) => {\r\n evaluate:\r\n while (true) {\r\n const i = i_mut, j = j_mut, d = d_mut;\r\n if (i === enc.bigK) {\r\n }\r\n else {\r\n if (j >= rbound) {\r\n }\r\n else {\r\n BigNatModule_contributeArr(r.digits, j, op_Multiply(fromInteger(BigNatModule_FFT_Fp_toInt(poly[i]), false, 2), BigNatModule_twopowersI64[d]));\r\n }\r\n const d_1 = (d + enc.bigL) | 0;\r\n const patternInput = (d_1 >= BigNatModule_baseBits) ? [j + 1, d_1 - BigNatModule_baseBits] : [j, d_1];\r\n i_mut = (i + 1);\r\n j_mut = patternInput[0];\r\n d_mut = patternInput[1];\r\n continue evaluate;\r\n }\r\n break;\r\n }\r\n };\r\n evaluate(0, 0, 0);\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_quickMulUsingFft(u, v) {\r\n const enc = BigNatModule_encodingGivenResultBits(BigNatModule_bits(u) + BigNatModule_bits(v));\r\n return BigNatModule_normN(BigNatModule_decodePoly(enc, BigNatModule_FFT_computeFftPaddedPolynomialProduct(enc.bigK, enc.k, BigNatModule_encodePoly(enc, u), BigNatModule_encodePoly(enc, v))));\r\n}\r\n\r\nexport const BigNatModule_minDigitsKaratsuba = 16;\r\n\r\nexport function BigNatModule_recMulKaratsuba(mul, p, q) {\r\n const bmax = BigNatModule_maxInt(p.bound, q.bound) | 0;\r\n if (bmax > BigNatModule_minDigitsKaratsuba) {\r\n const k = (~(~(bmax / 2))) | 0;\r\n const a0 = BigNatModule_restrictTo(k, p);\r\n const a1 = BigNatModule_shiftDown(k, p);\r\n const b0 = BigNatModule_restrictTo(k, q);\r\n const b1 = BigNatModule_shiftDown(k, q);\r\n const q0 = mul(a0, b0);\r\n const q1 = mul(BigNatModule_add(a0, a1), BigNatModule_add(b0, b1));\r\n const q2 = mul(a1, b1);\r\n return BigNatModule_add(q0, BigNatModule_shiftUp(k, BigNatModule_add(BigNatModule_sub(q1, BigNatModule_add(q0, q2)), BigNatModule_shiftUp(k, q2))));\r\n }\r\n else {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n }\r\n}\r\n\r\nexport function BigNatModule_mulKaratsuba(x, y) {\r\n return BigNatModule_recMulKaratsuba(BigNatModule_mulKaratsuba, x, y);\r\n}\r\n\r\nexport const BigNatModule_productDigitsUpperSchoolBook = ~(~(64000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_singleDigitForceSchoolBook = ~(~(32000 / BigNatModule_baseBits));\r\n\r\nexport const BigNatModule_productDigitsUpperFft = ~(~(BigNatModule_table[0].bigN / BigNatModule_baseBits));\r\n\r\nexport function BigNatModule_mul(p, q) {\r\n return BigNatModule_mulSchoolBook(p, q);\r\n}\r\n\r\nexport function BigNatModule_scaleSubInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo <= x_1[j + n]) {\r\n x_1[j + n] = ((x_1[j + n] - zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((x_1[j + n] + (BigNatModule_baseN - zLo)) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleSub(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleSubInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_scaleAddInPlace(x, f, a, n) {\r\n const patternInput = [x.digits, BigNatModule_degree(x)];\r\n const x_1 = patternInput[0];\r\n const patternInput_1 = [a.digits, BigNatModule_degree(a)];\r\n const ad = patternInput_1[1] | 0;\r\n const a_1 = patternInput_1[0];\r\n const f_1 = fromInteger(f, false, 2);\r\n let j = 0;\r\n let z = op_Multiply(f_1, fromInteger(a_1[0], false, 2));\r\n while ((compare(z, fromBits(0, 0, false)) > 0) ? true : (j < ad)) {\r\n if (j > patternInput[1]) {\r\n throw (new Error(\"scaleSubInPlace: pre-condition did not apply, result would be -ve\"));\r\n }\r\n let zLo = ~(~toInt(op_BitwiseAnd(z, BigNatModule_baseMaski64)));\r\n let zHi = op_Division(z, BigNatModule_baseNi64);\r\n if (zLo < (BigNatModule_baseN - x_1[j + n])) {\r\n x_1[j + n] = ((x_1[j + n] + zLo) | 0);\r\n }\r\n else {\r\n x_1[j + n] = ((zLo - (BigNatModule_baseN - x_1[j + n])) | 0);\r\n zHi = op_Addition(zHi, fromBits(1, 0, false));\r\n }\r\n if (j < ad) {\r\n z = op_Addition(zHi, op_Multiply(f_1, fromInteger(a_1[j + 1], false, 2)));\r\n }\r\n else {\r\n z = zHi;\r\n }\r\n j = ((j + 1) | 0);\r\n }\r\n BigNatModule_normN(x);\r\n}\r\n\r\nexport function BigNatModule_scaleAdd(x, f, a, n) {\r\n const freshx = BigNatModule_add(x, BigNatModule_zero);\r\n BigNatModule_scaleAddInPlace(freshx, f, a, n);\r\n return BigNatModule_normN(freshx);\r\n}\r\n\r\nexport function BigNatModule_removeFactor(x, a, n) {\r\n const patternInput = [BigNatModule_degree(a), BigNatModule_degree(x)];\r\n const degx = patternInput[1] | 0;\r\n const dega = patternInput[0] | 0;\r\n if (degx < (dega + n)) {\r\n return 0;\r\n }\r\n else {\r\n const patternInput_1 = [a.digits, x.digits];\r\n const xa = patternInput_1[1];\r\n const aa = patternInput_1[0];\r\n const f = ((dega === 0) ? ((degx === n) ? (~(~(xa[n] / aa[0]))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), fromInteger(aa[0], false, 2)))))) : ((degx === (dega + n)) ? (~(~(xa[degx] / (aa[dega] + 1)))) : (~(~toInt(op_Division(op_Addition(op_Multiply(fromInteger(xa[degx], false, 2), BigNatModule_baseNi64), fromInteger(xa[degx - 1], false, 2)), op_Addition(fromInteger(aa[dega], false, 2), fromBits(1, 0, false)))))))) | 0;\r\n if (f === 0) {\r\n if (BigNatModule_shiftCompare(a, n, x, 0) !== 1) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n else {\r\n return f | 0;\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_divmod(b, a) {\r\n if (BigNatModule_isZero(a)) {\r\n throw (new Error());\r\n }\r\n else if (BigNatModule_degree(b) < BigNatModule_degree(a)) {\r\n return [BigNatModule_zero, b];\r\n }\r\n else {\r\n const x = BigNatModule_copyN(b);\r\n const d = BigNatModule_createN(((BigNatModule_degree(b) - BigNatModule_degree(a)) + 1) + 1);\r\n let p = BigNatModule_degree(b);\r\n const m = BigNatModule_degree(a) | 0;\r\n let n = p - m;\r\n const Invariant = (tupledArg) => {\r\n };\r\n let finished = false;\r\n while (!finished) {\r\n Invariant([d, x, n, p]);\r\n const f = BigNatModule_removeFactor(x, a, n) | 0;\r\n if (f > 0) {\r\n BigNatModule_scaleSubInPlace(x, f, a, n);\r\n BigNatModule_scaleAddInPlace(d, f, BigNatModule_one, n);\r\n Invariant([d, x, n, p]);\r\n }\r\n else {\r\n finished = ((f === 0) && (n === 0));\r\n if (!finished) {\r\n if (p === (m + n)) {\r\n Invariant([d, x, n - 1, p]);\r\n n = ((n - 1) | 0);\r\n }\r\n else {\r\n Invariant([d, x, n - 1, p - 1]);\r\n n = ((n - 1) | 0);\r\n p = ((p - 1) | 0);\r\n }\r\n }\r\n }\r\n }\r\n return [BigNatModule_normN(d), BigNatModule_normN(x)];\r\n }\r\n}\r\n\r\nexport function BigNatModule_div(b, a) {\r\n return BigNatModule_divmod(b, a)[0];\r\n}\r\n\r\nexport function BigNatModule_rem(b, a) {\r\n return BigNatModule_divmod(b, a)[1];\r\n}\r\n\r\nexport function BigNatModule_bitAnd(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_minInt(a.bound, b.bound));\r\n for (let i = 0; i <= (r.bound - 1); i++) {\r\n r.digits[i] = ((a.digits[i] & b.digits[i]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitOr(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] | a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] | b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_bitXor(a, b) {\r\n const r = BigNatModule_createN(BigNatModule_maxInt(a.bound, b.bound));\r\n for (let i = 0; i <= (a.bound - 1); i++) {\r\n r.digits[i] = ((r.digits[i] ^ a.digits[i]) | 0);\r\n }\r\n for (let i_1 = 0; i_1 <= (b.bound - 1); i_1++) {\r\n r.digits[i_1] = ((r.digits[i_1] ^ b.digits[i_1]) | 0);\r\n }\r\n return BigNatModule_normN(r);\r\n}\r\n\r\nexport function BigNatModule_hcf(a, b) {\r\n const hcfloop = (a_1_mut, b_1_mut) => {\r\n hcfloop:\r\n while (true) {\r\n const a_1 = a_1_mut, b_1 = b_1_mut;\r\n if (BigNatModule_equal(BigNatModule_zero, a_1)) {\r\n return b_1;\r\n }\r\n else {\r\n a_1_mut = BigNatModule_divmod(b_1, a_1)[1];\r\n b_1_mut = a_1;\r\n continue hcfloop;\r\n }\r\n break;\r\n }\r\n };\r\n if (BigNatModule_lt(a, b)) {\r\n return hcfloop(a, b);\r\n }\r\n else {\r\n return hcfloop(b, a);\r\n }\r\n}\r\n\r\nexport const BigNatModule_two = BigNatModule_embed(2);\r\n\r\nexport function BigNatModule_powi(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (n_1 === 0) {\r\n return acc;\r\n }\r\n else if ((n_1 % 2) === 0) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = (~(~(n_1 / 2)));\r\n continue power;\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_pow(x, n) {\r\n const power = (acc_mut, x_1_mut, n_1_mut) => {\r\n power:\r\n while (true) {\r\n const acc = acc_mut, x_1 = x_1_mut, n_1 = n_1_mut;\r\n if (BigNatModule_isZero(n_1)) {\r\n return acc;\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(n_1, BigNatModule_two);\r\n const ndiv2 = patternInput[0];\r\n if (BigNatModule_isZero(patternInput[1])) {\r\n acc_mut = acc;\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n else {\r\n acc_mut = BigNatModule_mul(x_1, acc);\r\n x_1_mut = BigNatModule_mul(x_1, x_1);\r\n n_1_mut = ndiv2;\r\n continue power;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return power(BigNatModule_one, x, n);\r\n}\r\n\r\nexport function BigNatModule_toFloat(n) {\r\n const evalFloat = (acc_mut, k_mut, i_mut) => {\r\n evalFloat:\r\n while (true) {\r\n const acc = acc_mut, k = k_mut, i = i_mut;\r\n if (i === n.bound) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = (acc + (k * n.digits[i]));\r\n k_mut = (k * BigNatModule_baseN);\r\n i_mut = (i + 1);\r\n continue evalFloat;\r\n }\r\n break;\r\n }\r\n };\r\n return evalFloat(0, 1, 0);\r\n}\r\n\r\nexport function BigNatModule_ofInt32(n) {\r\n return BigNatModule_embed(n);\r\n}\r\n\r\nexport function BigNatModule_ofInt64(n) {\r\n return BigNatModule_embed64(n);\r\n}\r\n\r\nexport function BigNatModule_toUInt32(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n const value = n.digits[0] | 0;\r\n return value >>> 0;\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n const xB = patternInput[1] | 0;\r\n if (xB > BigNatModule_baseMask32B) {\r\n throw (new Error());\r\n }\r\n return ((patternInput[0] & BigNatModule_baseMask32A) >>> 0) + ((((xB & BigNatModule_baseMask32B) >>> 0) << BigNatModule_baseShift32B) >>> 0);\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toUInt64(n) {\r\n const matchValue = n.bound | 0;\r\n switch (matchValue) {\r\n case 0: {\r\n return fromBits(0, 0, true);\r\n }\r\n case 1: {\r\n return fromInteger(n.digits[0], true, 2);\r\n }\r\n case 2: {\r\n const patternInput = [n.digits[0], n.digits[1]];\r\n return op_Addition(fromInteger(patternInput[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B));\r\n }\r\n case 3: {\r\n const patternInput_1 = [n.digits[0], n.digits[1], n.digits[2]];\r\n const xC = patternInput_1[2] | 0;\r\n if (xC > BigNatModule_baseMask64C) {\r\n throw (new Error());\r\n }\r\n return op_Addition(op_Addition(fromInteger(patternInput_1[0] & BigNatModule_baseMask64A, true, 2), op_LeftShift(fromInteger(patternInput_1[1] & BigNatModule_baseMask64B, true, 2), BigNatModule_baseShift64B)), op_LeftShift(fromInteger(xC & BigNatModule_baseMask64C, true, 2), BigNatModule_baseShift64C));\r\n }\r\n default: {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigNatModule_toString(n) {\r\n const degn = BigNatModule_degree(n) | 0;\r\n const route = (prior_mut, k_mut, ten2k_mut) => {\r\n route:\r\n while (true) {\r\n const prior = prior_mut, k = k_mut, ten2k = ten2k_mut;\r\n if (BigNatModule_degree(ten2k) > degn) {\r\n return cons([k, ten2k], prior);\r\n }\r\n else {\r\n prior_mut = cons([k, ten2k], prior);\r\n k_mut = (k + 1);\r\n ten2k_mut = BigNatModule_mul(ten2k, ten2k);\r\n continue route;\r\n }\r\n break;\r\n }\r\n };\r\n const collect = (isLeading_mut, digits_mut, n_1_mut, _arg1_mut) => {\r\n collect:\r\n while (true) {\r\n const isLeading = isLeading_mut, digits = digits_mut, n_1 = n_1_mut, _arg1 = _arg1_mut;\r\n if (!isEmpty(_arg1)) {\r\n const prior_1 = tail(_arg1);\r\n const patternInput = BigNatModule_divmod(n_1, head(_arg1)[1]);\r\n const nL = patternInput[1];\r\n const nH = patternInput[0];\r\n if (isLeading && BigNatModule_isZero(nH)) {\r\n isLeading_mut = isLeading;\r\n digits_mut = digits;\r\n n_1_mut = nL;\r\n _arg1_mut = prior_1;\r\n continue collect;\r\n }\r\n else {\r\n isLeading_mut = isLeading;\r\n digits_mut = collect(false, digits, nL, prior_1);\r\n n_1_mut = nH;\r\n _arg1_mut = prior_1;\r\n continue collect;\r\n }\r\n }\r\n else {\r\n const n_2 = BigNatModule_eval32(n_1) | 0;\r\n if (isLeading && (n_2 === 0)) {\r\n return digits;\r\n }\r\n else {\r\n return cons(int32ToString(n_2), digits);\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n const digits_4 = collect(true, empty(), n, route(empty(), 0, BigNatModule_embed(10)));\r\n if (isEmpty(digits_4)) {\r\n return \"0\";\r\n }\r\n else {\r\n return join(\"\", toArray(digits_4));\r\n }\r\n}\r\n\r\nexport function BigNatModule_ofString(str) {\r\n const len = str.length | 0;\r\n if (isNullOrEmpty(str)) {\r\n throw (new Error(\"empty string\\\\nParameter name: str\"));\r\n }\r\n const ten = BigNatModule_embed(10);\r\n const build = (acc_mut, i_mut) => {\r\n build:\r\n while (true) {\r\n const acc = acc_mut, i = i_mut;\r\n if (i === len) {\r\n return acc;\r\n }\r\n else {\r\n const c = str[i];\r\n const d = (c.charCodeAt(0) - 48) | 0;\r\n if ((0 <= d) && (d <= 9)) {\r\n acc_mut = BigNatModule_add(BigNatModule_mul(ten, acc), BigNatModule_embed(d));\r\n i_mut = (i + 1);\r\n continue build;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return build(BigNatModule_embed(0), 0);\r\n}\r\n\r\nexport function BigNatModule_isSmall(n) {\r\n return n.bound <= 1;\r\n}\r\n\r\nexport function BigNatModule_getSmall(n) {\r\n const z = n;\r\n const i = 0;\r\n if (i < z.bound) {\r\n return z.digits[i] | 0;\r\n }\r\n else {\r\n return 0;\r\n }\r\n}\r\n\r\nexport function BigNatModule_factorial(n) {\r\n const productR = (a, b) => {\r\n if (BigNatModule_equal(a, b)) {\r\n return a;\r\n }\r\n else {\r\n const m = BigNatModule_div(BigNatModule_add(a, b), BigNatModule_ofInt32(2));\r\n return BigNatModule_mul(productR(a, m), productR(BigNatModule_add(m, BigNatModule_one), b));\r\n }\r\n };\r\n return productR(BigNatModule_one, n);\r\n}\r\n\r\n","import { BigNatModule_factorial, BigNatModule_ofString, BigNatModule_toFloat, BigNatModule_toUInt64, BigNatModule_toUInt32, BigNatModule_pow, BigNatModule_two, BigNatModule_rem, BigNatModule_lte, BigNatModule_hcf, BigNatModule_bitXor, BigNatModule_bitOr, BigNatModule_bitAnd, BigNatModule_divmod, BigNatModule_mul, BigNatModule_isOne, BigNatModule_sub, BigNatModule_gte, BigNatModule_scale, BigNatModule_one, BigNatModule_add, BigNatModule_ofInt64, BigNatModule_hash, BigNatModule_gt, BigNatModule_lt, BigNatModule_equal, BigNatModule_getSmall, BigNatModule_isSmall, BigNatModule_ofInt32, BigNatModule_toString, BigNatModule_isZero } from \"./n.js\";\r\nimport { Record, toString } from \"../Types.js\";\r\nimport { class_type } from \"../Reflection.js\";\r\nimport { initialize } from \"../Array.js\";\r\nimport { op_Addition, op_Multiply, fromValue, equals, fromBits, compare, fromInteger, op_UnaryNegation } from \"../Long.js\";\r\nimport { op_UnaryNegation_Int32 } from \"../Int32.js\";\r\nimport Decimal from \"../Decimal.js\";\r\n\r\nexport class BigInteger extends Record {\r\n constructor(signInt, v) {\r\n super();\r\n this.signInt = (signInt | 0);\r\n this.v = v;\r\n }\r\n toString() {\r\n const x = this;\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return BigNatModule_isZero(BigInteger__get_V(x)) ? \"0\" : (\"-\" + BigNatModule_toString(BigInteger__get_V(x)));\r\n }\r\n case 0: {\r\n return \"0\";\r\n }\r\n case 1: {\r\n return BigNatModule_toString(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\"));\r\n }\r\n }\r\n }\r\n Equals(obj) {\r\n const this$ = this;\r\n return (obj instanceof BigInteger) && BigInteger_op_Equality_56F059C0(this$, obj);\r\n }\r\n GetHashCode() {\r\n const x = this;\r\n return BigInteger_hash_Z665282C2(x) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return toString(this$);\r\n }\r\n CompareTo(obj) {\r\n const this$ = this;\r\n if (obj instanceof BigInteger) {\r\n return BigInteger_compare_56F059C0(this$, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"the objects are not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger$reflection() {\r\n return class_type(\"BigInt.BigInteger\", void 0, BigInteger, class_type(\"System.ValueType\"));\r\n}\r\n\r\nexport function BigInteger_$ctor_Z2BE94A1(signInt, v) {\r\n return new BigInteger(signInt, v);\r\n}\r\n\r\n(() => {\r\n BigInteger.smallLim = 4096;\r\n BigInteger.smallPosTab = initialize(BigInteger.smallLim, BigNatModule_ofInt32);\r\n BigInteger.one = BigInteger_$ctor_Z524259A4(1);\r\n BigInteger.two = BigInteger_$ctor_Z524259A4(2);\r\n BigInteger.zero = BigInteger_$ctor_Z524259A4(0);\r\n})();\r\n\r\nexport function BigInteger_nat_Z67CCE57D(n) {\r\n if (BigNatModule_isSmall(n) && (BigNatModule_getSmall(n) < BigInteger.smallLim)) {\r\n return BigInteger.smallPosTab[BigNatModule_getSmall(n)];\r\n }\r\n else {\r\n return n;\r\n }\r\n}\r\n\r\nexport function BigInteger_create_Z2BE94A1(s, n) {\r\n return BigInteger_$ctor_Z2BE94A1(s, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_posn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger_negn_Z67CCE57D(n) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(n));\r\n}\r\n\r\nexport function BigInteger__get_Sign(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return x.signInt | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_SignInt(x) {\r\n return x.signInt;\r\n}\r\n\r\nexport function BigInteger__get_V(x) {\r\n return x.v;\r\n}\r\n\r\nexport function BigInteger_op_Equality_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_equal(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Inequality_56F059C0(x, y) {\r\n return !BigInteger_op_Equality_56F059C0(x, y);\r\n}\r\n\r\nexport function BigInteger_op_LessThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return false;\r\n }\r\n case 3: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 6: {\r\n return false;\r\n }\r\n case 7: {\r\n return false;\r\n }\r\n case 8: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThan_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 5;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 7;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gt(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gt(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (!BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return true;\r\n }\r\n else {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n }\r\n case 3: {\r\n return false;\r\n }\r\n case 4: {\r\n return false;\r\n }\r\n case 5: {\r\n return false;\r\n }\r\n case 6: {\r\n return !BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 7: {\r\n return !BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 8: {\r\n return false;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_compare_56F059C0(n, nn) {\r\n if (BigInteger_op_LessThan_56F059C0(n, nn)) {\r\n return -1;\r\n }\r\n else if (BigInteger_op_Equality_56F059C0(n, nn)) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n}\r\n\r\nexport function BigInteger_hash_Z665282C2(z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return 1;\r\n }\r\n else {\r\n return (BigInteger__get_SignInt(z) + BigNatModule_hash(BigInteger__get_V(z))) | 0;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_StructuredDisplayString(x) {\r\n return toString(x);\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259A4(n) {\r\n if (n >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(n)));\r\n }\r\n else if (n === -2147483648) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(fromInteger(n, false, 2)))));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt32(op_UnaryNegation_Int32(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_$ctor_Z524259C1(n) {\r\n if (compare(n, fromBits(0, 0, false)) >= 0) {\r\n return BigInteger_$ctor_Z2BE94A1(1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(n)));\r\n }\r\n else if (equals(n, fromBits(0, 2147483648, false))) {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_add(BigNatModule_ofInt64(fromBits(4294967295, 2147483647, false)), BigNatModule_one)));\r\n }\r\n else {\r\n return BigInteger_$ctor_Z2BE94A1(-1, BigInteger_nat_Z67CCE57D(BigNatModule_ofInt64(op_UnaryNegation(n))));\r\n }\r\n}\r\n\r\nexport function BigInteger_get_One() {\r\n return BigInteger.one;\r\n}\r\n\r\nexport function BigInteger_get_Two() {\r\n return BigInteger.two;\r\n}\r\n\r\nexport function BigInteger_get_Zero() {\r\n return BigInteger.zero;\r\n}\r\n\r\nexport function BigInteger_op_UnaryNegation_Z665282C2(z) {\r\n const matchValue = BigInteger__get_SignInt(z) | 0;\r\n if (matchValue === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(matchValue), BigInteger__get_V(z));\r\n }\r\n}\r\n\r\nexport function BigInteger_Scale_Z320F31E(k, z) {\r\n if (BigInteger__get_SignInt(z) === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else if (k < 0) {\r\n return BigInteger_create_Z2BE94A1(op_UnaryNegation_Int32(BigInteger__get_SignInt(z)), BigNatModule_scale(op_UnaryNegation_Int32(k), BigInteger__get_V(z)));\r\n }\r\n else {\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(z), BigNatModule_scale(k, BigInteger__get_V(z)));\r\n }\r\n}\r\n\r\nexport function BigInteger_subnn_6A57060(nx, ny) {\r\n if (BigNatModule_gte(nx, ny)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_sub(nx, ny));\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_sub(ny, nx));\r\n }\r\n}\r\n\r\nexport function BigInteger_addnn_6A57060(nx, ny) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_add(nx, ny));\r\n}\r\n\r\nexport function BigInteger__get_IsZero(x) {\r\n if (BigInteger__get_SignInt(x) === 0) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsOne(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return BigNatModule_isOne(BigInteger__get_V(x));\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Addition_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return y;\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 2: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Subtraction_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(x)) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(y);\r\n }\r\n else {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigInteger_subnn_6A57060(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 3: {\r\n return BigInteger_op_UnaryNegation_Z665282C2(BigInteger_addnn_6A57060(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Multiply_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return x;\r\n }\r\n else if (BigInteger__get_IsZero(y)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(x)) {\r\n return y;\r\n }\r\n else if (BigInteger__get_IsOne(y)) {\r\n return x;\r\n }\r\n else {\r\n const m = BigNatModule_mul(BigInteger__get_V(x), BigInteger__get_V(y));\r\n return BigInteger_create_Z2BE94A1(BigInteger__get_SignInt(x) * BigInteger__get_SignInt(y), m);\r\n }\r\n}\r\n\r\nexport function BigInteger_DivRem_56F059C0(x, y) {\r\n if (BigInteger__get_IsZero(y)) {\r\n throw (new Error());\r\n }\r\n if (BigInteger__get_IsZero(x)) {\r\n return [BigInteger_get_Zero(), BigInteger_get_Zero()];\r\n }\r\n else {\r\n const patternInput = BigNatModule_divmod(BigInteger__get_V(x), BigInteger__get_V(y));\r\n const r = patternInput[1];\r\n const d = patternInput[0];\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 4;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 1: {\r\n return [BigInteger_posn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 2: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_posn_Z67CCE57D(r)];\r\n }\r\n case 3: {\r\n return [BigInteger_negn_Z67CCE57D(d), BigInteger_negn_Z67CCE57D(r)];\r\n }\r\n case 4: {\r\n throw (new Error(\"signs should be +/- 1\\\\nParameter name: x\"));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_Division_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[0];\r\n}\r\n\r\nexport function BigInteger_op_Modulus_56F059C0(x, y) {\r\n return BigInteger_DivRem_56F059C0(x, y)[1];\r\n}\r\n\r\nexport function BigInteger_op_RightShift_62E082A2(x, y) {\r\n return BigInteger_op_Division_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_LeftShift_62E082A2(x, y) {\r\n return BigInteger_op_Multiply_56F059C0(x, BigInteger_Pow_62E082A2(BigInteger_get_Two(), y));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseAnd_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitAnd(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_BitwiseOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitOr(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_op_ExclusiveOr_56F059C0(x, y) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_bitXor(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n}\r\n\r\nexport function BigInteger_GreatestCommonDivisor_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n if (matchValue[0] === 0) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_Zero();\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(y));\r\n }\r\n }\r\n else if (matchValue[1] === 0) {\r\n return BigInteger_posn_Z67CCE57D(BigInteger__get_V(x));\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_hcf(BigInteger__get_V(x), BigInteger__get_V(y)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsNegative(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsPositive(x) {\r\n if (BigInteger__get_SignInt(x) === 1) {\r\n return !BigInteger__get_IsZero(x);\r\n }\r\n else {\r\n return false;\r\n }\r\n}\r\n\r\nexport function BigInteger_Abs_Z665282C2(x) {\r\n if (BigInteger__get_SignInt(x) === -1) {\r\n return BigInteger_op_UnaryNegation_Z665282C2(x);\r\n }\r\n else {\r\n return x;\r\n }\r\n}\r\n\r\nexport function BigInteger_op_LessThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_lte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_lte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 3: {\r\n return true;\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 6: {\r\n return true;\r\n }\r\n case 7: {\r\n return true;\r\n }\r\n case 8: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_op_GreaterThanOrEqual_56F059C0(x, y) {\r\n const matchValue = [BigInteger__get_SignInt(x), BigInteger__get_SignInt(y)];\r\n let pattern_matching_result;\r\n if (matchValue[0] === -1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 1;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 6;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 3;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 0) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 8;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 4;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 7;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else if (matchValue[0] === 1) {\r\n if (matchValue[1] === -1) {\r\n pattern_matching_result = 2;\r\n }\r\n else if (matchValue[1] === 0) {\r\n pattern_matching_result = 5;\r\n }\r\n else if (matchValue[1] === 1) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 9;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return BigNatModule_gte(BigInteger__get_V(x), BigInteger__get_V(y));\r\n }\r\n case 1: {\r\n return BigNatModule_gte(BigInteger__get_V(y), BigInteger__get_V(x));\r\n }\r\n case 2: {\r\n return true;\r\n }\r\n case 3: {\r\n if (BigNatModule_isZero(BigInteger__get_V(x))) {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n case 4: {\r\n return true;\r\n }\r\n case 5: {\r\n return true;\r\n }\r\n case 6: {\r\n return BigNatModule_isZero(BigInteger__get_V(x));\r\n }\r\n case 7: {\r\n return BigNatModule_isZero(BigInteger__get_V(y));\r\n }\r\n case 8: {\r\n return true;\r\n }\r\n case 9: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger_Pow_62E082A2(x, y) {\r\n if (y < 0) {\r\n throw (new Error(\"y\"));\r\n }\r\n const matchValue = [BigInteger__get_IsZero(x), y];\r\n if (matchValue[0]) {\r\n if (matchValue[1] === 0) {\r\n return BigInteger_get_One();\r\n }\r\n else {\r\n return BigInteger_get_Zero();\r\n }\r\n }\r\n else {\r\n const yval = BigInteger_$ctor_Z524259A4(y);\r\n return BigInteger_create_Z2BE94A1(BigNatModule_isZero(BigNatModule_rem(BigInteger__get_V(yval), BigNatModule_two)) ? 1 : BigInteger__get_SignInt(x), BigNatModule_pow(BigInteger__get_V(x), BigInteger__get_V(yval)));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n const u = BigNatModule_toUInt32(BigInteger__get_V(x));\r\n if (u <= (2147483647 >>> 0)) {\r\n return (BigInteger__get_SignInt(x) * (~(~u))) | 0;\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && (u === ((2147483647 + 1) >>> 0))) {\r\n return -2147483648;\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt32(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return 0;\r\n }\r\n else {\r\n return BigNatModule_toUInt32(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, false);\r\n }\r\n else {\r\n const u = BigNatModule_toUInt64(BigInteger__get_V(x));\r\n if (compare(u, fromValue(fromBits(4294967295, 2147483647, false), true)) <= 0) {\r\n return op_Multiply(fromInteger(BigInteger__get_SignInt(x), false, 2), fromValue(u, false));\r\n }\r\n else if ((BigInteger__get_SignInt(x) === -1) && equals(u, fromValue(op_Addition(fromBits(4294967295, 2147483647, false), fromBits(1, 0, false)), true))) {\r\n return fromBits(0, 2147483648, false);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToUInt64(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return fromBits(0, 0, true);\r\n }\r\n else {\r\n return BigNatModule_toUInt64(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToDouble(x) {\r\n const matchValue = BigInteger__get_SignInt(x) | 0;\r\n switch (matchValue) {\r\n case -1: {\r\n return -BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n case 0: {\r\n return 0;\r\n }\r\n case 1: {\r\n return BigNatModule_toFloat(BigInteger__get_V(x));\r\n }\r\n default: {\r\n throw (new Error(\"signs should be +/- 1 or 0\\\\nParameter name: x\"));\r\n }\r\n }\r\n}\r\n\r\nexport function BigInteger__get_ToSByte(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x80 & 0xFF) - 0x80;\r\n}\r\n\r\nexport function BigInteger__get_ToByte(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFF;\r\n}\r\n\r\nexport function BigInteger__get_ToInt16(x) {\r\n return (BigInteger__get_ToInt32(x) + 0x8000 & 0xFFFF) - 0x8000;\r\n}\r\n\r\nexport function BigInteger__get_ToUInt16(x) {\r\n return BigInteger__get_ToUInt32(x) & 0xFFFF;\r\n}\r\n\r\nexport function BigInteger__get_ToSingle(x) {\r\n return BigInteger__get_ToDouble(x);\r\n}\r\n\r\nexport function BigInteger__get_ToDecimal(x) {\r\n return new Decimal(BigInteger__get_ToDouble(x));\r\n}\r\n\r\nexport function BigInteger_Parse_Z721C83C5(text) {\r\n if (text == null) {\r\n throw (new Error(\"text\"));\r\n }\r\n const text_1 = text.trim();\r\n const len = text_1.length | 0;\r\n if (len === 0) {\r\n throw (new Error());\r\n }\r\n const matchValue = [text_1[0], len];\r\n if (matchValue[0] === \"+\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else if (matchValue[0] === \"-\") {\r\n if (matchValue[1] === 1) {\r\n throw (new Error());\r\n }\r\n else {\r\n return BigInteger_negn_Z67CCE57D(BigNatModule_ofString(text_1.slice(1, (len - 1) + 1)));\r\n }\r\n }\r\n else {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_ofString(text_1));\r\n }\r\n}\r\n\r\nexport function BigInteger__get_IsSmall(x) {\r\n if (BigInteger__get_IsZero(x)) {\r\n return true;\r\n }\r\n else {\r\n return BigNatModule_isSmall(BigInteger__get_V(x));\r\n }\r\n}\r\n\r\nexport function BigInteger_Factorial_Z665282C2(x) {\r\n if (BigInteger__get_IsNegative(x)) {\r\n throw (new Error(\"mustBeNonNegative\\\\nParameter name: x\"));\r\n }\r\n if (BigInteger__get_IsPositive(x)) {\r\n return BigInteger_posn_Z67CCE57D(BigNatModule_factorial(BigInteger__get_V(x)));\r\n }\r\n else {\r\n return BigInteger_get_One();\r\n }\r\n}\r\n\r\nexport function BigInteger_op_UnaryPlus_Z665282C2(n1) {\r\n return n1;\r\n}\r\n\r\nexport function BigInteger_FromInt64_Z524259C1(x) {\r\n return BigInteger_$ctor_Z524259C1(x);\r\n}\r\n\r\nexport function BigInteger_FromInt32_Z524259A4(x) {\r\n return BigInteger_$ctor_Z524259A4(x);\r\n}\r\n\r\n","import { Union } from \"./Types.js\";\r\nimport { union_type } from \"./Reflection.js\";\r\nimport { some } from \"./Option.js\";\r\n\r\nexport class FSharpResult$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Ok\", \"Error\"];\r\n }\r\n}\r\n\r\nexport function FSharpResult$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpResult`2\", [gen0, gen1], FSharpResult$2, () => [[[\"ResultValue\", gen0]], [[\"ErrorValue\", gen1]]]);\r\n}\r\n\r\nexport function Result_Map(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, mapping(result.fields[0]));\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport function Result_MapError(mapping, result) {\r\n if (result.tag === 0) {\r\n return new FSharpResult$2(0, result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, mapping(result.fields[0]));\r\n }\r\n}\r\n\r\nexport function Result_Bind(binder, result) {\r\n if (result.tag === 0) {\r\n return binder(result.fields[0]);\r\n }\r\n else {\r\n return new FSharpResult$2(1, result.fields[0]);\r\n }\r\n}\r\n\r\nexport class FSharpChoice$2 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of2\", \"Choice2Of2\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$2$reflection(gen0, gen1) {\r\n return union_type(\"FSharp.Core.FSharpChoice`2\", [gen0, gen1], FSharpChoice$2, () => [[[\"Item\", gen0]], [[\"Item\", gen1]]]);\r\n}\r\n\r\nexport class FSharpChoice$3 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of3\", \"Choice2Of3\", \"Choice3Of3\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$3$reflection(gen0, gen1, gen2) {\r\n return union_type(\"FSharp.Core.FSharpChoice`3\", [gen0, gen1, gen2], FSharpChoice$3, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]]]);\r\n}\r\n\r\nexport class FSharpChoice$4 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of4\", \"Choice2Of4\", \"Choice3Of4\", \"Choice4Of4\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$4$reflection(gen0, gen1, gen2, gen3) {\r\n return union_type(\"FSharp.Core.FSharpChoice`4\", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]]]);\r\n}\r\n\r\nexport class FSharpChoice$5 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of5\", \"Choice2Of5\", \"Choice3Of5\", \"Choice4Of5\", \"Choice5Of5\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$5$reflection(gen0, gen1, gen2, gen3, gen4) {\r\n return union_type(\"FSharp.Core.FSharpChoice`5\", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]]]);\r\n}\r\n\r\nexport class FSharpChoice$6 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of6\", \"Choice2Of6\", \"Choice3Of6\", \"Choice4Of6\", \"Choice5Of6\", \"Choice6Of6\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$6$reflection(gen0, gen1, gen2, gen3, gen4, gen5) {\r\n return union_type(\"FSharp.Core.FSharpChoice`6\", [gen0, gen1, gen2, gen3, gen4, gen5], FSharpChoice$6, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]]]);\r\n}\r\n\r\nexport class FSharpChoice$7 extends Union {\r\n constructor(tag, ...fields) {\r\n super();\r\n this.tag = (tag | 0);\r\n this.fields = fields;\r\n }\r\n cases() {\r\n return [\"Choice1Of7\", \"Choice2Of7\", \"Choice3Of7\", \"Choice4Of7\", \"Choice5Of7\", \"Choice6Of7\", \"Choice7Of7\"];\r\n }\r\n}\r\n\r\nexport function FSharpChoice$7$reflection(gen0, gen1, gen2, gen3, gen4, gen5, gen6) {\r\n return union_type(\"FSharp.Core.FSharpChoice`7\", [gen0, gen1, gen2, gen3, gen4, gen5, gen6], FSharpChoice$7, () => [[[\"Item\", gen0]], [[\"Item\", gen1]], [[\"Item\", gen2]], [[\"Item\", gen3]], [[\"Item\", gen4]], [[\"Item\", gen5]], [[\"Item\", gen6]]]);\r\n}\r\n\r\nexport function Choice_makeChoice1Of2(x) {\r\n return new FSharpChoice$2(0, x);\r\n}\r\n\r\nexport function Choice_makeChoice2Of2(x) {\r\n return new FSharpChoice$2(1, x);\r\n}\r\n\r\nexport function Choice_tryValueIfChoice1Of2(x) {\r\n if (x.tag === 0) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function Choice_tryValueIfChoice2Of2(x) {\r\n if (x.tag === 1) {\r\n return some(x.fields[0]);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\n","/**\n * DateTimeOffset functions.\n *\n * Note: Date instances are always DateObjects in local\n * timezone (because JS dates are all kinds of messed up).\n * A local date returns UTC epoc when `.getTime()` is called.\n *\n * Basically; invariant: date.getTime() always return UTC time.\n */\nimport { fromValue, ticksToUnixEpochMilliseconds, unixEpochMillisecondsToTicks } from \"./Long.js\";\nimport { compareDates, dateOffset, padWithZeros } from \"./Util.js\";\nexport function dateOffsetToString(offset) {\n const isMinus = offset < 0;\n offset = Math.abs(offset);\n const hours = ~~(offset / 3600000);\n const minutes = (offset % 3600000) / 60000;\n return (isMinus ? \"-\" : \"+\") +\n padWithZeros(hours, 2) + \":\" +\n padWithZeros(minutes, 2);\n}\nexport function dateToHalfUTCString(date, half) {\n const str = date.toISOString();\n return half === \"first\"\n ? str.substring(0, str.indexOf(\"T\"))\n : str.substring(str.indexOf(\"T\") + 1, str.length - 1);\n}\nfunction dateToISOString(d, utc) {\n if (utc) {\n return d.toISOString();\n }\n else {\n // JS Date is always local\n const printOffset = d.kind == null ? true : d.kind === 2 /* Local */;\n return padWithZeros(d.getFullYear(), 4) + \"-\" +\n padWithZeros(d.getMonth() + 1, 2) + \"-\" +\n padWithZeros(d.getDate(), 2) + \"T\" +\n padWithZeros(d.getHours(), 2) + \":\" +\n padWithZeros(d.getMinutes(), 2) + \":\" +\n padWithZeros(d.getSeconds(), 2) + \".\" +\n padWithZeros(d.getMilliseconds(), 3) +\n (printOffset ? dateOffsetToString(d.getTimezoneOffset() * -60000) : \"\");\n }\n}\nfunction dateToISOStringWithOffset(dateWithOffset, offset) {\n const str = dateWithOffset.toISOString();\n return str.substring(0, str.length - 1) + dateOffsetToString(offset);\n}\nfunction dateToStringWithCustomFormat(date, format, utc) {\n return format.replace(/(\\w)\\1*/g, (match) => {\n let rep = Number.NaN;\n switch (match.substring(0, 1)) {\n case \"y\":\n const y = utc ? date.getUTCFullYear() : date.getFullYear();\n rep = match.length < 4 ? y % 100 : y;\n break;\n case \"M\":\n rep = (utc ? date.getUTCMonth() : date.getMonth()) + 1;\n break;\n case \"d\":\n rep = utc ? date.getUTCDate() : date.getDate();\n break;\n case \"H\":\n rep = utc ? date.getUTCHours() : date.getHours();\n break;\n case \"h\":\n const h = utc ? date.getUTCHours() : date.getHours();\n rep = h > 12 ? h % 12 : h;\n break;\n case \"m\":\n rep = utc ? date.getUTCMinutes() : date.getMinutes();\n break;\n case \"s\":\n rep = utc ? date.getUTCSeconds() : date.getSeconds();\n break;\n case \"f\":\n rep = utc ? date.getUTCMilliseconds() : date.getMilliseconds();\n break;\n }\n if (Number.isNaN(rep)) {\n return match;\n }\n else {\n return (rep < 10 && match.length > 1) ? \"0\" + rep : \"\" + rep;\n }\n });\n}\nfunction dateToStringWithOffset(date, format) {\n var _a, _b, _c;\n const d = new Date(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0));\n if (typeof format !== \"string\") {\n return d.toISOString().replace(/\\.\\d+/, \"\").replace(/[A-Z]|\\.\\d+/g, \" \") + dateOffsetToString(((_b = date.offset) !== null && _b !== void 0 ? _b : 0));\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\": return dateToHalfUTCString(d, \"first\");\n case \"T\":\n case \"t\": return dateToHalfUTCString(d, \"second\");\n case \"O\":\n case \"o\": return dateToISOStringWithOffset(d, ((_c = date.offset) !== null && _c !== void 0 ? _c : 0));\n default: throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(d, format, true);\n }\n}\nfunction dateToStringWithKind(date, format) {\n const utc = date.kind === 1 /* UTC */;\n if (typeof format !== \"string\") {\n return utc ? date.toUTCString() : date.toLocaleString();\n }\n else if (format.length === 1) {\n switch (format) {\n case \"D\":\n case \"d\":\n return utc ? dateToHalfUTCString(date, \"first\") : date.toLocaleDateString();\n case \"T\":\n case \"t\":\n return utc ? dateToHalfUTCString(date, \"second\") : date.toLocaleTimeString();\n case \"O\":\n case \"o\":\n return dateToISOString(date, utc);\n default:\n throw new Error(\"Unrecognized Date print format\");\n }\n }\n else {\n return dateToStringWithCustomFormat(date, format, utc);\n }\n}\nexport function toString(date, format, _provider) {\n return date.offset != null\n ? dateToStringWithOffset(date, format)\n : dateToStringWithKind(date, format);\n}\nexport function DateTime(value, kind) {\n const d = new Date(value);\n d.kind = (kind == null ? 0 /* Unspecified */ : kind) | 0;\n return d;\n}\nexport function fromTicks(ticks, kind) {\n ticks = fromValue(ticks);\n kind = kind != null ? kind : 2 /* Local */; // better default than Unspecified\n let date = DateTime(ticksToUnixEpochMilliseconds(ticks), kind);\n // Ticks are local to offset (in this case, either UTC or Local/Unknown).\n // If kind is anything but UTC, that means that the tick number was not\n // in utc, thus getTime() cannot return UTC, and needs to be shifted.\n if (kind !== 1 /* UTC */) {\n date = DateTime(date.getTime() - dateOffset(date), kind);\n }\n return date;\n}\nexport function fromDateTimeOffset(date, kind) {\n var _a;\n switch (kind) {\n case 1 /* UTC */: return DateTime(date.getTime(), 1 /* UTC */);\n case 2 /* Local */: return DateTime(date.getTime(), 2 /* Local */);\n default:\n const d = DateTime(date.getTime() + ((_a = date.offset) !== null && _a !== void 0 ? _a : 0), kind);\n return DateTime(d.getTime() - dateOffset(d), kind);\n }\n}\nexport function getTicks(date) {\n return unixEpochMillisecondsToTicks(date.getTime(), dateOffset(date));\n}\nexport function minValue() {\n // This is \"0001-01-01T00:00:00.000Z\", actual JS min value is -8640000000000000\n return DateTime(-62135596800000, 0 /* Unspecified */);\n}\nexport function maxValue() {\n // This is \"9999-12-31T23:59:59.999Z\", actual JS max value is 8640000000000000\n return DateTime(253402300799999, 0 /* Unspecified */);\n}\nexport function parseRaw(input) {\n function fail() {\n throw new Error(`The string is not a valid Date: ${input}`);\n }\n if (input == null || input.trim() === \"\") {\n fail();\n }\n // ISO dates without TZ are parsed as UTC. Adding time without TZ keeps them local.\n if (input.length === 10 && input[4] === \"-\" && input[7] === \"-\") {\n input += \"T00:00:00\";\n }\n let date = new Date(input);\n let offset = null;\n if (isNaN(date.getTime())) {\n // Try to check strings JS Date cannot parse (see #1045, #1422)\n // tslint:disable-next-line:max-line-length\n const m = /^\\s*(\\d+[^\\w\\s:]\\d+[^\\w\\s:]\\d+)?\\s*(\\d+:\\d+(?::\\d+(?:\\.\\d+)?)?)?\\s*([AaPp][Mm])?\\s*(Z|[+-]([01]?\\d):?([0-5]?\\d)?)?\\s*$/.exec(input);\n if (m != null) {\n let baseDate;\n let timeInSeconds = 0;\n if (m[2] != null) {\n const timeParts = m[2].split(\":\");\n timeInSeconds =\n parseInt(timeParts[0], 10) * 3600 +\n parseInt(timeParts[1] || \"0\", 10) * 60 +\n parseFloat(timeParts[2] || \"0\");\n if (m[3] != null && m[3].toUpperCase() === \"PM\") {\n timeInSeconds += 720;\n }\n }\n if (m[4] != null) { // There's an offset, parse as UTC\n if (m[1] != null) {\n baseDate = new Date(m[1] + \" UTC\");\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getUTCFullYear() + \"/\" + (d.getUTCMonth() + 1) + \"/\" + d.getUTCDate());\n }\n if (m[4] === \"Z\") {\n offset = \"Z\";\n }\n else {\n let offsetInMinutes = parseInt(m[5], 10) * 60 + parseInt(m[6] || \"0\", 10);\n if (m[4][0] === \"-\") {\n offsetInMinutes *= -1;\n }\n offset = offsetInMinutes;\n timeInSeconds -= offsetInMinutes * 60;\n }\n }\n else {\n if (m[1] != null) {\n baseDate = new Date(m[1]);\n }\n else {\n const d = new Date();\n baseDate = new Date(d.getFullYear() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getDate());\n }\n }\n date = new Date(baseDate.getTime() + timeInSeconds * 1000);\n // correct for daylight savings time\n date = new Date(date.getTime() + (date.getTimezoneOffset() - baseDate.getTimezoneOffset()) * 60000);\n }\n else {\n fail();\n }\n // Check again the date is valid after transformations, see #2229\n if (isNaN(date.getTime())) {\n fail();\n }\n }\n return [date, offset];\n}\nexport function parse(str, detectUTC = false) {\n const [date, offset] = parseRaw(str);\n // .NET always parses DateTime as Local if there's offset info (even \"Z\")\n // Newtonsoft.Json uses UTC if the offset is \"Z\"\n const kind = offset != null\n ? (detectUTC && offset === \"Z\" ? 1 /* UTC */ : 2 /* Local */)\n : 0 /* Unspecified */;\n return DateTime(date.getTime(), kind);\n}\nexport function tryParse(v, defValue) {\n try {\n defValue.contents = parse(v);\n return true;\n }\n catch (_err) {\n return false;\n }\n}\nexport function create(year, month, day, h = 0, m = 0, s = 0, ms = 0, kind) {\n const dateValue = kind === 1 /* UTC */\n ? Date.UTC(year, month - 1, day, h, m, s, ms)\n : new Date(year, month - 1, day, h, m, s, ms).getTime();\n if (isNaN(dateValue)) {\n throw new Error(\"The parameters describe an unrepresentable Date.\");\n }\n const date = DateTime(dateValue, kind);\n if (year <= 99) {\n date.setFullYear(year, month - 1, day);\n }\n return date;\n}\nexport function now() {\n return DateTime(Date.now(), 2 /* Local */);\n}\nexport function utcNow() {\n return DateTime(Date.now(), 1 /* UTC */);\n}\nexport function today() {\n return date(now());\n}\nexport function isLeapYear(year) {\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nexport function daysInMonth(year, month) {\n return month === 2\n ? (isLeapYear(year) ? 29 : 28)\n : (month >= 8 ? (month % 2 === 0 ? 31 : 30) : (month % 2 === 0 ? 30 : 31));\n}\nexport function toUniversalTime(date) {\n return date.kind === 1 /* UTC */ ? date : DateTime(date.getTime(), 1 /* UTC */);\n}\nexport function toLocalTime(date) {\n return date.kind === 2 /* Local */ ? date : DateTime(date.getTime(), 2 /* Local */);\n}\nexport function specifyKind(d, kind) {\n return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), kind);\n}\nexport function timeOfDay(d) {\n return hour(d) * 3600000\n + minute(d) * 60000\n + second(d) * 1000\n + millisecond(d);\n}\nexport function date(d) {\n return create(year(d), month(d), day(d), 0, 0, 0, 0, d.kind);\n}\nexport function day(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDate() : d.getDate();\n}\nexport function hour(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCHours() : d.getHours();\n}\nexport function millisecond(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMilliseconds() : d.getMilliseconds();\n}\nexport function minute(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCMinutes() : d.getMinutes();\n}\nexport function month(d) {\n return (d.kind === 1 /* UTC */ ? d.getUTCMonth() : d.getMonth()) + 1;\n}\nexport function second(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCSeconds() : d.getSeconds();\n}\nexport function year(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCFullYear() : d.getFullYear();\n}\nexport function dayOfWeek(d) {\n return d.kind === 1 /* UTC */ ? d.getUTCDay() : d.getDay();\n}\nexport function dayOfYear(d) {\n const _year = year(d);\n const _month = month(d);\n let _day = day(d);\n for (let i = 1; i < _month; i++) {\n _day += daysInMonth(_year, i);\n }\n return _day;\n}\nexport function add(d, ts) {\n const newDate = DateTime(d.getTime() + ts, d.kind);\n if (d.kind === 2 /* Local */) {\n const oldTzOffset = d.getTimezoneOffset();\n const newTzOffset = newDate.getTimezoneOffset();\n return oldTzOffset !== newTzOffset\n ? DateTime(newDate.getTime() + (newTzOffset - oldTzOffset) * 60000, d.kind)\n : newDate;\n }\n else {\n return newDate;\n }\n}\nexport function addDays(d, v) {\n return add(d, v * 86400000);\n}\nexport function addHours(d, v) {\n return add(d, v * 3600000);\n}\nexport function addMinutes(d, v) {\n return add(d, v * 60000);\n}\nexport function addSeconds(d, v) {\n return add(d, v * 1000);\n}\nexport function addMilliseconds(d, v) {\n return add(d, v);\n}\nexport function addYears(d, v) {\n const newMonth = month(d);\n const newYear = year(d) + v;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function addMonths(d, v) {\n let newMonth = month(d) + v;\n let newMonth_ = 0;\n let yearOffset = 0;\n if (newMonth > 12) {\n newMonth_ = newMonth % 12;\n yearOffset = Math.floor(newMonth / 12);\n newMonth = newMonth_;\n }\n else if (newMonth < 1) {\n newMonth_ = 12 + newMonth % 12;\n yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);\n newMonth = newMonth_;\n }\n const newYear = year(d) + yearOffset;\n const _daysInMonth = daysInMonth(newYear, newMonth);\n const newDay = Math.min(_daysInMonth, day(d));\n return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);\n}\nexport function subtract(d, that) {\n return typeof that === \"number\"\n ? add(d, -that)\n : d.getTime() - that.getTime();\n}\nexport function toLongDateString(d) {\n return d.toDateString();\n}\nexport function toShortDateString(d) {\n return d.toLocaleDateString();\n}\nexport function toLongTimeString(d) {\n return d.toLocaleTimeString();\n}\nexport function toShortTimeString(d) {\n return d.toLocaleTimeString().replace(/:\\d\\d(?!:)/, \"\");\n}\nexport function equals(d1, d2) {\n return d1.getTime() === d2.getTime();\n}\nexport const compare = compareDates;\nexport const compareTo = compareDates;\nexport function op_Addition(x, y) {\n return add(x, y);\n}\nexport function op_Subtraction(x, y) {\n return subtract(x, y);\n}\nexport function isDaylightSavingTime(x) {\n const jan = new Date(x.getFullYear(), 0, 1);\n const jul = new Date(x.getFullYear(), 6, 1);\n return isDST(jan.getTimezoneOffset(), jul.getTimezoneOffset(), x.getTimezoneOffset());\n}\nfunction isDST(janOffset, julOffset, tOffset) {\n return Math.min(janOffset, julOffset) === tOffset;\n}\nexport default DateTime;\n","import Decimal from \"./lib/big.js\";\nimport { FSharpRef } from \"./Types.js\";\nexport default Decimal;\nexport const get_Zero = new Decimal(0);\nexport const get_One = new Decimal(1);\nexport const get_MinusOne = new Decimal(-1);\nexport const get_MaxValue = new Decimal(\"79228162514264337593543950335\");\nexport const get_MinValue = new Decimal(\"-79228162514264337593543950335\");\nexport function compare(x, y) {\n return x.cmp(y);\n}\nexport function equals(x, y) {\n return !x.cmp(y);\n}\nexport function abs(x) {\n return x.abs();\n}\nexport function round(x, digits = 0) {\n return x.round(digits, 2 /* ROUND_HALF_EVEN */);\n}\nexport function truncate(x) {\n return x.round(0, 0 /* ROUND_DOWN */);\n}\nexport function ceiling(x) {\n return x.round(0, x.cmp(0) >= 0 ? 3 /* ROUND_UP */ : 0 /* ROUND_DOWN */);\n}\nexport function floor(x) {\n return x.round(0, x.cmp(0) >= 0 ? 0 /* ROUND_DOWN */ : 3 /* ROUND_UP */);\n}\nexport function pow(x, n) {\n return x.pow(n);\n}\nexport function sqrt(x) {\n return x.sqrt();\n}\nexport function op_Addition(x, y) {\n return x.add(y);\n}\nexport function op_Subtraction(x, y) {\n return x.sub(y);\n}\nexport function op_Multiply(x, y) {\n return x.mul(y);\n}\nexport function op_Division(x, y) {\n return x.div(y);\n}\nexport function op_Modulus(x, y) {\n return x.mod(y);\n}\nexport function op_UnaryNegation(x) {\n const x2 = new Decimal(x);\n x2.s = -x2.s || 0;\n return x2;\n}\nexport const add = op_Addition;\nexport const subtract = op_Subtraction;\nexport const multiply = op_Multiply;\nexport const divide = op_Division;\nexport const remainder = op_Modulus;\nexport const negate = op_UnaryNegation;\nexport function toString(x) {\n return x.toString();\n}\nexport function tryParse(str, defValue) {\n try {\n defValue.contents = new Decimal(str.trim());\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function parse(str) {\n const defValue = new FSharpRef(get_Zero);\n if (tryParse(str, defValue)) {\n return defValue.contents;\n }\n else {\n throw new Error(\"Input string was not in a correct format.\");\n }\n}\nexport function toNumber(x) {\n return +x;\n}\nfunction decimalToHex(dec, bitSize) {\n const hex = new Uint8Array(bitSize / 4 | 0);\n let hexCount = 1;\n for (let d = 0; d < dec.length; d++) {\n let value = dec[d];\n for (let i = 0; i < hexCount; i++) {\n const digit = hex[i] * 10 + value | 0;\n hex[i] = digit & 0xF;\n value = digit >> 4;\n }\n if (value !== 0) {\n hex[hexCount++] = value;\n }\n }\n return hex.slice(0, hexCount); // digits in reverse order\n}\nfunction hexToDecimal(hex, bitSize) {\n const dec = new Uint8Array(bitSize * 301 / 1000 + 1 | 0);\n let decCount = 1;\n for (let d = hex.length - 1; d >= 0; d--) {\n let carry = hex[d];\n for (let i = 0; i < decCount; i++) {\n const val = dec[i] * 16 + carry | 0;\n dec[i] = (val % 10) | 0;\n carry = (val / 10) | 0;\n }\n while (carry > 0) {\n dec[decCount++] = (carry % 10) | 0;\n carry = (carry / 10) | 0;\n }\n }\n return dec.slice(0, decCount); // digits in reverse order\n}\nfunction setInt32Bits(hexDigits, bits, offset) {\n for (let i = 0; i < 8; i++) {\n hexDigits[offset + i] = (bits >> (i * 4)) & 0xF;\n }\n}\nfunction getInt32Bits(hexDigits, offset) {\n let bits = 0;\n for (let i = 0; i < 8; i++) {\n bits = bits | (hexDigits[offset + i] << (i * 4));\n }\n return bits;\n}\nexport function fromIntArray(bits) {\n return fromInts(bits[0], bits[1], bits[2], bits[3]);\n}\nexport function fromInts(low, mid, high, signExp) {\n const isNegative = signExp < 0;\n const scale = (signExp >> 16) & 0x7F;\n return fromParts(low, mid, high, isNegative, scale);\n}\nexport function fromParts(low, mid, high, isNegative, scale) {\n const bitSize = 96;\n const hexDigits = new Uint8Array(bitSize / 4);\n setInt32Bits(hexDigits, low, 0);\n setInt32Bits(hexDigits, mid, 8);\n setInt32Bits(hexDigits, high, 16);\n const decDigits = hexToDecimal(hexDigits, bitSize);\n scale = scale & 0x7F;\n const big = new Decimal(0);\n big.c = Array.from(decDigits.reverse());\n big.e = decDigits.length - scale - 1;\n big.s = isNegative ? -1 : 1;\n const d = new Decimal(big);\n return d;\n}\nexport function getBits(d) {\n const bitSize = 96;\n const decDigits = Uint8Array.from(d.c);\n const hexDigits = decimalToHex(decDigits, bitSize);\n const low = getInt32Bits(hexDigits, 0);\n const mid = getInt32Bits(hexDigits, 8);\n const high = getInt32Bits(hexDigits, 16);\n const decStr = d.toString();\n const dotPos = decStr.indexOf(\".\");\n const scale = dotPos < 0 ? 0 : decStr.length - dotPos - 1;\n const signExp = ((scale & 0x7F) << 16) | (d.s < 0 ? 0x80000000 : 0);\n return [low, mid, high, signExp];\n}\n// export function makeRangeStepFunction(step: Decimal, last: Decimal) {\n// const stepComparedWithZero = step.cmp(get_Zero);\n// if (stepComparedWithZero === 0) {\n// throw new Error(\"The step of a range cannot be zero\");\n// }\n// const stepGreaterThanZero = stepComparedWithZero > 0;\n// return (x: Decimal) => {\n// const comparedWithLast = x.cmp(last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\n","import { compare, physicalHash, equals, structuralHash } from \"./Util.js\";\r\n\r\nexport function HashIdentity_FromFunctions(hash, eq) {\r\n return {\r\n Equals(x, y) {\r\n return eq(x, y);\r\n },\r\n GetHashCode(x_1) {\r\n return hash(x_1);\r\n },\r\n };\r\n}\r\n\r\nexport function HashIdentity_Structural() {\r\n return HashIdentity_FromFunctions(structuralHash, equals);\r\n}\r\n\r\nexport function HashIdentity_Reference() {\r\n return HashIdentity_FromFunctions(physicalHash, (e1, e2) => (e1 === e2));\r\n}\r\n\r\nexport function ComparisonIdentity_FromFunction(comparer) {\r\n return {\r\n Compare(x, y) {\r\n return comparer(x, y);\r\n },\r\n };\r\n}\r\n\r\nexport function ComparisonIdentity_Structural() {\r\n return ComparisonIdentity_FromFunction(compare);\r\n}\r\n\r\n","import { disposeSafe, structuralHash, equals } from \"./Util.js\";\r\nimport { HashIdentity_Structural, ComparisonIdentity_Structural } from \"./FSharp.Collections.js\";\r\nimport { StringBuilder__Append_Z721C83C5 } from \"./System.Text.js\";\r\n\r\nexport const LanguagePrimitives_GenericEqualityComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport const LanguagePrimitives_GenericEqualityERComparer = {\r\n [\"System.Collections.IEqualityComparer.Equals541DA560\"](x, y) {\r\n return equals(x, y);\r\n },\r\n [\"System.Collections.IEqualityComparer.GetHashCode4E60E31B\"](x_1) {\r\n return structuralHash(x_1);\r\n },\r\n};\r\n\r\nexport function LanguagePrimitives_FastGenericComparer() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericComparerFromTable() {\r\n return ComparisonIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparer() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function LanguagePrimitives_FastGenericEqualityComparerFromTable() {\r\n return HashIdentity_Structural();\r\n}\r\n\r\nexport function Operators_Failure(message) {\r\n return new Error(message);\r\n}\r\n\r\nexport function Operators_FailurePattern(exn) {\r\n return exn.message;\r\n}\r\n\r\nexport function Operators_NullArg(x) {\r\n throw (new Error(x));\r\n}\r\n\r\nexport function Operators_Using(resource, action) {\r\n try {\r\n return action(resource);\r\n }\r\n finally {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n disposeSafe(resource);\r\n }\r\n }\r\n}\r\n\r\nexport function Operators_Lock(_lockObj, action) {\r\n return action();\r\n}\r\n\r\nexport function ExtraTopLevelOperators_LazyPattern(input) {\r\n return input.Value;\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilderThen(continuation, builder, format) {\r\n return format.cont((s) => {\r\n StringBuilder__Append_Z721C83C5(builder, s);\r\n return continuation();\r\n });\r\n}\r\n\r\nexport function PrintfModule_PrintFormatToStringBuilder(builder, format) {\r\n return PrintfModule_PrintFormatToStringBuilderThen(() => {\r\n }, builder, format);\r\n}\r\n\r\n","\r\nexport const SR_indexOutOfBounds = \"The index was outside the range of elements in the collection.\";\r\n\r\nexport const SR_inputWasEmpty = \"Collection was empty.\";\r\n\r\nexport const SR_inputMustBeNonNegative = \"The input must be non-negative.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_differentLengths = \"The collections had different lengths.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\n","// export type decimal = Decimal;\nexport var NumberStyles;\n(function (NumberStyles) {\n // None = 0x00000000,\n // AllowLeadingWhite = 0x00000001,\n // AllowTrailingWhite = 0x00000002,\n // AllowLeadingSign = 0x00000004,\n // AllowTrailingSign = 0x00000008,\n // AllowParentheses = 0x00000010,\n // AllowDecimalPoint = 0x00000020,\n // AllowThousands = 0x00000040,\n // AllowExponent = 0x00000080,\n // AllowCurrencySymbol = 0x00000100,\n NumberStyles[NumberStyles[\"AllowHexSpecifier\"] = 512] = \"AllowHexSpecifier\";\n // Integer = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign,\n // HexNumber = AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier,\n // Number = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowTrailingSign | AllowDecimalPoint | AllowThousands,\n // Float = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n // AllowDecimalPoint | AllowExponent,\n // Currency = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol,\n // Any = AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign | AllowTrailingSign |\n // AllowParentheses | AllowDecimalPoint | AllowThousands | AllowCurrencySymbol | AllowExponent,\n})(NumberStyles || (NumberStyles = {}));\nfunction validResponse(regexMatch, radix) {\n const [/*all*/ , sign, prefix, digits] = regexMatch;\n return {\n sign: sign || \"\",\n prefix: prefix || \"\",\n digits,\n radix,\n };\n}\nfunction getRange(unsigned, bitsize) {\n switch (bitsize) {\n case 8: return unsigned ? [0, 255] : [-128, 127];\n case 16: return unsigned ? [0, 65535] : [-32768, 32767];\n case 32: return unsigned ? [0, 4294967295] : [-2147483648, 2147483647];\n default: throw new Error(\"Invalid bit size.\");\n }\n}\nfunction getInvalidDigits(radix) {\n switch (radix) {\n case 2: return /[^0-1]/;\n case 8: return /[^0-7]/;\n case 10: return /[^0-9]/;\n case 16: return /[^0-9a-fA-F]/;\n default:\n throw new Error(\"Invalid Base.\");\n }\n}\nfunction getRadix(prefix, style) {\n if (style & NumberStyles.AllowHexSpecifier) {\n return 16;\n }\n else {\n switch (prefix) {\n case \"0b\":\n case \"0B\": return 2;\n case \"0o\":\n case \"0O\": return 8;\n case \"0x\":\n case \"0X\": return 16;\n default: return 10;\n }\n }\n}\nexport function isValid(str, style, radix) {\n const integerRegex = /^\\s*([\\+\\-])?(0[xXoObB])?([0-9a-fA-F]+)\\s*$/;\n const res = integerRegex.exec(str.replace(/_/g, \"\"));\n if (res != null) {\n const [/*all*/ , /*sign*/ , prefix, digits] = res;\n radix = radix || getRadix(prefix, style);\n const invalidDigits = getInvalidDigits(radix);\n if (!invalidDigits.test(digits)) {\n return validResponse(res, radix);\n }\n }\n return null;\n}\nexport function parse(str, style, unsigned, bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n let v = Number.parseInt(res.sign + res.digits, res.radix);\n if (!Number.isNaN(v)) {\n const [umin, umax] = getRange(true, bitsize);\n if (!unsigned && res.radix !== 10 && v >= umin && v <= umax) {\n v = v << (32 - bitsize) >> (32 - bitsize);\n }\n const [min, max] = getRange(unsigned, bitsize);\n if (v >= min && v <= max) {\n return v;\n }\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function op_UnaryNegation_Int8(x) {\n return x === -128 ? x : -x;\n}\nexport function op_UnaryNegation_Int16(x) {\n return x === -32768 ? x : -x;\n}\nexport function op_UnaryNegation_Int32(x) {\n return x === -2147483648 ? x : -x;\n}\nexport function divRem(x, y, out) {\n const div = ~~(x / y);\n const rem = x % y;\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","import { join } from \"./String.js\";\r\nimport { uncurry, disposeSafe, isArrayLike, getEnumerator, toIterator, compare, structuralHash, equals } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { class_type, record_type, option_type } from \"./Reflection.js\";\r\nimport { SR_inputSequenceTooLong, SR_inputSequenceEmpty, SR_inputMustBeNonNegative, SR_notEnoughElements, SR_differentLengths, SR_keyNotFoundAlt, SR_indexOutOfBounds, SR_inputWasEmpty } from \"./Global.js\";\r\nimport { defaultArg, value as value_1, some } from \"./Option.js\";\r\nimport { transpose as transpose_1, splitInto as splitInto_1, windowed as windowed_1, pairwise as pairwise_1, chunkBySize as chunkBySize_1, map as map_1, permute as permute_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, scanBack as scanBack_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, fill } from \"./Array.js\";\r\n\r\nexport class FSharpList extends Record {\r\n constructor(head, tail) {\r\n super();\r\n this.head = head;\r\n this.tail = tail;\r\n }\r\n toString() {\r\n const xs = this;\r\n return (\"[\" + join(\"; \", xs)) + \"]\";\r\n }\r\n Equals(other) {\r\n const xs = this;\r\n if (xs === other) {\r\n return true;\r\n }\r\n else {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n if (equals(xs_1.head, ys_1.head)) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other);\r\n }\r\n }\r\n GetHashCode() {\r\n const xs = this;\r\n const loop = (i_mut, h_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, h = h_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n if (i > 18) {\r\n return h | 0;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n h_mut = (((h << 1) + structuralHash(xs_1.head)) + (631 * i));\r\n xs_1_mut = t;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return h | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, 0, xs) | 0;\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n CompareTo(other) {\r\n const xs = this;\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [xs_1.tail, ys_1.tail];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const xt = matchValue[0];\r\n const yt = matchValue[1];\r\n const c = compare(xs_1.head, ys_1.head) | 0;\r\n if (c === 0) {\r\n xs_1_mut = xt;\r\n ys_1_mut = yt;\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n else {\r\n return 1;\r\n }\r\n }\r\n else if (matchValue[1] != null) {\r\n return -1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, other) | 0;\r\n }\r\n GetEnumerator() {\r\n const xs = this;\r\n return ListEnumerator$1_$ctor_3002E699(xs);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const xs = this;\r\n return getEnumerator(xs);\r\n }\r\n}\r\n\r\nexport function FSharpList$reflection(gen0) {\r\n return record_type(\"ListModule.FSharpList\", [gen0], FSharpList, () => [[\"head\", gen0], [\"tail\", option_type(FSharpList$reflection(gen0))]]);\r\n}\r\n\r\nexport class ListEnumerator$1 {\r\n constructor(xs) {\r\n this.xs = xs;\r\n this.it = this.xs;\r\n this.current = null;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current;\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n const matchValue = __.it.tail;\r\n if (matchValue != null) {\r\n const t = matchValue;\r\n __.current = __.it.head;\r\n __.it = t;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n const __ = this;\r\n __.it = __.xs;\r\n __.current = null;\r\n }\r\n Dispose() {\r\n }\r\n}\r\n\r\nexport function ListEnumerator$1$reflection(gen0) {\r\n return class_type(\"ListModule.ListEnumerator`1\", [gen0], ListEnumerator$1);\r\n}\r\n\r\nexport function ListEnumerator$1_$ctor_3002E699(xs) {\r\n return new ListEnumerator$1(xs);\r\n}\r\n\r\nexport function FSharpList_get_Empty() {\r\n return new FSharpList(null, void 0);\r\n}\r\n\r\nexport function FSharpList_Cons_305B8EAC(x, xs) {\r\n return new FSharpList(x, xs);\r\n}\r\n\r\nexport function FSharpList__get_IsEmpty(xs) {\r\n return xs.tail == null;\r\n}\r\n\r\nexport function FSharpList__get_Length(xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n else {\r\n return i | 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs) | 0;\r\n}\r\n\r\nexport function FSharpList__get_Head(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return xs.head;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Tail(xs) {\r\n const matchValue = xs.tail;\r\n if (matchValue != null) {\r\n return matchValue;\r\n }\r\n else {\r\n throw (new Error((SR_inputWasEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function FSharpList__get_Item_Z524259A4(xs, index) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n const matchValue = xs_1.tail;\r\n if (matchValue != null) {\r\n if (i === index) {\r\n return xs_1.head;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = matchValue;\r\n continue loop;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpList_get_Empty();\r\n}\r\n\r\nexport function cons(x, xs) {\r\n return FSharpList_Cons_305B8EAC(x, xs);\r\n}\r\n\r\nexport function singleton(x) {\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_get_Empty());\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n return FSharpList__get_IsEmpty(xs);\r\n}\r\n\r\nexport function length(xs) {\r\n return FSharpList__get_Length(xs);\r\n}\r\n\r\nexport function head(xs) {\r\n return FSharpList__get_Head(xs);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n}\r\n\r\nexport function tail(xs) {\r\n return FSharpList__get_Tail(xs);\r\n}\r\n\r\nexport function tryLast(xs_mut) {\r\n tryLast:\r\n while (true) {\r\n const xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return void 0;\r\n }\r\n else {\r\n const t = FSharpList__get_Tail(xs);\r\n if (FSharpList__get_IsEmpty(t)) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n xs_mut = t;\r\n continue tryLast;\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const loop = (xs_1_mut, ys_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs_1), FSharpList__get_IsEmpty(ys_1)];\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n return 0;\r\n }\r\n else {\r\n return -1;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n return 1;\r\n }\r\n else {\r\n const c = comparer(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)) | 0;\r\n if (c === 0) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n else {\r\n return c | 0;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs, ys) | 0;\r\n}\r\n\r\nexport function toArray(xs) {\r\n const len = FSharpList__get_Length(xs) | 0;\r\n const res = fill(new Array(len), 0, len, null);\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (!FSharpList__get_IsEmpty(xs_1)) {\r\n res[i] = FSharpList__get_Head(xs_1);\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n loop(0, xs);\r\n return res;\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_1)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function reverse(xs) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), FSharpList_get_Empty(), xs);\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function foldIndexed(folder, state, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = folder(i, acc, FSharpList__get_Head(xs_1));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, state, xs);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n let acc = state;\r\n let xs_1 = xs;\r\n let ys_1 = ys;\r\n while ((!FSharpList__get_IsEmpty(xs_1)) && (!FSharpList__get_IsEmpty(ys_1))) {\r\n acc = folder(acc, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1));\r\n xs_1 = FSharpList__get_Tail(xs_1);\r\n ys_1 = FSharpList__get_Tail(ys_1);\r\n }\r\n return acc;\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function unfold(gen, state) {\r\n const loop = (acc_mut, node_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, node = node_mut;\r\n const matchValue = gen(acc);\r\n if (matchValue != null) {\r\n acc_mut = matchValue[1];\r\n node_mut = ((t = (new FSharpList(matchValue[0], void 0)), (node.tail = t, t)));\r\n continue loop;\r\n }\r\n else {\r\n return node;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(state, root);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar0, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar0, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function toSeq(xs) {\r\n return xs;\r\n}\r\n\r\nexport function ofArrayWithTail(xs, tail_1) {\r\n let res = tail_1;\r\n for (let i = xs.length - 1; i >= 0; i--) {\r\n res = FSharpList_Cons_305B8EAC(xs[i], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function ofArray(xs) {\r\n return ofArrayWithTail(xs, FSharpList_get_Empty());\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n let xs_3, t;\r\n if (isArrayLike(xs)) {\r\n return ofArray(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const enumerator = getEnumerator(xs);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const x = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n node = ((xs_3 = node, (t = (new FSharpList(x, void 0)), (xs_3.tail = t, t))));\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n const xs_5 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_5.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n }\r\n}\r\n\r\nexport function concat(lists) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n const action = (xs) => {\r\n node = fold((acc, x) => {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }, node, xs);\r\n };\r\n if (isArrayLike(lists)) {\r\n lists.forEach(action);\r\n }\r\n else if (lists instanceof FSharpList) {\r\n iterate(action, lists);\r\n }\r\n else {\r\n const enumerator = getEnumerator(lists);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n action(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n }\r\n const xs_6 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_6.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n let t, xs_4, t_2;\r\n const root = FSharpList_get_Empty();\r\n let node = (t = (new FSharpList(state, void 0)), (root.tail = t, t));\r\n let acc = state;\r\n let xs_3 = xs;\r\n while (!FSharpList__get_IsEmpty(xs_3)) {\r\n acc = folder(acc, FSharpList__get_Head(xs_3));\r\n node = ((xs_4 = node, (t_2 = (new FSharpList(acc, void 0)), (xs_4.tail = t_2, t_2))));\r\n xs_3 = FSharpList__get_Tail(xs_3);\r\n }\r\n const xs_6 = node;\r\n const t_4 = FSharpList_get_Empty();\r\n xs_6.tail = t_4;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return ofArray(scanBack_1(folder, toArray(xs), state));\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return fold((acc, x) => FSharpList_Cons_305B8EAC(x, acc), ys, reverse(xs));\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n let xs_1, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n let ys = xs;\r\n while (!FSharpList__get_IsEmpty(ys)) {\r\n let zs = mapping(FSharpList__get_Head(ys));\r\n while (!FSharpList__get_IsEmpty(zs)) {\r\n node = ((xs_1 = node, (t = (new FSharpList(FSharpList__get_Head(zs), void 0)), (xs_1.tail = t, t))));\r\n zs = FSharpList__get_Tail(zs);\r\n }\r\n ys = FSharpList__get_Tail(ys);\r\n }\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = foldIndexed((i, acc, x) => {\r\n let t;\r\n return (t = (new FSharpList(mapping(i, x), void 0)), (acc.tail = t, t));\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n let t;\r\n return (t = (new FSharpList(mapping(x), void 0)), (acc.tail = t, t));\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold2((acc, x, y) => {\r\n let t;\r\n return (t = (new FSharpList(mapping(x, y), void 0)), (acc.tail = t, t));\r\n }, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n const loop = (i_mut, acc_mut, xs_1_mut, ys_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n acc_mut = ((t = (new FSharpList(mapping(i, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(0, root, xs, ys);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n const loop = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut, ys_1 = ys_1_mut, zs_1 = zs_1_mut;\r\n if ((FSharpList__get_IsEmpty(xs_1) ? true : FSharpList__get_IsEmpty(ys_1)) ? true : FSharpList__get_IsEmpty(zs_1)) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(mapping(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1), FSharpList__get_Head(zs_1)), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n ys_1_mut = FSharpList__get_Tail(ys_1);\r\n zs_1_mut = FSharpList__get_Tail(zs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node_1 = loop(root, xs, ys, zs);\r\n const t_2 = FSharpList_get_Empty();\r\n node_1.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const root = FSharpList_get_Empty();\r\n const patternInput_1 = fold((tupledArg, x) => {\r\n let t;\r\n const patternInput = mapping(tupledArg[1], x);\r\n return [(t = (new FSharpList(patternInput[0], void 0)), (tupledArg[0].tail = t, t)), patternInput[1]];\r\n }, [root, state], xs);\r\n const t_2 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_2;\r\n return [FSharpList__get_Tail(root), patternInput_1[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n return mapFold((acc, x) => mapping(x, acc), state, reverse(xs));\r\n}\r\n\r\nexport function tryPick(f, xs) {\r\n const loop = (xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else {\r\n const matchValue = f(FSharpList__get_Head(xs_1));\r\n if (matchValue == null) {\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n break;\r\n }\r\n };\r\n return loop(xs);\r\n}\r\n\r\nexport function pick(f, xs) {\r\n const matchValue = tryPick(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFind(f, xs) {\r\n return tryPick((x) => (f(x) ? some(x) : (void 0)), xs);\r\n}\r\n\r\nexport function find(f, xs) {\r\n const matchValue = tryFind(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(f, xs) {\r\n return tryFindBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findBack(f, xs) {\r\n const matchValue = tryFindBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(f, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (f(FSharpList__get_Head(xs_1))) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function findIndex(f, xs) {\r\n const matchValue = tryFindIndex(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(f, xs) {\r\n return tryFindIndexBack_1(f, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(f, xs) {\r\n const matchValue = tryFindIndexBack(f, xs);\r\n if (matchValue == null) {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryItem(n, xs) {\r\n const loop = (i_mut, xs_1_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return void 0;\r\n }\r\n else if (i === n) {\r\n return some(FSharpList__get_Head(xs_1));\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0, xs);\r\n}\r\n\r\nexport function item(n, xs) {\r\n return FSharpList__get_Item_Z524259A4(xs, n);\r\n}\r\n\r\nexport function filter(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n if (f(x)) {\r\n const t = new FSharpList(x, void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n else {\r\n return acc;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function partition(f, xs) {\r\n const patternInput = [FSharpList_get_Empty(), FSharpList_get_Empty()];\r\n const root2 = patternInput[1];\r\n const root1 = patternInput[0];\r\n const patternInput_1 = fold(uncurry(2, (tupledArg) => {\r\n const lacc = tupledArg[0];\r\n const racc = tupledArg[1];\r\n return (x) => {\r\n let t, t_2;\r\n return f(x) ? [(t = (new FSharpList(x, void 0)), (lacc.tail = t, t)), racc] : [lacc, (t_2 = (new FSharpList(x, void 0)), (racc.tail = t_2, t_2))];\r\n };\r\n }), [root1, root2], xs);\r\n const t_4 = FSharpList_get_Empty();\r\n patternInput_1[0].tail = t_4;\r\n const t_5 = FSharpList_get_Empty();\r\n patternInput_1[1].tail = t_5;\r\n return [FSharpList__get_Tail(root1), FSharpList__get_Tail(root2)];\r\n}\r\n\r\nexport function choose(f, xs) {\r\n const root = FSharpList_get_Empty();\r\n const node = fold((acc, x) => {\r\n const matchValue = f(x);\r\n if (matchValue == null) {\r\n return acc;\r\n }\r\n else {\r\n const t = new FSharpList(value_1(matchValue), void 0);\r\n acc.tail = t;\r\n return t;\r\n }\r\n }, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function contains(value, xs, eq) {\r\n return tryFindIndex((v) => eq.Equals(value, v), xs) != null;\r\n}\r\n\r\nexport function initialize(n, f) {\r\n let xs, t;\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n for (let i = 0; i <= (n - 1); i++) {\r\n node = ((xs = node, (t = (new FSharpList(f(i), void 0)), (xs.tail = t, t))));\r\n }\r\n const xs_2 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_2.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg1) => x);\r\n}\r\n\r\nexport function reduce(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return fold(f, head(xs), tail(xs));\r\n }\r\n}\r\n\r\nexport function reduceBack(f, xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error(SR_inputWasEmpty));\r\n }\r\n else {\r\n return foldBack(f, tail(xs), head(xs));\r\n }\r\n}\r\n\r\nexport function forAll(f, xs) {\r\n return fold((acc, x) => (acc && f(x)), true, xs);\r\n}\r\n\r\nexport function forAll2(f, xs, ys) {\r\n return fold2((acc, x, y) => (acc && f(x, y)), true, xs, ys);\r\n}\r\n\r\nexport function exists(f, xs) {\r\n return tryFindIndex(f, xs) != null;\r\n}\r\n\r\nexport function exists2(f_mut, xs_mut, ys_mut) {\r\n exists2:\r\n while (true) {\r\n const f = f_mut, xs = xs_mut, ys = ys_mut;\r\n const matchValue = [FSharpList__get_IsEmpty(xs), FSharpList__get_IsEmpty(ys)];\r\n let pattern_matching_result;\r\n if (matchValue[0]) {\r\n if (matchValue[1]) {\r\n pattern_matching_result = 0;\r\n }\r\n else {\r\n pattern_matching_result = 2;\r\n }\r\n }\r\n else if (matchValue[1]) {\r\n pattern_matching_result = 2;\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n return false;\r\n }\r\n case 1: {\r\n if (f(FSharpList__get_Head(xs), FSharpList__get_Head(ys))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n ys_mut = FSharpList__get_Tail(ys);\r\n continue exists2;\r\n }\r\n }\r\n case 2: {\r\n throw (new Error((SR_differentLengths + \"\\\\nParameter name: \") + \"list2\"));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function unzip(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function unzip3(xs) {\r\n return foldBack((tupledArg, tupledArg_1) => [FSharpList_Cons_305B8EAC(tupledArg[0], tupledArg_1[0]), FSharpList_Cons_305B8EAC(tupledArg[1], tupledArg_1[1]), FSharpList_Cons_305B8EAC(tupledArg[2], tupledArg_1[2])], xs, [FSharpList_get_Empty(), FSharpList_get_Empty(), FSharpList_get_Empty()]);\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs);\r\n return averager.DivideByInt(total, count);\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs);\r\n return averager.DivideByInt(total, count);\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return ofArray(permute_1(f, toArray(xs)));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return ofArray(map_1(ofArray, chunkBySize_1(chunkSize, toArray(xs))));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const root = FSharpList_get_Empty();\r\n let node = root;\r\n iterate((x) => {\r\n iterate((y) => {\r\n let xs_1, t;\r\n node = ((xs_1 = node, (t = (new FSharpList([x, y], void 0)), (xs_1.tail = t, t))));\r\n }, ys);\r\n }, xs);\r\n const xs_3 = node;\r\n const t_2 = FSharpList_get_Empty();\r\n xs_3.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function skip(count_mut, xs_mut) {\r\n skip:\r\n while (true) {\r\n const count = count_mut, xs = xs_mut;\r\n if (count <= 0) {\r\n return xs;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n count_mut = (count - 1);\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skip;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function skipWhile(predicate_mut, xs_mut) {\r\n skipWhile:\r\n while (true) {\r\n const predicate = predicate_mut, xs = xs_mut;\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n return xs;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs))) {\r\n return xs;\r\n }\r\n else {\r\n predicate_mut = predicate;\r\n xs_mut = FSharpList__get_Tail(xs);\r\n continue skipWhile;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function take(count, xs) {\r\n if (count < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n const loop = (acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const acc = acc_mut, xs_1 = xs_1_mut;\r\n if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else if (!predicate(FSharpList__get_Head(xs_1))) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n const loop = (i_mut, acc_mut, xs_1_mut) => {\r\n let t;\r\n loop:\r\n while (true) {\r\n const i = i_mut, acc = acc_mut, xs_1 = xs_1_mut;\r\n if (i <= 0) {\r\n return acc;\r\n }\r\n else if (FSharpList__get_IsEmpty(xs_1)) {\r\n return acc;\r\n }\r\n else {\r\n i_mut = (i - 1);\r\n acc_mut = ((t = (new FSharpList(FSharpList__get_Head(xs_1), void 0)), (acc.tail = t, t)));\r\n xs_1_mut = FSharpList__get_Tail(xs_1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n const root = FSharpList_get_Empty();\r\n const node = loop(count, root, xs);\r\n const t_2 = FSharpList_get_Empty();\r\n node.tail = t_2;\r\n return FSharpList__get_Tail(root);\r\n}\r\n\r\nexport function getSlice(startIndex, endIndex, xs) {\r\n const len = length(xs) | 0;\r\n const startIndex_1 = defaultArg(startIndex, 0) | 0;\r\n const endIndex_1 = defaultArg(endIndex, len - 1) | 0;\r\n if (startIndex_1 < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"startIndex\"));\r\n }\r\n else if (endIndex_1 >= len) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"endIndex\"));\r\n }\r\n else if (endIndex_1 < startIndex_1) {\r\n return FSharpList_get_Empty();\r\n }\r\n else {\r\n return take((endIndex_1 - startIndex_1) + 1, skip(startIndex_1, xs));\r\n }\r\n}\r\n\r\nexport function splitAt(index, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_inputMustBeNonNegative + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n if (index > FSharpList__get_Length(xs)) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return [take(index, xs), skip(index, xs)];\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n if (FSharpList__get_IsEmpty(xs)) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n else if (FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return FSharpList__get_Head(xs);\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"list\"));\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n if ((!FSharpList__get_IsEmpty(xs)) && FSharpList__get_IsEmpty(FSharpList__get_Tail(xs))) {\r\n return some(FSharpList__get_Head(xs));\r\n }\r\n else {\r\n return void 0;\r\n }\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return ofArray(pairwise_1(toArray(xs)));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return ofArray(map_1(ofArray, windowed_1(windowSize, toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return ofArray(map_1(ofArray, splitInto_1(chunks, toArray(xs))));\r\n}\r\n\r\nexport function transpose(lists) {\r\n return ofArray(map_1(ofArray, transpose_1(map_1(toArray, Array.from(lists)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const result = fold((acc, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, FSharpList_Cons_305B8EAC(y, acc));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? FSharpList_Cons_305B8EAC(y, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys_1 = ofSeq(ys);\r\n const result = fold((acc, x) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return FSharpList_Cons_305B8EAC(x, append(ys_1, acc));\r\n }\r\n else {\r\n return FSharpList_Cons_305B8EAC(x, acc);\r\n }\r\n }, FSharpList_get_Empty(), xs);\r\n return reverse(isDone ? result : (((i + 1) === index) ? append(ys_1, result) : (() => {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n })()));\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let i = -1;\r\n let isDone = false;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n isDone = true;\r\n return false;\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n let i = -1;\r\n let status = -1;\r\n const ys = filter((_arg1) => {\r\n i = ((i + 1) | 0);\r\n if (i === index) {\r\n status = 0;\r\n return false;\r\n }\r\n else if (i > index) {\r\n if (i < (index + count)) {\r\n return false;\r\n }\r\n else {\r\n status = 1;\r\n return true;\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n }, xs);\r\n const status_1 = (((status === 0) && ((i + 1) === (index + count))) ? 1 : status) | 0;\r\n if (status_1 < 1) {\r\n const arg = (status_1 < 0) ? \"index\" : \"count\";\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + arg));\r\n }\r\n return ys;\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n const ys = mapIndexed((i, x) => {\r\n if (i === index) {\r\n isDone = true;\r\n return y;\r\n }\r\n else {\r\n return x;\r\n }\r\n }, xs);\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return ys;\r\n}\r\n\r\n","import { isValid } from \"./Int32.js\";\nimport * as LongLib from \"./lib/long.js\";\nexport default LongLib.Long;\nexport const get_Zero = LongLib.ZERO;\nexport const get_One = LongLib.ONE;\nexport const op_Addition = LongLib.add;\nexport const op_Subtraction = LongLib.subtract;\nexport const op_Multiply = LongLib.multiply;\nexport const op_Division = LongLib.divide;\nexport const op_Modulus = LongLib.modulo;\nexport const op_UnaryNegation = LongLib.negate;\nexport const op_LeftShift = LongLib.shiftLeft;\nexport const op_RightShift = LongLib.shiftRight;\nexport const op_RightShiftUnsigned = LongLib.shiftRightUnsigned;\nexport const op_BitwiseAnd = LongLib.and;\nexport const op_BitwiseOr = LongLib.or;\nexport const op_ExclusiveOr = LongLib.xor;\nexport const op_LogicalNot = LongLib.not;\nexport const op_LessThan = LongLib.lessThan;\nexport const op_LessThanOrEqual = LongLib.lessThanOrEqual;\nexport const op_GreaterThan = LongLib.greaterThan;\nexport const op_GreaterThanOrEqual = LongLib.greaterThanOrEqual;\nexport const op_Equality = LongLib.equals;\nexport const op_Inequality = LongLib.notEquals;\nexport const equals = LongLib.equals;\nexport const compare = LongLib.compare;\nexport const fromInt = LongLib.fromInt;\nexport const fromBits = LongLib.fromBits;\nexport const fromBytes = LongLib.fromBytes;\nexport const fromNumber = LongLib.fromNumber;\nexport const fromString = LongLib.fromString;\nexport const fromValue = LongLib.fromValue;\nexport const toInt = LongLib.toInt;\nexport const toBytes = LongLib.toBytes;\nexport const toNumber = LongLib.toNumber;\nexport const toString = LongLib.toString;\nexport const getLowBits = LongLib.getLowBits;\nexport const getHighBits = LongLib.getHighBits;\nexport const getLowBitsUnsigned = LongLib.getLowBitsUnsigned;\nexport const getHighBitsUnsigned = LongLib.getHighBitsUnsigned;\nfunction getMaxValue(unsigned, radix, isNegative) {\n switch (radix) {\n case 2: return unsigned ?\n \"1111111111111111111111111111111111111111111111111111111111111111\" :\n (isNegative ? \"1000000000000000000000000000000000000000000000000000000000000000\"\n : \"111111111111111111111111111111111111111111111111111111111111111\");\n case 8: return unsigned ?\n \"1777777777777777777777\" :\n (isNegative ? \"1000000000000000000000\" : \"777777777777777777777\");\n case 10: return unsigned ?\n \"18446744073709551615\" :\n (isNegative ? \"9223372036854775808\" : \"9223372036854775807\");\n case 16: return unsigned ?\n \"FFFFFFFFFFFFFFFF\" :\n (isNegative ? \"8000000000000000\" : \"7FFFFFFFFFFFFFFF\");\n default: throw new Error(\"Invalid radix.\");\n }\n}\nexport function abs(x) {\n if (!x.unsigned && LongLib.isNegative(x)) {\n return op_UnaryNegation(x);\n }\n else {\n return x;\n }\n}\nexport function fromInteger(value, unsigned, kind) {\n let x = value;\n let xh = 0;\n switch (kind) {\n case 0:\n x = value << 24 >> 24;\n xh = x;\n break;\n case 4:\n x = value << 24 >>> 24;\n break;\n case 1:\n x = value << 16 >> 16;\n xh = x;\n break;\n case 5:\n x = value << 16 >>> 16;\n break;\n case 2:\n x = value >> 0;\n xh = x;\n break;\n case 6:\n x = value >>> 0;\n break;\n }\n return LongLib.fromBits(x, xh >> 31, unsigned);\n}\nexport function parse(str, style, unsigned, _bitsize, radix) {\n const res = isValid(str, style, radix);\n if (res != null) {\n const lessOrEqual = (x, y) => {\n const len = Math.max(x.length, y.length);\n return x.padStart(len, \"0\") <= y.padStart(len, \"0\");\n };\n const isNegative = res.sign === \"-\";\n const maxValue = getMaxValue(unsigned || res.radix !== 10, res.radix, isNegative);\n if (lessOrEqual(res.digits.toUpperCase(), maxValue)) {\n str = isNegative ? res.sign + res.digits : res.digits;\n return LongLib.fromString(str, unsigned, res.radix);\n }\n }\n throw new Error(\"Input string was not in a correct format.\");\n}\nexport function tryParse(str, style, unsigned, bitsize, defValue) {\n try {\n defValue.contents = parse(str, style, unsigned, bitsize);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function unixEpochMillisecondsToTicks(ms, offset) {\n return op_Multiply(op_Addition(op_Addition(LongLib.fromNumber(ms), 62135596800000), offset), 10000);\n}\nexport function ticksToUnixEpochMilliseconds(ticks) {\n return LongLib.toNumber(op_Subtraction(op_Division(ticks, 10000), 62135596800000));\n}\n// export function makeRangeStepFunction(step: Long, last: Long, unsigned: boolean) {\n// const stepComparedWithZero = LongLib.compare(step, unsigned ? LongLib.UZERO : LongLib.ZERO);\n// if (stepComparedWithZero === 0) {\n// throw new Error(\"The step of a range cannot be zero\");\n// }\n// const stepGreaterThanZero = stepComparedWithZero > 0;\n// return (x: Long) => {\n// const comparedWithLast = LongLib.compare(x, last);\n// if ((stepGreaterThanZero && comparedWithLast <= 0)\n// || (!stepGreaterThanZero && comparedWithLast >= 0)) {\n// return [x, op_Addition(x, step)];\n// } else {\n// return undefined;\n// }\n// };\n// }\nexport function divRem(x, y, out) {\n const div = op_Division(x, y);\n const rem = op_Modulus(x, y);\n if (out != null) {\n out.contents = rem;\n return div;\n }\n else {\n return [div, rem];\n }\n}\n","import { record_type, bool_type, list_type, option_type, class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { singleton, ofArrayWithTail, head, tail, isEmpty as isEmpty_1, FSharpList, fold as fold_1, empty as empty_1, cons } from \"./List.js\";\r\nimport { map as map_2, fill } from \"./Array.js\";\r\nimport { structuralHash, compare, toIterator, equals, disposeSafe, getEnumerator, isArrayLike } from \"./Util.js\";\r\nimport { Record } from \"./Types.js\";\r\nimport { tryPick as tryPick_1, pick as pick_1, iterate as iterate_1, compareWith, map as map_1, unfold } from \"./Seq.js\";\r\nimport { format, join } from \"./String.js\";\r\nimport { LanguagePrimitives_FastGenericComparer } from \"./FSharp.Core.js\";\r\n\r\nexport class MapTreeLeaf$2 {\r\n constructor(k, v) {\r\n this.k = k;\r\n this.v = v;\r\n }\r\n}\r\n\r\nexport function MapTreeLeaf$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeLeaf`2\", [gen0, gen1], MapTreeLeaf$2);\r\n}\r\n\r\nexport function MapTreeLeaf$2_$ctor_5BDDA1(k, v) {\r\n return new MapTreeLeaf$2(k, v);\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Key(_) {\r\n return _.k;\r\n}\r\n\r\nexport function MapTreeLeaf$2__get_Value(_) {\r\n return _.v;\r\n}\r\n\r\nexport class MapTreeNode$2 extends MapTreeLeaf$2 {\r\n constructor(k, v, left, right, h) {\r\n super(k, v);\r\n this.left = left;\r\n this.right = right;\r\n this.h = (h | 0);\r\n }\r\n}\r\n\r\nexport function MapTreeNode$2$reflection(gen0, gen1) {\r\n return class_type(\"Map.MapTreeNode`2\", [gen0, gen1], MapTreeNode$2, MapTreeLeaf$2$reflection(gen0, gen1));\r\n}\r\n\r\nexport function MapTreeNode$2_$ctor_499A11FD(k, v, left, right, h) {\r\n return new MapTreeNode$2(k, v, left, right, h);\r\n}\r\n\r\nexport function MapTreeNode$2__get_Left(_) {\r\n return _.left;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Right(_) {\r\n return _.right;\r\n}\r\n\r\nexport function MapTreeNode$2__get_Height(_) {\r\n return _.h;\r\n}\r\n\r\nexport function MapTreeModule_empty() {\r\n return void 0;\r\n}\r\n\r\nexport function MapTreeModule_sizeAux(acc_mut, m_mut) {\r\n MapTreeModule_sizeAux:\r\n while (true) {\r\n const acc = acc_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n acc_mut = MapTreeModule_sizeAux(acc + 1, MapTreeNode$2__get_Left(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_sizeAux;\r\n }\r\n else {\r\n return (acc + 1) | 0;\r\n }\r\n }\r\n else {\r\n return acc | 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_size(x) {\r\n return MapTreeModule_sizeAux(0, x);\r\n}\r\n\r\nexport function MapTreeModule_mk(l, k, v, r) {\r\n let hl;\r\n const m = l;\r\n if (m != null) {\r\n const m2 = m;\r\n hl = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n hl = 0;\r\n }\r\n let hr;\r\n const m_1 = r;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n hr = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n hr = 0;\r\n }\r\n const m_2 = ((hl < hr) ? hr : hl) | 0;\r\n if (m_2 === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, l, r, m_2 + 1);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_rebalance(t1, k, v, t2) {\r\n let m_2, m2_2, m_3, m2_3;\r\n let t1h;\r\n const m = t1;\r\n if (m != null) {\r\n const m2 = m;\r\n t1h = ((m2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2) : 1);\r\n }\r\n else {\r\n t1h = 0;\r\n }\r\n let t2h;\r\n const m_1 = t2;\r\n if (m_1 != null) {\r\n const m2_1 = m_1;\r\n t2h = ((m2_1 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_1) : 1);\r\n }\r\n else {\r\n t2h = 0;\r\n }\r\n if (t2h > (t1h + 2)) {\r\n const matchValue = value_1(t2);\r\n if (matchValue instanceof MapTreeNode$2) {\r\n if (((m_2 = MapTreeNode$2__get_Left(matchValue), (m_2 != null) ? ((m2_2 = m_2, (m2_2 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_2) : 1)) : 0)) > (t1h + 1)) {\r\n const matchValue_1 = value_1(MapTreeNode$2__get_Left(matchValue));\r\n if (matchValue_1 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue_1)), MapTreeLeaf$2__get_Key(matchValue_1), MapTreeLeaf$2__get_Value(matchValue_1), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_1), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue)));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeModule_mk(t1, k, v, MapTreeNode$2__get_Left(matchValue)), MapTreeLeaf$2__get_Key(matchValue), MapTreeLeaf$2__get_Value(matchValue), MapTreeNode$2__get_Right(matchValue));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else if (t1h > (t2h + 2)) {\r\n const matchValue_2 = value_1(t1);\r\n if (matchValue_2 instanceof MapTreeNode$2) {\r\n if (((m_3 = MapTreeNode$2__get_Right(matchValue_2), (m_3 != null) ? ((m2_3 = m_3, (m2_3 instanceof MapTreeNode$2) ? MapTreeNode$2__get_Height(m2_3) : 1)) : 0)) > (t2h + 1)) {\r\n const matchValue_3 = value_1(MapTreeNode$2__get_Right(matchValue_2));\r\n if (matchValue_3 instanceof MapTreeNode$2) {\r\n return MapTreeModule_mk(MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeNode$2__get_Left(matchValue_3)), MapTreeLeaf$2__get_Key(matchValue_3), MapTreeLeaf$2__get_Value(matchValue_3), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_3), k, v, t2));\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(matchValue_2), MapTreeLeaf$2__get_Key(matchValue_2), MapTreeLeaf$2__get_Value(matchValue_2), MapTreeModule_mk(MapTreeNode$2__get_Right(matchValue_2), k, v, t2));\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.rebalance\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_mk(t1, k, v, t2);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_add(comparer, k, v, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_add(comparer, k, v, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c < 0) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, MapTreeModule_empty(), m, 2);\r\n }\r\n else if (c === 0) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n else {\r\n return MapTreeNode$2_$ctor_499A11FD(k, v, m, MapTreeModule_empty(), 2);\r\n }\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, v);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryFind(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_tryFind:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c === 0) {\r\n return some(MapTreeLeaf$2__get_Value(m2));\r\n }\r\n else if (m2 instanceof MapTreeNode$2) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = ((c < 0) ? MapTreeNode$2__get_Left(m2) : MapTreeNode$2__get_Right(m2));\r\n continue MapTreeModule_tryFind;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_find(comparer, k, m) {\r\n const matchValue = MapTreeModule_tryFind(comparer, k, m);\r\n if (matchValue == null) {\r\n throw (new Error());\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition1(comparer, f, k, v, acc1, acc2) {\r\n if (f(k, v)) {\r\n return [MapTreeModule_add(comparer, k, v, acc1), acc2];\r\n }\r\n else {\r\n return [acc1, MapTreeModule_add(comparer, k, v, acc2)];\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partitionAux(comparer_mut, f_mut, m_mut, acc_0_mut, acc_1_mut) {\r\n MapTreeModule_partitionAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc_0 = acc_0_mut, acc_1 = acc_1_mut;\r\n const acc = [acc_0, acc_1];\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_2 = MapTreeModule_partitionAux(comparer, f, MapTreeNode$2__get_Right(m2), acc[0], acc[1]);\r\n const acc_3 = MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_2[0], acc_2[1]);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n acc_0_mut = acc_3[0];\r\n acc_1_mut = acc_3[1];\r\n continue MapTreeModule_partitionAux;\r\n }\r\n else {\r\n return MapTreeModule_partition1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc[0], acc[1]);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_partition(comparer, f, m) {\r\n return MapTreeModule_partitionAux(comparer, f, m, MapTreeModule_empty(), MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_filter1(comparer, f, k, v, acc) {\r\n if (f(k, v)) {\r\n return MapTreeModule_add(comparer, k, v, acc);\r\n }\r\n else {\r\n return acc;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filterAux(comparer_mut, f_mut, m_mut, acc_mut) {\r\n MapTreeModule_filterAux:\r\n while (true) {\r\n const comparer = comparer_mut, f = f_mut, m = m_mut, acc = acc_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const acc_1 = MapTreeModule_filterAux(comparer, f, MapTreeNode$2__get_Left(m2), acc);\r\n const acc_2 = MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc_1);\r\n comparer_mut = comparer;\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n acc_mut = acc_2;\r\n continue MapTreeModule_filterAux;\r\n }\r\n else {\r\n return MapTreeModule_filter1(comparer, f, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_filter(comparer, f, m) {\r\n return MapTreeModule_filterAux(comparer, f, m, MapTreeModule_empty());\r\n}\r\n\r\nexport function MapTreeModule_spliceOutSuccessor(m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2)];\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Left(m2));\r\n return [patternInput[0], patternInput[1], MapTreeModule_mk(patternInput[2], MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2))];\r\n }\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_empty()];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"internal error: Map.spliceOutSuccessor\"));\r\n }\r\n}\r\n\r\nexport function MapTreeModule_remove(comparer, k, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_remove(comparer, k, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else if (c === 0) {\r\n return MapTreeModule_empty();\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_change(comparer, k, u, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c < 0) {\r\n return MapTreeModule_rebalance(MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeNode$2__get_Right(m2));\r\n }\r\n else if (c === 0) {\r\n const matchValue_1 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_1 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_1), MapTreeNode$2__get_Left(m2), MapTreeNode$2__get_Right(m2), MapTreeNode$2__get_Height(m2));\r\n }\r\n else if (MapTreeNode$2__get_Left(m2) == null) {\r\n return MapTreeNode$2__get_Right(m2);\r\n }\r\n else if (MapTreeNode$2__get_Right(m2) == null) {\r\n return MapTreeNode$2__get_Left(m2);\r\n }\r\n else {\r\n const patternInput = MapTreeModule_spliceOutSuccessor(MapTreeNode$2__get_Right(m2));\r\n return MapTreeModule_mk(MapTreeNode$2__get_Left(m2), patternInput[0], patternInput[1], patternInput[2]);\r\n }\r\n }\r\n else {\r\n return MapTreeModule_rebalance(MapTreeNode$2__get_Left(m2), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), MapTreeModule_change(comparer, k, u, MapTreeNode$2__get_Right(m2)));\r\n }\r\n }\r\n else {\r\n const c_1 = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (c_1 < 0) {\r\n const matchValue_2 = u(void 0);\r\n if (matchValue_2 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_2), MapTreeModule_empty(), m, 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n else if (c_1 === 0) {\r\n const matchValue_3 = u(some(MapTreeLeaf$2__get_Value(m2)));\r\n if (matchValue_3 != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue_3));\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n }\r\n else {\r\n const matchValue_4 = u(void 0);\r\n if (matchValue_4 != null) {\r\n return MapTreeNode$2_$ctor_499A11FD(k, value_1(matchValue_4), m, MapTreeModule_empty(), 2);\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const matchValue = u(void 0);\r\n if (matchValue != null) {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(k, value_1(matchValue));\r\n }\r\n else {\r\n return m;\r\n }\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mem(comparer_mut, k_mut, m_mut) {\r\n MapTreeModule_mem:\r\n while (true) {\r\n const comparer = comparer_mut, k = k_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n const c = comparer.Compare(k, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (c < 0) {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n else if (c === 0) {\r\n return true;\r\n }\r\n else {\r\n comparer_mut = comparer;\r\n k_mut = k;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_mem;\r\n }\r\n }\r\n else {\r\n return c === 0;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iterOpt(f_mut, m_mut) {\r\n MapTreeModule_iterOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n MapTreeModule_iterOpt(f, MapTreeNode$2__get_Left(m2));\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_iterOpt;\r\n }\r\n else {\r\n f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_iter(f, m) {\r\n MapTreeModule_iterOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_tryPickOpt(f_mut, m_mut) {\r\n MapTreeModule_tryPickOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const matchValue = MapTreeModule_tryPickOpt(f, MapTreeNode$2__get_Left(m2));\r\n if (matchValue == null) {\r\n const matchValue_1 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n if (matchValue_1 == null) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_tryPickOpt;\r\n }\r\n else {\r\n return matchValue_1;\r\n }\r\n }\r\n else {\r\n return matchValue;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_tryPick(f, m) {\r\n return MapTreeModule_tryPickOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_existsOpt(f_mut, m_mut) {\r\n MapTreeModule_existsOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_existsOpt(f, MapTreeNode$2__get_Left(m2)) ? true : f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n return true;\r\n }\r\n else {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_existsOpt;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_exists(f, m) {\r\n return MapTreeModule_existsOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_forallOpt(f_mut, m_mut) {\r\n MapTreeModule_forallOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n if (MapTreeModule_forallOpt(f, MapTreeNode$2__get_Left(m2)) && f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2))) {\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_forallOpt;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return true;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_forall(f, m) {\r\n return MapTreeModule_forallOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_map(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_map(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_map(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapiOpt(f, m) {\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const l2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Left(m2));\r\n const v2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n const r2 = MapTreeModule_mapiOpt(f, MapTreeNode$2__get_Right(m2));\r\n return MapTreeNode$2_$ctor_499A11FD(MapTreeLeaf$2__get_Key(m2), v2, l2, r2, MapTreeNode$2__get_Height(m2));\r\n }\r\n else {\r\n return MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_empty();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mapi(f, m) {\r\n return MapTreeModule_mapiOpt(f, m);\r\n}\r\n\r\nexport function MapTreeModule_foldBackOpt(f_mut, m_mut, x_mut) {\r\n MapTreeModule_foldBackOpt:\r\n while (true) {\r\n const f = f_mut, m = m_mut, x = x_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const x_1 = MapTreeModule_foldBackOpt(f, MapTreeNode$2__get_Right(m2), x);\r\n const x_2 = f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n f_mut = f;\r\n m_mut = MapTreeNode$2__get_Left(m2);\r\n x_mut = x_2;\r\n continue MapTreeModule_foldBackOpt;\r\n }\r\n else {\r\n return f(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x);\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldBack(f, m, x) {\r\n return MapTreeModule_foldBackOpt(f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_foldOpt(f_mut, x_mut, m_mut) {\r\n MapTreeModule_foldOpt:\r\n while (true) {\r\n const f = f_mut, x = x_mut, m = m_mut;\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n f_mut = f;\r\n x_mut = f(MapTreeModule_foldOpt(f, x, MapTreeNode$2__get_Left(m2)), MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n m_mut = MapTreeNode$2__get_Right(m2);\r\n continue MapTreeModule_foldOpt;\r\n }\r\n else {\r\n return f(x, MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2));\r\n }\r\n }\r\n else {\r\n return x;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_fold(f, x, m) {\r\n return MapTreeModule_foldOpt(f, x, m);\r\n}\r\n\r\nexport function MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x) {\r\n const foldFromTo = (f_1_mut, m_1_mut, x_1_mut) => {\r\n foldFromTo:\r\n while (true) {\r\n const f_1 = f_1_mut, m_1 = m_1_mut, x_1 = x_1_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n const cLoKey = comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) | 0;\r\n const cKeyHi = comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) | 0;\r\n const x_2 = (cLoKey < 0) ? foldFromTo(f_1, MapTreeNode$2__get_Left(m2), x_1) : x_1;\r\n const x_3 = ((cLoKey <= 0) && (cKeyHi <= 0)) ? f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_2) : x_2;\r\n if (cKeyHi < 0) {\r\n f_1_mut = f_1;\r\n m_1_mut = MapTreeNode$2__get_Right(m2);\r\n x_1_mut = x_3;\r\n continue foldFromTo;\r\n }\r\n else {\r\n return x_3;\r\n }\r\n }\r\n else if ((comparer.Compare(lo, MapTreeLeaf$2__get_Key(m2)) <= 0) && (comparer.Compare(MapTreeLeaf$2__get_Key(m2), hi) <= 0)) {\r\n return f_1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2), x_1);\r\n }\r\n else {\r\n return x_1;\r\n }\r\n }\r\n else {\r\n return x_1;\r\n }\r\n break;\r\n }\r\n };\r\n if (comparer.Compare(lo, hi) === 1) {\r\n return x;\r\n }\r\n else {\r\n return foldFromTo(f, m, x);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_foldSection(comparer, lo, hi, f, m, x) {\r\n return MapTreeModule_foldSectionOpt(comparer, lo, hi, f, m, x);\r\n}\r\n\r\nexport function MapTreeModule_toList(m) {\r\n const loop = (m_1_mut, acc_mut) => {\r\n loop:\r\n while (true) {\r\n const m_1 = m_1_mut, acc = acc_mut;\r\n if (m_1 != null) {\r\n const m2 = m_1;\r\n if (m2 instanceof MapTreeNode$2) {\r\n m_1_mut = MapTreeNode$2__get_Left(m2);\r\n acc_mut = cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], loop(MapTreeNode$2__get_Right(m2), acc));\r\n continue loop;\r\n }\r\n else {\r\n return cons([MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)], acc);\r\n }\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(m, empty_1());\r\n}\r\n\r\nexport function MapTreeModule_copyToArray(m, arr, i) {\r\n let j = i;\r\n MapTreeModule_iter((x, y) => {\r\n arr[j] = [x, y];\r\n j = ((j + 1) | 0);\r\n }, m);\r\n}\r\n\r\nexport function MapTreeModule_toArray(m) {\r\n const n = MapTreeModule_size(m) | 0;\r\n const res = fill(new Array(n), 0, n, [null, null]);\r\n MapTreeModule_copyToArray(m, res, 0);\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofList(comparer, l) {\r\n return fold_1((acc, tupledArg) => MapTreeModule_add(comparer, tupledArg[0], tupledArg[1], acc), MapTreeModule_empty(), l);\r\n}\r\n\r\nexport function MapTreeModule_mkFromEnumerator(comparer_mut, acc_mut, e_mut) {\r\n MapTreeModule_mkFromEnumerator:\r\n while (true) {\r\n const comparer = comparer_mut, acc = acc_mut, e = e_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const patternInput = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n comparer_mut = comparer;\r\n acc_mut = MapTreeModule_add(comparer, patternInput[0], patternInput[1], acc);\r\n e_mut = e;\r\n continue MapTreeModule_mkFromEnumerator;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_ofArray(comparer, arr) {\r\n let res = MapTreeModule_empty();\r\n for (let idx = 0; idx <= (arr.length - 1); idx++) {\r\n const forLoopVar = arr[idx];\r\n res = MapTreeModule_add(comparer, forLoopVar[0], forLoopVar[1], res);\r\n }\r\n return res;\r\n}\r\n\r\nexport function MapTreeModule_ofSeq(comparer, c) {\r\n if (isArrayLike(c)) {\r\n return MapTreeModule_ofArray(comparer, c);\r\n }\r\n else if (c instanceof FSharpList) {\r\n return MapTreeModule_ofList(comparer, c);\r\n }\r\n else {\r\n const ie = getEnumerator(c);\r\n try {\r\n return MapTreeModule_mkFromEnumerator(comparer, MapTreeModule_empty(), ie);\r\n }\r\n finally {\r\n disposeSafe(ie);\r\n }\r\n }\r\n}\r\n\r\nexport class MapTreeModule_MapIterator$2 extends Record {\r\n constructor(stack, started) {\r\n super();\r\n this.stack = stack;\r\n this.started = started;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_MapIterator$2$reflection(gen0, gen1) {\r\n return record_type(\"Map.MapTreeModule.MapIterator`2\", [gen0, gen1], MapTreeModule_MapIterator$2, () => [[\"stack\", list_type(option_type(MapTreeLeaf$2$reflection(gen0, gen1)))], [\"started\", bool_type]]);\r\n}\r\n\r\nexport function MapTreeModule_collapseLHS(stack_mut) {\r\n MapTreeModule_collapseLHS:\r\n while (true) {\r\n const stack = stack_mut;\r\n if (!isEmpty_1(stack)) {\r\n const rest = tail(stack);\r\n const m = head(stack);\r\n if (m != null) {\r\n const m2 = m;\r\n if (m2 instanceof MapTreeNode$2) {\r\n stack_mut = ofArrayWithTail([MapTreeNode$2__get_Left(m2), MapTreeLeaf$2_$ctor_5BDDA1(MapTreeLeaf$2__get_Key(m2), MapTreeLeaf$2__get_Value(m2)), MapTreeNode$2__get_Right(m2)], rest);\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n else {\r\n return stack;\r\n }\r\n }\r\n else {\r\n stack_mut = rest;\r\n continue MapTreeModule_collapseLHS;\r\n }\r\n }\r\n else {\r\n return empty_1();\r\n }\r\n break;\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIterator(m) {\r\n return new MapTreeModule_MapIterator$2(MapTreeModule_collapseLHS(singleton(m)), false);\r\n}\r\n\r\nexport function MapTreeModule_notStarted() {\r\n throw (new Error(\"enumeration not started\"));\r\n}\r\n\r\nexport function MapTreeModule_alreadyFinished() {\r\n throw (new Error(\"enumeration already finished\"));\r\n}\r\n\r\nexport function MapTreeModule_current(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n else {\r\n return [MapTreeLeaf$2__get_Key(m), MapTreeLeaf$2__get_Value(m)];\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for current\"));\r\n }\r\n }\r\n else {\r\n return MapTreeModule_alreadyFinished();\r\n }\r\n }\r\n else {\r\n return MapTreeModule_notStarted();\r\n }\r\n}\r\n\r\nexport function MapTreeModule_moveNext(i) {\r\n if (i.started) {\r\n const matchValue = i.stack;\r\n if (!isEmpty_1(matchValue)) {\r\n if (head(matchValue) != null) {\r\n const m = head(matchValue);\r\n if (m instanceof MapTreeNode$2) {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n else {\r\n i.stack = MapTreeModule_collapseLHS(tail(matchValue));\r\n return !isEmpty_1(i.stack);\r\n }\r\n }\r\n else {\r\n throw (new Error(\"Please report error: Map iterator, unexpected stack for moveNext\"));\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else {\r\n i.started = true;\r\n return !isEmpty_1(i.stack);\r\n }\r\n}\r\n\r\nexport function MapTreeModule_mkIEnumerator(m) {\r\n let i = MapTreeModule_mkIterator(m);\r\n return {\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n return MapTreeModule_current(i);\r\n },\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n return MapTreeModule_moveNext(i);\r\n },\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n i = MapTreeModule_mkIterator(m);\r\n },\r\n Dispose() {\r\n },\r\n };\r\n}\r\n\r\nexport function MapTreeModule_toSeq(s) {\r\n return unfold((en_1) => {\r\n if (en_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return [en_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), en_1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, MapTreeModule_mkIEnumerator(s));\r\n}\r\n\r\nexport class FSharpMap {\r\n constructor(comparer, tree) {\r\n this.comparer = comparer;\r\n this.tree = tree;\r\n }\r\n GetHashCode() {\r\n const this$ = this;\r\n return FSharpMap__ComputeHashCode(this$) | 0;\r\n }\r\n Equals(that) {\r\n const this$ = this;\r\n if (that instanceof FSharpMap) {\r\n const e1 = getEnumerator(this$);\r\n try {\r\n const e2 = getEnumerator(that);\r\n try {\r\n const loop = () => {\r\n const m1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n if (m1 === e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (!m1) {\r\n return true;\r\n }\r\n else {\r\n const e1c = e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n const e2c = e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (equals(e1c[0], e2c[0]) && equals(e1c[1], e2c[1])) {\r\n return loop();\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n };\r\n return loop();\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n toString() {\r\n const this$ = this;\r\n return (\"map [\" + join(\"; \", map_1((kv) => format(\"({0}, {1})\", kv[0], kv[1]), this$))) + \"]\";\r\n }\r\n get [Symbol.toStringTag]() {\r\n return \"FSharpMap\";\r\n }\r\n toJSON(_key) {\r\n const this$ = this;\r\n return Array.from(this$);\r\n }\r\n GetEnumerator() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const __ = this;\r\n return MapTreeModule_mkIEnumerator(__.tree);\r\n }\r\n CompareTo(obj) {\r\n const m = this;\r\n if (obj instanceof FSharpMap) {\r\n return compareWith((kvp1, kvp2) => {\r\n const c = m.comparer.Compare(kvp1[0], kvp2[0]) | 0;\r\n return ((c !== 0) ? c : compare(kvp1[1], kvp2[1])) | 0;\r\n }, m, obj) | 0;\r\n }\r\n else {\r\n throw (new Error(\"not comparable\\\\nParameter name: obj\"));\r\n }\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Add2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Clear\"]() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Remove2B595\"](x) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n [\"System.Collections.Generic.ICollection`1.Contains2B595\"](x) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, x[0]) && equals(FSharpMap__get_Item(m, x[0]), x[1]);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.CopyToZ2E171D71\"](arr, i) {\r\n const m = this;\r\n MapTreeModule_copyToArray(m.tree, arr, i);\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_IsReadOnly\"]() {\r\n return true;\r\n }\r\n [\"System.Collections.Generic.ICollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n [\"System.Collections.Generic.IReadOnlyCollection`1.get_Count\"]() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n get size() {\r\n const m = this;\r\n return FSharpMap__get_Count(m) | 0;\r\n }\r\n clear() {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n }\r\n delete(_arg1) {\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return false;\r\n }\r\n entries() {\r\n const m = this;\r\n return map_1((p) => [p[0], p[1]], m);\r\n }\r\n get(k) {\r\n const m = this;\r\n return FSharpMap__get_Item(m, k);\r\n }\r\n has(k) {\r\n const m = this;\r\n return FSharpMap__ContainsKey(m, k);\r\n }\r\n keys() {\r\n const m = this;\r\n return map_1((p) => p[0], m);\r\n }\r\n set(k, v) {\r\n const m = this;\r\n throw (new Error(\"Map cannot be mutated\"));\r\n return m;\r\n }\r\n values() {\r\n const m = this;\r\n return map_1((p) => p[1], m);\r\n }\r\n forEach(f, thisArg) {\r\n const m = this;\r\n iterate_1((p) => {\r\n f(p[1], p[0], m);\r\n }, m);\r\n }\r\n}\r\n\r\nexport function FSharpMap$reflection(gen0, gen1) {\r\n return class_type(\"Map.FSharpMap\", [gen0, gen1], FSharpMap);\r\n}\r\n\r\nexport function FSharpMap_$ctor(comparer, tree) {\r\n return new FSharpMap(comparer, tree);\r\n}\r\n\r\n(() => {\r\n FSharpMap.empty = FSharpMap_$ctor(LanguagePrimitives_FastGenericComparer(), MapTreeModule_empty());\r\n})();\r\n\r\nexport function FSharpMap_get_Empty() {\r\n return FSharpMap.empty;\r\n}\r\n\r\nexport function FSharpMap_Create(ie) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofSeq(comparer, ie));\r\n}\r\n\r\nexport function FSharpMap__get_Comparer(m) {\r\n return m.comparer;\r\n}\r\n\r\nexport function FSharpMap__get_Tree(m) {\r\n return m.tree;\r\n}\r\n\r\nexport function FSharpMap__Add(m, key, value) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_add(m.comparer, key, value, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Change(m, key, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_change(m.comparer, key, f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__get_IsEmpty(m) {\r\n return m.tree == null;\r\n}\r\n\r\nexport function FSharpMap__get_Item(m, key) {\r\n return MapTreeModule_find(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__TryPick(m, f) {\r\n return MapTreeModule_tryPick(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Exists(m, predicate) {\r\n return MapTreeModule_exists(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Filter(m, predicate) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_filter(m.comparer, predicate, m.tree));\r\n}\r\n\r\nexport function FSharpMap__ForAll(m, predicate) {\r\n return MapTreeModule_forall(predicate, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Fold(m, f, acc) {\r\n return MapTreeModule_foldBack(f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__FoldSection(m, lo, hi, f, acc) {\r\n return MapTreeModule_foldSection(m.comparer, lo, hi, f, m.tree, acc);\r\n}\r\n\r\nexport function FSharpMap__Iterate(m, f) {\r\n MapTreeModule_iter(f, m.tree);\r\n}\r\n\r\nexport function FSharpMap__MapRange(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_map(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Map(m, f) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_mapi(f, m.tree));\r\n}\r\n\r\nexport function FSharpMap__Partition(m, predicate) {\r\n const patternInput = MapTreeModule_partition(m.comparer, predicate, m.tree);\r\n return [FSharpMap_$ctor(m.comparer, patternInput[0]), FSharpMap_$ctor(m.comparer, patternInput[1])];\r\n}\r\n\r\nexport function FSharpMap__get_Count(m) {\r\n return MapTreeModule_size(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ContainsKey(m, key) {\r\n return MapTreeModule_mem(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__Remove(m, key) {\r\n return FSharpMap_$ctor(m.comparer, MapTreeModule_remove(m.comparer, key, m.tree));\r\n}\r\n\r\nexport function FSharpMap__TryGetValue(__, key, value) {\r\n const matchValue = MapTreeModule_tryFind(__.comparer, key, __.tree);\r\n if (matchValue == null) {\r\n return false;\r\n }\r\n else {\r\n const v = value_1(matchValue);\r\n value.contents = v;\r\n return true;\r\n }\r\n}\r\n\r\nexport function FSharpMap__get_Keys(__) {\r\n return map_2((kvp) => kvp[0], MapTreeModule_toArray(__.tree));\r\n}\r\n\r\nexport function FSharpMap__get_Values(__) {\r\n return map_2((kvp) => kvp[1], MapTreeModule_toArray(__.tree));\r\n}\r\n\r\nexport function FSharpMap__TryFind(m, key) {\r\n return MapTreeModule_tryFind(m.comparer, key, m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToList(m) {\r\n return MapTreeModule_toList(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ToArray(m) {\r\n return MapTreeModule_toArray(m.tree);\r\n}\r\n\r\nexport function FSharpMap__ComputeHashCode(this$) {\r\n const combineHash = (x, y) => (((x << 1) + y) + 631);\r\n let res = 0;\r\n const enumerator = getEnumerator(this$);\r\n try {\r\n while (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const activePatternResult8263 = enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n res = (combineHash(res, structuralHash(activePatternResult8263[0])) | 0);\r\n res = (combineHash(res, structuralHash(activePatternResult8263[1])) | 0);\r\n }\r\n }\r\n finally {\r\n disposeSafe(enumerator);\r\n }\r\n return res | 0;\r\n}\r\n\r\nexport function isEmpty(table) {\r\n return FSharpMap__get_IsEmpty(table);\r\n}\r\n\r\nexport function add(key, value, table) {\r\n return FSharpMap__Add(table, key, value);\r\n}\r\n\r\nexport function change(key, f, table) {\r\n return FSharpMap__Change(table, key, f);\r\n}\r\n\r\nexport function find(key, table) {\r\n return FSharpMap__get_Item(table, key);\r\n}\r\n\r\nexport function tryFind(key, table) {\r\n return FSharpMap__TryFind(table, key);\r\n}\r\n\r\nexport function remove(key, table) {\r\n return FSharpMap__Remove(table, key);\r\n}\r\n\r\nexport function containsKey(key, table) {\r\n return FSharpMap__ContainsKey(table, key);\r\n}\r\n\r\nexport function iterate(action, table) {\r\n FSharpMap__Iterate(table, action);\r\n}\r\n\r\nexport function tryPick(chooser, table) {\r\n return FSharpMap__TryPick(table, chooser);\r\n}\r\n\r\nexport function pick(chooser, table) {\r\n const matchValue = tryPick(chooser, table);\r\n if (matchValue != null) {\r\n return value_1(matchValue);\r\n }\r\n else {\r\n throw (new Error());\r\n }\r\n}\r\n\r\nexport function exists(predicate, table) {\r\n return FSharpMap__Exists(table, predicate);\r\n}\r\n\r\nexport function filter(predicate, table) {\r\n return FSharpMap__Filter(table, predicate);\r\n}\r\n\r\nexport function partition(predicate, table) {\r\n return FSharpMap__Partition(table, predicate);\r\n}\r\n\r\nexport function forAll(predicate, table) {\r\n return FSharpMap__ForAll(table, predicate);\r\n}\r\n\r\nexport function map(mapping, table) {\r\n return FSharpMap__Map(table, mapping);\r\n}\r\n\r\nexport function fold(folder, state, table) {\r\n return MapTreeModule_fold(folder, state, FSharpMap__get_Tree(table));\r\n}\r\n\r\nexport function foldBack(folder, table, state) {\r\n return MapTreeModule_foldBack(folder, FSharpMap__get_Tree(table), state);\r\n}\r\n\r\nexport function toSeq(table) {\r\n return map_1((kvp) => [kvp[0], kvp[1]], table);\r\n}\r\n\r\nexport function findKey(predicate, table) {\r\n return pick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function tryFindKey(predicate, table) {\r\n return tryPick_1((kvp) => {\r\n const k = kvp[0];\r\n if (predicate(k, kvp[1])) {\r\n return some(k);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, table);\r\n}\r\n\r\nexport function ofList(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofSeq(elements) {\r\n return FSharpMap_Create(elements);\r\n}\r\n\r\nexport function ofArray(elements) {\r\n const comparer = LanguagePrimitives_FastGenericComparer();\r\n return FSharpMap_$ctor(comparer, MapTreeModule_ofArray(comparer, elements));\r\n}\r\n\r\nexport function toList(table) {\r\n return FSharpMap__ToList(table);\r\n}\r\n\r\nexport function toArray(table) {\r\n return FSharpMap__ToArray(table);\r\n}\r\n\r\nexport function keys(table) {\r\n return FSharpMap__get_Keys(table);\r\n}\r\n\r\nexport function values(table) {\r\n return FSharpMap__get_Values(table);\r\n}\r\n\r\nexport function empty() {\r\n return FSharpMap_get_Empty();\r\n}\r\n\r\nexport function count(table) {\r\n return FSharpMap__get_Count(table);\r\n}\r\n\r\n","export const symbol = Symbol(\"numeric\");\nexport function isNumeric(x) {\n return typeof x === \"number\" || (x === null || x === void 0 ? void 0 : x[symbol]);\n}\nexport function compare(x, y) {\n if (typeof x === \"number\") {\n return x < y ? -1 : (x > y ? 1 : 0);\n }\n else {\n return x.CompareTo(y);\n }\n}\nexport function multiply(x, y) {\n if (typeof x === \"number\") {\n return x * y;\n }\n else {\n return x[symbol]().multiply(y);\n }\n}\nexport function toFixed(x, dp) {\n if (typeof x === \"number\") {\n return x.toFixed(dp);\n }\n else {\n return x[symbol]().toFixed(dp);\n }\n}\nexport function toPrecision(x, sd) {\n if (typeof x === \"number\") {\n return x.toPrecision(sd);\n }\n else {\n return x[symbol]().toPrecision(sd);\n }\n}\nexport function toExponential(x, dp) {\n if (typeof x === \"number\") {\n return x.toExponential(dp);\n }\n else {\n return x[symbol]().toExponential(dp);\n }\n}\nexport function toHex(x) {\n if (typeof x === \"number\") {\n return (Number(x) >>> 0).toString(16);\n }\n else {\n return x[symbol]().toHex();\n }\n}\n","import { compare, equals, structuralHash } from \"./Util.js\";\n// Using a class here for better compatibility with TS files importing Some\nexport class Some {\n constructor(value) {\n this.value = value;\n }\n toJSON() {\n return this.value;\n }\n // Don't add \"Some\" for consistency with erased options\n toString() {\n return String(this.value);\n }\n GetHashCode() {\n return structuralHash(this.value);\n }\n Equals(other) {\n if (other == null) {\n return false;\n }\n else {\n return equals(this.value, other instanceof Some ? other.value : other);\n }\n }\n CompareTo(other) {\n if (other == null) {\n return 1;\n }\n else {\n return compare(this.value, other instanceof Some ? other.value : other);\n }\n }\n}\nexport function some(x) {\n return x == null || x instanceof Some ? new Some(x) : x;\n}\nexport function value(x) {\n if (x == null) {\n throw new Error(\"Option has no value\");\n }\n else {\n return x instanceof Some ? x.value : x;\n }\n}\nexport function ofNullable(x) {\n // This will fail with unit probably, an alternative would be:\n // return x === null ? undefined : (x === undefined ? new Some(x) : x);\n return x == null ? undefined : x;\n}\nexport function toNullable(x) {\n return x == null ? null : value(x);\n}\nexport function flatten(x) {\n return x == null ? undefined : value(x);\n}\nexport function toArray(opt) {\n return (opt == null) ? [] : [value(opt)];\n}\nexport function defaultArg(opt, defaultValue) {\n return (opt != null) ? value(opt) : defaultValue;\n}\nexport function defaultArgWith(opt, defThunk) {\n return (opt != null) ? value(opt) : defThunk();\n}\nexport function filter(predicate, opt) {\n return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt;\n}\nexport function map(mapping, opt) {\n return (opt != null) ? some(mapping(value(opt))) : undefined;\n}\nexport function map2(mapping, opt1, opt2) {\n return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined;\n}\nexport function map3(mapping, opt1, opt2, opt3) {\n return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined;\n}\nexport function bind(binder, opt) {\n return opt != null ? binder(value(opt)) : undefined;\n}\nexport function tryOp(op, arg) {\n try {\n return some(op(arg));\n }\n catch (_a) {\n return undefined;\n }\n}\n","import { class_type } from \"./Reflection.js\";\r\nimport { fromNumber, op_Addition, toInt, toNumber, compare, fromInteger } from \"./Long.js\";\r\n\r\nfunction Native_random() {\r\n return Math.random();\r\n}\r\n\r\nfunction Native_randomNext(min, max) {\r\n \n if (max < min) {\n throw new Error(\"minValue must be less than maxValue\");\n }\n return Math.floor(Math.random() * (max - min)) + min\n ;\r\n}\r\n\r\nfunction Native_randomBytes(buffer) {\r\n \n if (buffer == null) {\n throw new Error(\"Buffer cannot be null\");\n }\n for (let i = 0; i < buffer.length; i += 6) {\n // Pick random 48-bit number. Fill buffer in 2 24-bit chunks to avoid bitwise truncation.\n let r = Math.floor(Math.random() * 281474976710656); // Low 24 bits = chunk 1.\n const rhi = Math.floor(r / 16777216); // High 24 bits shifted via division = chunk 2.\n for (let j = 0; j < 6 && i + j < buffer.length; j++) {\n if (j === 3) { r = rhi; }\n buffer[i + j] = r & 255;\n r >>>= 8;\n }\n };\r\n}\r\n\r\nexport class NonSeeded {\r\n constructor() {\r\n }\r\n Next0() {\r\n return Native_randomNext(0, 2147483647);\r\n }\r\n Next1(maxValue) {\r\n return Native_randomNext(0, maxValue);\r\n }\r\n Next2(minValue, maxValue) {\r\n return Native_randomNext(minValue, maxValue);\r\n }\r\n NextDouble() {\r\n return Native_random();\r\n }\r\n NextBytes(buffer) {\r\n Native_randomBytes(buffer);\r\n }\r\n}\r\n\r\nexport function NonSeeded$reflection() {\r\n return class_type(\"Random.NonSeeded\", void 0, NonSeeded);\r\n}\r\n\r\nexport function NonSeeded_$ctor() {\r\n return new NonSeeded();\r\n}\r\n\r\nexport class Seeded {\r\n constructor(seed) {\r\n this.MBIG = 2147483647;\r\n this.inext = 0;\r\n this.inextp = 0;\r\n this.seedArray = (new Int32Array(56));\r\n let ii = 0;\r\n let mj = 0;\r\n let mk = 0;\r\n const subtraction = ((seed === -2147483648) ? 2147483647 : Math.abs(seed)) | 0;\r\n mj = ((161803398 - subtraction) | 0);\r\n this.seedArray[55] = (mj | 0);\r\n mk = 1;\r\n for (let i = 1; i <= 54; i++) {\r\n ii = (((21 * i) % 55) | 0);\r\n this.seedArray[ii] = (mk | 0);\r\n mk = ((mj - mk) | 0);\r\n if (mk < 0) {\r\n mk = ((mk + this.MBIG) | 0);\r\n }\r\n mj = (this.seedArray[ii] | 0);\r\n }\r\n for (let k = 1; k <= 4; k++) {\r\n for (let i_1 = 1; i_1 <= 55; i_1++) {\r\n this.seedArray[i_1] = ((this.seedArray[i_1] - this.seedArray[1 + ((i_1 + 30) % 55)]) | 0);\r\n if (this.seedArray[i_1] < 0) {\r\n this.seedArray[i_1] = ((this.seedArray[i_1] + this.MBIG) | 0);\r\n }\r\n }\r\n }\r\n this.inext = 0;\r\n this.inextp = 21;\r\n }\r\n Next0() {\r\n const this$ = this;\r\n return Seeded__InternalSample(this$) | 0;\r\n }\r\n Next1(maxValue) {\r\n const this$ = this;\r\n if (maxValue < 0) {\r\n const exn = new Error(\"maxValue\", \"maxValue must be positive\");\r\n throw exn;\r\n }\r\n return (~(~(Seeded__Sample(this$) * maxValue))) | 0;\r\n }\r\n Next2(minValue, maxValue) {\r\n const this$ = this;\r\n if (minValue > maxValue) {\r\n const exn = new Error(\"minValue\", \"minValue must be less than maxValue\");\r\n throw exn;\r\n }\r\n const range = fromInteger(maxValue - minValue, false, 2);\r\n return ((compare(range, fromInteger(2147483647, false, 2)) <= 0) ? ((~(~(Seeded__Sample(this$) * toNumber(range)))) + minValue) : (~(~toInt(op_Addition(fromNumber(Seeded__GetSampleForLargeRange(this$) * toNumber(range), false), fromInteger(minValue, false, 2)))))) | 0;\r\n }\r\n NextDouble() {\r\n const this$ = this;\r\n return Seeded__Sample(this$);\r\n }\r\n NextBytes(buffer) {\r\n const this$ = this;\r\n if (buffer == null) {\r\n const exn = new Error(\"buffer\");\r\n throw exn;\r\n }\r\n for (let i = 0; i <= (buffer.length - 1); i++) {\r\n buffer[i] = ((Seeded__InternalSample(this$) % ((~(~255)) + 1)) & 0xFF);\r\n }\r\n }\r\n}\r\n\r\nexport function Seeded$reflection() {\r\n return class_type(\"Random.Seeded\", void 0, Seeded);\r\n}\r\n\r\nexport function Seeded_$ctor_Z524259A4(seed) {\r\n return new Seeded(seed);\r\n}\r\n\r\nfunction Seeded__InternalSample(_) {\r\n let retVal = 0;\r\n let locINext = _.inext;\r\n let locINextp = _.inextp;\r\n locINext = ((locINext + 1) | 0);\r\n if (locINext >= 56) {\r\n locINext = 1;\r\n }\r\n locINextp = ((locINextp + 1) | 0);\r\n if (locINextp >= 56) {\r\n locINextp = 1;\r\n }\r\n retVal = ((_.seedArray[locINext] - _.seedArray[locINextp]) | 0);\r\n if (retVal === _.MBIG) {\r\n retVal = ((retVal - 1) | 0);\r\n }\r\n if (retVal < 0) {\r\n retVal = ((retVal + _.MBIG) | 0);\r\n }\r\n _.seedArray[locINext] = (retVal | 0);\r\n _.inext = (locINext | 0);\r\n _.inextp = (locINextp | 0);\r\n return retVal | 0;\r\n}\r\n\r\nexport function Seeded__Sample(this$) {\r\n return Seeded__InternalSample(this$) * (1 / this$.MBIG);\r\n}\r\n\r\nexport function Seeded__GetSampleForLargeRange(this$) {\r\n let result = Seeded__InternalSample(this$);\r\n if ((Seeded__InternalSample(this$) % 2) === 0) {\r\n result = (-result);\r\n }\r\n let d = result;\r\n d = (d + (2147483647 - 1));\r\n d = (d / (2 * ((2147483647 - 1) >>> 0)));\r\n return d;\r\n}\r\n\r\nexport function nonSeeded() {\r\n return NonSeeded_$ctor();\r\n}\r\n\r\nexport function seeded(seed) {\r\n return Seeded_$ctor_Z524259A4(seed);\r\n}\r\n\r\n","import { compare } from \"./Util.js\";\r\nimport { unfold, delay } from \"./Seq.js\";\r\nimport { op_Addition, fromZero } from \"./BigInt.js\";\r\nimport { op_Addition as op_Addition_1, fromParts } from \"./Decimal.js\";\r\nimport { op_Addition as op_Addition_2, fromBits } from \"./Long.js\";\r\n\r\nexport function makeRangeStepFunction(step, stop, zero, add) {\r\n const stepComparedWithZero = compare(step, zero) | 0;\r\n if (stepComparedWithZero === 0) {\r\n throw (new Error(\"The step of a range cannot be zero\"));\r\n }\r\n const stepGreaterThanZero = stepComparedWithZero > 0;\r\n return (x) => {\r\n const comparedWithLast = compare(x, stop) | 0;\r\n return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : ((!stepGreaterThanZero) && (comparedWithLast >= 0))) ? [x, add(x, step)] : (void 0);\r\n };\r\n}\r\n\r\nexport function integralRangeStep(start, step, stop, zero, add) {\r\n const stepFn = makeRangeStepFunction(step, stop, zero, add);\r\n return delay(() => unfold(stepFn, start));\r\n}\r\n\r\nexport function rangeBigInt(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromZero(), op_Addition);\r\n}\r\n\r\nexport function rangeDecimal(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromParts(0, 0, 0, false, 0), op_Addition_1);\r\n}\r\n\r\nexport function rangeDouble(start, step, stop) {\r\n return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));\r\n}\r\n\r\nexport function rangeInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, false), op_Addition_2);\r\n}\r\n\r\nexport function rangeUInt64(start, step, stop) {\r\n return integralRangeStep(start, step, stop, fromBits(0, 0, true), op_Addition_2);\r\n}\r\n\r\nexport function rangeChar(start, stop) {\r\n const intStop = stop.charCodeAt(0) | 0;\r\n return delay(() => unfold((c) => {\r\n if (c <= intStop) {\r\n return [String.fromCharCode(c), c + 1];\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, start.charCodeAt(0)));\r\n}\r\n\r\n","import { Record, Union } from \"./Types.js\";\nimport { combineHashCodes, equalArraysWith, stringHash } from \"./Util.js\";\nimport Decimal from \"./Decimal.js\";\nimport { fromInt as int64FromInt } from \"./Long.js\";\nexport class CaseInfo {\n constructor(declaringType, tag, name, fields) {\n this.declaringType = declaringType;\n this.tag = tag;\n this.name = name;\n this.fields = fields;\n }\n}\nexport class MethodInfo {\n constructor(name, parameters, returnType) {\n this.name = name;\n this.parameters = parameters;\n this.returnType = returnType;\n }\n}\nexport class TypeInfo {\n constructor(fullname, generics, construct, parent, fields, cases, enumCases) {\n this.fullname = fullname;\n this.generics = generics;\n this.construct = construct;\n this.parent = parent;\n this.fields = fields;\n this.cases = cases;\n this.enumCases = enumCases;\n }\n toString() {\n return fullName(this);\n }\n GetHashCode() {\n return getHashCode(this);\n }\n Equals(other) {\n return equals(this, other);\n }\n}\nexport class GenericParameter extends TypeInfo {\n constructor(name) {\n super(name);\n }\n}\nexport function getGenerics(t) {\n return t.generics != null ? t.generics : [];\n}\nexport function getHashCode(t) {\n const fullnameHash = stringHash(t.fullname);\n const genHashes = getGenerics(t).map(getHashCode);\n return combineHashCodes([fullnameHash, ...genHashes]);\n}\nexport function equals(t1, t2) {\n if (t1.fullname === \"\") { // Anonymous records\n return t2.fullname === \"\"\n && equalArraysWith(getRecordElements(t1), getRecordElements(t2), ([k1, v1], [k2, v2]) => k1 === k2 && equals(v1, v2));\n }\n else {\n return t1.fullname === t2.fullname\n && equalArraysWith(getGenerics(t1), getGenerics(t2), equals);\n }\n}\nexport function class_type(fullname, generics, construct, parent) {\n return new TypeInfo(fullname, generics, construct, parent);\n}\nexport function record_type(fullname, generics, construct, fields) {\n return new TypeInfo(fullname, generics, construct, undefined, fields);\n}\nexport function anonRecord_type(...fields) {\n return new TypeInfo(\"\", undefined, undefined, undefined, () => fields);\n}\nexport function union_type(fullname, generics, construct, cases) {\n const t = new TypeInfo(fullname, generics, construct, undefined, undefined, () => {\n const caseNames = construct.prototype.cases();\n return cases().map((fields, i) => new CaseInfo(t, i, caseNames[i], fields));\n });\n return t;\n}\nexport function tuple_type(...generics) {\n return new TypeInfo(\"System.Tuple`\" + generics.length, generics);\n}\nexport function delegate_type(...generics) {\n return new TypeInfo(\"System.Func`\" + generics.length, generics);\n}\nexport function lambda_type(argType, returnType) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpFunc`2\", [argType, returnType]);\n}\nexport function option_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Core.FSharpOption`1\", [generic]);\n}\nexport function list_type(generic) {\n return new TypeInfo(\"Microsoft.FSharp.Collections.FSharpList`1\", [generic]);\n}\nexport function array_type(generic) {\n return new TypeInfo(\"[]\", [generic]);\n}\nexport function enum_type(fullname, underlyingType, enumCases) {\n return new TypeInfo(fullname, [underlyingType], undefined, undefined, undefined, undefined, enumCases);\n}\nexport function measure_type(fullname) {\n return new TypeInfo(fullname);\n}\nexport function generic_type(name) {\n return new GenericParameter(name);\n}\nexport const obj_type = new TypeInfo(\"System.Object\");\nexport const unit_type = new TypeInfo(\"Microsoft.FSharp.Core.Unit\");\nexport const char_type = new TypeInfo(\"System.Char\");\nexport const string_type = new TypeInfo(\"System.String\");\nexport const bool_type = new TypeInfo(\"System.Boolean\");\nexport const int8_type = new TypeInfo(\"System.SByte\");\nexport const uint8_type = new TypeInfo(\"System.Byte\");\nexport const int16_type = new TypeInfo(\"System.Int16\");\nexport const uint16_type = new TypeInfo(\"System.UInt16\");\nexport const int32_type = new TypeInfo(\"System.Int32\");\nexport const uint32_type = new TypeInfo(\"System.UInt32\");\nexport const float32_type = new TypeInfo(\"System.Single\");\nexport const float64_type = new TypeInfo(\"System.Double\");\nexport const decimal_type = new TypeInfo(\"System.Decimal\");\nexport function name(info) {\n if (Array.isArray(info)) {\n return info[0];\n }\n else if (info instanceof TypeInfo) {\n const elemType = getElementType(info);\n if (elemType != null) {\n return name(elemType) + \"[]\";\n }\n else {\n const i = info.fullname.lastIndexOf(\".\");\n return i === -1 ? info.fullname : info.fullname.substr(i + 1);\n }\n }\n else {\n return info.name;\n }\n}\nexport function fullName(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return fullName(elemType) + \"[]\";\n }\n else if (t.generics == null || t.generics.length === 0) {\n return t.fullname;\n }\n else {\n return t.fullname + \"[\" + t.generics.map((x) => fullName(x)).join(\",\") + \"]\";\n }\n}\nexport function namespace(t) {\n const elemType = getElementType(t);\n if (elemType != null) {\n return namespace(elemType);\n }\n else {\n const i = t.fullname.lastIndexOf(\".\");\n return i === -1 ? \"\" : t.fullname.substr(0, i);\n }\n}\nexport function isArray(t) {\n return getElementType(t) != null;\n}\nexport function getElementType(t) {\n var _a;\n return t.fullname === \"[]\" && ((_a = t.generics) === null || _a === void 0 ? void 0 : _a.length) === 1 ? t.generics[0] : undefined;\n}\nexport function isGenericType(t) {\n return t.generics != null && t.generics.length > 0;\n}\nexport function isGenericParameter(t) {\n return t instanceof GenericParameter;\n}\nexport function isEnum(t) {\n return t.enumCases != null && t.enumCases.length > 0;\n}\nexport function isSubclassOf(t1, t2) {\n return (t2.fullname === obj_type.fullname) || (t1.parent != null && (t1.parent.Equals(t2) || isSubclassOf(t1.parent, t2)));\n}\nfunction isErasedToNumber(t) {\n return isEnum(t) || [\n int8_type.fullname,\n uint8_type.fullname,\n int16_type.fullname,\n uint16_type.fullname,\n int32_type.fullname,\n uint32_type.fullname,\n float32_type.fullname,\n float64_type.fullname,\n ].includes(t.fullname);\n}\nexport function isInstanceOfType(t, o) {\n if (t.fullname === obj_type.fullname)\n return true;\n switch (typeof o) {\n case \"boolean\":\n return t.fullname === bool_type.fullname;\n case \"string\":\n return t.fullname === string_type.fullname;\n case \"function\":\n return isFunction(t);\n case \"number\":\n return isErasedToNumber(t);\n default:\n return t.construct != null && o instanceof t.construct;\n }\n}\n/**\n * This doesn't replace types for fields (records) or cases (unions)\n * but it should be enough for type comparison purposes\n */\nexport function getGenericTypeDefinition(t) {\n return t.generics == null ? t : new TypeInfo(t.fullname, t.generics.map(() => obj_type));\n}\nexport function getEnumUnderlyingType(t) {\n var _a;\n return (_a = t.generics) === null || _a === void 0 ? void 0 : _a[0];\n}\nexport function getEnumValues(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[1]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function getEnumNames(t) {\n if (isEnum(t) && t.enumCases != null) {\n return t.enumCases.map((kv) => kv[0]);\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nfunction getEnumCase(t, v) {\n if (t.enumCases != null) {\n if (typeof v === \"string\") {\n for (const kv of t.enumCases) {\n if (kv[0] === v) {\n return kv;\n }\n }\n throw new Error(`'${v}' was not found in ${t.fullname}`);\n }\n else {\n for (const kv of t.enumCases) {\n if (kv[1] === v) {\n return kv;\n }\n }\n // .NET returns the number even if it doesn't match any of the cases\n return [\"\", v];\n }\n }\n else {\n throw new Error(`${t.fullname} is not an enum type`);\n }\n}\nexport function parseEnum(t, str) {\n // TODO: better int parsing here, parseInt ceils floats: \"4.8\" -> 4\n const value = parseInt(str, 10);\n return getEnumCase(t, isNaN(value) ? str : value)[1];\n}\nexport function tryParseEnum(t, str, defValue) {\n try {\n defValue.contents = parseEnum(t, str);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nexport function getEnumName(t, v) {\n return getEnumCase(t, v)[0];\n}\nexport function isEnumDefined(t, v) {\n try {\n const kv = getEnumCase(t, v);\n return kv[0] != null && kv[0] !== \"\";\n }\n catch (_a) {\n // supress error\n }\n return false;\n}\n// FSharpType\nexport function getUnionCases(t) {\n if (t.cases != null) {\n return t.cases();\n }\n else {\n throw new Error(`${t.fullname} is not an F# union type`);\n }\n}\nexport function getRecordElements(t) {\n if (t.fields != null) {\n return t.fields();\n }\n else {\n throw new Error(`${t.fullname} is not an F# record type`);\n }\n}\nexport function getTupleElements(t) {\n if (isTuple(t) && t.generics != null) {\n return t.generics;\n }\n else {\n throw new Error(`${t.fullname} is not a tuple type`);\n }\n}\nexport function getFunctionElements(t) {\n if (isFunction(t) && t.generics != null) {\n const gen = t.generics;\n return [gen[0], gen[1]];\n }\n else {\n throw new Error(`${t.fullname} is not an F# function type`);\n }\n}\nexport function isUnion(t) {\n return t instanceof TypeInfo ? t.cases != null : t instanceof Union;\n}\nexport function isRecord(t) {\n return t instanceof TypeInfo ? t.fields != null : t instanceof Record;\n}\nexport function isTuple(t) {\n return t.fullname.startsWith(\"System.Tuple\");\n}\n// In .NET this is false for delegates\nexport function isFunction(t) {\n return t.fullname === \"Microsoft.FSharp.Core.FSharpFunc`2\";\n}\n// FSharpValue\nexport function getUnionFields(v, t) {\n const cases = getUnionCases(t);\n const case_ = cases[v.tag];\n if (case_ == null) {\n throw new Error(`Cannot find case ${v.name} in union type`);\n }\n return [case_, v.fields];\n}\nexport function getUnionCaseFields(uci) {\n return uci.fields == null ? [] : uci.fields;\n}\n// This is used as replacement of `FSharpValue.GetRecordFields`\n// For `FSharpTypes.GetRecordFields` see `getRecordElements`\n// Object.keys returns keys in the order they were added to the object\nexport function getRecordFields(v) {\n return Object.keys(v).map((k) => v[k]);\n}\nexport function getRecordField(v, field) {\n return v[field[0]];\n}\nexport function getTupleFields(v) {\n return v;\n}\nexport function getTupleField(v, i) {\n return v[i];\n}\nexport function makeUnion(uci, values) {\n const expectedLength = (uci.fields || []).length;\n if (values.length !== expectedLength) {\n throw new Error(`Expected an array of length ${expectedLength} but got ${values.length}`);\n }\n return uci.declaringType.construct != null\n ? new uci.declaringType.construct(uci.tag, ...values)\n : {};\n}\nexport function makeRecord(t, values) {\n const fields = getRecordElements(t);\n if (fields.length !== values.length) {\n throw new Error(`Expected an array of length ${fields.length} but got ${values.length}`);\n }\n return t.construct != null\n ? new t.construct(...values)\n : fields.reduce((obj, [key, _t], i) => {\n obj[key] = values[i];\n return obj;\n }, {});\n}\nexport function makeTuple(values, _t) {\n return values;\n}\nexport function makeGenericType(t, generics) {\n return new TypeInfo(t.fullname, generics, t.construct, t.parent, t.fields, t.cases);\n}\nexport function createInstance(t, consArgs) {\n // TODO: Check if consArgs length is same as t.construct?\n // (Arg types can still be different)\n if (typeof t.construct === \"function\") {\n return new t.construct(...(consArgs !== null && consArgs !== void 0 ? consArgs : []));\n }\n else if (isErasedToNumber(t)) {\n return 0;\n }\n else {\n switch (t.fullname) {\n case obj_type.fullname:\n return {};\n case bool_type.fullname:\n return false;\n case \"System.Int64\":\n case \"System.UInt64\":\n // typeof<int64> and typeof<uint64> get transformed to class_type(\"System.Int64\")\n // and class_type(\"System.UInt64\") respectively. Test for the name of the primitive type.\n return int64FromInt(0);\n case decimal_type.fullname:\n return new Decimal(0);\n case char_type.fullname:\n // Even though char is a value type, it's erased to string, and Unchecked.defaultof<char> is null\n return null;\n default:\n throw new Error(`Cannot access constructor of ${t.fullname}`);\n }\n }\n}\nexport function getValue(propertyInfo, v) {\n return v[propertyInfo[0]];\n}\n// Fable.Core.Reflection\nfunction assertUnion(x) {\n if (!(x instanceof Union)) {\n throw new Error(`Value is not an F# union type`);\n }\n}\nexport function getCaseTag(x) {\n assertUnion(x);\n return x.tag;\n}\nexport function getCaseName(x) {\n assertUnion(x);\n return x.cases()[x.tag];\n}\nexport function getCaseFields(x) {\n assertUnion(x);\n return x.fields;\n}\n","export function create(pattern, options = 0) {\n // Supported RegexOptions\n // * IgnoreCase: 0x0001\n // * Multiline: 0x0002\n // * Singleline: 0x0010\n // * ECMAScript: 0x0100 (ignored)\n if ((options & ~(1 ^ 2 ^ 16 ^ 256)) !== 0) {\n throw new Error(\"RegexOptions only supports: IgnoreCase, Multiline, Singleline and ECMAScript\");\n }\n let flags = \"g\";\n flags += options & 1 ? \"i\" : \"\"; // 0x0001 RegexOptions.IgnoreCase\n flags += options & 2 ? \"m\" : \"\";\n flags += options & 16 ? \"s\" : \"\";\n return new RegExp(pattern, flags);\n}\n// From http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex\nexport function escape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n}\nexport function unescape(str) {\n return str.replace(/\\\\([\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|])/g, \"$1\");\n}\nexport function isMatch(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.test(input);\n}\nexport function match(reg, input, startAt = 0) {\n reg.lastIndex = startAt;\n return reg.exec(input);\n}\nexport function matches(reg, input, startAt = 0) {\n if (input == null) {\n throw new Error(\"Input cannot ve null\");\n }\n if (!reg.global) {\n throw new Error(\"Non-global RegExp\"); // Prevent infinite loop\n }\n reg.lastIndex = startAt;\n const matches = [];\n let m;\n let lastMatchIndex = -1;\n // tslint:disable-next-line:no-conditional-assignment\n while ((m = reg.exec(input)) != null) {\n // It can happen even global regex get stuck, see #2845\n if (m.index === lastMatchIndex) {\n reg.lastIndex++;\n }\n else {\n lastMatchIndex = m.index;\n matches.push(m);\n }\n }\n return matches;\n}\nexport function options(reg) {\n let options = 256; // ECMAScript\n options |= reg.ignoreCase ? 1 : 0;\n options |= reg.multiline ? 2 : 0;\n return options;\n}\nexport function replace(reg, input, replacement, limit, offset = 0) {\n function replacer() {\n let res = arguments[0];\n if (limit) {\n limit--;\n const match = [];\n const len = arguments.length;\n // arguments: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter\n // * match: matched substring\n // * p1, p2, ...: nth capture group string\n // * offset: offset of matched substring\n // * string: whole string examined\n // * groups: named capturing groups\n // ONLY if regex contains a named capture group AND browser supports named groups\n // -> last element can be groups OR input string\n // -> check if last element is string\n const withGroups = typeof arguments[len - 1] !== \"string\";\n let pLast = withGroups ? len - 3 : len - 2;\n for (let i = 0; i < pLast; i++) {\n match.push(arguments[i]);\n }\n match.index = arguments[pLast++];\n match.input = arguments[pLast++];\n if (withGroups) {\n match.groups = arguments[pLast];\n }\n res = replacement(match);\n }\n return res;\n }\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n if (typeof replacement === \"function\") {\n limit = limit == null ? -1 : limit;\n return input.substring(0, offset) + input.substring(offset).replace(reg, replacer);\n }\n else {\n replacement =\n replacement\n // $0 doesn't work with JS regex, see #1155\n .replace(/\\$0/g, (_s) => \"$&\")\n // named groups in replacement are `${name}` in .Net, but `$<name>` in JS (in regex: groups are `(?<name>...)` in both)\n .replace(/\\${([^}]+)}/g, \"\\$<$1>\");\n if (limit != null) {\n let m;\n const sub1 = input.substring(offset);\n const _matches = matches(reg, sub1);\n const sub2 = matches.length > limit ? (m = _matches[limit - 1], sub1.substring(0, m.index + m[0].length)) : sub1;\n return input.substring(0, offset) + sub2.replace(reg, replacement)\n + input.substring(offset + sub2.length);\n }\n else {\n return input.replace(reg, replacement);\n }\n }\n}\nexport function split(reg, input, limit, offset = 0) {\n if (typeof reg === \"string\") {\n const tmp = reg;\n reg = create(input, limit !== null && limit !== void 0 ? limit : 0);\n input = tmp;\n limit = undefined;\n }\n input = input.substring(offset);\n return input.split(reg, limit);\n}\n","import { clear, equals, isArrayLike, isDisposable, toIterator, disposeSafe, getEnumerator } from \"./Util.js\";\r\nimport { toString } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { some, value as value_1 } from \"./Option.js\";\r\nimport { Operators_Lock, Operators_NullArg } from \"./FSharp.Core.js\";\r\nimport { chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, windowed as windowed_1, splitInto as splitInto_1, map as map_1, pairwise as pairwise_1, scanBack as scanBack_1, reverse as reverse_1, mapFoldBack as mapFoldBack_1, mapFold as mapFold_1, tryItem as tryItem_1, tryHead as tryHead_1, foldBack2 as foldBack2_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from \"./Array.js\";\r\nimport { length as length_1, tryItem as tryItem_2, isEmpty as isEmpty_1, tryHead as tryHead_2, ofSeq as ofSeq_1, ofArray as ofArray_1, toArray as toArray_1, FSharpList } from \"./List.js\";\r\nimport { SR_indexOutOfBounds } from \"./Global.js\";\r\n\r\nexport const SR_enumerationAlreadyFinished = \"Enumeration already finished.\";\r\n\r\nexport const SR_enumerationNotStarted = \"Enumeration has not started. Call MoveNext.\";\r\n\r\nexport const SR_inputSequenceEmpty = \"The input sequence was empty.\";\r\n\r\nexport const SR_inputSequenceTooLong = \"The input sequence contains more than one element.\";\r\n\r\nexport const SR_keyNotFoundAlt = \"An index satisfying the predicate was not found in the collection.\";\r\n\r\nexport const SR_notEnoughElements = \"The input sequence has an insufficient number of elements.\";\r\n\r\nexport const SR_resetNotSupported = \"Reset is not supported on this enumerator.\";\r\n\r\nexport function Enumerator_noReset() {\r\n throw (new Error(SR_resetNotSupported));\r\n}\r\n\r\nexport function Enumerator_notStarted() {\r\n throw (new Error(SR_enumerationNotStarted));\r\n}\r\n\r\nexport function Enumerator_alreadyFinished() {\r\n throw (new Error(SR_enumerationAlreadyFinished));\r\n}\r\n\r\nexport class Enumerator_Seq {\r\n constructor(f) {\r\n this.f = f;\r\n }\r\n toString() {\r\n const xs = this;\r\n const maxCount = 4;\r\n let i = 0;\r\n let str = \"seq [\";\r\n const e = getEnumerator(xs);\r\n try {\r\n while ((i < maxCount) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (i > 0) {\r\n str = (str + \"; \");\r\n }\r\n str = (str + toString(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n i = ((i + 1) | 0);\r\n }\r\n if (i === maxCount) {\r\n str = (str + \"; ...\");\r\n }\r\n return str + \"]\";\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n GetEnumerator() {\r\n const x = this;\r\n return x.f();\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const x = this;\r\n return x.f();\r\n }\r\n}\r\n\r\nexport function Enumerator_Seq$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.Seq\", [gen0], Enumerator_Seq);\r\n}\r\n\r\nexport function Enumerator_Seq_$ctor_673A07F2(f) {\r\n return new Enumerator_Seq(f);\r\n}\r\n\r\nexport class Enumerator_FromFunctions$1 {\r\n constructor(current, next, dispose) {\r\n this.current = current;\r\n this.next = next;\r\n this.dispose = dispose;\r\n }\r\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.get_Current\"]() {\r\n const __ = this;\r\n return __.current();\r\n }\r\n [\"System.Collections.IEnumerator.MoveNext\"]() {\r\n const __ = this;\r\n return __.next();\r\n }\r\n [\"System.Collections.IEnumerator.Reset\"]() {\r\n Enumerator_noReset();\r\n }\r\n Dispose() {\r\n const __ = this;\r\n __.dispose();\r\n }\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1$reflection(gen0) {\r\n return class_type(\"SeqModule.Enumerator.FromFunctions`1\", [gen0], Enumerator_FromFunctions$1);\r\n}\r\n\r\nexport function Enumerator_FromFunctions$1_$ctor_58C54629(current, next, dispose) {\r\n return new Enumerator_FromFunctions$1(current, next, dispose);\r\n}\r\n\r\nexport function Enumerator_cast(e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.IEnumerator.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n if (isDisposable(e)) {\r\n disposeSafe(e);\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_concat(sources) {\r\n let outerOpt = void 0;\r\n let innerOpt = void 0;\r\n let started = false;\r\n let finished = false;\r\n let curr = void 0;\r\n const finish = () => {\r\n finished = true;\r\n if (innerOpt != null) {\r\n const inner = innerOpt;\r\n try {\r\n disposeSafe(inner);\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n if (outerOpt != null) {\r\n const outer = outerOpt;\r\n try {\r\n disposeSafe(outer);\r\n }\r\n finally {\r\n outerOpt = (void 0);\r\n }\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n else if (finished) {\r\n Enumerator_alreadyFinished();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n let copyOfStruct;\r\n if (!started) {\r\n started = true;\r\n }\r\n if (finished) {\r\n return false;\r\n }\r\n else {\r\n let res = void 0;\r\n while (res == null) {\r\n const matchValue = [outerOpt, innerOpt];\r\n if (matchValue[0] != null) {\r\n if (matchValue[1] != null) {\r\n const inner_1 = matchValue[1];\r\n if (inner_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = some(inner_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n res = true;\r\n }\r\n else {\r\n try {\r\n disposeSafe(inner_1);\r\n }\r\n finally {\r\n innerOpt = (void 0);\r\n }\r\n }\r\n }\r\n else {\r\n const outer_1 = matchValue[0];\r\n if (outer_1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const ie = outer_1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n innerOpt = ((copyOfStruct = ie, getEnumerator(copyOfStruct)));\r\n }\r\n else {\r\n finish();\r\n res = false;\r\n }\r\n }\r\n }\r\n else {\r\n outerOpt = getEnumerator(sources);\r\n }\r\n }\r\n return value_1(res);\r\n }\r\n }, () => {\r\n if (!finished) {\r\n finish();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_enumerateThenFinally(f, e) {\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => e[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), () => e[\"System.Collections.IEnumerator.MoveNext\"](), () => {\r\n try {\r\n disposeSafe(e);\r\n }\r\n finally {\r\n f();\r\n }\r\n });\r\n}\r\n\r\nexport function Enumerator_generateWhileSome(openf, compute, closef) {\r\n let started = false;\r\n let curr = void 0;\r\n let state = some(openf());\r\n const dispose = () => {\r\n if (state != null) {\r\n const x_1 = value_1(state);\r\n try {\r\n closef(x_1);\r\n }\r\n finally {\r\n state = (void 0);\r\n }\r\n }\r\n };\r\n const finish = () => {\r\n try {\r\n dispose();\r\n }\r\n finally {\r\n curr = (void 0);\r\n }\r\n };\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (!started) {\r\n Enumerator_notStarted();\r\n }\r\n if (curr != null) {\r\n return value_1(curr);\r\n }\r\n else {\r\n return Enumerator_alreadyFinished();\r\n }\r\n }, () => {\r\n if (!started) {\r\n started = true;\r\n }\r\n if (state != null) {\r\n const s = value_1(state);\r\n let matchValue_1;\r\n try {\r\n matchValue_1 = compute(s);\r\n }\r\n catch (matchValue) {\r\n finish();\r\n throw matchValue;\r\n }\r\n if (matchValue_1 != null) {\r\n curr = matchValue_1;\r\n return true;\r\n }\r\n else {\r\n finish();\r\n return false;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }, dispose);\r\n}\r\n\r\nexport function Enumerator_unfold(f, state) {\r\n let curr = void 0;\r\n let acc = state;\r\n return Enumerator_FromFunctions$1_$ctor_58C54629(() => {\r\n if (curr != null) {\r\n const x = curr[0];\r\n const st = curr[1];\r\n return x;\r\n }\r\n else {\r\n return Enumerator_notStarted();\r\n }\r\n }, () => {\r\n curr = f(acc);\r\n if (curr != null) {\r\n const x_1 = curr[0];\r\n const st_1 = curr[1];\r\n acc = st_1;\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }, () => {\r\n });\r\n}\r\n\r\nexport function indexNotFound() {\r\n throw (new Error(SR_keyNotFoundAlt));\r\n}\r\n\r\nexport function checkNonNull(argName, arg) {\r\n if (arg == null) {\r\n Operators_NullArg(argName);\r\n }\r\n}\r\n\r\nexport function mkSeq(f) {\r\n return Enumerator_Seq_$ctor_673A07F2(f);\r\n}\r\n\r\nexport function ofSeq(xs) {\r\n checkNonNull(\"source\", xs);\r\n return getEnumerator(xs);\r\n}\r\n\r\nexport function delay(generator) {\r\n return mkSeq(() => getEnumerator(generator()));\r\n}\r\n\r\nexport function concat(sources) {\r\n return mkSeq(() => Enumerator_concat(sources));\r\n}\r\n\r\nexport function unfold(generator, state) {\r\n return mkSeq(() => Enumerator_unfold(generator, state));\r\n}\r\n\r\nexport function empty() {\r\n return delay(() => (new Array(0)));\r\n}\r\n\r\nexport function singleton(x) {\r\n return delay(() => singleton_1(x));\r\n}\r\n\r\nexport function ofArray(arr) {\r\n return arr;\r\n}\r\n\r\nexport function toArray(xs) {\r\n if (xs instanceof FSharpList) {\r\n return toArray_1(xs);\r\n }\r\n else {\r\n return Array.from(xs);\r\n }\r\n}\r\n\r\nexport function ofList(xs) {\r\n return xs;\r\n}\r\n\r\nexport function toList(xs) {\r\n if (isArrayLike(xs)) {\r\n return ofArray_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return xs;\r\n }\r\n else {\r\n return ofSeq_1(xs);\r\n }\r\n}\r\n\r\nexport function generate(create, compute, dispose) {\r\n return mkSeq(() => Enumerator_generateWhileSome(create, compute, dispose));\r\n}\r\n\r\nexport function generateIndexed(create, compute, dispose) {\r\n return mkSeq(() => {\r\n let i = -1;\r\n return Enumerator_generateWhileSome(create, (x) => {\r\n i = ((i + 1) | 0);\r\n return compute(i, x);\r\n }, dispose);\r\n });\r\n}\r\n\r\nexport function append(xs, ys) {\r\n return concat([xs, ys]);\r\n}\r\n\r\nexport function cast(xs) {\r\n return mkSeq(() => {\r\n checkNonNull(\"source\", xs);\r\n return Enumerator_cast(getEnumerator(xs));\r\n });\r\n}\r\n\r\nexport function choose(chooser, xs) {\r\n return generate(() => ofSeq(xs), (e) => {\r\n let curr = void 0;\r\n while ((curr == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n curr = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return curr;\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function compareWith(comparer, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let c = 0;\r\n let b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n let b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n while (((c === 0) && b1) && b2) {\r\n c = (comparer(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) | 0);\r\n if (c === 0) {\r\n b1 = e1[\"System.Collections.IEnumerator.MoveNext\"]();\r\n b2 = e2[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n }\r\n return ((c !== 0) ? c : (b1 ? 1 : (b2 ? -1 : 0))) | 0;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function contains(value, xs, comparer) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = comparer.Equals(value, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function enumerateFromFunctions(create, moveNext, current) {\r\n return generate(create, (x) => (moveNext(x) ? some(current(x)) : (void 0)), (x_1) => {\r\n const matchValue = x_1;\r\n if (isDisposable(matchValue)) {\r\n disposeSafe(matchValue);\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateThenFinally(source, compensation) {\r\n const compensation_1 = compensation;\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation_1, ofSeq(source));\r\n }\r\n catch (matchValue) {\r\n compensation_1();\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateUsing(resource, source) {\r\n const compensation = () => {\r\n if (equals(resource, null)) {\r\n }\r\n else {\r\n let copyOfStruct = resource;\r\n disposeSafe(copyOfStruct);\r\n }\r\n };\r\n return mkSeq(() => {\r\n try {\r\n return Enumerator_enumerateThenFinally(compensation, (ofSeq)(source(resource)));\r\n }\r\n catch (matchValue_1) {\r\n compensation();\r\n throw matchValue_1;\r\n }\r\n });\r\n}\r\n\r\nexport function enumerateWhile(guard, xs) {\r\n return concat(unfold((i) => (guard() ? [xs, i + 1] : (void 0)), 0));\r\n}\r\n\r\nexport function filter(f, xs) {\r\n return choose((x) => {\r\n if (f(x)) {\r\n return some(x);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, xs);\r\n}\r\n\r\nexport function exists(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let found = false;\r\n while ((!found) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function exists2(predicate, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let found = false;\r\n while (((!found) && e1[\"System.Collections.IEnumerator.MoveNext\"]()) && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n found = predicate(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return found;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function exactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_inputSequenceTooLong + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return v;\r\n }\r\n }\r\n else {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function tryExactlyOne(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const v = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? (void 0) : some(v);\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function tryFind(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n const c = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n if (predicate(c)) {\r\n res = some(c);\r\n }\r\n }\r\n return res;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function find(predicate, xs) {\r\n const matchValue = tryFind(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindBack(predicate, xs) {\r\n return tryFindBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findBack(predicate, xs) {\r\n const matchValue = tryFindBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function tryFindIndex(predicate, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (i_mut) => {\r\n loop:\r\n while (true) {\r\n const i = i_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n if (predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) {\r\n return i;\r\n }\r\n else {\r\n i_mut = (i + 1);\r\n continue loop;\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function findIndex(predicate, xs) {\r\n const matchValue = tryFindIndex(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function tryFindIndexBack(predicate, xs) {\r\n return tryFindIndexBack_1(predicate, toArray(xs));\r\n}\r\n\r\nexport function findIndexBack(predicate, xs) {\r\n const matchValue = tryFindIndexBack(predicate, xs);\r\n if (matchValue == null) {\r\n return indexNotFound() | 0;\r\n }\r\n else {\r\n return matchValue | 0;\r\n }\r\n}\r\n\r\nexport function fold(folder, state, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let acc = state;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function foldBack(folder, xs, state) {\r\n return foldBack_1(folder, toArray(xs), state);\r\n}\r\n\r\nexport function fold2(folder, state, xs, ys) {\r\n const e1 = ofSeq(xs);\r\n try {\r\n const e2 = ofSeq(ys);\r\n try {\r\n let acc = state;\r\n while (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc = folder(acc, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return acc;\r\n }\r\n finally {\r\n disposeSafe(e2);\r\n }\r\n }\r\n finally {\r\n disposeSafe(e1);\r\n }\r\n}\r\n\r\nexport function foldBack2(folder, xs, ys, state) {\r\n return foldBack2_1(folder, toArray(xs), toArray(ys), state);\r\n}\r\n\r\nexport function forAll(predicate, xs) {\r\n return !exists((x) => (!predicate(x)), xs);\r\n}\r\n\r\nexport function forAll2(predicate, xs, ys) {\r\n return !exists2((x, y) => (!predicate(x, y)), xs, ys);\r\n}\r\n\r\nexport function tryHead(xs) {\r\n if (isArrayLike(xs)) {\r\n return tryHead_1(xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryHead_2(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function head(xs) {\r\n const matchValue = tryHead(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function initialize(count, f) {\r\n return unfold((i) => ((i < count) ? [f(i), i + 1] : (void 0)), 0);\r\n}\r\n\r\nexport function initializeInfinite(f) {\r\n return initialize(2147483647, f);\r\n}\r\n\r\nexport function isEmpty(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length === 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return isEmpty_1(xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n return !e[\"System.Collections.IEnumerator.MoveNext\"]();\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function tryItem(index, xs) {\r\n if (isArrayLike(xs)) {\r\n return tryItem_1(index, xs);\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return tryItem_2(index, xs);\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (index_1_mut) => {\r\n loop:\r\n while (true) {\r\n const index_1 = index_1_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return void 0;\r\n }\r\n else if (index_1 === 0) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n index_1_mut = (index_1 - 1);\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return loop(index);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function item(index, xs) {\r\n const matchValue = tryItem(index, xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function iterate(action, xs) {\r\n fold((unitVar0, x) => {\r\n action(x);\r\n }, void 0, xs);\r\n}\r\n\r\nexport function iterate2(action, xs, ys) {\r\n fold2((unitVar0, x, y) => {\r\n action(x, y);\r\n }, void 0, xs, ys);\r\n}\r\n\r\nexport function iterateIndexed(action, xs) {\r\n fold((i, x) => {\r\n action(i, x);\r\n return (i + 1) | 0;\r\n }, 0, xs);\r\n}\r\n\r\nexport function iterateIndexed2(action, xs, ys) {\r\n fold2((i, x, y) => {\r\n action(i, x, y);\r\n return (i + 1) | 0;\r\n }, 0, xs, ys);\r\n}\r\n\r\nexport function tryLast(xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return acc;\r\n }\r\n else {\r\n acc_mut = e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]();\r\n continue loop;\r\n }\r\n break;\r\n }\r\n };\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function last(xs) {\r\n const matchValue = tryLast(xs);\r\n if (matchValue == null) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function length(xs) {\r\n if (isArrayLike(xs)) {\r\n return xs.length | 0;\r\n }\r\n else if (xs instanceof FSharpList) {\r\n return length_1(xs) | 0;\r\n }\r\n else {\r\n const e = ofSeq(xs);\r\n try {\r\n let count = 0;\r\n while (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n count = ((count + 1) | 0);\r\n }\r\n return count | 0;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n }\r\n}\r\n\r\nexport function map(mapping, xs) {\r\n return generate(() => ofSeq(xs), (e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function mapIndexed(mapping, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(mapping(i, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function indexed(xs) {\r\n return mapIndexed((i, x) => [i, x], xs);\r\n}\r\n\r\nexport function map2(mapping, xs, ys) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n });\r\n}\r\n\r\nexport function mapIndexed2(mapping, xs, ys) {\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n return (e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(i, e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n });\r\n}\r\n\r\nexport function map3(mapping, xs, ys, zs) {\r\n return generate(() => [ofSeq(xs), ofSeq(ys), ofSeq(zs)], (tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n const e3 = tupledArg[2];\r\n return ((e1[\"System.Collections.IEnumerator.MoveNext\"]() && e2[\"System.Collections.IEnumerator.MoveNext\"]()) && e3[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(mapping(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"](), e3[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) : (void 0);\r\n }, (tupledArg_1) => {\r\n try {\r\n disposeSafe(tupledArg_1[0]);\r\n }\r\n finally {\r\n try {\r\n disposeSafe(tupledArg_1[1]);\r\n }\r\n finally {\r\n disposeSafe(tupledArg_1[2]);\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function readOnly(xs) {\r\n checkNonNull(\"source\", xs);\r\n return map((x) => x, xs);\r\n}\r\n\r\nexport class CachedSeq$1 {\r\n constructor(cleanup, res) {\r\n this.cleanup = cleanup;\r\n this.res = res;\r\n }\r\n Dispose() {\r\n const _ = this;\r\n _.cleanup();\r\n }\r\n GetEnumerator() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n [Symbol.iterator]() {\r\n return toIterator(this.GetEnumerator());\r\n }\r\n [\"System.Collections.IEnumerable.GetEnumerator\"]() {\r\n const _ = this;\r\n return getEnumerator(_.res);\r\n }\r\n}\r\n\r\nexport function CachedSeq$1$reflection(gen0) {\r\n return class_type(\"SeqModule.CachedSeq`1\", [gen0], CachedSeq$1);\r\n}\r\n\r\nexport function CachedSeq$1_$ctor_Z7A8347D4(cleanup, res) {\r\n return new CachedSeq$1(cleanup, res);\r\n}\r\n\r\nexport function CachedSeq$1__Clear(_) {\r\n _.cleanup();\r\n}\r\n\r\nexport function cache(source) {\r\n checkNonNull(\"source\", source);\r\n const prefix = [];\r\n let enumeratorR = void 0;\r\n return CachedSeq$1_$ctor_Z7A8347D4(() => {\r\n Operators_Lock(prefix, () => {\r\n clear(prefix);\r\n let pattern_matching_result, e;\r\n if (enumeratorR != null) {\r\n if (value_1(enumeratorR) != null) {\r\n pattern_matching_result = 0;\r\n e = value_1(enumeratorR);\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n }\r\n else {\r\n pattern_matching_result = 1;\r\n }\r\n switch (pattern_matching_result) {\r\n case 0: {\r\n disposeSafe(e);\r\n break;\r\n }\r\n }\r\n enumeratorR = (void 0);\r\n });\r\n }, unfold((i_1) => Operators_Lock(prefix, () => {\r\n if (i_1 < prefix.length) {\r\n return [prefix[i_1], i_1 + 1];\r\n }\r\n else {\r\n if (i_1 >= prefix.length) {\r\n let optEnumerator_2;\r\n if (enumeratorR != null) {\r\n optEnumerator_2 = value_1(enumeratorR);\r\n }\r\n else {\r\n const optEnumerator = getEnumerator(source);\r\n enumeratorR = some(optEnumerator);\r\n optEnumerator_2 = optEnumerator;\r\n }\r\n if (optEnumerator_2 == null) {\r\n }\r\n else {\r\n const enumerator = optEnumerator_2;\r\n if (enumerator[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n void (prefix.push(enumerator[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()));\r\n }\r\n else {\r\n disposeSafe(enumerator);\r\n enumeratorR = some(void 0);\r\n }\r\n }\r\n }\r\n return (i_1 < prefix.length) ? [prefix[i_1], i_1 + 1] : (void 0);\r\n }\r\n }), 0));\r\n}\r\n\r\nexport function allPairs(xs, ys) {\r\n const ysCache = cache(ys);\r\n return delay(() => concat(map((x) => map((y) => [x, y], ysCache), xs)));\r\n}\r\n\r\nexport function mapFold(mapping, state, xs) {\r\n const patternInput = mapFold_1(mapping, state, toArray(xs));\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function mapFoldBack(mapping, xs, state) {\r\n const patternInput = mapFoldBack_1(mapping, toArray(xs), state);\r\n return [readOnly(patternInput[0]), patternInput[1]];\r\n}\r\n\r\nexport function tryPick(chooser, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n let res = void 0;\r\n while ((res == null) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n res = chooser(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n return res;\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function pick(chooser, xs) {\r\n const matchValue = tryPick(chooser, xs);\r\n if (matchValue == null) {\r\n return indexNotFound();\r\n }\r\n else {\r\n return value_1(matchValue);\r\n }\r\n}\r\n\r\nexport function reduce(folder, xs) {\r\n const e = ofSeq(xs);\r\n try {\r\n const loop = (acc_mut) => {\r\n loop:\r\n while (true) {\r\n const acc = acc_mut;\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n acc_mut = folder(acc, e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n continue loop;\r\n }\r\n else {\r\n return acc;\r\n }\r\n break;\r\n }\r\n };\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return loop(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n }\r\n finally {\r\n disposeSafe(e);\r\n }\r\n}\r\n\r\nexport function reduceBack(folder, xs) {\r\n const arr = toArray(xs);\r\n if (arr.length > 0) {\r\n return arr.reduceRight(folder);\r\n }\r\n else {\r\n throw (new Error(SR_inputSequenceEmpty));\r\n }\r\n}\r\n\r\nexport function replicate(n, x) {\r\n return initialize(n, (_arg1) => x);\r\n}\r\n\r\nexport function reverse(xs) {\r\n return delay(() => ofArray(reverse_1(toArray(xs))));\r\n}\r\n\r\nexport function scan(folder, state, xs) {\r\n return delay(() => {\r\n let acc = state;\r\n return concat([singleton(state), map((x) => {\r\n acc = folder(acc, x);\r\n return acc;\r\n }, xs)]);\r\n });\r\n}\r\n\r\nexport function scanBack(folder, xs, state) {\r\n return delay(() => ofArray(scanBack_1(folder, toArray(xs), state)));\r\n}\r\n\r\nexport function skip(count, source) {\r\n return mkSeq(() => {\r\n const e = ofSeq(source);\r\n try {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n return Enumerator_enumerateThenFinally(() => {\r\n }, e);\r\n }\r\n catch (matchValue) {\r\n disposeSafe(e);\r\n throw matchValue;\r\n }\r\n });\r\n}\r\n\r\nexport function skipWhile(predicate, xs) {\r\n return delay(() => {\r\n let skipped = true;\r\n return filter((x) => {\r\n if (skipped) {\r\n skipped = predicate(x);\r\n }\r\n return !skipped;\r\n }, xs);\r\n });\r\n}\r\n\r\nexport function tail(xs) {\r\n return skip(1, xs);\r\n}\r\n\r\nexport function take(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < count) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_notEnoughElements + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n }\r\n else {\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function takeWhile(predicate, xs) {\r\n return generate(() => ofSeq(xs), (e) => ((e[\"System.Collections.IEnumerator.MoveNext\"]() && predicate(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]())) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function truncate(count, xs) {\r\n return generateIndexed(() => ofSeq(xs), (i, e) => (((i < count) && e[\"System.Collections.IEnumerator.MoveNext\"]()) ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0)), (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function zip(xs, ys) {\r\n return map2((x, y) => [x, y], xs, ys);\r\n}\r\n\r\nexport function zip3(xs, ys, zs) {\r\n return map3((x, y, z) => [x, y, z], xs, ys, zs);\r\n}\r\n\r\nexport function collect(mapping, xs) {\r\n return delay(() => concat(map(mapping, xs)));\r\n}\r\n\r\nexport function where(predicate, xs) {\r\n return filter(predicate, xs);\r\n}\r\n\r\nexport function pairwise(xs) {\r\n return delay(() => ofArray(pairwise_1(toArray(xs))));\r\n}\r\n\r\nexport function splitInto(chunks, xs) {\r\n return delay(() => ofArray(map_1(ofArray, splitInto_1(chunks, toArray(xs)))));\r\n}\r\n\r\nexport function windowed(windowSize, xs) {\r\n return delay(() => ofArray(map_1(ofArray, windowed_1(windowSize, toArray(xs)))));\r\n}\r\n\r\nexport function transpose(xss) {\r\n return delay(() => ofArray(map_1(ofArray, transpose_1(map_1(toArray, toArray(xss))))));\r\n}\r\n\r\nexport function sortWith(comparer, xs) {\r\n return delay(() => {\r\n const arr = toArray(xs);\r\n arr.sort(comparer);\r\n return ofArray(arr);\r\n });\r\n}\r\n\r\nexport function sort(xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(x, y), xs);\r\n}\r\n\r\nexport function sortBy(projection, xs, comparer) {\r\n return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);\r\n}\r\n\r\nexport function sortDescending(xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);\r\n}\r\n\r\nexport function sortByDescending(projection, xs, comparer) {\r\n return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);\r\n}\r\n\r\nexport function sum(xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);\r\n}\r\n\r\nexport function sumBy(f, xs, adder) {\r\n return fold((acc, x) => adder.Add(acc, f(x)), adder.GetZero(), xs);\r\n}\r\n\r\nexport function maxBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function max(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? y : x), xs);\r\n}\r\n\r\nexport function minBy(projection, xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(projection(y), projection(x)) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function min(xs, comparer) {\r\n return reduce((x, y) => ((comparer.Compare(y, x) > 0) ? x : y), xs);\r\n}\r\n\r\nexport function average(xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, x);\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function averageBy(f, xs, averager) {\r\n let count = 0;\r\n const total = fold((acc, x) => {\r\n count = ((count + 1) | 0);\r\n return averager.Add(acc, f(x));\r\n }, averager.GetZero(), xs);\r\n if (count === 0) {\r\n throw (new Error((SR_inputSequenceEmpty + \"\\\\nParameter name: \") + \"source\"));\r\n }\r\n else {\r\n return averager.DivideByInt(total, count);\r\n }\r\n}\r\n\r\nexport function permute(f, xs) {\r\n return delay(() => ofArray(permute_1(f, toArray(xs))));\r\n}\r\n\r\nexport function chunkBySize(chunkSize, xs) {\r\n return delay(() => ofArray(map_1(ofArray, chunkBySize_1(chunkSize, toArray(xs)))));\r\n}\r\n\r\nexport function insertAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if (i === index) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function insertManyAt(index, ys, xs) {\r\n let status = -1;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {\r\n const e1 = tupledArg[0];\r\n const e2 = tupledArg[1];\r\n if (i === index) {\r\n status = 0;\r\n }\r\n let inserted;\r\n if (status === 0) {\r\n if (e2[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n inserted = some(e2[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n status = 1;\r\n inserted = (void 0);\r\n }\r\n }\r\n else {\r\n inserted = (void 0);\r\n }\r\n if (inserted == null) {\r\n if (e1[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e1[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n if (status < 1) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }\r\n else {\r\n return some(value_1(inserted));\r\n }\r\n }, (tupledArg_1) => {\r\n disposeSafe(tupledArg_1[0]);\r\n disposeSafe(tupledArg_1[1]);\r\n });\r\n}\r\n\r\nexport function removeAt(index, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function removeManyAt(index, count, xs) {\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if (i < index) {\r\n if (e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n }\r\n else {\r\n if (i === index) {\r\n for (let _ = 1; _ <= count; _++) {\r\n if (!e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"count\"));\r\n }\r\n }\r\n }\r\n return e[\"System.Collections.IEnumerator.MoveNext\"]() ? some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]()) : (void 0);\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\nexport function updateAt(index, y, xs) {\r\n let isDone = false;\r\n if (index < 0) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return generateIndexed(() => ofSeq(xs), (i, e) => {\r\n if ((isDone ? true : (i < index)) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n return some(e[\"System.Collections.Generic.IEnumerator`1.get_Current\"]());\r\n }\r\n else if ((i === index) && e[\"System.Collections.IEnumerator.MoveNext\"]()) {\r\n isDone = true;\r\n return some(y);\r\n }\r\n else {\r\n if (!isDone) {\r\n throw (new Error((SR_indexOutOfBounds + \"\\\\nParameter name: \") + \"index\"));\r\n }\r\n return void 0;\r\n }\r\n }, (e_1) => {\r\n disposeSafe(e_1);\r\n });\r\n}\r\n\r\n","import { toString as dateToString } from \"./Date.js\";\nimport { compare as numericCompare, isNumeric, multiply, toExponential, toFixed, toHex, toPrecision } from \"./Numeric.js\";\nimport { escape } from \"./RegExp.js\";\nimport { toString } from \"./Types.js\";\nconst fsFormatRegExp = /(^|[^%])%([0+\\- ]*)(\\*|\\d+)?(?:\\.(\\d+))?(\\w)/g;\nconst interpolateRegExp = /(?:(^|[^%])%([0+\\- ]*)(\\d+)?(?:\\.(\\d+))?(\\w))?%P\\(\\)/g;\nconst formatRegExp = /\\{(\\d+)(,-?\\d+)?(?:\\:([a-zA-Z])(\\d{0,2})|\\:(.+?))?\\}/g;\nfunction isLessThan(x, y) {\n return numericCompare(x, y) < 0;\n}\nfunction cmp(x, y, ic) {\n function isIgnoreCase(i) {\n return i === true ||\n i === 1 /* CurrentCultureIgnoreCase */ ||\n i === 3 /* InvariantCultureIgnoreCase */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n function isOrdinal(i) {\n return i === 4 /* Ordinal */ ||\n i === 5 /* OrdinalIgnoreCase */;\n }\n if (x == null) {\n return y == null ? 0 : -1;\n }\n if (y == null) {\n return 1;\n } // everything is bigger than null\n if (isOrdinal(ic)) {\n if (isIgnoreCase(ic)) {\n x = x.toLowerCase();\n y = y.toLowerCase();\n }\n return (x === y) ? 0 : (x < y ? -1 : 1);\n }\n else {\n if (isIgnoreCase(ic)) {\n x = x.toLocaleLowerCase();\n y = y.toLocaleLowerCase();\n }\n return x.localeCompare(y);\n }\n}\nexport function compare(...args) {\n switch (args.length) {\n case 2: return cmp(args[0], args[1], false);\n case 3: return cmp(args[0], args[1], args[2]);\n case 4: return cmp(args[0], args[1], args[2] === true);\n case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false);\n case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]);\n case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true);\n default: throw new Error(\"String.compare: Unsupported number of parameters\");\n }\n}\nexport function compareOrdinal(x, y) {\n return cmp(x, y, 4 /* Ordinal */);\n}\nexport function compareTo(x, y) {\n return cmp(x, y, 0 /* CurrentCulture */);\n}\nexport function startsWith(str, pattern, ic) {\n if (str.length >= pattern.length) {\n return cmp(str.substr(0, pattern.length), pattern, ic) === 0;\n }\n return false;\n}\nexport function indexOfAny(str, anyOf, ...args) {\n if (str == null || str === \"\") {\n return -1;\n }\n const startIndex = (args.length > 0) ? args[0] : 0;\n if (startIndex < 0) {\n throw new Error(\"Start index cannot be negative\");\n }\n const length = (args.length > 1) ? args[1] : str.length - startIndex;\n if (length < 0) {\n throw new Error(\"Length cannot be negative\");\n }\n if (length > str.length - startIndex) {\n throw new Error(\"Invalid startIndex and length\");\n }\n str = str.substr(startIndex, length);\n for (const c of anyOf) {\n const index = str.indexOf(c);\n if (index > -1) {\n return index + startIndex;\n }\n }\n return -1;\n}\nexport function printf(input) {\n return {\n input,\n cont: fsFormat(input),\n };\n}\nexport function interpolate(str, values) {\n let valIdx = 0;\n let strIdx = 0;\n let result = \"\";\n interpolateRegExp.lastIndex = 0;\n let match = interpolateRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n result += str.substring(strIdx, matchIndex).replace(/%%/g, \"%\");\n const [, , flags, padLength, precision, format] = match;\n result += formatReplacement(values[valIdx++], flags, padLength, precision, format);\n strIdx = interpolateRegExp.lastIndex;\n // Likewise we need to move interpolateRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n interpolateRegExp.lastIndex -= 1;\n match = interpolateRegExp.exec(str);\n }\n result += str.substring(strIdx).replace(/%%/g, \"%\");\n return result;\n}\nfunction continuePrint(cont, arg) {\n return typeof arg === \"string\" ? cont(arg) : arg.cont(cont);\n}\nexport function toConsole(arg) {\n // Don't remove the lambda here, see #1357\n return continuePrint((x) => console.log(x), arg);\n}\nexport function toConsoleError(arg) {\n return continuePrint((x) => console.error(x), arg);\n}\nexport function toText(arg) {\n return continuePrint((x) => x, arg);\n}\nexport function toFail(arg) {\n return continuePrint((x) => {\n throw new Error(x);\n }, arg);\n}\nfunction formatReplacement(rep, flags, padLength, precision, format) {\n let sign = \"\";\n flags = flags || \"\";\n format = format || \"\";\n if (isNumeric(rep)) {\n if (format.toLowerCase() !== \"x\") {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n else {\n if (flags.indexOf(\" \") >= 0) {\n sign = \" \";\n }\n else if (flags.indexOf(\"+\") >= 0) {\n sign = \"+\";\n }\n }\n }\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 6;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"x\":\n rep = toHex(rep);\n break;\n case \"X\":\n rep = toHex(rep).toUpperCase();\n break;\n default: // AOid\n rep = String(rep);\n break;\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep);\n }\n else {\n rep = toString(rep);\n }\n padLength = typeof padLength === \"number\" ? padLength : parseInt(padLength, 10);\n if (!isNaN(padLength)) {\n const zeroFlag = flags.indexOf(\"0\") >= 0; // Use '0' for left padding\n const minusFlag = flags.indexOf(\"-\") >= 0; // Right padding\n const ch = minusFlag || !zeroFlag ? \" \" : \"0\";\n if (ch === \"0\") {\n rep = padLeft(rep, padLength - sign.length, ch, minusFlag);\n rep = sign + rep;\n }\n else {\n rep = padLeft(sign + rep, padLength, ch, minusFlag);\n }\n }\n else {\n rep = sign + rep;\n }\n return rep;\n}\nfunction createPrinter(cont, _strParts, _matches, _result = \"\", padArg = -1) {\n return (...args) => {\n // Make copies of the values passed by reference because the function can be used multiple times\n let result = _result;\n const strParts = _strParts.slice();\n const matches = _matches.slice();\n for (const arg of args) {\n const [, , flags, _padLength, precision, format] = matches[0];\n let padLength = _padLength;\n if (padArg >= 0) {\n padLength = padArg;\n padArg = -1;\n }\n else if (padLength === \"*\") {\n if (arg < 0) {\n throw new Error(\"Non-negative number required\");\n }\n padArg = arg;\n continue;\n }\n result += strParts[0];\n result += formatReplacement(arg, flags, padLength, precision, format);\n strParts.splice(0, 1);\n matches.splice(0, 1);\n }\n if (matches.length === 0) {\n result += strParts[0];\n return cont(result);\n }\n else {\n return createPrinter(cont, strParts, matches, result, padArg);\n }\n };\n}\nexport function fsFormat(str) {\n return (cont) => {\n fsFormatRegExp.lastIndex = 0;\n const strParts = [];\n const matches = [];\n let strIdx = 0;\n let match = fsFormatRegExp.exec(str);\n while (match) {\n // The first group corresponds to the no-escape char (^|[^%]), the actual pattern starts in the next char\n // Note: we don't use negative lookbehind because some browsers don't support it yet\n const matchIndex = match.index + (match[1] || \"\").length;\n strParts.push(str.substring(strIdx, matchIndex).replace(/%%/g, \"%\"));\n matches.push(match);\n strIdx = fsFormatRegExp.lastIndex;\n // Likewise we need to move fsFormatRegExp.lastIndex one char behind to make sure we match the no-escape char next time\n fsFormatRegExp.lastIndex -= 1;\n match = fsFormatRegExp.exec(str);\n }\n if (strParts.length === 0) {\n return cont(str.replace(/%%/g, \"%\"));\n }\n else {\n strParts.push(str.substring(strIdx).replace(/%%/g, \"%\"));\n return createPrinter(cont, strParts, matches);\n }\n };\n}\nexport function format(str, ...args) {\n if (typeof str === \"object\" && args.length > 0) {\n // Called with culture info\n str = args[0];\n args.shift();\n }\n return str.replace(formatRegExp, (_, idx, padLength, format, precision, pattern) => {\n if (idx < 0 || idx >= args.length) {\n throw new Error(\"Index must be greater or equal to zero and less than the arguments' length.\");\n }\n let rep = args[idx];\n if (isNumeric(rep)) {\n precision = precision == null ? null : parseInt(precision, 10);\n switch (format) {\n case \"f\":\n case \"F\":\n precision = precision != null ? precision : 2;\n rep = toFixed(rep, precision);\n break;\n case \"g\":\n case \"G\":\n rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);\n break;\n case \"e\":\n case \"E\":\n rep = precision != null ? toExponential(rep, precision) : toExponential(rep);\n break;\n case \"p\":\n case \"P\":\n precision = precision != null ? precision : 2;\n rep = toFixed(multiply(rep, 100), precision) + \" %\";\n break;\n case \"d\":\n case \"D\":\n rep = precision != null ? padLeft(String(rep), precision, \"0\") : String(rep);\n break;\n case \"x\":\n case \"X\":\n rep = precision != null ? padLeft(toHex(rep), precision, \"0\") : toHex(rep);\n if (format === \"X\") {\n rep = rep.toUpperCase();\n }\n break;\n default:\n if (pattern) {\n let sign = \"\";\n rep = pattern.replace(/([0#,]+)(\\.[0#]+)?/, (_, intPart, decimalPart) => {\n if (isLessThan(rep, 0)) {\n rep = multiply(rep, -1);\n sign = \"-\";\n }\n const decimalPartLength = decimalPart != null ? decimalPart.length : 0;\n rep = toFixed(rep, Math.max(decimalPartLength - 1, 0));\n // Thousands separator\n if (intPart.indexOf(\",\") > 0) {\n const [intPart, decimalPart] = rep.split(\".\");\n const i = intPart.length % 3;\n const thousandGroups = Math.floor(intPart.length / 3);\n let thousands = i > 0 ? intPart.substr(0, i) + (thousandGroups > 0 ? \",\" : \"\") : \"\";\n for (let j = 0; j < thousandGroups; j++) {\n thousands += intPart.substr(i + j * 3, 3) + (j < thousandGroups - 1 ? \",\" : \"\");\n }\n rep = decimalPart ? thousands + \".\" + decimalPart : thousands;\n }\n // In .NET you can mix 0/# placeholders but for simplicity we only check the left most character\n intPart = intPart.replace(/,/g, \"\");\n const intPartLength = intPart.length > 0 && intPart[0] === \"0\" ? intPart.length : 0;\n return padLeft(rep, intPartLength - sign.length + decimalPartLength, \"0\");\n });\n rep = sign + rep;\n }\n }\n }\n else if (rep instanceof Date) {\n rep = dateToString(rep, pattern || format);\n }\n else {\n rep = toString(rep);\n }\n padLength = parseInt((padLength || \" \").substring(1), 10);\n if (!isNaN(padLength)) {\n rep = padLeft(String(rep), Math.abs(padLength), \" \", padLength < 0);\n }\n return rep;\n });\n}\nexport function endsWith(str, search) {\n const idx = str.lastIndexOf(search);\n return idx >= 0 && idx === str.length - search.length;\n}\nexport function initialize(n, f) {\n if (n < 0) {\n throw new Error(\"String length must be non-negative\");\n }\n const xs = new Array(n);\n for (let i = 0; i < n; i++) {\n xs[i] = f(i);\n }\n return xs.join(\"\");\n}\nexport function insert(str, startIndex, value) {\n if (startIndex < 0 || startIndex > str.length) {\n throw new Error(\"startIndex is negative or greater than the length of this instance.\");\n }\n return str.substring(0, startIndex) + value + str.substring(startIndex);\n}\nexport function isNullOrEmpty(str) {\n return typeof str !== \"string\" || str.length === 0;\n}\nexport function isNullOrWhiteSpace(str) {\n return typeof str !== \"string\" || /^\\s*$/.test(str);\n}\nexport function concat(...xs) {\n return xs.map((x) => String(x)).join(\"\");\n}\nexport function join(delimiter, xs) {\n if (Array.isArray(xs)) {\n return xs.join(delimiter);\n }\n else {\n return Array.from(xs).join(delimiter);\n }\n}\nexport function joinWithIndices(delimiter, xs, startIndex, count) {\n const endIndexPlusOne = startIndex + count;\n if (endIndexPlusOne > xs.length) {\n throw new Error(\"Index and count must refer to a location within the buffer.\");\n }\n return xs.slice(startIndex, endIndexPlusOne).join(delimiter);\n}\nfunction notSupported(name) {\n throw new Error(\"The environment doesn't support '\" + name + \"', please use a polyfill.\");\n}\nexport function toBase64String(inArray) {\n let str = \"\";\n for (let i = 0; i < inArray.length; i++) {\n str += String.fromCharCode(inArray[i]);\n }\n return typeof btoa === \"function\" ? btoa(str) : notSupported(\"btoa\");\n}\nexport function fromBase64String(b64Encoded) {\n const binary = typeof atob === \"function\" ? atob(b64Encoded) : notSupported(\"atob\");\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\nexport function padLeft(str, len, ch, isRight) {\n ch = ch || \" \";\n len = len - str.length;\n for (let i = 0; i < len; i++) {\n str = isRight ? str + ch : ch + str;\n }\n return str;\n}\nexport function padRight(str, len, ch) {\n return padLeft(str, len, ch, true);\n}\nexport function remove(str, startIndex, count) {\n if (startIndex >= str.length) {\n throw new Error(\"startIndex must be less than length of string\");\n }\n if (typeof count === \"number\" && (startIndex + count) > str.length) {\n throw new Error(\"Index and count must refer to a location within the string.\");\n }\n return str.slice(0, startIndex) + (typeof count === \"number\" ? str.substr(startIndex + count) : \"\");\n}\nexport function replace(str, search, replace) {\n return str.replace(new RegExp(escape(search), \"g\"), replace);\n}\nexport function replicate(n, x) {\n return initialize(n, () => x);\n}\nexport function getCharAtIndex(input, index) {\n if (index < 0 || index >= input.length) {\n throw new Error(\"Index was outside the bounds of the array.\");\n }\n return input[index];\n}\nexport function split(str, splitters, count, options) {\n count = typeof count === \"number\" ? count : undefined;\n options = typeof options === \"number\" ? options : 0;\n if (count && count < 0) {\n throw new Error(\"Count cannot be less than zero\");\n }\n if (count === 0) {\n return [];\n }\n const removeEmpty = (options & 1) === 1;\n const trim = (options & 2) === 2;\n splitters = splitters || [];\n splitters = splitters.filter(x => x).map(escape);\n splitters = splitters.length > 0 ? splitters : [\"\\\\s\"];\n const splits = [];\n const reg = new RegExp(splitters.join(\"|\"), \"g\");\n let findSplits = true;\n let i = 0;\n do {\n const match = reg.exec(str);\n if (match === null) {\n const candidate = trim ? str.substring(i).trim() : str.substring(i);\n if (!removeEmpty || candidate.length > 0) {\n splits.push(candidate);\n }\n findSplits = false;\n }\n else {\n const candidate = trim ? str.substring(i, match.index).trim() : str.substring(i, match.index);\n if (!removeEmpty || candidate.length > 0) {\n if (count != null && splits.length + 1 === count) {\n splits.push(trim ? str.substring(i).trim() : str.substring(i));\n findSplits = false;\n }\n else {\n splits.push(candidate);\n }\n }\n i = reg.lastIndex;\n }\n } while (findSplits);\n return splits;\n}\nexport function trim(str, ...chars) {\n if (chars.length === 0) {\n return str.trim();\n }\n const pattern = \"[\" + escape(chars.join(\"\")) + \"]+\";\n return str.replace(new RegExp(\"^\" + pattern), \"\").replace(new RegExp(pattern + \"$\"), \"\");\n}\nexport function trimStart(str, ...chars) {\n return chars.length === 0\n ? str.trimStart()\n : str.replace(new RegExp(\"^[\" + escape(chars.join(\"\")) + \"]+\"), \"\");\n}\nexport function trimEnd(str, ...chars) {\n return chars.length === 0\n ? str.trimEnd()\n : str.replace(new RegExp(\"[\" + escape(chars.join(\"\")) + \"]+$\"), \"\");\n}\nexport function filter(pred, x) {\n return x.split(\"\").filter((c) => pred(c)).join(\"\");\n}\nexport function substring(str, startIndex, length) {\n if ((startIndex + (length || 0) > str.length)) {\n throw new Error(\"Invalid startIndex and/or length\");\n }\n return length != null ? str.substr(startIndex, length) : str.substr(startIndex);\n}\nexport function fmt(strs, ...args) {\n return ({ strs, args });\n}\nexport function fmtWith(fmts) {\n return (strs, ...args) => ({ strs, args, fmts });\n}\nexport function getFormat(s) {\n return s.fmts\n ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart)\n : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart);\n}\n","import { substring, format, isNullOrEmpty, join } from \"./String.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\nimport { clear, int32ToString } from \"./Util.js\";\r\nimport { toString } from \"./Types.js\";\r\n\r\nexport class StringBuilder {\r\n constructor(value, capacity) {\r\n this.buf = [];\r\n if (!isNullOrEmpty(value)) {\r\n void (this.buf.push(value));\r\n }\r\n }\r\n toString() {\r\n const __ = this;\r\n return join(\"\", __.buf);\r\n }\r\n}\r\n\r\nexport function StringBuilder$reflection() {\r\n return class_type(\"System.Text.StringBuilder\", void 0, StringBuilder);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z18115A39(value, capacity) {\r\n return new StringBuilder(value, capacity);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z524259A4(capacity) {\r\n return StringBuilder_$ctor_Z18115A39(\"\", capacity);\r\n}\r\n\r\nexport function StringBuilder_$ctor_Z721C83C5(value) {\r\n return StringBuilder_$ctor_Z18115A39(value, 16);\r\n}\r\n\r\nexport function StringBuilder_$ctor() {\r\n return StringBuilder_$ctor_Z18115A39(\"\", 16);\r\n}\r\n\r\nexport function StringBuilder__Append_Z721C83C5(x, s) {\r\n void (x.buf.push(s));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_244C7CD6(x, c) {\r\n void (x.buf.push(c));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_Z524259A4(x, o) {\r\n void (x.buf.push(int32ToString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_5E38073B(x, o) {\r\n void (x.buf.push(o.toString()));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_Z1FBCCD16(x, o) {\r\n void (x.buf.push(toString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_4E60E31B(x, o) {\r\n void (x.buf.push(toString(o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_695F1130(x, cs) {\r\n void (x.buf.push(cs.join('')));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__Append_43A65C09(x, s) {\r\n void (x.buf.push(toString(s)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendFormat_433E080(x, fmt, o) {\r\n void (x.buf.push(format(fmt, o)));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendLine(x) {\r\n void (x.buf.push(\"\\n\"));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__AppendLine_Z721C83C5(x, s) {\r\n void (x.buf.push(s));\r\n void (x.buf.push(\"\\n\"));\r\n return x;\r\n}\r\n\r\nexport function StringBuilder__get_Length(x) {\r\n let len = 0;\r\n for (let i = x.buf.length - 1; i >= 0; i--) {\r\n len = ((len + x.buf[i].length) | 0);\r\n }\r\n return len | 0;\r\n}\r\n\r\nexport function StringBuilder__ToString_Z37302880(x, firstIndex, length) {\r\n return substring(toString(x), firstIndex, length);\r\n}\r\n\r\nexport function StringBuilder__Clear(x) {\r\n clear(x.buf);\r\n return x;\r\n}\r\n\r\n","import { Exception } from \"./Types.js\";\r\nimport { class_type } from \"./Reflection.js\";\r\n\r\nexport class SystemException extends Exception {\r\n constructor() {\r\n super();\r\n }\r\n}\r\n\r\nexport function SystemException$reflection() {\r\n return class_type(\"System.SystemException\", void 0, SystemException, class_type(\"System.Exception\"));\r\n}\r\n\r\nexport function SystemException_$ctor() {\r\n return new SystemException();\r\n}\r\n\r\nexport class TimeoutException extends SystemException {\r\n constructor() {\r\n super();\r\n }\r\n}\r\n\r\nexport function TimeoutException$reflection() {\r\n return class_type(\"System.TimeoutException\", void 0, TimeoutException, SystemException$reflection());\r\n}\r\n\r\nexport function TimeoutException_$ctor() {\r\n return new TimeoutException();\r\n}\r\n\r\n","import { combineHashCodes, compare, compareArrays, equalArrays, equals, sameConstructor, numberHash, structuralHash } from \"./Util.js\";\nexport function seqToString(self) {\n let count = 0;\n let str = \"[\";\n for (const x of self) {\n if (count === 0) {\n str += toString(x);\n }\n else if (count === 100) {\n str += \"; ...\";\n break;\n }\n else {\n str += \"; \" + toString(x);\n }\n count++;\n }\n return str + \"]\";\n}\nexport function toString(x, callStack = 0) {\n if (x != null && typeof x === \"object\") {\n if (typeof x.toString === \"function\") {\n return x.toString();\n }\n else if (Symbol.iterator in x) {\n return seqToString(x);\n }\n else { // TODO: Date?\n const cons = Object.getPrototypeOf(x).constructor;\n return cons === Object && callStack < 10\n // Same format as recordToString\n ? \"{ \" + Object.entries(x).map(([k, v]) => k + \" = \" + toString(v, callStack + 1)).join(\"\\n \") + \" }\"\n : cons.name;\n }\n }\n return String(x);\n}\nexport function unionToString(name, fields) {\n if (fields.length === 0) {\n return name;\n }\n else {\n let fieldStr = \"\";\n let withParens = true;\n if (fields.length === 1) {\n fieldStr = toString(fields[0]);\n withParens = fieldStr.indexOf(\" \") >= 0;\n }\n else {\n fieldStr = fields.map((x) => toString(x)).join(\", \");\n }\n return name + (withParens ? \" (\" : \" \") + fieldStr + (withParens ? \")\" : \"\");\n }\n}\nexport class Union {\n get name() {\n return this.cases()[this.tag];\n }\n toJSON() {\n return this.fields.length === 0 ? this.name : [this.name].concat(this.fields);\n }\n toString() {\n return unionToString(this.name, this.fields);\n }\n GetHashCode() {\n const hashes = this.fields.map((x) => structuralHash(x));\n hashes.splice(0, 0, numberHash(this.tag));\n return combineHashCodes(hashes);\n }\n Equals(other) {\n if (this === other) {\n return true;\n }\n else if (!sameConstructor(this, other)) {\n return false;\n }\n else if (this.tag === other.tag) {\n return equalArrays(this.fields, other.fields);\n }\n else {\n return false;\n }\n }\n CompareTo(other) {\n if (this === other) {\n return 0;\n }\n else if (!sameConstructor(this, other)) {\n return -1;\n }\n else if (this.tag === other.tag) {\n return compareArrays(this.fields, other.fields);\n }\n else {\n return this.tag < other.tag ? -1 : 1;\n }\n }\n}\nfunction recordToJSON(self) {\n const o = {};\n const keys = Object.keys(self);\n for (let i = 0; i < keys.length; i++) {\n o[keys[i]] = self[keys[i]];\n }\n return o;\n}\nfunction recordToString(self) {\n return \"{ \" + Object.entries(self).map(([k, v]) => k + \" = \" + toString(v)).join(\"\\n \") + \" }\";\n}\nfunction recordGetHashCode(self) {\n const hashes = Object.values(self).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n}\nfunction recordEquals(self, other) {\n if (self === other) {\n return true;\n }\n else if (!sameConstructor(self, other)) {\n return false;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n if (!equals(self[thisNames[i]], other[thisNames[i]])) {\n return false;\n }\n }\n return true;\n }\n}\nfunction recordCompareTo(self, other) {\n if (self === other) {\n return 0;\n }\n else if (!sameConstructor(self, other)) {\n return -1;\n }\n else {\n const thisNames = Object.keys(self);\n for (let i = 0; i < thisNames.length; i++) {\n const result = compare(self[thisNames[i]], other[thisNames[i]]);\n if (result !== 0) {\n return result;\n }\n }\n return 0;\n }\n}\nexport class Record {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class FSharpRef {\n constructor(contentsOrGetter, setter) {\n if (typeof setter === \"function\") {\n this.getter = contentsOrGetter;\n this.setter = setter;\n }\n else {\n this.getter = () => contentsOrGetter;\n this.setter = (v) => { contentsOrGetter = v; };\n }\n }\n get contents() {\n return this.getter();\n }\n set contents(v) {\n this.setter(v);\n }\n}\n// EXCEPTIONS\n// Exception is intentionally not derived from Error, for performance reasons (see #2160)\nexport class Exception {\n constructor(message) {\n this.message = message;\n }\n}\nexport function isException(x) {\n return x instanceof Exception || x instanceof Error;\n}\nexport class FSharpException extends Exception {\n toJSON() { return recordToJSON(this); }\n toString() { return recordToString(this); }\n GetHashCode() { return recordGetHashCode(this); }\n Equals(other) { return recordEquals(this, other); }\n CompareTo(other) { return recordCompareTo(this, other); }\n}\nexport class MatchFailureException extends FSharpException {\n constructor(arg1, arg2, arg3) {\n super();\n this.arg1 = arg1;\n this.arg2 = arg2 | 0;\n this.arg3 = arg3 | 0;\n this.message = \"The match cases were incomplete\";\n }\n}\nexport class Attribute {\n}\n","// tslint:disable:ban-types\nexport function isIterable(x) {\n return x != null && typeof x === \"object\" && Symbol.iterator in x;\n}\nexport function isArrayLike(x) {\n return Array.isArray(x) || ArrayBuffer.isView(x);\n}\nfunction isComparer(x) {\n return typeof x.Compare === \"function\";\n}\nfunction isComparable(x) {\n return typeof x.CompareTo === \"function\";\n}\nfunction isEquatable(x) {\n return typeof x.Equals === \"function\";\n}\nfunction isHashable(x) {\n return typeof x.GetHashCode === \"function\";\n}\nexport function isDisposable(x) {\n return x != null && typeof x.Dispose === \"function\";\n}\nexport function disposeSafe(x) {\n if (isDisposable(x)) {\n x.Dispose();\n }\n}\nexport function sameConstructor(x, y) {\n return Object.getPrototypeOf(x).constructor === Object.getPrototypeOf(y).constructor;\n}\nexport class Enumerator {\n constructor(iter) {\n this.iter = iter;\n }\n [\"System.Collections.Generic.IEnumerator`1.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.get_Current\"]() {\n return this.current;\n }\n [\"System.Collections.IEnumerator.MoveNext\"]() {\n const cur = this.iter.next();\n this.current = cur.value;\n return !cur.done;\n }\n [\"System.Collections.IEnumerator.Reset\"]() {\n throw new Error(\"JS iterators cannot be reset\");\n }\n Dispose() {\n return;\n }\n}\nexport function getEnumerator(o) {\n return typeof o.GetEnumerator === \"function\"\n ? o.GetEnumerator()\n : new Enumerator(o[Symbol.iterator]());\n}\nexport function toIterator(en) {\n return {\n [Symbol.iterator]() { return this; },\n next() {\n const hasNext = en[\"System.Collections.IEnumerator.MoveNext\"]();\n const current = hasNext ? en[\"System.Collections.IEnumerator.get_Current\"]() : undefined;\n return { done: !hasNext, value: current };\n },\n };\n}\nexport class Comparer {\n constructor(f) {\n this.Compare = f || compare;\n }\n}\nexport function comparerFromEqualityComparer(comparer) {\n // Sometimes IEqualityComparer also implements IComparer\n if (isComparer(comparer)) {\n return new Comparer(comparer.Compare);\n }\n else {\n return new Comparer((x, y) => {\n const xhash = comparer.GetHashCode(x);\n const yhash = comparer.GetHashCode(y);\n if (xhash === yhash) {\n return comparer.Equals(x, y) ? 0 : -1;\n }\n else {\n return xhash < yhash ? -1 : 1;\n }\n });\n }\n}\nexport function assertEqual(actual, expected, msg) {\n if (!equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport function assertNotEqual(actual, expected, msg) {\n if (equals(actual, expected)) {\n throw Object.assign(new Error(msg || `Expected: ${expected} - Actual: ${actual}`), {\n actual,\n expected,\n });\n }\n}\nexport class Lazy {\n constructor(factory) {\n this.factory = factory;\n this.isValueCreated = false;\n }\n get Value() {\n if (!this.isValueCreated) {\n this.createdValue = this.factory();\n this.isValueCreated = true;\n }\n return this.createdValue;\n }\n get IsValueCreated() {\n return this.isValueCreated;\n }\n}\nexport function lazyFromValue(v) {\n return new Lazy(() => v);\n}\nexport function padWithZeros(i, length) {\n let str = i.toString(10);\n while (str.length < length) {\n str = \"0\" + str;\n }\n return str;\n}\nexport function padLeftAndRightWithZeros(i, lengthLeft, lengthRight) {\n let str = i.toString(10);\n while (str.length < lengthLeft) {\n str = \"0\" + str;\n }\n while (str.length < lengthRight) {\n str = str + \"0\";\n }\n return str;\n}\nexport function dateOffset(date) {\n const date1 = date;\n return typeof date1.offset === \"number\"\n ? date1.offset\n : (date.kind === 1 /* UTC */\n ? 0 : date.getTimezoneOffset() * -60000);\n}\nexport function int16ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport function int32ToString(i, radix) {\n i = i < 0 && radix != null && radix !== 10 ? 0xFFFFFFFF + i + 1 : i;\n return i.toString(radix);\n}\nexport class ObjectRef {\n static id(o) {\n if (!ObjectRef.idMap.has(o)) {\n ObjectRef.idMap.set(o, ++ObjectRef.count);\n }\n return ObjectRef.idMap.get(o);\n }\n}\nObjectRef.idMap = new WeakMap();\nObjectRef.count = 0;\nexport function stringHash(s) {\n let i = 0;\n let h = 5381;\n const len = s.length;\n while (i < len) {\n h = (h * 33) ^ s.charCodeAt(i++);\n }\n return h;\n}\nexport function numberHash(x) {\n return x * 2654435761 | 0;\n}\n// From https://stackoverflow.com/a/37449594\nexport function combineHashCodes(hashes) {\n if (hashes.length === 0) {\n return 0;\n }\n return hashes.reduce((h1, h2) => {\n return ((h1 << 5) + h1) ^ h2;\n });\n}\nexport function physicalHash(x) {\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default:\n return numberHash(ObjectRef.id(x));\n }\n}\nexport function identityHash(x) {\n if (x == null) {\n return 0;\n }\n else if (isHashable(x)) {\n return x.GetHashCode();\n }\n else {\n return physicalHash(x);\n }\n}\nexport function dateHash(x) {\n return x.getTime();\n}\nexport function arrayHash(x) {\n const len = x.length;\n const hashes = new Array(len);\n for (let i = 0; i < len; i++) {\n hashes[i] = structuralHash(x[i]);\n }\n return combineHashCodes(hashes);\n}\nexport function structuralHash(x) {\n if (x == null) {\n return 0;\n }\n switch (typeof x) {\n case \"boolean\":\n return x ? 1 : 0;\n case \"number\":\n return numberHash(x);\n case \"string\":\n return stringHash(x);\n default: {\n if (isHashable(x)) {\n return x.GetHashCode();\n }\n else if (isArrayLike(x)) {\n return arrayHash(x);\n }\n else if (x instanceof Date) {\n return dateHash(x);\n }\n else if (Object.getPrototypeOf(x).constructor === Object) {\n // TODO: check call-stack to prevent cyclic objects?\n const hashes = Object.values(x).map((v) => structuralHash(v));\n return combineHashCodes(hashes);\n }\n else {\n // Classes don't implement GetHashCode by default, but must use identity hashing\n return numberHash(ObjectRef.id(x));\n // return stringHash(String(x));\n }\n }\n }\n}\n// Intended for custom numeric types, like long or decimal\nexport function fastStructuralHash(x) {\n return stringHash(String(x));\n}\n// Intended for declared types that may or may not implement GetHashCode\nexport function safeHash(x) {\n return x == null ? 0 : isHashable(x) ? x.GetHashCode() : numberHash(ObjectRef.id(x));\n}\nexport function equalArraysWith(x, y, eq) {\n if (x == null) {\n return y == null;\n }\n if (y == null) {\n return false;\n }\n if (x.length !== y.length) {\n return false;\n }\n for (let i = 0; i < x.length; i++) {\n if (!eq(x[i], y[i])) {\n return false;\n }\n }\n return true;\n}\nexport function equalArrays(x, y) {\n return equalArraysWith(x, y, equals);\n}\nfunction equalObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return false;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0; i < xKeys.length; i++) {\n if (xKeys[i] !== yKeys[i] || !equals(x[xKeys[i]], y[yKeys[i]])) {\n return false;\n }\n }\n return true;\n}\nexport function equals(x, y) {\n if (x === y) {\n return true;\n }\n else if (x == null) {\n return y == null;\n }\n else if (y == null) {\n return false;\n }\n else if (typeof x !== \"object\") {\n return false;\n }\n else if (isEquatable(x)) {\n return x.Equals(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) && equalArrays(x, y);\n }\n else if (x instanceof Date) {\n return (y instanceof Date) && compareDates(x, y) === 0;\n }\n else {\n return Object.getPrototypeOf(x).constructor === Object && equalObjects(x, y);\n }\n}\nexport function compareDates(x, y) {\n let xtime;\n let ytime;\n // DateTimeOffset and DateTime deals with equality differently.\n if (\"offset\" in x && \"offset\" in y) {\n xtime = x.getTime();\n ytime = y.getTime();\n }\n else {\n xtime = x.getTime() + dateOffset(x);\n ytime = y.getTime() + dateOffset(y);\n }\n return xtime === ytime ? 0 : (xtime < ytime ? -1 : 1);\n}\nexport function comparePrimitives(x, y) {\n return x === y ? 0 : (x < y ? -1 : 1);\n}\nexport function compareArraysWith(x, y, comp) {\n if (x == null) {\n return y == null ? 0 : 1;\n }\n if (y == null) {\n return -1;\n }\n if (x.length !== y.length) {\n return x.length < y.length ? -1 : 1;\n }\n for (let i = 0, j = 0; i < x.length; i++) {\n j = comp(x[i], y[i]);\n if (j !== 0) {\n return j;\n }\n }\n return 0;\n}\nexport function compareArrays(x, y) {\n return compareArraysWith(x, y, compare);\n}\nfunction compareObjects(x, y) {\n const xKeys = Object.keys(x);\n const yKeys = Object.keys(y);\n if (xKeys.length !== yKeys.length) {\n return xKeys.length < yKeys.length ? -1 : 1;\n }\n xKeys.sort();\n yKeys.sort();\n for (let i = 0, j = 0; i < xKeys.length; i++) {\n const key = xKeys[i];\n if (key !== yKeys[i]) {\n return key < yKeys[i] ? -1 : 1;\n }\n else {\n j = compare(x[key], y[key]);\n if (j !== 0) {\n return j;\n }\n }\n }\n return 0;\n}\nexport function compare(x, y) {\n if (x === y) {\n return 0;\n }\n else if (x == null) {\n return y == null ? 0 : -1;\n }\n else if (y == null) {\n return 1;\n }\n else if (typeof x !== \"object\") {\n return x < y ? -1 : 1;\n }\n else if (isComparable(x)) {\n return x.CompareTo(y);\n }\n else if (isArrayLike(x)) {\n return isArrayLike(y) ? compareArrays(x, y) : -1;\n }\n else if (x instanceof Date) {\n return y instanceof Date ? compareDates(x, y) : -1;\n }\n else {\n return Object.getPrototypeOf(x).constructor === Object ? compareObjects(x, y) : -1;\n }\n}\nexport function min(comparer, x, y) {\n return comparer(x, y) < 0 ? x : y;\n}\nexport function max(comparer, x, y) {\n return comparer(x, y) > 0 ? x : y;\n}\nexport function clamp(comparer, value, min, max) {\n return (comparer(value, min) < 0) ? min : (comparer(value, max) > 0) ? max : value;\n}\nexport function createAtom(value) {\n let atom = value;\n return (value, isSetter) => {\n if (!isSetter) {\n return atom;\n }\n else {\n atom = value;\n return void 0;\n }\n };\n}\nexport function createObj(fields) {\n const obj = {};\n for (const kv of fields) {\n obj[kv[0]] = kv[1];\n }\n return obj;\n}\nexport function jsOptions(mutator) {\n const opts = {};\n mutator(opts);\n return opts;\n}\nexport function round(value, digits = 0) {\n const m = Math.pow(10, digits);\n const n = +(digits ? value * m : value).toFixed(8);\n const i = Math.floor(n);\n const f = n - i;\n const e = 1e-8;\n const r = (f > 0.5 - e && f < 0.5 + e) ? ((i % 2 === 0) ? i : i + 1) : Math.round(n);\n return digits ? r / m : r;\n}\nexport function sign(x) {\n return x > 0 ? 1 : x < 0 ? -1 : 0;\n}\nexport function unescapeDataString(s) {\n // https://stackoverflow.com/a/4458580/524236\n return decodeURIComponent((s).replace(/\\+/g, \"%20\"));\n}\nexport function escapeDataString(s) {\n return encodeURIComponent(s).replace(/!/g, \"%21\")\n .replace(/'/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\nexport function escapeUriString(s) {\n return encodeURI(s);\n}\n// ICollection.Clear and Count members can be called on Arrays\n// or Dictionaries so we need a runtime check (see #1120)\nexport function count(col) {\n if (isArrayLike(col)) {\n return col.length;\n }\n else {\n let count = 0;\n for (const _ of col) {\n count++;\n }\n return count;\n }\n}\nexport function clear(col) {\n if (isArrayLike(col)) {\n col.splice(0);\n }\n else {\n col.clear();\n }\n}\nconst CURRIED = Symbol(\"curried\");\nexport function uncurry(arity, f) {\n // f may be a function option with None value\n if (f == null || f.length > 1) {\n return f;\n }\n const uncurried = (...args) => {\n let res = f;\n for (let i = 0; i < arity; i++) {\n res = res(args[i]);\n }\n return res;\n };\n uncurried[CURRIED] = f;\n return uncurried;\n}\nfunction _curry(args, arity, f) {\n return (arg) => arity === 1\n ? f(...args.concat([arg]))\n // Note it's important to generate a new args array every time\n // because a partially applied function can be run multiple times\n : _curry(args.concat([arg]), arity - 1, f);\n}\nexport function curry(arity, f) {\n if (f == null || f.length === 1) {\n return f;\n }\n else if (CURRIED in f) {\n return f[CURRIED];\n }\n else {\n return _curry([], arity, f);\n }\n}\nexport function checkArity(arity, f) {\n return f.length > arity\n ? (...args1) => (...args2) => f.apply(undefined, args1.concat(args2))\n : f;\n}\nexport function partialApply(arity, f, args) {\n if (f == null) {\n return undefined;\n }\n else if (CURRIED in f) {\n f = f[CURRIED];\n for (let i = 0; i < args.length; i++) {\n f = f(args[i]);\n }\n return f;\n }\n else {\n return _curry(args, arity, f);\n }\n}\nexport function mapCurriedArgs(fn, mappings) {\n function mapArg(fn, arg, mappings, idx) {\n const mapping = mappings[idx];\n if (mapping !== 0) {\n const expectedArity = mapping[0];\n const actualArity = mapping[1];\n if (expectedArity > 1) {\n arg = curry(expectedArity, arg);\n }\n if (actualArity > 1) {\n arg = uncurry(actualArity, arg);\n }\n }\n const res = fn(arg);\n if (idx + 1 === mappings.length) {\n return res;\n }\n else {\n return (arg) => mapArg(res, arg, mappings, idx + 1);\n }\n }\n return (arg) => mapArg(fn, arg, mappings, 0);\n}\n","// Adapted from https://github.com/MikeMcl/big.js/blob/0f94dc9110d55c4f324a47ba6a2e832ce23ac589/big.mjs\n/* tslint:disable */\nimport { combineHashCodes } from \"../Util.js\";\nimport { symbol } from \"../Numeric.js\";\n// The shared prototype object.\nvar P = {\n GetHashCode() { return combineHashCodes([this.s, this.e].concat(this.c)); },\n Equals(x) { return !this.cmp(x); },\n CompareTo(x) { return this.cmp(x); },\n [symbol]() {\n const _this = this;\n return {\n multiply: y => _this.mul(y),\n toPrecision: sd => _this.toPrecision(sd),\n toExponential: dp => _this.toExponential(dp),\n toFixed: dp => _this.toFixed(dp),\n toHex: () => (Number(_this) >>> 0).toString(16),\n };\n }\n};\n/*\n * big.js v6.0.3\n * A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\n * Copyright (c) 2020 Michael Mclaughlin\n * https://github.com/MikeMcl/big.js/LICENCE.md\n */\n/************************************** EDITABLE DEFAULTS *****************************************/\n// The default values below must be integers within the stated ranges.\n/*\n * The maximum number of decimal places (DP) of the results of operations involving division:\n * div and sqrt, and pow with negative exponents.\n */\nvar DP = 28, // 0 to MAX_DP\n/*\n * The rounding mode (RM) used when rounding to the above decimal places.\n *\n * 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)\n * 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)\n * 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)\n * 3 Away from zero. (ROUND_UP)\n */\nRM = 1, // 0, 1, 2 or 3\n// The maximum value of DP and Big.DP.\nMAX_DP = 1E6, // 0 to 1000000\n// The maximum magnitude of the exponent argument to the pow method.\nMAX_POWER = 1E6, // 1 to 1000000\n/*\n * The negative exponent (NE) at and beneath which toString returns exponential notation.\n * (JavaScript numbers: -7)\n * -1000000 is the minimum recommended exponent value of a Big.\n */\nNE = -29, // 0 to -1000000\n/*\n * The positive exponent (PE) at and above which toString returns exponential notation.\n * (JavaScript numbers: 21)\n * 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.\n */\nPE = 29, // 0 to 1000000\n/*\n * When true, an error will be thrown if a primitive number is passed to the Big constructor,\n * or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a\n * primitive number without a loss of precision.\n */\nSTRICT = false, // true or false\n/**************************************************************************************************/\n// Error messages.\nNAME = '[big.js] ', INVALID = NAME + 'Invalid ', INVALID_DP = INVALID + 'decimal places', INVALID_RM = INVALID + 'rounding mode', DIV_BY_ZERO = NAME + 'Division by zero', UNDEFINED = void 0, NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\n/*\n * Create and return a Big constructor.\n */\nfunction _Big_() {\n /*\n * The Big constructor and exported function.\n * Create and return a new instance of a Big number object.\n *\n * n {number|string|Big} A numeric value.\n */\n function Big(n) {\n var x = this;\n // Enable constructor usage without new.\n if (!(x instanceof Big))\n return n === UNDEFINED ? _Big_() : new Big(n);\n // Duplicate.\n if (n instanceof Big) {\n x.s = n.s;\n x.e = n.e;\n x.c = n.c.slice();\n normalize(x);\n }\n else {\n if (typeof n !== 'string') {\n if (Big.strict === true) {\n throw TypeError(INVALID + 'number');\n }\n // Minus zero?\n n = n === 0 && 1 / n < 0 ? '-0' : String(n);\n }\n parse(x, n);\n }\n // Retain a reference to this Big constructor.\n // Shadow Big.prototype.constructor which points to Object.\n x.constructor = Big;\n }\n Big.prototype = P;\n Big.DP = DP;\n Big.RM = RM;\n Big.NE = NE;\n Big.PE = PE;\n Big.strict = STRICT;\n return Big;\n}\nfunction normalize(x) {\n // x = round(x, DP, 0);\n if (x.c.length > 1 && !x.c[0]) {\n let i = x.c.findIndex(x => x);\n x.c = x.c.slice(i);\n x.e = x.e - i;\n }\n}\n/*\n * Parse the number or string value passed to a Big constructor.\n *\n * x {Big} A Big number instance.\n * n {number|string} A numeric value.\n */\nfunction parse(x, n) {\n var e, i, nl;\n if (!NUMERIC.test(n)) {\n throw Error(INVALID + 'number');\n }\n // Determine sign.\n x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\n // Decimal point?\n if ((e = n.indexOf('.')) > -1)\n n = n.replace('.', '');\n // Exponential form?\n if ((i = n.search(/e/i)) > 0) {\n // Determine exponent.\n if (e < 0)\n e = i;\n e += +n.slice(i + 1);\n n = n.substring(0, i);\n }\n else if (e < 0) {\n // Integer.\n e = n.length;\n }\n nl = n.length;\n // Determine leading zeros before decimal point.\n for (i = 0; i < e && i < nl && n.charAt(i) == '0';)\n ++i;\n // original version (ignores decimal point).\n // // Determine leading zeros.\n // for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\n if (i == nl) {\n // Zero.\n x.c = [x.e = 0];\n }\n else {\n x.e = e - i - 1;\n x.c = [];\n // Convert string to array of digits without leading zeros\n for (e = 0; i < nl;)\n x.c[e++] = +n.charAt(i++);\n // older version (doesn't keep trailing zeroes).\n // // Determine trailing zeros.\n // for (; nl > 0 && n.charAt(--nl) == '0';);\n // // Convert string to array of digits without leading/trailing zeros.\n // for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\n }\n x = round(x, Big.DP + 1, Big.RM);\n return x;\n}\n/*\n * Round Big x to a maximum of sd significant digits using rounding mode rm.\n *\n * x {Big} The Big to round.\n * sd {number} Significant digits: integer, 0 to MAX_DP inclusive.\n * rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n * [more] {boolean} Whether the result of division was truncated.\n */\nfunction round(x, sd, rm, more) {\n var xc = x.c;\n if (rm === UNDEFINED)\n rm = Big.RM;\n if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {\n throw Error(INVALID_RM);\n }\n if (sd < 1) {\n more =\n rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 ||\n rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED)));\n xc.length = 1;\n if (more) {\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n x.e = x.e - sd + 1;\n xc[0] = 1;\n }\n else {\n // Zero.\n xc[0] = x.e = 0;\n }\n }\n else if (sd < xc.length) {\n // xc[sd] is the digit after the digit that may be rounded up.\n const isZero = xc.findIndex((xci, idx) => idx >= sd && xci > 0) < 0;\n more =\n rm === 1 && xc[sd] >= 5 ||\n rm === 2 && (xc[sd] > 5 || xc[sd] === 5 &&\n (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) ||\n rm === 3 && (more || !isZero);\n // Remove any digits after the required precision.\n xc.length = sd--;\n // Round up?\n if (more) {\n // Rounding up may mean the previous digit has to be rounded up.\n for (; ++xc[sd] > 9;) {\n xc[sd] = 0;\n if (!sd--) {\n ++x.e;\n xc.unshift(1);\n }\n }\n }\n // Remove trailing zeros.\n for (sd = xc.length; !xc[--sd];)\n xc.pop();\n }\n return x;\n}\n/*\n * Return a string representing the value of Big x in normal or exponential notation.\n * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\n */\nfunction stringify(x, doExponential, isNonzero) {\n var e = x.e, s = x.c.join(''), n = s.length;\n // Exponential notation?\n if (doExponential) {\n s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\n // Normal notation.\n }\n else if (e < 0) {\n for (; ++e;)\n s = '0' + s;\n s = '0.' + s;\n }\n else if (e > 0) {\n if (++e > n) {\n for (e -= n; e--;)\n s += '0';\n }\n else if (e < n) {\n s = s.slice(0, e) + '.' + s.slice(e);\n }\n }\n else if (n > 1) {\n s = s.charAt(0) + '.' + s.slice(1);\n }\n return x.s < 0 && isNonzero ? '-' + s : s;\n}\n// Prototype/instance methods\n/*\n * Return a new Big whose value is the absolute value of this Big.\n */\nP.abs = function () {\n var x = new this.constructor(this);\n x.s = 1;\n return x;\n};\n/*\n * Return 1 if the value of this Big is greater than the value of Big y,\n * -1 if the value of this Big is less than the value of Big y, or\n * 0 if they have the same value.\n */\nP.cmp = function (y) {\n var isneg, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;\n // Either zero?\n if (!xc[0] || !yc[0])\n return !xc[0] ? !yc[0] ? 0 : -j : i;\n // Signs differ?\n if (i != j)\n return i;\n isneg = i < 0;\n // Compare exponents.\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n // Compare digit by digit.\n j = Math.max(xc.length, yc.length);\n for (i = 0; i < j; i++) {\n k = i < xc.length ? xc[i] : 0;\n l = i < yc.length ? yc[i] : 0;\n if (k != l)\n return k > l ^ isneg ? 1 : -1;\n }\n return 0;\n // original version (doesn't compare well trailing zeroes, e.g. 1.0 with 1.00)\n // j = (k = xc.length) < (l = yc.length) ? k : l;\n // // Compare digit by digit.\n // for (i = -1; ++i < j;) {\n // if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\n // }\n // // Compare lengths.\n // return k == l ? 0 : k > l ^ isneg ? 1 : -1;\n};\n/*\n * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\n * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.div = function (y) {\n var Big = this.constructor, x = new Big(this), y = new Big(y), a = x.c, // dividend\n b = y.c, // divisor\n k = x.s == y.s ? 1 : -1, dp = Big.DP;\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n // Divisor is zero?\n if (!b[0]) {\n throw Error(DIV_BY_ZERO);\n }\n // Dividend is 0? Return +-0.\n if (!a[0]) {\n y.s = k;\n y.c = [y.e = 0];\n return y;\n }\n var bl, bt, n, cmp, ri, bz = b.slice(), ai = bl = b.length, al = a.length, r = a.slice(0, bl), // remainder\n rl = r.length, q = y, // quotient\n qc = q.c = [], qi = 0, p = dp + (q.e = x.e - y.e) + 1; // precision of the result\n q.s = k;\n k = p < 0 ? 0 : p;\n // Create version of divisor with leading zero.\n bz.unshift(0);\n // Add zeros to make remainder as long as divisor.\n for (; rl++ < bl;)\n r.push(0);\n do {\n // n is how many times the divisor goes into current remainder.\n for (n = 0; n < 10; n++) {\n // Compare divisor and remainder.\n if (bl != (rl = r.length)) {\n cmp = bl > rl ? 1 : -1;\n }\n else {\n for (ri = -1, cmp = 0; ++ri < bl;) {\n if (b[ri] != r[ri]) {\n cmp = b[ri] > r[ri] ? 1 : -1;\n break;\n }\n }\n }\n // If divisor < remainder, subtract divisor from remainder.\n if (cmp < 0) {\n // Remainder can't be more than 1 digit longer than divisor.\n // Equalise lengths using divisor with extra leading zero?\n for (bt = rl == bl ? b : bz; rl;) {\n if (r[--rl] < bt[rl]) {\n ri = rl;\n for (; ri && !r[--ri];)\n r[ri] = 9;\n --r[ri];\n r[rl] += 10;\n }\n r[rl] -= bt[rl];\n }\n for (; !r[0];)\n r.shift();\n }\n else {\n break;\n }\n }\n // Add the digit n to the result array.\n qc[qi++] = cmp ? n : ++n;\n // Update the remainder.\n if (r[0] && cmp)\n r[rl] = a[ai] || 0;\n else\n r = [a[ai]];\n } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\n // Leading zero? Do not remove if result is simply zero (qi == 1).\n if (!qc[0] && qi != 1) {\n // There can't be more than one zero.\n qc.shift();\n q.e--;\n p--;\n }\n // Round?\n if (qi > p)\n round(q, p, Big.RM, r[0] !== UNDEFINED);\n return q;\n};\n/*\n * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\n */\nP.eq = function (y) {\n return this.cmp(y) === 0;\n};\n/*\n * Return true if the value of this Big is greater than the value of Big y, otherwise return\n * false.\n */\nP.gt = function (y) {\n return this.cmp(y) > 0;\n};\n/*\n * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\n * return false.\n */\nP.gte = function (y) {\n return this.cmp(y) > -1;\n};\n/*\n * Return true if the value of this Big is less than the value of Big y, otherwise return false.\n */\nP.lt = function (y) {\n return this.cmp(y) < 0;\n};\n/*\n * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\n * return false.\n */\nP.lte = function (y) {\n return this.cmp(y) < 1;\n};\n/*\n * Return a new Big whose value is the value of this Big minus the value of Big y.\n */\nP.minus = P.sub = function (y) {\n var i, j, t, xlty, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n // Signs differ?\n if (a != b) {\n y.s = -b;\n return x.plus(y);\n }\n var xc = x.c.slice(), xe = x.e, yc = y.c, ye = y.e;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (yc[0]) {\n y.s = -b;\n }\n else if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = 1;\n }\n return y;\n }\n // Determine which is the bigger number. Prepend zeros to equalise exponents.\n if (a = xe - ye) {\n if (xlty = a < 0) {\n a = -a;\n t = xc;\n }\n else {\n ye = xe;\n t = yc;\n }\n t.reverse();\n for (b = a; b--;)\n t.push(0);\n t.reverse();\n }\n else {\n // Exponents equal. Check digit by digit.\n j = ((xlty = xc.length < yc.length) ? xc : yc).length;\n for (a = b = 0; b < j; b++) {\n if (xc[b] != yc[b]) {\n xlty = xc[b] < yc[b];\n break;\n }\n }\n }\n // x < y? Point xc to the array of the bigger number.\n if (xlty) {\n t = xc;\n xc = yc;\n yc = t;\n y.s = -y.s;\n }\n /*\n * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\n * needs to start at yc.length.\n */\n if ((b = (j = yc.length) - (i = xc.length)) > 0)\n for (; b--;)\n xc[i++] = 0;\n // Subtract yc from xc.\n for (b = i; j > a;) {\n if (xc[--j] < yc[j]) {\n for (i = j; i && !xc[--i];)\n xc[i] = 9;\n --xc[i];\n xc[j] += 10;\n }\n xc[j] -= yc[j];\n }\n // Remove trailing zeros.\n for (; xc[--b] === 0;)\n xc.pop();\n // Remove leading zeros and adjust exponent accordingly.\n for (; xc[0] === 0;) {\n xc.shift();\n --ye;\n }\n if (!xc[0]) {\n // n - n = +0\n y.s = 1;\n // Result must be zero.\n xc = [ye = 0];\n }\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a new Big whose value is the value of this Big modulo the value of Big y.\n */\nP.mod = function (y) {\n var ygtx, Big = this.constructor, x = new Big(this), y = new Big(y), a = x.s, b = y.s;\n if (!y.c[0]) {\n throw Error(DIV_BY_ZERO);\n }\n x.s = y.s = 1;\n ygtx = y.cmp(x) == 1;\n x.s = a;\n y.s = b;\n if (ygtx)\n return new Big(x);\n a = Big.DP;\n b = Big.RM;\n Big.DP = Big.RM = 0;\n x = x.div(y);\n Big.DP = a;\n Big.RM = b;\n return this.minus(x.times(y));\n};\n/*\n * Return a new Big whose value is the value of this Big plus the value of Big y.\n */\nP.plus = P.add = function (y) {\n var e, k, t, Big = this.constructor, x = new Big(this), y = new Big(y);\n // Signs differ?\n if (x.s != y.s) {\n y.s = -y.s;\n return x.minus(y);\n }\n var xe = x.e, xc = x.c, ye = y.e, yc = y.c;\n // Either zero?\n if (!xc[0] || !yc[0]) {\n if (!yc[0]) {\n if (xc[0]) {\n y = new Big(x);\n }\n else {\n y.s = x.s;\n }\n }\n return y;\n }\n xc = xc.slice();\n // Prepend zeros to equalise exponents.\n // Note: reverse faster than unshifts.\n if (e = xe - ye) {\n if (e > 0) {\n ye = xe;\n t = yc;\n }\n else {\n e = -e;\n t = xc;\n }\n t.reverse();\n for (; e--;)\n t.push(0);\n t.reverse();\n }\n // Point xc to the longer array.\n if (xc.length - yc.length < 0) {\n t = yc;\n yc = xc;\n xc = t;\n }\n e = yc.length;\n // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\n for (k = 0; e; xc[e] %= 10)\n k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0;\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n if (k) {\n xc.unshift(k);\n ++ye;\n }\n // Remove trailing zeros.\n for (e = xc.length; xc[--e] === 0;)\n xc.pop();\n y.c = xc;\n y.e = ye;\n return y;\n};\n/*\n * Return a Big whose value is the value of this Big raised to the power n.\n * If n is negative, round to a maximum of Big.DP decimal places using rounding\n * mode Big.RM.\n *\n * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\n */\nP.pow = function (n) {\n var Big = this.constructor, x = new Big(this), y = new Big('1'), one = new Big('1'), isneg = n < 0;\n if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {\n throw Error(INVALID + 'exponent');\n }\n if (isneg)\n n = -n;\n for (;;) {\n if (n & 1)\n y = y.times(x);\n n >>= 1;\n if (!n)\n break;\n x = x.times(x);\n }\n return isneg ? one.div(y) : y;\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum precision of sd\n * significant digits using rounding mode rm, or Big.RM if rm is not specified.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.prec = function (sd, rm) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n return round(new this.constructor(this), sd, rm);\n};\n/*\n * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places\n * using rounding mode rm, or Big.RM if rm is not specified.\n * If dp is negative, round to an integer which is a multiple of 10**-dp.\n * If dp is not specified, round to 0 decimal places.\n *\n * dp? {number} Integer, -MAX_DP to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.round = function (dp, rm) {\n if (dp === UNDEFINED)\n dp = 0;\n else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n return round(new this.constructor(this), dp + this.e + 1, rm);\n};\n/*\n * Return a new Big whose value is the square root of the value of this Big, rounded, if\n * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\n */\nP.sqrt = function () {\n var r, c, t, Big = this.constructor, x = new Big(this), s = x.s, e = x.e, half = new Big('0.5');\n // Zero?\n if (!x.c[0])\n return new Big(x);\n // Negative?\n if (s < 0) {\n throw Error(NAME + 'No square root');\n }\n // Estimate.\n s = Math.sqrt(x + '');\n // Math.sqrt underflow/overflow?\n // Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.\n if (s === 0 || s === 1 / 0) {\n c = x.c.join('');\n if (!(c.length + e & 1))\n c += '0';\n s = Math.sqrt(c);\n e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\n r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);\n }\n else {\n r = new Big(s + '');\n }\n e = r.e + (Big.DP += 4);\n // Newton-Raphson iteration.\n do {\n t = r;\n r = half.times(t.plus(x.div(t)));\n } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\n return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);\n};\n/*\n * Return a new Big whose value is the value of this Big times the value of Big y.\n */\nP.times = P.mul = function (y) {\n var c, Big = this.constructor, x = new Big(this), y = new Big(y), xc = x.c, yc = y.c, a = xc.length, b = yc.length, i = x.e, j = y.e;\n // Determine sign of result.\n y.s = x.s == y.s ? 1 : -1;\n // Return signed 0 if either 0.\n if (!xc[0] || !yc[0]) {\n y.c = [y.e = 0];\n return y;\n }\n // Initialise exponent of result as x.e + y.e.\n y.e = i + j;\n // If array xc has fewer digits than yc, swap xc and yc, and lengths.\n if (a < b) {\n c = xc;\n xc = yc;\n yc = c;\n j = a;\n a = b;\n b = j;\n }\n // Initialise coefficient array of result with zeros.\n for (c = new Array(j = a + b); j--;)\n c[j] = 0;\n // Multiply.\n // i is initially xc.length.\n for (i = b; i--;) {\n b = 0;\n // a is yc.length.\n for (j = a + i; j > i;) {\n // Current sum of products at this digit position, plus carry.\n b = c[j] + yc[i] * xc[j - i - 1] + b;\n c[j--] = b % 10;\n // carry\n b = b / 10 | 0;\n }\n c[j] = b;\n }\n // Increment result exponent if there is a final carry, otherwise remove leading zero.\n if (b)\n ++y.e;\n else\n c.shift();\n // Remove trailing zeros.\n for (i = c.length; !c[--i];)\n c.pop();\n y.c = c;\n return y;\n};\n/*\n * Return a string representing the value of this Big in exponential notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toExponential = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), ++dp, rm);\n for (; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, true, !!n);\n};\n/*\n * Return a string representing the value of this Big in normal notation rounded to dp fixed\n * decimal places using rounding mode rm, or Big.RM if rm is not specified.\n *\n * dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n *\n * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\n * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\n */\nP.toFixed = function (dp, rm) {\n var x = this, n = x.c[0];\n if (dp !== UNDEFINED) {\n if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {\n throw Error(INVALID_DP);\n }\n x = round(new x.constructor(x), dp + x.e + 1, rm);\n // x.e may have changed if the value is rounded up.\n for (dp = dp + x.e + 1; x.c.length < dp;)\n x.c.push(0);\n }\n return stringify(x, false, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Omit the sign for negative zero.\n */\nP.toJSON = P.toString = function () {\n var x = this, Big = x.constructor;\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);\n};\n/*\n * Return the value of this Big as a primitve number.\n */\nP.toNumber = function () {\n var n = Number(stringify(this, true, true));\n if (this.constructor.strict === true && !this.eq(n.toString())) {\n throw Error(NAME + 'Imprecise conversion');\n }\n return n;\n};\n/*\n * Return a string representing the value of this Big rounded to sd significant digits using\n * rounding mode rm, or Big.RM if rm is not specified.\n * Use exponential notation if sd is less than the number of digits necessary to represent\n * the integer part of the value in normal notation.\n *\n * sd {number} Significant digits: integer, 1 to MAX_DP inclusive.\n * rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).\n */\nP.toPrecision = function (sd, rm) {\n var x = this, Big = x.constructor, n = x.c[0];\n if (sd !== UNDEFINED) {\n if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {\n throw Error(INVALID + 'precision');\n }\n x = round(new Big(x), sd, rm);\n for (; x.c.length < sd;)\n x.c.push(0);\n }\n return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);\n};\n/*\n * Return a string representing the value of this Big.\n * Return exponential notation if this Big has a positive exponent equal to or greater than\n * Big.PE, or a negative exponent equal to or less than Big.NE.\n * Include the sign for negative zero.\n */\nP.valueOf = function () {\n var x = this, Big = x.constructor;\n if (Big.strict === true) {\n throw Error(NAME + 'valueOf disallowed');\n }\n return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);\n};\n// Export\nexport var Big = _Big_();\n/// <reference types=\"https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/big.js/index.d.ts\" />\nexport default Big;\n","// Adapted from: https://github.com/dcodeIO/long.js/blob/master/src/long.js\n// Apache License 2.0: https://github.com/dcodeIO/long.js/blob/master/LICENSE\n/* tslint:disable */\nimport { symbol } from \"../Numeric.js\";\n/**\n * wasm optimizations, to do native i64 multiplication and divide\n */\nvar wasm = null;\ntry {\n wasm = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([\n 0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11\n ])), {}).exports;\n}\ncatch (e) {\n // no wasm support :(\n}\n/**\n * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.\n * See the from* functions below for more convenient ways of constructing Longs.\n * @exports Long\n * @class A Long class for representing a 64 bit two's-complement integer value.\n * @param {number} low The low (signed) 32 bits of the long\n * @param {number} high The high (signed) 32 bits of the long\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @constructor\n */\nexport function Long(low, high, unsigned) {\n /**\n * The low 32 bits as a signed value.\n * @type {number}\n */\n this.low = low | 0;\n /**\n * The high 32 bits as a signed value.\n * @type {number}\n */\n this.high = high | 0;\n /**\n * Whether unsigned or not.\n * @type {boolean}\n */\n this.unsigned = !!unsigned;\n}\nLong.prototype.GetHashCode = function () {\n let h1 = this.unsigned ? 1 : 0;\n h1 = ((h1 << 5) + h1) ^ this.high;\n h1 = ((h1 << 5) + h1) ^ this.low;\n return h1;\n};\nLong.prototype.Equals = function (x) { return equals(this, x); };\nLong.prototype.CompareTo = function (x) { return compare(this, x); };\nLong.prototype.toString = function (radix) { return toString(this, radix); };\nLong.prototype.toJSON = function () { return toString(this); };\nLong.prototype[symbol] = function () {\n const x = this;\n return {\n multiply: y => multiply(x, y),\n toPrecision: sd => String(x) + (0).toPrecision(sd).substr(1),\n toExponential: dp => String(x) + (0).toExponential(dp).substr(1),\n toFixed: dp => String(x) + (0).toFixed(dp).substr(1),\n toHex: () => toString(x.unsigned ? x : fromBytes(toBytes(x), true), 16),\n };\n};\n// The internal representation of a long is the two given signed, 32-bit values.\n// We use 32-bit pieces because these are the size of integers on which\n// Javascript performs bit-operations. For operations like addition and\n// multiplication, we split each number into 16 bit pieces, which can easily be\n// multiplied within Javascript's floating-point representation without overflow\n// or change in sign.\n//\n// In the algorithms below, we frequently reduce the negative case to the\n// positive case by negating the input(s) and then post-processing the result.\n// Note that we must ALWAYS check specially whether those values are MIN_VALUE\n// (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n// a positive number, it overflows back into a negative). Not handling this\n// case would often result in infinite recursion.\n//\n// Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the from*\n// methods on which they depend.\n/**\n * An indicator used to reliably determine if an object is a Long or not.\n * @type {boolean}\n * @const\n * @private\n */\nLong.prototype.__isLong__;\nObject.defineProperty(Long.prototype, \"__isLong__\", { value: true });\n/**\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n * @inner\n */\nexport function isLong(obj) {\n return (obj && obj[\"__isLong__\"]) === true;\n}\n/**\n * Tests if the specified object is a Long.\n * @function\n * @param {*} obj Object\n * @returns {boolean}\n */\n// Long.isLong = isLong;\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @inner\n */\nvar INT_CACHE = {};\n/**\n * A cache of the Long representations of small unsigned integer values.\n * @type {!Object}\n * @inner\n */\nvar UINT_CACHE = {};\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromInt(value, unsigned) {\n var obj, cachedObj, cache;\n if (unsigned) {\n value >>>= 0;\n if (cache = (0 <= value && value < 256)) {\n cachedObj = UINT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);\n if (cache)\n UINT_CACHE[value] = obj;\n return obj;\n }\n else {\n value |= 0;\n if (cache = (-128 <= value && value < 128)) {\n cachedObj = INT_CACHE[value];\n if (cachedObj)\n return cachedObj;\n }\n obj = fromBits(value, value < 0 ? -1 : 0, false);\n if (cache)\n INT_CACHE[value] = obj;\n return obj;\n }\n}\n/**\n * Returns a Long representing the given 32 bit integer value.\n * @function\n * @param {number} value The 32 bit integer in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromInt = fromInt;\n/**\n * @param {number} value\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromNumber(value, unsigned) {\n if (isNaN(value))\n return unsigned ? UZERO : ZERO;\n if (unsigned) {\n if (value < 0)\n return UZERO;\n if (value >= TWO_PWR_64_DBL)\n return MAX_UNSIGNED_VALUE;\n }\n else {\n if (value <= -TWO_PWR_63_DBL)\n return MIN_VALUE;\n if (value + 1 >= TWO_PWR_63_DBL)\n return MAX_VALUE;\n }\n if (value < 0)\n return negate(fromNumber(-value, unsigned));\n return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned);\n}\n/**\n * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.\n * @function\n * @param {number} value The number in question\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromNumber = fromNumber;\n/**\n * @param {number} lowBits\n * @param {number} highBits\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromBits(lowBits, highBits, unsigned) {\n return new Long(lowBits, highBits, unsigned);\n}\n/**\n * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. Each is\n * assumed to use 32 bits.\n * @function\n * @param {number} lowBits The low 32 bits\n * @param {number} highBits The high 32 bits\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromBits = fromBits;\n/**\n * @function\n * @param {number} base\n * @param {number} exponent\n * @returns {number}\n * @inner\n */\nvar pow_dbl = Math.pow; // Used 4 times (4*8 to 15+4)\n/**\n * @param {string} str\n * @param {(boolean|number)=} unsigned\n * @param {number=} radix\n * @returns {!Long}\n * @inner\n */\nexport function fromString(str, unsigned, radix) {\n if (str.length === 0)\n throw Error('empty string');\n if (str === \"NaN\" || str === \"Infinity\" || str === \"+Infinity\" || str === \"-Infinity\")\n return ZERO;\n if (typeof unsigned === 'number') {\n // For goog.math.long compatibility\n radix = unsigned,\n unsigned = false;\n }\n else {\n unsigned = !!unsigned;\n }\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n var p = str.indexOf('-');\n if (p > 0)\n throw Error('interior hyphen');\n else if (p === 0) {\n return negate(fromString(str.substring(1), unsigned, radix));\n }\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 8));\n var result = ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = fromNumber(pow_dbl(radix, size));\n result = add(multiply(result, power), fromNumber(value));\n }\n else {\n result = multiply(result, radixToPower);\n result = add(result, fromNumber(value));\n }\n }\n result.unsigned = unsigned;\n return result;\n}\n/**\n * Returns a Long representation of the given string, written using the specified radix.\n * @function\n * @param {string} str The textual representation of the Long\n * @param {(boolean|number)=} unsigned Whether unsigned or not, defaults to signed\n * @param {number=} radix The radix in which the text is written (2-36), defaults to 10\n * @returns {!Long} The corresponding Long value\n */\n// Long.fromString = fromString;\n/**\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val\n * @param {boolean=} unsigned\n * @returns {!Long}\n * @inner\n */\nexport function fromValue(val, unsigned) {\n if (typeof val === 'number')\n return fromNumber(val, unsigned);\n if (typeof val === 'string')\n return fromString(val, unsigned);\n // Throws for non-objects, converts non-instanceof Long:\n return fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned);\n}\n/**\n * Converts the specified value to a Long using the appropriate from* function for its type.\n * @function\n * @param {!Long|number|string|!{low: number, high: number, unsigned: boolean}} val Value\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {!Long}\n */\n// Long.fromValue = fromValue;\n// NOTE: the compiler should inline these constant values below and then remove these variables, so there should be\n// no runtime penalty for these.\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_16_DBL = 1 << 16;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_24_DBL = 1 << 24;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL;\n/**\n * @type {number}\n * @const\n * @inner\n */\nvar TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2;\n/**\n * @type {!Long}\n * @const\n * @inner\n */\nvar TWO_PWR_24 = fromInt(TWO_PWR_24_DBL);\n/**\n * @type {!Long}\n * @inner\n */\nexport var ZERO = fromInt(0);\n/**\n * Signed zero.\n * @type {!Long}\n */\n// Long.ZERO = ZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UZERO = fromInt(0, true);\n/**\n * Unsigned zero.\n * @type {!Long}\n */\n// Long.UZERO = UZERO;\n/**\n * @type {!Long}\n * @inner\n */\nexport var ONE = fromInt(1);\n/**\n * Signed one.\n * @type {!Long}\n */\n// Long.ONE = ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var UONE = fromInt(1, true);\n/**\n * Unsigned one.\n * @type {!Long}\n */\n// Long.UONE = UONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var NEG_ONE = fromInt(-1);\n/**\n * Signed negative one.\n * @type {!Long}\n */\n// Long.NEG_ONE = NEG_ONE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_VALUE = fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0, false);\n/**\n * Maximum signed value.\n * @type {!Long}\n */\n// Long.MAX_VALUE = MAX_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MAX_UNSIGNED_VALUE = fromBits(0xFFFFFFFF | 0, 0xFFFFFFFF | 0, true);\n/**\n * Maximum unsigned value.\n * @type {!Long}\n */\n// Long.MAX_UNSIGNED_VALUE = MAX_UNSIGNED_VALUE;\n/**\n * @type {!Long}\n * @inner\n */\nexport var MIN_VALUE = fromBits(0, 0x80000000 | 0, false);\n/**\n * Minimum signed value.\n * @type {!Long}\n */\n// Long.MIN_VALUE = MIN_VALUE;\n/**\n * @alias Long.prototype\n * @inner\n */\n// var LongPrototype = Long.prototype;\n/**\n * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer.\n * @this {!Long}\n * @returns {number}\n */\nexport function toInt($this) {\n return $this.unsigned ? $this.low >>> 0 : $this.low;\n}\n;\n/**\n * Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa).\n * @this {!Long}\n * @returns {number}\n */\nexport function toNumber($this) {\n if ($this.unsigned)\n return (($this.high >>> 0) * TWO_PWR_32_DBL) + ($this.low >>> 0);\n return $this.high * TWO_PWR_32_DBL + ($this.low >>> 0);\n}\n;\n/**\n * Converts the Long to a string written in the specified radix.\n * @this {!Long}\n * @param {number=} radix Radix (2-36), defaults to 10\n * @returns {string}\n * @override\n * @throws {RangeError} If `radix` is out of range\n */\nexport function toString($this, radix) {\n radix = radix || 10;\n if (radix < 2 || 36 < radix)\n throw RangeError('radix');\n if (isZero($this))\n return '0';\n if (isNegative($this)) { // Unsigned Longs are never negative\n if (equals($this, MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = fromNumber(radix), div = divide($this, radixLong), rem1 = subtract(multiply(div, radixLong), $this);\n return toString(div, radix) + toInt(rem1).toString(radix);\n }\n else\n return '-' + toString(negate($this), radix);\n }\n // Do several (6) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = fromNumber(pow_dbl(radix, 6), $this.unsigned), rem = $this;\n var result = '';\n while (true) {\n var remDiv = divide(rem, radixToPower), intval = toInt(subtract(rem, multiply(remDiv, radixToPower))) >>> 0, digits = intval.toString(radix);\n rem = remDiv;\n if (isZero(rem))\n return digits + result;\n else {\n while (digits.length < 6)\n digits = '0' + digits;\n result = '' + digits + result;\n }\n }\n}\n;\n/**\n * Gets the high 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed high bits\n */\nexport function getHighBits($this) {\n return $this.high;\n}\n;\n/**\n * Gets the high 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned high bits\n */\nexport function getHighBitsUnsigned($this) {\n return $this.high >>> 0;\n}\n;\n/**\n * Gets the low 32 bits as a signed integer.\n * @this {!Long}\n * @returns {number} Signed low bits\n */\nexport function getLowBits($this) {\n return $this.low;\n}\n;\n/**\n * Gets the low 32 bits as an unsigned integer.\n * @this {!Long}\n * @returns {number} Unsigned low bits\n */\nexport function getLowBitsUnsigned($this) {\n return $this.low >>> 0;\n}\n;\n/**\n * Gets the number of bits needed to represent the absolute value of this Long.\n * @this {!Long}\n * @returns {number}\n */\nexport function getNumBitsAbs($this) {\n if (isNegative($this)) // Unsigned Longs are never negative\n return equals($this, MIN_VALUE) ? 64 : getNumBitsAbs(negate($this));\n var val = $this.high != 0 ? $this.high : $this.low;\n for (var bit = 31; bit > 0; bit--)\n if ((val & (1 << bit)) != 0)\n break;\n return $this.high != 0 ? bit + 33 : bit + 1;\n}\n;\n/**\n * Tests if this Long's value equals zero.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isZero($this) {\n return $this.high === 0 && $this.low === 0;\n}\n;\n/**\n * Tests if this Long's value equals zero. This is an alias of {@link Long#isZero}.\n * @returns {boolean}\n */\n// LongPrototype.eqz = LongPrototype.isZero;\n/**\n * Tests if this Long's value is negative.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isNegative($this) {\n return !$this.unsigned && $this.high < 0;\n}\n;\n/**\n * Tests if this Long's value is positive.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isPositive($this) {\n return $this.unsigned || $this.high >= 0;\n}\n;\n/**\n * Tests if this Long's value is odd.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isOdd($this) {\n return ($this.low & 1) === 1;\n}\n;\n/**\n * Tests if this Long's value is even.\n * @this {!Long}\n * @returns {boolean}\n */\nexport function isEven($this) {\n return ($this.low & 1) === 0;\n}\n;\n/**\n * Tests if this Long's value equals the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function equals($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if ($this.unsigned !== other.unsigned && ($this.high >>> 31) === 1 && (other.high >>> 31) === 1)\n return false;\n return $this.high === other.high && $this.low === other.low;\n}\n;\n/**\n * Tests if this Long's value equals the specified's. This is an alias of {@link Long#equals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.eq = LongPrototype.equals;\n/**\n * Tests if this Long's value differs from the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function notEquals($this, other) {\n return !equals($this, /* validates */ other);\n}\n;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.neq = LongPrototype.notEquals;\n/**\n * Tests if this Long's value differs from the specified's. This is an alias of {@link Long#notEquals}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ne = LongPrototype.notEquals;\n/**\n * Tests if this Long's value is less than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThan($this, other) {\n return compare($this, /* validates */ other) < 0;\n}\n;\n/**\n * Tests if this Long's value is less than the specified's. This is an alias of {@link Long#lessThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lt = LongPrototype.lessThan;\n/**\n * Tests if this Long's value is less than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function lessThanOrEqual($this, other) {\n return compare($this, /* validates */ other) <= 0;\n}\n;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.lte = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is less than or equal the specified's. This is an alias of {@link Long#lessThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.le = LongPrototype.lessThanOrEqual;\n/**\n * Tests if this Long's value is greater than the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThan($this, other) {\n return compare($this, /* validates */ other) > 0;\n}\n;\n/**\n * Tests if this Long's value is greater than the specified's. This is an alias of {@link Long#greaterThan}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gt = LongPrototype.greaterThan;\n/**\n * Tests if this Long's value is greater than or equal the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\nexport function greaterThanOrEqual($this, other) {\n return compare($this, /* validates */ other) >= 0;\n}\n;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.gte = LongPrototype.greaterThanOrEqual;\n/**\n * Tests if this Long's value is greater than or equal the specified's. This is an alias of {@link Long#greaterThanOrEqual}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {boolean}\n */\n// LongPrototype.ge = LongPrototype.greaterThanOrEqual;\n/**\n * Compares this Long's value with the specified's.\n * @this {!Long}\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\nexport function compare($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n if (equals($this, other))\n return 0;\n var thisNeg = isNegative($this), otherNeg = isNegative(other);\n if (thisNeg && !otherNeg)\n return -1;\n if (!thisNeg && otherNeg)\n return 1;\n // At this point the sign bits are the same\n if (!$this.unsigned)\n return isNegative(subtract($this, other)) ? -1 : 1;\n // Both are positive if at least one is unsigned\n return (other.high >>> 0) > ($this.high >>> 0) || (other.high === $this.high && (other.low >>> 0) > ($this.low >>> 0)) ? -1 : 1;\n}\n;\n/**\n * Compares this Long's value with the specified's. This is an alias of {@link Long#compare}.\n * @function\n * @param {!Long|number|string} other Other value\n * @returns {number} 0 if they are the same, 1 if the this is greater and -1\n * if the given one is greater\n */\n// LongPrototype.comp = LongPrototype.compare;\n/**\n * Negates this Long's value.\n * @this {!Long}\n * @returns {!Long} Negated Long\n */\nexport function negate($this) {\n if (!$this.unsigned && equals($this, MIN_VALUE))\n return MIN_VALUE;\n return add(not($this), ONE);\n}\n;\n/**\n * Negates this Long's value. This is an alias of {@link Long#negate}.\n * @function\n * @returns {!Long} Negated Long\n */\n// LongPrototype.neg = LongPrototype.negate;\n/**\n * Returns the sum of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} addend Addend\n * @returns {!Long} Sum\n */\nexport function add($this, addend) {\n if (!isLong(addend))\n addend = fromValue(addend);\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = addend.high >>> 16;\n var b32 = addend.high & 0xFFFF;\n var b16 = addend.low >>> 16;\n var b00 = addend.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the difference of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\nexport function subtract($this, subtrahend) {\n if (!isLong(subtrahend))\n subtrahend = fromValue(subtrahend);\n return add($this, negate(subtrahend));\n}\n;\n/**\n * Returns the difference of this and the specified Long. This is an alias of {@link Long#subtract}.\n * @function\n * @param {!Long|number|string} subtrahend Subtrahend\n * @returns {!Long} Difference\n */\n// LongPrototype.sub = LongPrototype.subtract;\n/**\n * Returns the product of this and the specified Long.\n * @this {!Long}\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\nexport function multiply($this, multiplier) {\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n if (!isLong(multiplier))\n multiplier = fromValue(multiplier);\n // use wasm support if present\n if (wasm) {\n var low = wasm.mul($this.low, $this.high, multiplier.low, multiplier.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero(multiplier))\n return $this.unsigned ? UZERO : ZERO;\n if (equals($this, MIN_VALUE))\n return isOdd(multiplier) ? MIN_VALUE : ZERO;\n if (equals(multiplier, MIN_VALUE))\n return isOdd($this) ? MIN_VALUE : ZERO;\n if (isNegative($this)) {\n if (isNegative(multiplier))\n return multiply(negate($this), negate(multiplier));\n else\n return negate(multiply(negate($this), multiplier));\n }\n else if (isNegative(multiplier))\n return negate(multiply($this, negate(multiplier)));\n // If both longs are small, use float multiplication\n if (lessThan($this, TWO_PWR_24) && lessThan(multiplier, TWO_PWR_24))\n return fromNumber(toNumber($this) * toNumber(multiplier), $this.unsigned);\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n var a48 = $this.high >>> 16;\n var a32 = $this.high & 0xFFFF;\n var a16 = $this.low >>> 16;\n var a00 = $this.low & 0xFFFF;\n var b48 = multiplier.high >>> 16;\n var b32 = multiplier.high & 0xFFFF;\n var b16 = multiplier.low >>> 16;\n var b00 = multiplier.low & 0xFFFF;\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return fromBits((c16 << 16) | c00, (c48 << 16) | c32, $this.unsigned);\n}\n;\n/**\n * Returns the product of this and the specified Long. This is an alias of {@link Long#multiply}.\n * @function\n * @param {!Long|number|string} multiplier Multiplier\n * @returns {!Long} Product\n */\n// LongPrototype.mul = LongPrototype.multiply;\n/**\n * Returns this Long divided by the specified. The result is signed if this Long is signed or\n * unsigned if this Long is unsigned.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\nexport function divide($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n if (isZero(divisor))\n throw Error('division by zero');\n // use wasm support if present\n if (wasm) {\n // guard against signed division overflow: the largest\n // negative number / -1 would be 1 larger than the largest\n // positive number, due to two's complement.\n if (!$this.unsigned &&\n $this.high === -0x80000000 &&\n divisor.low === -1 && divisor.high === -1) {\n // be consistent with non-wasm code path\n return $this;\n }\n var low = ($this.unsigned ? wasm.div_u : wasm.div_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n if (isZero($this))\n return $this.unsigned ? UZERO : ZERO;\n var approx, rem, res;\n if (!$this.unsigned) {\n // This section is only relevant for signed longs and is derived from the\n // closure library as a whole.\n if (equals($this, MIN_VALUE)) {\n if (equals(divisor, ONE) || equals(divisor, NEG_ONE))\n return MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n else if (equals(divisor, MIN_VALUE))\n return ONE;\n else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = shiftRight($this, 1);\n approx = shiftLeft(divide(halfThis, divisor), 1);\n if (equals(approx, ZERO)) {\n return isNegative(divisor) ? ONE : NEG_ONE;\n }\n else {\n rem = subtract($this, multiply(divisor, approx));\n res = add(approx, divide(rem, divisor));\n return res;\n }\n }\n }\n else if (equals(divisor, MIN_VALUE))\n return $this.unsigned ? UZERO : ZERO;\n if (isNegative($this)) {\n if (isNegative(divisor))\n return divide(negate($this), negate(divisor));\n return negate(divide(negate($this), divisor));\n }\n else if (isNegative(divisor))\n return negate(divide($this, negate(divisor)));\n res = ZERO;\n }\n else {\n // The algorithm below has not been made for unsigned longs. It's therefore\n // required to take special care of the MSB prior to running it.\n if (!divisor.unsigned)\n divisor = toUnsigned(divisor);\n if (greaterThan(divisor, $this))\n return UZERO;\n if (greaterThan(divisor, shiftRightUnsigned($this, 1))) // 15 >>> 1 = 7 ; with divisor = 8 ; true\n return UONE;\n res = UZERO;\n }\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n rem = $this;\n while (greaterThanOrEqual(rem, divisor)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n approx = Math.max(1, Math.floor(toNumber(rem) / toNumber(divisor)));\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2), delta = (log2 <= 48) ? 1 : pow_dbl(2, log2 - 48), \n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n approxRes = fromNumber(approx), approxRem = multiply(approxRes, divisor);\n while (isNegative(approxRem) || greaterThan(approxRem, rem)) {\n approx -= delta;\n approxRes = fromNumber(approx, $this.unsigned);\n approxRem = multiply(approxRes, divisor);\n }\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (isZero(approxRes))\n approxRes = ONE;\n res = add(res, approxRes);\n rem = subtract(rem, approxRem);\n }\n return res;\n}\n;\n/**\n * Returns this Long divided by the specified. This is an alias of {@link Long#divide}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Quotient\n */\n// LongPrototype.div = LongPrototype.divide;\n/**\n * Returns this Long modulo the specified.\n * @this {!Long}\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\nexport function modulo($this, divisor) {\n if (!isLong(divisor))\n divisor = fromValue(divisor);\n // use wasm support if present\n if (wasm) {\n var low = ($this.unsigned ? wasm.rem_u : wasm.rem_s)($this.low, $this.high, divisor.low, divisor.high);\n return fromBits(low, wasm.get_high(), $this.unsigned);\n }\n return subtract($this, multiply(divide($this, divisor), divisor));\n}\n;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.mod = LongPrototype.modulo;\n/**\n * Returns this Long modulo the specified. This is an alias of {@link Long#modulo}.\n * @function\n * @param {!Long|number|string} divisor Divisor\n * @returns {!Long} Remainder\n */\n// LongPrototype.rem = LongPrototype.modulo;\n/**\n * Returns the bitwise NOT of this Long.\n * @this {!Long}\n * @returns {!Long}\n */\nexport function not($this) {\n return fromBits(~$this.low, ~$this.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise AND of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function and($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low & other.low, $this.high & other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise OR of this Long and the specified.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function or($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low | other.low, $this.high | other.high, $this.unsigned);\n}\n;\n/**\n * Returns the bitwise XOR of this Long and the given one.\n * @this {!Long}\n * @param {!Long|number|string} other Other Long\n * @returns {!Long}\n */\nexport function xor($this, other) {\n if (!isLong(other))\n other = fromValue(other);\n return fromBits($this.low ^ other.low, $this.high ^ other.high, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftLeft($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits($this.low << numBits, ($this.high << numBits) | ($this.low >>> (32 - numBits)), $this.unsigned);\n else\n return fromBits(0, $this.low << (numBits - 32), $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits shifted to the left by the given amount. This is an alias of {@link Long#shiftLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shl = LongPrototype.shiftLeft;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRight($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n if ((numBits &= 63) === 0)\n return $this;\n else if (numBits < 32)\n return fromBits(($this.low >>> numBits) | ($this.high << (32 - numBits)), $this.high >> numBits, $this.unsigned);\n else\n return fromBits($this.high >> (numBits - 32), $this.high >= 0 ? 0 : -1, $this.unsigned);\n}\n;\n/**\n * Returns this Long with bits arithmetically shifted to the right by the given amount. This is an alias of {@link Long#shiftRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr = LongPrototype.shiftRight;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\nexport function shiftRightUnsigned($this, numBits) {\n if (isLong(numBits))\n numBits = toInt(numBits);\n numBits &= 63;\n if (numBits === 0)\n return $this;\n else {\n var high = $this.high;\n if (numBits < 32) {\n var low = $this.low;\n return fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, $this.unsigned);\n }\n else if (numBits === 32)\n return fromBits(high, 0, $this.unsigned);\n else\n return fromBits(high >>> (numBits - 32), 0, $this.unsigned);\n }\n}\n;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shru = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits logically shifted to the right by the given amount. This is an alias of {@link Long#shiftRightUnsigned}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Shifted Long\n */\n// LongPrototype.shr_u = LongPrototype.shiftRightUnsigned;\n/**\n * Returns this Long with bits rotated to the left by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateLeft = function rotateLeft(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.low << numBits) | (this.high >>> b)), ((this.high << numBits) | (this.low >>> b)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.high << numBits) | (this.low >>> b)), ((this.low << numBits) | (this.high >>> b)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the left by the given amount. This is an alias of {@link Long#rotateLeft}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotl = LongPrototype.rotateLeft;\n/**\n * Returns this Long with bits rotated to the right by the given amount.\n * @this {!Long}\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\nexport const rotateRight = function rotateRight(numBits) {\n var b;\n if (isLong(numBits))\n numBits = numBits.toInt();\n if ((numBits &= 63) === 0)\n return this;\n if (numBits === 32)\n return fromBits(this.high, this.low, this.unsigned);\n if (numBits < 32) {\n b = (32 - numBits);\n return fromBits(((this.high << b) | (this.low >>> numBits)), ((this.low << b) | (this.high >>> numBits)), this.unsigned);\n }\n numBits -= 32;\n b = (32 - numBits);\n return fromBits(((this.low << b) | (this.high >>> numBits)), ((this.high << b) | (this.low >>> numBits)), this.unsigned);\n};\n/**\n * Returns this Long with bits rotated to the right by the given amount. This is an alias of {@link Long#rotateRight}.\n * @function\n * @param {number|!Long} numBits Number of bits\n * @returns {!Long} Rotated Long\n */\n// LongPrototype.rotr = LongPrototype.rotateRight;\n/**\n * Converts this Long to signed.\n * @this {!Long}\n * @returns {!Long} Signed long\n */\nexport function toSigned($this) {\n if (!$this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, false);\n}\n;\n/**\n * Converts this Long to unsigned.\n * @this {!Long}\n * @returns {!Long} Unsigned long\n */\nexport function toUnsigned($this) {\n if ($this.unsigned)\n return $this;\n return fromBits($this.low, $this.high, true);\n}\n;\n/**\n * Converts this Long to its byte representation.\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @this {!Long}\n * @returns {!Array.<number>} Byte representation\n */\nexport function toBytes($this, le) {\n return le ? toBytesLE($this) : toBytesBE($this);\n}\n;\n/**\n * Converts this Long to its little endian byte representation.\n * @this {!Long}\n * @returns {!Array.<number>} Little endian byte representation\n */\nexport function toBytesLE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n lo & 0xff,\n lo >>> 8 & 0xff,\n lo >>> 16 & 0xff,\n lo >>> 24,\n hi & 0xff,\n hi >>> 8 & 0xff,\n hi >>> 16 & 0xff,\n hi >>> 24\n ];\n}\n;\n/**\n * Converts this Long to its big endian byte representation.\n * @this {!Long}\n * @returns {!Array.<number>} Big endian byte representation\n */\nexport function toBytesBE($this) {\n var hi = $this.high, lo = $this.low;\n return [\n hi >>> 24,\n hi >>> 16 & 0xff,\n hi >>> 8 & 0xff,\n hi & 0xff,\n lo >>> 24,\n lo >>> 16 & 0xff,\n lo >>> 8 & 0xff,\n lo & 0xff\n ];\n}\n;\n/**\n * Creates a Long from its byte representation.\n * @param {!Array.<number>} bytes Byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @param {boolean=} le Whether little or big endian, defaults to big endian\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytes(bytes, unsigned, le) {\n return le ? fromBytesLE(bytes, unsigned) : fromBytesBE(bytes, unsigned);\n}\n;\n/**\n * Creates a Long from its little endian byte representation.\n * @param {!Array.<number>} bytes Little endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesLE(bytes, unsigned) {\n return new Long(bytes[0] |\n bytes[1] << 8 |\n bytes[2] << 16 |\n bytes[3] << 24, bytes[4] |\n bytes[5] << 8 |\n bytes[6] << 16 |\n bytes[7] << 24, unsigned);\n}\n;\n/**\n * Creates a Long from its big endian byte representation.\n * @param {!Array.<number>} bytes Big endian byte representation\n * @param {boolean=} unsigned Whether unsigned or not, defaults to signed\n * @returns {Long} The corresponding Long value\n */\nexport function fromBytesBE(bytes, unsigned) {\n return new Long(bytes[4] << 24 |\n bytes[5] << 16 |\n bytes[6] << 8 |\n bytes[7], bytes[0] << 24 |\n bytes[1] << 16 |\n bytes[2] << 8 |\n bytes[3], unsigned);\n}\n;\n"],"sourceRoot":""}