{"version":3,"file":"app/vendors-node_modules_webex_internal-plugin-llm_dist_index_js-node_modules_webex_internal-plug-47d21f.1dd41134.js","mappings":";;;;;;;;;AAAa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,8BAA8B,GAAG,mCAAmC,GAAG,kCAAkC;AACzG,6BAA6B,8BAA8B;AAC3D,kCAAkC,mCAAmC;AACrE,iCAAiC,kCAAkC;AACnE;;;;;;;;;;;;ACVa;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,kCAAkC,mBAAO,CAAC,0CAAK;AAC/C,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,qEAAe;AACrC,uCAAuC,mBAAO,CAAC,4DAAW;AAC1D,sCAAsC,mBAAO,CAAC,0DAAU;AACxD,2CAA2C,mBAAO,CAAC,2GAAiB;AACpE,kCAAkC,mBAAO,CAAC,+EAAO;AACjD,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,QAAQ,KAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gBAAgB;AACpE;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,wFAAwF;AACxF;AACA;AACA;AACA;AACA,KAAK;AACL,iHAAiH;AACjH;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,CAAC;;AAED;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AC1Pa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF;AACA;AACA;;AAEA;;AAEA;AACA,2DAA2D;AAC3D;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;ACxCa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mBAAO,CAAC,qGAA+B;AACvC,mBAAO,CAAC,uGAAgC;AACxC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,yCAAyC,mBAAO,CAAC,6FAAc;AAC/D,qCAAqC,mBAAO,CAAC,qFAAU;AACvD,iBAAiB,mBAAO,CAAC,6FAAc;AACvC,qDAAqD,mBAAO,CAAC,2HAA6B;AAC1F,kCAAkC,mBAAO,CAAC,+EAAO;AACjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI,KAA+B,EAAE,EAIpC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACxJa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe,GAAG,sBAAsB;AACxC,qCAAqC,mBAAO,CAAC,0GAAuC;AACpF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,oBAAoB,mBAAO,CAAC,mFAAsB;AAClD,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,iBAAiB,mBAAO,CAAC,6FAAc;AACvC;AACA;AACA;;AAEA,qBAAqB,sBAAsB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oDAAoD,wCAAwC;AAC5F;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,mBAAmB;AACnB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACzJa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,kBAAkB,mBAAO,CAAC,kHAA2C;AACrE,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,uBAAuB,mBAAO,CAAC,4HAAgD;AAC/E,qBAAqB,mBAAO,CAAC,0HAA+C;AAC5E,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,0BAA0B,GAAG,kBAAe,GAAG,iCAAiC,GAAG,gBAAgB;AACnG,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,+CAA+C,mBAAO,CAAC,4HAAgD;AACvG,WAAW,mBAAO,CAAC,0CAAK;AACxB,gBAAgB,mBAAO,CAAC,wDAAW;AACnC,cAAc,mBAAO,CAAC,oGAAQ;AAC9B,aAAa,mBAAO,CAAC,oDAAO;AAC5B,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,uCAAuC,mBAAO,CAAC,4DAAW;AAC1D,kDAAkD,mBAAO,CAAC,qFAAsB;AAChF,kBAAkB,mBAAO,CAAC,4DAAa;AACvC,yDAAyD,mFAAmF,WAAW,yHAAyH,gBAAgB,WAAW,yBAAyB,SAAS,wBAAwB,4BAA4B,cAAc,SAAS,+BAA+B,sBAAsB,WAAW,YAAY,gKAAgK,kDAAkD,SAAS,kBAAkB,kBAAkB,oBAAoB,sBAAsB,8BAA8B,cAAc,uBAAuB,eAAe,YAAY,oBAAoB,MAAM,2DAA2D,UAAU;AAC18B,kDAAkD,gBAAgB,gEAAgE,wDAAwD,6DAA6D,uDAAuD;AAC9S,uCAAuC,uDAAuD,uCAAuC,SAAS,uBAAuB;AACrK,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,gCAAgC,iCAAiC;;AAEjE;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,UAAU;AACtB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,UAAU;AACtB,aAAa;AACb;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8BAA8B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gCAAgC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY,UAAU;AACtB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,eAAe;AAC1B;AACA,WAAW,UAAU;AACrB;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB;AACA,WAAW,QAAQ;AACnB;AACA,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AClRa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,gBAAgB,mBAAO,CAAC,2EAAkB;AAC1C,iBAAiB,mBAAO,CAAC,6FAAc;AACvC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,kBAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACrFa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,4CAA4C,GAAG,uBAAuB,GAAG,gBAAgB,GAAG,gBAAgB;AAC5G,+CAA+C,mBAAO,CAAC,8IAAyD;AAChH,oCAAoC,mBAAO,CAAC,wHAA8C;AAC1F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,cAAc,mBAAO,CAAC,qEAAe;AACrC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,iBAAiB,mBAAO,CAAC,2FAAa;AACtC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA,uFAAuF;AACvF;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,2CAA2C,4CAA4C;AACvF;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3La;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,gBAAgB,mBAAO,CAAC,8GAAyC;AACjE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,wCAAwC,mBAAO,CAAC,kKAAmE;AACnH,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,wDAAwD,mBAAO,CAAC,8IAAyD;AACzH,sCAAsC,mBAAO,CAAC,8GAAyC;AACvF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,kCAAkC,mBAAO,CAAC,8GAAyC;AACnF,uDAAuD,mBAAO,CAAC,kKAAmE;AAClI,0CAA0C,mBAAO,CAAC,gEAAa;AAC/D,mCAAmC,mBAAO,CAAC,6CAAM;AACjD,oBAAoB,mBAAO,CAAC,mFAAsB;AAClD,cAAc,mBAAO,CAAC,qEAAe;AACrC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,eAAe,mBAAO,CAAC,0DAAU;AACjC,uCAAuC,mBAAO,CAAC,4DAAW;AAC1D,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,mCAAmC,mBAAO,CAAC,6FAAM;AACjD,0CAA0C,mBAAO,CAAC,+FAAe;AACjE,wDAAwD,mBAAO,CAAC,6HAA8B;AAC9F;AACA;AACA;AACA;AACA,uCAAuC,iDAAiD,8CAA8C,0EAA0E,mBAAmB;AACnO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,mEAAmE,sFAAsF,4DAA4D,yEAAyE;AAC7iB;AACA;AACA;AACA,mBAAmB,mBAAO,CAAC,sDAAO;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,mBAAmB;AAChC,aAAa,QAAQ;AACrB,aAAa,KAAK;AAClB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,aAAa,eAAe;AAC5B,aAAa,KAAK;AAClB,aAAa,aAAa;AAC1B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,eAAe;AAC5B,aAAa,eAAe;AAC5B,aAAa,mBAAmB;AAChC,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,mBAAmB;AAChC,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,mBAAmB;AAChC,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,MAAM;AACtB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,eAAe,kCAAkC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,MAAM;AACtB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,MAAM;AACtB,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,MAAM;AACtB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,kBAAkB;AAClC,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,oFAAoF;AACpF;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,aAAa,SAAS;AACtB,eAAe,UAAU,kBAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,MAAM;AACnB,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,YAAY,IAAqC;AACjD;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,cAAc,IAAqC;AACnD;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,uFAAuF;AACvF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU,KAAuL,EAAE,EAK5L;;AAEP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,0EAA0E;;AAE1E;AACA,cAAc,IAAqC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;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,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC9yBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE;AAChE,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACkL;AAClL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,uCAAuC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;AACA,YAAY,QAAQ;AACpB;AACA,qBAAqB,2DAAkB;AACvC;AACA,YAAY,QAAQ;AACpB;AACA,eAAe,2DAAkB;AACjC;AACA,YAAY,gBAAgB;AAC5B;AACA,kBAAkB,2DAAkB;AACpC;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,yDAAgB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,aAAa;AAC3B,cAAc,SAAS;AACvB,cAAc,aAAa;AAC3B;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA,YAAY;AACZ;AACA,mBAAmB,2DAAkB;AACrC;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,yDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,2DAAkB;AACtC,mBAAmB,2DAAkB;AACrC;;AAEA,mBAAmB,2DAAkB;AACrC,oBAAoB,2DAAkB;AACtC,wBAAwB,2DAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,mDAAU;AAChC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,gBAAgB;AACnC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,kBAAkB,0BAA0B;AAC5C;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB,+BAA+B;AACnD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D;;AAE5D;AACA;AACA;;AAEA,kBAAkB,WAAW;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,qDAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;;AAEA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA,2BAA2B,2DAAkB;AAC7C,uBAAuB,2DAAkB;AACzC,iBAAiB,2DAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,iBAAiB,WAAW;AAC5B;;AAEA;AACA;;AAEA,gBAAgB,qDAAY;;AAE5B;AACA;;AAEA;AACA;;AAEA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,sBAAsB,mDAAU;;AAEhC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA,kBAAkB,2BAA2B;AAC7C;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,yDAAgB,2BAA2B;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,2DAAkB;AACrC;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAoB,yDAAgB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,eAAe,2DAAkB;AACjC,0BAA0B,2DAAkB;AAC5C;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,uBAAuB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,EAAE;AAC5D;AACA;AACA,SAAS,uBAAuB;AAChC;AACA;AACA,QAAQ,WAAW,KAAK,kBAAkB;AAC1C,QAAQ,WAAW,IAAI;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,eAAe,2DAAkB;AACjC,mBAAmB,2DAAkB;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA,KAAK,iDAAY;AACjB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,yDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,sBAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA,qCAAqC;;AAErC,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,6BAA6B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,uBAAuB,2DAAkB;AACzC;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,yDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,aAAa,8BAA8B,IAAI,yDAAgB,2BAA2B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,oBAAoB,2DAAkB;AACtC,uBAAuB,2DAAkB;AACzC;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,uBAAuB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA,iBAAiB,8BAA8B;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2DAA2D,EAAE;AAC5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,yDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,WAAW;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B,IAAI,cAAc;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,iDAAY;AACjC;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,qDAAY;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,YAAY,QAAQ;AACpB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,sBAAsB,uDAAc;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,uDAAc;;AAElC;AACA;;AAEA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,uDAAc;;AAE7B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,qCAAqC,QAAQ;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kEAAkE,QAAQ;AAC1E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,wDAAwD,iBAAiB;AACzE;AACA;;AAEA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,mBAAmB;AACpC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sBAAsB;AAClC,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sDAAa;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA,UAAU,sDAAa;;AAEvB;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,gCAAgC,oCAAoC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,gCAAgC,oCAAoC;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAgB;AAC9B,6BAA6B,IAAI;AACjC,YAAY,8BAA8B,IAAI,kBAAkB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA,4BAA4B;AAC5B;AACA;;AAEA,kBAAkB,2DAAkB;AACpC,oBAAoB,2DAAkB;AACtC;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,qDAAY;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,kBAAkB,4BAA4B;AAC9C;;AAEA;;AAEA;AACA;;AAEA,qBAAqB,mDAAU;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iCAAiC;AACnD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA,YAAY,yDAAgB;AAC5B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,kBAAkB,2DAAkB;AACpC;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,cAAc;AACd;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,oBAAoB;AACpB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA;;AAEA;AACA,gBAAgB,OAAO;;AAEvB;AACA;AACA,eAAe,EAAE,QAAQ;;AAEzB;AACA,kBAAkB,EAAE,QAAQ,KAAK;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,uBAAuB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,2BAA2B;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,GAAG;AAC/D;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,YAAY;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,sBAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB;AACA,4BAA4B;AAC5B;AACA;;AAEA,kBAAkB,2DAAkB;AACpC;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK,0DAAiB;AACtB;AACA;;AAEA;;AAEA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,qDAAY;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,kBAAkB,4BAA4B;AAC9C;;AAEA;;AAEA;AACA;;AAEA,qBAAqB,mDAAU;AAC/B;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,kBAAkB,iCAAiC;AACnD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA,YAAY,yDAAgB;AAC5B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,kBAAkB,2DAAkB;AACpC;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ;AACpB,cAAc;AACd;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;;AAEA;;AAEA;AACA,gBAAgB,OAAO;;AAEvB;AACA;AACA,eAAe,EAAE,QAAQ;AACzB;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA,iBAAiB,uBAAuB;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,aAAa;AAC5B;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,eAAe;AAChC;AACA,mBAAmB,mDAAU;AAC7B;AACA;AACA;;AAEA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,sBAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,eAAe;AAChC;AACA,mBAAmB,mDAAU;AAC7B;AACA;AACA;;AAEA;;AAEA,sCAAsC,QAAQ;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,sBAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,YAAY;AAC7B;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B,IAAI,sBAAsB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,gBAAgB;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA,sBAAsB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iBAAiB,gBAAgB;AACjC;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA,oDAAoD;AACpD;;AAEA;AACA;AACA;AACA;AACA,4CAA4C,yCAAyC;;AAErF;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE;AAClC;AACA,2DAA2D;AAC3D;AACA;AACA,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;;AAEhD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAiB,wBAAwB;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B,mBAAmB,kDAAS;AAC5B;AACA;AACA;AACA,oBAAoB,kDAAS;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC;AACA,4BAA4B;AAC5B;AACA;;AAEA,6BAA6B;AAC7B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA,4BAA4B;AAC5B;AACA,eAAe,2DAAkB;AACjC,kBAAkB,2DAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA,4BAA4B;AAC5B;AACA,cAAc,2DAAkB;AAChC,kBAAkB,2DAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA,4BAA4B;AAC5B;AACA,cAAc,2DAAkB;AAChC,kBAAkB,2DAAkB;AACpC,eAAe,2DAAkB;AACjC,eAAe,2DAAkB,4BAA4B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,YAAY,QAAQ,cAAc;AAClC,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB;AACA,4BAA4B;AAC5B;AACA,cAAc,2DAAkB;AAChC;AACA;AACA;AACA;AACA,YAAY,cAAc;AAC1B,YAAY,SAAS;AACrB,YAAY,SAAS;AACrB,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,SAAS;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,cAAc;AACd;AACA;AACA;AACA,qCAAqC;;AAErC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;AACA,IAAI,0DAAiB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB;AACO;AACP;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,aAAa,kBAAkB,EAAE;AACjC;AACO;AACP;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,8BAA8B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,uBAAuB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,yCAAyC;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,SAAS;AACpB,aAAa,kBAAkB,EAAE;AACjC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC3xMA,SAAS,mBAAO,CAAC,0FAAM;AACvB,SAAS,mBAAO,CAAC,0FAAM;;AAEvB;AACA;AACA;;AAEA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,4GAAW;AAC7B,kBAAkB,mBAAO,CAAC,oHAAmB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC5GA,UAAU,mBAAO,CAAC,4GAAW;AAC7B,kBAAkB,mBAAO,CAAC,oHAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,eAAe,mBAAO,CAAC,8GAAyC;AAChE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,oCAAoC,mBAAO,CAAC,wHAA8C;AAC1F,mBAAO,CAAC,qGAA+B;AACvC,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,wCAAwC,mBAAO,CAAC,6EAAmB;AACnE,uCAAuC,gDAAgD,4CAA4C,0EAA0E,mBAAmB;AAChO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,kEAAkE,sFAAsF,2DAA2D,yEAAyE;AAC3iB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,OAAO,sCAAsC,6CAA6C;AACvG,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACvIa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,sCAAsC,mBAAO,CAAC,oFAAW;AACzD,qCAAqC,mBAAO,CAAC,kFAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACvBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,WAAW;AACX;AACA,UAAU,WAAW;AACrB;;;;;;;;;;;;ACTa;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,eAAe,mBAAO,CAAC,8GAAyC;AAChE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,wCAAwC,mBAAO,CAAC,6EAAmB;AACnE,mCAAmC,mBAAO,CAAC,wEAAO;AAClD,uCAAuC,gDAAgD,4CAA4C,0EAA0E,mBAAmB;AAChO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,kEAAkE,sFAAsF,2DAA2D,yEAAyE;AAC3iB;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACtBa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe,GAAG,cAAc;AAChC,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,oDAAoD,mBAAO,CAAC,uGAAgC;AAC5F,iBAAiB,mBAAO,CAAC,oFAAa;AACtC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;;AAEA,aAAa,cAAc;AAC3B;AACA;AACA;AACA,cAAc;AACd;AACA,kBAAkB,iBAAW;AAC7B;AACA;AACA,cAAc;AACd;AACA,iBAAiB,iBAAW;AAC5B;AACA;AACA,cAAc;AACd;AACA,oBAAoB,iBAAW;AAC/B;AACA;AACA,cAAc;AACd;AACA,sBAAsB,iBAAW;AACjC;AACA;AACA;AACA,cAAc;AACd;AACA,qBAAqB,iBAAW;AAChC;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kBAAe;AAChC;AACA;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;AC3Ja;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe,0BAA0B;AACzC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,sBAAsB;AACnC,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACjIa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAO,CAAC,uGAAgC;AACxC,mBAAO,CAAC,6GAAmC;AAC3C,mBAAO,CAAC,iHAAqC;AAC7C,mBAAO,CAAC,uGAAgC;AACxC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,mCAAmC,mBAAO,CAAC,2EAAQ;AACnD,qCAAqC,mBAAO,CAAC,+EAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACjCa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,oCAAoC,mBAAO,CAAC,6EAAS;AACrD,qCAAqC,mBAAO,CAAC,+EAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AC1Da;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,0CAA0C,mBAAO,CAAC,gEAAa;AAC/D,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,qEAAe;AACrC,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,oBAAoB;AACjC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,uBAAuB;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;;AAEA,gCAAgC,QAAQ,UAAU,iBAAiB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,oBAAoB;AACjC,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,uBAAuB;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,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,iBAAiB;AAC9B,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AChWa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;AACA,cAAc;AACd;AACA,kBAAkB,iBAAW;AAC7B;AACA;AACA,cAAc;AACd;AACA,iBAAiB,iBAAW;AAC5B;AACA;AACA,cAAc;AACd;AACA,oBAAoB,iBAAW;AAC/B;AACA;AACA,cAAc;AACd;AACA,sBAAsB,iBAAW;AACjC;AACA;AACA;AACA,cAAc;AACd;AACA,qBAAqB,iBAAW;AAChC;AACA;AACA;AACA,cAAc;AACd;AACA,oCAAoC,iBAAW;AAC/C;AACA;AACA;;;;;;;;;;;;AC9Ca;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,uBAAuB,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,uBAAuB,GAAG,kBAAkB;AAClH,+CAA+C,mBAAO,CAAC,8IAAyD;AAChH,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,cAAc,mBAAO,CAAC,qEAAe;AACrC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,mBAAmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/Ga;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAO,CAAC,qGAA+B;AACvC,mBAAO,CAAC,uGAAgC;AACxC,mBAAO,CAAC,uGAAgC;AACxC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,sCAAsC,mBAAO,CAAC,oFAAW;AACzD,qCAAqC,mBAAO,CAAC,kFAAU;AACvD,qCAAqC,mBAAO,CAAC,wFAAU;AACvD,cAAc,mBAAO,CAAC,kFAAU;AAChC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;AC/Ea;;AAEb,oBAAoB,mBAAO,CAAC,oHAA4C;AACxE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,wCAAwC,mBAAO,CAAC,kKAAmE;AACnH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,qCAAqC,mBAAO,CAAC,wHAA8C;AAC3F,6CAA6C,mBAAO,CAAC,4IAAwD;AAC7G,kCAAkC,mBAAO,CAAC,8GAAyC;AACnF,uDAAuD,mBAAO,CAAC,kKAAmE;AAClI,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,wDAAwD,mBAAO,CAAC,8IAAyD;AACzH,kCAAkC,mBAAO,CAAC,0CAAK;AAC/C,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,qEAAe;AACrC,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,sCAAsC,mBAAO,CAAC,oDAAS;AACvD,qCAAqC,mBAAO,CAAC,wFAAU;AACvD,cAAc,mBAAO,CAAC,kFAAU;AAChC;AACA;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B,qCAAqC,0CAA0C,kCAAkC,4DAA4D,0BAA0B;AAC1P,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,wEAAwE,KAAK;AAChc;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,MAAM;AACN,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,0EAA0E,aAAa;AACvF;AACA;AACA;AACA,KAAK;AACL;AACA,6EAA6E,eAAe;AAC5F;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+HAA+H,+CAA+C;AAC9K;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA,cAAc,IAAsC;AACpD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,2EAA2E,eAAe;AAC1F;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA;AACA;AACA;AACA,YAAY;AACZ,+EAA+E;AAC/E;AACA;AACA;AACA;AACA,0FAA0F;AAC1F;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,QAAQ,iBAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACxea;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,mBAAO,CAAC,8FAAU;AACvD;;;;;;;;;;;;ACda;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,sCAAsC,mBAAO,CAAC,8GAAyC;AACvF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,6CAA6C,mBAAO,CAAC,4IAAwD;AAC7G,wCAAwC,mBAAO,CAAC,gHAA0C;AAC1F,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,cAAc,mBAAO,CAAC,qEAAe;AACrC,oBAAoB,mBAAO,CAAC,mFAAsB;AAClD,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,mCAAmC,mBAAO,CAAC,0FAAM;AACjD,cAAc,mBAAO,CAAC,mFAAW;AACjC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,kBAAe;AAC5B;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,aAAa;AACb,YAAY;AACZ;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,eAAe,YAAY;AAC3B,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,UAAU;AACV,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,UAAU;AACV,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV,iEAAiE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACzfa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,yCAAyC,mBAAO,CAAC,mGAAe;AAChE;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI,gBAAgB,qBAAM;AAC1B,SAAS,qBAAM,cAAc,qBAAM;AACnC,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;;;;;;;;;;;ACnCA,SAAS,mBAAO,CAAC,uFAAM;AACvB,SAAS,mBAAO,CAAC,uFAAM;;AAEvB;AACA;AACA;;AAEA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC5GA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,qCAAqC,mBAAO,CAAC,0GAAuC;AACpF,kCAAkC,mBAAO,CAAC,8GAAyC;AACnF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,oCAAoC,mBAAO,CAAC,wHAA8C;AAC1F,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,oBAAoB,mBAAO,CAAC,mFAAsB;AAClD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA,cAAc,MAAqC,GAAG,CAAI;AAC1D;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACtIa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,6CAA6C,mBAAO,CAAC,oGAAmB;AACxE,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAe;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB,eAAe,iBAAiB;AAChC,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;AC9Da;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,6CAA6C,mBAAO,CAAC,oGAAmB;AACxE,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK;AAC/b,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;AACA;AACA,sBAAsB,kBAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,cAAc;AAC7B,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe;AACxB;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACjJa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,sCAAsC,mBAAO,CAAC,qFAAY;AAC1D,6BAA6B,mBAAO,CAAC,8IAAgC;AACrE,cAAc,mBAAO,CAAC,kGAAU;AAChC,aAAa,mBAAO,CAAC,iFAAU;AAC/B;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AC/Da;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,kCAAkC,mBAAO,CAAC,oGAAoC;AAC9E,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAe;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACziBa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,0CAA0C,mBAAO,CAAC,0GAAoC;AACtF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,gDAAgD,mBAAO,CAAC,8HAAiD;AACzG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,cAAc,mBAAO,CAAC,qEAAe;AACrC,mCAAmC,mBAAO,CAAC,0FAAM;AACjD,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,eAAe,mBAAO,CAAC,qFAAY;AACnC,6BAA6B,mBAAO,CAAC,8IAAgC;AACrE,cAAc,mBAAO,CAAC,mFAAW;AACjC,2DAA2D,mBAAO,CAAC,oJAAmC;AACtG,qDAAqD,mBAAO,CAAC,uHAA6B;AAC1F,eAAe,mBAAO,CAAC,kGAAU;AACjC,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK;AAC/b,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,kBAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,oFAAoF;AACpF;AACA,KAAK;AACL;AACA,yEAAyE;AACzE;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,yFAAyF;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,YAAY,IAAI;AAChB;AACA,WAAW;AACX;AACA,WAAW,oCAAoC;AAC/C;AACA,WAAW,4CAA4C;AACvD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,KAAK;AACtB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;AC34Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,yBAAyB,GAAG,wBAAwB,GAAG,mCAAmC,GAAG,2BAA2B,GAAG,+BAA+B,GAAG,sBAAsB,GAAG,iCAAiC,GAAG,+BAA+B,GAAG,+BAA+B,GAAG,oBAAoB,GAAG,4CAA4C,GAAG,8BAA8B,GAAG,iCAAiC,GAAG,0BAA0B;AACnc,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,iDAAiD,mBAAO,CAAC,gIAAkD;AAC3G,sCAAsC,mBAAO,CAAC,0GAAuC;AACrF,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,sCAAsC,mBAAO,CAAC,0HAA+C;AAC7F,qCAAqC,mBAAO,CAAC,wHAA8C;AAC3F,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,wCAAwC,mBAAO,CAAC,gHAA0C;AAC1F,0CAA0C,mBAAO,CAAC,8DAAc;AAChE,mCAAmC,mBAAO,CAAC,6CAAM;AACjD,cAAc,mBAAO,CAAC,qEAAe;AACrC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,cAAc,mBAAO,CAAC,kGAAU;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,yBAAyB,6CAA6C;AAC5I;AACA;AACA;AACA,gEAAgE,aAAoB;AACpF;AACA,2DAA2D,aAAoB;AAC/E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,8BAA8B,+BAA+B;AAC7D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA,gCAAgC,iCAAiC;AACjE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA,0BAA0B,2BAA2B;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA,8BAA8B,+BAA+B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+BAA+B;AAC7D;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4MAA4M,aAAoB;AAChO;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA,kCAAkC,mCAAmC;AACrE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa,KAAK;AAClB;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,6BAA6B,8BAA8B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA2C,4CAA4C;AACvF;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChXa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,+BAA+B,GAAG,uBAAuB,GAAG,qBAAqB,GAAG,qDAAqD,GAAG,oCAAoC,GAAG,mCAAmC,GAAG,qBAAqB,GAAG,6CAA6C,GAAG,uCAAuC,GAAG,6CAA6C,GAAG,+BAA+B,GAAG,4CAA4C,GAAG,+CAA+C,GAAG,+CAA+C,GAAG,0BAA0B,GAAG,yCAAyC,GAAG,0CAA0C,GAAG,sCAAsC,GAAG,4CAA4C,GAAG,0DAA0D,GAAG,kCAAkC;AAC71B,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG;AACA;AACA;AACA;;AAEA,qCAAqC,sCAAsC;AAC3E,iCAAiC,kCAAkC;AACnE,oBAAoB,qBAAqB;AACzC,kCAAkC,mCAAmC;AACrE,4CAA4C,6CAA6C;AACzF,oBAAoB,qBAAqB,SAAS;AAClD,8BAA8B,+BAA+B;AAC7D,sCAAsC,uCAAuC;AAC7E,wCAAwC,yCAAyC;AACjF,2CAA2C,4CAA4C;AACvF,8CAA8C,+CAA+C;AAC7F,8CAA8C,+CAA+C;AAC7F,4CAA4C,6CAA6C;AACzF,sBAAsB,uBAAuB,gBAAgB;;AAE7D,8BAA8B,+BAA+B;AAC7D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,0DAA0D,qPAAqP;AACxW,mCAAmC,oCAAoC;AACvE;AACA;AACA;AACA,yBAAyB,0BAA0B;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,qDAAqD;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0CAA0C;AACnF;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD,2CAA2C,4CAA4C;AACvF;;;;;;;;;;;;ACtnBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,sCAAsC,mBAAO,CAAC,oFAAW;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACpCa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,qDAAqD,mBAAO,CAAC,sHAA4B;AACzF;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AC/Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe,GAAG,eAAe,GAAG,aAAa,GAAG,mBAAmB;AACvE,cAAc,mBAAO,CAAC,qEAAe;AACrC;AACA;AACA;;AAEA,kBAAkB,mBAAmB;AACrC,eAAe,kBAAe;AAC9B;AACA;AACA,yBAAyB,iBAAW;AACpC,eAAe,iBAAW;AAC1B;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9Ca;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,kCAAkC,mBAAO,CAAC,8GAAyC;AACnF,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,qEAAe;AACrC,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,mDAAmD,mBAAO,CAAC,kHAA0B;AACrF,eAAe,mBAAO,CAAC,oFAAW;AAClC,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kBAAe;AACpC;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE;AACrE;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACvLa;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,eAAe,mBAAO,CAAC,8GAAyC;AAChE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,uCAAuC,mBAAO,CAAC,oFAAW;AAC1D,qCAAqC,mBAAO,CAAC,kFAAU;AACvD,yCAAyC,mBAAO,CAAC,4FAAe;AAChE,oCAAoC,mBAAO,CAAC,gFAAS;AACrD,aAAa;AACb,qDAAqD,mBAAO,CAAC,kHAA0B;AACvF,8BAA8B;AAC9B,kDAAkD,mBAAO,CAAC,8JAAgD;AAC1G,2BAA2B;AAC3B,qDAAqD,mBAAO,CAAC,oJAA2C;AACxG,6DAA6D,mBAAO,CAAC,wKAAqD;AAC1H,gDAAgD,mBAAO,CAAC,0GAAsB;AAC9E,iDAAiD,mBAAO,CAAC,4GAAuB;AAChF,8CAA8C,mBAAO,CAAC,sGAAoB;AAC1E,yCAAyC,mBAAO,CAAC,gGAAc;AAC/D,uCAAuC,gDAAgD,4CAA4C,0EAA0E,mBAAmB;AAChO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,kEAAkE,sFAAsF,2DAA2D,yEAAyE;AAC3iB;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACrGa;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,yBAAyB;AACzB,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,qEAAe;AACrC,cAAc,mBAAO,CAAC,kFAAU;AAChC,sCAAsC,mBAAO,CAAC,oFAAW;AACzD,mDAAmD,mBAAO,CAAC,kHAA0B;AACrF,2DAA2D,mBAAO,CAAC,oIAAmC;AACtG,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mJAAmJ;AACnJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,KAAK;AAClB,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,mDAAmD,mBAAmB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,oDAAoD,oBAAoB;AACxE;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,cAAc;AACd;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACzJa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,0CAA0C,mBAAO,CAAC,0GAAoC;AACtF,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,gDAAgD,mBAAO,CAAC,8HAAiD;AACzG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,oDAAoD,mBAAO,CAAC,oJAA2C;AACvG,gDAAgD,mBAAO,CAAC,0GAAsB;AAC9E,iDAAiD,mBAAO,CAAC,4GAAuB;AAChF,8CAA8C,mBAAO,CAAC,sGAAoB;AAC1E,6DAA6D,mBAAO,CAAC,wKAAqD;AAC1H,8BAA8B,mBAAO,CAAC,8JAAgD;AACtF,aAAa,mBAAO,CAAC,gFAAS;AAC9B;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E;AACA,SAAS;AACT;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gBAAgB;AAChB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB,iBAAiB,SAAS;AAC1B;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AC9aa;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,6CAA6C,mBAAO,CAAC,oGAAmB;AACxE,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY;AAC3T;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACvDa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,sCAAsC,mBAAO,CAAC,oFAAW;AACzD,6BAA6B,mBAAO,CAAC,8JAAgD;AACrF,aAAa,mBAAO,CAAC,gFAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA,aAAa,KAAK;AAClB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AChFa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf,kBAAkB,kBAAe;AACjC;AACA;AACA;;;;;;;;;;;;ACVa;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,eAAe,mBAAO,CAAC,8GAAyC;AAChE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,mCAAmC,mBAAO,CAAC,0FAAM;AACjD,kDAAkD,mBAAO,CAAC,+JAAiD;AAC3G,wCAAwC,mBAAO,CAAC,mGAAa;AAC7D,uCAAuC,gDAAgD,4CAA4C,0EAA0E,mBAAmB;AAChO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,kEAAkE,sFAAsF,2DAA2D,yEAAyE;AAC3iB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,kBAAe;AAChC;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;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;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;AC9Na;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,mCAAmC;AACnC,wCAAwC,mBAAO,CAAC,0HAA+C;AAC/F;AACA;AACA;AACA,WAAW,KAAK;AAChB,aAAa;AACb;AACA,kCAAkC,mCAAmC;AACrE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;;;;;;;;;;ACzBA,SAAS,mBAAO,CAAC,uFAAM;AACvB,SAAS,mBAAO,CAAC,uFAAM;;AAEvB;AACA;AACA;;AAEA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC5GA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,6BAA6B,GAAG,0BAA0B,GAAG,uBAAuB,GAAG,8CAA8C,GAAG,8BAA8B,GAAG,mBAAmB,GAAG,6BAA6B,GAAG,qBAAqB,GAAG,gCAAgC,GAAG,oCAAoC;AAC9T,6BAA6B,8BAA8B,cAAc;;AAEzE,kBAAkB,mBAAmB,QAAQ;;AAE7C,4BAA4B,6BAA6B,cAAc;AACvE,4BAA4B,6BAA6B,mBAAmB;;AAE5E,yBAAyB,0BAA0B,cAAc;AACjE,6CAA6C,8CAA8C,cAAc;AACzG,+BAA+B,gCAAgC,mBAAmB;;AAElF,mCAAmC,oCAAoC;AACvE,sBAAsB,uBAAuB;AAC7C,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mBAAO,CAAC,qGAA+B;AACvC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,uCAAuC,mBAAO,CAAC,uFAAY;AAC3D,qCAAqC,mBAAO,CAAC,mFAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;AC9Ca;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACrGa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,qCAAqC,mBAAO,CAAC,wHAA8C;AAC3F,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,sCAAsC,mBAAO,CAAC,0HAA+C;AAC7F,iDAAiD,mBAAO,CAAC,gIAAkD;AAC3G,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,iBAAiB,mBAAO,CAAC,yFAAa;AACtC;AACA;AACA;AACA;AACA;AACA,qBAAqB,kBAAe;AACpC;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,yBAAyB,6BAA6B;AACtD,wBAAwB;AACxB,wBAAwB;AACxB,uBAAuB;AACvB,uBAAuB,yBAAyB;AAChD,2BAA2B,0BAA0B;AACrD;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,iBAAiB,MAAM;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,iBAAiB,MAAM;AACvB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACvQa;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,iDAAiD,mBAAO,CAAC,gIAAkD;AAC3G,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,sCAAsC,mBAAO,CAAC,0HAA+C;AAC7F,mBAAO,CAAC,qGAA+B;AACvC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,8CAA8C,mBAAO,CAAC,uGAAoB;AAC1E,6CAA6C,mBAAO,CAAC,qGAAmB;AACxE,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB,gBAAgB,QAAQ;AACxB;AACA,gBAAgB,QAAQ;AACxB;AACA,gBAAgB,QAAQ;AACxB;AACA,gBAAgB,QAAQ;AACxB,gBAAgB,SAAS;AACzB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,+BAA+B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA,eAAe,QAAQ;AACvB,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA,aAAa,OAAO;AACpB,eAAe,iCAAiC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,gBAAgB;AAC7B,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,gBAAgB;AAC7B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO,KAAK;AACZ;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,gBAAgB,kBAAe;AAC/B;;;;;;;;;;;;AC1Ra;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mBAAO,CAAC,iHAAqC;AAC7C,mBAAO,CAAC,6GAAmC;AAC3C,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,qCAAqC,mBAAO,CAAC,iFAAU;AACvD,qCAAqC,mBAAO,CAAC,iFAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA,CAAC;AACD;;;;;;;;;;;;AClFa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,6CAA6C,mBAAO,CAAC,4IAAwD;AAC7G,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,qCAAqC,mBAAO,CAAC,wHAA8C;AAC3F,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,uDAAuD,mBAAO,CAAC,kKAAmE;AAClI,6CAA6C,mBAAO,CAAC,wHAA8C;AACnG,wDAAwD,mBAAO,CAAC,8IAAyD;AACzH,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,cAAc,mBAAO,CAAC,qEAAe;AACrC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AClHa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA,uBAAuB,iBAAW;AAClC,aAAa,iBAAW;AACxB,kBAAkB,iBAAW;AAC7B,4BAA4B,iBAAW;AACvC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAO,CAAC,qGAA+B;AACvC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,sCAAsC,mBAAO,CAAC,oFAAW;AACzD,qCAAqC,mBAAO,CAAC,kFAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACxBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,0CAA0C,mBAAO,CAAC,0GAAoC;AACtF,gDAAgD,mBAAO,CAAC,8HAAiD;AACzG,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,mCAAmC,mBAAO,CAAC,0FAAM;AACjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,MAAM;AACN;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,mBAAmB;AACnB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,GAAG;AAChB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;AC5LA,SAAS,mBAAO,CAAC,uFAAM;AACvB,SAAS,mBAAO,CAAC,uFAAM;;AAEvB;AACA;AACA;;AAEA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC5GA,UAAU,mBAAO,CAAC,yGAAW;AAC7B,kBAAkB,mBAAO,CAAC,iHAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA,uBAAuB,iBAAW;AAClC,aAAa,iBAAW;AACxB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC1Ba;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mBAAO,CAAC,qGAA+B;AACvC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,mCAAmC,mBAAO,CAAC,2EAAQ;AACnD,qCAAqC,mBAAO,CAAC,+EAAU;AACvD;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;ACxBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,mCAAmC,mBAAO,CAAC,oHAA4C;AACvF,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,oBAAoB;AACjC,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;;AClIa;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,sCAAsC,mBAAO,CAAC,8GAAyC;AACvF,kCAAkC,mBAAO,CAAC,oGAAoC;AAC9E,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,cAAc,mBAAO,CAAC,qEAAe;AACrC,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,2DAA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,kBAAe;AACnC;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E;AAC/E,OAAO;AACP,iEAAiE;AACjE,OAAO;AACP;AACA,4FAA4F;AAC5F,OAAO;AACP,8EAA8E;AAC9E,OAAO;AACP;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;AC7Ha;;AAEb,mBAAmB,mBAAO,CAAC,oHAA4C;AACvE,oCAAoC,mBAAO,CAAC,4JAAgE;AAC5G,wCAAwC,mBAAO,CAAC,kKAAmE;AACnH,wCAAwC,mBAAO,CAAC,oKAAoE;AACpH,+BAA+B,mBAAO,CAAC,8IAAyD;AAChG,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,sCAAsC,mBAAO,CAAC,4GAAwC;AACtF,oCAAoC,mBAAO,CAAC,wHAA8C;AAC1F,uDAAuD,mBAAO,CAAC,kKAAmE;AAClI,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,wDAAwD,mBAAO,CAAC,8IAAyD;AACzH,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,cAAc,mBAAO,CAAC,qEAAe;AACrC,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,8CAA8C,mBAAO,CAAC,qGAAqB;AAC3E,4CAA4C,mBAAO,CAAC,iGAAmB;AACvE;AACA;AACA;AACA;AACA,yBAAyB,yBAAyB,qCAAqC,0CAA0C,kCAAkC,4DAA4D,0BAA0B;AACzP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,wEAAwE,KAAK;AAChc;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,eAAe;AAC5B,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA,qFAAqF;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe;AACf;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,aAAa,eAAe;AAC5B;AACA,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,aAAa,eAAe;AAC5B;AACA,eAAe;AACf;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,gBAAgB,kBAAe;AAC/B;;;;;;;;;;;;ACxca;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,cAAc,GAAG,8BAA8B,GAAG,0BAA0B,GAAG,sBAAsB,GAAG,uBAAuB,GAAG,4BAA4B;AAC9J,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,4BAA4B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,yBAAyB,0BAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA,6BAA6B,8BAA8B;AAC3D;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACrDa;;AAEb,cAAc,mBAAO,CAAC,0GAAuC;AAC7D,eAAe,mBAAO,CAAC,8GAAyC;AAChE,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,uCAAuC,mBAAO,CAAC,kKAAmE;AAClH,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,wCAAwC,mBAAO,CAAC,6EAAmB;AACnE,qCAAqC,mBAAO,CAAC,iFAAU;AACvD,iBAAiB,mBAAO,CAAC,uFAAa;AACtC,uCAAuC,gDAAgD,4CAA4C,0EAA0E,mBAAmB;AAChO,yCAAyC,uCAAuC,6EAA6E,cAAc,qCAAqC,oCAAoC,UAAU,iBAAiB,kEAAkE,sFAAsF,2DAA2D,yEAAyE;AAC3iB,8DAA8D;AAC9D;;;;;;;;;;;;AClCa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,iCAAiC;AACjC;AACA,gCAAgC,iCAAiC;AACjE;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACba;;AAEb,yBAAyB,mBAAO,CAAC,gIAAkD;AACnF,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe,GAAG,qBAAqB;AACvC,0CAA0C,mBAAO,CAAC,0GAAoC;AACtF,gDAAgD,mBAAO,CAAC,8HAAiD;AACzG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,qDAAqD,mBAAO,CAAC,wIAAsD;AACnH,wCAAwC,mBAAO,CAAC,8GAAyC;AACzF,yDAAyD,mBAAO,CAAC,gJAA0D;AAC3H,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,mCAAmC,mBAAO,CAAC,yFAAM;AACjD,iBAAiB,mBAAO,CAAC,6EAAmB;AAC5C,iBAAiB,mBAAO,CAAC,uFAAa;AACtC,aAAa,mBAAO,CAAC,+EAAS;AAC9B,iCAAiC,6DAA6D,yCAAyC,4DAA4D,iCAAiC,iEAAiE,4DAA4D,OAAO,yCAAyC;AACjZ,uCAAuC,yEAAyE,2CAA2C,8CAA8C,MAAM,6EAA6E,IAAI,eAAe,YAAY,kBAAkB;AAC7U;AACA;AACA;AACA;AACA;AACA,oBAAoB,qBAAqB;AACzC;AACA;AACA;AACA;AACA,aAAa,KAAK;AAClB;AACA;AACA;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;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,eAAe,uBAAuB;AACtC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,uBAAuB;AACtC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,yBAAyB;AACxC,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB;AACnB;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,eAAe,MAAM;AACrB,eAAe,QAAQ;AACvB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,eAAe,MAAM;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,eAAe,kBAAe;AAC9B;;;;;;;;;;;AC7cA,SAAS,mBAAO,CAAC,sFAAM;AACvB,SAAS,mBAAO,CAAC,sFAAM;;AAEvB;AACA;AACA;;AAEA;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;ACzBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,QAAQ;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACjCA,UAAU,mBAAO,CAAC,wGAAW;AAC7B,kBAAkB,mBAAO,CAAC,gHAAmB;;AAE7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC;AACpC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,OAAO;AACzB;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;AC5GA,UAAU,mBAAO,CAAC,wGAAW;AAC7B,kBAAkB,mBAAO,CAAC,gHAAmB;;AAE7C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA","sources":["webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/encryption.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/ensure-buffer.browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/kms-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/kms-certificate-validation.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/kms-dry-error-interceptor.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/kms-errors.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/dist/kms.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/asn1js/src/asn1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/uuid/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/uuid/lib/bytesToUuid.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/uuid/lib/rng-browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/uuid/v1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-encryption/node_modules/uuid/v4.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-feature/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-feature/dist/feature.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-feature/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-llm/dist/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-llm/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-llm/dist/llm.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-lyra/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-lyra/dist/device.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-lyra/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-lyra/dist/lyra.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-lyra/dist/space.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/errors.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/mercury.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/socket/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/socket/socket-base.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/dist/socket/socket.shim.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/node_modules/uuid/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/node_modules/uuid/lib/bytesToUuid.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/node_modules/uuid/lib/rng-browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/node_modules/uuid/v1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-mercury/node_modules/uuid/v4.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/behavioral-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/business-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/call-diagnostic/call-diagnostic-metrics-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/call-diagnostic/call-diagnostic-metrics-latencies.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/call-diagnostic/call-diagnostic-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/call-diagnostic/call-diagnostic-metrics.util.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/call-diagnostic/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/client-metrics-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/client-metrics-prelogin-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/generic-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/new-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/operational-metrics.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/prelogin-metrics-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/rtcMetrics/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/rtcMetrics/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/dist/utils.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/node_modules/uuid/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/node_modules/uuid/lib/bytesToUuid.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/node_modules/uuid/lib/rng-browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/node_modules/uuid/v1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-metrics/node_modules/uuid/v4.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/presence-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/presence-worker.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-presence/dist/presence.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-search/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-search/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-search/dist/search.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/dist/support.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/node_modules/uuid/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/node_modules/uuid/lib/bytesToUuid.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/node_modules/uuid/lib/rng-browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/node_modules/uuid/v1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-support/node_modules/uuid/v4.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-user/dist/config.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-user/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-user/dist/user-uuid-batcher.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-user/dist/user-uuid-store.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-user/dist/user.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/dist/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/dist/utils.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/dist/voicea.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/node_modules/uuid/index.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/node_modules/uuid/lib/bytesToUuid.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/node_modules/uuid/lib/rng-browser.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/node_modules/uuid/v1.js","webpack://@agentx/agentx/../../node_modules/@webex/internal-plugin-voicea/node_modules/uuid/v4.js"],"sourcesContent":["\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n encryption: {\n joseOptions: {\n compact: true,\n contentAlg: 'A256GCM',\n protect: '*'\n },\n /**\n * Initial timeout before contacting KMS with a new request\n * @type {Number}\n */\n kmsInitialTimeout: 6000,\n /**\n * Maximum timeout before negotiating a new ECDH key\n * and contacting KMS with a new request\n * @type {Number}\n */\n kmsMaxTimeout: 32000,\n /**\n * Maximum timeout after negotiating several ECDH keys\n * @type {Number}\n */\n ecdhMaxTimeout: 32000 * 3,\n /**\n * Debounce wait before sending a kms request\n * @type {Number}\n */\n batcherWait: 50,\n /**\n * Maximum queue size before sending a kms request\n * @type {Number}\n */\n batcherMaxCalls: 50,\n /**\n * Debounce max wait before sending a kms metric\n * @type {Number}\n */\n batcherMaxWait: 150\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.KMS_KEY_REVOKE_FAILURE = exports.KMS_KEY_REVOKE_ERROR_STATUS = exports.KMS_KEY_REVOKE_ERROR_CODES = void 0;\nvar KMS_KEY_REVOKE_FAILURE = exports.KMS_KEY_REVOKE_FAILURE = 'event:kms:key:revoke:encryption:failure';\nvar KMS_KEY_REVOKE_ERROR_STATUS = exports.KMS_KEY_REVOKE_ERROR_STATUS = 405;\nvar KMS_KEY_REVOKE_ERROR_CODES = exports.KMS_KEY_REVOKE_ERROR_CODES = [405005, 405006];\n//# sourceMappingURL=constants.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _events = require(\"events\");\nvar _url = _interopRequireDefault(require(\"url\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _common = require(\"@webex/common\");\nvar _nodeJose = _interopRequireDefault(require(\"node-jose\"));\nvar _nodeScr = _interopRequireDefault(require(\"node-scr\"));\nvar _ensureBuffer = _interopRequireDefault(require(\"./ensure-buffer\"));\nvar _kms = _interopRequireDefault(require(\"./kms\"));\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar Encryption = _webexCore.WebexPlugin.extend({\n children: {\n kms: _kms.default\n },\n namespace: 'Encryption',\n processKmsMessageEvent: function processKmsMessageEvent(event) {\n return this.kms.processKmsMessageEvent(event);\n },\n decryptBinary: function decryptBinary(scr, buffer) {\n return (0, _ensureBuffer.default)(buffer).then(function (b) {\n /* istanbul ignore if */\n if (buffer.length === 0 || buffer.byteLength === 0) {\n return _promise.default.reject(new Error('Attempted to decrypt zero-length buffer'));\n }\n return scr.decrypt(b);\n });\n },\n /**\n * Decrypt a SCR (Secure Content Resource) using the supplied key uri.\n *\n * @param {string} key - The uri of a key stored in KMS\n * @param {Object} cipherScr - An encrypted SCR\n * @param {Object} options\n * @param {string} options.onBehalfOf - Fetch the KMS key on behalf of another user (using the user's UUID), active user requires the 'spark.kms_orgagent' role\n * @returns {Object} Decrypted SCR\n */\n decryptScr: function decryptScr(key, cipherScr, options) {\n return this.getKey(key, options).then(function (k) {\n return _nodeScr.default.fromJWE(k.jwk, cipherScr);\n });\n },\n /**\n * Decrypt text using the supplied key uri.\n *\n * @param {string} key - The uri of a key stored in KMS\n * @param {string} ciphertext - Encrypted text\n * @param {Object} options\n * @param {string} options.onBehalfOf - Fetch the KMS key on behalf of another user (using the user's UUID), active user requires the 'spark.kms_orgagent' role\n * @returns {string} Decrypted plaintext\n */\n decryptText: function decryptText(key, ciphertext, options) {\n return this.getKey(key, options).then(function (k) {\n return _nodeJose.default.JWE.createDecrypt(k.jwk).decrypt(ciphertext).then(function (result) {\n return result.plaintext.toString();\n });\n });\n },\n /**\n * Validate and initiate a Download request for requested file\n * @param {Object} fileUrl - Plaintext\n * @param {Object} scr - Plaintext\n * @param {Object} options - optional parameters to download a file\n * @returns {promise}\n */\n download: function download(fileUrl, scr, options) {\n var _this = this;\n /* istanbul ignore if */\n if (!fileUrl || !scr) {\n return _promise.default.reject(new Error('`scr` and `fileUrl` are required'));\n }\n var shunt = new _events.EventEmitter();\n var promise = this._fetchDownloadUrl(fileUrl, options).then(function (uri) {\n // eslint-disable-next-line no-shadow\n var options = {\n method: 'GET',\n uri: uri,\n responseType: 'buffer'\n };\n var ret = _this.request(options);\n (0, _common.transferEvents)('progress', options.download, shunt);\n return ret;\n }).then(function (res) {\n return _this.decryptBinary(scr, res.body);\n });\n (0, _common.proxyEvents)(shunt, promise);\n return promise;\n },\n /**\n * Fetch Download URL for the requested file\n * @param {Object} fileUrl - Plaintext\n * @param {Object} options - optional parameters to download a file\n * @returns {promise} url of the downloadable file\n */\n _fetchDownloadUrl: function _fetchDownloadUrl(fileUrl, options) {\n var _this2 = this;\n this.logger.info('encryption: retrieving download url for encrypted file');\n if (process.env.NODE_ENV !== 'production' && fileUrl.includes('localhost')) {\n this.logger.info('encryption: bypassing webex files because this looks to be a test file on localhost');\n return _promise.default.resolve(fileUrl);\n }\n var inputBody = {\n endpoints: [fileUrl]\n };\n var endpointUrl = _url.default.parse(fileUrl);\n\n // hardcode the url to use 'https' and the file service '/v1/download/endpoints' api\n endpointUrl.protocol = 'https';\n endpointUrl.pathname = '/v1/download/endpoints';\n return this.request({\n method: 'POST',\n uri: _url.default.format(endpointUrl),\n body: options ? _objectSpread(_objectSpread({}, inputBody), {}, {\n allow: options.params.allow\n }) : inputBody\n }).then(function (res) {\n // eslint-disable-next-line no-shadow\n var url = res.body.endpoints[fileUrl];\n if (!url) {\n _this2.logger.warn('encryption: could not determine download url for `fileUrl`; attempting to download `fileUrl` directly');\n return fileUrl;\n }\n _this2.logger.info('encryption: retrieved download url for encrypted file');\n return url;\n }).catch(function (err) {\n _this2.logger.warn(\"encryption: \".concat(err, \" could not determine download url for \").concat(fileUrl, \"; attempting to download \").concat(fileUrl, \" directly\"));\n return fileUrl;\n });\n },\n encryptBinary: function encryptBinary(file) {\n return (0, _ensureBuffer.default)(file).then(function (buffer) {\n return _nodeScr.default.create().then(function (scr) {\n return scr.encrypt(buffer).then(_ensureBuffer.default)\n // eslint-disable-next-line max-nested-callbacks\n .then(function (cdata) {\n return {\n scr: scr,\n cdata: cdata\n };\n });\n });\n });\n },\n /**\n * Encrypt a SCR (Secure Content Resource) using the supplied key uri.\n *\n * @param {string} key - The uri of a key stored in KMS\n * @param {Object} scr - Plaintext\n * @param {Object} options\n * @param {string} options.onBehalfOf - Fetch the KMS key on behalf of another user (using the user's UUID), active user requires the 'spark.kms_orgagent' role\n * @returns {string} Encrypted SCR\n */\n encryptScr: function encryptScr(key, scr, options) {\n /* istanbul ignore if */\n if (!scr.loc) {\n return _promise.default.reject(new Error('Cannot encrypt `scr` without first setting `loc`'));\n }\n return this.getKey(key, options).then(function (k) {\n return scr.toJWE(k.jwk);\n });\n },\n /**\n * Encrypt plaintext using the supplied key uri.\n *\n * @param {string} key - The uri of a key stored in KMS\n * @param {string} plaintext\n * @param {Object} options\n * @param {string} options.onBehalfOf - Fetch the KMS key on behalf of another user (using the user's UUID), active user requires the 'spark.kms_orgagent' role\n * @returns {string} Encrypted text\n */\n encryptText: function encryptText(key, plaintext, options) {\n var _this3 = this;\n return this.getKey(key, options).then(function (k) {\n return _nodeJose.default.JWE.createEncrypt(_this3.config.joseOptions, {\n key: k.jwk,\n header: {\n alg: 'dir'\n },\n reference: null\n }).final(plaintext, 'utf8');\n });\n },\n /**\n * Fetch the key associated with the supplied KMS uri.\n *\n * @param {string} uri - The uri of a key stored in KMS\n * @param {Object} options\n * @param {string} options.onBehalfOf - Fetch the KMS key on behalf of another user (using the user's UUID), active user requires the 'spark.kms_orgagent' role\n * @returns {string} Key\n */\n getKey: function getKey(uri) {\n var _this4 = this;\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n onBehalfOf = _ref.onBehalfOf;\n if (uri.jwk) {\n return this.kms.asKey(uri);\n }\n var storageKey = uri;\n if (onBehalfOf) {\n storageKey += \"/onBehalfOf/\".concat(onBehalfOf);\n }\n return this.unboundedStorage.get(storageKey).then(function (keyString) {\n return JSON.parse(keyString);\n }).then(function (keyObject) {\n return _this4.kms.asKey(keyObject);\n }).catch(function () {\n return _this4.kms.fetchKey({\n uri: uri,\n onBehalfOf: onBehalfOf\n }).then((0, _common.tap)(function (key) {\n return _this4.unboundedStorage.put(storageKey, (0, _stringify.default)(key, replacer));\n }));\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\n\n/**\n * JSON.stringify replacer that ensures private key data is serialized.\n * @param {string} k\n * @param {mixed} v\n * @returns {mixed}\n */\nfunction replacer(k, v) {\n if (k === 'jwk') {\n // note: this[k] and v may be different representations of the same value\n // eslint-disable-next-line no-invalid-this\n var json = this[k].toJSON(true);\n return json;\n }\n return v;\n}\nvar _default = exports.default = Encryption;\n//# sourceMappingURL=encryption.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = ensureBuffer;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-env: browser */\n\n/**\n * Ensures the provider buffer is, indeed, an ArrayBuffer; converts File and\n * Blob objects to ArrayBuffers.\n * @param {mixed} buffer\n * @returns {Promise}\n */\nfunction ensureBuffer(buffer) {\n if (buffer instanceof ArrayBuffer) {\n return _promise.default.resolve(buffer);\n }\n if (buffer.toArrayBuffer) {\n return _promise.default.resolve(buffer.toArrayBuffer());\n }\n if (buffer.buffer) {\n return _promise.default.resolve(buffer.buffer);\n }\n return new _promise.default(function (resolve, reject) {\n var fr = new FileReader();\n fr.onload = function onload() {\n resolve(new Uint8Array(this.result));\n };\n fr.onerror = reject;\n fr.readAsArrayBuffer(buffer);\n });\n}\n//# sourceMappingURL=ensure-buffer.browser.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"DryError\", {\n enumerable: true,\n get: function get() {\n return _kmsErrors.DryError;\n }\n});\n_Object$defineProperty(exports, \"KMS\", {\n enumerable: true,\n get: function get() {\n return _kms.default;\n }\n});\n_Object$defineProperty(exports, \"KmsError\", {\n enumerable: true,\n get: function get() {\n return _kmsErrors.KmsError;\n }\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _encryption.default;\n }\n});\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nrequire(\"@webex/internal-plugin-device\");\nrequire(\"@webex/internal-plugin-mercury\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lodash = require(\"lodash\");\nvar _encryption = _interopRequireDefault(require(\"./encryption\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\nvar _kmsErrors = require(\"./kms-errors\");\nvar _kmsDryErrorInterceptor = _interopRequireDefault(require(\"./kms-dry-error-interceptor\"));\nvar _kms = _interopRequireDefault(require(\"./kms\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n// Note: There's a bug where if bind gets replayed because of a timeout in which\n// the original request eventually completed, there'll be an error indicating\n// the key can't be bound (because it already has been). This could be mitigated\n// by using Promise.race to resolve replays (as more requests get enqueue for a\n// specific action, accept whichever one completes first).\n\nvar interceptors;\nif (process.env.NODE_ENV === 'test') {\n interceptors = {\n KmsDryErrorInterceptor: _kmsDryErrorInterceptor.default.create\n };\n}\n(0, _webexCore.registerInternalPlugin)('encryption', _encryption.default, {\n payloadTransformer: {\n predicates: [{\n name: 'encryptKmsMessage',\n direction: 'outbound',\n // I don't see any practical way to reduce complexity here.\n // eslint-disable-next-line complexity\n test: function test(ctx, options) {\n if (!(0, _lodash.has)(options, 'body.kmsMessage')) {\n return _promise.default.resolve(false);\n }\n if (!(0, _lodash.isObject)(options.body.kmsMessage)) {\n return _promise.default.resolve(false);\n }\n\n // If this is a template for a kms message, assume another transform\n // will fill it in later. This is a bit of a leaky abstraction, but the\n // alternative is building a complex rules engine for controlling\n // ordering of transforms\n if (options.body.kmsMessage.keyUris && options.body.kmsMessage.keyUris.length === 0) {\n return _promise.default.resolve(false);\n }\n if (options.body.kmsMessage.resourceUri && (options.body.kmsMessage.resourceUri.includes('') || options.body.kmsMessage.resourceUri.includes(''))) {\n return _promise.default.resolve(false);\n }\n if (options.body.kmsMessage.uri && (options.body.kmsMessage.uri.includes('') || options.body.kmsMessage.uri.includes(''))) {\n return _promise.default.resolve(false);\n }\n return _promise.default.resolve(true);\n },\n extract: function extract(options) {\n return _promise.default.resolve(options.body);\n }\n }, {\n name: 'decryptKmsMessage',\n direction: 'inbound',\n test: function test(ctx, response) {\n return _promise.default.resolve((0, _lodash.has)(response, 'body.kmsMessage') && (0, _lodash.isString)(response.body.kmsMessage));\n },\n extract: function extract(response) {\n return _promise.default.resolve(response.body);\n }\n }, {\n name: 'decryptErrorResponse',\n direction: 'inbound',\n test: function test(ctx, reason) {\n return _promise.default.resolve(Boolean(reason.body && reason.body.errorCode === 1900000));\n },\n extract: function extract(reason) {\n return _promise.default.resolve(reason);\n }\n }],\n transforms: [{\n name: 'encryptKmsMessage',\n fn: function fn(ctx, object) {\n if (!object) {\n return _promise.default.resolve();\n }\n if (!object.kmsMessage) {\n return _promise.default.resolve();\n }\n if ((0, _lodash.isString)(object.kmsMessage)) {\n return _promise.default.resolve();\n }\n return ctx.webex.internal.encryption.kms.prepareRequest(object.kmsMessage).then(function (req) {\n object.kmsMessage = req.wrapped;\n });\n }\n }, {\n name: 'decryptKmsMessage',\n fn: function fn(ctx, object) {\n return ctx.webex.internal.encryption.kms.decryptKmsMessage(object.kmsMessage).then(function (kmsMessage) {\n object.kmsMessage = kmsMessage;\n });\n }\n }, {\n name: 'decryptErrorResponse',\n fn: function fn(ctx, reason) {\n var promises = reason.body.errors.map(function (error) {\n return ctx.webex.internal.encryption.kms.decryptKmsMessage(error.description).then(function (desc) {\n error.description = desc;\n });\n });\n promises.push(ctx.webex.internal.encryption.kms.decryptKmsMessage(reason.body.message).then(function (kmsMessage) {\n reason.body.message = kmsMessage;\n }));\n return _promise.default.all(promises).then(function () {\n return _promise.default.reject(new _kmsErrors.DryError(reason));\n });\n }\n }]\n },\n interceptors: interceptors,\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.TIMEOUT_SYMBOL = void 0;\nvar _symbol = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/symbol\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _commonTimers = require(\"@webex/common-timers\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _kmsErrors = require(\"./kms-errors\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar TIMEOUT_SYMBOL = exports.TIMEOUT_SYMBOL = (0, _symbol.default)('TIMEOUT_SYMBOL');\n\n/**\n * @class\n */\nvar KmsBatcher = _webexCore.Batcher.extend({\n namespace: 'Encryption',\n /**\n * Accepts a kmsMessage event and passes its contents to acceptItem\n * @param {Object} event\n * @returns {Promise}\n */\n processKmsMessageEvent: function processKmsMessageEvent(event) {\n var _this = this;\n this.logger.info('kms-batcher: received kms message');\n return _promise.default.all(event.encryption.kmsMessages.map(function (kmsMessage) {\n return new _promise.default(function (resolve) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n _this.logger.info('kms-batcher:', kmsMessage.body);\n }\n resolve(_this.acceptItem(kmsMessage));\n });\n }));\n },\n /**\n * Attaches a timeout to the given KMS message\n * @param {Object} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n var _this2 = this;\n return this.getDeferredForRequest(item).then(function (defer) {\n var timeout = item[TIMEOUT_SYMBOL];\n\n /* istanbul ignore if */\n if (!timeout) {\n throw new Error('timeout is required');\n }\n var timer = (0, _commonTimers.safeSetTimeout)(function () {\n _this2.logger.warn(\"kms: request timed out; request id: \".concat(item.requestId, \"; timeout: \").concat(timeout));\n _this2.handleItemFailure(item, new _kmsErrors.KmsTimeoutError({\n timeout: timeout,\n request: item\n }));\n }, timeout);\n\n // Reminder: reassign `promise` is not a viable means of inserting into\n // the Promise chain\n defer.promise.then(function () {\n return clearTimeout(timer);\n });\n defer.promise.catch(function () {\n return clearTimeout(timer);\n });\n return item;\n });\n },\n /**\n * Attaches the final bits of cluster info to the payload\n * @param {Array} queue\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(queue) {\n return this.webex.internal.encryption.kms._getKMSCluster().then(function (cluster) {\n return {\n destination: cluster,\n kmsMessages: queue.map(function (req) {\n return req.wrapped;\n })\n };\n });\n },\n /**\n * @param {Object} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n this.logger.info('kms: batched-request-length', payload.kmsMessages.length);\n return this.webex.request({\n method: 'POST',\n service: 'encryption',\n resource: '/kms/messages',\n body: payload\n });\n },\n /**\n * Does nothing; the http response doesn't carry our response data\n * @returns {Promise}\n */\n handleHttpSuccess: function handleHttpSuccess() {\n return _promise.default.resolve();\n },\n /**\n * @param {Object} item\n * @returns {Promise}\n */\n didItemFail: function didItemFail(item) {\n return _promise.default.resolve(item.status >= 400);\n },\n /**\n * @param {Object} item\n * @returns {Promise}\n */\n handleItemSuccess: function handleItemSuccess(item) {\n return this.getDeferredForResponse(item).then(function (defer) {\n defer.resolve(item.body);\n });\n },\n /**\n * @param {Object} item\n * @param {KmsError} [reason]\n * @returns {Promise}\n */\n handleItemFailure: function handleItemFailure(item, reason) {\n (0, _kmsErrors.handleKmsKeyRevokedEncryptionFailure)(item, this.webex);\n return this.getDeferredForResponse(item).then(function (defer) {\n defer.reject(reason || new _kmsErrors.KmsError(item.body));\n });\n },\n /**\n * @param {Object} item\n * @returns {Promise}\n */\n fingerprintRequest: function fingerprintRequest(item) {\n return _promise.default.resolve(item.requestId);\n },\n /**\n * @param {Object} item\n * @returns {Promise}\n */\n fingerprintResponse: function fingerprintResponse(item) {\n return _promise.default.resolve(item.requestId);\n }\n});\nvar _default = exports.default = KmsBatcher;\n//# sourceMappingURL=kms-batcher.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Array$from = require(\"@babel/runtime-corejs2/core-js/array/from\");\nvar _Symbol = require(\"@babel/runtime-corejs2/core-js/symbol\");\nvar _Symbol$iterator = require(\"@babel/runtime-corejs2/core-js/symbol/iterator\");\nvar _Array$isArray = require(\"@babel/runtime-corejs2/core-js/array/is-array\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.validateCommonName = exports.default = exports.X509_SUBJECT_ALT_NAME_KEY = exports.KMSError = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _wrapNativeSuper2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/wrapNativeSuper\"));\nvar _url = require(\"url\");\nvar _validUrl = require(\"valid-url\");\nvar _asn1js = require(\"asn1js\");\nvar _pkijs = require(\"pkijs\");\nvar _lodash = require(\"lodash\");\nvar _nodeJose = _interopRequireDefault(require(\"node-jose\"));\nvar _isomorphicWebcrypto = _interopRequireDefault(require(\"isomorphic-webcrypto\"));\nvar _safeBuffer = require(\"safe-buffer\");\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== \"undefined\" && o[_Symbol$iterator] || o[\"@@iterator\"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return _Array$from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n(0, _pkijs.setEngine)('newEngine', _isomorphicWebcrypto.default, new _pkijs.CryptoEngine({\n name: '',\n crypto: _isomorphicWebcrypto.default,\n subtle: _isomorphicWebcrypto.default.subtle\n}));\nvar VALID_KTY = 'RSA';\nvar VALID_KID_PROTOCOL = 'kms:';\nvar X509_COMMON_NAME_KEY = '2.5.4.3';\nvar X509_SUBJECT_ALT_NAME_KEY = exports.X509_SUBJECT_ALT_NAME_KEY = '2.5.29.17';\n\n/**\n * Customize Error so the SDK knows to quit retrying and notify\n * the user\n */\nvar KMSError = exports.KMSError = /*#__PURE__*/function (_Error) {\n (0, _inherits2.default)(KMSError, _Error);\n var _super = _createSuper(KMSError);\n /**\n * add kmsError field to notify\n * @param {string} message\n */\n function KMSError(message) {\n var _this;\n (0, _classCallCheck2.default)(this, KMSError);\n _this = _super.call(this, message);\n _this.kmsError = true;\n return _this;\n }\n return (0, _createClass2.default)(KMSError);\n}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));\nvar throwError = function throwError(err) {\n throw new KMSError(\"INVALID KMS: \".concat(err));\n};\n\n/**\n * Converts the PEM string to a pkijs certificate object\n * @param {string} pem PEM representation of a certificate\n * @returns {Certificate} pkijs object of the certificate\n */\nvar decodeCert = function decodeCert(pem) {\n if (typeof pem !== 'string') {\n throwError('certificate needs to be a string');\n }\n var der = _safeBuffer.Buffer.from(pem, 'base64');\n var ber = new Uint8Array(der).buffer;\n var asn1 = (0, _asn1js.fromBER)(ber);\n return new _pkijs.Certificate({\n schema: asn1.result\n });\n};\n\n/**\n * Validate the 'kty' property of the KMS credentials\n * @param {Object} JWT KMS credentials\n * @param {string} JWT.kty type of certificate\n * @throws {KMSError} if kty is not a valid type\n * @returns {void}\n */\nvar validateKtyHeader = function validateKtyHeader(_ref) {\n var kty = _ref.kty;\n if (kty !== VALID_KTY) {\n throwError(\"'kty' header must be '\".concat(VALID_KTY, \"'\"));\n }\n};\nvar validateKidHeader = function validateKidHeader(_ref2) {\n var kid = _ref2.kid;\n if (!(0, _validUrl.isUri)(kid)) {\n throwError(\"'kid' is not a valid URI\");\n }\n if ((0, _url.parse)(kid).protocol !== VALID_KID_PROTOCOL) {\n throwError(\"'kid' protocol must be '\".concat(VALID_KID_PROTOCOL, \"'\"));\n }\n};\n\n/**\n * Checks the first certificate matches the 'kid' in the JWT.\n * It first checks the Subject Alternative Name then it checks\n * the Common Name\n * @param {Certificate} certificate represents the KMS\n * @param {Object} JWT KMS credentials\n * @param {string} JWT.kid the uri of the KMS\n * @throws {KMSError} if unable to validate certificate against KMS credentials\n * @returns {void}\n */\nvar validateCommonName = exports.validateCommonName = function validateCommonName(_ref3, _ref4) {\n var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),\n certificate = _ref5[0];\n var kid = _ref4.kid;\n var kidHostname = (0, _url.parse)(kid).hostname;\n var validationSuccessful = false;\n if (certificate.extensions) {\n // Subject Alt Names are in here\n var _iterator = _createForOfIteratorHelper(certificate.extensions),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var extension = _step.value;\n if (extension.extnID === X509_SUBJECT_ALT_NAME_KEY) {\n var altNames = extension.parsedValue.altNames;\n var _iterator2 = _createForOfIteratorHelper(altNames),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var entry = _step2.value;\n var san = entry.value.toLowerCase();\n validationSuccessful = san === kidHostname;\n if (validationSuccessful) {\n break;\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n if (validationSuccessful) {\n break;\n }\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n if (!validationSuccessful) {\n // Didn't match kid in the Subject Alt Names, checking the Common Name\n var subjectAttributes = certificate.subject.typesAndValues;\n var _iterator3 = _createForOfIteratorHelper(subjectAttributes),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var attribute = _step3.value;\n if (attribute.type === X509_COMMON_NAME_KEY) {\n var commonName = attribute.value.valueBlock.value;\n validationSuccessful = commonName === kidHostname;\n if (validationSuccessful) {\n break;\n }\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n if (!validationSuccessful) {\n throwError(\"hostname of the 1st certificate does not match 'kid'\");\n }\n};\n\n/**\n * Validate the first KMS certificate against the information\n * provided in the JWT\n * @param {Certificate} certificate first certificate the identifies the KMS\n * @param {Object} JWT credentials of the KMS\n * @param {string} JWT.e Public exponent of the first certificate\n * @param {string} KWT.n Modulus of the first certificate\n * @throws {KMSError} if e or n doesn't match the first certificate\n * @returns {void}\n */\nvar validatePublicCertificate = function validatePublicCertificate(_ref6, _ref7) {\n var _ref8 = (0, _slicedToArray2.default)(_ref6, 1),\n certificate = _ref8[0];\n var publicExponent = _ref7.e,\n modulus = _ref7.n;\n var encode = _nodeJose.default.util.base64url.encode;\n var publicKey = certificate.subjectPublicKeyInfo.subjectPublicKey;\n var asn1PublicCert = (0, _asn1js.fromBER)(publicKey.valueBlock.valueHex);\n var publicCert = new _pkijs.RSAPublicKey({\n schema: asn1PublicCert.result\n });\n var publicExponentHex = publicCert.publicExponent.valueBlock.valueHex;\n var modulusHex = publicCert.modulus.valueBlock.valueHex;\n if (publicExponent !== encode(publicExponentHex)) {\n throwError('Public exponent is invalid');\n }\n if (modulus !== encode(modulusHex)) {\n throwError('Modulus is invalid');\n }\n};\n\n/**\n * Validates the list of certificates against the CAs provided\n * @param {certificate[]} certificates list of certificates provided\n * by the KMS to certify itself\n * @param {string[]} [caroots=[]] list of Certificate Authorities used to\n * validate the KMS's certificates\n * @returns {Promise} rejects if unable to validate the certificates\n */\nvar validateCertificatesSignature = function validateCertificatesSignature(certificates) {\n var caroots = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var certificateEngine = new _pkijs.CertificateChainValidationEngine({\n trustedCerts: caroots.map(decodeCert),\n certs: certificates\n });\n return certificateEngine.verify().then(function (_ref9) {\n var result = _ref9.result,\n resultCode = _ref9.resultCode,\n resultMessage = _ref9.resultMessage;\n if (!result) {\n throwError(\"Certificate Validation failed [\".concat(resultCode, \"]: \").concat(resultMessage));\n }\n });\n};\n\n/**\n * Validates the information provided by the KMS. This is a curried function.\n * The first function takes the caroots param and returns a second function.\n * The second function takes the credentials of the KMS and validates it\n * @param {string[]} caroots PEM encoded certificates that will be used\n * as Certificate Authorities\n * @param {Object} jwt Object containing the fields necessary to\n * validate the KMS\n * @returns {Promise} when resolved will return the jwt\n */\nvar validateKMS = function validateKMS(caroots) {\n return function () {\n var jwt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return _promise.default.resolve().then(function () {\n validateKtyHeader(jwt);\n validateKidHeader(jwt);\n if (!((0, _lodash.isArray)(jwt.x5c) && jwt.x5c.length > 0)) {\n throwError('JWK does not contain a list of certificates');\n }\n var certificates = jwt.x5c.map(decodeCert);\n validateCommonName(certificates, jwt);\n validatePublicCertificate(certificates, jwt);\n\n // Skip validating signatures if no CA roots were provided\n var promise = caroots ? validateCertificatesSignature(certificates, caroots) : _promise.default.resolve();\n return promise.then(function () {\n return jwt;\n });\n });\n };\n};\nvar _default = exports.default = validateKMS;\n//# sourceMappingURL=kms-certificate-validation.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _httpCore = require(\"@webex/http-core\");\nvar _kmsErrors = require(\"./kms-errors\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/**\n * Interceptor (only to be used in test mode) intended to replay requests that\n * fail as a result of the test-user incompatibility in KMS.\n * @class\n */\nvar KmsDryErrorInterceptor = exports.default = /*#__PURE__*/function (_Interceptor) {\n (0, _inherits2.default)(KmsDryErrorInterceptor, _Interceptor);\n var _super = _createSuper(KmsDryErrorInterceptor);\n function KmsDryErrorInterceptor() {\n (0, _classCallCheck2.default)(this, KmsDryErrorInterceptor);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(KmsDryErrorInterceptor, [{\n key: \"onResponseError\",\n value:\n /**\n * @param {Object} options\n * @param {Exception} reason\n * @returns {Promise}\n */\n function onResponseError(options, reason) {\n if (reason instanceof _kmsErrors.DryError && reason.message.match(/Failed to resolve authorization token in KmsMessage request for user/)) {\n this.webex.logger.error('DRY Request Failed due to kms/test-user flakiness');\n this.webex.logger.error(reason);\n return this.replay(options, reason);\n }\n return _promise.default.reject(reason);\n }\n\n /**\n * Replays the request\n * @param {Object} options\n * @param {DryError} reason\n * @returns {Object}\n */\n }, {\n key: \"replay\",\n value: function replay(options, reason) {\n if (options.replayCount) {\n options.replayCount += 1;\n } else {\n options.replayCount = 1;\n }\n if (options.replayCount > this.webex.config.maxAuthenticationReplays) {\n this.webex.logger.error(\"kms: failed after \".concat(this.webex.config.maxAuthenticationReplays, \" replay attempts\"));\n return _promise.default.reject(reason);\n }\n this.webex.logger.info(\"kms: replaying request \".concat(options.replayCount, \" time\"));\n return this.webex.request(options);\n }\n }], [{\n key: \"create\",\n value:\n /**\n * @returns {KmsDryErrorInterceptor}\n */\n function create() {\n return new KmsDryErrorInterceptor({\n webex: this\n });\n }\n }]);\n return KmsDryErrorInterceptor;\n}(_httpCore.Interceptor);\n//# sourceMappingURL=kms-dry-error-interceptor.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleKmsKeyRevokedEncryptionFailure = exports.KmsTimeoutError = exports.KmsError = exports.DryError = void 0;\nvar _defineProperties = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/define-properties\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _common = require(\"@webex/common\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _constants = require(\"./constants\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/**\n * Error class for KMS errors\n */\nvar KmsError = exports.KmsError = /*#__PURE__*/function (_Exception) {\n (0, _inherits2.default)(KmsError, _Exception);\n var _super = _createSuper(KmsError);\n function KmsError() {\n (0, _classCallCheck2.default)(this, KmsError);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(KmsError, [{\n key: \"parse\",\n value:\n /**\n * @param {HttpResponse} body\n * @returns {string}\n */\n function parse(body) {\n body = body.body || body;\n (0, _defineProperties.default)(this, {\n body: {\n enumerable: false,\n value: body\n },\n reason: {\n enumerable: false,\n value: body.reason\n },\n requestId: {\n enumerable: false,\n value: body.requestId\n },\n status: {\n enumerable: false,\n value: body.status\n }\n });\n var message = typeof body === 'string' ? body : body.reason;\n if (!message) {\n message = this.constructor.defaultMessage;\n }\n if (body.status) {\n message += \"\\nKMS_RESPONSE_STATUS: \".concat(body.status);\n }\n if (body.requestId) {\n message += \"\\nKMS_REQUEST_ID: \".concat(body.requestId);\n }\n if (body.statusCode) {\n message += \"\\nKMS_STATUS_CODE: \".concat(body.statusCode);\n }\n if (body.errorCode) {\n message += \"\\nKMS_ErrorCode: \".concat(body.errorCode);\n }\n return message;\n }\n }]);\n return KmsError;\n}(_common.Exception);\n/**\n * Thrown when an expected KMSResponse is not received in a timely manner\n */\n(0, _defineProperty2.default)(KmsError, \"defaultMessage\", 'An unknown error occurred while communicating with the kms. This implies we received an error response without a body.');\nvar KmsTimeoutError = exports.KmsTimeoutError = /*#__PURE__*/function (_KmsError) {\n (0, _inherits2.default)(KmsTimeoutError, _KmsError);\n var _super2 = _createSuper(KmsTimeoutError);\n function KmsTimeoutError() {\n (0, _classCallCheck2.default)(this, KmsTimeoutError);\n return _super2.apply(this, arguments);\n }\n (0, _createClass2.default)(KmsTimeoutError, [{\n key: \"parse\",\n value:\n /**\n * @param {KmsRequest} options.request\n * @param {KmsRequest} options.timeout\n * @returns {string}\n */\n function parse() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$request = _ref.request,\n request = _ref$request === void 0 ? {} : _ref$request,\n timeout = _ref.timeout;\n var message = \"The KMS did not respond within \".concat(timeout ? \"\".concat(timeout, \" milliseconds\") : 'a timely fashion');\n if (request) {\n if (request.method && request.uri) {\n message += \"\\nKMS_REQUEST: \".concat(request.method, \" \").concat(request.uri);\n }\n if (request.requestId) {\n message += \"\\nKMS_REQUEST_ID: \".concat(request.requestId);\n }\n }\n return message;\n }\n }]);\n return KmsTimeoutError;\n}(KmsError);\n/**\n * Emitted when a REST request includes an encrypter error\n */\nvar DryError = exports.DryError = /*#__PURE__*/function (_WebexHttpError) {\n (0, _inherits2.default)(DryError, _WebexHttpError);\n var _super3 = _createSuper(DryError);\n function DryError() {\n (0, _classCallCheck2.default)(this, DryError);\n return _super3.apply(this, arguments);\n }\n (0, _createClass2.default)(DryError, [{\n key: \"parse\",\n value:\n /**\n * @param {WebexHttpError} reason\n * @returns {string}\n */\n function parse(reason) {\n (0, _apply.default)(_webexCore.WebexHttpError.prototype.parse, this, [reason._res]);\n var body = reason._res.body.message;\n var message = body.reason || body;\n if (!message) {\n message = this.constructor.defaultMessage;\n }\n if (this.options.url) {\n message += \"\\n\".concat(this.options.method, \" \").concat(this.options.url);\n } else if (this.options.uri) {\n message += \"\\n\".concat(this.options.method, \" \").concat(this.options.uri);\n } else {\n message += \"\\n\".concat(this.options.method, \" \").concat(this.options.service.toUpperCase(), \"/\").concat(this.options.resource);\n }\n message += \"\\nWEBEX_TRACKING_ID: \".concat(this.options.headers.trackingid);\n if (body.status) {\n message += \"\\nKMS_RESPONSE_STATUS: \".concat(body.status);\n }\n if (body.requestId) {\n message += \"\\nKMS_REQUEST_ID: \".concat(body.requestId);\n }\n (0, _defineProperties.default)(this, {\n reason: {\n enumerable: false,\n value: body.reason\n },\n requestId: {\n enumerable: false,\n value: body.requestId\n },\n status: {\n enumerable: false,\n value: body.status\n }\n });\n return message;\n }\n }]);\n return DryError;\n}(_webexCore.WebexHttpError);\n/**\n * Function triggers an event when specific encryption failures are received.\n */\n// eslint-disable-next-line consistent-return\n(0, _defineProperty2.default)(DryError, \"defaultMessage\", 'An unknown error was received from a service that proxies to the KMS');\nvar handleKmsKeyRevokedEncryptionFailure = exports.handleKmsKeyRevokedEncryptionFailure = function handleKmsKeyRevokedEncryptionFailure(item, webex) {\n if (item.status === _constants.KMS_KEY_REVOKE_ERROR_STATUS && _constants.KMS_KEY_REVOKE_ERROR_CODES.includes(item.body.errorCode)) {\n webex.internal.encryption.trigger(_constants.KMS_KEY_REVOKE_FAILURE);\n }\n};\n//# sourceMappingURL=kms-errors.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap2 = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor2 = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _applyDecoratedDescriptor2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/applyDecoratedDescriptor\"));\nvar _weakMap = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/weak-map\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _now = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/date/now\"));\nvar _getOwnPropertyDescriptor = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\"));\nvar _querystring = _interopRequireDefault(require(\"querystring\"));\nvar _util = _interopRequireDefault(require(\"util\"));\nvar _commonTimers = require(\"@webex/common-timers\");\nvar _common = require(\"@webex/common\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _nodeKms = require(\"node-kms\");\nvar _nodeJose = _interopRequireDefault(require(\"node-jose\"));\nvar _lodash = require(\"lodash\");\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\nvar _kmsBatcher = _interopRequireWildcard(require(\"./kms-batcher\"));\nvar _kmsCertificateValidation = _interopRequireWildcard(require(\"./kms-certificate-validation\"));\nvar _dec, _obj;\n/*!\n * Copyright (c) 2015-2024 Cisco Systems, Inc. See LICENSE file.\n */\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap2) return null; var r = new _WeakMap2(), t = new _WeakMap2(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor2; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor2(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nvar contexts = new _weakMap.default();\nvar kmsDetails = new _weakMap.default();\nvar partialContexts = new _weakMap.default();\nvar consoleDebug = require('debug')('kms');\n\n/**\n * @class\n */\nvar KMS = _webexCore.WebexPlugin.extend((_dec = (0, _common.oneFlight)({\n keyFactory: function keyFactory(_ref) {\n var uri = _ref.uri,\n onBehalfOf = _ref.onBehalfOf;\n return \"\".concat(uri, \"/\").concat(onBehalfOf);\n }\n}), (_obj = {\n namespace: 'Encryption',\n children: {\n batcher: _kmsBatcher.default\n },\n /**\n * Binds a key to a resource\n * @param {Object} options\n * @param {KMSResourceObject} options.kro\n * @param {string} options.kroUri\n * @param {Key} options.key\n * @param {string} options.keyUri\n * @returns {Promise}\n */\n bindKey: function bindKey(_ref2) {\n var _this = this;\n var kro = _ref2.kro,\n kroUri = _ref2.kroUri,\n key = _ref2.key,\n keyUri = _ref2.keyUri;\n kroUri = kroUri || kro.uri;\n keyUri = keyUri || key.uri;\n this.logger.info('kms: binding key to resource');\n\n /* istanbul ignore if */\n if (!kroUri) {\n return _promise.default.reject(new Error('`kro` or `kroUri` is required'));\n }\n\n /* istanbul ignore if */\n if (!keyUri) {\n return _promise.default.reject(new Error('`key` or `keyUri` is required'));\n }\n return this.request({\n method: 'update',\n resourceUri: kroUri,\n uri: keyUri\n }).then(function (res) {\n _this.logger.info('kms: bound key to resource');\n return res.key;\n });\n },\n /**\n * Creates a new KMS Resource\n * @param {Object} options\n * @param {Array} options.userIds\n * @param {Array} options.keyUris\n * @param {Key} options.key\n * @param {Array} options.keys\n * @returns {Promise}\n */\n createResource: function createResource(_ref3) {\n var _this2 = this;\n var userIds = _ref3.userIds,\n keyUris = _ref3.keyUris,\n key = _ref3.key,\n keys = _ref3.keys;\n keyUris = keyUris || [];\n /* istanbul ignore if */\n if (keys) {\n keyUris = keys.reduce(function (uris, k) {\n uris.push(k.uri);\n return uris;\n }, keyUris);\n }\n\n /* istanbul ignore else */\n if (key) {\n keyUris.push(key.uri);\n }\n\n /* istanbul ignore if */\n if (keyUris.length === 0) {\n return _promise.default.reject(new Error('Cannot create KMS Resource without at least one keyUri'));\n }\n this.logger.info('kms: creating resource');\n return this.request({\n method: 'create',\n uri: '/resources',\n userIds: userIds,\n keyUris: keyUris\n }).then(function (res) {\n _this2.logger.info('kms: created resource');\n return res.resource;\n });\n },\n /**\n * Authorizes a user or KRO to a KRO\n * @param {Object} options\n * @param {Array} options.userIds\n * @param {Array} options.authIds interchangable with userIds\n * @param {KMSResourceObject} options.kro the target kro\n * @param {string} options.kroUri\n * @returns {Promise}\n */\n addAuthorization: function addAuthorization(_ref4) {\n var _this3 = this;\n var userIds = _ref4.userIds,\n authIds = _ref4.authIds,\n kro = _ref4.kro,\n kroUri = _ref4.kroUri;\n userIds = userIds || [];\n kroUri = kroUri || kro.uri;\n if (authIds) {\n userIds = userIds.concat(authIds);\n }\n\n /* istanbul ignore if */\n if (userIds.length === 0) {\n return _promise.default.reject(new Error('Cannot add authorization without userIds or authIds'));\n }\n\n /* istanbul ignore if */\n if (!kroUri) {\n return _promise.default.reject(new Error('`kro` or `kroUri` is required'));\n }\n this.logger.info('kms: adding authorization to kms resource');\n return this.request({\n method: 'create',\n uri: '/authorizations',\n resourceUri: kroUri,\n userIds: userIds\n }).then(function (res) {\n _this3.logger.info('kms: added authorization');\n return res.authorizations;\n });\n },\n /**\n * Retrieve a list of users that have been authorized to the KRO\n * @param {Object} options\n * @param {KMSResourceObject} options.kro the target kro\n * @param {string} options.kroUri\n * @returns {Array}\n */\n listAuthorizations: function listAuthorizations(_ref5) {\n var _this4 = this;\n var kro = _ref5.kro,\n kroUri = _ref5.kroUri;\n kroUri = kroUri || kro.uri;\n /* istanbul ignore if */\n if (!kroUri) {\n return _promise.default.reject(new Error('`kro` or `kroUri` is required'));\n }\n return this.request({\n method: 'retrieve',\n uri: \"\".concat(kroUri, \"/authorizations\")\n }).then(function (res) {\n _this4.logger.info('kms: retrieved authorization list');\n return res.authorizations;\n });\n },\n /**\n * Deauthorizes a user or KRO from a KRO\n * @param {Object} options\n * @param {string} options.userId\n * @param {string} options.authId interchangable with userIds\n * @param {KMSResourceObject} options.kro the target kro\n * @param {string} options.kroUri\n * @returns {Promise}\n */\n removeAuthorization: function removeAuthorization(_ref6) {\n var _this5 = this;\n var authId = _ref6.authId,\n userId = _ref6.userId,\n kro = _ref6.kro,\n kroUri = _ref6.kroUri;\n authId = authId || userId;\n kroUri = kroUri || kro.uri;\n\n /* istanbul ignore if */\n if (!authId) {\n return _promise.default.reject(new Error('Cannot remove authorization without authId'));\n }\n\n /* istanbul ignore if */\n if (!kroUri) {\n return _promise.default.reject(new Error('`kro` or `kroUri` is required'));\n }\n this.logger.info('kms: removing authorization from kms resource');\n return this.request({\n method: 'delete',\n uri: \"\".concat(kroUri, \"/authorizations?\").concat(_querystring.default.stringify({\n authId: authId\n }))\n }).then(function (res) {\n _this5.logger.info('kms: removed authorization');\n return res.authorizations;\n });\n },\n /**\n * Requests `count` unbound keys from the kms\n * @param {Object} options\n * @param {Number} options.count\n * @returns {Array}\n */\n createUnboundKeys: function createUnboundKeys(_ref7) {\n var _this6 = this;\n var count = _ref7.count;\n this.logger.info(\"kms: request \".concat(count, \" unbound keys\"));\n\n /* istanbul ignore if */\n if (!count) {\n return _promise.default.reject(new Error('`options.count` is required'));\n }\n return this.request({\n method: 'create',\n uri: '/keys',\n count: count\n }).then(function (res) {\n _this6.logger.info('kms: received unbound keys');\n return _promise.default.all(res.keys.map(_this6.asKey));\n });\n },\n /**\n * @typedef {Object} FetchPublicKeyResponse\n * @property {number} status 200,400(Bad Request: Request payload missing info),404(Not Found: HSM Public Key not found),501(Not Implemented: This KMS does not support BYOK),502(Bad Gateway: KMS could not communicate with HSM)\n * @property {UUID} requestId this is should be unique, used for debug.\n * @property {string} publicKey\n */\n /**\n * get public key from kms\n * @param {Object} options\n * @param {UUID} options.assignedOrgId the orgId\n * @returns {Promise.} response of get public key api\n */\n fetchPublicKey: function fetchPublicKey(_ref8) {\n var _this7 = this;\n var assignedOrgId = _ref8.assignedOrgId;\n this.logger.info('kms: fetch public key for byok');\n return this.request({\n method: 'retrieve',\n uri: '/publicKey',\n assignedOrgId: assignedOrgId\n }).then(function (res) {\n _this7.logger.info('kms: received public key');\n return res.publicKey;\n });\n },\n /**\n * @typedef {Object} UploadCmkResponse\n * @property {number} status\n * @property {UUID} requestId\n * @property {string} uri\n * @property {string} keysState\n */\n /**\n * upload master key for one org.\n * @param {Object} options\n * @param {UUID} options.assignedOrgId the orgId\n * @param {string} options.customerMasterKey the master key\n * @param {string} options.customerMasterKeyBackup the master key backup\n * @param {boolean} options.awsKms enable amazon aws keys\n * @returns {Promise.} response of upload CMK api\n */\n uploadCustomerMasterKey: function uploadCustomerMasterKey(_ref9) {\n var _this8 = this;\n var assignedOrgId = _ref9.assignedOrgId,\n customerMasterKey = _ref9.customerMasterKey,\n _ref9$awsKms = _ref9.awsKms,\n awsKms = _ref9$awsKms === void 0 ? false : _ref9$awsKms,\n _ref9$customerMasterK = _ref9.customerMasterKeyBackup,\n customerMasterKeyBackup = _ref9$customerMasterK === void 0 ? undefined : _ref9$customerMasterK;\n this.logger.info('kms: upload customer master key for byok');\n return this.request({\n method: 'create',\n uri: awsKms ? '/awsKmsCmk' : '/cmk',\n assignedOrgId: assignedOrgId,\n customerMasterKey: customerMasterKey,\n requestId: _uuid.default.v4(),\n customerMasterKeyBackup: awsKms ? customerMasterKeyBackup : undefined\n }).then(function (res) {\n _this8.logger.info('kms: finish to upload customer master key');\n return res;\n });\n },\n /**\n * get all customer master keys for one org.\n * @param {Object} options\n * @param {UUID} options.assignedOrgId the orgId\n * @param {boolean} options.awsKms enable amazon aws keys\n * @returns {Promise.} response of list CMKs api\n */\n listAllCustomerMasterKey: function listAllCustomerMasterKey(_ref10) {\n var _this9 = this;\n var assignedOrgId = _ref10.assignedOrgId,\n _ref10$awsKms = _ref10.awsKms,\n awsKms = _ref10$awsKms === void 0 ? false : _ref10$awsKms;\n this.logger.info('kms: get all customer master keys for byok');\n return this.request({\n method: 'retrieve',\n uri: awsKms ? '/awsKmsCmk' : '/cmk',\n assignedOrgId: assignedOrgId,\n requestId: _uuid.default.v4()\n }).then(function (res) {\n _this9.logger.info('kms: finish to get all customer master keys');\n return res;\n });\n },\n /**\n * @typedef {Object} ActivateCmkResponse\n * @property {number} status\n * @property {UUID} requestId\n * @property {Array} customerMasterKeys\n */\n /**\n *\n * @typedef {Object} CMK\n * @property {string} usageState\n * @property {UUID} assignedOrgId\n * @property {string} uri\n * @property {string} source\n * @property {Date | undefined} stateUpdatedOn\n * @property {Date | undefined} rotation\n */\n /**\n * change one customer master key state for one org.\n * delete pending key, then the keyState should be 'removedclean';\n * active pending key, then the keyState should be 'active';\n *\n * @param {Object} options\n * @param {string} options.keyId the id of one customer master key, it should be a url\n * @param {string} options.keyState one of the following: PENDING, RECOVERING,ACTIVE,REVOKED,DEACTIVATED,REENCRYPTING,RETIRED,DELETED,DISABLED,REMOVEDCLEAN,REMOVEDDIRTY;\n * @param {UUID} options.assignedOrgId the orgId\n * @returns {Promise.} response of list CMKs api\n */\n changeCustomerMasterKeyState: function changeCustomerMasterKeyState(_ref11) {\n var _this10 = this;\n var keyId = _ref11.keyId,\n keyState = _ref11.keyState,\n assignedOrgId = _ref11.assignedOrgId;\n this.logger.info('kms: change one customer master key state for byok');\n return this.request({\n method: 'update',\n uri: keyId,\n keyState: keyState,\n assignedOrgId: assignedOrgId,\n requestId: _uuid.default.v4()\n }).then(function (res) {\n _this10.logger.info('kms: finish to change the customer master key state to {}', keyState);\n return res;\n });\n },\n /**\n * this is for test case. it will delete all CMKs, no matter what their status is. This is mainly for test purpose\n * @param {Object} options\n * @param {UUID} options.assignedOrgId the orgId\n * @param {boolean} options.awsKms enable amazon aws keys\n * @returns {Promise.<{status, requestId}>}\n */\n deleteAllCustomerMasterKeys: function deleteAllCustomerMasterKeys(_ref12) {\n var _this11 = this;\n var assignedOrgId = _ref12.assignedOrgId,\n _ref12$awsKms = _ref12.awsKms,\n awsKms = _ref12$awsKms === void 0 ? false : _ref12$awsKms;\n this.logger.info('kms: delete all customer master keys at the same time');\n return this.request({\n method: 'delete',\n uri: awsKms ? '/awsKmsCmk' : '/cmk',\n assignedOrgId: assignedOrgId,\n requestId: _uuid.default.v4()\n }).then(function (res) {\n _this11.logger.info('kms: finish to delete all customer master keys');\n return res;\n });\n },\n /**\n * return to use global master key for one org.\n * @param {Object} options\n * @param {UUID} options.assignedOrgId the orgId\n * @returns {Promise.} response of activate CMK api\n */\n useGlobalMasterKey: function useGlobalMasterKey(_ref13) {\n var _this12 = this;\n var assignedOrgId = _ref13.assignedOrgId;\n this.logger.info('kms: return to use global master key');\n return this.request({\n method: 'update',\n uri: 'default',\n keyState: 'ACTIVE',\n assignedOrgId: assignedOrgId,\n requestId: _uuid.default.v4()\n }).then(function (res) {\n _this12.logger.info('kms: finish to return to global master key');\n return res;\n });\n },\n fetchKey: function fetchKey(_ref14) {\n var _this13 = this;\n var uri = _ref14.uri,\n onBehalfOf = _ref14.onBehalfOf;\n /* istanbul ignore if */\n if (!uri) {\n return _promise.default.reject(new Error('`options.uri` is required'));\n }\n this.logger.info('kms: fetching key');\n return this.request({\n method: 'retrieve',\n uri: uri\n }, {\n onBehalfOf: onBehalfOf\n }).then(function (res) {\n _this13.logger.info('kms: fetched key');\n return _this13.asKey(res.key);\n });\n },\n /**\n * Pings the kms. Mostly for testing\n * @returns {Promise}\n */\n ping: function ping() {\n return this.request({\n method: 'update',\n uri: '/ping'\n });\n },\n /**\n * Ensures a key obect is Key instance\n * @param {Object} key\n * @returns {Promise}\n */\n asKey: function asKey(key) {\n return _nodeJose.default.JWK.asKey(key.jwk).then(function (jwk) {\n key.jwk = jwk;\n return key;\n });\n },\n /**\n * Adds appropriate metadata to the KMS request\n * @param {Object} payload\n * @param {Object} onBehalfOf Optional parameter to prepare the request on behalf of another user\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(payload, onBehalfOf) {\n var _this14 = this;\n var isECDHRequest = payload.method === 'create' && payload.uri.includes('/ecdhe');\n return _promise.default.resolve(isECDHRequest ? partialContexts.get(this) : this._getContext()).then(function (context) {\n _this14.logger.info(\"kms: wrapping \".concat(isECDHRequest ? 'ephemeral key' : 'kms', \" request\"));\n var req = new _nodeKms.Request(payload);\n var requestContext = context;\n if (onBehalfOf) {\n requestContext = _this14._contextOnBehalfOf(context, onBehalfOf);\n }\n return req.wrap(requestContext, {\n serverKey: isECDHRequest\n }).then(function () {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n _this14.logger.info('kms: request payload', _util.default.inspect((0, _lodash.omit)(JSON.parse((0, _stringify.default)(req)), 'wrapped'), {\n depth: null\n }));\n }\n return req;\n });\n });\n },\n /**\n * Accepts a kms message event, decrypts it, and passes it to the batcher\n * @param {Object} event\n * @returns {Promise}\n */\n processKmsMessageEvent: function processKmsMessageEvent(event) {\n var _this15 = this;\n this.logger.info('kms: received kms message');\n return _promise.default.all(event.encryption.kmsMessages.map(function (kmsMessage, index) {\n return _this15._isECDHEMessage(kmsMessage).then(function (isECDHMessage) {\n _this15.logger.info(\"kms: received \".concat(isECDHMessage ? 'ecdhe' : 'normal', \" message\"));\n var res = new _nodeKms.Response(kmsMessage);\n return _promise.default.resolve(isECDHMessage ? partialContexts.get(_this15) : contexts.get(_this15))\n // eslint-disable-next-line max-nested-callbacks\n .then(function (context) {\n return res.unwrap(context);\n })\n // eslint-disable-next-line max-nested-callbacks\n .then(function () {\n if (process.env.NODE_ENV !== 'production') {\n _this15.logger.info('kms: response payload', _util.default.inspect((0, _lodash.omit)(JSON.parse((0, _stringify.default)(res)), 'wrapped'), {\n depth: null\n }));\n }\n })\n // eslint-disable-next-line max-nested-callbacks\n .then(function () {\n event.encryption.kmsMessages[index] = res;\n })\n // eslint-disable-next-line max-nested-callbacks\n .then(function () {\n return res;\n });\n });\n })).then(function () {\n return _this15.batcher.processKmsMessageEvent(event);\n }).catch(function (reason) {\n _this15.logger.error('kms: decrypt failed', reason.stack);\n return _promise.default.reject(reason);\n }).then(function () {\n return event;\n });\n },\n /**\n * Decrypts a kms message\n * @param {Object} kmsMessage\n * @returns {Promise}\n */\n decryptKmsMessage: function decryptKmsMessage(kmsMessage) {\n var res = new _nodeKms.Response(kmsMessage);\n return contexts.get(this).then(function (context) {\n return res.unwrap(context);\n }).then(function () {\n return res.body;\n });\n },\n /**\n * Determines if the kms message is an ecdhe message or a normal message\n * @param {Object} kmsMessage\n * @returns {Promise}\n */\n _isECDHEMessage: function _isECDHEMessage(kmsMessage) {\n return this._getKMSStaticPubKey().then(function (kmsStaticPubKey) {\n var fields = kmsMessage.split('.');\n if (fields.length !== 3) {\n return false;\n }\n var header = JSON.parse(_nodeJose.default.util.base64url.decode(fields[0]));\n return header.kid === kmsStaticPubKey.kid;\n });\n },\n /**\n * Sends a request to the kms\n * @param {Object} payload\n * @param {Object} options\n * @param {Number} options.timeout (internal)\n * @param {string} options.onBehalfOf Run the request on behalf of another user (UUID), used in compliance scenarios\n * @returns {Promise}\n */\n request: function request(payload) {\n var _this16 = this;\n var _ref15 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n timeout = _ref15.timeout,\n onBehalfOf = _ref15.onBehalfOf;\n timeout = timeout || this.config.kmsInitialTimeout;\n\n // Note: this should only happen when we're using the async kms batcher;\n // once we implement the sync batcher, this'll need to be smarter.\n return this.webex.internal.mercury.connect().then(function () {\n return _this16.prepareRequest(payload, onBehalfOf);\n }).then(function (req) {\n req[_kmsBatcher.TIMEOUT_SYMBOL] = timeout;\n return _this16.batcher.request(req);\n })\n // High complexity is due to attempt at test mode resiliency\n // eslint-disable-next-line complexity\n .catch(function (reason) {\n if (process.env.NODE_ENV === 'test' && (reason.status === 403 || reason.statusCode === 403) && reason.message.match(/Failed to resolve authorization token in KmsMessage request for user/)) {\n _this16.logger.warn('kms: rerequested key due to test-mode kms auth failure');\n return _this16.request(payload, {\n onBehalfOf: onBehalfOf\n });\n }\n\n // KMS Error. Notify the user\n if (reason instanceof _kmsCertificateValidation.KMSError) {\n _this16.webex.trigger('client:InvalidRequestError');\n return _promise.default.reject(reason);\n }\n\n // Ideally, most or all of the code below would go in kms-batcher, but\n // but batching needs at least one more round of refactoring for that to\n // work.\n if (!reason.statusCode && !reason.status) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n /* istanbul ignore next: reason.stack vs stack difficult to control in test */\n _this16.logger.info('kms: request error', reason.stack || reason);\n }\n consoleDebug(\"timeout \".concat(timeout));\n timeout *= 2;\n if (timeout >= _this16.config.ecdhMaxTimeout) {\n _this16.logger.info('kms: exceeded maximum KMS request retries');\n return _promise.default.reject(reason);\n }\n\n // Peek ahead to make sure we don't reset the timeout if the next timeout\n // will exceed the maximum timeout for renegotiating ECDH keys.\n var nextTimeout = timeout * 2;\n if (timeout >= _this16.config.kmsMaxTimeout && nextTimeout < _this16.config.ecdhMaxTimeout) {\n _this16.logger.info('kms: exceeded maximum KMS request retries; negotiating new ecdh key');\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n _this16.logger.info('kms: timeout/maxtimeout', timeout, _this16.config.kmsMaxTimeout);\n }\n contexts.delete(_this16);\n timeout = 0;\n }\n return _this16.request(payload, {\n timeout: timeout,\n onBehalfOf: onBehalfOf\n });\n }\n return _promise.default.reject(reason);\n });\n },\n /**\n * @private\n * @returns {Promise}\n */\n _getAuthorization: function _getAuthorization() {\n return this.webex.credentials.getUserToken('spark:kms').then(function (token) {\n return token.access_token;\n });\n },\n /**\n * @private\n * @param {String} onBehalfOf create context on behalf of another user, undefined when this is not necessary\n * @returns {Promise}\n */\n _getContext: function _getContext() {\n var _this17 = this;\n var promise = contexts.get(this);\n if (!promise) {\n promise = this._prepareContext();\n contexts.set(this, promise);\n promise.then(function (context) {\n var expiresIn = context.ephemeralKey.expirationDate - (0, _now.default)() - 30000;\n (0, _commonTimers.safeSetTimeout)(function () {\n return contexts.delete(_this17);\n }, expiresIn);\n });\n }\n return _promise.default.all([promise, this._getAuthorization()]).then(function (_ref16) {\n var _ref17 = (0, _slicedToArray2.default)(_ref16, 2),\n context = _ref17[0],\n authorization = _ref17[1];\n context.clientInfo.credential.bearer = authorization;\n return context;\n });\n },\n /**\n * @private\n * @returns {Promise}\n */\n _getKMSCluster: function _getKMSCluster() {\n this.logger.info('kms: retrieving KMS cluster');\n return this._getKMSDetails().then(function (_ref18) {\n var kmsCluster = _ref18.kmsCluster;\n return kmsCluster;\n });\n },\n /**\n * @private\n * @returns {Promise}\n */\n _getKMSDetails: function _getKMSDetails() {\n var _this18 = this;\n var details = kmsDetails.get(this);\n if (!details) {\n this.logger.info('kms: fetching KMS details');\n details = this.webex.request({\n service: 'encryption',\n resource: \"/kms/\".concat(this.webex.internal.device.userId)\n }).then(function (res) {\n _this18.logger.info('kms: fetched KMS details');\n var body = res.body;\n body.rsaPublicKey = JSON.parse(body.rsaPublicKey);\n return body;\n }).catch(function (reason) {\n _this18.logger.error('kms: failed to fetch KMS details', reason);\n return _promise.default.reject(reason);\n });\n kmsDetails.set(this, details);\n }\n return details;\n },\n /**\n * @private\n * @returns {Promise}\n */\n _getKMSStaticPubKey: function _getKMSStaticPubKey() {\n this.logger.info('kms: retrieving KMS static public key');\n return this._getKMSDetails().then(function (_ref19) {\n var rsaPublicKey = _ref19.rsaPublicKey;\n return rsaPublicKey;\n });\n },\n /**\n * @private\n * @returns {Promise}\n */\n _prepareContext: function _prepareContext() {\n var _this19 = this;\n this.logger.info('kms: creating context');\n var context = new _nodeKms.Context();\n return _promise.default.all([this._getKMSStaticPubKey().then((0, _kmsCertificateValidation.default)(this.config.caroots)), this._getAuthorization()]).then(function (_ref20) {\n var _ref21 = (0, _slicedToArray2.default)(_ref20, 2),\n kmsStaticPubKey = _ref21[0],\n authorization = _ref21[1];\n context.clientInfo = {\n clientId: _this19.webex.internal.device.url,\n credential: {\n userId: _this19.webex.internal.device.userId,\n bearer: authorization\n }\n };\n context.serverInfo = {\n key: kmsStaticPubKey\n };\n _this19.logger.info('kms: creating local ephemeral key');\n return context.createECDHKey();\n }).then(function (localECDHKey) {\n context.ephemeralKey = localECDHKey;\n partialContexts.set(_this19, context);\n return _promise.default.all([localECDHKey.asKey(), _this19._getKMSCluster()]);\n }).then(function (_ref22) {\n var _ref23 = (0, _slicedToArray2.default)(_ref22, 2),\n localECDHKey = _ref23[0],\n cluster = _ref23[1];\n _this19.logger.info('kms: submitting ephemeral key request');\n return _this19.request({\n uri: \"\".concat(cluster, \"/ecdhe\"),\n method: 'create',\n jwk: localECDHKey.toJSON()\n });\n }).then(function (res) {\n _this19.logger.info('kms: deriving final ephemeral key');\n return context.deriveEphemeralKey(res.key);\n }).then(function (key) {\n context.ephemeralKey = key;\n partialContexts.delete(_this19);\n _this19.logger.info('kms: derived final ephemeral key');\n return context;\n }).catch(function (reason) {\n _this19.logger.error('kms: failed to negotiate ephemeral key', reason);\n return _promise.default.reject(reason);\n });\n },\n /**\n * KMS 'retrieve' requests can be made on behalf of another user. This is useful\n * for scenarios such as eDiscovery. i.e. Where an authorized compliance officer is\n * entitled to retrieve content generated by any organisational user.\n * As the KMSContext is cached, updating it will affect separate requests. Hence when\n * making a request onBehalfOf another user create a new context for just this request.\n * However this context will be 'light' as it only needs to change one field.\n * @param {Object} originalContext - The base context to 'copy'\n * @param {String} onBehalfOf - The user specified in the new context\n * @returns {Context} A 'copy' of the existing context with a new user specified\n * @private\n */\n _contextOnBehalfOf: function _contextOnBehalfOf(originalContext, onBehalfOf) {\n var context = new _nodeKms.Context();\n context.clientInfo = context.clientInfo = {\n clientId: originalContext.clientInfo.clientId,\n credential: {\n userId: onBehalfOf,\n onBehalfOf: onBehalfOf,\n // Supports running onBehalfOf self. i.e. A CO which calls onBehalfOf with CO.id.\n bearer: originalContext.clientInfo.credential.bearer\n }\n };\n context.serverInfo = originalContext.serverInfo;\n context.ephemeralKey = originalContext.ephemeralKey;\n return context;\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n}, ((0, _applyDecoratedDescriptor2.default)(_obj, \"fetchKey\", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, \"fetchKey\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"_getContext\", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, \"_getContext\"), _obj)), _obj)));\nvar _default = exports.default = KMS;\n//# sourceMappingURL=kms.js.map\n","/* eslint-disable indent */\n/*\n * Copyright (c) 2016-2018, Peculiar Ventures\n * All rights reserved.\n *\n * Author 2016-2018, Yury Strozhevsky .\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\n * OF SUCH DAMAGE.\n *\n */\n//**************************************************************************************\nimport { getParametersValue, padNumber, isEqualBuffer, bufferToHexCodes, checkBufferParams, utilToBase, utilFromBase, utilEncodeTC, utilDecodeTC, utilConcatView } from \"pvutils\";\n//**************************************************************************************\n//#region Other utility functions\n//**************************************************************************************\nfunction assertBigInt()\n{\n\tif(typeof BigInt === \"undefined\")\n\t{\n\t\tthrow new Error(\"BigInt is not defined. Your environment doesn't implement BigInt.\");\n\t}\n}\n\n/**\n * Recursive function which checks and enables isIndefiniteForm flag for constructed blocks if any child has that flag enabled\n * @param {BaseBlock} baseBlock Base ASN.1 block\n * @returns Returns `true` if incoming block is `indefinite form`\n */\nfunction prepareIndefiniteForm(baseBlock)\n{\n\tif(baseBlock.idBlock.isConstructed)\n\t{\n\t\tfor(let i = 0; i < baseBlock.valueBlock.value.length; i++)\n\t\t{\n\t\t\tif(prepareIndefiniteForm(baseBlock.valueBlock.value[i]))\n\t\t\t{\n\t\t\t\tbaseBlock.lenBlock.isIndefiniteForm = true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn !!baseBlock.lenBlock.isIndefiniteForm;\n}\n\n/**\n * Concatenates buffers from the list\n * @param {Array.} buffers List of buffers\n * @returns Concatenated buffer\n */\nfunction concat(buffers) \n{\n\t//#region Initial variables\n\tlet outputLength = 0;\n\tlet prevLength = 0;\n\t//#endregion\n\n\t//#region Calculate output length\n\tfor(let i = 0; i < buffers.length; i++)\n\t{\n\t\tconst buffer = buffers[i];\n\t\toutputLength += buffer.byteLength;\n\t}\n\t//#endregion\n\n\tconst retBuf = new ArrayBuffer(outputLength);\n\tconst retView = new Uint8Array(retBuf);\n\n\tfor(let i = 0; i < buffers.length; i++)\n\t{\n\t\tconst buffer = buffers[i];\n\t\tretView.set(new Uint8Array(buffer), prevLength);\n\t\tprevLength += buffer.byteLength;\n\t}\n\n\treturn retBuf;\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of global variables\n//**************************************************************************************\nconst powers2 = [new Uint8Array([1])];\nconst digitsString = \"0123456789\";\nconst NAME = \"name\";\nconst VALUE_BEFORE_DECODE = \"valueBeforeDecode\";\nconst BLOCK_LENGTH = \"blockLength\";\nconst ERROR = \"error\";\nconst WARNINGS = \"warnings\";\nconst VALUE_HEX = \"valueHex\";\nconst IS_HEX_ONLY = \"isHexOnly\";\nconst ID_BLOCK = \"idBlock\";\nconst TAG_CLASS = \"tagClass\";\nconst TAG_NUMBER = \"tagNumber\";\nconst IS_CONSTRUCTED = \"isConstructed\";\nconst LEN_BLOCK = \"lenBlock\";\nconst IS_INDEFINITE_FORM = \"isIndefiniteForm\";\nconst LONG_FORM_USED = \"longFormUsed\";\nconst LENGTH = \"length\";\nconst OPTIONAL = \"optional\";\nconst PRIMITIVE_SCHEMA = \"primitiveSchema\";\nconst VALUE = \"value\";\nconst VALUE_DATE = \"valueDate\";\nconst FROM_BER = \"fromBER\";\nconst TO_BER = \"toBER\";\nconst LOCAL = \"local\";\nconst UNUSED_BITS = \"unusedBits\";\nconst VALUE_DEC = \"valueDec\";\nconst IS_FIRST_SID = \"isFirstSid\";\nconst DATA = \"data\";\nconst EMPTY_STRING = \"\";\nconst EMPTY_BUFFER = new ArrayBuffer(0);\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration for \"ViewWriter\"\n//**************************************************************************************\nclass ViewWriter\n{\n\tconstructor()\n\t{\n\t\t/**\n\t\t * @type {Array.}\n\t\t */\n\t\tthis.items = [];\n\t}\n\n\t/**\n\t * Writes buffer\n\t * @param {ArrayBuffer} buf \n\t */\n\twrite(buf)\n\t{\n\t\tthis.items.push(buf);\n\t}\n\n\t/**\n\t * Concatenates all buffers\n\t * @returns {ArrayBuffer}\n\t */\n\tfinal()\n\t{\n\t\treturn concat(this.items);\n\t}\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration for \"LocalBaseBlock\" class\n//**************************************************************************************\n/**\n * Class used as a base block for all remaining ASN.1 classes\n * @typedef LocalBaseBlock\n * @interface\n * @property {number} blockLength\n * @property {string} error\n * @property {Array.} warnings\n * @property {ArrayBuffer} valueBeforeDecode\n */\nclass LocalBaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalBaseBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueBeforeDecode]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\t/**\n\t\t * @type {number} blockLength\n\t\t */\n\t\tthis.blockLength = getParametersValue(parameters, BLOCK_LENGTH, 0);\n\t\t/**\n\t\t * @type {string} error\n\t\t */\n\t\tthis.error = getParametersValue(parameters, ERROR, EMPTY_STRING);\n\t\t/**\n\t\t * @type {Array.} warnings\n\t\t */\n\t\tthis.warnings = getParametersValue(parameters, WARNINGS, []);\n\t\t//noinspection JSCheckFunctionSignatures\n\t\t/**\n\t\t * @type {ArrayBuffer} valueBeforeDecode\n\t\t */\n\t\tif(VALUE_BEFORE_DECODE in parameters)\n\t\t\tthis.valueBeforeDecode = parameters.valueBeforeDecode.slice(0);\n\t\telse\n\t\t\tthis.valueBeforeDecode = EMPTY_BUFFER;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"baseBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\treturn {\n\t\t\tblockName: this.constructor.blockName(),\n\t\t\tblockLength: this.blockLength,\n\t\t\terror: this.error,\n\t\t\twarnings: this.warnings,\n\t\t\tvalueBeforeDecode: bufferToHexCodes(this.valueBeforeDecode, 0, this.valueBeforeDecode.byteLength)\n\t\t};\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Description for \"HexBlock\" class\n//**************************************************************************************\n/**\n * Class used as a base block for all remaining ASN.1 classes\n * @extends LocalBaseBlock\n * @typedef HexBlock\n * @property {number} blockLength\n * @property {string} error\n * @property {Array.} warnings\n * @property {ArrayBuffer} valueBeforeDecode\n * @property {boolean} isHexOnly\n * @property {ArrayBuffer} valueHex\n */\n//noinspection JSUnusedLocalSymbols\nexport const HexBlock = BaseClass => class LocalHexBlockMixin extends BaseClass\n{\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Constructor for \"HexBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\t/**\n\t\t * @type {boolean}\n\t\t */\n\t\tthis.isHexOnly = getParametersValue(parameters, IS_HEX_ONLY, false);\n\t\t/**\n\t\t * @type {ArrayBuffer}\n\t\t */\n\t\tif(VALUE_HEX in parameters)\n\t\t\tthis.valueHex = parameters.valueHex.slice(0);\n\t\telse\n\t\t\tthis.valueHex = EMPTY_BUFFER;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"hexBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\t//#region Initial checks\n\t\tif(intBuffer.length === 0)\n\t\t{\n\t\t\tthis.warnings.push(\"Zero buffer length\");\n\t\t\treturn inputOffset;\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Copy input buffer to internal buffer\n\t\tthis.valueHex = inputBuffer.slice(inputOffset, inputOffset + inputLength);\n\t\t//#endregion\n\n\t\tthis.blockLength = inputLength;\n\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\tif(this.isHexOnly !== true)\n\t\t{\n\t\t\tthis.error = \"Flag \\\"isHexOnly\\\" is not set, abort\";\n\t\t\treturn EMPTY_BUFFER;\n\t\t}\n\n\t\tif(sizeOnly === true)\n\t\t\treturn new ArrayBuffer(this.valueHex.byteLength);\n\n\t\t//noinspection JSCheckFunctionSignatures\n\t\treturn this.valueHex.slice(0);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.blockName = this.constructor.blockName();\n\t\tobject.isHexOnly = this.isHexOnly;\n\t\tobject.valueHex = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n};\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of identification block class\n//**************************************************************************************\nclass LocalIdentificationBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalBaseBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {Object} [idBlock]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper();\n\n\t\tif(ID_BLOCK in parameters)\n\t\t{\n\t\t\t//#region Properties from hexBlock class\n\t\t\tthis.isHexOnly = getParametersValue(parameters.idBlock, IS_HEX_ONLY, false);\n\t\t\tthis.valueHex = getParametersValue(parameters.idBlock, VALUE_HEX, EMPTY_BUFFER);\n\t\t\t//#endregion\n\n\t\t\tthis.tagClass = getParametersValue(parameters.idBlock, TAG_CLASS, (-1));\n\t\t\tthis.tagNumber = getParametersValue(parameters.idBlock, TAG_NUMBER, (-1));\n\t\t\tthis.isConstructed = getParametersValue(parameters.idBlock, IS_CONSTRUCTED, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.tagClass = (-1);\n\t\t\tthis.tagNumber = (-1);\n\t\t\tthis.isConstructed = false;\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"identificationBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//#region Initial variables\n\t\tlet firstOctet = 0;\n\t\tlet retBuf;\n\t\tlet retView;\n\t\t//#endregion\n\n\t\tswitch(this.tagClass)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\tfirstOctet |= 0x00; // UNIVERSAL\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfirstOctet |= 0x40; // APPLICATION\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tfirstOctet |= 0x80; // CONTEXT-SPECIFIC\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tfirstOctet |= 0xC0; // PRIVATE\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.error = \"Unknown tag class\";\n\t\t\t\treturn (EMPTY_BUFFER);\n\t\t}\n\n\t\tif(this.isConstructed)\n\t\t\tfirstOctet |= 0x20;\n\n\t\tif((this.tagNumber < 31) && (!this.isHexOnly))\n\t\t{\n\t\t\tretBuf = new ArrayBuffer(1);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tif(!sizeOnly)\n\t\t\t{\n\t\t\t\tlet number = this.tagNumber;\n\t\t\t\tnumber &= 0x1F;\n\t\t\t\tfirstOctet |= number;\n\n\t\t\t\tretView[0] = firstOctet;\n\t\t\t}\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tif(this.isHexOnly === false)\n\t\t{\n\t\t\tconst encodedBuf = utilToBase(this.tagNumber, 7);\n\t\t\tconst encodedView = new Uint8Array(encodedBuf);\n\t\t\tconst size = encodedBuf.byteLength;\n\n\t\t\tretBuf = new ArrayBuffer(size + 1);\n\t\t\tretView = new Uint8Array(retBuf);\n\t\t\tretView[0] = (firstOctet | 0x1F);\n\n\t\t\tif(!sizeOnly)\n\t\t\t{\n\t\t\t\tfor(let i = 0; i < (size - 1); i++)\n\t\t\t\t\tretView[i + 1] = encodedView[i] | 0x80;\n\n\t\t\t\tretView[size] = encodedView[size - 1];\n\t\t\t}\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tretBuf = new ArrayBuffer(this.valueHex.byteLength + 1);\n\t\tretView = new Uint8Array(retBuf);\n\n\t\tretView[0] = (firstOctet | 0x1F);\n\n\t\tif(sizeOnly === false)\n\t\t{\n\t\t\tconst curView = new Uint8Array(this.valueHex);\n\n\t\t\tfor(let i = 0; i < (curView.length - 1); i++)\n\t\t\t\tretView[i + 1] = curView[i] | 0x80;\n\n\t\t\tretView[this.valueHex.byteLength] = curView[curView.length - 1];\n\t\t}\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\t//#region Initial checks\n\t\tif(intBuffer.length === 0)\n\t\t{\n\t\t\tthis.error = \"Zero buffer length\";\n\t\t\treturn (-1);\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Find tag class\n\t\tconst tagClassMask = intBuffer[0] & 0xC0;\n\n\t\tswitch(tagClassMask)\n\t\t{\n\t\t\tcase 0x00:\n\t\t\t\tthis.tagClass = (1); // UNIVERSAL\n\t\t\t\tbreak;\n\t\t\tcase 0x40:\n\t\t\t\tthis.tagClass = (2); // APPLICATION\n\t\t\t\tbreak;\n\t\t\tcase 0x80:\n\t\t\t\tthis.tagClass = (3); // CONTEXT-SPECIFIC\n\t\t\t\tbreak;\n\t\t\tcase 0xC0:\n\t\t\t\tthis.tagClass = (4); // PRIVATE\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.error = \"Unknown tag class\";\n\t\t\t\treturn (-1);\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Find it's constructed or not\n\t\tthis.isConstructed = (intBuffer[0] & 0x20) === 0x20;\n\t\t//#endregion\n\n\t\t//#region Find tag number\n\t\tthis.isHexOnly = false;\n\n\t\tconst tagNumberMask = intBuffer[0] & 0x1F;\n\n\t\t//#region Simple case (tag number < 31)\n\t\tif(tagNumberMask !== 0x1F)\n\t\t{\n\t\t\tthis.tagNumber = (tagNumberMask);\n\t\t\tthis.blockLength = 1;\n\t\t}\n\t\t//#endregion\n\t\t//#region Tag number bigger or equal to 31\n\t\telse\n\t\t{\n\t\t\tlet count = 1;\n\n\t\t\tthis.valueHex = new ArrayBuffer(255);\n\t\t\tlet tagNumberBufferMaxLength = 255;\n\t\t\tlet intTagNumberBuffer = new Uint8Array(this.valueHex);\n\n\t\t\t//noinspection JSBitwiseOperatorUsage\n\t\t\twhile(intBuffer[count] & 0x80)\n\t\t\t{\n\t\t\t\tintTagNumberBuffer[count - 1] = intBuffer[count] & 0x7F;\n\t\t\t\tcount++;\n\n\t\t\t\tif(count >= intBuffer.length)\n\t\t\t\t{\n\t\t\t\t\tthis.error = \"End of input reached before message was fully decoded\";\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\n\t\t\t\t//#region In case if tag number length is greater than 255 bytes (rare but possible case)\n\t\t\t\tif(count === tagNumberBufferMaxLength)\n\t\t\t\t{\n\t\t\t\t\ttagNumberBufferMaxLength += 255;\n\n\t\t\t\t\tconst tempBuffer = new ArrayBuffer(tagNumberBufferMaxLength);\n\t\t\t\t\tconst tempBufferView = new Uint8Array(tempBuffer);\n\n\t\t\t\t\tfor(let i = 0; i < intTagNumberBuffer.length; i++)\n\t\t\t\t\t\ttempBufferView[i] = intTagNumberBuffer[i];\n\n\t\t\t\t\tthis.valueHex = new ArrayBuffer(tagNumberBufferMaxLength);\n\t\t\t\t\tintTagNumberBuffer = new Uint8Array(this.valueHex);\n\t\t\t\t}\n\t\t\t\t//#endregion\n\t\t\t}\n\n\t\t\tthis.blockLength = (count + 1);\n\t\t\tintTagNumberBuffer[count - 1] = intBuffer[count] & 0x7F; // Write last byte to buffer\n\n\t\t\t//#region Cut buffer\n\t\t\tconst tempBuffer = new ArrayBuffer(count);\n\t\t\tconst tempBufferView = new Uint8Array(tempBuffer);\n\n\t\t\tfor(let i = 0; i < count; i++)\n\t\t\t\ttempBufferView[i] = intTagNumberBuffer[i];\n\n\t\t\tthis.valueHex = new ArrayBuffer(count);\n\t\t\tintTagNumberBuffer = new Uint8Array(this.valueHex);\n\t\t\tintTagNumberBuffer.set(tempBufferView);\n\t\t\t//#endregion\n\n\t\t\t//#region Try to convert long tag number to short form\n\t\t\tif(this.blockLength <= 9)\n\t\t\t\tthis.tagNumber = utilFromBase(intTagNumberBuffer, 7);\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.isHexOnly = true;\n\t\t\t\tthis.warnings.push(\"Tag too long, represented as hex-coded\");\n\t\t\t}\n\t\t\t//#endregion\n\t\t}\n\t\t//#endregion\n\t\t//#endregion\n\n\t\t//#region Check if constructed encoding was using for primitive type\n\t\tif(((this.tagClass === 1)) &&\n\t\t\t(this.isConstructed))\n\t\t{\n\t\t\tswitch(this.tagNumber)\n\t\t\t{\n\t\t\t\tcase 1: // Boolean\n\t\t\t\tcase 2: // REAL\n\t\t\t\tcase 5: // Null\n\t\t\t\tcase 6: // OBJECT IDENTIFIER\n\t\t\t\tcase 9: // REAL\n\t\t\t\tcase 13: // RELATIVE OBJECT IDENTIFIER\n\t\t\t\tcase 14: // Time\n\t\t\t\tcase 23:\n\t\t\t\tcase 24:\n\t\t\t\tcase 31:\n\t\t\t\tcase 32:\n\t\t\t\tcase 33:\n\t\t\t\tcase 34:\n\t\t\t\t\tthis.error = \"Constructed encoding used for primitive type\";\n\t\t\t\t\treturn (-1);\n\t\t\t\tdefault:\n\t\t\t}\n\t\t}\n\t\t//#endregion\n\n\t\treturn (inputOffset + this.blockLength); // Return current offset in input buffer\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName: string,\n\t * tagClass: number,\n\t * tagNumber: number,\n\t * isConstructed: boolean,\n\t * isHexOnly: boolean,\n\t * valueHex: ArrayBuffer,\n\t * blockLength: number,\n\t * error: string, warnings: Array.,\n\t * valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.blockName = this.constructor.blockName();\n\t\tobject.tagClass = this.tagClass;\n\t\tobject.tagNumber = this.tagNumber;\n\t\tobject.isConstructed = this.isConstructed;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of length block class\n//**************************************************************************************\nclass LocalLengthBlock extends LocalBaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalLengthBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {Object} [lenBlock]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper();\n\n\t\tif(LEN_BLOCK in parameters)\n\t\t{\n\t\t\tthis.isIndefiniteForm = getParametersValue(parameters.lenBlock, IS_INDEFINITE_FORM, false);\n\t\t\tthis.longFormUsed = getParametersValue(parameters.lenBlock, LONG_FORM_USED, false);\n\t\t\tthis.length = getParametersValue(parameters.lenBlock, LENGTH, 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.isIndefiniteForm = false;\n\t\t\tthis.longFormUsed = false;\n\t\t\tthis.length = 0;\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"lengthBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\t//#region Initial checks\n\t\tif(intBuffer.length === 0)\n\t\t{\n\t\t\tthis.error = \"Zero buffer length\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tif(intBuffer[0] === 0xFF)\n\t\t{\n\t\t\tthis.error = \"Length block 0xFF is reserved by standard\";\n\t\t\treturn (-1);\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Check for length form type\n\t\tthis.isIndefiniteForm = intBuffer[0] === 0x80;\n\t\t//#endregion\n\n\t\t//#region Stop working in case of indefinite length form\n\t\tif(this.isIndefiniteForm === true)\n\t\t{\n\t\t\tthis.blockLength = 1;\n\t\t\treturn (inputOffset + this.blockLength);\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Check is long form of length encoding using\n\t\tthis.longFormUsed = !!(intBuffer[0] & 0x80);\n\t\t//#endregion\n\n\t\t//#region Stop working in case of short form of length value\n\t\tif(this.longFormUsed === false)\n\t\t{\n\t\t\tthis.length = (intBuffer[0]);\n\t\t\tthis.blockLength = 1;\n\t\t\treturn (inputOffset + this.blockLength);\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Calculate length value in case of long form\n\t\tconst count = intBuffer[0] & 0x7F;\n\n\t\tif(count > 8) // Too big length value\n\t\t{\n\t\t\tthis.error = \"Too big integer\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tif((count + 1) > intBuffer.length)\n\t\t{\n\t\t\tthis.error = \"End of input reached before message was fully decoded\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tconst lengthBufferView = new Uint8Array(count);\n\n\t\tfor(let i = 0; i < count; i++)\n\t\t\tlengthBufferView[i] = intBuffer[i + 1];\n\n\t\tif(lengthBufferView[count - 1] === 0x00)\n\t\t\tthis.warnings.push(\"Needlessly long encoded length\");\n\n\t\tthis.length = utilFromBase(lengthBufferView, 8);\n\n\t\tif(this.longFormUsed && (this.length <= 127))\n\t\t\tthis.warnings.push(\"Unnecessary usage of long length form\");\n\n\t\tthis.blockLength = count + 1;\n\t\t//#endregion\n\n\t\treturn (inputOffset + this.blockLength); // Return current offset in input buffer\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//#region Initial variables\n\t\tlet retBuf;\n\t\tlet retView;\n\t\t//#endregion\n\n\t\tif(this.length > 127)\n\t\t\tthis.longFormUsed = true;\n\n\t\tif(this.isIndefiniteForm)\n\t\t{\n\t\t\tretBuf = new ArrayBuffer(1);\n\n\t\t\tif(sizeOnly === false)\n\t\t\t{\n\t\t\t\tretView = new Uint8Array(retBuf);\n\t\t\t\tretView[0] = 0x80;\n\t\t\t}\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tif(this.longFormUsed === true)\n\t\t{\n\t\t\tconst encodedBuf = utilToBase(this.length, 8);\n\n\t\t\tif(encodedBuf.byteLength > 127)\n\t\t\t{\n\t\t\t\tthis.error = \"Too big length\";\n\t\t\t\treturn (EMPTY_BUFFER);\n\t\t\t}\n\n\t\t\tretBuf = new ArrayBuffer(encodedBuf.byteLength + 1);\n\n\t\t\tif(sizeOnly === true)\n\t\t\t\treturn retBuf;\n\n\t\t\tconst encodedView = new Uint8Array(encodedBuf);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tretView[0] = encodedBuf.byteLength | 0x80;\n\n\t\t\tfor(let i = 0; i < encodedBuf.byteLength; i++)\n\t\t\t\tretView[i + 1] = encodedView[i];\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tretBuf = new ArrayBuffer(1);\n\n\t\tif(sizeOnly === false)\n\t\t{\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tretView[0] = this.length;\n\t\t}\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.blockName = this.constructor.blockName();\n\t\tobject.isIndefiniteForm = this.isIndefiniteForm;\n\t\tobject.longFormUsed = this.longFormUsed;\n\t\tobject.length = this.length;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of value block class\n//**************************************************************************************\nexport class ValueBlock extends LocalBaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"ValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"valueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols,JSUnusedLocalSymbols,JSUnusedLocalSymbols\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Throw an exception for a function which needs to be specified in extended classes\n\t\tthrow TypeError(\"User need to make a specific function in a class which extends \\\"ValueBlock\\\"\");\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//#region Throw an exception for a function which needs to be specified in extended classes\n\t\tthrow TypeError(\"User need to make a specific function in a class which extends \\\"ValueBlock\\\"\");\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of basic ASN.1 block class\n//**************************************************************************************\nexport class BaseBlock extends LocalBaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"BaseBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {Object} [primitiveSchema]\n\t * @property {string} [name]\n\t * @property {boolean} [optional]\n\t * @param valueBlockType Type of value block\n\t */\n\tconstructor(parameters = {}, valueBlockType = ValueBlock)\n\t{\n\t\tsuper(parameters);\n\n\t\tif(NAME in parameters)\n\t\t\tthis.name = parameters.name;\n\t\tif(OPTIONAL in parameters)\n\t\t\tthis.optional = parameters.optional;\n\t\tif(PRIMITIVE_SCHEMA in parameters)\n\t\t\tthis.primitiveSchema = parameters.primitiveSchema;\n\n\t\tthis.idBlock = new LocalIdentificationBlock(parameters);\n\t\tthis.lenBlock = new LocalLengthBlock(parameters);\n\t\tthis.valueBlock = new valueBlockType(parameters);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BaseBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false, writer)\n\t{\n\t\tconst _writer = writer || new ViewWriter();\n\n\t\tif(!writer)\n\t\t{\n\t\t\tprepareIndefiniteForm(this);\n\t\t}\n\n\t\tconst idBlockBuf = this.idBlock.toBER(sizeOnly);\n\n\t\t_writer.write(idBlockBuf);\n\n\t\tif(this.lenBlock.isIndefiniteForm)\n\t\t{\n\t\t\t_writer.write(new Uint8Array([0x80]).buffer);\n\n\t\t\tthis.valueBlock.toBER(sizeOnly, _writer);\n\n\t\t\t_writer.write(new ArrayBuffer(2));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconst valueBlockSizeBuf = this.valueBlock.toBER(true);\n\t\t\tthis.lenBlock.length = valueBlockSizeBuf.byteLength;\n\t\t\tconst lenBlockBuf = this.lenBlock.toBER(sizeOnly);\n\n\t\t\t_writer.write(lenBlockBuf);\n\n\t\t\tconst valueBlockBuf = sizeOnly\n\t\t\t\t? new ArrayBuffer(this.lenBlock.length)\n\t\t\t\t: this.valueBlock.toBER(sizeOnly);\n\n\t\t\t_writer.write(valueBlockBuf, _writer);\n\t\t}\n\n\t\tif(!writer)\n\t\t{\n\t\t\treturn _writer.final();\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.idBlock = this.idBlock.toJSON();\n\t\tobject.lenBlock = this.lenBlock.toJSON();\n\t\tobject.valueBlock = this.valueBlock.toJSON();\n\n\t\tif(NAME in this)\n\t\t\tobject.name = this.name;\n\t\tif(OPTIONAL in this)\n\t\t\tobject.optional = this.optional;\n\t\tif(PRIMITIVE_SCHEMA in this)\n\t\t\tobject.primitiveSchema = this.primitiveSchema.toJSON();\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${bufferToHexCodes(this.valueBlock.valueHex)}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of basic block for all PRIMITIVE types\n//**************************************************************************************\nclass LocalPrimitiveValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalPrimitiveValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueBeforeDecode]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\t//#region Variables from \"hexBlock\" class\n\t\tif(VALUE_HEX in parameters)\n\t\t\tthis.valueHex = parameters.valueHex.slice(0);\n\t\telse\n\t\t\tthis.valueHex = EMPTY_BUFFER;\n\n\t\tthis.isHexOnly = getParametersValue(parameters, IS_HEX_ONLY, true);\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\t//#region Initial checks\n\t\tif(intBuffer.length === 0)\n\t\t{\n\t\t\tthis.warnings.push(\"Zero buffer length\");\n\t\t\treturn inputOffset;\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Copy input buffer into internal buffer\n\t\tthis.valueHex = new ArrayBuffer(intBuffer.length);\n\t\tconst valueHexView = new Uint8Array(this.valueHex);\n\n\t\tfor(let i = 0; i < intBuffer.length; i++)\n\t\t\tvalueHexView[i] = intBuffer[i];\n\t\t//#endregion\n\n\t\tthis.blockLength = inputLength;\n\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\treturn this.valueHex.slice(0);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"PrimitiveValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.valueHex = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\t\tobject.isHexOnly = this.isHexOnly;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class Primitive extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Primitive\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalPrimitiveValueBlock);\n\n\t\tthis.idBlock.isConstructed = false;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"PRIMITIVE\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of basic block for all CONSTRUCTED types\n//**************************************************************************************\nclass LocalConstructedValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalConstructedValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.value = getParametersValue(parameters, VALUE, []);\n\t\tthis.isIndefiniteForm = getParametersValue(parameters, IS_INDEFINITE_FORM, false);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Store initial offset and length\n\t\tconst initialOffset = inputOffset;\n\t\tconst initialLength = inputLength;\n\t\t//#endregion\n\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\t//#region Initial checks\n\t\tif(intBuffer.length === 0)\n\t\t{\n\t\t\tthis.warnings.push(\"Zero buffer length\");\n\t\t\treturn inputOffset;\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Aux function\n\t\tfunction checkLen(indefiniteLength, length)\n\t\t{\n\t\t\tif(indefiniteLength === true)\n\t\t\t\treturn 1;\n\n\t\t\treturn length;\n\t\t}\n\t\t//#endregion\n\n\t\tlet currentOffset = inputOffset;\n\n\t\twhile(checkLen(this.isIndefiniteForm, inputLength) > 0)\n\t\t{\n\t\t\tconst returnObject = LocalFromBER(inputBuffer, currentOffset, inputLength);\n\t\t\tif(returnObject.offset === (-1))\n\t\t\t{\n\t\t\t\tthis.error = returnObject.result.error;\n\t\t\t\tthis.warnings.concat(returnObject.result.warnings);\n\t\t\t\treturn (-1);\n\t\t\t}\n\n\t\t\tcurrentOffset = returnObject.offset;\n\n\t\t\tthis.blockLength += returnObject.result.blockLength;\n\t\t\tinputLength -= returnObject.result.blockLength;\n\n\t\t\tthis.value.push(returnObject.result);\n\n\t\t\tif((this.isIndefiniteForm === true) && (returnObject.result.constructor.blockName() === EndOfContent.blockName()))\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif(this.isIndefiniteForm === true)\n\t\t{\n\t\t\tif(this.value[this.value.length - 1].constructor.blockName() === EndOfContent.blockName())\n\t\t\t\tthis.value.pop();\n\t\t\telse\n\t\t\t\tthis.warnings.push(\"No EndOfContent block encoded\");\n\t\t}\n\n\t\t//#region Copy \"inputBuffer\" to VALUE_BEFORE_DECODE\n\t\tthis.valueBeforeDecode = inputBuffer.slice(initialOffset, initialOffset + initialLength);\n\t\t//#endregion\n\n\t\treturn currentOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false, writer)\n\t{\n\t\tconst _writer = writer || new ViewWriter();\n\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t{\n\t\t\tthis.value[i].toBER(sizeOnly, _writer);\n\t\t}\n\n\t\tif(!writer)\n\t\t{\n\t\t\treturn _writer.final();\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"ConstructedValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.isIndefiniteForm = this.isIndefiniteForm;\n\t\tobject.value = [];\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t\tobject.value.push(this.value[i].toJSON());\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class Constructed extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Constructed\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalConstructedValueBlock);\n\n\t\tthis.idBlock.isConstructed = true;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"CONSTRUCTED\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tthis.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\tconst values = [];\n\t\tfor(const value of this.valueBlock.value)\n\t\t{\n\t\t\tvalues.push(value.toString().split(\"\\n\").map(o => ` ${o}`).join(\"\\n\"));\n\t\t}\n\t\tconst blockName = this.idBlock.tagClass === 3\n\t\t\t? `[${this.idBlock.tagNumber}]`\n\t\t\t: this.constructor.blockName();\n\t\treturn values.length\n\t\t\t? `${blockName} :\\n${values.join(\"\\n\")}` // items\n\t\t\t: `${blockName} :`; // empty\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 EndOfContent type class\n//**************************************************************************************\nclass LocalEndOfContentValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalEndOfContentValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols,JSUnusedLocalSymbols\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number}\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region There is no \"value block\" for EndOfContent type and we need to return the same offset\n\t\treturn inputOffset;\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\treturn EMPTY_BUFFER;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"EndOfContentValueBlock\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class EndOfContent extends BaseBlock\n{\n\t//**********************************************************************************\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalEndOfContentValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 0; // EndOfContent\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"EndOfContent\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 Boolean type class\n//**************************************************************************************\nclass LocalBooleanValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalBooleanValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.value = getParametersValue(parameters, VALUE, false);\n\t\tthis.isHexOnly = getParametersValue(parameters, IS_HEX_ONLY, false);\n\n\t\tif(VALUE_HEX in parameters)\n\t\t\tthis.valueHex = parameters.valueHex.slice(0);\n\t\telse\n\t\t{\n\t\t\tthis.valueHex = new ArrayBuffer(1);\n\t\t\tif(this.value === true)\n\t\t\t{\n\t\t\t\tconst view = new Uint8Array(this.valueHex);\n\t\t\t\tview[0] = 0xFF;\n\t\t\t}\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\t//#region Getting Uint8Array from ArrayBuffer\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t\t//#endregion\n\n\t\tif(inputLength > 1)\n\t\t\tthis.warnings.push(\"Boolean value encoded in more then 1 octet\");\n\n\t\tthis.isHexOnly = true;\n\n\t\t//#region Copy input buffer to internal array\n\t\tthis.valueHex = new ArrayBuffer(intBuffer.length);\n\t\tconst view = new Uint8Array(this.valueHex);\n\n\t\tfor(let i = 0; i < intBuffer.length; i++)\n\t\t\tview[i] = intBuffer[i];\n\t\t//#endregion\n\n\t\tif(utilDecodeTC.call(this) !== 0)\n\t\t\tthis.value = true;\n\t\telse\n\t\t\tthis.value = false;\n\n\t\tthis.blockLength = inputLength;\n\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\treturn this.valueHex;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BooleanValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.value;\n\t\tobject.isHexOnly = this.isHexOnly;\n\t\tobject.valueHex = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class Boolean extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Boolean\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalBooleanValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 1; // Boolean\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BOOLEAN\";\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.value}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 Sequence and Set type classes\n//**************************************************************************************\nexport class Sequence extends Constructed\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Sequence\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 16; // Sequence\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"SEQUENCE\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class Set extends Constructed\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Set\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 17; // Set\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"SET\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 Null type class\n//**************************************************************************************\nexport class Null extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Null\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalBaseBlock); // We will not have a call to \"Null value block\" because of specified FROM_BER and TO_BER functions\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 5; // Null\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"NULL\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedLocalSymbols\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tif(this.lenBlock.length > 0)\n\t\t\tthis.warnings.push(\"Non-zero length of value block for Null type\");\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tthis.blockLength += inputLength;\n\n\t\tif((inputOffset + inputLength) > inputBuffer.byteLength)\n\t\t{\n\t\t\tthis.error = \"End of input reached before message was fully decoded (inconsistent offset and length values)\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false, writer)\n\t{\n\t\tconst retBuf = new ArrayBuffer(2);\n\n\t\tif(!sizeOnly)\n\t\t{\n\t\t\tconst retView = new Uint8Array(retBuf);\n\t\t\tretView[0] = 0x05;\n\t\t\tretView[1] = 0x00;\n\t\t}\n\n\t\tif(writer)\n\t\t{\n\t\t\twriter.write(retBuf);\n\t\t}\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 OctetString type class\n//**************************************************************************************\nclass LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalOctetStringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.isConstructed = getParametersValue(parameters, IS_CONSTRUCTED, false);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tlet resultOffset = 0;\n\n\t\tif(this.isConstructed === true)\n\t\t{\n\t\t\tthis.isHexOnly = false;\n\n\t\t\tresultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength);\n\t\t\tif(resultOffset === (-1))\n\t\t\t\treturn resultOffset;\n\n\t\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t\t{\n\t\t\t\tconst currentBlockName = this.value[i].constructor.blockName();\n\n\t\t\t\tif(currentBlockName === EndOfContent.blockName())\n\t\t\t\t{\n\t\t\t\t\tif(this.isIndefiniteForm === true)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.error = \"EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only\";\n\t\t\t\t\t\treturn (-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(currentBlockName !== OctetString.blockName())\n\t\t\t\t{\n\t\t\t\t\tthis.error = \"OCTET STRING may consists of OCTET STRINGs only\";\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.isHexOnly = true;\n\n\t\t\tresultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);\n\t\t\tthis.blockLength = inputLength;\n\t\t}\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false, writer)\n\t{\n\t\tif(this.isConstructed === true)\n\t\t\treturn LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);\n\n\t\tlet retBuf = new ArrayBuffer(this.valueHex.byteLength);\n\n\t\tif(sizeOnly === true)\n\t\t\treturn retBuf;\n\n\t\tif(this.valueHex.byteLength === 0)\n\t\t\treturn retBuf;\n\n\t\tretBuf = this.valueHex.slice(0);\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"OctetStringValueBlock\";\n\t}\n\t//**********************************************************************************\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.isConstructed = this.isConstructed;\n\t\tobject.isHexOnly = this.isHexOnly;\n\t\tobject.valueHex = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class OctetString extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"OctetString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalOctetStringValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 4; // OctetString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tthis.valueBlock.isConstructed = this.idBlock.isConstructed;\n\t\tthis.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n\n\t\t//#region Ability to encode empty OCTET STRING\n\t\tif(inputLength === 0)\n\t\t{\n\t\t\tif(this.idBlock.error.length === 0)\n\t\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\t\tif(this.lenBlock.error.length === 0)\n\t\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\t\treturn inputOffset;\n\t\t}\n\t\t//#endregion\n\n\t\tif(!this.valueBlock.isConstructed)\n\t\t{\n\t\t\tconst buf = inputBuffer.slice(inputOffset, inputOffset + inputLength);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst asn = fromBER(buf);\n\t\t\t\tif(asn.offset !== -1 && asn.offset === inputLength)\n\t\t\t\t{\n\t\t\t\t\tthis.valueBlock.value = [asn.result];\n\t\t\t\t}\n\t\t\t} catch(e)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\t\t}\n\n\t\treturn super.fromBER(inputBuffer, inputOffset, inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"OCTET STRING\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Checking that two OCTETSTRINGs are equal\n\t * @param {OctetString} octetString\n\t */\n\tisEqual(octetString)\n\t{\n\t\t//#region Check input type\n\t\tif((octetString instanceof OctetString) === false)\n\t\t\treturn false;\n\t\t//#endregion\n\n\t\t//#region Compare two JSON strings\n\t\tif(JSON.stringify(this) !== JSON.stringify(octetString))\n\t\t\treturn false;\n\t\t//#endregion\n\n\t\treturn true;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\tif(this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length))\n\t\t{\n\t\t\treturn Constructed.prototype.toString.call(this);\n\t\t} else\n\t\t{\n\t\t\treturn `${this.constructor.blockName()} : ${bufferToHexCodes(this.valueBlock.valueHex)}`;\n\t\t}\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 BitString type class\n//**************************************************************************************\nclass LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalBitStringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.unusedBits = getParametersValue(parameters, UNUSED_BITS, 0);\n\t\tthis.isConstructed = getParametersValue(parameters, IS_CONSTRUCTED, false);\n\t\tthis.blockLength = this.valueHex.byteLength;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Ability to decode zero-length BitString value\n\t\tif(inputLength === 0)\n\t\t\treturn inputOffset;\n\t\t//#endregion\n\n\t\tlet resultOffset = (-1);\n\n\t\t//#region If the BISTRING supposed to be a constructed value\n\t\tif(this.isConstructed === true)\n\t\t{\n\t\t\tresultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength);\n\t\t\tif(resultOffset === (-1))\n\t\t\t\treturn resultOffset;\n\n\t\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t\t{\n\t\t\t\tconst currentBlockName = this.value[i].constructor.blockName();\n\n\t\t\t\tif(currentBlockName === EndOfContent.blockName())\n\t\t\t\t{\n\t\t\t\t\tif(this.isIndefiniteForm === true)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.error = \"EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only\";\n\t\t\t\t\t\treturn (-1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(currentBlockName !== BitString.blockName())\n\t\t\t\t{\n\t\t\t\t\tthis.error = \"BIT STRING may consists of BIT STRINGs only\";\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\n\t\t\t\tif((this.unusedBits > 0) && (this.value[i].valueBlock.unusedBits > 0))\n\t\t\t\t{\n\t\t\t\t\tthis.error = \"Using of \\\"unused bits\\\" inside constructive BIT STRING allowed for least one only\";\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\n\t\t\t\tthis.unusedBits = this.value[i].valueBlock.unusedBits;\n\t\t\t\tif(this.unusedBits > 7)\n\t\t\t\t{\n\t\t\t\t\tthis.error = \"Unused bits for BitString must be in range 0-7\";\n\t\t\t\t\treturn (-1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn resultOffset;\n\t\t}\n\t\t//#endregion\n\t\t//#region If the BitString supposed to be a primitive value\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\n\t\tthis.unusedBits = intBuffer[0];\n\n\t\tif(this.unusedBits > 7)\n\t\t{\n\t\t\tthis.error = \"Unused bits for BitString must be in range 0-7\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tif(!this.unusedBits)\n\t\t{\n\t\t\tconst buf = inputBuffer.slice(inputOffset + 1, inputOffset + inputLength);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tconst asn = fromBER(buf);\n\t\t\t\tif(asn.offset !== -1 && asn.offset === (inputLength - 1))\n\t\t\t\t{\n\t\t\t\t\tthis.value = [asn.result];\n\t\t\t\t}\n\t\t\t} catch(e)\n\t\t\t{\n\t\t\t\t// nothing\n\t\t\t}\n\t\t}\n\n\t\t//#region Copy input buffer to internal buffer\n\t\tthis.valueHex = new ArrayBuffer(intBuffer.length - 1);\n\t\tconst view = new Uint8Array(this.valueHex);\n\t\tfor(let i = 0; i < (inputLength - 1); i++)\n\t\t\tview[i] = intBuffer[i + 1];\n\t\t//#endregion\n\n\t\tthis.blockLength = intBuffer.length;\n\n\t\treturn (inputOffset + inputLength);\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false, writer)\n\t{\n\t\tif(this.isConstructed === true)\n\t\t\treturn LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);\n\n\t\tif(sizeOnly === true)\n\t\t\treturn (new ArrayBuffer(this.valueHex.byteLength + 1));\n\n\t\tif(this.valueHex.byteLength === 0)\n\t\t\treturn (EMPTY_BUFFER);\n\n\t\tconst curView = new Uint8Array(this.valueHex);\n\n\t\tconst retBuf = new ArrayBuffer(this.valueHex.byteLength + 1);\n\t\tconst retView = new Uint8Array(retBuf);\n\n\t\tretView[0] = this.unusedBits;\n\n\t\tfor(let i = 0; i < this.valueHex.byteLength; i++)\n\t\t\tretView[i + 1] = curView[i];\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BitStringValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {{blockName, blockLength, error, warnings, valueBeforeDecode}|{blockName: string, blockLength: number, error: string, warnings: Array., valueBeforeDecode: string}}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.unusedBits = this.unusedBits;\n\t\tobject.isConstructed = this.isConstructed;\n\t\tobject.isHexOnly = this.isHexOnly;\n\t\tobject.valueHex = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class BitString extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"BitString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalBitStringValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 3; // BitString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BIT STRING\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\t//#region Ability to encode empty BitString\n\t\tif(inputLength === 0)\n\t\t\treturn inputOffset;\n\t\t//#endregion\n\n\t\tthis.valueBlock.isConstructed = this.idBlock.isConstructed;\n\t\tthis.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;\n\n\t\treturn super.fromBER(inputBuffer, inputOffset, inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Checking that two BITSTRINGs are equal\n\t * @param {BitString} bitString\n\t */\n\tisEqual(bitString)\n\t{\n\t\t//#region Check input type\n\t\tif((bitString instanceof BitString) === false)\n\t\t\treturn false;\n\t\t//#endregion\n\n\t\t//#region Compare two JSON strings\n\t\tif(JSON.stringify(this) !== JSON.stringify(bitString))\n\t\t\treturn false;\n\t\t//#endregion\n\n\t\treturn true;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\tif(this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length))\n\t\t{\n\t\t\treturn Constructed.prototype.toString.call(this);\n\t\t} else\n\t\t{\n\t\t\t// convert bytes to bits\n\t\t\tconst bits = [];\n\t\t\tconst valueHex = new Uint8Array(this.valueBlock.valueHex);\n\t\t\tfor(const byte of valueHex)\n\t\t\t{\n\t\t\t\tbits.push(byte.toString(2).padStart(8, \"0\"));\n\t\t\t}\n\t\t\treturn `${this.constructor.blockName()} : ${bits.join(\"\")}`;\n\t\t}\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 Integer type class\n//**************************************************************************************\n/**\n * @extends ValueBlock\n */\nclass LocalIntegerValueBlock extends HexBlock(ValueBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalIntegerValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tif(VALUE in parameters)\n\t\t\tthis.valueDec = parameters.value;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Setter for VALUE_HEX\n\t * @param {ArrayBuffer} _value\n\t */\n\tset valueHex(_value)\n\t{\n\t\tthis._valueHex = _value.slice(0);\n\n\t\tif(_value.byteLength >= 4)\n\t\t{\n\t\t\tthis.warnings.push(\"Too big Integer for decoding, hex only\");\n\t\t\tthis.isHexOnly = true;\n\t\t\tthis._valueDec = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.isHexOnly = false;\n\n\t\t\tif(_value.byteLength > 0)\n\t\t\t\tthis._valueDec = utilDecodeTC.call(this);\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Getter for VALUE_HEX\n\t * @returns {ArrayBuffer}\n\t */\n\tget valueHex()\n\t{\n\t\treturn this._valueHex;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Getter for VALUE_DEC\n\t * @param {number} _value\n\t */\n\tset valueDec(_value)\n\t{\n\t\tthis._valueDec = _value;\n\n\t\tthis.isHexOnly = false;\n\t\tthis._valueHex = utilEncodeTC(_value);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Getter for VALUE_DEC\n\t * @returns {number}\n\t */\n\tget valueDec()\n\t{\n\t\treturn this._valueDec;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from DER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 DER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 DER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @param {number} [expectedLength=0] Expected length of converted VALUE_HEX buffer\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromDER(inputBuffer, inputOffset, inputLength, expectedLength = 0)\n\t{\n\t\tconst offset = this.fromBER(inputBuffer, inputOffset, inputLength);\n\t\tif(offset === (-1))\n\t\t\treturn offset;\n\n\t\tconst view = new Uint8Array(this._valueHex);\n\n\t\tif((view[0] === 0x00) && ((view[1] & 0x80) !== 0))\n\t\t{\n\t\t\tconst updatedValueHex = new ArrayBuffer(this._valueHex.byteLength - 1);\n\t\t\tconst updatedView = new Uint8Array(updatedValueHex);\n\n\t\t\tupdatedView.set(new Uint8Array(this._valueHex, 1, this._valueHex.byteLength - 1));\n\n\t\t\tthis._valueHex = updatedValueHex.slice(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(expectedLength !== 0)\n\t\t\t{\n\t\t\t\tif(this._valueHex.byteLength < expectedLength)\n\t\t\t\t{\n\t\t\t\t\tif((expectedLength - this._valueHex.byteLength) > 1)\n\t\t\t\t\t\texpectedLength = this._valueHex.byteLength + 1;\n\n\t\t\t\t\tconst updatedValueHex = new ArrayBuffer(expectedLength);\n\t\t\t\t\tconst updatedView = new Uint8Array(updatedValueHex);\n\n\t\t\t\t\tupdatedView.set(view, expectedLength - this._valueHex.byteLength);\n\n\t\t\t\t\tthis._valueHex = updatedValueHex.slice(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn offset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (DER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoDER(sizeOnly = false)\n\t{\n\t\tconst view = new Uint8Array(this._valueHex);\n\n\t\tswitch(true)\n\t\t{\n\t\t\tcase ((view[0] & 0x80) !== 0):\n\t\t\t\t{\n\t\t\t\t\tconst updatedValueHex = new ArrayBuffer(this._valueHex.byteLength + 1);\n\t\t\t\t\tconst updatedView = new Uint8Array(updatedValueHex);\n\n\t\t\t\t\tupdatedView[0] = 0x00;\n\t\t\t\t\tupdatedView.set(view, 1);\n\n\t\t\t\t\tthis._valueHex = updatedValueHex.slice(0);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase ((view[0] === 0x00) && ((view[1] & 0x80) === 0)):\n\t\t\t\t{\n\t\t\t\t\tconst updatedValueHex = new ArrayBuffer(this._valueHex.byteLength - 1);\n\t\t\t\t\tconst updatedView = new Uint8Array(updatedValueHex);\n\n\t\t\t\t\tupdatedView.set(new Uint8Array(this._valueHex, 1, this._valueHex.byteLength - 1));\n\n\t\t\t\t\tthis._valueHex = updatedValueHex.slice(0);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\n\t\treturn this.toBER(sizeOnly);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);\n\t\tif(resultOffset === (-1))\n\t\t\treturn resultOffset;\n\n\t\tthis.blockLength = inputLength;\n\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//noinspection JSCheckFunctionSignatures\n\t\treturn this.valueHex.slice(0);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"IntegerValueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.valueDec = this.valueDec;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Convert current value to decimal string representation\n\t */\n\ttoString()\n\t{\n\t\t//#region Aux functions\n\t\tfunction viewAdd(first, second)\n\t\t{\n\t\t\t//#region Initial variables\n\t\t\tconst c = new Uint8Array([0]);\n\n\t\t\tlet firstView = new Uint8Array(first);\n\t\t\tlet secondView = new Uint8Array(second);\n\n\t\t\tlet firstViewCopy = firstView.slice(0);\n\t\t\tconst firstViewCopyLength = firstViewCopy.length - 1;\n\t\t\tlet secondViewCopy = secondView.slice(0);\n\t\t\tconst secondViewCopyLength = secondViewCopy.length - 1;\n\n\t\t\tlet value = 0;\n\n\t\t\tconst max = (secondViewCopyLength < firstViewCopyLength) ? firstViewCopyLength : secondViewCopyLength;\n\n\t\t\tlet counter = 0;\n\t\t\t//#endregion\n\n\t\t\tfor(let i = max; i >= 0; i--, counter++)\n\t\t\t{\n\t\t\t\tswitch(true)\n\t\t\t\t{\n\t\t\t\t\tcase (counter < secondViewCopy.length):\n\t\t\t\t\t\tvalue = firstViewCopy[firstViewCopyLength - counter] + secondViewCopy[secondViewCopyLength - counter] + c[0];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tvalue = firstViewCopy[firstViewCopyLength - counter] + c[0];\n\t\t\t\t}\n\n\t\t\t\tc[0] = value / 10;\n\n\t\t\t\tswitch(true)\n\t\t\t\t{\n\t\t\t\t\tcase (counter >= firstViewCopy.length):\n\t\t\t\t\t\tfirstViewCopy = utilConcatView(new Uint8Array([value % 10]), firstViewCopy);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfirstViewCopy[firstViewCopyLength - counter] = value % 10;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(c[0] > 0)\n\t\t\t\tfirstViewCopy = utilConcatView(c, firstViewCopy);\n\n\t\t\treturn firstViewCopy.slice(0);\n\t\t}\n\n\t\tfunction power2(n)\n\t\t{\n\t\t\tif(n >= powers2.length)\n\t\t\t{\n\t\t\t\tfor(let p = powers2.length; p <= n; p++)\n\t\t\t\t{\n\t\t\t\t\tconst c = new Uint8Array([0]);\n\t\t\t\t\tlet digits = (powers2[p - 1]).slice(0);\n\n\t\t\t\t\tfor(let i = (digits.length - 1); i >= 0; i--)\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newValue = new Uint8Array([(digits[i] << 1) + c[0]]);\n\t\t\t\t\t\tc[0] = newValue[0] / 10;\n\t\t\t\t\t\tdigits[i] = newValue[0] % 10;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(c[0] > 0)\n\t\t\t\t\t\tdigits = utilConcatView(c, digits);\n\n\t\t\t\t\tpowers2.push(digits);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn powers2[n];\n\t\t}\n\n\t\tfunction viewSub(first, second)\n\t\t{\n\t\t\t//#region Initial variables\n\t\t\tlet b = 0;\n\n\t\t\tlet firstView = new Uint8Array(first);\n\t\t\tlet secondView = new Uint8Array(second);\n\n\t\t\tlet firstViewCopy = firstView.slice(0);\n\t\t\tconst firstViewCopyLength = firstViewCopy.length - 1;\n\t\t\tlet secondViewCopy = secondView.slice(0);\n\t\t\tconst secondViewCopyLength = secondViewCopy.length - 1;\n\n\t\t\tlet value;\n\n\t\t\tlet counter = 0;\n\t\t\t//#endregion\n\n\t\t\tfor(let i = secondViewCopyLength; i >= 0; i--, counter++)\n\t\t\t{\n\t\t\t\tvalue = firstViewCopy[firstViewCopyLength - counter] - secondViewCopy[secondViewCopyLength - counter] - b;\n\n\t\t\t\tswitch(true)\n\t\t\t\t{\n\t\t\t\t\tcase (value < 0):\n\t\t\t\t\t\tb = 1;\n\t\t\t\t\t\tfirstViewCopy[firstViewCopyLength - counter] = value + 10;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tb = 0;\n\t\t\t\t\t\tfirstViewCopy[firstViewCopyLength - counter] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(b > 0)\n\t\t\t{\n\t\t\t\tfor(let i = (firstViewCopyLength - secondViewCopyLength + 1); i >= 0; i--, counter++)\n\t\t\t\t{\n\t\t\t\t\tvalue = firstViewCopy[firstViewCopyLength - counter] - b;\n\n\t\t\t\t\tif(value < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tb = 1;\n\t\t\t\t\t\tfirstViewCopy[firstViewCopyLength - counter] = value + 10;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tb = 0;\n\t\t\t\t\t\tfirstViewCopy[firstViewCopyLength - counter] = value;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn firstViewCopy.slice();\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Initial variables\n\t\tconst firstBit = (this._valueHex.byteLength * 8) - 1;\n\n\t\tlet digits = new Uint8Array((this._valueHex.byteLength * 8) / 3);\n\t\tlet bitNumber = 0;\n\t\tlet currentByte;\n\n\t\tconst asn1View = new Uint8Array(this._valueHex);\n\n\t\tlet result = \"\";\n\n\t\tlet flag = false;\n\t\t//#endregion\n\n\t\t//#region Calculate number\n\t\tfor(let byteNumber = (this._valueHex.byteLength - 1); byteNumber >= 0; byteNumber--)\n\t\t{\n\t\t\tcurrentByte = asn1View[byteNumber];\n\n\t\t\tfor(let i = 0; i < 8; i++)\n\t\t\t{\n\t\t\t\tif((currentByte & 1) === 1)\n\t\t\t\t{\n\t\t\t\t\tswitch(bitNumber)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase firstBit:\n\t\t\t\t\t\t\tdigits = viewSub(power2(bitNumber), digits);\n\t\t\t\t\t\t\tresult = \"-\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tdigits = viewAdd(digits, power2(bitNumber));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbitNumber++;\n\t\t\t\tcurrentByte >>= 1;\n\t\t\t}\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Print number\n\t\tfor(let i = 0; i < digits.length; i++)\n\t\t{\n\t\t\tif(digits[i])\n\t\t\t\tflag = true;\n\n\t\t\tif(flag)\n\t\t\t\tresult += digitsString.charAt(digits[i]);\n\t\t}\n\n\t\tif(flag === false)\n\t\t\tresult += digitsString.charAt(0);\n\t\t//#endregion\n\n\t\treturn result;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nexport class Integer extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Integer\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalIntegerValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 2; // Integer\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"INTEGER\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Compare two Integer object, or Integer and ArrayBuffer objects\n\t * @param {!Integer|ArrayBuffer} otherValue\n\t * @returns {boolean}\n\t */\n\tisEqual(otherValue)\n\t{\n\t\tif(otherValue instanceof Integer)\n\t\t{\n\t\t\tif(this.valueBlock.isHexOnly && otherValue.valueBlock.isHexOnly) // Compare two ArrayBuffers\n\t\t\t\treturn isEqualBuffer(this.valueBlock.valueHex, otherValue.valueBlock.valueHex);\n\n\t\t\tif(this.valueBlock.isHexOnly === otherValue.valueBlock.isHexOnly)\n\t\t\t\treturn (this.valueBlock.valueDec === otherValue.valueBlock.valueDec);\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif(otherValue instanceof ArrayBuffer)\n\t\t\treturn isEqualBuffer(this.valueBlock.valueHex, otherValue);\n\n\t\treturn false;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Convert current Integer value from BER into DER format\n\t * @returns {Integer}\n\t */\n\tconvertToDER()\n\t{\n\t\tconst integer = new Integer({ valueHex: this.valueBlock.valueHex });\n\t\tinteger.valueBlock.toDER();\n\n\t\treturn integer;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Convert current Integer value from DER to BER format\n\t * @returns {Integer}\n\t */\n\tconvertFromDER()\n\t{\n\t\tconst expectedLength = (this.valueBlock.valueHex.byteLength % 2) ? (this.valueBlock.valueHex.byteLength + 1) : this.valueBlock.valueHex.byteLength;\n\t\tconst integer = new Integer({ valueHex: this.valueBlock.valueHex });\n\t\tinteger.valueBlock.fromDER(integer.valueBlock.valueHex, 0, integer.valueBlock.valueHex.byteLength, expectedLength);\n\n\t\treturn integer;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\tassertBigInt();\n\t\tconst hex = bufferToHexCodes(this.valueBlock.valueHex);\n\t\tconst bigInt = BigInt(`0x${hex}`);\n\t\treturn `${this.constructor.blockName()} : ${bigInt.toString()}`;\n\t}\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 Enumerated type class\n//**************************************************************************************\nexport class Enumerated extends Integer\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Enumerated\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 10; // Enumerated\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"ENUMERATED\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of ASN.1 ObjectIdentifier type class\n//**************************************************************************************\nclass LocalSidValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalSidValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {number} [valueDec]\n\t * @property {boolean} [isFirstSid]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.valueDec = getParametersValue(parameters, VALUE_DEC, -1);\n\t\tthis.isFirstSid = getParametersValue(parameters, IS_FIRST_SID, false);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"sidBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tif(inputLength === 0)\n\t\t\treturn inputOffset;\n\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\n\t\tthis.valueHex = new ArrayBuffer(inputLength);\n\t\tlet view = new Uint8Array(this.valueHex);\n\n\t\tfor(let i = 0; i < inputLength; i++)\n\t\t{\n\t\t\tview[i] = intBuffer[i] & 0x7F;\n\n\t\t\tthis.blockLength++;\n\n\t\t\tif((intBuffer[i] & 0x80) === 0x00)\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//#region Adjust size of valueHex buffer\n\t\tconst tempValueHex = new ArrayBuffer(this.blockLength);\n\t\tconst tempView = new Uint8Array(tempValueHex);\n\n\t\tfor(let i = 0; i < this.blockLength; i++)\n\t\t\ttempView[i] = view[i];\n\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tthis.valueHex = tempValueHex.slice(0);\n\t\tview = new Uint8Array(this.valueHex);\n\t\t//#endregion\n\n\t\tif((intBuffer[this.blockLength - 1] & 0x80) !== 0x00)\n\t\t{\n\t\t\tthis.error = \"End of input reached before message was fully decoded\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tif(view[0] === 0x00)\n\t\t\tthis.warnings.push(\"Needlessly long format of SID encoding\");\n\n\t\tif(this.blockLength <= 8)\n\t\t\tthis.valueDec = utilFromBase(view, 7);\n\t\telse\n\t\t{\n\t\t\tthis.isHexOnly = true;\n\t\t\tthis.warnings.push(\"Too big SID for decoding, hex only\");\n\t\t}\n\n\t\treturn (inputOffset + this.blockLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Save a BigInt value immediately as an array of octects.\n\t */\n\tset valueBigInt(value)\n\t{\n\n\t\tassertBigInt();\n\n\t\tlet bits = BigInt(value).toString(2);\n\t\twhile(bits.length % 7)\n\t\t{\n\t\t\tbits = \"0\" + bits;\n\t\t}\n\t\tconst bytes = new Uint8Array(bits.length / 7);\n\t\tfor(let i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\tbytes[i] = parseInt(bits.slice(i * 7, i * 7 + 7), 2) + (i + 1 < bytes.length ? 0x80 : 0);\n\t\t}\n\t\tthis.fromBER(bytes.buffer, 0, bytes.length);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//#region Initial variables\n\t\tlet retBuf;\n\t\tlet retView;\n\t\t//#endregion\n\n\t\tif(this.isHexOnly)\n\t\t{\n\t\t\tif(sizeOnly === true)\n\t\t\t\treturn (new ArrayBuffer(this.valueHex.byteLength));\n\n\t\t\tconst curView = new Uint8Array(this.valueHex);\n\n\t\t\tretBuf = new ArrayBuffer(this.blockLength);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tfor(let i = 0; i < (this.blockLength - 1); i++)\n\t\t\t\tretView[i] = curView[i] | 0x80;\n\n\t\t\tretView[this.blockLength - 1] = curView[this.blockLength - 1];\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tconst encodedBuf = utilToBase(this.valueDec, 7);\n\t\tif(encodedBuf.byteLength === 0)\n\t\t{\n\t\t\tthis.error = \"Error during encoding SID value\";\n\t\t\treturn (EMPTY_BUFFER);\n\t\t}\n\n\t\tretBuf = new ArrayBuffer(encodedBuf.byteLength);\n\n\t\tif(sizeOnly === false)\n\t\t{\n\t\t\tconst encodedView = new Uint8Array(encodedBuf);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tfor(let i = 0; i < (encodedBuf.byteLength - 1); i++)\n\t\t\t\tretView[i] = encodedView[i] | 0x80;\n\n\t\t\tretView[encodedBuf.byteLength - 1] = encodedView[encodedBuf.byteLength - 1];\n\t\t}\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Create string representation of current SID block\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tlet result = \"\";\n\n\t\tif(this.isHexOnly === true)\n\t\t\tresult = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\t\telse\n\t\t{\n\t\t\tif(this.isFirstSid)\n\t\t\t{\n\t\t\t\tlet sidValue = this.valueDec;\n\n\t\t\t\tif(this.valueDec <= 39)\n\t\t\t\t\tresult = \"0.\";\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(this.valueDec <= 79)\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = \"1.\";\n\t\t\t\t\t\tsidValue -= 40;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tresult = \"2.\";\n\t\t\t\t\t\tsidValue -= 80;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tresult += sidValue.toString();\n\t\t\t}\n\t\t\telse\n\t\t\t\tresult = this.valueDec.toString();\n\t\t}\n\n\t\treturn result;\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.valueDec = this.valueDec;\n\t\tobject.isFirstSid = this.isFirstSid;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nclass LocalObjectIdentifierValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalObjectIdentifierValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.fromString(getParametersValue(parameters, VALUE, EMPTY_STRING));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tlet resultOffset = inputOffset;\n\n\t\twhile(inputLength > 0)\n\t\t{\n\t\t\tconst sidBlock = new LocalSidValueBlock();\n\t\t\tresultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);\n\t\t\tif(resultOffset === (-1))\n\t\t\t{\n\t\t\t\tthis.blockLength = 0;\n\t\t\t\tthis.error = sidBlock.error;\n\t\t\t\treturn resultOffset;\n\t\t\t}\n\n\t\t\tif(this.value.length === 0)\n\t\t\t\tsidBlock.isFirstSid = true;\n\n\t\t\tthis.blockLength += sidBlock.blockLength;\n\t\t\tinputLength -= sidBlock.blockLength;\n\n\t\t\tthis.value.push(sidBlock);\n\t\t}\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\tconst retBufs = [];\n\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t{\n\t\t\tconst valueBuf = this.value[i].toBER(sizeOnly);\n\t\t\tif(valueBuf.byteLength === 0)\n\t\t\t{\n\t\t\t\tthis.error = this.value[i].error;\n\t\t\t\treturn (EMPTY_BUFFER);\n\t\t\t}\n\n\t\t\tretBufs.push(valueBuf);\n\t\t}\n\n\t\treturn concat(retBufs);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Create \"LocalObjectIdentifierValueBlock\" class from string\n\t * @param {string} string Input string to convert from\n\t * @returns {boolean}\n\t */\n\tfromString(string)\n\t{\n\t\tthis.value = []; // Clear existing SID values\n\n\t\tlet pos1 = 0;\n\t\tlet pos2 = 0;\n\n\t\tlet sid = \"\";\n\n\t\tlet flag = false;\n\n\t\tdo\n\t\t{\n\t\t\tpos2 = string.indexOf(\".\", pos1);\n\t\t\tif(pos2 === (-1))\n\t\t\t\tsid = string.substr(pos1);\n\t\t\telse\n\t\t\t\tsid = string.substr(pos1, pos2 - pos1);\n\n\t\t\tpos1 = pos2 + 1;\n\n\t\t\tif(flag)\n\t\t\t{\n\t\t\t\tconst sidBlock = this.value[0];\n\n\t\t\t\tlet plus = 0;\n\n\t\t\t\tswitch(sidBlock.valueDec)\n\t\t\t\t{\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tplus = 40;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tplus = 80;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthis.value = []; // clear SID array\n\t\t\t\t\t\treturn false; // ???\n\t\t\t\t}\n\n\t\t\t\tconst parsedSID = parseInt(sid, 10);\n\t\t\t\tif(isNaN(parsedSID))\n\t\t\t\t\treturn true;\n\n\t\t\t\tsidBlock.valueDec = parsedSID + plus;\n\n\t\t\t\tflag = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconst sidBlock = new LocalSidValueBlock();\n\t\t\t\tif(sid > Number.MAX_SAFE_INTEGER)\n\t\t\t\t{\n\t\t\t\t\tassertBigInt();\n\t\t\t\t\tconst sidValue = BigInt(sid);\n\t\t\t\t\tsidBlock.valueBigInt = sidValue;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tsidBlock.valueDec = parseInt(sid, 10);\n\t\t\t\t\tif(isNaN(sidBlock.valueDec)) return true;\n\t\t\t\t}\n\n\t\t\t\tif(this.value.length === 0)\n\t\t\t\t{\n\t\t\t\t\tsidBlock.isFirstSid = true;\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\n\t\t\t\tthis.value.push(sidBlock);\n\t\t\t}\n\t\t} while(pos2 !== (-1));\n\n\t\treturn true;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Converts \"LocalObjectIdentifierValueBlock\" class to string\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tlet result = \"\";\n\t\tlet isHexOnly = false;\n\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t{\n\t\t\tisHexOnly = this.value[i].isHexOnly;\n\n\t\t\tlet sidStr = this.value[i].toString();\n\n\t\t\tif(i !== 0)\n\t\t\t\tresult = `${result}.`;\n\n\t\t\tif(isHexOnly)\n\t\t\t{\n\t\t\t\tsidStr = `{${sidStr}}`;\n\n\t\t\t\tif(this.value[i].isFirstSid)\n\t\t\t\t\tresult = `2.{${sidStr} - 80}`;\n\t\t\t\telse\n\t\t\t\t\tresult += sidStr;\n\t\t\t}\n\t\t\telse\n\t\t\t\tresult += sidStr;\n\t\t}\n\n\t\treturn result;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"ObjectIdentifierValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.toString();\n\t\tobject.sidArray = [];\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t\tobject.sidArray.push(this.value[i].toJSON());\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nexport class ObjectIdentifier extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"ObjectIdentifier\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalObjectIdentifierValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 6; // OBJECT IDENTIFIER\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"OBJECT IDENTIFIER\";\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.toString()}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of all string's classes\n//**************************************************************************************\nclass LocalUtf8StringValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Constructor for \"LocalUtf8StringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.isHexOnly = true;\n\t\tthis.value = \"\"; // String representation of decoded ArrayBuffer\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"Utf8StringValueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.value;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nexport class Utf8String extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Utf8String\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalUtf8StringValueBlock);\n\n\t\tif(VALUE in parameters)\n\t\t\tthis.fromString(parameters.value);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 12; // Utf8String\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"UTF8String\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\tthis.valueBlock.value = String.fromCharCode.apply(null, new Uint8Array(inputBuffer));\n\n\t\ttry\n\t\t{\n\t\t\t//noinspection JSDeprecatedSymbols\n\t\t\tthis.valueBlock.value = decodeURIComponent(escape(this.valueBlock.value));\n\t\t}\n\t\tcatch(ex)\n\t\t{\n\t\t\tthis.warnings.push(`Error during \"decodeURIComponent\": ${ex}, using raw string`);\n\t\t}\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\t//noinspection JSDeprecatedSymbols\n\t\tconst str = unescape(encodeURIComponent(inputString));\n\t\tconst strLen = str.length;\n\n\t\tthis.valueBlock.valueHex = new ArrayBuffer(strLen);\n\t\tconst view = new Uint8Array(this.valueBlock.valueHex);\n\n\t\tfor(let i = 0; i < strLen; i++)\n\t\t\tview[i] = str.charCodeAt(i);\n\n\t\tthis.valueBlock.value = inputString;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.value}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#region Declaration of ASN.1 RelativeObjectIdentifier type class\n//**************************************************************************************\nclass LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalRelativeSidValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {number} [valueDec]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.valueDec = getParametersValue(parameters, VALUE_DEC, -1);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"relativeSidBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tif(inputLength === 0)\n\t\t\treturn inputOffset;\n\n\t\t//#region Basic check for parameters\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tif(checkBufferParams(this, inputBuffer, inputOffset, inputLength) === false)\n\t\t\treturn (-1);\n\t\t//#endregion\n\n\t\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\n\t\tthis.valueHex = new ArrayBuffer(inputLength);\n\t\tlet view = new Uint8Array(this.valueHex);\n\n\t\tfor(let i = 0; i < inputLength; i++)\n\t\t{\n\t\t\tview[i] = intBuffer[i] & 0x7F;\n\n\t\t\tthis.blockLength++;\n\n\t\t\tif((intBuffer[i] & 0x80) === 0x00)\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//#region Adjust size of valueHex buffer\n\t\tconst tempValueHex = new ArrayBuffer(this.blockLength);\n\t\tconst tempView = new Uint8Array(tempValueHex);\n\n\t\tfor(let i = 0; i < this.blockLength; i++)\n\t\t\ttempView[i] = view[i];\n\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tthis.valueHex = tempValueHex.slice(0);\n\t\tview = new Uint8Array(this.valueHex);\n\t\t//#endregion\n\n\t\tif((intBuffer[this.blockLength - 1] & 0x80) !== 0x00)\n\t\t{\n\t\t\tthis.error = \"End of input reached before message was fully decoded\";\n\t\t\treturn (-1);\n\t\t}\n\n\t\tif(view[0] === 0x00)\n\t\t\tthis.warnings.push(\"Needlessly long format of SID encoding\");\n\n\t\tif(this.blockLength <= 8)\n\t\t\tthis.valueDec = utilFromBase(view, 7);\n\t\telse\n\t\t{\n\t\t\tthis.isHexOnly = true;\n\t\t\tthis.warnings.push(\"Too big SID for decoding, hex only\");\n\t\t}\n\n\t\treturn (inputOffset + this.blockLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\t//#region Initial variables\n\t\tlet retBuf;\n\t\tlet retView;\n\t\t//#endregion\n\n\t\tif(this.isHexOnly)\n\t\t{\n\t\t\tif(sizeOnly === true)\n\t\t\t\treturn (new ArrayBuffer(this.valueHex.byteLength));\n\n\t\t\tconst curView = new Uint8Array(this.valueHex);\n\n\t\t\tretBuf = new ArrayBuffer(this.blockLength);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tfor(let i = 0; i < (this.blockLength - 1); i++)\n\t\t\t\tretView[i] = curView[i] | 0x80;\n\n\t\t\tretView[this.blockLength - 1] = curView[this.blockLength - 1];\n\n\t\t\treturn retBuf;\n\t\t}\n\n\t\tconst encodedBuf = utilToBase(this.valueDec, 7);\n\t\tif(encodedBuf.byteLength === 0)\n\t\t{\n\t\t\tthis.error = \"Error during encoding SID value\";\n\t\t\treturn (EMPTY_BUFFER);\n\t\t}\n\n\t\tretBuf = new ArrayBuffer(encodedBuf.byteLength);\n\n\t\tif(sizeOnly === false)\n\t\t{\n\t\t\tconst encodedView = new Uint8Array(encodedBuf);\n\t\t\tretView = new Uint8Array(retBuf);\n\n\t\t\tfor(let i = 0; i < (encodedBuf.byteLength - 1); i++)\n\t\t\t\tretView[i] = encodedView[i] | 0x80;\n\n\t\t\tretView[encodedBuf.byteLength - 1] = encodedView[encodedBuf.byteLength - 1];\n\t\t}\n\n\t\treturn retBuf;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Create string representation of current SID block\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tlet result = \"\";\n\n\t\tif(this.isHexOnly === true)\n\t\t\tresult = bufferToHexCodes(this.valueHex, 0, this.valueHex.byteLength);\n\t\telse\n\t\t{\n\t\t\tresult = this.valueDec.toString();\n\t\t}\n\n\t\treturn result;\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t} catch(ex) { }\n\t\t//#endregion\n\n\t\tobject.valueDec = this.valueDec;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nclass LocalRelativeObjectIdentifierValueBlock extends ValueBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalRelativeObjectIdentifierValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.fromString(getParametersValue(parameters, VALUE, EMPTY_STRING));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tlet resultOffset = inputOffset;\n\n\t\twhile(inputLength > 0)\n\t\t{\n\t\t\tconst sidBlock = new LocalRelativeSidValueBlock();\n\t\t\tresultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);\n\t\t\tif(resultOffset === (-1))\n\t\t\t{\n\t\t\t\tthis.blockLength = 0;\n\t\t\t\tthis.error = sidBlock.error;\n\t\t\t\treturn resultOffset;\n\t\t\t}\n\n\t\t\tthis.blockLength += sidBlock.blockLength;\n\t\t\tinputLength -= sidBlock.blockLength;\n\n\t\t\tthis.value.push(sidBlock);\n\t\t}\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\tlet retBufs = [];\n\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t{\n\t\t\tconst valueBuf = this.value[i].toBER(sizeOnly);\n\t\t\tif(valueBuf.byteLength === 0)\n\t\t\t{\n\t\t\t\tthis.error = this.value[i].error;\n\t\t\t\treturn (EMPTY_BUFFER);\n\t\t\t}\n\n\t\t\tretBufs.push(valueBuf);\n\t\t}\n\n\t\treturn concat(retBufs);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Create \"LocalRelativeObjectIdentifierValueBlock\" class from string\n\t * @param {string} string Input string to convert from\n\t * @returns {boolean}\n\t */\n\tfromString(string)\n\t{\n\t\tthis.value = []; // Clear existing SID values\n\n\t\tlet pos1 = 0;\n\t\tlet pos2 = 0;\n\n\t\tlet sid = \"\";\n\n\t\tdo\n\t\t{\n\t\t\tpos2 = string.indexOf(\".\", pos1);\n\t\t\tif(pos2 === (-1))\n\t\t\t\tsid = string.substr(pos1);\n\t\t\telse\n\t\t\t\tsid = string.substr(pos1, pos2 - pos1);\n\n\t\t\tpos1 = pos2 + 1;\n\n\t\t\tconst sidBlock = new LocalRelativeSidValueBlock();\n\t\t\tsidBlock.valueDec = parseInt(sid, 10);\n\t\t\tif(isNaN(sidBlock.valueDec))\n\t\t\t\treturn true;\n\n\t\t\tthis.value.push(sidBlock);\n\n\t\t} while(pos2 !== (-1));\n\n\t\treturn true;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Converts \"LocalRelativeObjectIdentifierValueBlock\" class to string\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tlet result = \"\";\n\t\tlet isHexOnly = false;\n\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t{\n\t\t\tisHexOnly = this.value[i].isHexOnly;\n\n\t\t\tlet sidStr = this.value[i].toString();\n\n\t\t\tif(i !== 0)\n\t\t\t\tresult = `${result}.`;\n\n\t\t\tif(isHexOnly)\n\t\t\t{\n\t\t\t\tsidStr = `{${sidStr}}`;\n\t\t\t\tresult += sidStr;\n\t\t\t} else\n\t\t\t\tresult += sidStr;\n\t\t}\n\n\t\treturn result;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"RelativeObjectIdentifierValueBlock\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t} catch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.toString();\n\t\tobject.sidArray = [];\n\t\tfor(let i = 0; i < this.value.length; i++)\n\t\t\tobject.sidArray.push(this.value[i].toJSON());\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nexport class RelativeObjectIdentifier extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"RelativeObjectIdentifier\" class\n\t * @param {Object} [parameters={}]\n\t * @property {ArrayBuffer} [valueHex]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalRelativeObjectIdentifierValueBlock);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 13; // RELATIVE OBJECT IDENTIFIER\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"RelativeObjectIdentifier\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n/**\n * @extends LocalBaseBlock\n * @extends HexBlock\n */\nclass LocalBmpStringValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalBmpStringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.isHexOnly = true;\n\t\tthis.value = \"\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BmpStringValueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.value;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nexport class BmpString extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"BmpString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalBmpStringValueBlock);\n\n\t\tif(VALUE in parameters)\n\t\t\tthis.fromString(parameters.value);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 30; // BmpString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"BMPString\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tconst copyBuffer = inputBuffer.slice(0);\n\t\tconst valueView = new Uint8Array(copyBuffer);\n\n\t\tfor(let i = 0; i < valueView.length; i += 2)\n\t\t{\n\t\t\tconst temp = valueView[i];\n\n\t\t\tvalueView[i] = valueView[i + 1];\n\t\t\tvalueView[i + 1] = temp;\n\t\t}\n\n\t\tthis.valueBlock.value = String.fromCharCode.apply(null, new Uint16Array(copyBuffer));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\tconst strLength = inputString.length;\n\n\t\tthis.valueBlock.valueHex = new ArrayBuffer(strLength * 2);\n\t\tconst valueHexView = new Uint8Array(this.valueBlock.valueHex);\n\n\t\tfor(let i = 0; i < strLength; i++)\n\t\t{\n\t\t\tconst codeBuf = utilToBase(inputString.charCodeAt(i), 8);\n\t\t\tconst codeView = new Uint8Array(codeBuf);\n\t\t\tif(codeView.length > 2)\n\t\t\t\tcontinue;\n\n\t\t\tconst dif = 2 - codeView.length;\n\n\t\t\tfor(let j = (codeView.length - 1); j >= 0; j--)\n\t\t\t\tvalueHexView[i * 2 + j + dif] = codeView[j];\n\t\t}\n\n\t\tthis.valueBlock.value = inputString;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.value}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nclass LocalUniversalStringValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalUniversalStringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.isHexOnly = true;\n\t\tthis.value = \"\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"UniversalStringValueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.value;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nexport class UniversalString extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"UniversalString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalUniversalStringValueBlock);\n\n\t\tif(VALUE in parameters)\n\t\t\tthis.fromString(parameters.value);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 28; // UniversalString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"UniversalString\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tconst copyBuffer = inputBuffer.slice(0);\n\t\tconst valueView = new Uint8Array(copyBuffer);\n\n\t\tfor(let i = 0; i < valueView.length; i += 4)\n\t\t{\n\t\t\tvalueView[i] = valueView[i + 3];\n\t\t\tvalueView[i + 1] = valueView[i + 2];\n\t\t\tvalueView[i + 2] = 0x00;\n\t\t\tvalueView[i + 3] = 0x00;\n\t\t}\n\n\t\tthis.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(copyBuffer));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\tconst strLength = inputString.length;\n\n\t\tthis.valueBlock.valueHex = new ArrayBuffer(strLength * 4);\n\t\tconst valueHexView = new Uint8Array(this.valueBlock.valueHex);\n\n\t\tfor(let i = 0; i < strLength; i++)\n\t\t{\n\t\t\tconst codeBuf = utilToBase(inputString.charCodeAt(i), 8);\n\t\t\tconst codeView = new Uint8Array(codeBuf);\n\t\t\tif(codeView.length > 4)\n\t\t\t\tcontinue;\n\n\t\t\tconst dif = 4 - codeView.length;\n\n\t\t\tfor(let j = (codeView.length - 1); j >= 0; j--)\n\t\t\t\tvalueHexView[i * 4 + j + dif] = codeView[j];\n\t\t}\n\n\t\tthis.valueBlock.value = inputString;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.value}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\nclass LocalSimpleStringValueBlock extends HexBlock(LocalBaseBlock)\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalSimpleStringValueBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.value = \"\";\n\t\tthis.isHexOnly = true;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"SimpleStringValueBlock\";\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.value = this.value;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends BaseBlock\n */\nclass LocalSimpleStringBlock extends BaseBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"LocalSimpleStringBlock\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters, LocalSimpleStringValueBlock);\n\n\t\tif(VALUE in parameters)\n\t\t\tthis.fromString(parameters.value);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"SIMPLESTRING\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\tthis.valueBlock.value = String.fromCharCode.apply(null, new Uint8Array(inputBuffer));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\tconst strLen = inputString.length;\n\n\t\tthis.valueBlock.valueHex = new ArrayBuffer(strLen);\n\t\tconst view = new Uint8Array(this.valueBlock.valueHex);\n\n\t\tfor(let i = 0; i < strLen; i++)\n\t\t\tview[i] = inputString.charCodeAt(i);\n\n\t\tthis.valueBlock.value = inputString;\n\t}\n\t//**********************************************************************************\n\ttoString()\n\t{\n\t\treturn `${this.constructor.blockName()} : ${this.valueBlock.value}`;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class NumericString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"NumericString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 18; // NumericString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"NumericString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class PrintableString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"PrintableString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 19; // PrintableString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"PrintableString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class TeletexString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"TeletexString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 20; // TeletexString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"TeletexString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class VideotexString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"VideotexString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 21; // VideotexString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"VideotexString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class IA5String extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"IA5String\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 22; // IA5String\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"IA5String\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class GraphicString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"GraphicString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 25; // GraphicString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"GraphicString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class VisibleString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"VisibleString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 26; // VisibleString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"VisibleString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class GeneralString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"GeneralString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 27; // GeneralString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"GeneralString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends LocalSimpleStringBlock\n */\nexport class CharacterString extends LocalSimpleStringBlock\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"CharacterString\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 29; // CharacterString\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"CharacterString\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of all date and time classes\n//**************************************************************************************\n/**\n * @extends VisibleString\n */\nexport class UTCTime extends VisibleString\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"UTCTime\" class\n\t * @param {Object} [parameters={}]\n\t * @property {string} [value] String representatio of the date\n\t * @property {Date} [valueDate] JavaScript \"Date\" object\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.year = 0;\n\t\tthis.month = 0;\n\t\tthis.day = 0;\n\t\tthis.hour = 0;\n\t\tthis.minute = 0;\n\t\tthis.second = 0;\n\n\t\t//#region Create UTCTime from ASN.1 UTC string value\n\t\tif(VALUE in parameters)\n\t\t{\n\t\t\tthis.fromString(parameters.value);\n\n\t\t\tthis.valueBlock.valueHex = new ArrayBuffer(parameters.value.length);\n\t\t\tconst view = new Uint8Array(this.valueBlock.valueHex);\n\n\t\t\tfor(let i = 0; i < parameters.value.length; i++)\n\t\t\t\tview[i] = parameters.value.charCodeAt(i);\n\t\t}\n\t\t//#endregion\n\t\t//#region Create GeneralizedTime from JavaScript Date type\n\t\tif(VALUE_DATE in parameters)\n\t\t{\n\t\t\tthis.fromDate(parameters.valueDate);\n\t\t\tthis.valueBlock.valueHex = this.toBuffer();\n\t\t}\n\t\t//#endregion\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 23; // UTCTime\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\tthis.fromString(String.fromCharCode.apply(null, new Uint8Array(inputBuffer)));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ASN.1 internal string into ArrayBuffer\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBuffer()\n\t{\n\t\tconst str = this.toString();\n\n\t\tconst buffer = new ArrayBuffer(str.length);\n\t\tconst view = new Uint8Array(buffer);\n\n\t\tfor(let i = 0; i < str.length; i++)\n\t\t\tview[i] = str.charCodeAt(i);\n\n\t\treturn buffer;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting \"Date\" object into ASN.1 internal string\n\t * @param {!Date} inputDate JavaScript \"Date\" object\n\t */\n\tfromDate(inputDate)\n\t{\n\t\tthis.year = inputDate.getUTCFullYear();\n\t\tthis.month = inputDate.getUTCMonth() + 1;\n\t\tthis.day = inputDate.getUTCDate();\n\t\tthis.hour = inputDate.getUTCHours();\n\t\tthis.minute = inputDate.getUTCMinutes();\n\t\tthis.second = inputDate.getUTCSeconds();\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Function converting ASN.1 internal string into \"Date\" object\n\t * @returns {Date}\n\t */\n\ttoDate()\n\t{\n\t\treturn (new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second)));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\t//#region Parse input string\n\t\tconst parser = /(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})Z/ig;\n\t\tconst parserArray = parser.exec(inputString);\n\t\tif(parserArray === null)\n\t\t{\n\t\t\tthis.error = \"Wrong input string for conversion\";\n\t\t\treturn;\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Store parsed values\n\t\tconst year = parseInt(parserArray[1], 10);\n\t\tif(year >= 50)\n\t\t\tthis.year = 1900 + year;\n\t\telse\n\t\t\tthis.year = 2000 + year;\n\n\t\tthis.month = parseInt(parserArray[2], 10);\n\t\tthis.day = parseInt(parserArray[3], 10);\n\t\tthis.hour = parseInt(parserArray[4], 10);\n\t\tthis.minute = parseInt(parserArray[5], 10);\n\t\tthis.second = parseInt(parserArray[6], 10);\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ASN.1 internal class into JavaScript string\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tconst outputArray = new Array(7);\n\n\t\toutputArray[0] = padNumber(((this.year < 2000) ? (this.year - 1900) : (this.year - 2000)), 2);\n\t\toutputArray[1] = padNumber(this.month, 2);\n\t\toutputArray[2] = padNumber(this.day, 2);\n\t\toutputArray[3] = padNumber(this.hour, 2);\n\t\toutputArray[4] = padNumber(this.minute, 2);\n\t\toutputArray[5] = padNumber(this.second, 2);\n\t\toutputArray[6] = \"Z\";\n\n\t\treturn outputArray.join(\"\");\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"UTCTime\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.year = this.year;\n\t\tobject.month = this.month;\n\t\tobject.day = this.day;\n\t\tobject.hour = this.hour;\n\t\tobject.minute = this.minute;\n\t\tobject.second = this.second;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends VisibleString\n */\nexport class GeneralizedTime extends VisibleString\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"GeneralizedTime\" class\n\t * @param {Object} [parameters={}]\n\t * @property {string} [value] String representatio of the date\n\t * @property {Date} [valueDate] JavaScript \"Date\" object\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.year = 0;\n\t\tthis.month = 0;\n\t\tthis.day = 0;\n\t\tthis.hour = 0;\n\t\tthis.minute = 0;\n\t\tthis.second = 0;\n\t\tthis.millisecond = 0;\n\n\t\t//#region Create UTCTime from ASN.1 UTC string value\n\t\tif(VALUE in parameters)\n\t\t{\n\t\t\tthis.fromString(parameters.value);\n\n\t\t\tthis.valueBlock.valueHex = new ArrayBuffer(parameters.value.length);\n\t\t\tconst view = new Uint8Array(this.valueBlock.valueHex);\n\n\t\t\tfor(let i = 0; i < parameters.value.length; i++)\n\t\t\t\tview[i] = parameters.value.charCodeAt(i);\n\t\t}\n\t\t//#endregion\n\t\t//#region Create GeneralizedTime from JavaScript Date type\n\t\tif(VALUE_DATE in parameters)\n\t\t{\n\t\t\tthis.fromDate(parameters.valueDate);\n\t\t\tthis.valueBlock.valueHex = this.toBuffer();\n\t\t}\n\t\t//#endregion\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 24; // GeneralizedTime\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tconst resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, (this.lenBlock.isIndefiniteForm === true) ? inputLength : this.lenBlock.length);\n\t\tif(resultOffset === (-1))\n\t\t{\n\t\t\tthis.error = this.valueBlock.error;\n\t\t\treturn resultOffset;\n\t\t}\n\n\t\tthis.fromBuffer(this.valueBlock.valueHex);\n\n\t\tif(this.idBlock.error.length === 0)\n\t\t\tthis.blockLength += this.idBlock.blockLength;\n\n\t\tif(this.lenBlock.error.length === 0)\n\t\t\tthis.blockLength += this.lenBlock.blockLength;\n\n\t\tif(this.valueBlock.error.length === 0)\n\t\t\tthis.blockLength += this.valueBlock.blockLength;\n\n\t\treturn resultOffset;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ArrayBuffer into ASN.1 internal string\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t */\n\tfromBuffer(inputBuffer)\n\t{\n\t\tthis.fromString(String.fromCharCode.apply(null, new Uint8Array(inputBuffer)));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ASN.1 internal string into ArrayBuffer\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBuffer()\n\t{\n\t\tconst str = this.toString();\n\n\t\tconst buffer = new ArrayBuffer(str.length);\n\t\tconst view = new Uint8Array(buffer);\n\n\t\tfor(let i = 0; i < str.length; i++)\n\t\t\tview[i] = str.charCodeAt(i);\n\n\t\treturn buffer;\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting \"Date\" object into ASN.1 internal string\n\t * @param {!Date} inputDate JavaScript \"Date\" object\n\t */\n\tfromDate(inputDate)\n\t{\n\t\tthis.year = inputDate.getUTCFullYear();\n\t\tthis.month = inputDate.getUTCMonth() + 1;\n\t\tthis.day = inputDate.getUTCDate();\n\t\tthis.hour = inputDate.getUTCHours();\n\t\tthis.minute = inputDate.getUTCMinutes();\n\t\tthis.second = inputDate.getUTCSeconds();\n\t\tthis.millisecond = inputDate.getUTCMilliseconds();\n\t}\n\t//**********************************************************************************\n\t//noinspection JSUnusedGlobalSymbols\n\t/**\n\t * Function converting ASN.1 internal string into \"Date\" object\n\t * @returns {Date}\n\t */\n\ttoDate()\n\t{\n\t\treturn (new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)));\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting JavaScript string into ASN.1 internal class\n\t * @param {!string} inputString ASN.1 BER encoded array\n\t */\n\tfromString(inputString)\n\t{\n\t\t//#region Initial variables\n\t\tlet isUTC = false;\n\n\t\tlet timeString = \"\";\n\t\tlet dateTimeString = \"\";\n\t\tlet fractionPart = 0;\n\n\t\tlet parser;\n\n\t\tlet hourDifference = 0;\n\t\tlet minuteDifference = 0;\n\t\t//#endregion\n\n\t\t//#region Convert as UTC time\n\t\tif(inputString[inputString.length - 1] === \"Z\")\n\t\t{\n\t\t\ttimeString = inputString.substr(0, inputString.length - 1);\n\n\t\t\tisUTC = true;\n\t\t}\n\t\t//#endregion\n\t\t//#region Convert as local time\n\t\telse\n\t\t{\n\t\t\t//noinspection JSPrimitiveTypeWrapperUsage\n\t\t\tconst number = new Number(inputString[inputString.length - 1]);\n\n\t\t\tif(isNaN(number.valueOf()))\n\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\ttimeString = inputString;\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Check that we do not have a \"+\" and \"-\" symbols inside UTC time\n\t\tif(isUTC)\n\t\t{\n\t\t\tif(timeString.indexOf(\"+\") !== (-1))\n\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\tif(timeString.indexOf(\"-\") !== (-1))\n\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\t\t}\n\t\t//#endregion\n\t\t//#region Get \"UTC time difference\" in case of local time\n\t\telse\n\t\t{\n\t\t\tlet multiplier = 1;\n\t\t\tlet differencePosition = timeString.indexOf(\"+\");\n\t\t\tlet differenceString = \"\";\n\n\t\t\tif(differencePosition === (-1))\n\t\t\t{\n\t\t\t\tdifferencePosition = timeString.indexOf(\"-\");\n\t\t\t\tmultiplier = (-1);\n\t\t\t}\n\n\t\t\tif(differencePosition !== (-1))\n\t\t\t{\n\t\t\t\tdifferenceString = timeString.substr(differencePosition + 1);\n\t\t\t\ttimeString = timeString.substr(0, differencePosition);\n\n\t\t\t\tif((differenceString.length !== 2) && (differenceString.length !== 4))\n\t\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\t\t//noinspection JSPrimitiveTypeWrapperUsage\n\t\t\t\tlet number = new Number(differenceString.substr(0, 2));\n\n\t\t\t\tif(isNaN(number.valueOf()))\n\t\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\t\thourDifference = multiplier * number;\n\n\t\t\t\tif(differenceString.length === 4)\n\t\t\t\t{\n\t\t\t\t\t//noinspection JSPrimitiveTypeWrapperUsage\n\t\t\t\t\tnumber = new Number(differenceString.substr(2, 2));\n\n\t\t\t\t\tif(isNaN(number.valueOf()))\n\t\t\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\t\t\tminuteDifference = multiplier * number;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Get position of fraction point\n\t\tlet fractionPointPosition = timeString.indexOf(\".\"); // Check for \"full stop\" symbol\n\t\tif(fractionPointPosition === (-1))\n\t\t\tfractionPointPosition = timeString.indexOf(\",\"); // Check for \"comma\" symbol\n\t\t//#endregion\n\n\t\t//#region Get fraction part\n\t\tif(fractionPointPosition !== (-1))\n\t\t{\n\t\t\t//noinspection JSPrimitiveTypeWrapperUsage\n\t\t\tconst fractionPartCheck = new Number(`0${timeString.substr(fractionPointPosition)}`);\n\n\t\t\tif(isNaN(fractionPartCheck.valueOf()))\n\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\t\tfractionPart = fractionPartCheck.valueOf();\n\n\t\t\tdateTimeString = timeString.substr(0, fractionPointPosition);\n\t\t}\n\t\telse\n\t\t\tdateTimeString = timeString;\n\t\t//#endregion\n\n\t\t//#region Parse internal date\n\t\tswitch(true)\n\t\t{\n\t\t\tcase (dateTimeString.length === 8): // \"YYYYMMDD\"\n\t\t\t\tparser = /(\\d{4})(\\d{2})(\\d{2})/ig;\n\t\t\t\tif(fractionPointPosition !== (-1))\n\t\t\t\t\tthrow new Error(\"Wrong input string for conversion\"); // Here we should not have a \"fraction point\"\n\t\t\t\tbreak;\n\t\t\tcase (dateTimeString.length === 10): // \"YYYYMMDDHH\"\n\t\t\t\tparser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})/ig;\n\n\t\t\t\tif(fractionPointPosition !== (-1))\n\t\t\t\t{\n\t\t\t\t\tlet fractionResult = 60 * fractionPart;\n\t\t\t\t\tthis.minute = Math.floor(fractionResult);\n\n\t\t\t\t\tfractionResult = 60 * (fractionResult - this.minute);\n\t\t\t\t\tthis.second = Math.floor(fractionResult);\n\n\t\t\t\t\tfractionResult = 1000 * (fractionResult - this.second);\n\t\t\t\t\tthis.millisecond = Math.floor(fractionResult);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase (dateTimeString.length === 12): // \"YYYYMMDDHHMM\"\n\t\t\t\tparser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/ig;\n\n\t\t\t\tif(fractionPointPosition !== (-1))\n\t\t\t\t{\n\t\t\t\t\tlet fractionResult = 60 * fractionPart;\n\t\t\t\t\tthis.second = Math.floor(fractionResult);\n\n\t\t\t\t\tfractionResult = 1000 * (fractionResult - this.second);\n\t\t\t\t\tthis.millisecond = Math.floor(fractionResult);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase (dateTimeString.length === 14): // \"YYYYMMDDHHMMSS\"\n\t\t\t\tparser = /(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/ig;\n\n\t\t\t\tif(fractionPointPosition !== (-1))\n\t\t\t\t{\n\t\t\t\t\tconst fractionResult = 1000 * fractionPart;\n\t\t\t\t\tthis.millisecond = Math.floor(fractionResult);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Put parsed values at right places\n\t\tconst parserArray = parser.exec(dateTimeString);\n\t\tif(parserArray === null)\n\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\n\t\tfor(let j = 1; j < parserArray.length; j++)\n\t\t{\n\t\t\tswitch(j)\n\t\t\t{\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.year = parseInt(parserArray[j], 10);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.month = parseInt(parserArray[j], 10);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.day = parseInt(parserArray[j], 10);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.hour = parseInt(parserArray[j], 10) + hourDifference;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tthis.minute = parseInt(parserArray[j], 10) + minuteDifference;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tthis.second = parseInt(parserArray[j], 10);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(\"Wrong input string for conversion\");\n\t\t\t}\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Get final date\n\t\tif(isUTC === false)\n\t\t{\n\t\t\tconst tempDate = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);\n\n\t\t\tthis.year = tempDate.getUTCFullYear();\n\t\t\tthis.month = tempDate.getUTCMonth();\n\t\t\tthis.day = tempDate.getUTCDay();\n\t\t\tthis.hour = tempDate.getUTCHours();\n\t\t\tthis.minute = tempDate.getUTCMinutes();\n\t\t\tthis.second = tempDate.getUTCSeconds();\n\t\t\tthis.millisecond = tempDate.getUTCMilliseconds();\n\t\t}\n\t\t//#endregion\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Function converting ASN.1 internal class into JavaScript string\n\t * @returns {string}\n\t */\n\ttoString()\n\t{\n\t\tconst outputArray = [];\n\n\t\toutputArray.push(padNumber(this.year, 4));\n\t\toutputArray.push(padNumber(this.month, 2));\n\t\toutputArray.push(padNumber(this.day, 2));\n\t\toutputArray.push(padNumber(this.hour, 2));\n\t\toutputArray.push(padNumber(this.minute, 2));\n\t\toutputArray.push(padNumber(this.second, 2));\n\t\tif(this.millisecond !== 0)\n\t\t{\n\t\t\toutputArray.push(\".\");\n\t\t\toutputArray.push(padNumber(this.millisecond, 3));\n\t\t}\n\t\toutputArray.push(\"Z\");\n\n\t\treturn outputArray.join(\"\");\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"GeneralizedTime\";\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Conversion for the block to JSON object\n\t * @returns {Object}\n\t */\n\ttoJSON()\n\t{\n\t\tlet object = {};\n\n\t\t//#region Seems at the moment (Sep 2016) there is no way how to check method is supported in \"super\" object\n\t\ttry\n\t\t{\n\t\t\tobject = super.toJSON();\n\t\t}\n\t\tcatch(ex) { }\n\t\t//#endregion\n\n\t\tobject.year = this.year;\n\t\tobject.month = this.month;\n\t\tobject.day = this.day;\n\t\tobject.hour = this.hour;\n\t\tobject.minute = this.minute;\n\t\tobject.second = this.second;\n\t\tobject.millisecond = this.millisecond;\n\n\t\treturn object;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends Utf8String\n */\nexport class DATE extends Utf8String\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"DATE\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 31; // DATE\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"DATE\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends Utf8String\n */\nexport class TimeOfDay extends Utf8String\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"TimeOfDay\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 32; // TimeOfDay\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"TimeOfDay\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends Utf8String\n */\nexport class DateTime extends Utf8String\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"DateTime\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 33; // DateTime\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"DateTime\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends Utf8String\n */\nexport class Duration extends Utf8String\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Duration\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 34; // Duration\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"Duration\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n/**\n * @extends Utf8String\n */\nexport class TIME extends Utf8String\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Time\" class\n\t * @param {Object} [parameters={}]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tsuper(parameters);\n\n\t\tthis.idBlock.tagClass = 1; // UNIVERSAL\n\t\tthis.idBlock.tagNumber = 14; // Time\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Aux function, need to get a block name. Need to have it here for inheritance\n\t * @returns {string}\n\t */\n\tstatic blockName()\n\t{\n\t\treturn \"TIME\";\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of special ASN.1 schema type Choice\n//**************************************************************************************\nexport class Choice\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Choice\" class\n\t * @param {Object} [parameters={}]\n\t * @property {Array} [value] Array of ASN.1 types for make a choice from\n\t * @property {boolean} [optional]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tthis.value = getParametersValue(parameters, VALUE, []);\n\t\tthis.optional = getParametersValue(parameters, OPTIONAL, false);\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of special ASN.1 schema type Any\n//**************************************************************************************\nexport class Any\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Any\" class\n\t * @param {Object} [parameters={}]\n\t * @property {string} [name]\n\t * @property {boolean} [optional]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tthis.name = getParametersValue(parameters, NAME, EMPTY_STRING);\n\t\tthis.optional = getParametersValue(parameters, OPTIONAL, false);\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of special ASN.1 schema type Repeated\n//**************************************************************************************\nexport class Repeated\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Repeated\" class\n\t * @param {Object} [parameters={}]\n\t * @property {string} [name]\n\t * @property {boolean} [optional]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tthis.name = getParametersValue(parameters, NAME, EMPTY_STRING);\n\t\tthis.optional = getParametersValue(parameters, OPTIONAL, false);\n\t\tthis.value = getParametersValue(parameters, VALUE, new Any());\n\t\tthis.local = getParametersValue(parameters, LOCAL, false); // Could local or global array to store elements\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Declaration of special ASN.1 schema type RawData\n//**************************************************************************************\n/**\n * @description Special class providing ability to have \"toBER/fromBER\" for raw ArrayBuffer\n */\nexport class RawData\n{\n\t//**********************************************************************************\n\t/**\n\t * Constructor for \"Repeated\" class\n\t * @param {Object} [parameters={}]\n\t * @property {string} [name]\n\t * @property {boolean} [optional]\n\t */\n\tconstructor(parameters = {})\n\t{\n\t\tthis.data = getParametersValue(parameters, DATA, EMPTY_BUFFER);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Base function for converting block from BER encoded array of bytes\n\t * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n\t * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n\t * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n\t * @returns {number} Offset after least decoded byte\n\t */\n\tfromBER(inputBuffer, inputOffset, inputLength)\n\t{\n\t\tthis.data = inputBuffer.slice(inputOffset, inputLength);\n\t\treturn (inputOffset + inputLength);\n\t}\n\t//**********************************************************************************\n\t/**\n\t * Encoding of current ASN.1 block into ASN.1 encoded array (BER rules)\n\t * @param {boolean} [sizeOnly=false] Flag that we need only a size of encoding, not a real array of bytes\n\t * @returns {ArrayBuffer}\n\t */\n\ttoBER(sizeOnly = false)\n\t{\n\t\treturn this.data;\n\t}\n\t//**********************************************************************************\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Major ASN.1 BER decoding function\n//**************************************************************************************\n/**\n * Internal library function for decoding ASN.1 BER\n * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array\n * @param {!number} inputOffset Offset in ASN.1 BER encoded array where decoding should be started\n * @param {!number} inputLength Maximum length of array of bytes which can be using in this function\n * @returns {{offset: number, result: Object}}\n */\nfunction LocalFromBER(inputBuffer, inputOffset, inputLength)\n{\n\tconst incomingOffset = inputOffset; // Need to store initial offset since \"inputOffset\" is changing in the function\n\n\t//#region Local function changing a type for ASN.1 classes\n\tfunction localChangeType(inputObject, newType)\n\t{\n\t\tif(inputObject instanceof newType)\n\t\t\treturn inputObject;\n\n\t\tconst newObject = new newType();\n\t\tnewObject.idBlock = inputObject.idBlock;\n\t\tnewObject.lenBlock = inputObject.lenBlock;\n\t\tnewObject.warnings = inputObject.warnings;\n\t\t//noinspection JSCheckFunctionSignatures\n\t\tnewObject.valueBeforeDecode = inputObject.valueBeforeDecode.slice(0);\n\n\t\treturn newObject;\n\t}\n\t//#endregion\n\n\t//#region Create a basic ASN.1 type since we need to return errors and warnings from the function\n\tlet returnObject = new BaseBlock({}, Object);\n\t//#endregion\n\n\t//#region Basic check for parameters\n\tconst baseBlock = new LocalBaseBlock();\n\tif(checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) === false)\n\t{\n\t\treturnObject.error = baseBlock.error;\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult: returnObject\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Getting Uint8Array from ArrayBuffer\n\tconst intBuffer = new Uint8Array(inputBuffer, inputOffset, inputLength);\n\t//#endregion\n\n\t//#region Initial checks\n\tif(intBuffer.length === 0)\n\t{\n\t\treturnObject.error = \"Zero buffer length\";\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult: returnObject\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Decode identification block of ASN.1 BER structure\n\tlet resultOffset = returnObject.idBlock.fromBER(inputBuffer, inputOffset, inputLength);\n\treturnObject.warnings.concat(returnObject.idBlock.warnings);\n\tif(resultOffset === (-1))\n\t{\n\t\treturnObject.error = returnObject.idBlock.error;\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult: returnObject\n\t\t};\n\t}\n\n\tinputOffset = resultOffset;\n\tinputLength -= returnObject.idBlock.blockLength;\n\t//#endregion\n\n\t//#region Decode length block of ASN.1 BER structure\n\tresultOffset = returnObject.lenBlock.fromBER(inputBuffer, inputOffset, inputLength);\n\treturnObject.warnings.concat(returnObject.lenBlock.warnings);\n\tif(resultOffset === (-1))\n\t{\n\t\treturnObject.error = returnObject.lenBlock.error;\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult: returnObject\n\t\t};\n\t}\n\n\tinputOffset = resultOffset;\n\tinputLength -= returnObject.lenBlock.blockLength;\n\t//#endregion\n\n\t//#region Check for using indefinite length form in encoding for primitive types\n\tif((returnObject.idBlock.isConstructed === false) &&\n\t\t(returnObject.lenBlock.isIndefiniteForm === true))\n\t{\n\t\treturnObject.error = \"Indefinite length form used for primitive encoding form\";\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult: returnObject\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Switch ASN.1 block type\n\tlet newASN1Type = BaseBlock;\n\n\tswitch(returnObject.idBlock.tagClass)\n\t{\n\t\t//#region UNIVERSAL\n\t\tcase 1:\n\t\t\t//#region Check for reserved tag numbers\n\t\t\tif((returnObject.idBlock.tagNumber >= 37) &&\n\t\t\t\t(returnObject.idBlock.isHexOnly === false))\n\t\t\t{\n\t\t\t\treturnObject.error = \"UNIVERSAL 37 and upper tags are reserved by ASN.1 standard\";\n\t\t\t\treturn {\n\t\t\t\t\toffset: (-1),\n\t\t\t\t\tresult: returnObject\n\t\t\t\t};\n\t\t\t}\n\t\t\t//#endregion\n\n\t\t\tswitch(returnObject.idBlock.tagNumber)\n\t\t\t{\n\t\t\t\t//#region EndOfContent type\n\t\t\t\tcase 0:\n\t\t\t\t\t//#region Check for EndOfContent type\n\t\t\t\t\tif((returnObject.idBlock.isConstructed === true) &&\n\t\t\t\t\t\t(returnObject.lenBlock.length > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\treturnObject.error = \"Type [UNIVERSAL 0] is reserved\";\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\toffset: (-1),\n\t\t\t\t\t\t\tresult: returnObject\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t//#endregion\n\n\t\t\t\t\tnewASN1Type = EndOfContent;\n\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Boolean type\n\t\t\t\tcase 1:\n\t\t\t\t\tnewASN1Type = Boolean;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Integer type\n\t\t\t\tcase 2:\n\t\t\t\t\tnewASN1Type = Integer;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region BitString type\n\t\t\t\tcase 3:\n\t\t\t\t\tnewASN1Type = BitString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region OctetString type\n\t\t\t\tcase 4:\n\t\t\t\t\tnewASN1Type = OctetString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Null type\n\t\t\t\tcase 5:\n\t\t\t\t\tnewASN1Type = Null;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region OBJECT IDENTIFIER type\n\t\t\t\tcase 6:\n\t\t\t\t\tnewASN1Type = ObjectIdentifier;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Enumerated type\n\t\t\t\tcase 10:\n\t\t\t\t\tnewASN1Type = Enumerated;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Utf8String type\n\t\t\t\tcase 12:\n\t\t\t\t\tnewASN1Type = Utf8String;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Time type\n\t\t\t\t//#region RELATIVE OBJECT IDENTIFIER type\n\t\t\t\tcase 13:\n\t\t\t\t\tnewASN1Type = RelativeObjectIdentifier;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\tcase 14:\n\t\t\t\t\tnewASN1Type = TIME;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region ASN.1 reserved type\n\t\t\t\tcase 15:\n\t\t\t\t\treturnObject.error = \"[UNIVERSAL 15] is reserved by ASN.1 standard\";\n\t\t\t\t\treturn {\n\t\t\t\t\t\toffset: (-1),\n\t\t\t\t\t\tresult: returnObject\n\t\t\t\t\t};\n\t\t\t\t//#endregion\n\t\t\t\t//#region Sequence type\n\t\t\t\tcase 16:\n\t\t\t\t\tnewASN1Type = Sequence;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Set type\n\t\t\t\tcase 17:\n\t\t\t\t\tnewASN1Type = Set;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region NumericString type\n\t\t\t\tcase 18:\n\t\t\t\t\tnewASN1Type = NumericString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region PrintableString type\n\t\t\t\tcase 19:\n\t\t\t\t\tnewASN1Type = PrintableString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region TeletexString type\n\t\t\t\tcase 20:\n\t\t\t\t\tnewASN1Type = TeletexString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region VideotexString type\n\t\t\t\tcase 21:\n\t\t\t\t\tnewASN1Type = VideotexString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region IA5String type\n\t\t\t\tcase 22:\n\t\t\t\t\tnewASN1Type = IA5String;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region UTCTime type\n\t\t\t\tcase 23:\n\t\t\t\t\tnewASN1Type = UTCTime;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region GeneralizedTime type\n\t\t\t\tcase 24:\n\t\t\t\t\tnewASN1Type = GeneralizedTime;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region GraphicString type\n\t\t\t\tcase 25:\n\t\t\t\t\tnewASN1Type = GraphicString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region VisibleString type\n\t\t\t\tcase 26:\n\t\t\t\t\tnewASN1Type = VisibleString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region GeneralString type\n\t\t\t\tcase 27:\n\t\t\t\t\tnewASN1Type = GeneralString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region UniversalString type\n\t\t\t\tcase 28:\n\t\t\t\t\tnewASN1Type = UniversalString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region CharacterString type\n\t\t\t\tcase 29:\n\t\t\t\t\tnewASN1Type = CharacterString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region BmpString type\n\t\t\t\tcase 30:\n\t\t\t\t\tnewASN1Type = BmpString;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region DATE type\n\t\t\t\tcase 31:\n\t\t\t\t\tnewASN1Type = DATE;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region TimeOfDay type\n\t\t\t\tcase 32:\n\t\t\t\t\tnewASN1Type = TimeOfDay;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Date-Time type\n\t\t\t\tcase 33:\n\t\t\t\t\tnewASN1Type = DateTime;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region Duration type\n\t\t\t\tcase 34:\n\t\t\t\t\tnewASN1Type = Duration;\n\t\t\t\t\tbreak;\n\t\t\t\t//#endregion\n\t\t\t\t//#region default\n\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tlet newObject;\n\n\t\t\t\t\t\tif(returnObject.idBlock.isConstructed === true)\n\t\t\t\t\t\t\tnewObject = new Constructed();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnewObject = new Primitive();\n\n\t\t\t\t\t\tnewObject.idBlock = returnObject.idBlock;\n\t\t\t\t\t\tnewObject.lenBlock = returnObject.lenBlock;\n\t\t\t\t\t\tnewObject.warnings = returnObject.warnings;\n\n\t\t\t\t\t\treturnObject = newObject;\n\t\t\t\t\t}\n\t\t\t\t//#endregion\n\t\t\t}\n\t\t\tbreak;\n\t\t//#endregion\n\t\t//#region All other tag classes\n\t\tcase 2: // APPLICATION\n\t\tcase 3: // CONTEXT-SPECIFIC\n\t\tcase 4: // PRIVATE\n\t\tdefault:\n\t\t\t{\n\t\t\t\tif(returnObject.idBlock.isConstructed === true)\n\t\t\t\t\tnewASN1Type = Constructed;\n\t\t\t\telse\n\t\t\t\t\tnewASN1Type = Primitive;\n\t\t\t}\n\t\t//#endregion\n\t}\n\t//#endregion\n\n\t//#region Change type and perform BER decoding\n\treturnObject = localChangeType(returnObject, newASN1Type);\n\tresultOffset = returnObject.fromBER(inputBuffer, inputOffset, (returnObject.lenBlock.isIndefiniteForm === true) ? inputLength : returnObject.lenBlock.length);\n\t//#endregion\n\n\t//#region Coping incoming buffer for entire ASN.1 block\n\treturnObject.valueBeforeDecode = inputBuffer.slice(incomingOffset, incomingOffset + returnObject.blockLength);\n\t//#endregion\n\n\treturn {\n\t\toffset: resultOffset,\n\t\tresult: returnObject\n\t};\n}\n//**************************************************************************************\n/**\n * Major function for decoding ASN.1 BER array into internal library structures\n * @param {!ArrayBuffer} inputBuffer ASN.1 BER encoded array of bytes\n */\nexport function fromBER(inputBuffer)\n{\n\tif(inputBuffer.byteLength === 0)\n\t{\n\t\tconst result = new BaseBlock({}, Object);\n\t\tresult.error = \"Input buffer has zero length\";\n\n\t\treturn {\n\t\t\toffset: (-1),\n\t\t\tresult\n\t\t};\n\t}\n\n\treturn LocalFromBER(inputBuffer, 0, inputBuffer.byteLength);\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Major scheme verification function\n//**************************************************************************************\n/**\n * Compare of two ASN.1 object trees\n * @param {!Object} root Root of input ASN.1 object tree\n * @param {!Object} inputData Input ASN.1 object tree\n * @param {!Object} inputSchema Input ASN.1 schema to compare with\n * @return {{verified: boolean}|{verified:boolean, result: Object}}\n */\nexport function compareSchema(root, inputData, inputSchema)\n{\n\t//#region Special case for Choice schema element type\n\tif(inputSchema instanceof Choice)\n\t{\n\t\tconst choiceResult = false;\n\n\t\tfor(let j = 0; j < inputSchema.value.length; j++)\n\t\t{\n\t\t\tconst result = compareSchema(root, inputData, inputSchema.value[j]);\n\t\t\tif(result.verified === true)\n\t\t\t{\n\t\t\t\treturn {\n\t\t\t\t\tverified: true,\n\t\t\t\t\tresult: root\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif(choiceResult === false)\n\t\t{\n\t\t\tconst _result = {\n\t\t\t\tverified: false,\n\t\t\t\tresult: {\n\t\t\t\t\terror: \"Wrong values for Choice type\"\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t\t_result.name = inputSchema.name;\n\n\t\t\treturn _result;\n\t\t}\n\t}\n\t//#endregion\n\n\t//#region Special case for Any schema element type\n\tif(inputSchema instanceof Any)\n\t{\n\t\t//#region Add named component of ASN.1 schema\n\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\troot[inputSchema.name] = inputData;\n\t\t//#endregion\n\n\t\treturn {\n\t\t\tverified: true,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Initial check\n\tif((root instanceof Object) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong root object\" }\n\t\t};\n\t}\n\n\tif((inputData instanceof Object) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 data\" }\n\t\t};\n\t}\n\n\tif((inputSchema instanceof Object) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif((ID_BLOCK in inputSchema) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Comparing idBlock properties in ASN.1 data and ASN.1 schema\n\t//#region Encode and decode ASN.1 schema idBlock\n\t/// This encoding/decoding is necessary because could be an errors in schema definition\n\tif((FROM_BER in inputSchema.idBlock) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif((TO_BER in inputSchema.idBlock) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tconst encodedId = inputSchema.idBlock.toBER(false);\n\tif(encodedId.byteLength === 0)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Error encoding idBlock for ASN.1 schema\" }\n\t\t};\n\t}\n\n\tconst decodedOffset = inputSchema.idBlock.fromBER(encodedId, 0, encodedId.byteLength);\n\tif(decodedOffset === (-1))\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Error decoding idBlock for ASN.1 schema\" }\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region tagClass\n\tif(inputSchema.idBlock.hasOwnProperty(TAG_CLASS) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif(inputSchema.idBlock.tagClass !== inputData.idBlock.tagClass)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\t//#region tagNumber\n\tif(inputSchema.idBlock.hasOwnProperty(TAG_NUMBER) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif(inputSchema.idBlock.tagNumber !== inputData.idBlock.tagNumber)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\t//#region isConstructed\n\tif(inputSchema.idBlock.hasOwnProperty(IS_CONSTRUCTED) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif(inputSchema.idBlock.isConstructed !== inputData.idBlock.isConstructed)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\t//#region isHexOnly\n\tif((IS_HEX_ONLY in inputSchema.idBlock) === false) // Since 'isHexOnly' is an inherited property\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t};\n\t}\n\n\tif(inputSchema.idBlock.isHexOnly !== inputData.idBlock.isHexOnly)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\t//#region valueHex\n\tif(inputSchema.idBlock.isHexOnly === true)\n\t{\n\t\tif((VALUE_HEX in inputSchema.idBlock) === false) // Since 'valueHex' is an inherited property\n\t\t{\n\t\t\treturn {\n\t\t\t\tverified: false,\n\t\t\t\tresult: { error: \"Wrong ASN.1 schema\" }\n\t\t\t};\n\t\t}\n\n\t\tconst schemaView = new Uint8Array(inputSchema.idBlock.valueHex);\n\t\tconst asn1View = new Uint8Array(inputData.idBlock.valueHex);\n\n\t\tif(schemaView.length !== asn1View.length)\n\t\t{\n\t\t\treturn {\n\t\t\t\tverified: false,\n\t\t\t\tresult: root\n\t\t\t};\n\t\t}\n\n\t\tfor(let i = 0; i < schemaView.length; i++)\n\t\t{\n\t\t\tif(schemaView[i] !== asn1View[1])\n\t\t\t{\n\t\t\t\treturn {\n\t\t\t\t\tverified: false,\n\t\t\t\t\tresult: root\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n\t//#endregion\n\t//#endregion\n\n\t//#region Add named component of ASN.1 schema\n\tif(inputSchema.hasOwnProperty(NAME))\n\t{\n\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\tif(inputSchema.name !== \"\")\n\t\t\troot[inputSchema.name] = inputData;\n\t}\n\t//#endregion\n\n\t//#region Getting next ASN.1 block for comparison\n\tif(inputSchema.idBlock.isConstructed === true)\n\t{\n\t\tlet admission = 0;\n\t\tlet result = { verified: false };\n\n\t\tlet maxLength = inputSchema.valueBlock.value.length;\n\n\t\tif(maxLength > 0)\n\t\t{\n\t\t\tif(inputSchema.valueBlock.value[0] instanceof Repeated)\n\t\t\t\tmaxLength = inputData.valueBlock.value.length;\n\t\t}\n\n\t\t//#region Special case when constructive value has no elements\n\t\tif(maxLength === 0)\n\t\t{\n\t\t\treturn {\n\t\t\t\tverified: true,\n\t\t\t\tresult: root\n\t\t\t};\n\t\t}\n\t\t//#endregion\n\n\t\t//#region Special case when \"inputData\" has no values and \"inputSchema\" has all optional values\n\t\tif((inputData.valueBlock.value.length === 0) &&\n\t\t\t(inputSchema.valueBlock.value.length !== 0))\n\t\t{\n\t\t\tlet _optional = true;\n\n\t\t\tfor(let i = 0; i < inputSchema.valueBlock.value.length; i++)\n\t\t\t\t_optional = _optional && (inputSchema.valueBlock.value[i].optional || false);\n\n\t\t\tif(_optional === true)\n\t\t\t{\n\t\t\t\treturn {\n\t\t\t\t\tverified: true,\n\t\t\t\t\tresult: root\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t//#region Delete early added name of block\n\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t{\n\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t}\n\t\t\t//#endregion\n\n\t\t\troot.error = \"Inconsistent object length\";\n\n\t\t\treturn {\n\t\t\t\tverified: false,\n\t\t\t\tresult: root\n\t\t\t};\n\t\t}\n\t\t//#endregion\n\n\t\tfor(let i = 0; i < maxLength; i++)\n\t\t{\n\t\t\t//#region Special case when there is an OPTIONAL element of ASN.1 schema at the end\n\t\t\tif((i - admission) >= inputData.valueBlock.value.length)\n\t\t\t{\n\t\t\t\tif(inputSchema.valueBlock.value[i].optional === false)\n\t\t\t\t{\n\t\t\t\t\tconst _result = {\n\t\t\t\t\t\tverified: false,\n\t\t\t\t\t\tresult: root\n\t\t\t\t\t};\n\n\t\t\t\t\troot.error = \"Inconsistent length between ASN.1 data and schema\";\n\n\t\t\t\t\t//#region Delete early added name of block\n\t\t\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t\t\t{\n\t\t\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t\t\t\t\t_result.name = inputSchema.name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//#endregion\n\n\t\t\t\t\treturn _result;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//#endregion\n\t\t\telse\n\t\t\t{\n\t\t\t\t//#region Special case for Repeated type of ASN.1 schema element\n\t\t\t\tif(inputSchema.valueBlock.value[0] instanceof Repeated)\n\t\t\t\t{\n\t\t\t\t\tresult = compareSchema(root, inputData.valueBlock.value[i], inputSchema.valueBlock.value[0].value);\n\t\t\t\t\tif(result.verified === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(inputSchema.valueBlock.value[0].optional === true)\n\t\t\t\t\t\t\tadmission++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//#region Delete early added name of block\n\t\t\t\t\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\t\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//#endregion\n\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif((NAME in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].name.length > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tlet arrayRoot = {};\n\n\t\t\t\t\t\tif((LOCAL in inputSchema.valueBlock.value[0]) && (inputSchema.valueBlock.value[0].local === true))\n\t\t\t\t\t\t\tarrayRoot = inputData;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tarrayRoot = root;\n\n\t\t\t\t\t\tif(typeof arrayRoot[inputSchema.valueBlock.value[0].name] === \"undefined\")\n\t\t\t\t\t\t\tarrayRoot[inputSchema.valueBlock.value[0].name] = [];\n\n\t\t\t\t\t\tarrayRoot[inputSchema.valueBlock.value[0].name].push(inputData.valueBlock.value[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//#endregion\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult = compareSchema(root, inputData.valueBlock.value[i - admission], inputSchema.valueBlock.value[i]);\n\t\t\t\t\tif(result.verified === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(inputSchema.valueBlock.value[i].optional === true)\n\t\t\t\t\t\t\tadmission++;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//#region Delete early added name of block\n\t\t\t\t\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\t\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//#endregion\n\n\t\t\t\t\t\t\treturn result;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(result.verified === false) // The situation may take place if last element is OPTIONAL and verification failed\n\t\t{\n\t\t\tconst _result = {\n\t\t\t\tverified: false,\n\t\t\t\tresult: root\n\t\t\t};\n\n\t\t\t//#region Delete early added name of block\n\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t{\n\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t{\n\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t\t\t_result.name = inputSchema.name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//#endregion\n\n\t\t\treturn _result;\n\t\t}\n\n\t\treturn {\n\t\t\tverified: true,\n\t\t\tresult: root\n\t\t};\n\t}\n\t//#endregion\n\t//#region Ability to parse internal value for primitive-encoded value (value of OctetString, for example)\n\tif((PRIMITIVE_SCHEMA in inputSchema) &&\n\t\t(VALUE_HEX in inputData.valueBlock))\n\t{\n\t\t//#region Decoding of raw ASN.1 data\n\t\tconst asn1 = fromBER(inputData.valueBlock.valueHex);\n\t\tif(asn1.offset === (-1))\n\t\t{\n\t\t\tconst _result = {\n\t\t\t\tverified: false,\n\t\t\t\tresult: asn1.result\n\t\t\t};\n\n\t\t\t//#region Delete early added name of block\n\t\t\tif(inputSchema.hasOwnProperty(NAME))\n\t\t\t{\n\t\t\t\tinputSchema.name = inputSchema.name.replace(/^\\s+|\\s+$/g, EMPTY_STRING);\n\t\t\t\tif(inputSchema.name !== \"\")\n\t\t\t\t{\n\t\t\t\t\tdelete root[inputSchema.name];\n\t\t\t\t\t_result.name = inputSchema.name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//#endregion\n\n\t\t\treturn _result;\n\t\t}\n\t\t//#endregion\n\n\t\treturn compareSchema(root, asn1.result, inputSchema.primitiveSchema);\n\t}\n\n\treturn {\n\t\tverified: true,\n\t\tresult: root\n\t};\n\t//#endregion\n}\n//**************************************************************************************\n//noinspection JSUnusedGlobalSymbols\n/**\n * ASN.1 schema verification for ArrayBuffer data\n * @param {!ArrayBuffer} inputBuffer Input BER-encoded ASN.1 data\n * @param {!Object} inputSchema Input ASN.1 schema to verify against to\n * @return {{verified: boolean}|{verified:boolean, result: Object}}\n */\nexport function verifySchema(inputBuffer, inputSchema)\n{\n\t//#region Initial check\n\tif((inputSchema instanceof Object) === false)\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: { error: \"Wrong ASN.1 schema type\" }\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Decoding of raw ASN.1 data\n\tconst asn1 = fromBER(inputBuffer);\n\tif(asn1.offset === (-1))\n\t{\n\t\treturn {\n\t\t\tverified: false,\n\t\t\tresult: asn1.result\n\t\t};\n\t}\n\t//#endregion\n\n\t//#region Compare ASN.1 struct with input schema\n\treturn compareSchema(asn1.result, asn1.result, inputSchema);\n\t//#endregion\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n//#region Major function converting JSON to ASN.1 objects\n//**************************************************************************************\n//noinspection JSUnusedGlobalSymbols\n/**\n * Converting from JSON to ASN.1 objects\n * @param {string|Object} json JSON string or object to convert to ASN.1 objects\n */\nexport function fromJSON(json)\n{\n\t// TODO Implement\n}\n//**************************************************************************************\n//#endregion\n//**************************************************************************************\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n feature: {}\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nrequire(\"@webex/internal-plugin-device\");\nvar _lodash = require(\"lodash\");\nvar WebexCore = _interopRequireWildcard(require(\"@webex/webex-core\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar Feature = WebexCore.WebexPlugin.extend({\n namespace: 'Feature',\n /**\n * Returns the value of the requested feature toggle.\n * @param {string} keyType \n * @param {string} key\n * @param {Object} options\n * @param {boolean} options.full to get full feature record including metadata.\n * @returns {string|boolean|number|FeatureModel|null}\n */\n getFeature: function getFeature(keyType, key, options) {\n if (keyType !== 'developer' && keyType !== 'user' && keyType !== 'entitlement') {\n return _promise.default.reject(new Error('Invalid feature keyType provided. Only `developer`, `user`, and `entitlement` feature toggles are permitted.'));\n }\n options = options || {};\n var feature = this.webex.internal.device.features[keyType].get(key);\n if (!feature) {\n return _promise.default.resolve(null);\n }\n if (options.full) {\n return _promise.default.resolve(feature.serialize());\n }\n return _promise.default.resolve(feature.value);\n },\n /**\n * Handles a feature toggle update from the server.\n * When one of these legacy feature gets updated, this event handler be triggered\n * * group-message-notifications\n * * mention-notifications\n * * thread-notifications,\n * This handler is being listened from mercury connection success method for the event \"event:featureToggle_update\"\n * @param {Object} feature\n * @returns {undefined}\n */\n updateFeature: function updateFeature(feature) {\n if (feature) {\n var keyType = feature.type.toLowerCase();\n if (keyType === 'user' || keyType === 'developer') {\n this.webex.internal.device.features[keyType].add([feature], {\n merge: true\n });\n }\n }\n },\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {string} keyType \n * @param {string} key\n * @param {string} value\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint's response.\n */\n setFeature: function setFeature(keyType, key, value) {\n var _this = this;\n // Limit only to developer feature toggles for now.\n if (keyType !== 'developer' && keyType !== 'user') {\n return _promise.default.reject(new Error('Only `developer` and `user` feature toggles can be set.'));\n }\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: \"features/users/\".concat(this.webex.internal.device.userId, \"/\").concat(keyType),\n body: {\n key: key,\n mutable: true,\n val: value\n }\n }).then(function (res) {\n return _this.webex.internal.device.features[keyType].add(res.body, {\n merge: true\n });\n });\n },\n /**\n * Issues request to server to set a value for a feature toggle.\n * @param {array} featureList - in the form of `Array<{ type: 'USER' | 'DEV', key: string, val: any }>`\n * @returns {Promise} Refreshes the local device and resolves with the features endpoint`s response.\n */\n setBundledFeatures: function setBundledFeatures(featureList) {\n var _this2 = this;\n featureList.forEach(function (item) {\n item.mutable = item.mutable || 'true';\n if (item.type !== 'USER' && item.type !== 'DEV') {\n item.type = 'USER';\n }\n });\n return this.request({\n method: 'POST',\n api: 'feature',\n resource: \"features/users/\".concat(this.webex.internal.device.userId, \"/toggles\"),\n body: featureList\n }).then(function (res) {\n var partitionedToggles = (0, _lodash.partition)(res.body.featureToggles, {\n type: 'USER'\n });\n _this2.webex.internal.device.features.user.add(partitionedToggles[0], {\n merge: true\n });\n _this2.webex.internal.device.features.developer.add(partitionedToggles[1], {\n merge: true\n });\n });\n },\n initialize: function initialize() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (0, _apply.default)(WebexCore.WebexPlugin.prototype.initialize, this, args);\n this.listenToAndRun(this.webex, 'change:internal.device.features.developer', this.trigger.bind(this, 'change:developer'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.entitlement', this.trigger.bind(this, 'change:entitlement'));\n this.listenToAndRun(this.webex, 'change:internal.device.features.user', this.trigger.bind(this, 'change:user'));\n }\n});\nvar _default = exports.default = Feature;\n//# sourceMappingURL=feature.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _feature.default;\n }\n});\nvar _webexCore = require(\"@webex/webex-core\");\nvar _feature = _interopRequireDefault(require(\"./feature\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('feature', _feature.default, {\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LLM = void 0;\n// eslint-disable-next-line import/prefer-default-export\nvar LLM = exports.LLM = 'llm';\n//# sourceMappingURL=constants.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _llm.default;\n }\n});\nvar WebexCore = _interopRequireWildcard(require(\"@webex/webex-core\"));\nvar _llm = _interopRequireWildcard(require(\"./llm\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nWebexCore.registerInternalPlugin('llm', _llm.default, {\n config: _llm.config\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.config = void 0;\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _internalPluginMercury = _interopRequireDefault(require(\"@webex/internal-plugin-mercury\"));\nvar _constants = require(\"./constants\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable consistent-return */\n// eslint-disable-next-line no-unused-vars\n\nvar config = exports.config = {\n llm: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000\n }\n};\n\n/**\n * LLMChannel to provide socket connections\n */\nvar LLMChannel = exports.default = /*#__PURE__*/function (_ref) {\n (0, _inherits2.default)(LLMChannel, _ref);\n var _super = _createSuper(LLMChannel);\n function LLMChannel() {\n var _this;\n (0, _classCallCheck2.default)(this, LLMChannel);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"namespace\", _constants.LLM);\n /**\n * If the LLM plugin has been registered and listening\n * @instance\n * @type {Boolean}\n * @public\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"webSocketUrl\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"binding\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"locusUrl\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"datachannelUrl\", void 0);\n /**\n * Register to the websocket\n * @param {string} llmSocketUrl\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"register\", function (llmSocketUrl) {\n return _this.request({\n method: 'POST',\n url: llmSocketUrl,\n body: {\n deviceUrl: _this.webex.internal.device.url\n }\n }).then(function (res) {\n _this.webSocketUrl = res.body.webSocketUrl;\n _this.binding = res.body.binding;\n }).catch(function (error) {\n _this.logger.error(\"Error connecting to websocket: \".concat(error));\n throw error;\n });\n });\n /**\n * Register and connect to the websocket\n * @param {string} locusUrl\n * @param {string} datachannelUrl\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"registerAndConnect\", function (locusUrl, datachannelUrl) {\n return _this.register(datachannelUrl).then(function () {\n if (!locusUrl || !datachannelUrl) return undefined;\n _this.locusUrl = locusUrl;\n _this.datachannelUrl = datachannelUrl;\n _this.connect(_this.webSocketUrl);\n });\n });\n /**\n * Tells if LLM socket is connected\n * @returns {boolean} connected\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"isConnected\", function () {\n return _this.connected;\n });\n /**\n * Tells if LLM socket is binding\n * @returns {string} binding\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"getBinding\", function () {\n return _this.binding;\n });\n /**\n * Get Locus URL for the connection\n * @returns {string} locus Url\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"getLocusUrl\", function () {\n return _this.locusUrl;\n });\n /**\n * Get data channel URL for the connection\n * @returns {string} data channel Url\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"getDatachannelUrl\", function () {\n return _this.datachannelUrl;\n });\n /**\n * Disconnects websocket connection\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"disconnectLLM\", function () {\n return _this.disconnect().then(function () {\n _this.locusUrl = undefined;\n _this.datachannelUrl = undefined;\n _this.binding = undefined;\n _this.webSocketUrl = undefined;\n });\n });\n return _this;\n }\n return (0, _createClass2.default)(LLMChannel);\n}(_internalPluginMercury.default);\n//# sourceMappingURL=llm.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n lyra: {}\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _webexCore = require(\"@webex/webex-core\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @class\n * @extends {Lyra}\n * @memberof Lyra\n */\nvar Device = _webexCore.WebexPlugin.extend({\n namespace: 'Lyra',\n /**\n * Gets the audio state of the device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise} {volume, microphones, url}\n */\n getAudioState: function getAudioState(space) {\n return this.webex.request({\n method: 'GET',\n uri: \"\".concat(space.url, \"/audio\")\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Updates audio state for lyra device, should be called every 10 minutes or\n * when mic or volume state is changed\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {Types~LyraAudioState} audioState\n * @param {object} audioState.volume optional\n * @param {boolean} audioState.volume.level\n * @param {object} audioState.microphones optional\n * @param {boolean} audioState.microphones.muted\n * @param {string} audioState.deviceUrl\n * @returns {Promise}\n */\n putAudioState: function putAudioState(space) {\n var audioState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!audioState.deviceUrl) {\n return _promise.default.reject(new Error('audioState.deviceUrl is required'));\n }\n return this.webex.request({\n method: 'PUT',\n uri: \"\".concat(space.url, \"/audio\"),\n body: audioState\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Mutes lyra device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n mute: function mute(space) {\n return this.webex.request({\n method: 'POST',\n uri: \"\".concat(space.url, \"/audio/microphones/actions/mute/invoke\")\n });\n },\n /**\n * Unmutes lyra device\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n unmute: function unmute(space) {\n return this.webex.request({\n method: 'POST',\n uri: \"\".concat(space.url, \"/audio/microphones/actions/un-mute/invoke\")\n });\n },\n /**\n * Increases lyra device's volume\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n increaseVolume: function increaseVolume(space) {\n return this.webex.request({\n method: 'POST',\n uri: \"\".concat(space.url, \"/audio/volume/actions/increase/invoke\")\n });\n },\n /**\n * Decreases lyra device's volume\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise}\n */\n decreaseVolume: function decreaseVolume(space) {\n return this.webex.request({\n method: 'POST',\n uri: \"\".concat(space.url, \"/audio/volume/actions/decrease/invoke\")\n });\n },\n /**\n * Sets lyra device's volume but should use increase and decrease api instead\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {integer} level to be set\n * @returns {Promise}\n */\n setVolume: function setVolume(space) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return this.webex.request({\n method: 'POST',\n uri: \"\".concat(space.url, \"/audio/volume/actions/set/invoke\"),\n body: {\n level: level\n }\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = Device;\n//# sourceMappingURL=device.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"config\", {\n enumerable: true,\n get: function get() {\n return _config.default;\n }\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _lyra.default;\n }\n});\nrequire(\"@webex/internal-plugin-mercury\");\nrequire(\"@webex/internal-plugin-encryption\");\nrequire(\"@webex/internal-plugin-conversation\");\nrequire(\"@webex/internal-plugin-feature\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lyra = _interopRequireDefault(require(\"./lyra\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('lyra', _lyra.default, {\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _webexCore = require(\"@webex/webex-core\");\nvar _space = _interopRequireDefault(require(\"./space\"));\nvar _device = _interopRequireDefault(require(\"./device\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar Lyra = _webexCore.WebexPlugin.extend({\n /**\n * @typedef {Object} Endpoint\n * @property {Object} advertiser\n * @property {string} advertiser.id\n * @property {string} advertiser.displayName\n * @property {string} advertiser.orgId\n * @property {Object} links\n * @property {Object} links.addMeToSpace\n * @property {string} links.addMeToSpace.href\n * @property {string} links.addMeToSpace.method\n * @property {Object} links.lyra_space\n * @property {string} links.lyra_space.href\n * @property {string} links.lyra_space.method\n * @property {string} proof\n * @property {Object} token\n * @property {string} token.value\n */\n namespace: 'Lyra',\n children: {\n space: _space.default,\n device: _device.default\n },\n /**\n * Get the endpoint information\n * @param {string} token - ultrasound token decoded\n * @returns {Promise}\n */\n getAdvertisedEndpoint: function getAdvertisedEndpoint(token) {\n return this.webex.request({\n method: 'GET',\n api: 'proximity',\n resource: '/ultrasound/advertisements',\n qs: {\n token: token\n }\n }).then(function (res) {\n return res.body;\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = Lyra;\n//# sourceMappingURL=lyra.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _querystring = _interopRequireDefault(require(\"querystring\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _common = require(\"@webex/common\");\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/**\n * @class\n * @extends {Lyra}\n * @memberof Lyra\n */\nvar Space = _webexCore.WebexPlugin.extend({\n namespace: 'Lyra',\n /**\n * Lists lyra spaces associated with user\n *\n * @returns {Promise} spaces\n */\n list: function list() {\n return this.webex.request({\n method: 'GET',\n api: 'lyra',\n resource: '/spaces'\n }).then(function (res) {\n return res.body.items;\n });\n },\n /**\n * Retrieves a lyra space info\n * @param {Types~LyraSpace} space\n * @param {string} space.id\n * @param {string} space.identity.id\n * @returns {Promise} response body\n */\n get: function get() {\n var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var spaceId = space.id || space.identity && space.identity.id;\n if (!spaceId) {\n return _promise.default.reject(new Error('space.id is required'));\n }\n return this.webex.request({\n method: 'GET',\n api: 'lyra',\n resource: \"/spaces/\".concat(spaceId)\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Joins a lyra space, update every 10 minutes to keep alive for MANUAL\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {object} options\n * @param {string} options.passType\n * @param {string} options.data additional data such as proof for ultrasound\n * @param {string} options.uri use a custom uri\n * @returns {Promise}\n */\n join: function join(space, options) {\n options = _objectSpread({\n passType: 'MANUAL'\n }, options);\n var body = {\n pass: {\n type: options.passType\n },\n deviceUrl: this.webex.internal.device.url\n };\n if (options.data) {\n body.pass.data = options.data;\n }\n if (options.verificationInitiation) {\n body.verificationInitiation = options.verificationInitiation;\n }\n\n // if options.uri is available use it, since that would have the\n // complete lyra service URL\n if (options.uri) {\n return this.webex.request({\n method: 'PUT',\n uri: options.uri,\n body: body\n });\n }\n return this.webex.request({\n method: 'PUT',\n api: 'lyra',\n resource: \"\".concat(space.url, \"/occupants/@me\"),\n body: body\n });\n },\n /**\n * Leaves a lyra space\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {object} options\n * @param {boolean} options.removeAllDevices remove all devices of current user also\n * @returns {Promise}\n */\n leave: function leave(space) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // all devices are removed by default (when deviceUrl is not supplied)\n var uri = \"\".concat(space.url, \"/occupants/@me\");\n if (!options.removeAllDevices) {\n var params = {\n deviceUrl: _common.base64.toBase64Url(this.webex.internal.device.url)\n };\n uri += \"?\".concat(_querystring.default.stringify(params));\n }\n return this.webex.request({\n method: 'DELETE',\n api: 'lyra',\n resource: uri\n });\n },\n /**\n * Verifies a space occupant (to be used by the lyra device)\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {string} occupantId id of user to verify\n * @returns {Promise}\n */\n verifyOccupant: function verifyOccupant(space, occupantId) {\n var body = {\n pass: {\n type: 'VERIFICATION'\n }\n };\n return this.webex.request({\n method: 'PUT',\n uri: \"\".concat(space.url, \"/occupants/\").concat(occupantId),\n body: body\n });\n },\n /**\n * Gets the state of bindings in this Lyra space\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @returns {Promise} bindings response body\n */\n getCurrentBindings: function getCurrentBindings(space) {\n return this.webex.request({\n method: 'GET',\n uri: \"\".concat(space.url, \"/bindings\")\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Binds a conversation to lyra space\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {string} space.id\n * @param {string} space.identity.id\n * @param {Types~Conversation} conversation\n * @param {string} conversation.kmsResourceObjectUrl\n * @param {string} conversation.url\n * @param {object} options\n * @param {boolean} options.uri complete lyra service URL\n * @returns {Promise} bindings response body\n */\n bindConversation: function bindConversation() {\n var _this = this;\n var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var conversation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var spaceId = space.id || space.identity && space.identity.id;\n if (!space.url) {\n return _promise.default.reject(new Error('space.url is required'));\n }\n if (!spaceId) {\n return _promise.default.reject(new Error('space.id is required'));\n }\n if (!conversation.kmsResourceObjectUrl) {\n return _promise.default.reject(new Error('conversation.kmsResourceObjectUrl is required'));\n }\n if (!conversation.url) {\n return _promise.default.reject(new Error('conversation.url is required'));\n }\n var body = {\n kmsMessage: {\n method: 'create',\n uri: '/authorizations',\n resourceUri: \"\".concat(conversation.kmsResourceObjectUrl),\n userIds: [spaceId]\n },\n conversationUrl: conversation.url\n };\n var request = {\n method: 'POST',\n body: body\n };\n\n // if options.uri is available use it, since that would have the\n // complete lyra service URL\n if (options.uri) {\n request.uri = options.uri;\n } else {\n request.api = 'lyra';\n request.resource = \"\".concat(space.url, \"/bindings\");\n }\n return this._bindConversation(spaceId).then(function () {\n return _this.webex.request(request);\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Binds a conversation to lyra space by posting capabilities to Lyra.\n *\n * Lyra no longer automatically enables binding for a space containing a device with type \"SPARK_BOARD\".\n * Webexboard now is running the CE code stack which supports posting of capabilities to Lyra.\n * @param {String} spaceId space ID\n * @returns {Promise} bindings response body\n */\n _bindConversation: function _bindConversation(spaceId) {\n // Skip until we can bind a conversation to lyra space by posting capabilities to Lyra.\n /* eslint no-unreachable: 1 */\n return _promise.default.resolve();\n\n // PUT /lyra/api/v1/spaces/{spaceId}/devices/{encodedDeviceUrl}/capabilities\n var encodedDeviceUrl = _common.base64.encode(this.webex.internal.device.url);\n var resource = \"spaces/\".concat(spaceId, \"/devices/\").concat(encodedDeviceUrl, \"/capabilities\");\n return this.webex.request({\n method: 'PUT',\n api: 'lyra',\n resource: resource,\n body: {\n bindingCleanupAfterCall: true\n }\n });\n },\n /**\n * Removes binding between a conversation and a lyra space using conversation\n * url\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {string} space.id\n * @param {string} space.identity.id\n * @param {Types~Conversation} conversation\n * @param {string} conversation.kmsResourceObjectUrl\n * @param {string} conversation.url\n * @param {object} options\n * @param {boolean} options.uri complete lyra service URL\n * @returns {Promise} bindings response body\n */\n unbindConversation: function unbindConversation() {\n var _this2 = this;\n var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var conversation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var spaceId = space.id || space.identity && space.identity.id;\n if (!space.url) {\n return _promise.default.reject(new Error('space.url is required'));\n }\n if (!spaceId) {\n return _promise.default.reject(new Error('space.id is required'));\n }\n if (!conversation.url) {\n return _promise.default.reject(new Error('conversation.url is required'));\n }\n if (!conversation.kmsResourceObjectUrl) {\n return _promise.default.reject(new Error('conversation.kmsResourceObjectUrl is required'));\n }\n var parameters = {\n kmsMessage: {\n method: 'delete',\n uri: \"\".concat(conversation.kmsResourceObjectUrl, \"/authorizations?\").concat(_querystring.default.stringify({\n authId: spaceId\n }))\n },\n conversationUrl: _common.base64.toBase64Url(conversation.url)\n };\n return this.webex.internal.encryption.kms.prepareRequest(parameters.kmsMessage).then(function (req) {\n parameters.kmsMessage = req.wrapped;\n // if options.uri is available use it, since that would have the\n // complete lyra service URL\n if (options.uri) {\n return _this2.webex.request({\n method: 'DELETE',\n uri: \"\".concat(options.uri, \"?\").concat(_querystring.default.stringify(parameters))\n });\n }\n return _this2.webex.request({\n method: 'DELETE',\n api: 'lyra',\n resource: \"\".concat(space.url, \"/bindings?\").concat(_querystring.default.stringify(parameters))\n });\n });\n },\n /**\n * Delete a binding using binding id\n * @param {Types~LyraSpace} space\n * @param {string} space.url\n * @param {string} space.identity.id\n * @param {object} options\n * @param {string} options.kmsResourceObjectUrl\n * @param {string} options.bindingId\n * @returns {Promise} bindings response body\n */\n deleteBinding: function deleteBinding() {\n var _this3 = this;\n var space = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var spaceId = space.id || space.identity && space.identity.id;\n if (!space.url) {\n return _promise.default.reject(new Error('space.url is required'));\n }\n if (!spaceId) {\n return _promise.default.reject(new Error('space.id is required'));\n }\n if (!options.kmsResourceObjectUrl) {\n return _promise.default.reject(new Error('options.kmsResourceObjectUrl is required'));\n }\n if (!options.bindingId) {\n return _promise.default.reject(new Error('options.bindingId is required'));\n }\n var parameters = {\n kmsMessage: {\n method: 'delete',\n uri: \"\".concat(options.kmsResourceObjectUrl, \"/authorizations?\").concat(_querystring.default.stringify({\n authId: spaceId\n }))\n }\n };\n return this.webex.internal.encryption.kms.prepareRequest(parameters.kmsMessage).then(function (req) {\n parameters.kmsMessage = req.wrapped;\n return _this3.webex.request({\n method: 'DELETE',\n uri: \"\".concat(space.url, \"/bindings/\").concat(options.bindingId, \"?\").concat(_querystring.default.stringify(parameters))\n });\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = Space;\n//# sourceMappingURL=space.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n mercury: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000,\n /**\n * When logging out, use default reason which can trigger a reconnect,\n * or set to something else, like `done (permanent)` to prevent reconnect\n * @type {String}\n */\n beforeLogoutOptionsCloseReason: process.env.MERCURY_LOGOUT_REASON || 'done (forced)'\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UnknownResponse = exports.NotAuthorized = exports.Forbidden = exports.ConnectionError = exports.BadRequest = void 0;\nvar _defineProperties = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/define-properties\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _common = require(\"@webex/common\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/**\n * Exception thrown when a websocket gets closed\n */\nvar ConnectionError = exports.ConnectionError = /*#__PURE__*/function (_Exception) {\n (0, _inherits2.default)(ConnectionError, _Exception);\n var _super = _createSuper(ConnectionError);\n function ConnectionError() {\n (0, _classCallCheck2.default)(this, ConnectionError);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(ConnectionError, [{\n key: \"parse\",\n value:\n /**\n * @param {CloseEvent} event\n * @returns {string}\n */\n function parse() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n (0, _defineProperties.default)(this, {\n code: {\n value: event.code\n },\n reason: {\n value: event.reason\n }\n });\n return event.reason;\n }\n }]);\n return ConnectionError;\n}(_common.Exception);\n/**\n * thrown for CloseCode 4400\n */\n(0, _defineProperty2.default)(ConnectionError, \"defaultMessage\", 'Failed to connect to socket');\nvar UnknownResponse = exports.UnknownResponse = /*#__PURE__*/function (_ConnectionError) {\n (0, _inherits2.default)(UnknownResponse, _ConnectionError);\n var _super2 = _createSuper(UnknownResponse);\n function UnknownResponse() {\n (0, _classCallCheck2.default)(this, UnknownResponse);\n return _super2.apply(this, arguments);\n }\n return (0, _createClass2.default)(UnknownResponse);\n}(ConnectionError);\n/**\n * thrown for CloseCode 4400\n */\n(0, _defineProperty2.default)(UnknownResponse, \"defaultMessage\", 'UnknownResponse is produced by IE when we receive a 4XXX. You probably want to treat this like a NotFound');\nvar BadRequest = exports.BadRequest = /*#__PURE__*/function (_ConnectionError2) {\n (0, _inherits2.default)(BadRequest, _ConnectionError2);\n var _super3 = _createSuper(BadRequest);\n function BadRequest() {\n (0, _classCallCheck2.default)(this, BadRequest);\n return _super3.apply(this, arguments);\n }\n return (0, _createClass2.default)(BadRequest);\n}(ConnectionError);\n/**\n * thrown for CloseCode 4401\n */\n(0, _defineProperty2.default)(BadRequest, \"defaultMessage\", 'BadRequest usually implies an attempt to use service account credentials');\nvar NotAuthorized = exports.NotAuthorized = /*#__PURE__*/function (_ConnectionError3) {\n (0, _inherits2.default)(NotAuthorized, _ConnectionError3);\n var _super4 = _createSuper(NotAuthorized);\n function NotAuthorized() {\n (0, _classCallCheck2.default)(this, NotAuthorized);\n return _super4.apply(this, arguments);\n }\n return (0, _createClass2.default)(NotAuthorized);\n}(ConnectionError);\n/**\n * thrown for CloseCode 4403\n */\n(0, _defineProperty2.default)(NotAuthorized, \"defaultMessage\", 'Please refresh your access token');\nvar Forbidden = exports.Forbidden = /*#__PURE__*/function (_ConnectionError4) {\n (0, _inherits2.default)(Forbidden, _ConnectionError4);\n var _super5 = _createSuper(Forbidden);\n function Forbidden() {\n (0, _classCallCheck2.default)(this, Forbidden);\n return _super5.apply(this, arguments);\n }\n return (0, _createClass2.default)(Forbidden);\n}(ConnectionError); // /**\n// * thrown for CloseCode 4404\n// */\n// export class NotFound extends ConnectionError {\n// static defaultMessage = `Please refresh your Mercury registration (typically via a WDM refresh)`;\n// }\n(0, _defineProperty2.default)(Forbidden, \"defaultMessage\", 'Forbidden usually implies these credentials are not entitled for Webex');\n//# sourceMappingURL=errors.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"BadRequest\", {\n enumerable: true,\n get: function get() {\n return _errors.BadRequest;\n }\n});\n_Object$defineProperty(exports, \"ConnectionError\", {\n enumerable: true,\n get: function get() {\n return _errors.ConnectionError;\n }\n});\n_Object$defineProperty(exports, \"Forbidden\", {\n enumerable: true,\n get: function get() {\n return _errors.Forbidden;\n }\n});\n_Object$defineProperty(exports, \"Mercury\", {\n enumerable: true,\n get: function get() {\n return _mercury.default;\n }\n});\n_Object$defineProperty(exports, \"NotAuthorized\", {\n enumerable: true,\n get: function get() {\n return _errors.NotAuthorized;\n }\n});\n_Object$defineProperty(exports, \"Socket\", {\n enumerable: true,\n get: function get() {\n return _socket.default;\n }\n});\n_Object$defineProperty(exports, \"UnknownResponse\", {\n enumerable: true,\n get: function get() {\n return _errors.UnknownResponse;\n }\n});\n_Object$defineProperty(exports, \"config\", {\n enumerable: true,\n get: function get() {\n return _config.default;\n }\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _mercury.default;\n }\n});\nrequire(\"@webex/internal-plugin-device\");\nrequire(\"@webex/internal-plugin-feature\");\nrequire(\"@webex/internal-plugin-metrics\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _mercury = _interopRequireDefault(require(\"./mercury\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\nvar _socket = _interopRequireDefault(require(\"./socket\"));\nvar _errors = require(\"./errors\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('mercury', _mercury.default, {\n config: _config.default,\n onBeforeLogout: function onBeforeLogout() {\n return this.logout();\n }\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$keys2 = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor2 = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _assign = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/assign\"));\nvar _deleteProperty = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/delete-property\"));\nvar _now = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/date/now\"));\nvar _getOwnPropertyDescriptor = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _applyDecoratedDescriptor2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/applyDecoratedDescriptor\"));\nvar _url = _interopRequireDefault(require(\"url\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _common = require(\"@webex/common\");\nvar _lodash = require(\"lodash\");\nvar _backoff = _interopRequireDefault(require(\"backoff\"));\nvar _socket = _interopRequireDefault(require(\"./socket\"));\nvar _errors = require(\"./errors\");\nvar _dec, _dec2, _obj;\n/* eslint-disable require-jsdoc */\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nfunction ownKeys(e, r) { var t = _Object$keys2(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor2(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor2(t, r)); }); } return e; }\nvar normalReconnectReasons = ['idle', 'done (forced)', 'pong not received', 'pong mismatch'];\nvar Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mercury#listen(): Use Mercury#connect() instead'), _dec2 = (0, _common.deprecated)('Mercury#stopListening(): Use Mercury#disconnect() instead'), (_obj = {\n namespace: 'Mercury',\n lastError: undefined,\n session: {\n connected: {\n default: false,\n type: 'boolean'\n },\n connecting: {\n default: false,\n type: 'boolean'\n },\n hasEverConnected: {\n default: false,\n type: 'boolean'\n },\n socket: 'object',\n localClusterServiceUrls: 'object',\n mercuryTimeOffset: {\n default: undefined,\n type: 'number'\n }\n },\n derived: {\n listening: {\n deps: ['connected'],\n fn: function fn() {\n return this.connected;\n }\n }\n },\n initialize: function initialize() {\n var _this = this;\n /*\n When one of these legacy feature gets updated, this event would be triggered\n * group-message-notifications\n * mention-notifications\n * thread-notifications\n */\n this.on('event:featureToggle_update', function (envelope) {\n if (envelope && envelope.data) {\n _this.webex.internal.feature.updateFeature(envelope.data.featureToggle);\n }\n });\n },\n /**\n * Get the last error.\n * @returns {any} The last error.\n */\n getLastError: function getLastError() {\n return this.lastError;\n },\n connect: function connect(webSocketUrl) {\n var _this2 = this;\n if (this.connected) {\n this.logger.info(\"\".concat(this.namespace, \": already connected, will not connect again\"));\n return _promise.default.resolve();\n }\n this.connecting = true;\n this.logger.info(\"\".concat(this.namespace, \": starting connection attempt\"));\n this.logger.info(\"\".concat(this.namespace, \": debug_mercury_logging stack: \"), new Error('debug_mercury_logging').stack);\n return _promise.default.resolve(this.webex.internal.device.registered || this.webex.internal.device.register()).then(function () {\n _this2.logger.info(\"\".concat(_this2.namespace, \": connecting\"));\n return _this2._connectWithBackoff(webSocketUrl);\n });\n },\n logout: function logout() {\n return this.disconnect(this.config.beforeLogoutOptionsCloseReason && !normalReconnectReasons.includes(this.config.beforeLogoutOptionsCloseReason) ? {\n code: 1050,\n reason: this.config.beforeLogoutOptionsCloseReason\n } : undefined);\n },\n disconnect: function disconnect(options) {\n var _this3 = this;\n return new _promise.default(function (resolve) {\n if (_this3.backoffCall) {\n _this3.logger.info(\"\".concat(_this3.namespace, \": aborting connection\"));\n _this3.backoffCall.abort();\n }\n if (_this3.socket) {\n _this3.socket.removeAllListeners('message');\n _this3.once('offline', resolve);\n resolve(_this3.socket.close(options || undefined));\n }\n resolve();\n });\n },\n listen: function listen() {\n /* eslint no-invalid-this: [0] */\n return this.connect();\n },\n stopListening: function stopListening() {\n /* eslint no-invalid-this: [0] */\n return this.disconnect();\n },\n processRegistrationStatusEvent: function processRegistrationStatusEvent(message) {\n this.localClusterServiceUrls = message.localClusterServiceUrls;\n },\n _applyOverrides: function _applyOverrides(event) {\n if (!event || !event.headers) {\n return;\n }\n var headerKeys = (0, _keys.default)(event.headers);\n headerKeys.forEach(function (keyPath) {\n (0, _lodash.set)(event, keyPath, event.headers[keyPath]);\n });\n },\n _prepareUrl: function _prepareUrl(webSocketUrl) {\n var _this4 = this;\n if (!webSocketUrl) {\n webSocketUrl = this.webex.internal.device.webSocketUrl;\n }\n return this.webex.internal.feature.getFeature('developer', 'web-high-availability').then(function (haMessagingEnabled) {\n if (haMessagingEnabled) {\n return _this4.webex.internal.services.convertUrlToPriorityHostUrl(webSocketUrl);\n }\n return webSocketUrl;\n }).then(function (wsUrl) {\n webSocketUrl = wsUrl;\n }).then(function () {\n return _this4.webex.internal.feature.getFeature('developer', 'web-shared-mercury');\n }).then(function (webSharedMercury) {\n webSocketUrl = _url.default.parse(webSocketUrl, true);\n (0, _assign.default)(webSocketUrl.query, {\n outboundWireFormat: 'text',\n bufferStates: true,\n aliasHttpStatus: true\n });\n if (webSharedMercury) {\n (0, _assign.default)(webSocketUrl.query, {\n mercuryRegistrationStatus: true,\n isRegistrationRefreshEnabled: true\n });\n (0, _deleteProperty.default)(webSocketUrl.query, 'bufferStates');\n }\n if ((0, _lodash.get)(_this4, 'webex.config.device.ephemeral', false)) {\n webSocketUrl.query.multipleConnections = true;\n }\n webSocketUrl.query.clientTimestamp = (0, _now.default)();\n return _url.default.format(webSocketUrl);\n });\n },\n _attemptConnection: function _attemptConnection(socketUrl, callback) {\n var _this5 = this;\n var socket = new _socket.default();\n var attemptWSUrl;\n socket.on('close', function () {\n return _this5._onclose.apply(_this5, arguments);\n });\n socket.on('message', function () {\n return _this5._onmessage.apply(_this5, arguments);\n });\n socket.on('pong', function () {\n return _this5._setTimeOffset.apply(_this5, arguments);\n });\n socket.on('sequence-mismatch', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return _this5._emit.apply(_this5, ['sequence-mismatch'].concat(args));\n });\n socket.on('ping-pong-latency', function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return _this5._emit.apply(_this5, ['ping-pong-latency'].concat(args));\n });\n _promise.default.all([this._prepareUrl(socketUrl), this.webex.credentials.getUserToken()]).then(function (_ref) {\n var _ref2 = (0, _slicedToArray2.default)(_ref, 2),\n webSocketUrl = _ref2[0],\n token = _ref2[1];\n if (!_this5.backoffCall) {\n var msg = \"\".concat(_this5.namespace, \": prevent socket open when backoffCall no longer defined\");\n _this5.logger.info(msg);\n return _promise.default.reject(new Error(msg));\n }\n attemptWSUrl = webSocketUrl;\n var options = {\n forceCloseDelay: _this5.config.forceCloseDelay,\n pingInterval: _this5.config.pingInterval,\n pongTimeout: _this5.config.pongTimeout,\n token: token.toString(),\n trackingId: \"\".concat(_this5.webex.sessionId, \"_\").concat((0, _now.default)()),\n logger: _this5.logger\n };\n\n // if the consumer has supplied request options use them\n if (_this5.webex.config.defaultMercuryOptions) {\n _this5.logger.info(\"\".concat(_this5.namespace, \": setting custom options\"));\n options = _objectSpread(_objectSpread({}, options), _this5.webex.config.defaultMercuryOptions);\n }\n\n // Set the socket before opening it. This allows a disconnect() to close\n // the socket if it is in the process of being opened.\n _this5.socket = socket;\n _this5.logger.info(\"\".concat(_this5.namespace, \" connection url: \").concat(webSocketUrl));\n return socket.open(webSocketUrl, options);\n }).then(function () {\n _this5.logger.info(\"\".concat(_this5.namespace, \": connected to mercury, success, action: connected, url: \").concat(attemptWSUrl));\n callback();\n return _this5.webex.internal.feature.getFeature('developer', 'web-high-availability').then(function (haMessagingEnabled) {\n if (haMessagingEnabled) {\n return _this5.webex.internal.device.refresh();\n }\n return _promise.default.resolve();\n });\n }).catch(function (reason) {\n var _this5$backoffCall;\n _this5.lastError = reason; // remember the last error\n\n // Suppress connection errors that appear to be network related. This\n // may end up suppressing metrics during outages, but we might not care\n // (especially since many of our outages happen in a way that client\n // metrics can't be trusted).\n if (reason.code !== 1006 && _this5.backoffCall && _this5.backoffCall.getNumRetries() > 0) {\n _this5._emit('connection_failed', reason, {\n retries: _this5.backoffCall.getNumRetries()\n });\n }\n _this5.logger.info(\"\".concat(_this5.namespace, \": connection attempt failed\"), reason, ((_this5$backoffCall = _this5.backoffCall) === null || _this5$backoffCall === void 0 ? void 0 : _this5$backoffCall.getNumRetries()) === 0 ? reason.stack : '');\n // UnknownResponse is produced by IE for any 4XXX; treated it like a bad\n // web socket url and let WDM handle the token checking\n if (reason instanceof _errors.UnknownResponse) {\n _this5.logger.info(\"\".concat(_this5.namespace, \": received unknown response code, refreshing device registration\"));\n return _this5.webex.internal.device.refresh().then(function () {\n return callback(reason);\n });\n }\n // NotAuthorized implies expired token\n if (reason instanceof _errors.NotAuthorized) {\n _this5.logger.info(\"\".concat(_this5.namespace, \": received authorization error, reauthorizing\"));\n return _this5.webex.credentials.refresh({\n force: true\n }).then(function () {\n return callback(reason);\n });\n }\n // // NotFound implies expired web socket url\n // else if (reason instanceof NotFound) {\n // this.logger.info(`mercury: received not found error, refreshing device registration`);\n // return this.webex.internal.device.refresh()\n // .then(() => callback(reason));\n // }\n // BadRequest implies current credentials are for a Service Account\n // Forbidden implies current user is not entitle for Webex\n if (reason instanceof _errors.BadRequest || reason instanceof _errors.Forbidden) {\n _this5.logger.warn(\"\".concat(_this5.namespace, \": received unrecoverable response from mercury\"));\n _this5.backoffCall.abort();\n return callback(reason);\n }\n if (reason instanceof _errors.ConnectionError) {\n return _this5.webex.internal.feature.getFeature('developer', 'web-high-availability').then(function (haMessagingEnabled) {\n if (haMessagingEnabled) {\n _this5.logger.info(\"\".concat(_this5.namespace, \": received a generic connection error, will try to connect to another datacenter. failed, action: 'failed', url: \").concat(attemptWSUrl, \" error: \").concat(reason.message));\n return _this5.webex.internal.services.markFailedUrl(attemptWSUrl);\n }\n return null;\n }).then(function () {\n return callback(reason);\n });\n }\n return callback(reason);\n }).catch(function (reason) {\n _this5.logger.error(\"\".concat(_this5.namespace, \": failed to handle connection failure\"), reason);\n callback(reason);\n });\n },\n _connectWithBackoff: function _connectWithBackoff(webSocketUrl) {\n var _this6 = this;\n return new _promise.default(function (resolve, reject) {\n // eslint gets confused about whether or not call is actually used\n // eslint-disable-next-line prefer-const\n var call;\n var onComplete = function onComplete(err) {\n _this6.connecting = false;\n _this6.backoffCall = undefined;\n if (err) {\n _this6.logger.info(\"\".concat(_this6.namespace, \": failed to connect after \").concat(call.getNumRetries(), \" retries; log statement about next retry was inaccurate; \").concat(err));\n return reject(err);\n }\n _this6.connected = true;\n _this6.hasEverConnected = true;\n _this6._emit('online');\n return resolve();\n };\n\n // eslint-disable-next-line prefer-reflect\n call = _backoff.default.call(function (callback) {\n _this6.logger.info(\"\".concat(_this6.namespace, \": executing connection attempt \").concat(call.getNumRetries()));\n _this6._attemptConnection(webSocketUrl, callback);\n }, onComplete);\n call.setStrategy(new _backoff.default.ExponentialStrategy({\n initialDelay: _this6.config.backoffTimeReset,\n maxDelay: _this6.config.backoffTimeMax\n }));\n if (_this6.config.initialConnectionMaxRetries && !_this6.hasEverConnected) {\n call.failAfter(_this6.config.initialConnectionMaxRetries);\n } else if (_this6.config.maxRetries) {\n call.failAfter(_this6.config.maxRetries);\n }\n call.on('abort', function () {\n _this6.logger.info(\"\".concat(_this6.namespace, \": connection aborted\"));\n reject(new Error('Mercury Connection Aborted'));\n });\n call.on('callback', function (err) {\n if (err) {\n var number = call.getNumRetries();\n var delay = Math.min(call.strategy_.nextBackoffDelay_, _this6.config.backoffTimeMax);\n _this6.logger.info(\"\".concat(_this6.namespace, \": failed to connect; attempting retry \").concat(number + 1, \" in \").concat(delay, \" ms\"));\n /* istanbul ignore if */\n if (process.env.NODE_ENV === 'development') {\n _this6.logger.debug(\"\".concat(_this6.namespace, \": \"), err, err.stack);\n }\n return;\n }\n _this6.logger.info(\"\".concat(_this6.namespace, \": connected\"));\n });\n call.start();\n _this6.backoffCall = call;\n });\n },\n _emit: function _emit() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n try {\n this.trigger.apply(this, args);\n } catch (error) {\n this.logger.error(\"\".concat(this.namespace, \": error occurred in event handler:\"), error, ' with args: ', args);\n }\n },\n _getEventHandlers: function _getEventHandlers(eventType) {\n var _eventType$split = eventType.split('.'),\n _eventType$split2 = (0, _slicedToArray2.default)(_eventType$split, 2),\n namespace = _eventType$split2[0],\n name = _eventType$split2[1];\n var handlers = [];\n if (!this.webex[namespace] && !this.webex.internal[namespace]) {\n return handlers;\n }\n var handlerName = (0, _lodash.camelCase)(\"process_\".concat(name, \"_event\"));\n if ((this.webex[namespace] || this.webex.internal[namespace])[handlerName]) {\n handlers.push({\n name: handlerName,\n namespace: namespace\n });\n }\n return handlers;\n },\n _onclose: function _onclose(event) {\n // I don't see any way to avoid the complexity or statement count in here.\n /* eslint complexity: [0] */\n\n try {\n var reason = event.reason && event.reason.toLowerCase();\n var socketUrl = this.socket.url;\n this.socket.removeAllListeners();\n this.unset('socket');\n this.connected = false;\n this._emit('offline', event);\n switch (event.code) {\n case 1003:\n // metric: disconnect\n this.logger.info(\"\".concat(this.namespace, \": Mercury service rejected last message; will not reconnect: \").concat(event.reason));\n this._emit('offline.permanent', event);\n break;\n case 4000:\n // metric: disconnect\n this.logger.info(\"\".concat(this.namespace, \": socket replaced; will not reconnect\"));\n this._emit('offline.replaced', event);\n break;\n case 1001:\n case 1005:\n case 1006:\n case 1011:\n this.logger.info(\"\".concat(this.namespace, \": socket disconnected; reconnecting\"));\n this._emit('offline.transient', event);\n this._reconnect(socketUrl);\n // metric: disconnect\n // if (code == 1011 && reason !== ping error) metric: unexpected disconnect\n break;\n case 1000:\n case 1050:\n // 1050 indicates logout form of closure, default to old behavior, use config reason defined by consumer to proceed with the permanent block\n if (normalReconnectReasons.includes(reason)) {\n this.logger.info(\"\".concat(this.namespace, \": socket disconnected; reconnecting\"));\n this._emit('offline.transient', event);\n this._reconnect(socketUrl);\n // metric: disconnect\n // if (reason === done forced) metric: force closure\n } else {\n this.logger.info(\"\".concat(this.namespace, \": socket disconnected; will not reconnect: \").concat(event.reason));\n this._emit('offline.permanent', event);\n }\n break;\n default:\n this.logger.info(\"\".concat(this.namespace, \": socket disconnected unexpectedly; will not reconnect\"));\n // unexpected disconnect\n this._emit('offline.permanent', event);\n }\n } catch (error) {\n this.logger.error(\"\".concat(this.namespace, \": error occurred in close handler\"), error);\n }\n },\n _onmessage: function _onmessage(event) {\n var _this7 = this;\n this._setTimeOffset(event);\n var envelope = event.data;\n if (process.env.ENABLE_MERCURY_LOGGING) {\n this.logger.debug(\"\".concat(this.namespace, \": message envelope: \"), envelope);\n }\n var data = envelope.data;\n this._applyOverrides(data);\n return this._getEventHandlers(data.eventType).reduce(function (promise, handler) {\n return promise.then(function () {\n var namespace = handler.namespace,\n name = handler.name;\n return new _promise.default(function (resolve) {\n return resolve((_this7.webex[namespace] || _this7.webex.internal[namespace])[name](data));\n }).catch(function (reason) {\n return _this7.logger.error(\"\".concat(_this7.namespace, \": error occurred in autowired event handler for \").concat(data.eventType), reason);\n });\n });\n }, _promise.default.resolve()).then(function () {\n _this7._emit('event', event.data);\n var _data$eventType$split = data.eventType.split('.'),\n _data$eventType$split2 = (0, _slicedToArray2.default)(_data$eventType$split, 1),\n namespace = _data$eventType$split2[0];\n if (namespace === data.eventType) {\n _this7._emit(\"event:\".concat(namespace), envelope);\n } else {\n _this7._emit(\"event:\".concat(namespace), envelope);\n _this7._emit(\"event:\".concat(data.eventType), envelope);\n }\n }).catch(function (reason) {\n _this7.logger.error(\"\".concat(_this7.namespace, \": error occurred processing socket message\"), reason);\n });\n },\n _setTimeOffset: function _setTimeOffset(event) {\n var wsWriteTimestamp = event.data.wsWriteTimestamp;\n if (typeof wsWriteTimestamp === 'number' && wsWriteTimestamp > 0) {\n this.mercuryTimeOffset = (0, _now.default)() - wsWriteTimestamp;\n }\n },\n _reconnect: function _reconnect(webSocketUrl) {\n this.logger.info(\"\".concat(this.namespace, \": reconnecting\"));\n return this.connect(webSocketUrl);\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n}, ((0, _applyDecoratedDescriptor2.default)(_obj, \"connect\", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, \"connect\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"disconnect\", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, \"disconnect\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"listen\", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, \"listen\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"stopListening\", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, \"stopListening\"), _obj)), _obj)));\nvar _default = exports.default = Mercury;\n//# sourceMappingURL=mercury.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _socket.default;\n }\n});\nvar _socket = _interopRequireDefault(require(\"./socket\"));\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _weakMap = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/weak-map\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _defineProperty = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/define-property\"));\nvar _parseInt2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/parse-int\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _events = require(\"events\");\nvar _common = require(\"@webex/common\");\nvar _commonTimers = require(\"@webex/common-timers\");\nvar _lodash = require(\"lodash\");\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\nvar _errors = require(\"../errors\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar sockets = new _weakMap.default();\n\n/**\n * Generalized socket abstraction\n */\nvar Socket = exports.default = /*#__PURE__*/function (_EventEmitter) {\n (0, _inherits2.default)(Socket, _EventEmitter);\n var _super = _createSuper(Socket);\n /**\n * constructor\n * @returns {Socket}\n */\n function Socket() {\n var _this;\n (0, _classCallCheck2.default)(this, Socket);\n _this = _super.call(this);\n _this._domain = 'unknown-domain';\n _this.onmessage = _this.onmessage.bind((0, _assertThisInitialized2.default)(_this));\n _this.onclose = _this.onclose.bind((0, _assertThisInitialized2.default)(_this));\n return _this;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {string}\n */\n (0, _createClass2.default)(Socket, [{\n key: \"binaryType\",\n get: function get() {\n return sockets.get(this).binaryType;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {number}\n */\n }, {\n key: \"bufferedAmount\",\n get: function get() {\n return sockets.get(this).bufferedAmount;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {string}\n */\n }, {\n key: \"extensions\",\n get: function get() {\n return sockets.get(this).extensions;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {string}\n */\n }, {\n key: \"protocol\",\n get: function get() {\n return sockets.get(this).protocol;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {number}\n */\n }, {\n key: \"readyState\",\n get: function get() {\n return sockets.get(this).readyState;\n }\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n * @returns {string}\n */\n }, {\n key: \"url\",\n get: function get() {\n return sockets.get(this).url;\n }\n\n /**\n * Provides the environmentally appropriate constructor (ws in NodeJS,\n * WebSocket in browsers)\n * @returns {WebSocket}\n */\n }, {\n key: \"close\",\n value:\n /**\n * Closes the socket\n * @param {Object} options\n * @param {string} options.reason\n * @param {number} options.code\n * @returns {Promise}\n */\n function close(options) {\n var _this2 = this;\n return new _promise.default(function (resolve, reject) {\n var socket = sockets.get(_this2);\n if (!socket) {\n // Open has not been called yet so there is no socket to close\n resolve();\n return;\n }\n // logger is defined once open is called\n _this2.logger.info(\"socket,\".concat(_this2._domain, \": closing\"));\n if (socket.readyState === 2 || socket.readyState === 3) {\n _this2.logger.info(\"socket,\".concat(_this2._domain, \": already closed\"));\n resolve();\n return;\n }\n options = options || {};\n if (options.code && options.code !== 1000 && options.code !== 1050 && (options.code < 3000 || options.code > 4999)) {\n reject(new Error('`options.code` must be 1000 or 1050 or between 3000 and 4999 (inclusive)'));\n return;\n }\n options = (0, _lodash.defaults)(options, {\n code: 1000,\n reason: 'Done'\n });\n var closeTimer = (0, _commonTimers.safeSetTimeout)(function () {\n try {\n _this2.logger.info(\"socket,\".concat(_this2._domain, \": no close event received, forcing closure\"));\n resolve(_this2.onclose(options.code === 1050 ? {\n code: 1050,\n reason: options.reason\n } : {\n code: 1000,\n reason: 'Done (forced)'\n }));\n } catch (error) {\n _this2.logger.warn(\"socket,\".concat(_this2._domain, \": force-close failed\"), error);\n }\n }, _this2.forceCloseDelay);\n socket.onclose = function (event) {\n _this2.logger.info(\"socket,\".concat(_this2._domain, \": close event fired\"), event.code, event.reason);\n clearTimeout(closeTimer);\n _this2.onclose(event);\n resolve(event);\n };\n socket.close(options.code, options.reason);\n });\n }\n\n /**\n * Opens a WebSocket\n * @param {string} url\n * @param {options} options\n * @param {number} options.forceCloseDelay (required)\n * @param {number} options.pingInterval (required)\n * @param {number} options.pongTimeout (required)\n * @param {string} options.token (required)\n * @param {string} options.trackingId (required)\n * @param {Logger} options.logger (required)\n * @param {string} options.logLevelToken\n * @returns {Promise}\n */\n }, {\n key: \"open\",\n value: function open(url, options) {\n var _this3 = this;\n try {\n this._domain = new URL(url).hostname;\n } catch (_unused) {\n this._domain = url;\n }\n return new _promise.default(function (resolve, reject) {\n /* eslint complexity: [0] */\n if (!url) {\n reject(new Error('`url` is required'));\n return;\n }\n if (sockets.get(_this3)) {\n reject(new Error('Socket#open() can only be called once per instance'));\n return;\n }\n options = options || {};\n (0, _common.checkRequired)(['forceCloseDelay', 'pingInterval', 'pongTimeout', 'token', 'trackingId', 'logger'], options);\n (0, _keys.default)(options).forEach(function (key) {\n (0, _defineProperty.default)(_this3, key, {\n enumerable: false,\n value: options[key]\n });\n });\n var WebSocket = Socket.getWebSocketConstructor();\n _this3.logger.info(\"socket,\".concat(_this3._domain, \": creating WebSocket\"));\n var socket = new WebSocket(url, [], options);\n socket.binaryType = 'arraybuffer';\n socket.onmessage = _this3.onmessage;\n socket.onclose = function (event) {\n event = _this3._fixCloseCode(event);\n _this3.logger.info(\"socket,\".concat(_this3._domain, \": closed before open\"), event.code, event.reason);\n switch (event.code) {\n case 1005:\n // IE 11 doesn't seem to allow 4XXX codes, so if we get a 1005, assume\n // it's a bad websocket url. That'll trigger a device refresh; if it\n // turns out we had a bad token, the device refresh should 401 and\n // trigger a token refresh.\n return reject(new _errors.UnknownResponse(event));\n case 4400:\n return reject(new _errors.BadRequest(event));\n case 4401:\n return reject(new _errors.NotAuthorized(event));\n case 4403:\n return reject(new _errors.Forbidden(event));\n // case 4404:\n // return reject(new NotFound(event));\n default:\n return reject(new _errors.ConnectionError(event));\n }\n };\n socket.onopen = function () {\n _this3.logger.info(\"socket,\".concat(_this3._domain, \": connected\"));\n _this3._authorize().then(function () {\n _this3.logger.info(\"socket,\".concat(_this3._domain, \": authorized\"));\n socket.onclose = _this3.onclose;\n resolve();\n }).catch(reject);\n };\n socket.onerror = function (event) {\n _this3.logger.warn(\"socket,\".concat(_this3._domain, \": error event fired\"), event);\n };\n sockets.set(_this3, socket);\n _this3.logger.info(\"socket,\".concat(_this3._domain, \": waiting for server\"));\n });\n }\n\n /**\n * Handles incoming CloseEvents\n * @param {CloseEvent} event\n * @returns {undefined}\n */\n }, {\n key: \"onclose\",\n value: function onclose(event) {\n this.logger.info(\"socket,\".concat(this._domain, \": closed\"), event.code, event.reason);\n clearTimeout(this.pongTimer);\n clearTimeout(this.pingTimer);\n event = this._fixCloseCode(event);\n this.emit('close', event);\n\n // Remove all listeners to (a) avoid reacting to late pongs and (b) ensure\n // we don't have a retain cycle.\n this.removeAllListeners();\n }\n\n /**\n * Handles incoming message events\n * @param {MessageEvent} event\n * @returns {undefined}\n */\n }, {\n key: \"onmessage\",\n value: function onmessage(event) {\n try {\n var data = JSON.parse(event.data);\n var sequenceNumber = (0, _parseInt2.default)(data.sequenceNumber, 10);\n this.logger.debug(\"socket,\".concat(this._domain, \": sequence number: \"), sequenceNumber);\n if (this.expectedSequenceNumber && sequenceNumber !== this.expectedSequenceNumber) {\n this.logger.debug(\"socket,\".concat(this._domain, \": sequence number mismatch indicates lost mercury message. expected: \").concat(this.expectedSequenceNumber, \", actual: \").concat(sequenceNumber));\n this.emit('sequence-mismatch', sequenceNumber, this.expectedSequenceNumber);\n }\n this.expectedSequenceNumber = sequenceNumber + 1;\n\n // Yes, it's a little weird looking; we want to emit message events that\n // look like normal socket message events, but event.data cannot be\n // modified and we don't actually care about anything but the data property\n var processedEvent = {\n data: data\n };\n this._acknowledge(processedEvent);\n if (data.type === 'pong') {\n this.emit('pong', processedEvent);\n } else {\n this.emit('message', processedEvent);\n }\n } catch (error) {\n // The above code should only be able to throw if we receive an unparsable\n // message from Mercury. At this time, the only action we have is to\n // ignore it and move on.\n /* istanbul ignore next */\n this.logger.warn(\"socket,\".concat(this._domain, \": error while receiving WebSocket message\"), error);\n }\n }\n\n /**\n * Sends a message up the socket\n * @param {mixed} data\n * @returns {Promise}\n */\n }, {\n key: \"send\",\n value: function send(data) {\n var _this4 = this;\n return new _promise.default(function (resolve, reject) {\n if (_this4.readyState !== 1) {\n return reject(new Error('INVALID_STATE_ERROR'));\n }\n if ((0, _lodash.isObject)(data)) {\n data = (0, _stringify.default)(data);\n }\n var socket = sockets.get(_this4);\n socket.send(data);\n return resolve();\n });\n }\n\n /**\n * Sends an acknowledgment for a specific event\n * @param {MessageEvent} event\n * @returns {Promise}\n */\n }, {\n key: \"_acknowledge\",\n value: function _acknowledge(event) {\n if (!event) {\n return _promise.default.reject(new Error('`event` is required'));\n }\n if (!(0, _lodash.has)(event, 'data.id')) {\n return _promise.default.reject(new Error('`event.data.id` is required'));\n }\n return this.send({\n messageId: event.data.id,\n type: 'ack'\n });\n }\n\n /**\n * Sends an auth message up the socket\n * @private\n * @returns {Promise}\n */\n }, {\n key: \"_authorize\",\n value: function _authorize() {\n var _this5 = this;\n return new _promise.default(function (resolve) {\n _this5.logger.info(\"socket,\".concat(_this5._domain, \": authorizing\"));\n _this5.send({\n id: _uuid.default.v4(),\n type: 'authorization',\n data: {\n token: _this5.token\n },\n trackingId: _this5.trackingId,\n logLevelToken: _this5.logLevelToken\n });\n var waitForBufferState = function waitForBufferState(event) {\n if (!event.data.type && (event.data.data.eventType === 'mercury.buffer_state' || event.data.data.eventType === 'mercury.registration_status')) {\n _this5.removeListener('message', waitForBufferState);\n _this5._ping();\n resolve();\n }\n };\n _this5.once('message', waitForBufferState);\n });\n }\n\n /**\n * Deals with the fact that some browsers drop some close codes (but not\n * close reasons).\n * @param {CloseEvent} event\n * @private\n * @returns {CloseEvent}\n */\n }, {\n key: \"_fixCloseCode\",\n value: function _fixCloseCode(event) {\n if (event.code === 1005 && event.reason) {\n switch (event.reason.toLowerCase()) {\n case 'replaced':\n this.logger.info(\"socket,\".concat(this._domain, \": fixing CloseEvent code for reason: \"), event.reason);\n event.code = 4000;\n break;\n case 'authentication failed':\n case 'authentication did not happen within the timeout window of 30000 seconds.':\n this.logger.info(\"socket,\".concat(this._domain, \": fixing CloseEvent code for reason: \"), event.reason);\n event.code = 1008;\n break;\n default:\n // do nothing\n }\n }\n\n return event;\n }\n\n /**\n * Sends a ping up the socket and confirms we get it back\n * @param {[type]} id\n * @private\n * @returns {[type]}\n */\n }, {\n key: \"_ping\",\n value: function _ping(id) {\n var _this6 = this;\n var confirmPongId = function confirmPongId(event) {\n try {\n _this6.logger.debug(\"socket,\".concat(_this6._domain, \": pong\"), event.data.id);\n if (event.data && event.data.id !== id) {\n _this6.logger.info(\"socket,\".concat(_this6._domain, \": received pong for wrong ping id, closing socket\"));\n _this6.logger.debug(\"socket,\".concat(_this6._domain, \": expected\"), id, 'received', event.data.id);\n _this6.close({\n code: 1000,\n reason: 'Pong mismatch'\n });\n }\n } catch (error) {\n // This try/catch block was added as a debugging step; to the best of my\n // knowledge, the above can never throw.\n /* istanbul ignore next */\n _this6.logger.error(\"socket,\".concat(_this6._domain, \": error occurred in confirmPongId\"), error);\n }\n };\n var onPongNotReceived = function onPongNotReceived() {\n try {\n _this6.logger.info(\"socket,\".concat(_this6._domain, \": pong not receive in expected period, closing socket\"));\n _this6.close({\n code: 1000,\n reason: 'Pong not received'\n }).catch(function (reason) {\n _this6.logger.warn(\"socket,\".concat(_this6._domain, \": failed to close socket after missed pong\"), reason);\n });\n } catch (error) {\n // This try/catch block was added as a debugging step; to the best of my\n // knowledge, the above can never throw.\n /* istanbul ignore next */\n _this6.logger.error(\"socket,\".concat(_this6._domain, \": error occurred in onPongNotReceived\"), error);\n }\n };\n var scheduleNextPingAndCancelPongTimer = function scheduleNextPingAndCancelPongTimer() {\n try {\n clearTimeout(_this6.pongTimer);\n _this6.pingTimer = (0, _commonTimers.safeSetTimeout)(function () {\n return _this6._ping();\n }, _this6.pingInterval);\n } catch (error) {\n // This try/catch block was added as a debugging step; to the best of my\n // knowledge, the above can never throw.\n /* istanbul ignore next */\n _this6.logger.error(\"socket,\".concat(_this6._domain, \": error occurred in scheduleNextPingAndCancelPongTimer\"), error);\n }\n };\n var calculateLatency = function calculateLatency(pingTimestamp) {\n var now = performance.now();\n var latency = now - pingTimestamp;\n _this6.logger.debug(\"socket,\".concat(_this6._domain, \": latency: \"), latency);\n _this6.emit('ping-pong-latency', latency);\n };\n id = id || _uuid.default.v4();\n var pingTimestamp = performance.now();\n this.pongTimer = (0, _commonTimers.safeSetTimeout)(onPongNotReceived, this.pongTimeout);\n this.once('pong', scheduleNextPingAndCancelPongTimer);\n this.once('pong', confirmPongId);\n this.once('pong', function () {\n return calculateLatency(pingTimestamp);\n });\n this.logger.debug(\"socket,\".concat(this._domain, \": ping \").concat(id));\n return this.send({\n id: id,\n type: 'ping'\n });\n }\n }], [{\n key: \"getWebSocketConstructor\",\n value: function getWebSocketConstructor() {\n throw new Error('Socket.getWebSocketConstructor() must be implemented in an environmentally appropriate way');\n }\n }]);\n return Socket;\n}(_events.EventEmitter);\n//# sourceMappingURL=socket-base.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _socketBase = _interopRequireDefault(require(\"./socket-base\"));\n/* eslint-disable no-restricted-globals */\n\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-env browser */\n\n_socketBase.default.getWebSocketConstructor = function getWebSocketConstructor() {\n // Grabed from https://github.com/heineiuo/isomorphic-ws/blob/9b977394ac875638c045fd9cf774ed418484b394/browser.js\n var ws;\n if (typeof WebSocket !== 'undefined') {\n ws = WebSocket;\n } else if (typeof MozWebSocket !== 'undefined') {\n // eslint-disable-next-line no-undef\n ws = MozWebSocket;\n } else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket;\n } else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket;\n } else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket;\n }\n return ws;\n};\nvar _default = exports.default = _socketBase.default;\n//# sourceMappingURL=socket.shim.js.map\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _symbol = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/symbol\"));\nvar _now = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/date/now\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _commonTimers = require(\"@webex/common-timers\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar sym = (0, _symbol.default)('metric id');\n\n/**\n * @class\n * @extends Batcher\n * @memberof Metrics\n */\nvar MetricsBatcher = _webexCore.Batcher.extend({\n namespace: 'Metrics',\n /**\n * @param {any} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n // Keep non-prod data out of metrics\n var env = process.env.NODE_ENV === 'production' ? null : 'TEST';\n item.appType = item.appType || this.config.appType;\n item.env = item.env || env;\n item.time = item.time || (0, _now.default)();\n item.version = item.version || this.webex.version;\n return _promise.default.resolve(item);\n },\n /**\n * @param {any[]} queue\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(queue) {\n return _promise.default.resolve(queue.map(function (item) {\n item.postTime = item.postTime || (0, _now.default)();\n return item;\n }));\n },\n /**\n * @param {any} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n return this.webex.request({\n method: 'POST',\n service: 'metrics',\n resource: 'metrics',\n body: {\n metrics: payload\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout\n });\n },\n /**\n * @param {any} res\n * @returns {Promise}\n */\n handleHttpSuccess: function handleHttpSuccess(res) {\n var _this = this;\n return _promise.default.all(res.options.body.metrics.map(function (item) {\n return _this.acceptItem(item);\n }));\n },\n /**\n * @param {any} reason\n * @returns {Promise}\n */\n handleHttpError: function handleHttpError(reason) {\n var _this2 = this;\n if (reason instanceof _webexCore.WebexHttpError.NetworkOrCORSError) {\n this.logger.warn('metrics-batcher: received network error submitting metrics, reenqueuing payload');\n return _promise.default.all(reason.options.body.metrics.map(function (item) {\n return new _promise.default(function (resolve) {\n var delay = item[sym].nextDelay;\n if (delay < _this2.config.batcherRetryPlateau) {\n item[sym].nextDelay *= 2;\n }\n (0, _commonTimers.safeSetTimeout)(function () {\n resolve(_this2.rerequest(item));\n }, delay);\n });\n }));\n }\n return (0, _apply.default)(_webexCore.Batcher.prototype.handleHttpError, this, [reason]);\n },\n /**\n * @param {any} item\n * @returns {Promise}\n */\n rerequest: function rerequest(item) {\n var _this3 = this;\n return _promise.default.all([this.getDeferredForRequest(item), this.prepareItem(item)]).then(function (_ref) {\n var _ref2 = (0, _slicedToArray2.default)(_ref, 2),\n defer = _ref2[0],\n req = _ref2[1];\n _this3.enqueue(req).then(function () {\n return _this3.bounce();\n }).catch(function (reason) {\n return defer.reject(reason);\n });\n });\n },\n /**\n * @param {any} item\n * @returns {Promise}\n */\n fingerprintRequest: function fingerprintRequest(item) {\n item[sym] = item[sym] || {\n nextDelay: 1000\n };\n return _promise.default.resolve(item[sym]);\n },\n /**\n * @param {any} item\n * @returns {Promise}\n */\n fingerprintResponse: function fingerprintResponse(item) {\n return _promise.default.resolve(item[sym]);\n }\n});\nvar _default = exports.default = MetricsBatcher;\n//# sourceMappingURL=batcher.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _genericMetrics = _interopRequireDefault(require(\"./generic-metrics\"));\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n/**\n * @description Util class to handle Behavioral Metrics\n * @export\n * @class BehavioralMetrics\n */\nvar BehavioralMetrics = exports.default = /*#__PURE__*/function (_GenericMetrics) {\n (0, _inherits2.default)(BehavioralMetrics, _GenericMetrics);\n var _super = _createSuper(BehavioralMetrics);\n function BehavioralMetrics() {\n (0, _classCallCheck2.default)(this, BehavioralMetrics);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(BehavioralMetrics, [{\n key: \"submitBehavioralEvent\",\n value:\n /**\n * Submit a behavioral metric to our metrics endpoint.\n * @param {MetricEventProduct} product the product from which the metric is being submitted, e.g. 'webex' web client, 'wxcc_desktop'\n * @param {MetricEventAgent} agent the source of the action for this metric\n * @param {string} target the 'thing' that this metric includes information about\n * @param {MetricEventVerb} verb the action that this metric includes information about\n * @param {EventPayload} payload information specific to this event. This should be flat, i.e. it should not include nested objects.\n * @returns {Promise}\n */\n function submitBehavioralEvent(_ref) {\n var product = _ref.product,\n agent = _ref.agent,\n target = _ref.target,\n verb = _ref.verb,\n payload = _ref.payload;\n var name = \"\".concat(product, \".\").concat(agent, \".\").concat(target, \".\").concat(verb);\n var event = this.createTaggedEventObject({\n type: ['behavioral'],\n name: name,\n payload: payload\n });\n this.submitEvent({\n kind: 'behavioral-events -> ',\n name: name,\n event: event\n });\n }\n }]);\n return BehavioralMetrics;\n}(_genericMetrics.default);\n//# sourceMappingURL=behavioral-metrics.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _genericMetrics = _interopRequireDefault(require(\"./generic-metrics\"));\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n/**\n * @description Util class to handle Business Metrics\n * @export\n * @class BusinessMetrics\n */\nvar BusinessMetrics = exports.default = /*#__PURE__*/function (_GenericMetrics) {\n (0, _inherits2.default)(BusinessMetrics, _GenericMetrics);\n var _super = _createSuper(BusinessMetrics);\n function BusinessMetrics() {\n (0, _classCallCheck2.default)(this, BusinessMetrics);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(BusinessMetrics, [{\n key: \"buildEvent\",\n value:\n /**\n * Build the metric event to submit.\n * @param {string} name of the metric\n * @param {EventPayload} payload user payload of the metric\n * @param {EventPayload} metadata to include outside of eventPayload.value\n * @returns {MetricEvent} The constructed metric event\n */\n function buildEvent(_ref) {\n var name = _ref.name,\n payload = _ref.payload,\n metadata = _ref.metadata;\n return {\n type: ['business'],\n eventPayload: _objectSpread(_objectSpread({\n key: name,\n client_timestamp: new Date().toISOString()\n }, metadata), {}, {\n value: payload\n })\n };\n }\n\n /**\n * Submit a business metric to our metrics endpoint.\n * routes to the correct table with the correct schema payload by table\n * https://confluence-eng-gpk2.cisco.com/conf/display/WAP/Business+metrics++-%3E+ROMA\n * @param {string} name of the metric, ignored if going to wbxapp_callend_metrics\n * @param {EventPayload} payload user payload of the metric\n * @param {Table} table optional - to submit the metric to and adapt the sent schema\n * @param {EventPayload} metadata optional - to include outside of eventPayload.value\n * @returns {Promise}\n */\n }, {\n key: \"submitBusinessEvent\",\n value: function submitBusinessEvent(_ref2) {\n var name = _ref2.name,\n payload = _ref2.payload,\n table = _ref2.table,\n metadata = _ref2.metadata;\n if (!table) {\n table = 'default';\n }\n if (!metadata) {\n metadata = {};\n }\n if (!metadata.appType) {\n metadata.appType = 'Web Client';\n }\n switch (table) {\n case 'wbxapp_callend_metrics':\n {\n // https://confluence-eng-gpk2.cisco.com/conf/display/WAP/Table+wbxapp_callend_metrics\n var callEndEvent = this.buildEvent({\n name: 'callEnd',\n payload: payload,\n metadata: metadata\n });\n return this.submitEvent({\n kind: 'business-events:wbxapp_callend_metrics -> ',\n name: 'wbxapp_callend_metrics',\n event: callEndEvent\n });\n }\n case 'business_metrics':\n {\n // all event payload keys are converted into a hex string value\n // unfortunately, the pinot team does not allow changes to the schema of business_metrics\n // so we have to shim this layer specifically for this\n // https://confluence-eng-gpk2.cisco.com/conf/display/WAP/Table%3A+business_metrics\n var businessEvent = this.buildEvent({\n name: name,\n payload: _objectSpread(_objectSpread(_objectSpread({}, this.getContext()), this.getBrowserDetails()), payload),\n metadata: metadata\n });\n return this.submitEvent({\n kind: 'business-events:business_metrics -> ',\n name: name,\n event: businessEvent\n });\n }\n case 'business_ucf':\n case 'default':\n default:\n {\n // all event payload keys are converted into a hex string value\n // https://confluence-eng-gpk2.cisco.com/conf/display/WAP/Business+metrics++-%3E+ROMA\n var defaultEvent = this.buildEvent({\n name: name,\n payload: payload,\n metadata: _objectSpread({\n context: this.getContext(),\n browserDetails: this.getBrowserDetails()\n }, metadata)\n });\n return this.submitEvent({\n kind: 'business-events:default -> ',\n name: name,\n event: defaultEvent\n });\n }\n }\n }\n }]);\n return BusinessMetrics;\n}(_genericMetrics.default);\n//# sourceMappingURL=business-metrics.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _lodash = require(\"lodash\");\nvar _batcher = _interopRequireDefault(require(\"../batcher\"));\nvar _callDiagnosticMetrics = require(\"./call-diagnostic-metrics.util\");\nvar _config = require(\"./config\");\nvar _utils = require(\"../utils\");\nvar CallDiagnosticEventsBatcher = _batcher.default.extend({\n namespace: 'Metrics',\n /**\n * Prepare item\n * @param {any} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n return _promise.default.resolve((0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, item));\n },\n /**\n * Prepare request, add time sensitive date etc.\n * @param {any[]} queue\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(queue) {\n // Add sent timestamp\n queue.forEach(function (item) {\n item.eventPayload.originTime = item.eventPayload.originTime || {};\n item.eventPayload.originTime.sent = new Date().toISOString();\n });\n return _promise.default.resolve(queue);\n },\n /**\n *\n * @param {any} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n var _this = this;\n var batchId = (0, _lodash.uniqueId)('ca-batch-');\n return this.webex.request({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: payload\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout\n }).then(function (res) {\n _this.webex.logger.log(_config.CALL_DIAGNOSTIC_LOG_IDENTIFIER, \"CallDiagnosticEventsBatcher: @submitHttpRequest#\".concat(batchId, \". Request successful.\"));\n return res;\n }).catch(function (err) {\n _this.webex.logger.error(_config.CALL_DIAGNOSTIC_LOG_IDENTIFIER, \"CallDiagnosticEventsBatcher: @submitHttpRequest#\".concat(batchId, \". Request failed:\"), \"error: \".concat((0, _utils.generateCommonErrorMetadata)(err)));\n return _promise.default.reject(err);\n });\n }\n});\nvar _default = exports.default = CallDiagnosticEventsBatcher;\n//# sourceMappingURL=call-diagnostic-metrics-batcher.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _map = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/map\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _webexCore = require(\"@webex/webex-core\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable class-methods-use-this */ /* eslint-disable valid-jsdoc */\n// we only care about client event and feature event for now\n/**\n * @description Helper class to store latencies timestamp and to calculate various latencies for CA.\n * @exports\n * @class CallDiagnosticLatencies\n */\nvar CallDiagnosticLatencies = exports.default = /*#__PURE__*/function (_WebexPlugin) {\n (0, _inherits2.default)(CallDiagnosticLatencies, _WebexPlugin);\n var _super = _createSuper(CallDiagnosticLatencies);\n /**\n * @constructor\n */\n function CallDiagnosticLatencies() {\n var _this;\n (0, _classCallCheck2.default)(this, CallDiagnosticLatencies);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"latencyTimestamps\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"precomputedLatencies\", void 0);\n // meetingId that the current latencies are for\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"meetingId\", void 0);\n _this.latencyTimestamps = new _map.default();\n _this.precomputedLatencies = new _map.default();\n return _this;\n }\n\n /**\n * Clear timestamps\n */\n (0, _createClass2.default)(CallDiagnosticLatencies, [{\n key: \"clearTimestamps\",\n value: function clearTimestamps() {\n this.latencyTimestamps.clear();\n this.precomputedLatencies.clear();\n }\n\n /**\n * Associate current latencies with a meeting id\n * @param meetingId\n */\n }, {\n key: \"setMeetingId\",\n value: function setMeetingId(meetingId) {\n this.meetingId = meetingId;\n }\n\n /**\n * Returns the meeting object associated with current latencies\n * @returns meeting object\n */\n }, {\n key: \"getMeeting\",\n value: function getMeeting() {\n if (this.meetingId) {\n // @ts-ignore\n return this.webex.meetings.getBasicMeetingInformation(this.meetingId);\n }\n return undefined;\n }\n\n /**\n * Store timestamp value\n * @param key - key\n * @param value - value\n * @param options - store options\n * @throws\n * @returns\n */\n }, {\n key: \"saveTimestamp\",\n value: function saveTimestamp(_ref) {\n var key = _ref.key,\n _ref$value = _ref.value,\n value = _ref$value === void 0 ? new Date().getTime() : _ref$value,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options;\n // save the meetingId so we can use the meeting object in latency calculations if needed\n var meetingId = options.meetingId;\n if (meetingId) {\n this.setMeetingId(meetingId);\n }\n // for some events we're only interested in the first timestamp not last\n // as these events can happen multiple times\n if (key === 'client.media.rx.start' || key === 'client.media.tx.start' || key === 'internal.client.meetinginfo.request' || key === 'internal.client.meetinginfo.response' || key === 'client.media-engine.remote-sdp-received') {\n this.saveFirstTimestampOnly(key, value);\n } else {\n this.latencyTimestamps.set(key, value);\n // new offer/answer so reset the remote SDP timestamp\n if (key === 'client.media-engine.local-sdp-generated') {\n this.latencyTimestamps.delete('client.media-engine.remote-sdp-received');\n }\n }\n }\n\n /**\n * Store precomputed latency value\n * @param key - key\n * @param value - value\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @throws\n * @returns\n */\n }, {\n key: \"saveLatency\",\n value: function saveLatency(key, value) {\n var accumulate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var existingValue = accumulate ? this.precomputedLatencies.get(key) || 0 : 0;\n this.precomputedLatencies.set(key, value + existingValue);\n }\n\n /**\n * Measure latency for a request\n * @param callback - callback for which you would like to measure latency\n * @param key - key\n * @param accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement\n * @returns\n */\n }, {\n key: \"measureLatency\",\n value: function measureLatency(callback, key) {\n var _this2 = this;\n var accumulate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var start = performance.now();\n return callback().finally(function () {\n _this2.saveLatency(key, performance.now() - start, accumulate);\n });\n }\n\n /**\n * Store only the first timestamp value for the given key\n * @param key - key\n * @param value -value\n * @throws\n * @returns\n */\n }, {\n key: \"saveFirstTimestampOnly\",\n value: function saveFirstTimestampOnly(key) {\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date().getTime();\n if (this.latencyTimestamps.has(key)) {\n return;\n }\n this.latencyTimestamps.set(key, value);\n }\n\n /**\n * Helper to calculate end - start\n * @param a start\n * @param b end\n * @returns latency\n */\n }, {\n key: \"getDiffBetweenTimestamps\",\n value: function getDiffBetweenTimestamps(a, b) {\n var start = this.latencyTimestamps.get(a);\n var end = this.latencyTimestamps.get(b);\n if (start && end) {\n return end - start;\n }\n return undefined;\n }\n\n /**\n * Meeting Info Request\n * @note Meeting Info request happen not just in the join phase. CA requires\n * metrics around meeting info request that are only part of join phase.\n * This internal.* event is used to track the real timestamps\n * (when the actual request/response happen). This is because the actual CA event is\n * sent inside the join method on the meeting object based on some logic, but that's not exactly when\n * those events are actually fired. The logic only confirms that they have happened, and we send them over.\n * @returns - latency\n */\n }, {\n key: \"getMeetingInfoReqResp\",\n value: function getMeetingInfoReqResp() {\n return this.getDiffBetweenTimestamps('internal.client.meetinginfo.request', 'internal.client.meetinginfo.response');\n }\n\n /**\n * Interstitial Time\n * @returns - latency\n */\n }, {\n key: \"getShowInterstitialTime\",\n value: function getShowInterstitialTime() {\n return this.getDiffBetweenTimestamps('client.interstitial-window.start-launch', 'internal.client.interstitial-window.click.joinbutton');\n }\n\n /**\n * getU2CTime\n * @returns - latency\n */\n }, {\n key: \"getU2CTime\",\n value: function getU2CTime() {\n var u2cLatency = this.precomputedLatencies.get('internal.get.u2c.time');\n return u2cLatency ? Math.floor(u2cLatency) : undefined;\n }\n\n /**\n * Device Register Time\n * @returns - latency\n */\n }, {\n key: \"getRegisterWDMDeviceJMT\",\n value: function getRegisterWDMDeviceJMT() {\n return this.getDiffBetweenTimestamps('internal.register.device.request', 'internal.register.device.response');\n }\n\n /**\n * Call Init Join Request\n * @returns - latency\n */\n }, {\n key: \"getCallInitJoinReq\",\n value: function getCallInitJoinReq() {\n return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.request');\n }\n\n /**\n * Locus Join Request\n * @returns - latency\n */\n }, {\n key: \"getJoinReqResp\",\n value: function getJoinReqResp() {\n return this.getDiffBetweenTimestamps('client.locus.join.request', 'client.locus.join.response');\n }\n\n /**\n * Time taken to do turn discovery\n * @returns - latency\n */\n }, {\n key: \"getTurnDiscoveryTime\",\n value: function getTurnDiscoveryTime() {\n return this.getDiffBetweenTimestamps('internal.client.add-media.turn-discovery.start', 'internal.client.add-media.turn-discovery.end');\n }\n\n /**\n * Local SDP Generated Remote SDP REceived\n * @returns - latency\n */\n }, {\n key: \"getLocalSDPGenRemoteSDPRecv\",\n value: function getLocalSDPGenRemoteSDPRecv() {\n return this.getDiffBetweenTimestamps('client.media-engine.local-sdp-generated', 'client.media-engine.remote-sdp-received');\n }\n\n /**\n * ICE Setup Time\n * @returns - latency\n */\n }, {\n key: \"getICESetupTime\",\n value: function getICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Audio ICE time\n * @returns - latency\n */\n }, {\n key: \"getAudioICESetupTime\",\n value: function getAudioICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Video ICE Time\n * @returns - latency\n */\n }, {\n key: \"getVideoICESetupTime\",\n value: function getVideoICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Share ICE Time\n * @returns - latency\n */\n }, {\n key: \"getShareICESetupTime\",\n value: function getShareICESetupTime() {\n return this.getDiffBetweenTimestamps('client.ice.start', 'client.ice.end');\n }\n\n /**\n * Stay Lobby Time\n * @returns - latency\n */\n }, {\n key: \"getStayLobbyTime\",\n value: function getStayLobbyTime() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'internal.host.meeting.participant.admitted');\n }\n\n /**\n * Page JMT\n * @returns - latency\n */\n }, {\n key: \"getPageJMT\",\n value: function getPageJMT() {\n return this.precomputedLatencies.get('internal.client.pageJMT') || undefined;\n }\n\n /**\n * Download Time JMT\n * @returns - latency\n */\n }, {\n key: \"getDownloadTimeJMT\",\n value: function getDownloadTimeJMT() {\n return this.precomputedLatencies.get('internal.download.time') || undefined;\n }\n\n /**\n * Click To Interstitial\n * @returns - latency\n */\n }, {\n key: \"getClickToInterstitial\",\n value: function getClickToInterstitial() {\n // for normal join (where green join button exists before interstitial, i.e reminder, space list etc)\n if (this.latencyTimestamps.get('internal.client.meeting.click.joinbutton')) {\n return this.getDiffBetweenTimestamps('internal.client.meeting.click.joinbutton', 'internal.client.meeting.interstitial-window.showed');\n }\n\n // for cross launch and guest flows\n return this.precomputedLatencies.get('internal.click.to.interstitial') || undefined;\n }\n\n /**\n * Interstitial To Join Ok\n * @returns - latency\n */\n }, {\n key: \"getInterstitialToJoinOK\",\n value: function getInterstitialToJoinOK() {\n return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.locus.join.response');\n }\n\n /**\n * Call Init To MediaEngineReady\n * @returns - latency\n */\n }, {\n key: \"getCallInitMediaEngineReady\",\n value: function getCallInitMediaEngineReady() {\n return this.getDiffBetweenTimestamps('internal.client.interstitial-window.click.joinbutton', 'client.media-engine.ready');\n }\n\n /**\n * Interstitial To Media Ok\n * @returns - latency\n */\n }, {\n key: \"getInterstitialToMediaOKJMT\",\n value: function getInterstitialToMediaOKJMT() {\n var interstitialJoinClickTimestamp = this.latencyTimestamps.get('internal.client.interstitial-window.click.joinbutton');\n\n // get the first timestamp\n var connectedMedia = this.latencyTimestamps.get('client.ice.end');\n var lobbyTime = this.getStayLobbyTime() || 0;\n if (interstitialJoinClickTimestamp && connectedMedia) {\n return connectedMedia - interstitialJoinClickTimestamp - lobbyTime;\n }\n return undefined;\n }\n\n /**\n * Total JMT\n * @returns - latency\n */\n }, {\n key: \"getTotalJMT\",\n value: function getTotalJMT() {\n var clickToInterstitial = this.getClickToInterstitial();\n var interstitialToJoinOk = this.getInterstitialToJoinOK();\n if (clickToInterstitial && interstitialToJoinOk) {\n return clickToInterstitial + interstitialToJoinOk;\n }\n return undefined;\n }\n\n /**\n * Join Conf JMT\n * @returns - latency\n */\n }, {\n key: \"getJoinConfJMT\",\n value: function getJoinConfJMT() {\n var joinReqResp = this.getJoinReqResp();\n var ICESetupTime = this.getICESetupTime();\n if (joinReqResp && ICESetupTime) {\n return joinReqResp + ICESetupTime;\n }\n return undefined;\n }\n\n /**\n * Total Media JMT\n * @returns - latency\n */\n }, {\n key: \"getTotalMediaJMT\",\n value: function getTotalMediaJMT() {\n var clickToInterstitial = this.getClickToInterstitial();\n var interstitialToJoinOk = this.getInterstitialToJoinOK();\n var joinConfJMT = this.getJoinConfJMT();\n var lobbyTime = this.getStayLobbyTime();\n if (clickToInterstitial && interstitialToJoinOk && joinConfJMT) {\n var _this$getMeeting;\n var totalMediaJMT = clickToInterstitial + interstitialToJoinOk + joinConfJMT;\n if ((_this$getMeeting = this.getMeeting()) !== null && _this$getMeeting !== void 0 && _this$getMeeting.allowMediaInLobby) {\n return totalMediaJMT;\n }\n return totalMediaJMT - lobbyTime;\n }\n return undefined;\n }\n\n /**\n * Client JMT\n * @returns - latency\n */\n }, {\n key: \"getClientJMT\",\n value: function getClientJMT() {\n var interstitialToJoinOk = this.getInterstitialToJoinOK();\n var joinConfJMT = this.getJoinConfJMT();\n if (interstitialToJoinOk && joinConfJMT) {\n return interstitialToJoinOk - joinConfJMT;\n }\n return undefined;\n }\n\n /**\n * Audio setup delay receive\n */\n }, {\n key: \"getAudioJoinRespRxStart\",\n value: function getAudioJoinRespRxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');\n }\n\n /**\n * Video setup delay receive\n */\n }, {\n key: \"getVideoJoinRespRxStart\",\n value: function getVideoJoinRespRxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.rx.start');\n }\n\n /**\n * Total latency for all get cluster request.\n */\n }, {\n key: \"getReachabilityClustersReqResp\",\n value: function getReachabilityClustersReqResp() {\n var reachablityClusterReqResp = this.precomputedLatencies.get('internal.get.cluster.time');\n return reachablityClusterReqResp ? Math.floor(reachablityClusterReqResp) : undefined;\n }\n\n /**\n * Audio setup delay transmit\n */\n }, {\n key: \"getAudioJoinRespTxStart\",\n value: function getAudioJoinRespTxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');\n }\n\n /**\n * Video setup delay transmit\n */\n }, {\n key: \"getVideoJoinRespTxStart\",\n value: function getVideoJoinRespTxStart() {\n return this.getDiffBetweenTimestamps('client.locus.join.response', 'client.media.tx.start');\n }\n\n /**\n * Total latency for all exchange ci token.\n */\n }, {\n key: \"getExchangeCITokenJMT\",\n value: function getExchangeCITokenJMT() {\n var exchangeCITokenJMT = this.precomputedLatencies.get('internal.exchange.ci.token.time');\n return exchangeCITokenJMT ? Math.floor(exchangeCITokenJMT) : undefined;\n }\n\n /**\n * Total latency for all refresh captcha requests.\n */\n }, {\n key: \"getRefreshCaptchaReqResp\",\n value: function getRefreshCaptchaReqResp() {\n var refreshCaptchaReqResp = this.precomputedLatencies.get('internal.refresh.captcha.time');\n return refreshCaptchaReqResp ? Math.floor(refreshCaptchaReqResp) : undefined;\n }\n\n /**\n * Get the latency for downloading intelligence models.\n * @returns - latency\n */\n }, {\n key: \"getDownloadIntelligenceModelsReqResp\",\n value: function getDownloadIntelligenceModelsReqResp() {\n var downloadIntelligenceModelsReqResp = this.precomputedLatencies.get('internal.api.fetch.intelligence.models');\n return downloadIntelligenceModelsReqResp ? Math.floor(downloadIntelligenceModelsReqResp) : undefined;\n }\n\n /**\n * Get the total latency for all other app API requests.\n * Excludes meeting info, because it's measured separately.\n * @returns - latency\n */\n }, {\n key: \"getOtherAppApiReqResp\",\n value: function getOtherAppApiReqResp() {\n var otherAppApiJMT = this.precomputedLatencies.get('internal.other.app.api.time');\n return otherAppApiJMT > 0 ? Math.floor(otherAppApiJMT) : undefined;\n }\n }]);\n return CallDiagnosticLatencies;\n}(_webexCore.WebexPlugin);\n//# sourceMappingURL=call-diagnostic-metrics-latencies.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _regenerator = _interopRequireDefault(require(\"@babel/runtime-corejs2/regenerator\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _common = require(\"@webex/common\");\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\nvar _lodash = require(\"lodash\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _metrics = require(\"../metrics\");\nvar _callDiagnosticMetrics = require(\"./call-diagnostic-metrics.util\");\nvar _config = require(\"../config\");\nvar _callDiagnosticMetricsBatcher = _interopRequireDefault(require(\"./call-diagnostic-metrics-batcher\"));\nvar _preloginMetricsBatcher = _interopRequireDefault(require(\"../prelogin-metrics-batcher\"));\nvar _config2 = require(\"./config\");\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable class-methods-use-this */ /* eslint-disable valid-jsdoc */\nvar _BrowserDetection = (0, _common.BrowserDetection)(),\n getOSVersion = _BrowserDetection.getOSVersion,\n getBrowserName = _BrowserDetection.getBrowserName,\n getBrowserVersion = _BrowserDetection.getBrowserVersion;\n/**\n * @description Util class to handle Call Analyzer Metrics\n * @export\n * @class CallDiagnosticMetrics\n */\nvar CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {\n (0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);\n var _super = _createSuper(CallDiagnosticMetrics);\n /**\n * Constructor\n * @param args\n */\n function CallDiagnosticMetrics() {\n var _this;\n (0, _classCallCheck2.default)(this, CallDiagnosticMetrics);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n // @ts-ignore\n // @ts-ignore\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"callDiagnosticEventsBatcher\", void 0);\n // @ts-ignore\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"preLoginMetricsBatcher\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"logger\", void 0);\n // to avoid adding @ts-ignore everywhere\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"hasLoggedBrowserSerial\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"device\", void 0);\n // the default validator before piping an event to the batcher\n // this function can be overridden by the user\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"validator\", function (options) {\n return _promise.default.resolve({\n event: options === null || options === void 0 ? void 0 : options.event,\n valid: true\n });\n });\n /**\n * Prepare the event and send the request to metrics-a service, pre login.\n * @param event\n * @param preLoginId\n * @returns\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"submitToCallDiagnosticsPreLogin\", function (event, preLoginId) {\n // build metrics-a event type\n var finalEvent = {\n eventPayload: event,\n type: ['diagnostic-event']\n };\n _this.preLoginMetricsBatcher.savePreLoginId(preLoginId);\n return _this.preLoginMetricsBatcher.request(finalEvent);\n });\n _this.logger = _this.webex.logger;\n // @ts-ignore\n _this.callDiagnosticEventsBatcher = new _callDiagnosticMetricsBatcher.default({}, {\n parent: _this.webex\n });\n // @ts-ignore\n _this.preLoginMetricsBatcher = new _preloginMetricsBatcher.default({}, {\n parent: _this.webex\n });\n return _this;\n }\n\n /**\n * Returns the login type of the current user\n * @returns one of 'login-ci','unverified-guest', null\n */\n (0, _createClass2.default)(CallDiagnosticMetrics, [{\n key: \"getCurLoginType\",\n value: function getCurLoginType() {\n // @ts-ignore\n if (this.webex.canAuthorize) {\n // @ts-ignore\n return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';\n }\n return null;\n }\n\n /**\n * Returns if the meeting has converged architecture enabled\n * @param options.meetingId\n */\n }, {\n key: \"getIsConvergedArchitectureEnabled\",\n value: function getIsConvergedArchitectureEnabled(_ref) {\n var meetingId = _ref.meetingId;\n if (meetingId) {\n var _meeting$meetingInfo;\n // @ts-ignore\n var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);\n return meeting === null || meeting === void 0 ? void 0 : (_meeting$meetingInfo = meeting.meetingInfo) === null || _meeting$meetingInfo === void 0 ? void 0 : _meeting$meetingInfo.enableConvergedArchitecture;\n }\n return undefined;\n }\n\n /**\n * Returns meeting's subServiceType\n * @param meeting\n * @returns\n */\n }, {\n key: \"getSubServiceType\",\n value: function getSubServiceType(meeting) {\n if (meeting) {\n // @ts-ignore\n var meetingInfo = meeting === null || meeting === void 0 ? void 0 : meeting.meetingInfo;\n // if not Scheduled, not Webinar, pmr - then pmr\n if (!(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled) && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr) {\n return _config2.WEBEX_SUB_SERVICE_TYPES.PMR;\n }\n // if Scheduled, not Webinar, not pmr - then ScheduledMeeting\n if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr)) {\n return _config2.WEBEX_SUB_SERVICE_TYPES.SCHEDULED_MEETING;\n }\n // if Scheduled, Webinar, not pmr - then Webinar\n if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr)) {\n return _config2.WEBEX_SUB_SERVICE_TYPES.WEBINAR;\n }\n }\n return undefined;\n }\n\n /**\n * Get origin object for Call Diagnostic Event payload.\n * @param options\n * @param meetingId\n * @returns\n */\n }, {\n key: \"getOrigin\",\n value: function getOrigin(options, meetingId) {\n var _this$webex$meetings$, _this$webex$meetings$2, _this$webex$meetings$3, _this$webex$meetings$4, _this$webex$meetings$5, _this$webex$meetings$6;\n var defaultClientType = // @ts-ignore\n (_this$webex$meetings$ = this.webex.meetings.config) === null || _this$webex$meetings$ === void 0 ? void 0 : (_this$webex$meetings$2 = _this$webex$meetings$.metrics) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.clientType;\n var defaultSubClientType = // @ts-ignore\n (_this$webex$meetings$3 = this.webex.meetings.config) === null || _this$webex$meetings$3 === void 0 ? void 0 : (_this$webex$meetings$4 = _this$webex$meetings$3.metrics) === null || _this$webex$meetings$4 === void 0 ? void 0 : _this$webex$meetings$4.subClientType;\n // @ts-ignore\n var providedClientVersion = (_this$webex$meetings$5 = this.webex.meetings.config) === null || _this$webex$meetings$5 === void 0 ? void 0 : (_this$webex$meetings$6 = _this$webex$meetings$5.metrics) === null || _this$webex$meetings$6 === void 0 ? void 0 : _this$webex$meetings$6.clientVersion;\n // @ts-ignore\n var defaultSDKClientVersion = \"\".concat(_config.CLIENT_NAME, \"/\").concat(this.webex.version);\n var versionMetadata = {};\n\n // sdk version split doesn't really make sense for now...\n if (providedClientVersion) {\n versionMetadata = (0, _callDiagnosticMetrics.extractVersionMetadata)(providedClientVersion);\n }\n if (!this.hasLoggedBrowserSerial) {\n this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, \"CallDiagnosticMetrics: @createClientEventObjectInMeeting => collected browser data\", (0, _stringify.default)((0, _common.getBrowserSerial)()));\n this.hasLoggedBrowserSerial = true;\n }\n if (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {\n var _this$webex$meetings, _this$webex$meetings$7, _this$webex$meetings$8, _this$webex$meetings$9, _this$webex$meetings$10, _this$webex$meetings$11;\n var origin = {\n name: 'endpoint',\n networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',\n userAgent: (0, _callDiagnosticMetrics.userAgentToString)({\n // @ts-ignore\n clientName: (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$7 = _this$webex$meetings.config) === null || _this$webex$meetings$7 === void 0 ? void 0 : (_this$webex$meetings$8 = _this$webex$meetings$7.metrics) === null || _this$webex$meetings$8 === void 0 ? void 0 : _this$webex$meetings$8.clientName,\n // @ts-ignore\n webexVersion: this.webex.version\n }),\n clientInfo: _objectSpread(_objectSpread({\n clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,\n clientVersion: providedClientVersion || defaultSDKClientVersion\n }, versionMetadata), {}, {\n publicNetworkPrefix:\n // @ts-ignore\n (0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$meetings$9 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$9 === void 0 ? void 0 : _this$webex$meetings$9.clientAddress) || undefined,\n localNetworkPrefix: (0, _callDiagnosticMetrics.anonymizeIPAddress)( // @ts-ignore\n (_this$webex$meetings$10 = this.webex.meetings.meetingCollection.get(meetingId)) === null || _this$webex$meetings$10 === void 0 ? void 0 : (_this$webex$meetings$11 = _this$webex$meetings$10.statsAnalyzer) === null || _this$webex$meetings$11 === void 0 ? void 0 : _this$webex$meetings$11.getLocalIpAddress()) || undefined,\n osVersion: getOSVersion() || 'unknown',\n subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,\n os: (0, _metrics.getOSNameInternal)(),\n browser: getBrowserName(),\n browserVersion: getBrowserVersion()\n })\n };\n if (meetingId) {\n // @ts-ignore\n var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);\n if (meeting !== null && meeting !== void 0 && meeting.environment) {\n origin.environment = meeting.environment;\n }\n }\n if (options !== null && options !== void 0 && options.environment) {\n origin.environment = options.environment;\n }\n if (options !== null && options !== void 0 && options.newEnvironment) {\n origin.newEnvironment = options.newEnvironment;\n }\n if (options !== null && options !== void 0 && options.clientLaunchMethod) {\n origin.clientInfo.clientLaunchMethod = options.clientLaunchMethod;\n }\n if (options !== null && options !== void 0 && options.browserLaunchMethod) {\n origin.clientInfo.browserLaunchMethod = options.browserLaunchMethod;\n }\n return origin;\n }\n throw new Error(\"ClientType and SubClientType can't be undefined\");\n }\n\n /**\n * Gather identifier details for call diagnostic payload.\n * @throws Error if initialization fails.\n * @param options\n */\n }, {\n key: \"getIdentifiers\",\n value: function getIdentifiers(options) {\n var _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo3, _meeting$meetingInfo6, _meeting$meetingInfo8;\n var meeting = options.meeting,\n mediaConnections = options.mediaConnections,\n correlationId = options.correlationId,\n webexConferenceIdStr = options.webexConferenceIdStr,\n globalMeetingId = options.globalMeetingId,\n preLoginId = options.preLoginId,\n sessionCorrelationId = options.sessionCorrelationId;\n var identifiers = {\n correlationId: 'unknown' // concerned with setting this to unknown. This will fail diagnostic events parsing because it's not a uuid pattern\n };\n\n if (meeting) {\n identifiers.correlationId = meeting.correlationId;\n if (meeting.sessionCorrelationId) {\n identifiers.sessionCorrelationId = meeting.sessionCorrelationId;\n }\n }\n if (sessionCorrelationId) {\n identifiers.sessionCorrelationId = sessionCorrelationId;\n }\n if (sessionCorrelationId) {\n identifiers.sessionCorrelationId = sessionCorrelationId;\n }\n if (correlationId) {\n identifiers.correlationId = correlationId;\n }\n\n // TODO: should we use patterns.uuid to validate correlationId and session correlation id? they will fail the diagnostic events validation pipeline if improperly formatted\n\n if (this.device) {\n var device = this.device;\n var _ref2 = (device === null || device === void 0 ? void 0 : device.config) || {},\n installationId = _ref2.installationId;\n identifiers.userId = (device === null || device === void 0 ? void 0 : device.userId) || preLoginId;\n identifiers.deviceId = device === null || device === void 0 ? void 0 : device.url;\n identifiers.orgId = device === null || device === void 0 ? void 0 : device.orgId;\n // @ts-ignore\n identifiers.locusUrl = this.webex.internal.services.get('locus');\n if (installationId) {\n identifiers.machineId = installationId;\n }\n }\n if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {\n identifiers.locusUrl = meeting.locusUrl;\n identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();\n identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;\n }\n if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo2 = meeting.meetingInfo) !== null && _meeting$meetingInfo2 !== void 0 && _meeting$meetingInfo2.confIdStr || meeting !== null && meeting !== void 0 && (_meeting$meetingInfo3 = meeting.meetingInfo) !== null && _meeting$meetingInfo3 !== void 0 && _meeting$meetingInfo3.confID) {\n var _meeting$meetingInfo4, _meeting$meetingInfo5;\n identifiers.webexConferenceIdStr = \"\".concat(((_meeting$meetingInfo4 = meeting.meetingInfo) === null || _meeting$meetingInfo4 === void 0 ? void 0 : _meeting$meetingInfo4.confIdStr) || ((_meeting$meetingInfo5 = meeting.meetingInfo) === null || _meeting$meetingInfo5 === void 0 ? void 0 : _meeting$meetingInfo5.confID));\n }\n if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo6 = meeting.meetingInfo) !== null && _meeting$meetingInfo6 !== void 0 && _meeting$meetingInfo6.meetingId) {\n var _meeting$meetingInfo7;\n identifiers.globalMeetingId = (_meeting$meetingInfo7 = meeting.meetingInfo) === null || _meeting$meetingInfo7 === void 0 ? void 0 : _meeting$meetingInfo7.meetingId;\n }\n if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo8 = meeting.meetingInfo) !== null && _meeting$meetingInfo8 !== void 0 && _meeting$meetingInfo8.siteName) {\n var _meeting$meetingInfo9;\n identifiers.webexSiteName = (_meeting$meetingInfo9 = meeting.meetingInfo) === null || _meeting$meetingInfo9 === void 0 ? void 0 : _meeting$meetingInfo9.siteName;\n }\n if (mediaConnections) {\n var _mediaConnections$, _mediaConnections$2;\n identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;\n identifiers.mediaAgentGroupId = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$2 = mediaConnections[0]) === null || _mediaConnections$2 === void 0 ? void 0 : _mediaConnections$2.mediaAgentGroupId;\n }\n if (!(identifiers !== null && identifiers !== void 0 && identifiers.webexConferenceIdStr) && webexConferenceIdStr) {\n identifiers.webexConferenceIdStr = \"\".concat(webexConferenceIdStr);\n }\n if (!(identifiers !== null && identifiers !== void 0 && identifiers.globalMeetingId) && globalMeetingId) {\n identifiers.globalMeetingId = globalMeetingId;\n }\n if (identifiers.correlationId === undefined) {\n throw new Error('Identifiers initialization failed.');\n }\n return identifiers;\n }\n\n /**\n * Create diagnostic event, which can hold client event, feature event or MQE event data.\n * This just initiates the shared properties that are required for all the 3 event categories.\n * @param eventData\n * @param options\n * @returns\n */\n }, {\n key: \"prepareDiagnosticEvent\",\n value: function prepareDiagnosticEvent(eventData, options) {\n var _this$webex$meetings$12;\n var meetingId = options.meetingId,\n triggeredTime = options.triggeredTime;\n var origin = this.getOrigin(options, meetingId);\n var event = {\n eventId: _uuid.default.v4(),\n version: 1,\n origin: origin,\n originTime: {\n triggered: triggeredTime || new Date().toISOString(),\n // is overridden in prepareRequest batcher\n sent: 'not_defined_yet'\n },\n // @ts-ignore\n senderCountryCode: (_this$webex$meetings$12 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$12 === void 0 ? void 0 : _this$webex$meetings$12.countryCode,\n event: eventData\n };\n\n // sanitize (remove empty properties, CA requires it)\n // but we don't want to sanitize MQE as most of the times\n // values will be 0, [] etc, and they are required.\n if (eventData.name !== 'client.mediaquality.event') {\n (0, _callDiagnosticMetrics.clearEmptyKeysRecursively)(event);\n }\n return event;\n }\n\n /**\n * TODO: NOT IMPLEMENTED\n * Submit Feature Event\n * @returns\n */\n }, {\n key: \"submitFeatureEvent\",\n value: function submitFeatureEvent() {\n throw Error('Not implemented');\n }\n\n /**\n * Submit Media Quality Event\n * @param args - submit params\n * @param arg.name - event key\n * @param arg.payload - additional payload to be merge with the default payload\n * @param arg.options - options\n */\n }, {\n key: \"submitMQE\",\n value: function submitMQE(_ref3) {\n var name = _ref3.name,\n payload = _ref3.payload,\n options = _ref3.options;\n var meetingId = options.meetingId,\n mediaConnections = options.mediaConnections,\n webexConferenceIdStr = options.webexConferenceIdStr,\n globalMeetingId = options.globalMeetingId;\n\n // events that will most likely happen in join phase\n if (meetingId) {\n // @ts-ignore\n var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);\n if (!meeting) {\n console.warn('Attempt to send MQE but no meeting was found...', \"event: \".concat(name, \", meetingId: \").concat(meetingId));\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId: meetingId,\n name: name\n }\n });\n return;\n }\n\n // merge identifiers\n var identifiers = this.getIdentifiers({\n meeting: meeting,\n mediaConnections: meeting.mediaConnections || mediaConnections,\n webexConferenceIdStr: webexConferenceIdStr,\n globalMeetingId: globalMeetingId\n });\n\n // create media quality event object\n var clientEventObject = {\n name: name,\n canProceed: true,\n identifiers: identifiers,\n eventData: {\n webClientDomain: window.location.hostname\n },\n intervals: payload.intervals,\n callingServiceType: 'LOCUS',\n meetingJoinInfo: {\n clientSignallingProtocol: 'WebRTC'\n },\n sourceMetadata: {\n applicationSoftwareType: _config.CLIENT_NAME,\n // @ts-ignore\n applicationSoftwareVersion: this.webex.version,\n mediaEngineSoftwareType: getBrowserName() || 'browser',\n mediaEngineSoftwareVersion: getOSVersion() || 'unknown',\n startTime: new Date().toISOString()\n }\n };\n\n // merge any new properties, or override existing ones\n clientEventObject = (0, _lodash.merge)(clientEventObject, payload);\n\n // append media quality event data to the call diagnostic event\n var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n this.validator({\n type: 'mqe',\n event: diagnosticEvent\n });\n this.submitToCallDiagnostics(diagnosticEvent);\n } else {\n throw new Error('Media quality events cant be sent outside the context of a meeting. Meeting id is required.');\n }\n }\n\n /**\n * Return Client Event payload by client error code\n * @param arg - get error arg\n * @param arg.clientErrorCode\n * @param arg.serviceErrorCode\n * @param arg.payloadOverrides\n * @param arg.httpStatusCode\n * @returns\n */\n }, {\n key: \"getErrorPayloadForClientErrorCode\",\n value: function getErrorPayloadForClientErrorCode(_ref4) {\n var clientErrorCode = _ref4.clientErrorCode,\n serviceErrorCode = _ref4.serviceErrorCode,\n serviceErrorName = _ref4.serviceErrorName,\n rawErrorMessage = _ref4.rawErrorMessage,\n payloadOverrides = _ref4.payloadOverrides,\n httpStatusCode = _ref4.httpStatusCode;\n var error;\n if (clientErrorCode) {\n var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n if (partialParsedError) {\n error = (0, _lodash.merge)({\n fatal: true,\n shownToUser: false,\n name: 'other',\n category: 'other'\n },\n // default values\n {\n errorCode: clientErrorCode\n }, serviceErrorName ? {\n errorData: {\n errorName: serviceErrorName\n }\n } : {}, {\n serviceErrorCode: serviceErrorCode\n }, {\n rawErrorMessage: rawErrorMessage\n }, httpStatusCode === undefined ? {} : {\n httpStatusCode: httpStatusCode\n }, partialParsedError, payloadOverrides || {});\n return error;\n }\n }\n return undefined;\n }\n\n /**\n * Generate error payload for Client Event\n * @param rawError\n */\n }, {\n key: \"generateClientEventErrorPayload\",\n value: function generateClientEventErrorPayload(rawError) {\n var _rawError$error, _rawError$error$body, _rawError$body, _rawError$body2, _rawError$body3, _rawError$body3$reaso;\n var rawErrorMessage = rawError.message;\n var httpStatusCode = rawError.statusCode;\n if (rawError.name) {\n if ((0, _callDiagnosticMetrics.isBrowserMediaErrorName)(rawError.name)) {\n return this.getErrorPayloadForClientErrorCode({\n serviceErrorCode: undefined,\n clientErrorCode: _config2.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],\n serviceErrorName: rawError.name,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n }\n if ((0, _callDiagnosticMetrics.isSdpOfferCreationError)(rawError)) {\n var _rawError$cause;\n // error code is 30005, but that's not specific enough. we also need to check error.cause.type\n var causeType = (_rawError$cause = rawError.cause) === null || _rawError$cause === void 0 ? void 0 : _rawError$cause.type;\n return this.getErrorPayloadForClientErrorCode({\n serviceErrorCode: undefined,\n clientErrorCode: _config2.SDP_OFFER_CREATION_ERROR_MAP[causeType] || _config2.SDP_OFFER_CREATION_ERROR_MAP.GENERAL,\n serviceErrorName: rawError.name,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n var serviceErrorCode = (rawError === null || rawError === void 0 ? void 0 : (_rawError$error = rawError.error) === null || _rawError$error === void 0 ? void 0 : (_rawError$error$body = _rawError$error.body) === null || _rawError$error$body === void 0 ? void 0 : _rawError$error$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body = rawError.body) === null || _rawError$body === void 0 ? void 0 : _rawError$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body2 = rawError.body) === null || _rawError$body2 === void 0 ? void 0 : _rawError$body2.code) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body3 = rawError.body) === null || _rawError$body3 === void 0 ? void 0 : (_rawError$body3$reaso = _rawError$body3.reason) === null || _rawError$body3$reaso === void 0 ? void 0 : _rawError$body3$reaso.reasonCode);\n if (serviceErrorCode) {\n var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n if (clientErrorCode) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: clientErrorCode,\n serviceErrorCode: serviceErrorCode,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n\n // by default, if it is locus error, return new locus err\n if ((0, _callDiagnosticMetrics.isLocusServiceErrorCode)(serviceErrorCode)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: _config2.NEW_LOCUS_ERROR_CLIENT_CODE,\n serviceErrorCode: serviceErrorCode,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n }\n if ((0, _callDiagnosticMetrics.isMeetingInfoServiceError)(rawError)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: _config2.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n serviceErrorCode: serviceErrorCode,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n if ((0, _callDiagnosticMetrics.isNetworkError)(rawError)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: _config2.NETWORK_ERROR,\n serviceErrorCode: serviceErrorCode,\n payloadOverrides: rawError.payloadOverrides,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n if ((0, _callDiagnosticMetrics.isUnauthorizedError)(rawError)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: _config2.AUTHENTICATION_FAILED_CODE,\n serviceErrorCode: serviceErrorCode,\n payloadOverrides: rawError.payloadOverrides,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n\n // otherwise return unkown error but passing serviceErrorCode and serviceErrorName so that we know the issue\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: _config2.UNKNOWN_ERROR,\n serviceErrorCode: serviceErrorCode || _config2.UNKNOWN_ERROR,\n serviceErrorName: rawError === null || rawError === void 0 ? void 0 : rawError.name,\n payloadOverrides: rawError.payloadOverrides,\n rawErrorMessage: rawErrorMessage,\n httpStatusCode: httpStatusCode\n });\n }\n\n /**\n * Create client event object for in meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - options\n * @returns object\n */\n }, {\n key: \"createClientEventObjectInMeeting\",\n value: function createClientEventObjectInMeeting(_ref5) {\n var _options$joinFlowVers, _meeting$callStateFor;\n var name = _ref5.name,\n options = _ref5.options,\n errors = _ref5.errors;\n var meetingId = options.meetingId,\n mediaConnections = options.mediaConnections,\n globalMeetingId = options.globalMeetingId,\n webexConferenceIdStr = options.webexConferenceIdStr,\n sessionCorrelationId = options.sessionCorrelationId;\n\n // @ts-ignore\n var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);\n if (!meeting) {\n console.warn('Attempt to send client event but no meeting was found...', \"name: \".concat(name, \", meetingId: \").concat(meetingId));\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId: meetingId,\n name: name\n }\n });\n return undefined;\n }\n\n // grab identifiers\n var identifiers = this.getIdentifiers({\n meeting: meeting,\n mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections,\n webexConferenceIdStr: webexConferenceIdStr,\n globalMeetingId: globalMeetingId,\n sessionCorrelationId: sessionCorrelationId\n });\n\n // create client event object\n var clientEventObject = {\n name: name,\n canProceed: true,\n identifiers: identifiers,\n errors: errors,\n eventData: {\n webClientDomain: window.location.hostname\n },\n userType: meeting.getCurUserType(),\n loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),\n isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({\n meetingId: meetingId\n }),\n webexSubServiceType: this.getSubServiceType(meeting)\n };\n var joinFlowVersion = (_options$joinFlowVers = options.joinFlowVersion) !== null && _options$joinFlowVers !== void 0 ? _options$joinFlowVers : (_meeting$callStateFor = meeting.callStateForMetrics) === null || _meeting$callStateFor === void 0 ? void 0 : _meeting$callStateFor.joinFlowVersion;\n if (joinFlowVersion) {\n clientEventObject.joinFlowVersion = joinFlowVersion;\n }\n if (options.meetingJoinPhase) {\n clientEventObject.meetingJoinPhase = options.meetingJoinPhase;\n }\n return clientEventObject;\n }\n\n /**\n * Create client event object for pre meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - payload\n * @returns object\n */\n }, {\n key: \"createClientEventObjectPreMeeting\",\n value: function createClientEventObjectPreMeeting(_ref6) {\n var name = _ref6.name,\n options = _ref6.options,\n errors = _ref6.errors;\n var correlationId = options.correlationId,\n globalMeetingId = options.globalMeetingId,\n webexConferenceIdStr = options.webexConferenceIdStr,\n preLoginId = options.preLoginId,\n sessionCorrelationId = options.sessionCorrelationId;\n\n // grab identifiers\n var identifiers = this.getIdentifiers({\n correlationId: correlationId,\n sessionCorrelationId: sessionCorrelationId,\n preLoginId: preLoginId,\n globalMeetingId: globalMeetingId,\n webexConferenceIdStr: webexConferenceIdStr\n });\n\n // create client event object\n var clientEventObject = {\n name: name,\n errors: errors,\n canProceed: true,\n identifiers: identifiers,\n eventData: {\n webClientDomain: window.location.hostname\n },\n loginType: this.getCurLoginType()\n };\n if (options.joinFlowVersion) {\n clientEventObject.joinFlowVersion = options.joinFlowVersion;\n }\n if (options.meetingJoinPhase) {\n clientEventObject.meetingJoinPhase = options.meetingJoinPhase;\n }\n return clientEventObject;\n }\n\n /**\n * Prepare Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @returns {any} options to be with fetch\n * @throws\n */\n }, {\n key: \"prepareClientEvent\",\n value: function prepareClientEvent(_ref7) {\n var name = _ref7.name,\n payload = _ref7.payload,\n options = _ref7.options;\n var meetingId = options.meetingId,\n correlationId = options.correlationId,\n rawError = options.rawError;\n var clientEventObject;\n\n // check if we need to generate errors\n var errors = [];\n if (rawError) {\n var generatedError = this.generateClientEventErrorPayload(rawError);\n if (generatedError) {\n errors.push(generatedError);\n }\n this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:', \"generatedError: \".concat((0, _stringify.default)(generatedError)));\n }\n\n // events that will most likely happen in join phase\n if (meetingId) {\n clientEventObject = this.createClientEventObjectInMeeting({\n name: name,\n options: options,\n errors: errors\n });\n } else if (correlationId) {\n // any pre join events or events that are outside the meeting.\n clientEventObject = this.createClientEventObjectPreMeeting({\n name: name,\n options: options,\n errors: errors\n });\n } else {\n throw new Error('Not implemented');\n }\n\n // merge any new properties, or override existing ones\n clientEventObject = (0, _lodash.merge)(clientEventObject, payload);\n\n // append client event data to the call diagnostic event\n var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n return diagnosticEvent;\n }\n\n /**\n * Submit Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @throws\n */\n }, {\n key: \"submitClientEvent\",\n value: function submitClientEvent(_ref8) {\n var name = _ref8.name,\n payload = _ref8.payload,\n options = _ref8.options;\n this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.', \"name: \".concat(name));\n var diagnosticEvent = this.prepareClientEvent({\n name: name,\n payload: payload,\n options: options\n });\n if (options !== null && options !== void 0 && options.preLoginId) {\n return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options === null || options === void 0 ? void 0 : options.preLoginId);\n }\n this.validator({\n type: 'ce',\n event: diagnosticEvent\n });\n return this.submitToCallDiagnostics(diagnosticEvent);\n }\n\n /**\n * Prepare the event and send the request to metrics-a service.\n * @param event\n * @returns promise\n */\n }, {\n key: \"submitToCallDiagnostics\",\n value: function submitToCallDiagnostics(event) {\n // build metrics-a event type\n var finalEvent = {\n eventPayload: event,\n type: ['diagnostic-event']\n };\n return this.callDiagnosticEventsBatcher.request(finalEvent);\n }\n }, {\n key: \"buildClientEventFetchRequestOptions\",\n value: (\n /**\n * Builds a request options object to later be passed to fetch().\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - client event options\n * @returns {Promise}\n * @throws\n */\n function () {\n var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref9) {\n var name, payload, options, clientEvent, diagnosticEvent, request;\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n name = _ref9.name, payload = _ref9.payload, options = _ref9.options;\n this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', \"name: \".concat(name));\n clientEvent = this.prepareClientEvent({\n name: name,\n payload: payload,\n options: options\n }); // build metrics-a event type\n // @ts-ignore\n diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, {\n eventPayload: clientEvent,\n type: ['diagnostic-event']\n });\n request = {\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: [diagnosticEvent]\n },\n headers: {},\n // @ts-ignore\n waitForServiceTimeout: this.webex.internal.metrics.config.waitForServiceTimeout\n };\n if (options.preLoginId) {\n request.headers = {\n authorization: false,\n 'x-prelogin-userid': options.preLoginId\n };\n request.resource = 'clientmetrics-prelogin';\n }\n\n // @ts-ignore\n return _context.abrupt(\"return\", this.webex.prepareFetchOptions(request));\n case 7:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function buildClientEventFetchRequestOptions(_x) {\n return _buildClientEventFetchRequestOptions.apply(this, arguments);\n }\n return buildClientEventFetchRequestOptions;\n }()\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n )\n }, {\n key: \"isServiceErrorExpected\",\n value: function isServiceErrorExpected(serviceErrorCode) {\n var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n var clientErrorPayload = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n return (clientErrorPayload === null || clientErrorPayload === void 0 ? void 0 : clientErrorPayload.category) === 'expected';\n }\n\n /**\n * This method is used to set the device information by internal-plugin-device\n * @param {device} object The webex.internal.device object\n * @returns {undefined}\n */\n }, {\n key: \"setDeviceInfo\",\n value: function setDeviceInfo(device) {\n // This was created to fix the circular dependency between internal-plugin-device and internal-plugin-metrics\n this.logger.log('CallDiagnosticMetrics: @setDeviceInfo called', device);\n this.device = device;\n }\n }]);\n return CallDiagnosticMetrics;\n}(_webexCore.StatelessWebexPlugin);\n//# sourceMappingURL=call-diagnostic-metrics.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.userAgentToString = exports.setMetricTimings = exports.prepareDiagnosticMetricItem = exports.isUnauthorizedError = exports.isSdpOfferCreationError = exports.isNetworkError = exports.isMeetingInfoServiceError = exports.isLocusServiceErrorCode = exports.isBrowserMediaErrorName = exports.getBuildType = exports.generateClientErrorCodeForIceFailure = exports.extractVersionMetadata = exports.clearEmptyKeysRecursively = exports.anonymizeIPAddress = void 0;\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _toConsumableArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/toConsumableArray\"));\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/typeof\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _isArray = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/array/is-array\"));\nvar _assign = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/assign\"));\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _parseInt2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/parse-int\"));\nvar _ipAnonymize = _interopRequireDefault(require(\"ip-anonymize\"));\nvar _util = _interopRequireDefault(require(\"util\"));\nvar _common = require(\"@webex/common\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lodash = require(\"lodash\");\nvar _config = require(\"./config\");\n/* eslint-disable valid-jsdoc */\n\nvar _BrowserDetection = (0, _common.BrowserDetection)(),\n getOSName = _BrowserDetection.getOSName,\n getOSVersion = _BrowserDetection.getOSVersion,\n getBrowserName = _BrowserDetection.getBrowserName,\n getBrowserVersion = _BrowserDetection.getBrowserVersion;\nvar anonymizeIPAddress = exports.anonymizeIPAddress = function anonymizeIPAddress(localIp) {\n return (0, _ipAnonymize.default)(localIp, 28, 96);\n};\n\n/**\n * Returns a formated string of the user agent.\n *\n * @returns {string} formatted user agent information\n */\nvar userAgentToString = exports.userAgentToString = function userAgentToString(_ref) {\n var clientName = _ref.clientName,\n webexVersion = _ref.webexVersion;\n var userAgentOption;\n var browserInfo;\n var clientInfo = _util.default.format('client=%s', \"\".concat(clientName));\n if (['chrome', 'firefox', 'msie', 'msedge', 'safari'].indexOf(getBrowserName().toLowerCase()) !== -1) {\n browserInfo = _util.default.format('browser=%s', \"\".concat(getBrowserName().toLowerCase(), \"/\").concat(getBrowserVersion().split('.')[0]));\n }\n var osInfo = _util.default.format('os=%s', \"\".concat(getOSName(), \"/\").concat(getOSVersion().split('.')[0]));\n if (browserInfo) {\n userAgentOption = \"(\".concat(browserInfo);\n }\n if (osInfo) {\n userAgentOption = userAgentOption ? \"\".concat(userAgentOption, \"; \").concat(clientInfo, \"; \").concat(osInfo) : \"\".concat(clientInfo, \"; (\").concat(osInfo);\n }\n if (userAgentOption) {\n userAgentOption += ')';\n return _util.default.format('webex-js-sdk/%s %s', \"\".concat(process.env.NODE_ENV, \"-\").concat(webexVersion), userAgentOption);\n }\n return _util.default.format('webex-js-sdk/%s', \"\".concat(process.env.NODE_ENV, \"-\").concat(webexVersion));\n};\n\n/**\n * Iterates object recursively and removes any\n * property that returns isEmpty for it's associated value\n * isEmpty = implementation from Lodash.\n *\n * It modifies the object in place (mutable)\n *\n * @param obj - input\n * @returns\n */\nvar clearEmptyKeysRecursively = exports.clearEmptyKeysRecursively = function clearEmptyKeysRecursively(obj) {\n // Check if the object is empty\n if ((0, _keys.default)(obj).length === 0) {\n return;\n }\n (0, _keys.default)(obj).forEach(function (key) {\n if (((0, _typeof2.default)(obj[key]) === 'object' || typeof obj[key] === 'string' || (0, _isArray.default)(obj[key])) && (0, _lodash.isEmpty)(obj[key])) {\n delete obj[key];\n }\n if ((0, _isArray.default)(obj[key])) {\n obj[key] = (0, _toConsumableArray2.default)(obj[key].filter(function (x) {\n return !!x;\n }));\n }\n if ((0, _typeof2.default)(obj[key]) === 'object') {\n clearEmptyKeysRecursively(obj[key]);\n }\n });\n};\n\n/**\n * Locus error codes start with 2. The next three digits are the\n * HTTP status code related to the error code (like 400, 403, 502, etc.)\n * The remaining three digits are just an increasing integer.\n * If it is 7 digits and starts with a 2, it is locus.\n *\n * @param errorCode\n * @returns {boolean}\n */\nvar isLocusServiceErrorCode = exports.isLocusServiceErrorCode = function isLocusServiceErrorCode(errorCode) {\n var code = \"\".concat(errorCode);\n if (code.length === 7 && code.charAt(0) === '2') {\n return true;\n }\n return false;\n};\n\n/**\n * MeetingInfo errors sometimes has body.data.meetingInfo object\n * MeetingInfo errors come with a wbxappapi url\n *\n * @param {Object} rawError\n * @returns {boolean}\n */\nvar isMeetingInfoServiceError = exports.isMeetingInfoServiceError = function isMeetingInfoServiceError(rawError) {\n var _rawError$body, _rawError$body$data, _rawError$body2, _rawError$body2$url;\n if ((_rawError$body = rawError.body) !== null && _rawError$body !== void 0 && (_rawError$body$data = _rawError$body.data) !== null && _rawError$body$data !== void 0 && _rawError$body$data.meetingInfo || (_rawError$body2 = rawError.body) !== null && _rawError$body2 !== void 0 && (_rawError$body2$url = _rawError$body2.url) !== null && _rawError$body2$url !== void 0 && _rawError$body2$url.includes(_config.WBX_APP_API_URL)) {\n return true;\n }\n return false;\n};\n\n/**\n * Returns true if the raw error is a network related error\n *\n * @param {Object} rawError\n * @returns {boolean}\n */\nvar isNetworkError = exports.isNetworkError = function isNetworkError(rawError) {\n if (rawError instanceof _webexCore.WebexHttpError.NetworkOrCORSError) {\n return true;\n }\n return false;\n};\n\n/**\n * Returns true if the error is an unauthorized error\n *\n * @param {Object} rawError\n * @returns {boolean}\n */\nvar isUnauthorizedError = exports.isUnauthorizedError = function isUnauthorizedError(rawError) {\n if (rawError instanceof _webexCore.WebexHttpError.Unauthorized) {\n return true;\n }\n return false;\n};\n\n/**\n * Returns true if the error is an SdpOfferCreation error\n *\n * @param {Object} rawError\n * @returns {boolean}\n */\nvar isSdpOfferCreationError = exports.isSdpOfferCreationError = function isSdpOfferCreationError(rawError) {\n // would LIKE to do rawError instanceof Errors.SdpOfferCreationError\n // but including internal-media-core in plugin-metrics breaks meetings and metrics unit tests\n if (rawError.name === _config.ERROR_DESCRIPTIONS.SDP_OFFER_CREATION_ERROR) {\n return true;\n }\n return false;\n};\n\n/**\n * MDN Media Devices getUserMedia() method returns a name if it errs\n * Documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n *\n * @param errorCode\n * @returns\n */\nvar isBrowserMediaErrorName = exports.isBrowserMediaErrorName = function isBrowserMediaErrorName(errorName) {\n if (_config.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[errorName]) {\n return true;\n }\n return false;\n};\n\n/**\n * @param {Object} webex sdk instance\n * @param webClientDomain\n * @returns\n */\nvar getBuildType = exports.getBuildType = function getBuildType(webex, webClientDomain) {\n var _webex$internal$metri, _webex$internal$metri2;\n var markAsTestEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // used temporary to test pre join in production without creating noise data, SPARK-468456\n if (markAsTestEvent) {\n return 'test';\n }\n if ((_webex$internal$metri = webex.internal.metrics) !== null && _webex$internal$metri !== void 0 && (_webex$internal$metri2 = _webex$internal$metri.config) !== null && _webex$internal$metri2 !== void 0 && _webex$internal$metri2.caBuildType) {\n return webex.internal.metrics.config.caBuildType;\n }\n if (webClientDomain !== null && webClientDomain !== void 0 && webClientDomain.includes('localhost') || webClientDomain !== null && webClientDomain !== void 0 && webClientDomain.includes('127.0.0.1') || process.env.NODE_ENV !== 'production') {\n return 'test';\n }\n return 'prod';\n};\n\n/**\n * Prepare metric item for submission.\n * @param {Object} webex sdk instance\n * @param {Object} item\n * @returns {Object} prepared item\n */\nvar prepareDiagnosticMetricItem = exports.prepareDiagnosticMetricItem = function prepareDiagnosticMetricItem(webex, item) {\n var _item$eventPayload, _item$eventPayload$ev, _item$eventPayload$ev2, _item$eventPayload2, _item$eventPayload2$e, _item$eventPayload2$e2, _item$eventPayload3, _item$eventPayload3$e;\n var buildType = getBuildType(webex, (_item$eventPayload = item.eventPayload) === null || _item$eventPayload === void 0 ? void 0 : (_item$eventPayload$ev = _item$eventPayload.event) === null || _item$eventPayload$ev === void 0 ? void 0 : (_item$eventPayload$ev2 = _item$eventPayload$ev.eventData) === null || _item$eventPayload$ev2 === void 0 ? void 0 : _item$eventPayload$ev2.webClientDomain, (_item$eventPayload2 = item.eventPayload) === null || _item$eventPayload2 === void 0 ? void 0 : (_item$eventPayload2$e = _item$eventPayload2.event) === null || _item$eventPayload2$e === void 0 ? void 0 : (_item$eventPayload2$e2 = _item$eventPayload2$e.eventData) === null || _item$eventPayload2$e2 === void 0 ? void 0 : _item$eventPayload2$e2.markAsTestEvent);\n\n // Set upgradeChannel to 'gold' if buildType is 'prod', otherwise to the buildType value\n var upgradeChannel = buildType === 'prod' ? 'gold' : buildType;\n var origin = {\n buildType: buildType,\n networkType: 'unknown',\n upgradeChannel: upgradeChannel\n };\n\n // check event names and append latencies?\n var eventName = (_item$eventPayload3 = item.eventPayload) === null || _item$eventPayload3 === void 0 ? void 0 : (_item$eventPayload3$e = _item$eventPayload3.event) === null || _item$eventPayload3$e === void 0 ? void 0 : _item$eventPayload3$e.name;\n var joinTimes = {};\n var audioSetupDelay = {};\n var videoSetupDelay = {};\n var cdl = webex.internal.newMetrics.callDiagnosticLatencies;\n switch (eventName) {\n case 'client.webexapp.launched':\n joinTimes.downloadTime = cdl.getDownloadTimeJMT();\n break;\n case 'client.login.end':\n joinTimes.otherAppApiReqResp = cdl.getOtherAppApiReqResp();\n joinTimes.exchangeCITokenJMT = cdl.getExchangeCITokenJMT();\n break;\n case 'client.interstitial-window.launched':\n joinTimes.meetingInfoReqResp = cdl.getMeetingInfoReqResp();\n joinTimes.clickToInterstitial = cdl.getClickToInterstitial();\n joinTimes.refreshCaptchaServiceReqResp = cdl.getRefreshCaptchaReqResp();\n joinTimes.downloadIntelligenceModelsReqResp = cdl.getDownloadIntelligenceModelsReqResp();\n break;\n case 'client.call.initiated':\n joinTimes.meetingInfoReqResp = cdl.getMeetingInfoReqResp();\n joinTimes.showInterstitialTime = cdl.getShowInterstitialTime();\n joinTimes.registerWDMDeviceJMT = cdl.getRegisterWDMDeviceJMT();\n joinTimes.getU2CTime = cdl.getU2CTime();\n joinTimes.getReachabilityClustersReqResp = cdl.getReachabilityClustersReqResp();\n break;\n case 'client.locus.join.response':\n joinTimes.meetingInfoReqResp = cdl.getMeetingInfoReqResp();\n joinTimes.callInitJoinReq = cdl.getCallInitJoinReq();\n joinTimes.joinReqResp = cdl.getJoinReqResp();\n joinTimes.pageJmt = cdl.getPageJMT();\n joinTimes.clickToInterstitial = cdl.getClickToInterstitial();\n joinTimes.interstitialToJoinOK = cdl.getInterstitialToJoinOK();\n joinTimes.totalJmt = cdl.getTotalJMT();\n joinTimes.clientJmt = cdl.getClientJMT();\n joinTimes.downloadTime = cdl.getDownloadTimeJMT();\n break;\n case 'client.ice.end':\n joinTimes.ICESetupTime = cdl.getICESetupTime();\n joinTimes.audioICESetupTime = cdl.getAudioICESetupTime();\n joinTimes.videoICESetupTime = cdl.getVideoICESetupTime();\n joinTimes.shareICESetupTime = cdl.getShareICESetupTime();\n break;\n case 'client.media.rx.start':\n joinTimes.localSDPGenRemoteSDPRecv = cdl.getLocalSDPGenRemoteSDPRecv();\n audioSetupDelay.joinRespRxStart = cdl.getAudioJoinRespRxStart();\n videoSetupDelay.joinRespRxStart = cdl.getVideoJoinRespRxStart();\n break;\n case 'client.media-engine.ready':\n joinTimes.totalMediaJMT = cdl.getTotalMediaJMT();\n joinTimes.interstitialToMediaOKJMT = cdl.getInterstitialToMediaOKJMT();\n joinTimes.callInitMediaEngineReady = cdl.getCallInitMediaEngineReady();\n joinTimes.stayLobbyTime = cdl.getStayLobbyTime();\n break;\n case 'client.media.tx.start':\n audioSetupDelay.joinRespTxStart = cdl.getAudioJoinRespTxStart();\n videoSetupDelay.joinRespTxStart = cdl.getVideoJoinRespTxStart();\n }\n if (!(0, _lodash.isEmpty)(joinTimes)) {\n item.eventPayload.event = (0, _lodash.merge)(item.eventPayload.event, {\n joinTimes: joinTimes\n });\n }\n if (!(0, _lodash.isEmpty)(audioSetupDelay)) {\n item.eventPayload.event = (0, _lodash.merge)(item.eventPayload.event, {\n audioSetupDelay: audioSetupDelay\n });\n }\n if (!(0, _lodash.isEmpty)(videoSetupDelay)) {\n item.eventPayload.event = (0, _lodash.merge)(item.eventPayload.event, {\n videoSetupDelay: videoSetupDelay\n });\n }\n item.eventPayload.origin = (0, _assign.default)(origin, item.eventPayload.origin);\n webex.logger.log(\"CallDiagnosticLatencies,prepareDiagnosticMetricItem: \".concat((0, _stringify.default)({\n latencies: Object.fromEntries(cdl.latencyTimestamps),\n event: item\n })));\n return item;\n};\n\n/**\n * Sets the originTime value(s) before the request/fetch.\n * This function is only useful if you are about to submit a metrics\n * request using pre-built fetch options;\n *\n * @param {any} options\n * @returns {any} the updated options object\n */\nvar setMetricTimings = exports.setMetricTimings = function setMetricTimings(options) {\n if (options.body && options.json) {\n var _body$metrics;\n var body = JSON.parse(options.body);\n var now = new Date().toISOString();\n (_body$metrics = body.metrics) === null || _body$metrics === void 0 ? void 0 : _body$metrics.forEach(function (metric) {\n if (metric.eventPayload) {\n // The event will effectively be triggered and sent at the same time.\n // The existing triggered time is from when the options were built.\n metric.eventPayload.originTime = {\n triggered: now,\n sent: now\n };\n }\n });\n options.body = (0, _stringify.default)(body);\n }\n return options;\n};\nvar extractVersionMetadata = exports.extractVersionMetadata = function extractVersionMetadata(version) {\n // extract major and minor version\n var _version$split = version.split('.'),\n _version$split2 = (0, _slicedToArray2.default)(_version$split, 2),\n majorVersion = _version$split2[0],\n minorVersion = _version$split2[1];\n return {\n majorVersion: (0, _parseInt2.default)(majorVersion, 10),\n minorVersion: (0, _parseInt2.default)(minorVersion, 10)\n };\n};\n\n/**\n * Generates client error codes for specific ice failures\n * that happen when trying to add media in a meeting.\n */\nvar generateClientErrorCodeForIceFailure = exports.generateClientErrorCodeForIceFailure = function generateClientErrorCodeForIceFailure(_ref2) {\n var signalingState = _ref2.signalingState,\n iceConnected = _ref2.iceConnected,\n turnServerUsed = _ref2.turnServerUsed,\n unreachable = _ref2.unreachable;\n var errorCode = _config.ICE_FAILURE_CLIENT_CODE; // default;\n\n if (signalingState === 'have-local-offer') {\n errorCode = _config.MISSING_ROAP_ANSWER_CLIENT_CODE;\n }\n if (signalingState === 'stable' && iceConnected) {\n errorCode = _config.DTLS_HANDSHAKE_FAILED_CLIENT_CODE;\n }\n if (signalingState !== 'have-local-offer' && !iceConnected) {\n if (turnServerUsed) {\n if (unreachable) {\n errorCode = _config.ICE_AND_REACHABILITY_FAILED_CLIENT_CODE;\n } else {\n errorCode = _config.ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE;\n }\n } else {\n errorCode = _config.ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE;\n }\n }\n return errorCode;\n};\n//# sourceMappingURL=call-diagnostic-metrics.util.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.WEBEX_SUB_SERVICE_TYPES = exports.WBX_APP_API_URL = exports.UNKNOWN_ERROR = exports.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = exports.SDP_OFFER_CREATION_ERROR_MAP = exports.NEW_LOCUS_ERROR_CLIENT_CODE = exports.NETWORK_ERROR = exports.MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE = exports.MISSING_ROAP_ANSWER_CLIENT_CODE = exports.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = exports.ICE_FAILURE_CLIENT_CODE = exports.ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE = exports.ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE = exports.ICE_AND_REACHABILITY_FAILED_CLIENT_CODE = exports.ERROR_DESCRIPTIONS = exports.DTLS_HANDSHAKE_FAILED_CLIENT_CODE = exports.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD = exports.CALL_DIAGNOSTIC_LOG_IDENTIFIER = exports.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = exports.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP = exports.AUTHENTICATION_FAILED_CODE = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _CLIENT_ERROR_CODE_TO;\n/* eslint-disable import/prefer-default-export */\n// Most client error codes are mapped based on\n// https://sqbu-github.cisco.com/WebExSquared/event-dictionary/wiki/Error-codes-for-metric-events\n\nvar CALL_DIAGNOSTIC_LOG_IDENTIFIER = exports.CALL_DIAGNOSTIC_LOG_IDENTIFIER = 'call-diagnostic-events -> ';\nvar AUTHENTICATION_FAILED_CODE = exports.AUTHENTICATION_FAILED_CODE = 1010;\nvar NETWORK_ERROR = exports.NETWORK_ERROR = 1026;\nvar NEW_LOCUS_ERROR_CLIENT_CODE = exports.NEW_LOCUS_ERROR_CLIENT_CODE = 4008;\nvar MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = exports.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;\nvar UNKNOWN_ERROR = exports.UNKNOWN_ERROR = 9999; // Unexpected error that is not a meetingInfo error, locus error or browser media error.\nvar ICE_FAILURE_CLIENT_CODE = exports.ICE_FAILURE_CLIENT_CODE = 2004;\nvar MISSING_ROAP_ANSWER_CLIENT_CODE = exports.MISSING_ROAP_ANSWER_CLIENT_CODE = 2007;\nvar DTLS_HANDSHAKE_FAILED_CLIENT_CODE = exports.DTLS_HANDSHAKE_FAILED_CLIENT_CODE = 2008;\nvar ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE = exports.ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE = 2010;\nvar ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE = exports.ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE = 2009;\nvar ICE_AND_REACHABILITY_FAILED_CLIENT_CODE = exports.ICE_AND_REACHABILITY_FAILED_CLIENT_CODE = 2011;\nvar MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE = exports.MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE = 2012;\nvar WBX_APP_API_URL = exports.WBX_APP_API_URL = 'wbxappapi'; // MeetingInfo WebexAppApi response object normally contains a body.url that includes the string 'wbxappapi'\n\nvar WEBEX_SUB_SERVICE_TYPES = exports.WEBEX_SUB_SERVICE_TYPES = {\n PMR: 'PMR',\n SCHEDULED_MEETING: 'ScheduledMeeting',\n WEBINAR: 'Webinar'\n};\n\n// Found in https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\nvar BROWSER_MEDIA_ERROR_NAMES = {\n PERMISSION_DENIED_ERROR: 'PermissionDeniedError',\n NOT_ALLOWED_ERROR: 'NotAllowedError',\n NOT_READABLE_ERROR: 'NotReadableError',\n ABORT_ERROR: 'AbortError',\n NOT_FOUND_ERROR: 'NotFoundError',\n OVERCONSTRAINED_ERROR: 'OverconstrainedError',\n SECURITY_ERROR: 'SecurityError',\n TYPE_ERROR: 'TypeError'\n};\nvar BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP = exports.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, BROWSER_MEDIA_ERROR_NAMES.PERMISSION_DENIED_ERROR, 4032), BROWSER_MEDIA_ERROR_NAMES.NOT_ALLOWED_ERROR, 4032), BROWSER_MEDIA_ERROR_NAMES.NOT_READABLE_ERROR, 2729), BROWSER_MEDIA_ERROR_NAMES.ABORT_ERROR, 2729), BROWSER_MEDIA_ERROR_NAMES.NOT_FOUND_ERROR, 2729), BROWSER_MEDIA_ERROR_NAMES.OVERCONSTRAINED_ERROR, 2729), BROWSER_MEDIA_ERROR_NAMES.SECURITY_ERROR, 2729), BROWSER_MEDIA_ERROR_NAMES.TYPE_ERROR, 2729);\nvar SDP_OFFER_CREATION_ERROR_MAP = exports.SDP_OFFER_CREATION_ERROR_MAP = {\n GENERAL: 2050,\n SDP_MUNGE_MISSING_CODECS: 2051\n};\nvar ERROR_DESCRIPTIONS = exports.ERROR_DESCRIPTIONS = {\n UNKNOWN_CALL_FAILURE: 'UnknownCallFailure',\n LOCUS_RATE_LIMITED_INCOMING: 'LocusRateLimitedIncoming',\n LOCUS_RATE_LIMITED_OUTGOING: 'LocusRateLimitedOutgoing',\n LOCUS_UNAVAILABLE: 'LocusUnavailable',\n LOCUS_CONFLICT: 'LocusConflict',\n TIMEOUT: 'Timeout',\n LOCUS_INVALID_SEQUENCE_HASH: 'LocusInvalidSequenceHash',\n AUTHENTICATION_FAILED: 'AuthenticationFailed',\n NETWORK_ERROR: 'NetworkError',\n UPDATE_MEDIA_FAILED: 'UpdateMediaFailed',\n FAILED_TO_CONNECT_MEDIA: 'FailedToConnectMedia',\n MEDIA_ENGINE_LOST: 'MediaEngineLost',\n MEDIA_CONNECTION_LOST: 'MediaConnectionLost',\n ICE_FAILURE: 'IceFailure',\n MEDIA_ENGINE_HANG: 'MediaEngineHang',\n ICE_SERVER_REJECTED: 'IceServerRejected',\n CALL_FULL: 'CallFull',\n ROOM_TOO_LARGE: 'RoomTooLarge',\n GUEST_ALREADY_ADDED: 'GuestAlreadyAdded',\n LOCUS_USER_NOT_AUTHORISED: 'LocusUserNotAuthorised',\n CLOUDBERRY_UNAVAILABLE: 'CloudberryUnavailable',\n ROOM_TOO_LARGE_FREE_ACCOUNT: 'RoomTooLarge_FreeAccount',\n MEETING_INACTIVE: 'MeetingInactive',\n MEETING_LOCKED: 'MeetingLocked',\n MEETING_TERMINATING: 'MeetingTerminating',\n MODERATOR_PIN_OR_GUEST_REQUIRED: 'Moderator_Pin_Or_Guest_Required',\n MODERATOR_PIN_OR_GUEST_PIN_REQUIRED: 'Moderator_Pin_Or_Guest_PIN_Required',\n MODERATOR_REQUIRED: 'Moderator_Required',\n USER_NOT_MEMBER_OF_ROOM: 'UserNotMemberOfRoom',\n NEW_LOCUS_ERROR: 'NewLocusError',\n NETWORK_UNAVAILABLE: 'NetworkUnavailable',\n MEETING_UNAVAILABLE: 'MeetingUnavailable',\n MEETING_ID_INVALID: 'MeetingIDInvalid',\n MEETING_SITE_INVALID: 'MeetingSiteInvalid',\n LOCUS_INVALID_JOINTIME: 'LocusInvalidJoinTime',\n LOBBY_EXPIRED: 'LobbyExpired',\n MEDIA_CONNECTION_LOST_PAIRED: 'MediaConnectionLostPaired',\n PHONE_NUMBER_NOT_A_NUMBER: 'PhoneNumberNotANumber',\n PHONE_NUMBER_TOO_LONG: 'PhoneNumberTooLong',\n INVALID_DIALABLE_KEY: 'InvalidDialableKey',\n ONE_ON_ONE_TO_SELF_NOT_ALLOWED: 'OneOnOneToSelfNotAllowed',\n REMOVED_PARTICIPANT: 'RemovedParticipant',\n MEETING_LINK_NOT_FOUND: 'MeetingLinkNotFound',\n PHONE_NUMBER_TOO_SHORT_AFTER_IDD: 'PhoneNumberTooShortAfterIdd',\n INVALID_INVITEE_ADDRESS: 'InvalidInviteeAddress',\n PMR_USER_ACCOUNT_LOCKED_OUT: 'PMRUserAccountLockedOut',\n GUEST_FORBIDDEN: 'GuestForbidden',\n PMR_ACCOUNT_SUSPENDED: 'PMRAccountSuspended',\n EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE: 'EmptyPhoneNumberOrCountryCode',\n CONVERSATION_NOT_FOUND: 'ConversationNotFound',\n SIP_CALLEE_BUSY: 'SIPCalleeBusy',\n SIP_CALLEE_NOT_FOUND: 'SIPCalleeNotFound',\n START_RECORDING_FAILED: 'StartRecordingFailed',\n RECORDING_IN_PROGRESS_FAILED: 'RecordingInProgressFailed',\n MEETING_INFO_LOOKUP_ERROR: 'MeetingInfoLookupError',\n CALL_FULL_ADD_GUEST: 'CallFullAddGuest',\n REQUIRE_WEBEX_LOGIN: 'RequireWebexLogin',\n USER_NOT_ALLOWED_ACCESS_MEETING: 'UserNotAllowedAccessMeeting',\n USER_NEEDS_ACTIVATION: 'UserNeedsActivation',\n SIGN_UP_INVALID_EMAIL: 'SignUpInvalidEmail',\n UNKNOWN_ERROR: 'UnknownError',\n NO_MEDIA_FOUND: 'NoMediaFound',\n STREAM_ERROR_NO_MEDIA: 'StreamErrorNoMedia',\n CAMERA_PERMISSION_DENIED: 'CameraPermissionDenied',\n FRAUD_DETECTION: 'FraudDetection',\n E2EE_NOT_SUPPORTED: 'E2EENotSupported',\n LOCUS_LOBBY_FULL_CMR: 'LocusLobbyFullCMR',\n USER_NOT_INVITED_TO_JOIN: 'UserNotInvitedToJoin',\n MISSING_ROAP_ANSWER: 'MissingRoapAnswer',\n DTLS_HANDSHAKE_FAILED: 'DTLSHandshakeFailed',\n ICE_FAILED_WITHOUT_TURN_TLS: 'ICEFailedWithoutTURN_TLS',\n ICE_FAILED_WITH_TURN_TLS: 'ICEFailedWithTURN_TLS',\n ICE_AND_REACHABILITY_FAILED: 'ICEAndReachabilityFailed',\n MULTISTREAM_NOT_AVAILABLE: 'MultistreamNotAvailable',\n SDP_OFFER_CREATION_ERROR: 'SdpOfferCreationError',\n SDP_OFFER_CREATION_ERROR_MISSING_CODEC: 'SdpOfferCreationErrorMissingCodec',\n WDM_RESTRICTED_REGION: 'WdmRestrictedRegion'\n};\nvar SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = exports.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = {\n // ---- Webex API ----\n // Taken from https://wiki.cisco.com/display/HFWEB/MeetingInfo+API and https://sqbu-github.cisco.com/WebExSquared/spark-client-framework/blob/master/spark-client-framework/Services/WebexMeetingService/WebexMeetingModel.h\n // Site not support the URL's domain\n 58400: 4100,\n 99002: 4100,\n // Cannot find the data. Unkown meeting.\n 99009: 4100,\n // Meeting is not allow to cross env\n 58500: 4100,\n // Input parameters contain invalit item\n 400001: 4100,\n // Empty password or token. Meeting is not allow to access since require password\n 403004: 4005,\n // Wrong password. Meeting is not allow to access since password error\n 403028: 4005,\n // Wrong or expired permission. Meeting is not allow to access since permissionToken error or expire\n 403032: 4005,\n // Meeting is required login for current user\n 403034: 4036,\n // Meeting is not allow to access since require password or hostKey\n // Empty password or host key\n 403036: 4005,\n // Meeting is not allow to access since password or hostKey error\n // Wrong password or host key\n 403038: 4005,\n // CMR Meeting Not Supported (meeting exists, but not CMR meeting)\n 403040: 4100,\n // Requires Moderator Pin or Guest Pin\n 403041: 4005,\n // Email blocked\n 403047: 4101,\n // Device not authenticated for your organization\n 403408: 4101,\n // Invalid panelist Pin\n 403043: 4005,\n // Device not registered in org. Device not authenticated.\n 403048: 4101,\n // Not allowed to join external meetings. Violate meeting join policy. Your organization settings don't allow you to join this meeting.\n 403049: 4101,\n // Invalid email. Requires sign in meeting's current site.\n 403100: 4101,\n // Enforce sign in: need login before access when policy enforce sign in. GuestForceUserSignInPolicy\n 403101: 4036,\n // Enforce sign in: sign in with your email address that is approved by your organization\n 403102: 4036,\n // Join internal Meeting: need login before access when policy enforce sign in. Guest force user sign in internal meeting policy.\n 403103: 4036,\n // Join internal Meeting: The host's organization policy doesn't allow your account to join this meeting. Try switching to another account\n 403104: 4101,\n 404001: 4101,\n // Site data not found. Unkonwn meeting. Site data not found(or null).\n 404006: 4100,\n // Invalid input with too many requests. Too many requests access, please input captcha code\n 423001: 4005,\n // Wrong password with too many requests. PasswordError too many time, please input captcha code\n 423005: 4005,\n // Wrong password or host key with too many requests\n 423006: 4005,\n // PasswordError with right captcha, please input captcha code\n 423010: 4005,\n // PasswordOrHostKeyError with right captcha, please input captcha code\n 423012: 4005,\n // Unverified or invalid input. Force show captcha. Please input captcha code\"\n 423013: 4005,\n // Too many requests access\n 429005: 4100,\n // ---- Locus ------\n // FREE_USER_MAX_PARTICIPANTS_EXCEEDED\n 2403001: 3007,\n // PAID_USER_MAX_PARTICIPANTS_EXCEEDED\n 2403002: 3002,\n // SERVICE_MAX_PARTICIPANTS_EXCEEDED\n 2403003: 3002,\n // LOCUS_INACTIVE\n 2403004: 4001,\n // LOCUS_FREE_USER_MAX_PARTICIPANTS_JOINED_EXCEEDED\n 2403018: 3001,\n // LOCUS_PAID_USER_MAX_PARTICIPANTS_JOINED_EXCEEDED\n 2403019: 3001,\n // LOCUS_LOCKED\n 2423003: 4002,\n // LOCUS_TERMINATING\n 2423004: 4003,\n // LOCUS_REQUIRES_MODERATOR_PIN_OR_GUEST\n 2423005: 4005,\n 2423006: 4005,\n 2423016: 4005,\n 2423017: 4005,\n 2423018: 4005,\n // LOCUS_OWNER_CONCURRENT_ACTIVE_MEETING_LIMIT_EXCEEDED\n 2423012: 12000,\n // LOCUS_LOBBY_FULL_CMR\n 2423021: 12001,\n // LOCUS_REQUIRES_MODERATOR_ROLE\n 2423007: 4006,\n // LOCUS_JOIN_RESTRICTED_USER_NOT_IN_ROOM\n 2403010: 4007,\n // LOCUS_MEETING_NOT_FOUND\n 2403014: 4011,\n // LOCUS_NOT_WEBEX_SITE\n 2403015: 4012,\n // LOCUS_INVALID_JOIN_TIME\n 2423010: 4013,\n // LOCUS_PHONE_NUMBER_NOT_A_NUMBER\n 2400008: 4016,\n // LOCUS_PHONE_NUMBER_TOO_LONG\n 2400011: 4017,\n // LOCUS_INVALID_DIALABLE_KEY\n 2400012: 4018,\n // LOCUS_ONE_ON_ONE_TO_SELF_NOT_ALLOWED\n 2403007: 4019,\n // LOCUS_REMOVED_PARTICIPANT\n 2401002: 4020,\n // LOCUS_MEETING_LINK_NOT_FOUND\n 2404002: 4021,\n // LOCUS_PHONE_NUMBER_TOO_SHORT_AFTER_IDD\n 2400009: 4022,\n // LOCUS_INVALID_INVITEE_ADDRESS\n 2400025: 4023,\n // LOCUS_PMR_USER_ACCOUNT_LOCKEDOUT\n 2423009: 4024,\n // LOCUS_RESOURCE_GUEST_FORBIDDEN\n 2403022: 4025,\n // LOCUS_PMR_SUSPENDED\n 2423008: 4026,\n // LOCUS_EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE\n 2400006: 4027,\n // LOCUS_INVALID_SINCE_OR_SEQUENCE_HASH_IN_REQUEST\n 2400014: 1006,\n // LOCUS_CONVERSATION_NOT_FOUND\n 2404001: 4028,\n // LOCUS_RECORDING_CONTROL_NOT_SUPPORTED\n 2403025: 4029,\n // LOCUS_RECORDING_NOT_STARTED\n 2405001: 4029,\n // LOCUS_RECORDING_NOT_ENABLED\n 2409005: 4029,\n // E2EE_NOT_SUPPORTED\n 2409062: 12002,\n // LOCUS: ONLY_INVITED_USERS_CAN_ATTEND_THIS_MEETING\n 2423025: 12003,\n // ---- U2C Sign in catalog ------\n // The user exists, but hasn't completed activation. Needs to visit Atlas for more processing.\n 100002: 4102,\n // The user exists, had completed activation earlier, but requires re-activation because of change in login strategy.\n // Common example is: user signed up using an OAuth provider, but that OAuth provider was removed by org's admin. Now the user needs to re-activate using alternate login strategies: password-pin, new OAuth provider, SSO, etc.\n 100007: 4102,\n // The user does not exist\n 100001: 4103,\n // The user wasn't found, and the organization used for search is a domain-claimed organization.\n 100006: 4103,\n 100005: 4103,\n // Depracated because of an issue in the UCF Clients\n // If both email-hash and domain-hash are null or undefined.\n 100004: 4103,\n // ---- WDM ----\n // WDM_BLOCKED_ACCESS_BY_COUNTRY_CODE_BANNED_COUNTRY_ERROR_CODE\n 4404002: 13000,\n // WDM_BLOCKED_ACCESS_BY_COUNTRY_CODE_RESTRICTED_COUNTRY_ERROR_CODE\n 4404003: 13000\n};\nvar CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD = exports.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD = (_CLIENT_ERROR_CODE_TO = {\n 1000: {\n errorDescription: ERROR_DESCRIPTIONS.UNKNOWN_CALL_FAILURE,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1001: {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_RATE_LIMITED_INCOMING,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1002: {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_RATE_LIMITED_OUTGOING,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1003: {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_UNAVAILABLE,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1004: {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_CONFLICT,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1005: {\n errorDescription: ERROR_DESCRIPTIONS.TIMEOUT,\n category: 'signaling',\n fatal: true,\n name: 'locus.response'\n },\n 1006: {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_INVALID_SEQUENCE_HASH,\n category: 'signaling',\n fatal: true\n },\n 1007: {\n errorDescription: ERROR_DESCRIPTIONS.UPDATE_MEDIA_FAILED,\n category: 'signaling',\n fatal: true\n }\n}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, AUTHENTICATION_FAILED_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.AUTHENTICATION_FAILED,\n category: 'network',\n fatal: true\n}), 1026, {\n errorDescription: ERROR_DESCRIPTIONS.NETWORK_ERROR,\n category: 'network',\n fatal: true\n}), 2001, {\n errorDescription: ERROR_DESCRIPTIONS.FAILED_TO_CONNECT_MEDIA,\n category: 'signaling',\n fatal: true\n}), 2002, {\n errorDescription: ERROR_DESCRIPTIONS.MEDIA_ENGINE_LOST,\n category: 'signaling',\n fatal: true\n}), 2003, {\n errorDescription: ERROR_DESCRIPTIONS.MEDIA_CONNECTION_LOST,\n category: 'signaling',\n fatal: true\n}), ICE_FAILURE_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.ICE_FAILURE,\n category: 'media',\n fatal: true\n}), 2005, {\n errorDescription: ERROR_DESCRIPTIONS.MEDIA_ENGINE_HANG,\n category: 'signaling',\n fatal: true\n}), 2006, {\n errorDescription: ERROR_DESCRIPTIONS.ICE_SERVER_REJECTED,\n category: 'signaling',\n fatal: true\n}), MISSING_ROAP_ANSWER_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.MISSING_ROAP_ANSWER,\n category: 'media',\n fatal: true\n}), DTLS_HANDSHAKE_FAILED_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.DTLS_HANDSHAKE_FAILED,\n category: 'media',\n fatal: true\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.ICE_FAILED_WITHOUT_TURN_TLS,\n category: 'media',\n fatal: true\n}), ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.ICE_FAILED_WITH_TURN_TLS,\n category: 'media',\n fatal: true\n}), ICE_AND_REACHABILITY_FAILED_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.ICE_AND_REACHABILITY_FAILED,\n category: 'expected',\n fatal: true\n}), MULTISTREAM_NOT_AVAILABLE_CLIENT_CODE, {\n errorDescription: ERROR_DESCRIPTIONS.MULTISTREAM_NOT_AVAILABLE,\n category: 'expected',\n fatal: false\n}), 2050, {\n errorDescription: ERROR_DESCRIPTIONS.SDP_OFFER_CREATION_ERROR,\n category: 'media',\n fatal: true,\n shownToUser: true\n}), 2051, {\n errorDescription: ERROR_DESCRIPTIONS.SDP_OFFER_CREATION_ERROR_MISSING_CODEC,\n category: 'expected',\n fatal: true,\n shownToUser: true\n}), 3001, {\n errorDescription: ERROR_DESCRIPTIONS.CALL_FULL,\n category: 'expected',\n fatal: true\n}), 3002, {\n errorDescription: ERROR_DESCRIPTIONS.ROOM_TOO_LARGE,\n category: 'expected',\n fatal: true\n}), 3004, {\n errorDescription: ERROR_DESCRIPTIONS.GUEST_ALREADY_ADDED,\n category: 'expected',\n fatal: false\n}), 3005, {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_USER_NOT_AUTHORISED,\n category: 'expected',\n fatal: true\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, 3006, {\n errorDescription: ERROR_DESCRIPTIONS.CLOUDBERRY_UNAVAILABLE,\n category: 'expected',\n fatal: true\n}), 3007, {\n errorDescription: ERROR_DESCRIPTIONS.STREAM_ERROR_NO_MEDIA,\n category: 'expected',\n fatal: true\n}), 3013, {\n errorDescription: ERROR_DESCRIPTIONS.ROOM_TOO_LARGE_FREE_ACCOUNT,\n category: 'expected',\n fatal: false\n}), 4001, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_INACTIVE,\n category: 'expected',\n fatal: true\n}), 4002, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_LOCKED,\n category: 'expected',\n fatal: true,\n name: 'locus.response'\n}), 4003, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_TERMINATING,\n category: 'expected',\n fatal: true,\n name: 'locus.leave'\n}), 4004, {\n errorDescription: ERROR_DESCRIPTIONS.MODERATOR_PIN_OR_GUEST_REQUIRED,\n category: 'expected',\n fatal: false\n}), 4005, {\n errorDescription: ERROR_DESCRIPTIONS.MODERATOR_PIN_OR_GUEST_PIN_REQUIRED,\n category: 'expected',\n fatal: false\n}), 4006, {\n errorDescription: ERROR_DESCRIPTIONS.MODERATOR_REQUIRED,\n category: 'expected',\n fatal: false\n}), 4007, {\n errorDescription: ERROR_DESCRIPTIONS.USER_NOT_MEMBER_OF_ROOM,\n category: 'expected',\n fatal: true\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, 4008, {\n errorDescription: ERROR_DESCRIPTIONS.NEW_LOCUS_ERROR,\n category: 'signaling',\n fatal: true\n}), 4009, {\n errorDescription: ERROR_DESCRIPTIONS.NETWORK_UNAVAILABLE,\n category: 'network',\n fatal: true\n}), 4010, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_UNAVAILABLE,\n category: 'expected',\n fatal: true\n}), 4011, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_ID_INVALID,\n category: 'expected',\n fatal: true\n}), 4012, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_SITE_INVALID,\n category: 'expected',\n fatal: true\n}), 4013, {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_INVALID_JOINTIME,\n category: 'expected',\n fatal: true\n}), 4014, {\n errorDescription: ERROR_DESCRIPTIONS.LOBBY_EXPIRED,\n category: 'expected',\n fatal: true\n}), 4015, {\n errorDescription: ERROR_DESCRIPTIONS.MEDIA_CONNECTION_LOST_PAIRED,\n category: 'expected',\n fatal: false\n}), 4016, {\n errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_NOT_A_NUMBER,\n category: 'expected',\n fatal: true,\n name: 'locus.response'\n}), 4017, {\n errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_TOO_LONG,\n category: 'expected',\n fatal: true,\n name: 'locus.response'\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, 4018, {\n errorDescription: ERROR_DESCRIPTIONS.INVALID_DIALABLE_KEY,\n category: 'expected',\n fatal: true,\n name: 'locus.response'\n}), 4019, {\n errorDescription: ERROR_DESCRIPTIONS.ONE_ON_ONE_TO_SELF_NOT_ALLOWED,\n category: 'expected',\n fatal: true\n}), 4020, {\n errorDescription: ERROR_DESCRIPTIONS.REMOVED_PARTICIPANT,\n category: 'expected',\n fatal: true\n}), 4021, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_LINK_NOT_FOUND,\n category: 'expected',\n fatal: true\n}), 4022, {\n errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_TOO_SHORT_AFTER_IDD,\n category: 'expected',\n fatal: true\n}), 4023, {\n errorDescription: ERROR_DESCRIPTIONS.INVALID_INVITEE_ADDRESS,\n category: 'expected',\n fatal: true\n}), 4024, {\n errorDescription: ERROR_DESCRIPTIONS.PMR_USER_ACCOUNT_LOCKED_OUT,\n category: 'expected',\n fatal: true\n}), 4025, {\n errorDescription: ERROR_DESCRIPTIONS.GUEST_FORBIDDEN,\n category: 'expected',\n fatal: true\n}), 4026, {\n errorDescription: ERROR_DESCRIPTIONS.PMR_ACCOUNT_SUSPENDED,\n category: 'expected',\n fatal: true\n}), 4027, {\n errorDescription: ERROR_DESCRIPTIONS.EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE,\n category: 'expected',\n fatal: true\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, 4028, {\n errorDescription: ERROR_DESCRIPTIONS.CONVERSATION_NOT_FOUND,\n category: 'expected',\n fatal: true\n}), 4029, {\n errorDescription: ERROR_DESCRIPTIONS.START_RECORDING_FAILED,\n category: 'expected',\n fatal: true\n}), 4030, {\n errorDescription: ERROR_DESCRIPTIONS.RECORDING_IN_PROGRESS_FAILED,\n category: 'expected',\n fatal: true\n}), 4032, {\n errorDescription: ERROR_DESCRIPTIONS.CAMERA_PERMISSION_DENIED,\n category: 'expected',\n fatal: true\n}), 4036, {\n errorDescription: ERROR_DESCRIPTIONS.REQUIRE_WEBEX_LOGIN,\n category: 'expected',\n fatal: true\n}), 5000, {\n errorDescription: ERROR_DESCRIPTIONS.SIP_CALLEE_BUSY,\n category: 'expected',\n fatal: true\n}), 5001, {\n errorDescription: ERROR_DESCRIPTIONS.SIP_CALLEE_NOT_FOUND,\n category: 'expected',\n fatal: true\n}), 4100, {\n errorDescription: ERROR_DESCRIPTIONS.MEETING_INFO_LOOKUP_ERROR,\n category: 'signaling',\n fatal: true\n}), 3003, {\n errorDescription: ERROR_DESCRIPTIONS.CALL_FULL_ADD_GUEST,\n category: 'expected',\n fatal: false\n}), 4101, {\n errorDescription: ERROR_DESCRIPTIONS.USER_NOT_ALLOWED_ACCESS_MEETING,\n category: 'expected',\n fatal: true\n}), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_CLIENT_ERROR_CODE_TO, 4102, {\n errorDescription: ERROR_DESCRIPTIONS.USER_NEEDS_ACTIVATION,\n category: 'expected',\n fatal: true\n}), 4103, {\n errorDescription: ERROR_DESCRIPTIONS.SIGN_UP_INVALID_EMAIL,\n category: 'expected',\n fatal: true\n}), 2729, {\n errorDescription: ERROR_DESCRIPTIONS.NO_MEDIA_FOUND,\n category: 'expected',\n fatal: false\n}), 9999, {\n errorDescription: ERROR_DESCRIPTIONS.UNKNOWN_ERROR,\n category: 'other',\n fatal: true\n}), 12000, {\n errorDescription: ERROR_DESCRIPTIONS.FRAUD_DETECTION,\n category: 'expected',\n fatal: true,\n name: 'locus.response',\n shownToUser: true\n}), 12001, {\n errorDescription: ERROR_DESCRIPTIONS.LOCUS_LOBBY_FULL_CMR,\n category: 'expected',\n fatal: true,\n name: 'locus.response',\n shownToUser: true\n}), 12002, {\n errorDescription: ERROR_DESCRIPTIONS.E2EE_NOT_SUPPORTED,\n category: 'expected',\n fatal: true,\n name: 'locus.response',\n shownToUser: true\n}), 12003, {\n errorDescription: ERROR_DESCRIPTIONS.USER_NOT_INVITED_TO_JOIN,\n category: 'expected',\n fatal: true\n}), 13000, {\n errorDescription: ERROR_DESCRIPTIONS.WDM_RESTRICTED_REGION,\n category: 'expected',\n fatal: true\n}));\nvar CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = exports.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = 'js_sdk_call_diagnostic_event_failed_to_send';\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _batcher = _interopRequireDefault(require(\"./batcher\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar ClientMetricsBatcher = _batcher.default.extend({\n namespace: 'Metrics',\n prepareItem: function prepareItem(item) {\n // Add more defaults to payload when the clientmetrics endpoint evolves to support richer payloads\n return _promise.default.resolve(item);\n },\n prepareRequest: function prepareRequest(queue) {\n return _promise.default.resolve(queue);\n },\n submitHttpRequest: function submitHttpRequest(payload) {\n return this.webex.request({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: payload\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout\n });\n }\n});\nvar _default = exports.default = ClientMetricsBatcher;\n//# sourceMappingURL=client-metrics-batcher.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _preloginMetricsBatcher = _interopRequireDefault(require(\"./prelogin-metrics-batcher\"));\nvar ClientMetricsPreloginBatcher = _preloginMetricsBatcher.default.extend({\n namespace: 'Metrics',\n /**\n * Prepare item\n * @param {any} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n // Add more defaults to payload when the clientmetrics endpoint evolves to support richer payloads\n return _promise.default.resolve(item);\n },\n /**\n * Prepare request, add time sensitive date etc.\n * @param {any[]} queue\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(queue) {\n return _promise.default.resolve(queue);\n }\n});\nvar _default = exports.default = ClientMetricsPreloginBatcher;\n//# sourceMappingURL=client-metrics-prelogin-batcher.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.OS_NAME = exports.OSMap = exports.CLIENT_NAME = void 0;\nvar _common = require(\"@webex/common\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar CLIENT_NAME = exports.CLIENT_NAME = 'webex-js-sdk';\nvar _default = exports.default = {\n device: {\n preDiscoveryServices: {\n metricsServiceUrl: process.env.METRICS_SERVICE_URL || 'https://metrics-a.wbx2.com/metrics/api/v1',\n metrics: process.env.METRICS_SERVICE_URL || 'https://metrics-a.wbx2.com/metrics/api/v1'\n }\n },\n metrics: {\n appType: _common.inBrowser ? 'browser' : 'nodejs',\n batcherWait: 500,\n batcherMaxCalls: 50,\n batcherMaxWait: 1500,\n batcherRetryPlateau: 32000,\n waitForServiceTimeout: 30\n }\n};\nvar OS_NAME = exports.OS_NAME = {\n WINDOWS: 'windows',\n MAC: 'mac',\n IOS: 'ios',\n ANDROID: 'android',\n CHROME: 'chrome',\n LINUX: 'linux',\n OTHERS: 'other'\n};\nvar OSMap = exports.OSMap = {\n 'Chrome OS': OS_NAME.CHROME,\n macOS: OS_NAME.MAC,\n Windows: OS_NAME.WINDOWS,\n iOS: OS_NAME.IOS,\n Android: OS_NAME.ANDROID,\n Linux: OS_NAME.LINUX\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _now = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/date/now\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _common = require(\"@webex/common\");\nvar _lodash = require(\"lodash\");\nvar _clientMetricsBatcher = _interopRequireDefault(require(\"./client-metrics-batcher\"));\nvar _metrics = require(\"./metrics\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nvar _BrowserDetection = (0, _common.BrowserDetection)(),\n getOSVersion = _BrowserDetection.getOSVersion,\n getBrowserName = _BrowserDetection.getBrowserName,\n getBrowserVersion = _BrowserDetection.getBrowserVersion;\n\n/**\n * @description top-level abstract class to handle Metrics and common routines.\n * @export\n * @class GenericMetrics\n */\nvar GenericMetrics = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {\n (0, _inherits2.default)(GenericMetrics, _StatelessWebexPlugin);\n var _super = _createSuper(GenericMetrics);\n /**\n * Constructor\n * @param {any[]} args\n */\n function GenericMetrics() {\n var _this;\n (0, _classCallCheck2.default)(this, GenericMetrics);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n // @ts-ignore\n // @ts-ignore\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"clientMetricsBatcher\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"logger\", void 0);\n // to avoid adding @ts-ignore everywhere\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"device\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"version\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"deviceId\", '');\n _this.logger = _this.webex.logger;\n // @ts-ignore\n _this.clientMetricsBatcher = new _clientMetricsBatcher.default({}, {\n parent: _this.webex\n });\n // @ts-ignore\n _this.device = _this.webex.internal.device;\n // @ts-ignore\n _this.version = _this.webex.version;\n return _this;\n }\n\n /**\n * Submit a business metric to our metrics endpoint.\n * @param {string} kind of metric for logging\n * @param {string} name of the metric\n * @param {object} event\n * @returns {Promise}\n */\n (0, _createClass2.default)(GenericMetrics, [{\n key: \"submitEvent\",\n value: function submitEvent(_ref) {\n var kind = _ref.kind,\n name = _ref.name,\n event = _ref.event;\n this.logger.log(kind, \"@submitEvent. Submit event: \".concat(name));\n return this.clientMetricsBatcher.request(event);\n }\n\n /**\n * Returns the deviceId from our registration with WDM.\n * @returns {string} deviceId or empty string\n */\n }, {\n key: \"getDeviceId\",\n value: function getDeviceId() {\n if (this.deviceId === '') {\n var url = this.device.url;\n if (url && url.length !== 0) {\n var n = url.lastIndexOf('/');\n if (n !== -1) {\n this.deviceId = url.substring(n + 1);\n }\n }\n }\n return this.deviceId;\n }\n\n /**\n * Returns the context object to be submitted with all metrics.\n * @returns {DeviceContext}\n */\n }, {\n key: \"getContext\",\n value: function getContext() {\n return {\n app: {\n version: this.version\n },\n device: {\n id: this.getDeviceId()\n },\n locale: window.navigator.language,\n os: {\n name: (0, _metrics.getOSNameInternal)(),\n version: getOSVersion()\n }\n };\n }\n\n /**\n * Returns the browser details to be included with all metrics.\n * @returns {object}\n */\n }, {\n key: \"getBrowserDetails\",\n value: function getBrowserDetails() {\n return {\n browser: getBrowserName(),\n browserHeight: window.innerHeight,\n browserVersion: getBrowserVersion(),\n browserWidth: window.innerWidth,\n domain: window.location.hostname,\n inIframe: window.self !== window.top,\n locale: window.navigator.language,\n os: (0, _metrics.getOSNameInternal)()\n };\n }\n\n /**\n * Returns true once we have the deviceId we need to submit behavioral/operational/business events\n * @returns {boolean}\n */\n }, {\n key: \"isReadyToSubmitEvents\",\n value: function isReadyToSubmitEvents() {\n var deviceId = this.getDeviceId();\n return deviceId && deviceId.length !== 0;\n }\n\n /**\n * Creates the object to send to our metrics endpoint for a tagged event (i.e. behavoral or operational)\n * @param {[MetricType]} list of event type (i.e. ['behavioral'], ['operational', 'behavioral'])\n * @param {string} metric name\n * @param {EventPayload} user payload\n * @returns {EventPayload}\n */\n }, {\n key: \"createTaggedEventObject\",\n value: function createTaggedEventObject(_ref2) {\n var type = _ref2.type,\n name = _ref2.name,\n payload = _ref2.payload;\n var allTags = payload;\n allTags = (0, _lodash.merge)(allTags, this.getBrowserDetails());\n var event = {\n context: this.getContext(),\n metricName: name,\n tags: allTags,\n timestamp: (0, _now.default)(),\n type: type\n };\n return event;\n }\n }]);\n return GenericMetrics;\n}(_webexCore.StatelessWebexPlugin);\n//# sourceMappingURL=generic-metrics.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"BehavioralMetrics\", {\n enumerable: true,\n get: function get() {\n return _behavioralMetrics.default;\n }\n});\n_Object$defineProperty(exports, \"BusinessMetrics\", {\n enumerable: true,\n get: function get() {\n return _businessMetrics.default;\n }\n});\nexports.CALL_DIAGNOSTIC_CONFIG = void 0;\n_Object$defineProperty(exports, \"CallDiagnosticLatencies\", {\n enumerable: true,\n get: function get() {\n return _callDiagnosticMetricsLatencies.default;\n }\n});\n_Object$defineProperty(exports, \"CallDiagnosticMetrics\", {\n enumerable: true,\n get: function get() {\n return _callDiagnosticMetrics2.default;\n }\n});\nexports.CallDiagnosticUtils = void 0;\n_Object$defineProperty(exports, \"NewMetrics\", {\n enumerable: true,\n get: function get() {\n return _newMetrics.default;\n }\n});\n_Object$defineProperty(exports, \"OperationalMetrics\", {\n enumerable: true,\n get: function get() {\n return _operationalMetrics.default;\n }\n});\n_Object$defineProperty(exports, \"RtcMetrics\", {\n enumerable: true,\n get: function get() {\n return _rtcMetrics.default;\n }\n});\nexports.Utils = void 0;\n_Object$defineProperty(exports, \"config\", {\n enumerable: true,\n get: function get() {\n return _config.default;\n }\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _metrics.default;\n }\n});\n_Object$defineProperty(exports, \"getOSNameInternal\", {\n enumerable: true,\n get: function get() {\n return _metrics.getOSNameInternal;\n }\n});\nvar _webexCore = require(\"@webex/webex-core\");\nvar _metrics = _interopRequireWildcard(require(\"./metrics\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\nvar _newMetrics = _interopRequireDefault(require(\"./new-metrics\"));\nvar Utils = _interopRequireWildcard(require(\"./utils\"));\nexports.Utils = Utils;\nvar CALL_DIAGNOSTIC_CONFIG = _interopRequireWildcard(require(\"./call-diagnostic/config\"));\nexports.CALL_DIAGNOSTIC_CONFIG = CALL_DIAGNOSTIC_CONFIG;\nvar CallDiagnosticUtils = _interopRequireWildcard(require(\"./call-diagnostic/call-diagnostic-metrics.util\"));\nexports.CallDiagnosticUtils = CallDiagnosticUtils;\nvar _callDiagnosticMetrics2 = _interopRequireDefault(require(\"./call-diagnostic/call-diagnostic-metrics\"));\nvar _callDiagnosticMetricsLatencies = _interopRequireDefault(require(\"./call-diagnostic/call-diagnostic-metrics-latencies\"));\nvar _behavioralMetrics = _interopRequireDefault(require(\"./behavioral-metrics\"));\nvar _operationalMetrics = _interopRequireDefault(require(\"./operational-metrics\"));\nvar _businessMetrics = _interopRequireDefault(require(\"./business-metrics\"));\nvar _rtcMetrics = _interopRequireDefault(require(\"./rtcMetrics\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('metrics', _metrics.default, {\n config: _config.default\n});\n(0, _webexCore.registerInternalPlugin)('newMetrics', _newMetrics.default, {\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nexports.getOSNameInternal = getOSNameInternal;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _common = require(\"@webex/common\");\nvar _config = require(\"./config\");\nvar _batcher = _interopRequireDefault(require(\"./batcher\"));\nvar _clientMetricsBatcher = _interopRequireDefault(require(\"./client-metrics-batcher\"));\nvar _clientMetricsPreloginBatcher = _interopRequireDefault(require(\"./client-metrics-prelogin-batcher\"));\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable default-param-last */ /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _BrowserDetection = (0, _common.BrowserDetection)(),\n getOSName = _BrowserDetection.getOSName,\n getOSVersion = _BrowserDetection.getOSVersion,\n getBrowserName = _BrowserDetection.getBrowserName,\n getBrowserVersion = _BrowserDetection.getBrowserVersion;\nfunction getOSNameInternal() {\n var _OSMap$getOSName;\n return (_OSMap$getOSName = _config.OSMap[getOSName()]) !== null && _OSMap$getOSName !== void 0 ? _OSMap$getOSName : _config.OS_NAME.OTHERS;\n}\nfunction getSparkUserAgent(webex) {\n var _webex$config;\n var _ref = (_webex$config = webex === null || webex === void 0 ? void 0 : webex.config) !== null && _webex$config !== void 0 ? _webex$config : {},\n appName = _ref.appName,\n appVersion = _ref.appVersion,\n appPlatform = _ref.appPlatform;\n var sparkUserAgent = _config.CLIENT_NAME;\n if (appName) {\n sparkUserAgent += \" \".concat(appName, \"/\").concat(appVersion !== null && appVersion !== void 0 ? appVersion : '0.0');\n }\n if (appPlatform) {\n sparkUserAgent += \" \".concat(appPlatform);\n }\n return sparkUserAgent;\n}\nvar Metrics = _webexCore.WebexPlugin.extend({\n children: {\n batcher: _batcher.default,\n clientMetricsBatcher: _clientMetricsBatcher.default,\n clientMetricsPreloginBatcher: _clientMetricsPreloginBatcher.default\n },\n namespace: 'Metrics',\n submit: function submit(key, value) {\n return this.batcher.request(_objectSpread({\n key: key\n }, value));\n },\n /**\n * Returns the payload for submitting client metrics.\n * @param {string} eventName\n * @param {any} props\n * @returns {any} - the payload\n */\n getClientMetricsPayload: function getClientMetricsPayload(eventName, props) {\n var _this$webex$meetings, _this$webex$meetings$, _this$webex$meetings$2;\n if (!eventName) {\n throw Error('Missing behavioral metric name. Please provide one');\n }\n var payload = {\n metricName: eventName\n };\n // @ts-ignore\n var providedClientVersion = (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$ = _this$webex$meetings.config) === null || _this$webex$meetings$ === void 0 ? void 0 : (_this$webex$meetings$2 = _this$webex$meetings$.metrics) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.clientVersion;\n payload.tags = _objectSpread(_objectSpread({}, props.tags), {}, {\n browser: getBrowserName(),\n os: getOSNameInternal(),\n appVersion: providedClientVersion,\n // Node does not like this so we need to check if it exists or not\n // eslint-disable-next-line no-undef\n domain: typeof window !== 'undefined' ? window.location.hostname || 'non-browser' : 'non-browser' // Check what else we could measure\n });\n\n payload.fields = _objectSpread(_objectSpread({}, props.fields), {}, {\n browser_version: getBrowserVersion(),\n os_version: getOSVersion(),\n sdk_version: this.webex.version,\n platform: 'Web',\n spark_user_agent: getSparkUserAgent(this.webex),\n client_id: this.webex.credentials.config.client_id\n });\n payload.type = props.type || this.webex.config.metrics.type;\n payload.context = _objectSpread(_objectSpread({}, props.context), {}, {\n app: {\n version: this.webex.version\n },\n locale: 'en-US',\n os: {\n name: getOSNameInternal(),\n version: getOSVersion()\n }\n });\n if (props.eventPayload) {\n payload.eventPayload = props.eventPayload;\n }\n\n // Mocking the time in tests when running in node\n // is impossible so unable to use Date.now()\n payload.timestamp = new Date().valueOf();\n return payload;\n },\n /**\n * This corresponds to #sendSemiStructured() in the deprecated metrics handler\n * @param {string} eventName\n * @param {Object} props\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n submitClientMetrics: function submitClientMetrics(eventName) {\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var preLoginId = arguments.length > 2 ? arguments[2] : undefined;\n var payload = this.getClientMetricsPayload(eventName, props);\n if (preLoginId) {\n this.clientMetricsPreloginBatcher.savePreLoginId(preLoginId);\n return this.clientMetricsPreloginBatcher.request(payload);\n }\n return this.clientMetricsBatcher.request(payload);\n },\n /**\n * Issue request to alias a user's pre-login ID with their CI UUID\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n aliasUser: function aliasUser(preLoginId) {\n return this.request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics',\n headers: {\n 'x-prelogin-userid': preLoginId\n },\n body: {},\n qs: {\n alias: true\n }\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = Metrics;\n//# sourceMappingURL=metrics.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _regenerator = _interopRequireDefault(require(\"@babel/runtime-corejs2/regenerator\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _callDiagnosticMetrics = _interopRequireDefault(require(\"./call-diagnostic/call-diagnostic-metrics\"));\nvar _behavioralMetrics = _interopRequireDefault(require(\"./behavioral-metrics\"));\nvar _operationalMetrics = _interopRequireDefault(require(\"./operational-metrics\"));\nvar _businessMetrics = _interopRequireDefault(require(\"./business-metrics\"));\nvar _callDiagnosticMetricsLatencies = _interopRequireDefault(require(\"./call-diagnostic/call-diagnostic-metrics-latencies\"));\nvar _callDiagnosticMetrics2 = require(\"./call-diagnostic/call-diagnostic-metrics.util\");\nvar _utils = require(\"./utils\");\nvar _class;\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\n// @ts-ignore\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n/**\n * Metrics plugin to centralize all types of metrics.\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?pageId=231011379\n * @class\n */\nvar Metrics = /*#__PURE__*/function (_WebexPlugin) {\n (0, _inherits2.default)(Metrics, _WebexPlugin);\n var _super = _createSuper(Metrics);\n /**\n * Constructor\n * @param args\n * @constructor\n * @private\n * @returns\n */\n function Metrics() {\n var _this;\n (0, _classCallCheck2.default)(this, Metrics);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n\n // @ts-ignore\n // Call Diagnostic latencies\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"callDiagnosticLatencies\", void 0);\n // Helper classes to handle the different types of metrics\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"callDiagnosticMetrics\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"behavioralMetrics\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"operationalMetrics\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"businessMetrics\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"isReady\", false);\n _this.callDiagnosticLatencies = new _callDiagnosticMetricsLatencies.default({}, {\n parent: _this.webex\n });\n _this.onReady();\n return _this;\n }\n\n /**\n * On Ready\n */\n (0, _createClass2.default)(Metrics, [{\n key: \"onReady\",\n value: function onReady() {\n var _this2 = this;\n // @ts-ignore\n this.webex.once('ready', function () {\n // @ts-ignore\n _this2.callDiagnosticMetrics = new _callDiagnosticMetrics.default({}, {\n parent: _this2.webex\n });\n _this2.isReady = true;\n });\n }\n\n /**\n * Used for internal purposes only\n * @param args\n */\n }, {\n key: \"submitInternalEvent\",\n value: function submitInternalEvent(_ref) {\n var name = _ref.name,\n payload = _ref.payload,\n options = _ref.options;\n if (name === 'internal.reset.join.latencies') {\n this.callDiagnosticLatencies.clearTimestamps();\n } else {\n this.callDiagnosticLatencies.saveTimestamp({\n key: name\n });\n }\n }\n\n /**\n * if webex metrics is ready, build behavioral metric backend if not already done.\n */\n }, {\n key: \"lazyBuildBehavioralMetrics\",\n value: function lazyBuildBehavioralMetrics() {\n if (this.isReady && !this.behavioralMetrics) {\n // @ts-ignore\n this.behavioralMetrics = new _behavioralMetrics.default({}, {\n parent: this.webex\n });\n }\n }\n\n /**\n * if webex metrics is ready, build operational metric backend if not already done.\n */\n }, {\n key: \"lazyBuildOperationalMetrics\",\n value: function lazyBuildOperationalMetrics() {\n if (this.isReady && !this.operationalMetrics) {\n // @ts-ignore\n this.operationalMetrics = new _operationalMetrics.default({}, {\n parent: this.webex\n });\n }\n }\n\n /**\n * if webex metrics is ready, build business metric backend if not already done.\n */\n }, {\n key: \"lazyBuildBusinessMetrics\",\n value: function lazyBuildBusinessMetrics() {\n if (this.isReady && !this.businessMetrics) {\n // @ts-ignore\n this.businessMetrics = new _businessMetrics.default({}, {\n parent: this.webex\n });\n }\n }\n\n /**\n * @returns true once we have the deviceId we need to submit behavioral events to Amplitude\n */\n }, {\n key: \"isReadyToSubmitBehavioralEvents\",\n value: function isReadyToSubmitBehavioralEvents() {\n var _this$behavioralMetri, _this$behavioralMetri2;\n this.lazyBuildBehavioralMetrics();\n return (_this$behavioralMetri = (_this$behavioralMetri2 = this.behavioralMetrics) === null || _this$behavioralMetri2 === void 0 ? void 0 : _this$behavioralMetri2.isReadyToSubmitEvents()) !== null && _this$behavioralMetri !== void 0 ? _this$behavioralMetri : false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit operational events\n */\n }, {\n key: \"isReadyToSubmitOperationalEvents\",\n value: function isReadyToSubmitOperationalEvents() {\n var _this$operationalMetr, _this$operationalMetr2;\n this.lazyBuildOperationalMetrics();\n return (_this$operationalMetr = (_this$operationalMetr2 = this.operationalMetrics) === null || _this$operationalMetr2 === void 0 ? void 0 : _this$operationalMetr2.isReadyToSubmitEvents()) !== null && _this$operationalMetr !== void 0 ? _this$operationalMetr : false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit business events\n */\n }, {\n key: \"isReadyToSubmitBusinessEvents\",\n value: function isReadyToSubmitBusinessEvents() {\n var _this$businessMetrics, _this$businessMetrics2;\n this.lazyBuildBusinessMetrics();\n return (_this$businessMetrics = (_this$businessMetrics2 = this.businessMetrics) === null || _this$businessMetrics2 === void 0 ? void 0 : _this$businessMetrics2.isReadyToSubmitEvents()) !== null && _this$businessMetrics !== void 0 ? _this$businessMetrics : false;\n }\n\n /**\n * Behavioral event\n * @param args\n */\n }, {\n key: \"submitBehavioralEvent\",\n value: function submitBehavioralEvent(_ref2) {\n var product = _ref2.product,\n agent = _ref2.agent,\n target = _ref2.target,\n verb = _ref2.verb,\n payload = _ref2.payload;\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\"NewMetrics: @submitBehavioralEvent. Attempted to submit before webex.ready: \".concat(product, \".\").concat(agent, \".\").concat(target, \".\").concat(verb));\n return _promise.default.resolve();\n }\n this.lazyBuildBehavioralMetrics();\n return this.behavioralMetrics.submitBehavioralEvent({\n product: product,\n agent: agent,\n target: target,\n verb: verb,\n payload: payload\n });\n }\n\n /**\n * Operational event\n * @param args\n */\n }, {\n key: \"submitOperationalEvent\",\n value: function submitOperationalEvent(_ref3) {\n var name = _ref3.name,\n payload = _ref3.payload;\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\"NewMetrics: @submitOperationalEvent. Attempted to submit before webex.ready: \".concat(name));\n return _promise.default.resolve();\n }\n this.lazyBuildOperationalMetrics();\n return this.operationalMetrics.submitOperationalEvent({\n name: name,\n payload: payload\n });\n }\n\n /**\n * Business event\n * @param args\n */\n }, {\n key: \"submitBusinessEvent\",\n value: function submitBusinessEvent(_ref4) {\n var name = _ref4.name,\n payload = _ref4.payload,\n table = _ref4.table,\n metadata = _ref4.metadata;\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\"NewMetrics: @submitBusinessEvent. Attempted to submit before webex.ready: \".concat(name));\n return _promise.default.resolve();\n }\n this.lazyBuildBusinessMetrics();\n return this.businessMetrics.submitBusinessEvent({\n name: name,\n payload: payload,\n table: table,\n metadata: metadata\n });\n }\n\n /**\n * Call Analyzer: Media Quality Event\n * @param args\n */\n }, {\n key: \"submitMQE\",\n value: function submitMQE(_ref5) {\n var name = _ref5.name,\n payload = _ref5.payload,\n options = _ref5.options;\n this.callDiagnosticLatencies.saveTimestamp({\n key: name\n });\n this.callDiagnosticMetrics.submitMQE({\n name: name,\n payload: payload,\n options: options\n });\n }\n\n /**\n * Call Analyzer: Feature Usage Event\n * @param args\n */\n }, {\n key: \"submitFeatureEvent\",\n value: function submitFeatureEvent(_ref6) {\n var name = _ref6.name,\n payload = _ref6.payload,\n options = _ref6.options;\n throw new Error('Not implemented.');\n }\n\n /**\n * Call Analyzer: Client Event\n * @public\n * @param args\n */\n }, {\n key: \"submitClientEvent\",\n value: function submitClientEvent(_ref7) {\n var name = _ref7.name,\n payload = _ref7.payload,\n options = _ref7.options;\n if (!this.callDiagnosticLatencies || !this.callDiagnosticMetrics) {\n // @ts-ignore\n this.webex.logger.log(\"NewMetrics: @submitClientEvent. Attempted to submit before webex.ready. Event name: \".concat(name));\n return _promise.default.resolve();\n }\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {\n meetingId: options === null || options === void 0 ? void 0 : options.meetingId\n }\n });\n return this.callDiagnosticMetrics.submitClientEvent({\n name: name,\n payload: payload,\n options: options\n });\n }\n\n /**\n * Issue request to alias a user's pre-login ID with their CI UUID\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n }, {\n key: \"clientMetricsAliasUser\",\n value: function clientMetricsAliasUser(preLoginId) {\n var _this3 = this;\n // @ts-ignore\n return this.webex.request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics',\n headers: {\n 'x-prelogin-userid': preLoginId\n },\n body: {},\n qs: {\n alias: true\n }\n }).then(function (res) {\n // @ts-ignore\n _this3.webex.logger.log(\"NewMetrics: @clientMetricsAliasUser. Request successful.\");\n return res;\n }).catch(function (err) {\n // @ts-ignore\n _this3.logger.error(\"NewMetrics: @clientMetricsAliasUser. Request failed:\", \"err: \".concat((0, _utils.generateCommonErrorMetadata)(err)));\n return _promise.default.reject(err);\n });\n }\n\n /**\n * Returns a promise that will resolve to fetch options for submitting a metric.\n *\n * This is to support quickly submitting metrics when the browser/tab is closing.\n * Calling submitClientEvent will not work because there some async steps that will\n * not complete before the browser is closed. Instead, we pre-gather all the\n * information/options needed for the request(s), and then simply and quickly\n * fire the fetch(es) when beforeUnload is triggered.\n *\n * We must use fetch instead of request because fetch has a keepalive option that\n * allows the request it to outlive the page.\n *\n * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will\n * properly adjust them before submitting.\n *\n * @public\n * @param {Object} arg\n * @param {String} arg.name - event name\n * @param {Object} arg.payload - event payload\n * @param {Object} arg.options - other options\n * @returns {Promise} promise that resolves to options to be used with fetch\n */\n }, {\n key: \"buildClientEventFetchRequestOptions\",\n value: (function () {\n var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref8) {\n var name, payload, options;\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n name = _ref8.name, payload = _ref8.payload, options = _ref8.options;\n return _context.abrupt(\"return\", this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({\n name: name,\n payload: payload,\n options: options\n }));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee, this);\n }));\n function buildClientEventFetchRequestOptions(_x) {\n return _buildClientEventFetchRequestOptions.apply(this, arguments);\n }\n return buildClientEventFetchRequestOptions;\n }()\n /**\n * Submits a metric from pre-built request options via the fetch API. Updates\n * the \"$timings\" and \"originTime\" values to Date.now() since the existing times\n * were set when the options were built (not submitted).\n * @param {any} options - the pre-built request options for submitting a metric\n * @returns {Promise} promise that resolves to the response object\n */\n )\n }, {\n key: \"setMetricTimingsAndFetch\",\n value: function setMetricTimingsAndFetch(options) {\n // @ts-ignore\n return this.webex.setTimingsAndFetch((0, _callDiagnosticMetrics2.setMetricTimings)(options));\n }\n\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n }, {\n key: \"isServiceErrorExpected\",\n value: function isServiceErrorExpected(serviceErrorCode) {\n return this.callDiagnosticMetrics.isServiceErrorExpected(serviceErrorCode);\n }\n }]);\n return Metrics;\n}(_webexCore.WebexPlugin);\n_class = Metrics;\n// eslint-disable-next-line no-use-before-define\n(0, _defineProperty2.default)(Metrics, \"instance\", void 0);\nvar _default = exports.default = Metrics;\n//# sourceMappingURL=new-metrics.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _genericMetrics = _interopRequireDefault(require(\"./generic-metrics\"));\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n/**\n * @description Util class to handle Operational Metrics\n * @export\n * @class OperationalMetrics\n */\nvar OperationalMetrics = exports.default = /*#__PURE__*/function (_GenericMetrics) {\n (0, _inherits2.default)(OperationalMetrics, _GenericMetrics);\n var _super = _createSuper(OperationalMetrics);\n function OperationalMetrics() {\n (0, _classCallCheck2.default)(this, OperationalMetrics);\n return _super.apply(this, arguments);\n }\n (0, _createClass2.default)(OperationalMetrics, [{\n key: \"submitOperationalEvent\",\n value:\n /**\n * Submit an operational metric to our metrics endpoint.\n * @param {string} name of the metric\n * @param {EventPayload} user payload of the metric\n * @returns {Promise}\n */\n function submitOperationalEvent(_ref) {\n var name = _ref.name,\n payload = _ref.payload;\n var event = this.createTaggedEventObject({\n type: ['operational'],\n name: name,\n payload: payload\n });\n this.submitEvent({\n kind: 'operational-events -> ',\n name: name,\n event: event\n });\n }\n }]);\n return OperationalMetrics;\n}(_genericMetrics.default);\n//# sourceMappingURL=operational-metrics.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _lodash = require(\"lodash\");\nvar _batcher = _interopRequireDefault(require(\"./batcher\"));\nvar _callDiagnosticMetrics = require(\"./call-diagnostic/call-diagnostic-metrics.util\");\nvar _utils = require(\"./utils\");\nvar PRE_LOGIN_METRICS_IDENTIFIER = 'Pre Login Metrics -->';\nvar PreLoginMetricsBatcher = _batcher.default.extend({\n namespace: 'Metrics',\n preLoginId: undefined,\n /**\n * Save the pre-login ID.\n * @param {string} preLoginId The pre-login ID to be saved.\n * @returns {void}\n */\n savePreLoginId: function savePreLoginId(preLoginId) {\n this.preLoginId = preLoginId;\n },\n /**\n * Prepare item\n * @param {any} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n return _promise.default.resolve((0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, item));\n },\n /**\n * Prepare request, add time sensitive date etc.\n * @param {any[]} queue\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(queue) {\n // Add sent timestamp\n queue.forEach(function (item) {\n item.eventPayload.originTime = item.eventPayload.originTime || {};\n item.eventPayload.originTime.sent = new Date().toISOString();\n });\n return _promise.default.resolve(queue);\n },\n /**\n *\n * @param {any} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n var _this = this;\n var batchId = (0, _lodash.uniqueId)('prelogin-batch-');\n if (this.preLoginId === undefined) {\n this.webex.logger.error(PRE_LOGIN_METRICS_IDENTIFIER, \"PreLoginMetricsBatcher: @submitHttpRequest#\".concat(batchId, \". PreLoginId is not set.\"));\n return _promise.default.reject(new Error('PreLoginId is not set.'));\n }\n return this.webex.request({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics-prelogin',\n headers: {\n authorization: false,\n 'x-prelogin-userid': this.preLoginId\n },\n body: {\n metrics: payload\n },\n waitForServiceTimeout: this.webex.config.metrics.waitForServiceTimeout\n }).then(function (res) {\n _this.webex.logger.log(PRE_LOGIN_METRICS_IDENTIFIER, \"PreLoginMetricsBatcher: @submitHttpRequest#\".concat(batchId, \". Request successful.\"));\n return res;\n }).catch(function (err) {\n _this.webex.logger.error(PRE_LOGIN_METRICS_IDENTIFIER, \"PreLoginMetricsBatcher: @submitHttpRequest#\".concat(batchId, \". Request failed:\"), \"error: \".concat((0, _utils.generateCommonErrorMetadata)(err)));\n return _promise.default.reject(err);\n });\n }\n});\nvar _default = exports.default = PreLoginMetricsBatcher;\n//# sourceMappingURL=prelogin-metrics-batcher.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar RTC_METRICS = exports.default = {\n APP_ID: 'FFB51ED5-4319-4C55-8303-B1F2FCCDE231'\n};\n//# sourceMappingURL=constants.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\nvar CallDiagnosticUtils = _interopRequireWildcard(require(\"../call-diagnostic/call-diagnostic-metrics.util\"));\nvar _constants = _interopRequireDefault(require(\"./constants\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\n/* eslint-disable class-methods-use-this */\n\nvar parseJsonPayload = function parseJsonPayload(payload) {\n try {\n if (payload && payload[0]) {\n return JSON.parse(payload[0]);\n }\n return null;\n } catch (_) {\n return null;\n }\n};\n\n/**\n * Rtc Metrics\n */\nvar RtcMetrics = exports.default = /*#__PURE__*/function () {\n /**\n * Initialize the interval.\n *\n * @param {object} webex - The main `webex` object.\n * @param {IdType} Ids - Meeting or Calling id.\n * @param {string} correlationId - The correlation id.\n */\n function RtcMetrics(webex, _ref, correlationId) {\n var meetingId = _ref.meetingId,\n callId = _ref.callId;\n (0, _classCallCheck2.default)(this, RtcMetrics);\n /**\n * Array of MetricData items to be sent to the metrics service.\n */\n (0, _defineProperty2.default)(this, \"metricsQueue\", []);\n (0, _defineProperty2.default)(this, \"intervalId\", void 0);\n (0, _defineProperty2.default)(this, \"webex\", void 0);\n (0, _defineProperty2.default)(this, \"meetingId\", void 0);\n (0, _defineProperty2.default)(this, \"callId\", void 0);\n (0, _defineProperty2.default)(this, \"correlationId\", void 0);\n (0, _defineProperty2.default)(this, \"connectionId\", void 0);\n (0, _defineProperty2.default)(this, \"shouldSendMetricsOnNextStatsReport\", void 0);\n // `window` is used to prevent typescript from returning a NodeJS.Timer.\n this.intervalId = window.setInterval(this.sendMetricsInQueue.bind(this), 30 * 1000);\n this.meetingId = meetingId;\n this.callId = callId;\n this.webex = webex;\n this.correlationId = correlationId;\n this.resetConnection();\n }\n\n /**\n * Updates the call identifier with the provided value.\n *\n * @param {string} callId - The new call identifier to set.\n * @returns {void}\n */\n (0, _createClass2.default)(RtcMetrics, [{\n key: \"updateCallId\",\n value: function updateCallId(callId) {\n this.callId = callId;\n }\n\n /**\n * Check to see if the metrics queue has any items.\n *\n * @returns {void}\n */\n }, {\n key: \"sendMetricsInQueue\",\n value: function sendMetricsInQueue() {\n if (this.metricsQueue.length) {\n this.sendMetrics();\n this.metricsQueue = [];\n }\n }\n\n /**\n * Forces sending metrics when we get the next stats-report\n *\n * This is useful for cases when something important happens that affects the media connection,\n * for example when we move from lobby into the meeting.\n *\n * @returns {void}\n */\n }, {\n key: \"sendNextMetrics\",\n value: function sendNextMetrics() {\n this.shouldSendMetricsOnNextStatsReport = true;\n }\n\n /**\n * Add metrics items to the metrics queue.\n *\n * @param {object} data - An object with a payload array of metrics items.\n *\n * @returns {void}\n */\n }, {\n key: \"addMetrics\",\n value: function addMetrics(data) {\n if (data.payload.length) {\n if (data.name === 'stats-report') {\n data.payload = data.payload.map(this.anonymizeIp);\n }\n this.metricsQueue.push(data);\n if (this.shouldSendMetricsOnNextStatsReport && data.name === 'stats-report') {\n // this is the first useful set of data (WCME gives it to us after 5s), send it out immediately\n // in case the user is unhappy and closes the browser early\n this.sendMetricsInQueue();\n this.shouldSendMetricsOnNextStatsReport = false;\n }\n try {\n // If a connection fails, send the rest of the metrics in queue and get a new connection id.\n var parsedPayload = parseJsonPayload(data.payload);\n if (data.name === 'onconnectionstatechange' && parsedPayload && parsedPayload.value === 'failed') {\n this.sendMetricsInQueue();\n this.resetConnection();\n }\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n /**\n * Clear the metrics interval.\n *\n * @returns {void}\n */\n }, {\n key: \"closeMetrics\",\n value: function closeMetrics() {\n this.sendMetricsInQueue();\n clearInterval(this.intervalId);\n }\n\n /**\n * Anonymize IP addresses.\n *\n * @param {array} stats - An RTCStatsReport organized into an array of strings.\n * @returns {string}\n */\n }, {\n key: \"anonymizeIp\",\n value: function anonymizeIp(stats) {\n var data = JSON.parse(stats);\n // on local and remote candidates, anonymize the last 4 bits.\n if (data.type === 'local-candidate' || data.type === 'remote-candidate') {\n data.ip = CallDiagnosticUtils.anonymizeIPAddress(data.ip) || undefined;\n data.address = CallDiagnosticUtils.anonymizeIPAddress(data.address) || undefined;\n data.relatedAddress = CallDiagnosticUtils.anonymizeIPAddress(data.relatedAddress) || undefined;\n }\n return (0, _stringify.default)(data);\n }\n\n /**\n * Set a new connection id.\n *\n * @returns {void}\n */\n }, {\n key: \"resetConnection\",\n value: function resetConnection() {\n this.connectionId = _uuid.default.v4();\n this.shouldSendMetricsOnNextStatsReport = true;\n }\n\n /**\n * Send metrics to the metrics service.\n *\n * @returns {void}\n */\n }, {\n key: \"sendMetrics\",\n value: function sendMetrics() {\n var metricsAttributes = {\n type: 'webrtc',\n version: '1.1.0',\n userId: this.webex.internal.device.userId,\n correlationId: this.correlationId,\n connectionId: this.connectionId,\n data: this.metricsQueue\n };\n if (this.meetingId) {\n metricsAttributes.meetingId = this.meetingId;\n } else if (this.callId) {\n metricsAttributes.callId = this.callId;\n }\n this.webex.request({\n method: 'POST',\n service: 'unifiedTelemetry',\n resource: 'metric/v2',\n headers: {\n type: 'webrtcMedia',\n appId: _constants.default.APP_ID\n },\n body: {\n metrics: [metricsAttributes]\n }\n });\n }\n }]);\n return RtcMetrics;\n}();\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.generateCommonErrorMetadata = void 0;\nvar _stringify = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/json/stringify\"));\n/* eslint-disable import/prefer-default-export */\n/**\n * Generates common metadata for errors\n * @param {any} error\n * @returns {object}\n */\nvar generateCommonErrorMetadata = exports.generateCommonErrorMetadata = function generateCommonErrorMetadata(error) {\n if (error instanceof Error) {\n return (0, _stringify.default)({\n message: error === null || error === void 0 ? void 0 : error.message,\n name: error === null || error === void 0 ? void 0 : error.name,\n stack: error === null || error === void 0 ? void 0 : error.stack\n });\n }\n return error;\n};\n//# sourceMappingURL=utils.js.map\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n presence: {\n batcherWait: 50,\n batcherMaxCalls: 50,\n batcherMaxWait: 150\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UPDATE_PRESENCE_DELAY = exports.SUBSCRIPTION_DELAY = exports.PRESENCE_UPDATE = exports.PREMATURE_EXPIRATION_SUBSCRIPTION_TIME = exports.GROUNDSKEEPER_INTERVAL = exports.FETCH_DELAY = exports.EXPIRED_PRESENCE_TIME = exports.ENVELOPE_TYPE = exports.DEFAULT_SUBSCRIPTION_TTL = exports.APHELEIA_SUBSCRIPTION_UPDATE = void 0;\nvar GROUNDSKEEPER_INTERVAL = exports.GROUNDSKEEPER_INTERVAL = 20 * 1000; // 20 seconds in ms\n\nvar FETCH_DELAY = exports.FETCH_DELAY = 300; // ms\n\nvar UPDATE_PRESENCE_DELAY = exports.UPDATE_PRESENCE_DELAY = 60 * 1000; // 1 minute in ms\nvar EXPIRED_PRESENCE_TIME = exports.EXPIRED_PRESENCE_TIME = 10 * 60 * 1000; // 10 minutes in ms\n\nvar SUBSCRIPTION_DELAY = exports.SUBSCRIPTION_DELAY = 60 * 1000; // 1 minute in ms\nvar PREMATURE_EXPIRATION_SUBSCRIPTION_TIME = exports.PREMATURE_EXPIRATION_SUBSCRIPTION_TIME = 60 * 1000; // 1 minute in ms\nvar DEFAULT_SUBSCRIPTION_TTL = exports.DEFAULT_SUBSCRIPTION_TTL = 10 * 60 * 1000; // 10 minutes in ms\n\nvar APHELEIA_SUBSCRIPTION_UPDATE = exports.APHELEIA_SUBSCRIPTION_UPDATE = 'event:apheleia.subscription_update';\nvar PRESENCE_UPDATE = exports.PRESENCE_UPDATE = 'updated';\nvar ENVELOPE_TYPE = exports.ENVELOPE_TYPE = {\n SUBSCRIPTION: 'subscription',\n PRESENCE: 'presence',\n DELETE: 'delete'\n};\n//# sourceMappingURL=constants.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _presence.default;\n }\n});\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nrequire(\"@webex/internal-plugin-device\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lodash = require(\"lodash\");\nvar _presence = _interopRequireDefault(require(\"./presence\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('presence', _presence.default, {\n payloadTransformer: {\n predicates: [{\n name: 'normalizeSingleStatusResponse',\n direction: 'inbound',\n test: function test(ctx, response) {\n // POST to /apheleia/api/v1/events\n return _promise.default.resolve((0, _lodash.has)(response, 'body.eventType') && (0, _lodash.has)(response, 'body.subject'));\n },\n extract: function extract(response) {\n return _promise.default.resolve(response);\n }\n }],\n transforms: [{\n name: 'normalizeSingleStatusResponse',\n direction: 'inbound',\n fn: function fn(ctx, response) {\n response.body.status = response.body.eventType;\n }\n }]\n },\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _webexCore = require(\"@webex/webex-core\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @class\n * @ignore\n */\nvar PresenceBatcher = _webexCore.Batcher.extend({\n namespace: 'Presence',\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {HttpResponseObject} res\n * @returns {Promise}\n */\n handleHttpSuccess: function handleHttpSuccess(res) {\n var _this = this;\n return _promise.default.all(res.body.statusList.map(function (presenceResponse) {\n return _this.handleItemSuccess(presenceResponse.subject, presenceResponse);\n }));\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {string} item\n * @param {Object} response\n * @returns {Promise}\n */\n handleItemFailure: function handleItemFailure(item, response) {\n return this.getDeferredForResponse(item).then(function (defer) {\n defer.reject(response);\n });\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {string} item\n * @param {Object} response\n * @returns {Promise}\n */\n handleItemSuccess: function handleItemSuccess(item, response) {\n return this.getDeferredForResponse(item).then(function (defer) {\n defer.resolve(response);\n });\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {string} id\n * @returns {Promise}\n */\n fingerprintRequest: function fingerprintRequest(id) {\n return _promise.default.resolve(id);\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {string} id\n * @returns {Promise}\n */\n fingerprintResponse: function fingerprintResponse(id) {\n return _promise.default.resolve(id);\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {Array} ids\n * @returns {Promise}\n */\n prepareRequest: function prepareRequest(ids) {\n return _promise.default.resolve(ids);\n },\n /**\n * @instance\n * @memberof PresenceBatcher\n * @param {Object} subjects\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(subjects) {\n return this.webex.request({\n method: 'POST',\n api: 'apheleia',\n resource: 'compositions',\n body: {\n subjects: subjects\n }\n });\n }\n});\nvar _default = exports.default = PresenceBatcher;\n//# sourceMappingURL=presence-batcher.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _assign = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/assign\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _entries = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/entries\"));\nvar _toConsumableArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/toConsumableArray\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _lodash = require(\"lodash\");\nvar _constants = require(\"./constants\");\n/**\n * Presence Worker\n * Manages fetches and subscriptions for presence\n * @class\n */\nvar PresenceWorker = exports.default = /*#__PURE__*/function () {\n /**\n * Constructs a presence worker to execute and\n * maintain tasks related to presence upkeep.\n * @returns {undefined}\n */\n function PresenceWorker() {\n (0, _classCallCheck2.default)(this, PresenceWorker);\n (0, _defineProperty2.default)(this, \"debouncedFetch\", (0, _lodash.debounce)(this.checkFetchers, _constants.FETCH_DELAY));\n this.presences = {}; // current presence objects; updated time\n this.watchers = {}; // counter of visible presence-required objects\n this.fetchers = {}; // waiting to get presence object\n this.flights = {}; // in flight to get presence object\n this.campers = {}; // waiting to subscribe; updated time\n this.subscribers = {}; // current subscriptions; expiration time\n }\n\n /**\n * Connect to the mercury for presence and starts worker.\n * @param {object} webex\n * @returns {undefined}\n */\n (0, _createClass2.default)(PresenceWorker, [{\n key: \"initialize\",\n value: function initialize(webex) {\n var _this = this;\n if (!webex || !webex.internal) {\n throw new Error('Must initialize Presence Worker with webex!');\n }\n this.webex = webex;\n var mercury = this.webex.internal.mercury.connected ? _promise.default.resolve() : this.webex.internal.mercury.connect();\n mercury.then(function () {\n _this.webex.internal.mercury.on(_constants.APHELEIA_SUBSCRIPTION_UPDATE, _this.subscriptionUpdate.bind(_this));\n });\n setInterval(this.groundskeeper.bind(this), _constants.GROUNDSKEEPER_INTERVAL);\n }\n\n /**\n * Trigger a subscription update event.\n * @param {string} event\n * @returns {undefined}\n */\n }, {\n key: \"subscriptionUpdate\",\n value: function subscriptionUpdate(event) {\n this.presences[event.data.subject] = new Date().getTime();\n this.webex.internal.presence.emitEvent(_constants.PRESENCE_UPDATE, {\n type: _constants.ENVELOPE_TYPE.SUBSCRIPTION,\n payload: event.data\n });\n }\n\n /**\n * Retrieves and subscribes to a user's presence.\n * @param {string} id\n * @returns {undefined}\n */\n }, {\n key: \"enqueue\",\n value: function enqueue(id) {\n var now = new Date().getTime();\n if (this.watchers[id]) {\n this.watchers[id] += 1;\n } else {\n this.watchers[id] = 1;\n }\n if (this.subscribers[id]) {\n return;\n }\n if (!this.campers[id]) {\n this.campers[id] = now;\n }\n\n // Retrieve presence if:\n // not in flight or\n // don't already have the presence or\n // presence has gone stale\n if (!this.flights[id] && (!this.presences[id] || this.presences[id] < now - _constants.UPDATE_PRESENCE_DELAY)) {\n this.fetchers[id] = id;\n this.debouncedFetch();\n }\n }\n\n /**\n * Retract from subscribing to a user's presence.\n * @param {string} id\n * @returns {undefined}\n */\n }, {\n key: \"dequeue\",\n value: function dequeue(id) {\n if (this.watchers[id]) {\n this.watchers[id] -= 1;\n if (this.watchers[id] <= 0) {\n delete this.watchers[id];\n delete this.fetchers[id];\n delete this.campers[id];\n }\n }\n }\n\n /**\n * Retrieve users' presences.\n * @returns {undefined}\n */\n }, {\n key: \"checkFetchers\",\n value: function checkFetchers() {\n var _this2 = this;\n var boarding = this.fetchers;\n (0, _assign.default)(this.flights, boarding);\n this.fetchers = {};\n this.webex.internal.presence.list((0, _keys.default)(boarding)).then(function (response) {\n var now = new Date().getTime();\n response.statusList.forEach(function (presence) {\n var id = presence.subject;\n delete _this2.flights[id];\n _this2.presences[id] = now;\n });\n _this2.webex.internal.presence.emitEvent(_constants.PRESENCE_UPDATE, {\n type: _constants.ENVELOPE_TYPE.PRESENCE,\n payload: response\n });\n });\n }\n }, {\n key: \"checkCampers\",\n value:\n /**\n * Determine if we should subscribe to users' presences.\n * @returns {Array}: User ids to subscribe.\n */\n function checkCampers() {\n var _this3 = this;\n var now = new Date().getTime();\n var subscribers = [];\n (0, _entries.default)(this.campers).forEach(function (camper) {\n var id = camper[0];\n var time = camper[1];\n\n // Subscribe if they've been camping for a minute\n if (time < now - _constants.SUBSCRIPTION_DELAY) {\n delete _this3.campers[id];\n _this3.subscribers[id] = null;\n subscribers.push(id);\n }\n });\n return subscribers;\n }\n\n /**\n * Determine if we should re-subscribe or remove users' subscriptions.\n * @returns {Array}: User ids to re-subscribe.\n */\n }, {\n key: \"checkSubscriptions\",\n value: function checkSubscriptions() {\n var _this4 = this;\n var now = new Date().getTime();\n var renewIds = [];\n (0, _entries.default)(this.subscribers).forEach(function (subscription) {\n var id = subscription[0];\n var expiration = subscription[1];\n if (expiration) {\n // Renew subscription if they're about to expire\n if (_this4.watchers[id] && now > expiration - _constants.PREMATURE_EXPIRATION_SUBSCRIPTION_TIME) {\n renewIds.push(id);\n } else if (now > expiration) {\n delete _this4.subscribers[id];\n }\n }\n });\n return renewIds;\n }\n\n /**\n * Remove expired presence objects.\n * @returns {undefined}\n */\n }, {\n key: \"cleanPresences\",\n value: function cleanPresences() {\n var _this5 = this;\n var trash = [];\n var tenMinutesAgo = new Date().getTime() - _constants.EXPIRED_PRESENCE_TIME;\n (0, _entries.default)(this.presences).forEach(function (presence) {\n var id = presence[0];\n var lastUpdated = presence[1];\n\n // Delete the object if it is stale\n if (lastUpdated < tenMinutesAgo) {\n delete _this5.presences[id];\n trash.push(id);\n }\n });\n\n // Tells client to delete it too\n if (trash.length) {\n this.webex.internal.presence.emitEvent(_constants.PRESENCE_UPDATE, {\n type: _constants.ENVELOPE_TYPE.DELETE,\n payload: trash\n });\n }\n }\n\n /**\n * Execute chores on an interval.\n * Checks if we should make new subscribe,\n * checks if we should re-subscribe,\n * removes expired subscriptions,\n * removes expired presence objects.\n * @returns {undefined}\n */\n }, {\n key: \"groundskeeper\",\n value: function groundskeeper() {\n var _this6 = this;\n var campers = this.checkCampers();\n var renewSubscriptions = this.checkSubscriptions();\n var ids = [].concat((0, _toConsumableArray2.default)(campers), (0, _toConsumableArray2.default)(renewSubscriptions));\n if (ids.length) {\n this.webex.internal.presence.subscribe(ids).then(function (body) {\n var now = new Date().getTime();\n body.responses.forEach(function (response) {\n if (response.responseCode === 200) {\n var ttl = response.subscriptionTtl * 1000;\n _this6.subscribers[response.subject] = now + ttl;\n _this6.presences[response.status.subject] = now;\n } else {\n // If it errored for any reason, set the ttl so we clean it out eventually\n _this6.subscribers[response.subject] = now + _constants.DEFAULT_SUBSCRIPTION_TTL;\n }\n });\n });\n }\n this.cleanPresences();\n }\n }]);\n return PresenceWorker;\n}();\n//# sourceMappingURL=presence-worker.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _toConsumableArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/toConsumableArray\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _isArray = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/array/is-array\"));\nrequire(\"@webex/internal-plugin-device\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _presenceBatcher = _interopRequireDefault(require(\"./presence-batcher\"));\nvar _presenceWorker = _interopRequireDefault(require(\"./presence-worker\"));\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar defaultSubscriptionTtl = 600;\nvar USER = 'user';\nvar USER_PRESENCE_ENABLED = 'user-presence-enabled';\n\n/**\n * @class\n * @extends WebexPlugin\n */\nvar Presence = _webexCore.WebexPlugin.extend({\n namespace: 'Presence',\n children: {\n batcher: _presenceBatcher.default\n },\n session: {\n worker: {\n default: function _default() {\n return new _presenceWorker.default();\n },\n type: 'any'\n }\n },\n /**\n * Initialize the presence plugin\n * @returns {undefined}\n */\n initialize: function initialize() {\n var _this = this;\n this.webex.once('ready', function () {\n if (_this.config.initializeWorker) {\n _this.worker.initialize(_this.webex);\n }\n });\n },\n /**\n * Initializes the presence worker.\n * @returns {undefined}\n */\n initializeWorker: function initializeWorker() {\n var _this2 = this;\n if (this.webex.ready) {\n this.worker.initialize(this.webex);\n } else {\n this.webex.once('ready', function () {\n _this2.worker.initialize(_this2.webex);\n });\n }\n },\n /**\n * Trigger an event.\n * @param {string} event\n * @param {string} payload\n * @returns {undefined}\n */\n emitEvent: function emitEvent(event, payload) {\n if (payload.type && payload.payload) {\n this.trigger(event, payload);\n }\n },\n /**\n * Enables presence feature\n * @returns {Promise} resolves with true, if successful\n */\n enable: function enable() {\n return this.webex.internal.feature.setFeature(USER, USER_PRESENCE_ENABLED, true).then(function (response) {\n return response.value;\n });\n },\n /**\n * Disables presence feature\n * @returns {Promise} resolves with false, if successful\n */\n disable: function disable() {\n return this.webex.internal.feature.setFeature(USER, USER_PRESENCE_ENABLED, false).then(function (response) {\n return response.value;\n });\n },\n /**\n * Returns true if presence is enabled, false otherwise\n * @returns {Promise} resolves with true if presence is enabled\n */\n isEnabled: function isEnabled() {\n return this.webex.internal.feature.getFeature(USER, USER_PRESENCE_ENABLED);\n },\n /**\n * The status object\n * @typedef {Object} PresenceStatusObject\n * @property {string} url: Public resource identifier for presence\n * @property {string} subject: User ID for the user the returned composed presence represents\n * @property {string} status: Current composed presence state\n * @property {string} statusTime: DateTime in RFC3339 format that the current status began\n * @property {string} lastActive: DateTime in RFC3339 format that the service last saw activity from the user.\n * @property {string} expires: DEPRECATED - DateTime in RFC3339 format that represents when the current\n * status will expire. Will not exist if expiresTTL is -1.\n * @property {Number} expiresTTL: TTL in seconds until the status will expire. If TTL is -1 the current\n * status has no known expiration.\n * @property {string} expiresTime: DateTime in RFC3339 format that the current status will expire. Missing\n * field means no known expiration.\n * @property {Object} vectorCounters: Used for packet ordering and tracking.\n * @property {Boolean} suppressNotifications: Indicates if notification suppression is recommended for this status.\n * @property {string} lastSeenDeviceUrl: Resource Identifier of the last device to post presence activity for\n * this user.\n */\n /**\n * Gets the current presence status of a given person id\n * @param {string} personId\n * @returns {Promise} resolves with status object of person\n */\n get: function get(personId) {\n if (!personId) {\n return _promise.default.reject(new Error('A person id is required'));\n }\n return this.webex.request({\n method: 'GET',\n service: 'apheleia',\n resource: \"compositions?userId=\".concat(personId)\n }).then(function (response) {\n return response.body;\n });\n },\n /**\n * @typedef {Object} PresenceStatusesObject\n * @property {Array.} statusList\n */\n /**\n * Gets the current presence statuses of an array of people ids\n * @param {Array} personIds\n * @returns {Promise} resolves with an object with key of `statusList` array\n */\n list: function list(personIds) {\n var _this3 = this;\n if (!personIds || !(0, _isArray.default)(personIds)) {\n return _promise.default.reject(new Error('An array of person ids is required'));\n }\n return _promise.default.all(personIds.map(function (id) {\n return _this3.batcher.request(id);\n })).then(function (presences) {\n return {\n statusList: presences\n };\n });\n },\n /**\n * Subscribes to a person's presence status updates\n * Updates are sent via mercury events `apheleia.subscription_update`\n * @param {string | Array} personIds\n * @param {number} subscriptionTtl - Requested length of subscriptions in seconds.\n * @returns {Promise}\n */\n subscribe: function subscribe(personIds) {\n var _this4 = this;\n var subscriptionTtl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSubscriptionTtl;\n var subjects;\n var batches = [];\n var batchLimit = 50;\n if (!personIds) {\n return _promise.default.reject(new Error('A person id is required'));\n }\n if ((0, _isArray.default)(personIds)) {\n subjects = personIds;\n } else {\n subjects = [personIds];\n }\n // Limit batches to 50 ids per request\n for (var i = 0; i < subjects.length; i += batchLimit) {\n batches.push(subjects.slice(i, i + batchLimit));\n }\n return _promise.default.all(batches.map(function (ids) {\n return _this4.webex.request({\n method: 'POST',\n api: 'apheleia',\n resource: 'subscriptions',\n body: {\n subjects: ids,\n subscriptionTtl: subscriptionTtl,\n includeStatus: true\n }\n }).then(function (response) {\n return response.body.responses;\n });\n })).then(function (idBatches) {\n var _ref;\n return {\n responses: (_ref = []).concat.apply(_ref, (0, _toConsumableArray2.default)(idBatches))\n };\n });\n },\n /**\n * Unsubscribes from a person or group of people's presence subscription\n * @param {string | Array} personIds\n * @returns {Promise}\n */\n unsubscribe: function unsubscribe(personIds) {\n var subjects;\n if (!personIds) {\n return _promise.default.reject(new Error('A person id is required'));\n }\n if ((0, _isArray.default)(personIds)) {\n subjects = personIds;\n } else {\n subjects = [personIds];\n }\n return this.webex.request({\n method: 'POST',\n api: 'apheleia',\n resource: 'subscriptions',\n body: {\n subjects: subjects,\n subscriptionTtl: 0,\n includeStatus: true\n }\n });\n },\n /**\n * Sets the status of the current user\n * @param {string} status - active | inactive | ooo | dnd\n * @param {number} ttl - Time To Live for the event in seconds.\n * @returns {Promise}\n */\n setStatus: function setStatus(status, ttl) {\n if (!status) {\n return _promise.default.reject(new Error('A status is required'));\n }\n return this.webex.request({\n method: 'POST',\n api: 'apheleia',\n resource: 'events',\n body: _objectSpread(_objectSpread({\n subject: this.webex.internal.device.userId,\n eventType: status\n }, status !== 'dnd' && {\n label: this.webex.internal.device.userId\n }), {}, {\n ttl: ttl\n })\n }).then(function (response) {\n return response.body;\n });\n },\n /**\n * Retrieves and subscribes to a user's presence.\n * @param {string} id\n * @returns {undefined}\n */\n enqueue: function enqueue(id) {\n return this.worker.enqueue(id);\n },\n /**\n * Retract from subscribing to a user's presence.\n * @param {string} id\n * @returns {undefined}\n */\n dequeue: function dequeue(id) {\n return this.worker.dequeue(id);\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default2 = exports.default = Presence;\n//# sourceMappingURL=presence.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n search: {}\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _search.default;\n }\n});\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nrequire(\"@webex/internal-plugin-conversation\");\nrequire(\"@webex/internal-plugin-encryption\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lodash = require(\"lodash\");\nvar _search = _interopRequireDefault(require(\"./search\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('search', _search.default, {\n config: _config.default,\n payloadTransformer: {\n predicates: [{\n name: 'encryptSearchQuery',\n direction: 'outbound',\n test: function test(ctx, options) {\n if (!(0, _lodash.has)(options, 'body.query')) {\n return _promise.default.resolve(false);\n }\n if (!(0, _lodash.has)(options, 'body.searchEncryptionKeyUrl')) {\n return _promise.default.resolve(false);\n }\n if (options.service === 'argonaut') {\n return _promise.default.resolve(true);\n }\n if (options.url) {\n var service = ctx.webex.internal.services.getServiceFromUrl(options.url);\n return _promise.default.resolve(service && service.name === 'argonaut');\n }\n return _promise.default.resolve(false);\n },\n extract: function extract(options) {\n return _promise.default.resolve(options.body);\n }\n }, {\n name: 'transformObjectArray',\n direction: 'inbound',\n test: function test(ctx, response) {\n return _promise.default.resolve((0, _lodash.has)(response, 'body.activities.items[0].objectType')).then(function (res) {\n if (!res) {\n return _promise.default.resolve(false);\n }\n if (response.options.service === 'argonaut') {\n return _promise.default.resolve(true);\n }\n if (response.options.url) {\n var service = ctx.webex.internal.services.getServiceFromUrl(response.options.url);\n return _promise.default.resolve(service && service.name === 'argonaut');\n }\n return _promise.default.resolve(false);\n });\n },\n extract: function extract(response) {\n return _promise.default.resolve(response.body.activities.items);\n }\n }],\n transforms: [{\n name: 'encryptSearchQuery',\n direction: 'outbound',\n fn: function fn(ctx, object) {\n return ctx.webex.internal.encryption.encryptText(object.searchEncryptionKeyUrl, object.query).then(function (q) {\n object.query = q;\n });\n }\n }]\n }\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _deleteProperty = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/delete-property\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _assign = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/assign\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _getOwnPropertyDescriptor = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\"));\nvar _slicedToArray2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/slicedToArray\"));\nvar _applyDecoratedDescriptor2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/applyDecoratedDescriptor\"));\nvar _lodash = require(\"lodash\");\nvar _common = require(\"@webex/common\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _obj;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar Search = _webexCore.WebexPlugin.extend((_obj = {\n namespace: 'Search',\n people: function people(options) {\n options = options || {};\n if (!options.queryString && options.query) {\n options.queryString = options.query;\n (0, _deleteProperty.default)(options, 'query');\n }\n if (!options.queryString) {\n return _promise.default.reject(new Error('`options.query` is required'));\n }\n return this.request({\n api: 'argonaut',\n resource: 'directory',\n method: 'POST',\n body: options\n }).then(function (res) {\n return res.body;\n });\n },\n bindSearchKey: function bindSearchKey() {\n var _this = this;\n return this.webex.internal.encryption.kms.createUnboundKeys({\n count: 1\n }).then(function (_ref) {\n var _ref2 = (0, _slicedToArray2.default)(_ref, 1),\n key = _ref2[0];\n return _this.webex.internal.encryption.kms.createResource({\n key: key,\n userIds: [_this.webex.internal.device.userId]\n }).then(function () {\n return _this.webex.internal.device.set('searchEncryptionKeyUrl', key.uri);\n });\n });\n },\n /**\n * Fetches search result activities\n * @param {Object} options\n * @param {boolean} options.includeRemoteClusterReferences when true,\n * includes search results from remote clusters\n * @returns {Promise} Resolves with the activities\n */\n search: function search(options) {\n var _this2 = this;\n /* eslint max-nested-callbacks: [0] */\n options = options || {};\n var promise = _promise.default.resolve();\n if (!this.webex.internal.device.searchEncryptionKeyUrl) {\n promise = this.bindSearchKey();\n }\n return promise.then(function () {\n return _this2.webex.request({\n service: 'argonaut',\n resource: 'search',\n method: 'POST',\n body: (0, _assign.default)(options, {\n searchEncryptionKeyUrl: _this2.webex.internal.device.searchEncryptionKeyUrl\n })\n });\n }).then(function (res) {\n var resActivities = (0, _lodash.get)(res, 'body.activities.items', []);\n if (options.includeRemoteClusterReferences && res.body.breadcrumbs) {\n var breadcrumbs = res.body.breadcrumbs;\n var promises = [];\n (0, _keys.default)(breadcrumbs).forEach(function (cluster) {\n // Map activity URLs to their cluster\n var editedCluster = \"\".concat(cluster, \":identityLookup\");\n var clusterActivityUrls = breadcrumbs[cluster].items.map(function (activity) {\n return activity.activityUrl;\n });\n\n // Find activities per cluster\n var bulkActivitiesPromise = _this2.webex.internal.conversation.bulkActivitiesFetch(clusterActivityUrls, {\n cluster: editedCluster\n }).catch(function (err) {\n _this2.logger.warn('search: error fetching from remote clusters', err);\n return _promise.default.resolve([]);\n });\n promises.push(bulkActivitiesPromise);\n });\n return _promise.default.all(promises).then(function (clusterResults) {\n return clusterResults.reduce(function (accumulator, clusterResult) {\n return accumulator.concat(clusterResult);\n }, resActivities);\n });\n }\n return resActivities;\n });\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n}, ((0, _applyDecoratedDescriptor2.default)(_obj, \"bindSearchKey\", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, \"bindSearchKey\"), _obj)), _obj));\nvar _default = exports.default = Search;\n//# sourceMappingURL=search.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n device: {\n preDiscoveryServices: {\n atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\n atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\n clientLogs: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1',\n clientLogsServiceUrl: process.env.CLIENT_LOGS_SERVICE_URL || 'https://client-logs-a.wbx2.com/api/v1'\n }\n },\n support: {\n appType: '',\n appVersion: '',\n languageCode: '',\n incrementalLogs: false\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _support.default;\n }\n});\nrequire(\"@webex/internal-plugin-device\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _support = _interopRequireDefault(require(\"./support\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('support', _support.default, {\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _regenerator = _interopRequireDefault(require(\"@babel/runtime-corejs2/regenerator\"));\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _lodash = require(\"lodash\");\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nvar Support = _webexCore.WebexPlugin.extend({\n namespace: 'Support',\n getFeedbackUrl: function getFeedbackUrl(options) {\n options = options || {};\n return this.request({\n method: 'POST',\n api: 'conversation',\n resource: 'users/deskFeedbackUrl',\n body: (0, _lodash.defaults)(options, {\n appVersion: this.config.appVersion,\n appType: this.config.appType,\n feedbackId: options.feedbackId || _uuid.default.v4(),\n languageCode: this.config.languageCode\n })\n }).then(function (res) {\n return res.body.url;\n });\n },\n getSupportUrl: function getSupportUrl() {\n return this.webex.request({\n method: 'GET',\n api: 'conversation',\n resource: 'users/deskSupportUrl',\n qs: {\n languageCode: this.config.languageCode\n }\n }).then(function (res) {\n return res.body.url;\n });\n },\n /**\n * Sends logs to the backend\n *\n * @param {Object} metadata metadata about the logs\n * @param {Array} logs logs to send, if undefined, SDK's logs will be sent\n * @param {Object} options additional options\n * @param {string} options.type 'full' or 'diff', if not specified then the config.incrementalLogs value is used to determine the type,\n * this option only applies if logs parameter is undefined\n * 'diff' means that only the logs since the last log upload will be sent\n * 'full' means that all the logs from internal buffers will be sent\n * @returns {Promise}\n */\n submitLogs: function submitLogs(metadata, logs) {\n var _this = this;\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var metadataArray = this._constructFileMetadata(metadata);\n var type = options.type;\n\n // this is really testing that Ampersand is fully ready. once it's ready, these exist\n if (!logs && this.webex.logger.sdkBuffer && this.webex.logger.clientBuffer && this.webex.logger.buffer) {\n var diff = type !== undefined ? type === 'diff' : this.config.incrementalLogs;\n logs = this.webex.logger.formatLogs({\n diff: diff\n });\n }\n var filename;\n if (metadata.locusId && metadata.callStart) {\n filename = \"\".concat(metadata.locusId, \"_\").concat(metadata.callStart, \".txt\");\n } else {\n filename = \"\".concat(this.webex.sessionId, \".txt\");\n }\n var userId;\n return this.webex.credentials.getUserToken().catch(function () {\n return _this.webex.credentials.getClientToken();\n }).then( /*#__PURE__*/function () {\n var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(token) {\n var headers, initalOpts, finalOpts, uploadOptions;\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n headers = {\n authorization: token.toString()\n };\n initalOpts = {\n service: 'clientLogs',\n resource: 'logs/urls'\n };\n finalOpts = {\n service: 'clientLogs',\n resource: 'logs/meta'\n };\n uploadOptions = (0, _lodash.defaults)(initalOpts, {\n file: logs,\n shouldAttemptReauth: false,\n headers: headers,\n phases: {\n initialize: {\n body: {\n file: filename\n }\n },\n upload: {\n $uri: function $uri(session) {\n return session.tempURL;\n }\n },\n finalize: (0, _lodash.defaults)(finalOpts, {\n $body: function $body(session) {\n userId = session.userId;\n return {\n filename: session.logFilename,\n data: metadataArray,\n userId: _this.webex.internal.device.userId || session.userId\n };\n }\n })\n }\n });\n return _context.abrupt(\"return\", _this.webex.upload(uploadOptions));\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }()).then(function (body) {\n if (userId && !body.userId) {\n body.userId = userId;\n }\n return body;\n });\n },\n /**\n * Constructs an array of key-value pairs for log upload.\n * @param {*} metadata\n * @returns {array}\n */\n _constructFileMetadata: function _constructFileMetadata(metadata) {\n var metadataArray = ['locusId', 'appVersion', 'callStart', 'feedbackId', 'correlationId', 'meetingId', 'surveySessionId', 'productAreaTag', 'issueTypeTag', 'issueDescTag', 'locussessionid', 'autoupload'].map(function (key) {\n if (metadata[key]) {\n return {\n key: key,\n value: metadata[key]\n };\n }\n return null;\n }).filter(function (entry) {\n return Boolean(entry);\n });\n if (this.webex.sessionId) {\n metadataArray.push({\n key: 'trackingId',\n value: this.webex.sessionId\n });\n }\n if (this.webex.internal.support.config.appVersion) {\n metadataArray.push({\n key: 'appVersion',\n value: this.webex.internal.support.config.appVersion\n });\n }\n if (this.webex.internal.device.userId) {\n metadataArray.push({\n key: 'userId',\n value: this.webex.internal.device.userId\n });\n }\n if (this.webex.internal.device.orgId) {\n metadataArray.push({\n key: 'orgId',\n value: this.webex.internal.device.orgId\n });\n }\n return metadataArray;\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = Support;\n//# sourceMappingURL=support.js.map\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n device: {\n preDiscoveryServices: {\n atlasServiceUrl: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1',\n atlas: process.env.ATLAS_SERVICE_URL || 'https://atlas-a.wbx2.com/admin/api/v1'\n }\n },\n user: {\n batcherWait: 100,\n batcherMaxCalls: 100,\n batcherMaxWait: 1500,\n verifyDefaults: {\n reqId: 'WEBCLIENT'\n }\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _user.default;\n }\n});\nrequire(\"@webex/internal-plugin-device\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _user = _interopRequireDefault(require(\"./user\"));\nvar _config = _interopRequireDefault(require(\"./config\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n(0, _webexCore.registerInternalPlugin)('user', _user.default, {\n config: _config.default\n});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _keys = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/keys\"));\nvar _webexCore = require(\"@webex/webex-core\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @class\n */\nvar AbstractUserUUIDRequestBatcher = _webexCore.Batcher.extend({\n namespace: 'User',\n /**\n * @param {string} item\n * @returns {Promise}\n */\n prepareItem: function prepareItem(item) {\n return _promise.default.resolve({\n email: item\n });\n },\n /**\n * @param {HttpResponseObject} res\n * @returns {Promise}\n */\n handleHttpSuccess: function handleHttpSuccess(res) {\n var _this = this;\n return _promise.default.all((0, _keys.default)(res.body).map(function (email) {\n if (res.body[email] && res.body[email].id) {\n return _this.handleItemSuccess(email, res.body[email]);\n }\n return _this.handleItemFailure(email, res.body[email]);\n }));\n },\n handleItemFailure: function handleItemFailure(email, response) {\n return this.getDeferredForResponse(email).then(function (defer) {\n defer.reject(response);\n });\n },\n /**\n * @param {string} email\n * @param {Object} response\n * @returns {Promise}\n */\n handleItemSuccess: function handleItemSuccess(email, response) {\n return this.getDeferredForResponse(email).then(function (defer) {\n defer.resolve(response);\n });\n },\n /**\n * @param {string} email\n * @returns {Promise}\n */\n fingerprintRequest: function fingerprintRequest(email) {\n return _promise.default.resolve(email.email || email);\n },\n /**\n * @param {string} email\n * @returns {Promise}\n */\n fingerprintResponse: function fingerprintResponse(email) {\n return _promise.default.resolve(email);\n }\n});\n\n/**\n * @class\n */\nvar FakeUserUUIDRequestBatcher = AbstractUserUUIDRequestBatcher.extend({\n /**\n * @param {Object} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n return this.webex.request({\n method: 'POST',\n service: 'conversation',\n resource: '/users',\n body: payload\n });\n }\n});\n\n/**\n * @class\n */\nvar RealUserUUIDRequestBatcher = AbstractUserUUIDRequestBatcher.extend({\n /**\n * @param {Object} payload\n * @returns {Promise}\n */\n submitHttpRequest: function submitHttpRequest(payload) {\n return this.webex.request({\n method: 'POST',\n service: 'conversation',\n resource: '/users',\n body: payload,\n qs: {\n shouldCreateUsers: true\n }\n });\n }\n});\n\n/**\n * @class\n */\nvar UserUUIDBatcher = _webexCore.WebexPlugin.extend({\n children: {\n faker: FakeUserUUIDRequestBatcher,\n creator: RealUserUUIDRequestBatcher\n },\n /**\n * @param {Object} payload\n * @returns {Promise}\n */\n request: function request(payload) {\n return payload.create ? this.creator.request(payload.email) : this.faker.request(payload.email);\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n});\nvar _default = exports.default = UserUUIDBatcher;\n//# sourceMappingURL=user-uuid-batcher.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _weakMap = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/weak-map\"));\nvar _map = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/map\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _common = require(\"@webex/common\");\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar usersByEmail = new _weakMap.default();\nvar usersById = new _weakMap.default();\n\n/**\n * @class\n */\nvar UserUUIDStore = exports.default = /*#__PURE__*/function () {\n /**\n * @constructs {UserUUIDStore}\n */\n function UserUUIDStore() {\n (0, _classCallCheck2.default)(this, UserUUIDStore);\n usersByEmail.set(this, new _map.default());\n usersById.set(this, new _map.default());\n }\n\n /**\n * Adds a user object to the store\n * @param {Object} user\n * @param {string} user.id\n * @param {string} user.emailAddress\n * @returns {Promise}\n */\n (0, _createClass2.default)(UserUUIDStore, [{\n key: \"add\",\n value: function add(user) {\n var _this = this;\n if (!user.id) {\n return _promise.default.reject(new Error('`user.id` is required'));\n }\n if (!user.emailAddress) {\n return _promise.default.reject(new Error('`user.emailAddress` is required'));\n }\n if (!_common.patterns.uuid.test(user.id)) {\n return _promise.default.reject(new Error('`user.id` does not appear to be a uuid'));\n }\n if (!_common.patterns.email.test(user.emailAddress)) {\n return _promise.default.reject(new Error('`user.emailAddress` does not appear to be an email address'));\n }\n var p1 = this.getById(user.id).then(function (u) {\n return usersById.get(_this).set(user.id, _objectSpread(_objectSpread({}, u), user));\n }).catch(function () {\n return usersById.get(_this).set(user.id, _objectSpread({}, user));\n });\n var p2 = this.getByEmail(user.emailAddress).then(function (u) {\n return usersByEmail.get(_this).set(user.emailAddress, _objectSpread(_objectSpread({}, u), user));\n }).catch(function () {\n return usersByEmail.get(_this).set(user.emailAddress, _objectSpread({}, user));\n });\n return _promise.default.all([p1, p2]);\n }\n\n /**\n * Retrieves the specified user object from the store\n * @param {string} id\n * @returns {Promise}\n */\n }, {\n key: \"get\",\n value: function get(id) {\n if (_common.patterns.uuid.test(id)) {\n return this.getById(id);\n }\n if (_common.patterns.email.test(id)) {\n return this.getByEmail(id);\n }\n return _promise.default.reject(new Error('`id` does not appear to be a valid user identifier'));\n }\n\n /**\n * Retrieves the specified user object by id from the store\n * @param {Object} id\n * @returns {Promise}\n */\n }, {\n key: \"getById\",\n value: function getById(id) {\n var ret = usersById.get(this).get(id);\n if (ret) {\n return _promise.default.resolve(ret);\n }\n return _promise.default.reject(new Error('No user found by specified id'));\n }\n\n /**\n * Retrieves the specified user object by id from the store\n * @param {Object} email\n * @returns {Promise}\n */\n }, {\n key: \"getByEmail\",\n value: function getByEmail(email) {\n var ret = usersByEmail.get(this).get(email);\n if (ret) {\n return _promise.default.resolve(ret);\n }\n return _promise.default.reject(new Error('No user found by specified email address'));\n }\n }]);\n return UserUUIDStore;\n}();\n//# sourceMappingURL=user-uuid-store.js.map\n","\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\nvar _Object$getOwnPropertySymbols = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-symbols\");\nvar _Object$getOwnPropertyDescriptor2 = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _Object$getOwnPropertyDescriptors = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptors\");\nvar _Object$defineProperties = require(\"@babel/runtime-corejs2/core-js/object/define-properties\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _getOwnPropertyDescriptor = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _applyDecoratedDescriptor2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/applyDecoratedDescriptor\"));\nvar _lodash = require(\"lodash\");\nvar _common = require(\"@webex/common\");\nvar _webexCore = require(\"@webex/webex-core\");\nvar _userUuidBatcher = _interopRequireDefault(require(\"./user-uuid-batcher\"));\nvar _userUuidStore = _interopRequireDefault(require(\"./user-uuid-store\"));\nvar _dec, _dec2, _dec3, _dec4, _obj;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nfunction ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor2(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor2(t, r)); }); } return e; }\n/**\n * @class\n */\nvar User = _webexCore.WebexPlugin.extend((_dec = (0, _webexCore.waitForValue)('@'), _dec2 = (0, _common.oneFlight)({\n keyFactory: function keyFactory(email, options) {\n return email + String(options && options.create);\n }\n}), _dec3 = (0, _webexCore.persist)('@'), _dec4 = (0, _common.deprecated)('Use User#verify()'), (_obj = {\n namespace: 'User',\n children: {\n batcher: _userUuidBatcher.default\n },\n props: {\n /**\n * Indicates if the current user is known to have a password.\n * @instance\n * @memberof User\n * @type {boolean}\n */\n hasPassword: {\n default: false,\n type: 'boolean'\n }\n },\n session: {\n store: {\n default: function _default() {\n return new _userUuidStore.default();\n },\n type: 'any'\n }\n },\n /**\n * Activates a Webex user account and exchanges for user token.\n * @instance\n * @memberof User\n * @param {Object} options\n * @param {Object} options.confirmationCode (required -- optional if verification token is provided)\n * @param {Object} options.id (required -- optional if verification token is provided)\n * @param {Object} options.verificationToken (required -- optional if uuid and verification token provided)\n * @param {Object} options.email (required with verificationToken for Federation/global user)\n * @returns {Promise} Resolves with a userSession\n */\n activate: function activate() {\n var _this = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!(options.verificationToken || options.confirmationCode && options.id)) {\n return _promise.default.reject(new Error('either options.verificationToken is required or both options.confirmationCode and options.id are required'));\n }\n options.scope = this.webex.config.credentials.scope;\n\n // if we have options.email and options.verificationToken\n // and Federation flag is enabled, flag that we need to\n // lookup user's CI.\n var activateOptions = _objectSpread({}, options);\n delete activateOptions.email;\n return this.request({\n uri: this.webex.config.credentials.activationUrl,\n method: 'POST',\n body: activateOptions,\n auth: {\n user: this.webex.config.credentials.client_id,\n pass: this.webex.config.credentials.client_secret,\n sendImmediately: true\n }\n }).then(function (res) {\n _this.webex.credentials.set({\n supertoken: res.body.tokenData\n });\n return res.body;\n });\n },\n /**\n * Converts a user-identifying object to a uuid, perhaps by doing a network\n * lookup\n * @param {string|Object} user\n * @param {Object} options\n * @param {boolean} options.create if true, ensures the return UUID refers to\n * an existing user (rather than creating one deterministically based on email\n * address), even if that user must be created\n * @returns {Promise}\n */\n asUUID: function asUUID(user, options) {\n var _this2 = this;\n if (!user) {\n return _promise.default.reject(new Error('`user` is required'));\n }\n if ((0, _lodash.isArray)(user)) {\n return _promise.default.all(user.map(function (u) {\n return _this2.asUUID(u, options);\n }));\n }\n var id = this._extractUUID(user);\n if (!(options && options.force) && _common.patterns.uuid.test(id)) {\n return _promise.default.resolve(id);\n }\n var email = this._extractEmailAddress(user);\n if (!_common.patterns.email.test(email)) {\n return _promise.default.reject(new Error('Provided user object does not appear to identify a user'));\n }\n return this.getUUID(email, options);\n },\n /**\n * Requests a uuid from the api\n * @param {string} email\n * @param {Object} options\n * @param {boolean} options.create\n * @returns {Promise}\n */\n fetchUUID: function fetchUUID(email, options) {\n var _this3 = this;\n return this.batcher.request({\n email: email,\n create: options && options.create\n }).then(function (user) {\n return _this3.recordUUID(_objectSpread({\n emailAddress: email\n }, user)).then(function () {\n return user.id;\n });\n });\n },\n /**\n * Generates One Time Password.\n * @instance\n * @param {Object} options\n * @param {string} options.email\n * @param {string} options.id\n * @returns {Promise}\n */\n generateOTP: function generateOTP() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!(options.email || options.id)) {\n return _promise.default.reject(new Error('One of `options.email` or `options.id` is required'));\n }\n return this.request({\n uri: this.webex.config.credentials.generateOtpUrl,\n method: 'POST',\n body: options,\n auth: {\n user: this.webex.config.credentials.client_id,\n pass: this.webex.config.credentials.client_secret\n }\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Fetches details about the current user\n * @returns {Promise}\n */\n get: function get() {\n var _this4 = this;\n return this.request({\n service: 'conversation',\n resource: 'users'\n }).then(function (res) {\n return res.body;\n }).then((0, _common.tap)(function (user) {\n return _this4.recordUUID({\n id: user.id,\n // CI endpoints don't use the same user format as actors, so, email may\n // be in one of a few fields\n emailAddress: user.email || user.emailAddress\n });\n }));\n },\n getUUID: function getUUID(email, options) {\n var _this5 = this;\n return this.store.getByEmail(email).then(function (user) {\n if (options && options.create && !user.userExists) {\n return _promise.default.reject(new Error('User for specified email cannot be confirmed to exist'));\n }\n if (!user.id) {\n return _promise.default.reject(new Error('No id recorded for specified user'));\n }\n return user.id;\n }).catch(function () {\n return _this5.fetchUUID(email, options);\n });\n },\n initialize: function initialize() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (0, _apply.default)(_webexCore.WebexPlugin.prototype.initialize, this, args);\n },\n /**\n * Caches the uuid for the specified email address\n * @param {Object} user\n * @param {string} user.id\n * @param {string} user.emailAddress\n * @returns {Promise}\n */\n recordUUID: function recordUUID(user) {\n if (!user) {\n return _promise.default.reject(new Error('`user` is required'));\n }\n if (!user.id) {\n return _promise.default.reject(new Error('`user.id` is required'));\n }\n if (!_common.patterns.uuid.test(user.id)) {\n return _promise.default.reject(new Error('`user.id` must be a uuid'));\n }\n if (!user.emailAddress) {\n return _promise.default.reject(new Error('`user.emailAddress` is required'));\n }\n if (!_common.patterns.email.test(user.emailAddress)) {\n return _promise.default.reject(new Error('`user.emailAddress` must be an email address'));\n }\n return this.store.add(user);\n },\n register: function register() {\n return this.verify.apply(this, arguments);\n },\n /**\n * Updates a user with webex.\n * @param {Object} body\n * @private\n * @returns {Promise} Resolves with a response from PATCH request\n */\n _setUser: function _setUser(body) {\n var _this6 = this;\n return this.webex.credentials.getUserToken().then(function (token) {\n return _this6.request({\n uri: \"\".concat(_this6.webex.config.credentials.setPasswordUrl, \"/\").concat(_this6.webex.internal.device.userId),\n method: 'PATCH',\n headers: {\n authorization: token.toString()\n },\n body: body\n });\n });\n },\n /**\n * Updates a user's password with webex.\n * @instance\n * @memberof User\n * @param {Object} options\n * @param {string} options.password (required)\n * @param {string} options.email (required when federation enabled)\n * @returns {Promise} Resolves with complete user object containing new password\n */\n setPassword: function setPassword(options) {\n var _this7 = this;\n options = options || {};\n if (!options.password) {\n return _promise.default.reject(new Error('`options.password` is required'));\n }\n return this._setUser({\n schemas: ['urn:scim:schemas:core:1.0', 'urn:scim:schemas:extension:cisco:commonidentity:1.0'],\n password: options.password\n }).then(function (res) {\n _this7.hasPassword = true;\n return res.body;\n });\n },\n /**\n * Updates a user's name with webex.\n * @instance\n * @memberof User\n * @param {string} givenName\n * @param {string} familyName\n * @param {string} displayName\n * @returns {Promise}\n */\n updateName: function updateName() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n givenName = _ref.givenName,\n familyName = _ref.familyName,\n displayName = _ref.displayName;\n if (!(givenName || familyName || displayName)) {\n return _promise.default.reject(new Error('One of `givenName` and `familyName` or `displayName` is required'));\n }\n return this._setUser({\n schemas: ['urn:scim:schemas:core:1.0', 'urn:scim:schemas:extension:cisco:commonidentity:1.0'],\n name: {\n givenName: givenName,\n familyName: familyName\n },\n displayName: displayName\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Updates the current user's display name\n * @param {Object} options\n * @param {string} options.displayName\n * @returns {Promise}\n */\n update: function update(options) {\n options = options || {};\n if (!options.displayName) {\n return _promise.default.reject(new Error('`options.displayName` is required'));\n }\n return this.request({\n method: 'PATCH',\n service: 'conversation',\n resource: 'users/user',\n body: options\n }).then(function (res) {\n return res.body;\n });\n },\n /**\n * Validated One Time Password.\n * @instance\n * @param {Object} options\n * @param {string} options.email\n * @param {string} options.id\n * @param {string} options.oneTimePassword\n * @returns {Promise}\n */\n validateOTP: function validateOTP() {\n var _this8 = this;\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!(options.email || options.id) || !options.oneTimePassword) {\n return _promise.default.reject(new Error('One of `options.email` or `options.id` and `options.oneTimePassword` are required'));\n }\n options.scope = this.webex.config.credentials.scope;\n return this.request({\n uri: this.webex.config.credentials.validateOtpUrl,\n method: 'POST',\n body: options,\n auth: {\n user: this.webex.config.credentials.client_id,\n pass: this.webex.config.credentials.client_secret\n }\n }).then(function (res) {\n _this8.webex.credentials.set({\n supertoken: res.body.tokenData\n });\n return res.body;\n });\n },\n /**\n * Determines if the specified user needs to signup or can signin.\n * Triggers activation email if client credentials are used\n * @param {Object} options\n * @param {string} options.email (required)\n * @param {string} options.reqId required if need to check email status\n * @param {string} options.preloginId\n * @returns {Promise}\n */\n verify: function verify(options) {\n var _this9 = this;\n options = _objectSpread(_objectSpread({}, this.config.verifyDefaults), options);\n var _options = options,\n email = _options.email;\n if (!email) {\n return _promise.default.reject(new Error('`options.email` is required'));\n }\n return this.webex.internal.services.collectPreauthCatalog({\n email: email\n }).then(function () {\n return _this9.webex.credentials.getUserToken();\n }).catch(function () {\n return _this9.webex.credentials.getClientToken();\n }).then(function (token) {\n return _this9.request({\n service: 'atlas',\n resource: 'users/activations',\n method: 'POST',\n headers: {\n authorization: token.toString(),\n 'x-prelogin-userid': options.preloginId\n },\n body: options,\n shouldRefreshAccessToken: false\n });\n }).then(function (res) {\n if (res.body.hasPassword || res.body.sso) {\n _this9.hasPassword = true;\n }\n return res.body;\n });\n },\n /**\n * If the passed-in lookupCI is true, retrieve the user's\n * CI from Atlas and return the URL's via a Promise.\n * Otherwise, return current CI in config via a Promise.\n * Useful in a Promise chain to retrieve the CI based on\n * conditions like Federation enabled, and suppresses sending\n * an additional email to the user, since this is just a\n * look-up.\n * @param {string} email (required)\n * @param {boolean} lookupCI (required)\n * @returns {Promise}\n */\n getUserCI: function getUserCI(email, lookupCI) {\n if (lookupCI) {\n // call verify first to get the user's CI, but suppress sending another email\n var verifyOptions = {\n email: email,\n suppressEmail: true\n };\n return this.verify(verifyOptions).then(function (res) {\n return _promise.default.resolve(res.userEntities);\n });\n }\n return _promise.default.resolve({\n idBrokerUrl: this.webex.config.credentials.idbroker.url,\n identityUrl: this.webex.config.credentials.identity.url\n });\n },\n /**\n * Extracts the uuid from a user identifying object\n * @param {string|Object} user\n * @private\n * @returns {string}\n */\n _extractUUID: function _extractUUID(user) {\n return user.entryUUID || user.id || user;\n },\n /**\n * Extracts the email address from a user identifying object\n * @param {string|Object} user\n * @private\n * @returns {string}\n */\n _extractEmailAddress: function _extractEmailAddress(user) {\n return user.email || user.emailAddress || user.entryEmail || user;\n },\n version: \"3.7.0-web-workers-keepalive.1\"\n}, ((0, _applyDecoratedDescriptor2.default)(_obj, \"activate\", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, \"activate\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"getUUID\", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, \"getUUID\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"initialize\", [_dec3], (0, _getOwnPropertyDescriptor.default)(_obj, \"initialize\"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, \"register\", [_dec4], (0, _getOwnPropertyDescriptor.default)(_obj, \"register\"), _obj)), _obj)));\nvar _default2 = exports.default = User;\n//# sourceMappingURL=user.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VOICEA = exports.TURN_ON_CAPTION_STATUS = exports.TRANSCRIPTION_TYPE = exports.EVENT_TRIGGERS = exports.ANNOUNCE_STATUS = exports.AIBRIDGE_RELAY_TYPES = void 0;\nvar EVENT_TRIGGERS = exports.EVENT_TRIGGERS = {\n VOICEA_ANNOUNCEMENT: 'voicea:announcement',\n CAPTION_LANGUAGE_UPDATE: 'voicea:captionLanguageUpdate',\n SPOKEN_LANGUAGE_UPDATE: 'voicea:spokenLanguageUpdate',\n CAPTIONS_TURNED_ON: 'voicea:captionOn',\n TRANSCRIBING_ON: 'voicea:transcribingOn',\n TRANSCRIBING_OFF: 'voicea:transcribingOff',\n NEW_CAPTION: 'voicea:newCaption',\n EVA_COMMAND: 'voicea:wxa',\n HIGHLIGHT_CREATED: 'voicea:highlightCreated',\n NEW_MANUAL_CAPTION: 'aibridge:newManualCaption'\n};\nvar AIBRIDGE_RELAY_TYPES = exports.AIBRIDGE_RELAY_TYPES = {\n VOICEA: {\n ANNOUNCEMENT: 'voicea.annc',\n CLIENT_ANNOUNCEMENT: 'client.annc',\n TRANSLATION_REQUEST: 'voicea.transl.req',\n TRANSLATION_RESPONSE: 'voicea.transl.rsp',\n TRANSCRIPTION: 'voicea.transcription'\n },\n MANUAL: {\n TRANSCRIPTION: 'aibridge.manual_transcription'\n }\n};\nvar TRANSCRIPTION_TYPE = exports.TRANSCRIPTION_TYPE = {\n UNKNOWN: 'unknown',\n EVA_WAKE: 'eva_wake',\n EVA_THANKS: 'eva_thanks',\n EVA_CANCEL: 'eva_cancel',\n HIGHLIGHT_CREATED: 'highlight_created',\n TRANSCRIPT_INTERIM_RESULTS: 'transcript_interim_results',\n TRANSCRIPT_FINAL_RESULT: 'transcript_final_result',\n MANUAL_CAPTION_INTERIM_RESULTS: 'manual_caption_interim_results',\n MANUAL_CAPTION_FINAL_RESULT: 'manual_caption_final_result'\n};\nvar VOICEA = exports.VOICEA = 'voicea';\nvar ANNOUNCE_STATUS = exports.ANNOUNCE_STATUS = {\n IDLE: 'idle',\n JOINED: 'joined',\n JOINING: 'joining'\n};\nvar TURN_ON_CAPTION_STATUS = exports.TURN_ON_CAPTION_STATUS = {\n IDLE: 'idle',\n ENABLED: 'enabled',\n SENDING: 'sending'\n};\n//# sourceMappingURL=constants.js.map\n","\"use strict\";\n\nvar _typeof = require(\"@babel/runtime-corejs2/helpers/typeof\");\nvar _WeakMap = require(\"@babel/runtime-corejs2/core-js/weak-map\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _Object$getOwnPropertyDescriptor = require(\"@babel/runtime-corejs2/core-js/object/get-own-property-descriptor\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\n_Object$defineProperty(exports, \"EVENT_TRIGGERS\", {\n enumerable: true,\n get: function get() {\n return _constants.EVENT_TRIGGERS;\n }\n});\n_Object$defineProperty(exports, \"TURN_ON_CAPTION_STATUS\", {\n enumerable: true,\n get: function get() {\n return _constants.TURN_ON_CAPTION_STATUS;\n }\n});\n_Object$defineProperty(exports, \"default\", {\n enumerable: true,\n get: function get() {\n return _voicea.default;\n }\n});\nvar WebexCore = _interopRequireWildcard(require(\"@webex/webex-core\"));\nvar _voicea = _interopRequireDefault(require(\"./voicea\"));\nvar _constants = require(\"./constants\");\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nWebexCore.registerInternalPlugin('voicea', _voicea.default, {});\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.millisToMinutesAndSeconds = void 0;\n// eslint-disable-next-line import/prefer-default-export\nvar millisToMinutesAndSeconds = exports.millisToMinutesAndSeconds = function millisToMinutesAndSeconds(millis) {\n var minutes = Math.floor(millis / 60000);\n var seconds = (millis % 60000 / 1000).toFixed(0);\n return \"\".concat(minutes, \":\").concat(+seconds < 10 ? '0' : '').concat(seconds);\n};\n//# sourceMappingURL=utils.js.map\n","\"use strict\";\n\nvar _Reflect$construct = require(\"@babel/runtime-corejs2/core-js/reflect/construct\");\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\nvar _interopRequireDefault = require(\"@babel/runtime-corejs2/helpers/interopRequireDefault\");\n_Object$defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.VoiceaChannel = void 0;\nvar _regenerator = _interopRequireDefault(require(\"@babel/runtime-corejs2/regenerator\"));\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/classCallCheck\"));\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/createClass\"));\nvar _assertThisInitialized2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/assertThisInitialized\"));\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/inherits\"));\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/possibleConstructorReturn\"));\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/getPrototypeOf\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _uuid = _interopRequireDefault(require(\"uuid\"));\nvar _webexCore = require(\"@webex/webex-core\");\nvar _constants = require(\"./constants\");\nvar _utils = require(\"./utils\");\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } // eslint-disable-next-line no-unused-vars\n/**\n * @description VoiceaChannel to hold single instance of LLM\n * @export\n * @class VoiceaChannel\n */\nvar VoiceaChannel = exports.VoiceaChannel = /*#__PURE__*/function (_WebexPlugin) {\n (0, _inherits2.default)(VoiceaChannel, _WebexPlugin);\n var _super = _createSuper(VoiceaChannel);\n /**\n * Initializes Voicea plugin\n * @param {any} args\n */\n function VoiceaChannel() {\n var _this;\n (0, _classCallCheck2.default)(this, VoiceaChannel);\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _super.call.apply(_super, [this].concat(args));\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"namespace\", _constants.VOICEA);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"seqNum\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"areCaptionsEnabled\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"hasSubscribedToEvents\", false);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"vmcDeviceId\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"announceStatus\", void 0);\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"captionStatus\", void 0);\n /**\n * @param {Object} e\n * @returns {undefined}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"eventProcessor\", function (e) {\n _this.seqNum = e.sequenceNumber + 1;\n switch (e.data.relayType) {\n case _constants.AIBRIDGE_RELAY_TYPES.VOICEA.ANNOUNCEMENT:\n _this.vmcDeviceId = e.headers.from;\n _this.announceStatus = _constants.ANNOUNCE_STATUS.JOINED;\n _this.processAnnouncementMessage(e.data.voiceaPayload);\n break;\n case _constants.AIBRIDGE_RELAY_TYPES.VOICEA.TRANSLATION_RESPONSE:\n _this.processCaptionLanguageResponse(e.data.voiceaPayload);\n break;\n case _constants.AIBRIDGE_RELAY_TYPES.VOICEA.TRANSCRIPTION:\n _this.processTranscription(e.data.voiceaPayload);\n break;\n case _constants.AIBRIDGE_RELAY_TYPES.MANUAL.TRANSCRIPTION:\n _this.processManualTranscription(e.data.transcriptPayload);\n break;\n default:\n break;\n }\n });\n /**\n * Process manual Transcript and send alert\n * @param {TranscriptionResponse} transcriptPayload\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"processManualTranscription\", function (transcriptPayload) {\n switch (transcriptPayload.type) {\n case _constants.TRANSCRIPTION_TYPE.MANUAL_CAPTION_FINAL_RESULT:\n case _constants.TRANSCRIPTION_TYPE.MANUAL_CAPTION_INTERIM_RESULTS:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.NEW_MANUAL_CAPTION, {\n isFinal: transcriptPayload.type === _constants.TRANSCRIPTION_TYPE.MANUAL_CAPTION_FINAL_RESULT,\n transcriptId: transcriptPayload.id,\n transcripts: transcriptPayload.transcripts\n });\n break;\n default:\n break;\n }\n });\n /**\n * Process Transcript and send alert\n * @param {TranscriptionResponse} voiceaPayload\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"processTranscription\", function (voiceaPayload) {\n switch (voiceaPayload.type) {\n case _constants.TRANSCRIPTION_TYPE.TRANSCRIPT_INTERIM_RESULTS:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.NEW_CAPTION, {\n isFinal: false,\n transcriptId: voiceaPayload.transcript_id,\n transcripts: voiceaPayload.transcripts\n });\n break;\n case _constants.TRANSCRIPTION_TYPE.TRANSCRIPT_FINAL_RESULT:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.NEW_CAPTION, {\n isFinal: true,\n transcriptId: voiceaPayload.transcript_id,\n transcripts: voiceaPayload.transcripts.map(function (transcript) {\n transcript.timestamp = (0, _utils.millisToMinutesAndSeconds)(transcript.end_millis);\n return transcript;\n })\n });\n break;\n case _constants.TRANSCRIPTION_TYPE.HIGHLIGHT_CREATED:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.HIGHLIGHT_CREATED, {\n csis: voiceaPayload.highlight.csis,\n highlightId: voiceaPayload.highlight.highlight_id,\n text: voiceaPayload.highlight.transcript,\n highlightLabel: voiceaPayload.highlight.highlight_label,\n highlightSource: voiceaPayload.highlight.highlight_source,\n timestamp: (0, _utils.millisToMinutesAndSeconds)(voiceaPayload.highlight.end_millis)\n });\n break;\n case _constants.TRANSCRIPTION_TYPE.EVA_THANKS:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.EVA_COMMAND, {\n isListening: false,\n text: voiceaPayload.command_response\n });\n break;\n case _constants.TRANSCRIPTION_TYPE.EVA_WAKE:\n case _constants.TRANSCRIPTION_TYPE.EVA_CANCEL:\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.EVA_COMMAND, {\n isListening: voiceaPayload.type === _constants.TRANSCRIPTION_TYPE.EVA_WAKE\n });\n break;\n default:\n break;\n }\n });\n /**\n * Processes Caption Language Response\n * @param {CaptionLanguageResponse} voiceaPayload\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"processCaptionLanguageResponse\", function (voiceaPayload) {\n if (voiceaPayload.statusCode === 200) {\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, {\n statusCode: 200\n });\n } else {\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.CAPTION_LANGUAGE_UPDATE, {\n statusCode: voiceaPayload.errorCode,\n errorMessage: voiceaPayload.message\n });\n }\n });\n /**\n * processes voicea announcement response and triggers event\n * @param {Object} voiceaPayload\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"processAnnouncementMessage\", function (voiceaPayload) {\n var _voiceaPayload$transl, _voiceaPayload$transl2, _voiceaPayload$transl3, _voiceaPayload$transl4, _voiceaPayload$ASR$sp, _voiceaPayload$ASR;\n var voiceaLanguageOptions = {\n captionLanguages: (_voiceaPayload$transl = voiceaPayload === null || voiceaPayload === void 0 ? void 0 : (_voiceaPayload$transl2 = voiceaPayload.translation) === null || _voiceaPayload$transl2 === void 0 ? void 0 : _voiceaPayload$transl2.allowed_languages) !== null && _voiceaPayload$transl !== void 0 ? _voiceaPayload$transl : [],\n maxLanguages: (_voiceaPayload$transl3 = voiceaPayload === null || voiceaPayload === void 0 ? void 0 : (_voiceaPayload$transl4 = voiceaPayload.translation) === null || _voiceaPayload$transl4 === void 0 ? void 0 : _voiceaPayload$transl4.max_languages) !== null && _voiceaPayload$transl3 !== void 0 ? _voiceaPayload$transl3 : 0,\n spokenLanguages: (_voiceaPayload$ASR$sp = voiceaPayload === null || voiceaPayload === void 0 ? void 0 : (_voiceaPayload$ASR = voiceaPayload.ASR) === null || _voiceaPayload$ASR === void 0 ? void 0 : _voiceaPayload$ASR.spoken_languages) !== null && _voiceaPayload$ASR$sp !== void 0 ? _voiceaPayload$ASR$sp : []\n };\n\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.VOICEA_ANNOUNCEMENT, voiceaLanguageOptions);\n });\n /**\n * Sends Announcement to add voicea to the meeting\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"sendAnnouncement\", function () {\n _this.announceStatus = _constants.ANNOUNCE_STATUS.JOINING;\n _this.listenToEvents();\n // @ts-ignore\n _this.webex.internal.llm.socket.send({\n id: \"\".concat(_this.seqNum),\n type: 'publishRequest',\n recipients: {\n // @ts-ignore\n route: _this.webex.internal.llm.getBinding()\n },\n headers: {},\n data: {\n clientPayload: {\n version: 'v2'\n },\n eventType: 'relay.event',\n relayType: _constants.AIBRIDGE_RELAY_TYPES.VOICEA.CLIENT_ANNOUNCEMENT\n },\n trackingId: \"\".concat(_webexCore.config.trackingIdPrefix, \"_\").concat(_uuid.default.v4().toString())\n });\n _this.seqNum += 1;\n });\n /**\n * Set Spoken Language for the meeting\n * @param {string} languageCode\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"setSpokenLanguage\", function (languageCode) {\n return (\n // @ts-ignore\n _this.request({\n method: 'PUT',\n // @ts-ignore\n url: \"\".concat(_this.webex.internal.llm.getLocusUrl(), \"/controls/\"),\n body: {\n transcribe: {\n spokenLanguage: languageCode\n }\n }\n }).then(function () {\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.SPOKEN_LANGUAGE_UPDATE, {\n languageCode: languageCode\n });\n })\n );\n });\n /**\n * Request Language translation\n * @param {string} languageCode\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"requestLanguage\", function (languageCode) {\n // @ts-ignore\n if (!_this.webex.internal.llm.isConnected()) return;\n // @ts-ignore\n _this.webex.internal.llm.socket.send({\n id: \"\".concat(_this.seqNum),\n type: 'publishRequest',\n recipients: {\n // @ts-ignore\n route: _this.webex.internal.llm.getBinding()\n },\n headers: {\n to: _this.vmcDeviceId\n },\n data: {\n clientPayload: {\n translationLanguage: languageCode,\n id: _uuid.default.v4()\n },\n eventType: 'relay.event',\n relayType: _constants.AIBRIDGE_RELAY_TYPES.VOICEA.TRANSLATION_REQUEST\n },\n trackingId: \"\".concat(_webexCore.config.trackingIdPrefix, \"_\").concat(_uuid.default.v4().toString())\n });\n _this.seqNum += 1;\n });\n /**\n * request turn on Captions\n * @param {string} [languageCode] - Optional Parameter for spoken language code. Defaults to English\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"requestTurnOnCaptions\", function (languageCode) {\n _this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.SENDING;\n\n // only set the spoken language if it is provided\n var body = {\n transcribe: {\n caption: true\n },\n languageCode: languageCode\n };\n\n // @ts-ignore\n // eslint-disable-next-line newline-before-return\n return _this.request({\n method: 'PUT',\n // @ts-ignore\n url: \"\".concat(_this.webex.internal.llm.getLocusUrl(), \"/controls/\"),\n body: body\n }).then(function () {\n // @ts-ignore\n _this.trigger(_constants.EVENT_TRIGGERS.CAPTIONS_TURNED_ON);\n _this.areCaptionsEnabled = true;\n _this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.ENABLED;\n _this.announce();\n }).catch(function () {\n _this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;\n throw new Error('turn on captions fail');\n });\n });\n /**\n * is announce processing\n * @returns {boolean}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"isAnnounceProcessing\", function () {\n return [_constants.ANNOUNCE_STATUS.JOINING, _constants.ANNOUNCE_STATUS.JOINED].includes(_this.announceStatus);\n });\n /**\n * announce to voicea data chanel\n * @returns {void}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"announce\", function () {\n if (_this.isAnnounceProcessing()) return;\n // @ts-ignore\n if (!_this.webex.internal.llm.isConnected()) {\n throw new Error('voicea can not announce before llm connected');\n }\n _this.sendAnnouncement();\n });\n /**\n * is turn on caption processing\n * @returns {boolean}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"isCaptionProcessing\", function () {\n return [_constants.TURN_ON_CAPTION_STATUS.SENDING, _constants.TURN_ON_CAPTION_STATUS.ENABLED].includes(_this.captionStatus);\n });\n /**\n * Turn on Captions\n * @param {string} [spokenLanguage] - Optional Spoken language code\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"turnOnCaptions\", /*#__PURE__*/function () {\n var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(spokenLanguage) {\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!_this.isCaptionProcessing()) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", undefined);\n case 2:\n if (_this.webex.internal.llm.isConnected()) {\n _context.next = 4;\n break;\n }\n throw new Error('can not turn on captions before llm connected');\n case 4:\n return _context.abrupt(\"return\", _this.requestTurnOnCaptions(spokenLanguage));\n case 5:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n /**\n * Toggle transcribing for highlights\n * @param {bool} activate if true transcribing is turned on\n * @param {string} spokenLanguage language code for spoken language\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"toggleTranscribing\", function (activate, spokenLanguage) {\n // @ts-ignore\n return _this.request({\n method: 'PUT',\n // @ts-ignore\n url: \"\".concat(_this.webex.internal.llm.getLocusUrl(), \"/controls/\"),\n body: {\n transcribe: {\n transcribing: activate\n },\n spokenLanguage: spokenLanguage\n }\n }).then(function () {\n if (activate && !_this.areCaptionsEnabled) {\n return _this.turnOnCaptions(spokenLanguage);\n }\n return undefined;\n });\n });\n /**\n * Toggle turn on manual caption\n * @param {bool} enable if true manual caption is turned on\n * @returns {Promise}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"toggleManualCaption\", function (enable) {\n // @ts-ignore\n return _this.request({\n method: 'PUT',\n // @ts-ignore\n url: \"\".concat(_this.webex.internal.llm.getLocusUrl(), \"/controls/\"),\n body: {\n manualCaption: {\n enable: enable\n }\n }\n }).then(function () {\n return undefined;\n });\n });\n /**\n * get caption status\n * @returns {string}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"getCaptionStatus\", function () {\n return _this.captionStatus;\n });\n /**\n * get announce status\n * @returns {string}\n */\n (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), \"getAnnounceStatus\", function () {\n return _this.announceStatus;\n });\n _this.seqNum = 1;\n _this.areCaptionsEnabled = false;\n _this.vmcDeviceId = undefined;\n _this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;\n _this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;\n return _this;\n }\n (0, _createClass2.default)(VoiceaChannel, [{\n key: \"listenToEvents\",\n value:\n /**\n * Listen to websocket messages\n * @returns {undefined}\n */\n function listenToEvents() {\n if (!this.hasSubscribedToEvents) {\n // @ts-ignore\n this.webex.internal.llm.on('event:relay.event', this.eventProcessor);\n this.hasSubscribedToEvents = true;\n }\n }\n\n /**\n * Listen to websocket messages\n * @returns {void}\n */\n }, {\n key: \"deregisterEvents\",\n value: function deregisterEvents() {\n this.areCaptionsEnabled = false;\n this.vmcDeviceId = undefined;\n // @ts-ignore\n this.webex.internal.llm.off('event:relay.event', this.eventProcessor);\n this.hasSubscribedToEvents = false;\n this.announceStatus = _constants.ANNOUNCE_STATUS.IDLE;\n this.captionStatus = _constants.TURN_ON_CAPTION_STATUS.IDLE;\n }\n }]);\n return VoiceaChannel;\n}(_webexCore.WebexPlugin);\nvar _default = exports.default = VoiceaChannel;\n//# sourceMappingURL=voicea.js.map\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n"],"names":[],"sourceRoot":""}