{"version":3,"file":"app/vendors-node_modules_webex_calling_dist_module_index_js-node_modules_webex_common-timers_dist-c728f8.98a72277.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAA2C;AACuD;AACtE;AACsE;AAC8R;AAC7R;AAC3B;AAC9B;AACnC,0BAA0B,kDAAQ;AACzC;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA;AACA;AACA;AACA,QAAQ,+CAAG,yBAAyB,yDAAiB;AACrD;AACA,oCAAoC,sDAAc,UAAU,6CAAK,SAAS,+CAAI,mBAAmB,kDAAO;AACxG;AACA;AACA;AACA,0CAA0C,kDAAO,8BAA8B,kDAAO;AACtF,wCAAwC,+CAAI,0BAA0B,+CAAI;AAC1E,QAAQ,+CAAG,sBAAsB,cAAc;AAC/C,QAAQ,+CAAG,kCAAkC,cAAc;AAC3D,QAAQ,+CAAG,kCAAkC,UAAU;AACvD,QAAQ,+CAAG,oCAAoC,YAAY;AAC3D,uBAAuB,cAAc,GAAG,+CAAO,CAAC,GAAG,4DAAa,CAAC,EAAE,iDAAS,CAAC,GAAG,cAAc,SAAS,MAAM,oCAAoC,UAAU;AAC3J;AACA;AACA,wBAAwB,IAAI;AAC5B,wBAAwB,uDAAY;AACpC,yBAAyB,2DAAgB;AACzC,aAAa;AACb;AACA,gCAAgC,kDAAO;AACvC,kCAAkC,+CAAI;AACtC,sCAAsC,4DAAa;AACnD;AACA;AACA,uCAAuC,+CAAI;AAC3C,sCAAsC,4DAAa;AACnD;AACA;AACA;AACA,mCAAmC,gEAAiB;AACpD,mCAAmC,0DAAe;AAClD,sCAAsC,4DAAa,uBAAuB,4DAAa;AACvF,wDAAwD,4DAAa;AACrE;AACA;AACA;AACA;AACA,8CAA8C,4DAAa;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qCAAqC;AACrC;AACA,6BAA6B;AA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AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,yDAAyD,cAAc,GAAG,+CAAO,CAAC,GAAG,4DAAa,CAAC,GAAG,4EAAoC,CAAC;AAC3I;AACA,wBAAwB,uDAAY;AACpC;AACA,qBAAqB,oDAAY,GAAG,wDAAgB;AACpD;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,mCAAmC,gBAAgB;AACnD;AACA;AACA,YAAY,+CAAG;AACf;AACA;AACA;AACA,yCAAyC,+EAAuC;AAChF,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAiB;AACvC;AACA;AACA;AACA;AACA,sBAAsB,4DAAiB;AACvC;AACA;AACA;AACA;AACA,sBAAsB,4DAAiB;AACvC;AACA;AACA;AACA,2CAA2C,4DAAiB;AAC5D,2CAA2C,4DAAiB;AAC5D,2CAA2C,4DAAiB;AAC5D,2CAA2C,4DAAiB;AAC5D;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACxPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACrB6C;AACT;AACf;AACsB;AACgB;AACjB;AACW;AACrD;AACP;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA,QAAQ,+CAAG,yBAAyB,0DAAkB;AACtD;AACA;AACA;AACA;AACA,8BAA8B,gEAAiB;AAC/C,QAAQ,+CAAG,oCAAoC,qBAAqB;AACpE,kBAAkB,0DAAkB;AACpC;AACA,SAAS;AACT;AACA,iBAAiB,0DAAe;AAChC,iBAAiB,0DAAe;AAChC,4CAA4C,2EAAsB;AAClE;AACA,iBAAiB,0DAAe;AAChC,4CAA4C,qEAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;AChEqB;AACe;AACe;AAC+G;AAC1H;AAC0B;AAClE;AACP;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA;AACA,QAAQ,+CAAG,yBAAyB,iEAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,sEAAuB,GAAG,iBAAiB,IAAI,MAAM,iEAAkB,mDAAmD;AACnJ,eAAe,OAAO;AACtB;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA,cAAc,wEAAyB;AACvC,cAAc,uEAAwB;AACtC;AACA;AACA;AACA,4BAA4B,aAAa,GAAG,uDAAe,CAAC,GAAG,YAAY,GAAG,mDAAW,eAAe,GAAG,oDAAY,CAAC,GAAG,WAAW;AACtI,4BAA4B,uDAAY;AACxC,iBAAiB;AACjB,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA,gDAAgD,0DAAW;AAC3D,iCAAiC,8DAAe;AAChD;AACA;AACA;AACA,+EAA+E,wDAAS;AACxF,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,6BAA6B,8DAAe;AAC5C;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB,8DAAe;AACxC;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACrG2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A;AACA;AACA;AACA;AACA,kBAAkB,0DAAkB;AACpC;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB,GAAG,uDAAe,CAAC,GAAG,cAAc,GAAG,mDAAW,CAAC,GAAG,oDAAY,CAAC,GAAG,WAAW;AAC5H,wBAAwB,uDAAY;AACpC;AACA,aAAa;AACb;AACA,wCAAwC,0DAAW;AACnD;AACA;AACA,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,2EAA4B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;AC9RO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACR6C;AAChB;AACF;AAC8E;AACvE;AACE;AACD;AACmD;AACW;AAC5E;AAC2B;AAC+O;AAC5Q;AAC+C;AAC3B;AACvC,4BAA4B,kDAAQ;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA,yBAAyB,8CAAK;AAC9B;AACA;AACA;AACA;AACA,gBAAgB,WAAW,2DAAgB;AAC3C,uFAAuF,iDAAM;AAC7F,QAAQ,+CAAG,qBAAqB,4DAAmB;AACnD,QAAQ,kEAAmB;AAC3B,2BAA2B,oEAAc;AACzC,6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oEAAyB;AACnD;AACA,SAAS;AACT;AACA;AACA,yBAAyB,8CAAI;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8BAA8B;AAC9B;AACA,qBAAqB,qBAAqB,iDAAI;AAC9C;AACA,eAAe,yDAAU;AACzB;AACA;AACO;AACP;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC1RwC;AAC4B;AACnB;AACQ;AAClD;AACP;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA;AACA,YAAY,qDAAY;AACxB;AACA;AACA;AACA;AACA;AACA,qCAAqC,+DAAsB;AAC3D;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,YAAY,qDAAG,+BAA+B,WAAW;AACzD,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb,2CAA2C,WAAW;AACtD;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,yDAAiB;AACtD;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA,gBAAgB,qDAAG;AACnB,0BAA0B,sDAAc;AACxC;AACA,iBAAiB;AACjB;AACA;AACA;AACA,gBAAgB,qDAAG;AACnB,0BAA0B,sDAAc;AACxC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,qDAAG;AACf,sBAAsB,sDAAc;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpJ6G;AAClE;AAChB;AACqB;AACK;AACC;AAC8E;AACvD;AACnB;AAC2Y;AAC9Z;AACD;AACoF;AACI;AACtG;AACa;AACqC;AAChC;AACU;AACpD,mBAAmB,kDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA;AACA;AACA;AACA,YAAY,qDAAY;AACxB;AACA;AACA,6BAA6B,2DAAgB;AAC7C,yBAAyB,6DAAqB,CAAC,GAAG,iDAAI,GAAG;AACzD,6BAA6B,iDAAI;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAG,6BAA6B,eAAe;AACvD,kBAAkB,iDAAS;AAC3B;AACA,SAAS;AACT,mBAAmB,0DAAkB;AACrC,wBAAwB,0DAAc;AACtC;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAe;AACrC,SAAS;AACT;AACA,kCAAkC,MAAM,mDAAc,gBAAgB,oDAAe;AACrF,8BAA8B,sEAAU,eAAe,qBAAqB;AAC5E,4BAA4B,sDAAa;AACzC;AACA,2BAA2B;AAC3B,0BAA0B;AAC1B,aAAa;AACb;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,6BAA6B,sDAAa;AAC1C;AACA,2BAA2B;AAC3B,0BAA0B;AAC1B,aAAa;AACb;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;A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kB,iDAAS;AAC3B;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,UAAU;AAC9C;AACA,kBAAkB,iDAAS;AAC3B;AACA;AACA;AACA;AACA,YAAY,gDAAG;AACf,YAAY,gDAAG,mBAAmB,SAAS;AAC3C;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD,wFAAwF,YAAY;AACpG,YAAY,gDAAG;AACf;AACA;AACA;AACA,oCAAoC,2EAAmB;AACvD;AACA;AACA,kCAAkC,8DAAsB;AACxD;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,6BAA6B,mBAAmB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAG,0BAA0B,aAAa,qBAAqB,mBAAmB;AAC1F,kBAAkB,iDAAS;AAC3B;AACA,SAAS;AACT;AACA;AACA;AACA,yCAAyC,mDAAc;AACvD,0CAA0C,oDAAe;AACzD;AACA,sDAAsD,wDAAa;AACnE,yCAAyC,mDAAc;AACvD,0CAA0C,oDAAe;AACzD;AACA;AACA,yCAAyC,mDAAc;AACvD,0CAA0C,oDAAe;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAG,6DAA6D,wBAAwB;AACpG,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6BAA6B;AACxE;AACA;AACA,YAAY,gDAAG,wDAAwD,kCAAkC,KAAK,MAAM,iDAAS,oBAAoB;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAG,2DAA2D,wBAAwB;AAClG,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA,sBAAsB,2DAAe;AACrC;AACA;AACA;AACA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AACA;AACA,YAAY,gDAAG,yBAAyB,KAAK;AAC7C,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA,YAAY,gDAAG,uCAAuC,UAAU;AAChE,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,YAAY,gDAAG,2DAA2D,wBAAwB;AAClG,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA,yBAAyB,8CAAS;AAClC;AACA;AACA;AACA;AACA,gBAAgB,gDAAG,6CAA6C,wBAAwB;AACxF,0BAA0B,iDAAS;AACnC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAG,uCAAuC,wBAAwB;AAC9E,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAG,kEAAkE,wBAAwB;AACzG,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,YAAY,gDAAG,wCAAwC,wBAAwB,WAAW,UAAU;AACpG,sBAAsB,iDAAS;AAC/B;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAG;AACX,kBAAkB,iDAAS;AAC3B;AACA,SAAS;AACT;AACA,kBAAkB,2DAAe;AACjC;AACA,QAAQ,gDAAG,sCAAsC,oBAAoB;AACrE,kBAAkB,iDAAS;AAC3B;AACA,SAAS;AACT;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;ACz3D0C;AAC+B;AACnC;AACC;AACK;AACI;AACnB;AACL;AAC/B;AACO,0BAA0B,kDAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA;AACA,YAAY,qDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG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,sCAAsC,yDAAiB;AACvD;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,oBAAoB,+CAAG,uBAAuB,eAAe;AAC7D,8BAA8B,yDAAiB;AAC/C;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB,mDAAe;AAChC,gBAAgB,+CAAG,wCAAwC,cAAc;AACzE,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA,+CAA+C,qDAAqD;AACpG;AACA;AACA,iBAAiB,mDAAe;AAChC,gBAAgB,+CAAG,2CAA2C,cAAc;AAC5E,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA;AACA,mDAAmD,gCAAgC;AACnF;AACA;AACA;AACA;AACA,gBAAgB,+CAAG,wCAAwC,2BAA2B;AACtF,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACrRuB;AACO;;;;;;;;;;;;;;;;;;;;;;;;ACDvB;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AAClC;AACP;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA,CAAC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzDxB;AACA;AACA;AACA,8BAA8B,UAAU,GAAG,mBAAmB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5H2B;AACwD;AACpD;AACsB;AAC7B;AACsB;AACR;AACc;AACR;AACL;AACO;AACG;AACR;AACjC,mBAAmB,kDAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,iDAAI;AAC1B;AACA;AACA;AACA;AACA;AACA,6BAA6B,qDAAY;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW,2DAAgB;AAC3C,QAAQ,4DAAmB;AAC3B,4BAA4B,iEAAkB;AAC9C,QAAQ,+CAAG,qBAAqB,iDAAS;AACzC,2BAA2B,qEAAc;AACzC;AACA;AACA;AACA;AACA,sBAAsB,+CAAW;AACjC;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,6DAAkB;AACtD;AACA;AACA,gBAAgB,uIAAuI;AACvJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,+CAAW;AAC5B;AACA;AACA;AACA;AACA;AACA,iBAAiB,+CAAW;AAC5B,iBAAiB,+CAAW;AAC5B,iBAAiB,+CAAW;AAC5B;AACA;AACA,iBAAiB,+CAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+CAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,yDAAiB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,gBAAgB;AACpD;AACA,mDAAmD,wDAAa;AAChE,gBAAgB,+CAAG,kCAAkC,iBAAiB,KAAK;AAC3E;AACA;AACA,gBAAgB,+CAAG,yCAAyC;AAC5D,gCAAgC,gEAAS,4EAA4E,EAAE,sDAAU,aAAa,6DAAkB;AAChK,0BAA0B,+CAAW;AACrC;AACA;AACA;AACA,2CAA2C,2DAAgB;AAC3D,+CAA+C,wDAAa;AAC5D,YAAY,+CAAG,wCAAwC,iBAAiB,KAAK;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,iDAAS;AAC3B;AACA;AACA,QAAQ,+CAAG;AACX,4BAA4B,0DAAe;AAC3C,sBAAsB,+CAAW;AACjC,SAAS;AACT;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AChKO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;;;;;;;;;;;;;;;;;;ACTR;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAO;AACc;AAC0B;AACE;AAC3B;AACL;AACb;AACe;AACgF;AACyY;AAC3d;AACrC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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BAAgB,uEAA+B;AAC/C,YAAY,8DAAsB;AAClC,yCAAyC,uEAA+B,GAAG,2DAAmB;AAC9F,gBAAgB,2DAAmB;AACnC,gBAAgB,2DAAmB;AACnC;AACA;AACA;AACA,kBAAkB,yDAAiB;AACnC;AACA;AACA;AACA;AACA,cAAc,8EAAsC;AACpD,cAAc,uEAA+B;AAC7C;AACA;AACA;AACA;AACA;AACA,uBAAuB,uEAA+B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,aAAa,2DAAmB;AAC7C,YAAY,+CAAG,wCAAwC,UAAU,gCAAgC,QAAQ;AACzG;AACA;AACA,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yDAAgB;AAC5C,iDAAiD,oDAAW;AAC5D,6BAA6B;AAC7B;AACA,qBAAqB;AACrB,iBAAiB,aAAa,2DAAmB;AACjD,gBAAgB,+CAAG,+CAA+C,UAAU;AAC5E;AACA;AACA;AACA,YAAY,yDAAgB;AAC5B,iCAAiC,oDAAW;AAC5C,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,8DAAsB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,2DAAmB;AACnH,QAAQ,+CAAG,iCAAiC,mBAAmB;AAC/D,kBAAkB,yDAAiB;AACnC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAG;AACvB,8BAA8B,yDAAiB;AAC/C;AACA,qBAAqB;AACrB;AACA,4EAA4E,qDAAa;AACzF;AACA,gFAAgF,qDAAa;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+CAAG;AACvB,8BAA8B,yDAAiB;AAC/C;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,kBAAkB,qEAA6B;AAC/C;AACA;AACA,kBAAkB,qEAA6B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAAkB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iCAAiC,MAAM,yDAAiB;AACxD;AACA,gBAAgB,+CAAG;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+CAAG;AAC3B;AACA;AACA;AACA,iCAAiC,oDAAW;AAC5C;AACA;AACA,iCAAiC,oDAAW;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG,SAAS,OAAO,uCAAuC,qBAAqB;AAC3F,sBAAsB,yDAAiB;AACvC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,0CAA0C,6DAAkB;AAC5D,iCAAiC,oDAAW;AAC5C,gBAAgB,+CAAG,SAAS,OAAO,6BAA6B,IAAI;AACpE,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA;AACA,0CAA0C,6DAAkB;AAC5D,iCAAiC,oDAAW;AAC5C;AACA;AACA;AACA,4DAA4D,wDAAY,eAAe,sDAAU,WAAW,uDAAW;AACvH;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iEAAwB;AACtD;AACA,yCAAyC,oDAAW;AACpD;AACA;AACA,yCAAyC,oDAAW;AACpD;AACA,gEAAgE,wDAAY,qBAAqB,sDAAU,WAAW,uDAAW;AACjI,iBAAiB,IAAI,wDAAwD,yDAAiB,EAAE;AAChG,gDAAgD,6DAAkB;AAClE,oBAAoB,+CAAG,UAAU,OAAO,qDAAqD,qBAAqB;AAClH,8BAA8B,yDAAiB;AAC/C;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mCAAmC,6DAAkB;AACrD;AACA;AACA;AACA;AACA,kCAAkC,qDAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,0KAAiC;AACzF;AACA,8BAA8B,4DAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,kCAAkC,yDAAiB;AACnD;AACA;AACA,gDAAgD,4DAAiB;AACjE,4BAA4B,+CAAG,iCAAiC,sBAAsB;AACtF,6CAA6C,oDAAW;AACxD;AACA,gDAAgD,4DAAiB;AACjE;AACA,4BAA4B,+CAAG,2BAA2B,gCAAgC,mBAAmB,kBAAkB;AAC/H,gDAAgD,iEAAwB;AACxE;AACA,qDAAqD,oDAAW;AAChE;AACA,4EAA4E,wDAAY,eAAe,sDAAU,oBAAoB,uDAAW;AAChJ,6BAA6B,IAAI,6CAA6C,yDAAiB,EAAE;AACjG;AACA;AACA,+CAA+C,6DAAkB;AACjE;AACA;AACA,iDAAiD,oDAAW;AAC5D;AACA;AACA;AACA;AACA;AACA,iDAAiD,oDAAW;AAC5D;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,yCAAyC,MAAM,4DAAiB,kBAAkB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG,qCAAqC;AACpD;AACA;AACA,uBAAuB,6DAAkB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kEAA0B;AAC7D,qCAAqC,qEAA6B;AAClE,qCAAqC,qEAA6B;AAClE;AACA,uCAAuC,iEAAyB,CAAC,GAAG,gCAAgC;AACpG;AACA;AACA,sCAAsC,6DAAkB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,yDAAiB;AAC3C;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;AC5gB6H;AACrF;AACJ;AACf;AACgJ;AAC1H;AACmB;AAC9D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG,yBAAyB,qDAAa;AACjD;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC,mCAAmC;AACnC,iDAAiD,uDAAe;AAChE;AACA,qBAAqB,uDAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,OAAO;AAC/E;AACA;AACA;AACA,qBAAqB,uDAAe;AACpC,qBAAqB,uDAAe;AACpC,qBAAqB,uDAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uDAAe;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC,mCAAmC;AACnC,iDAAiD,uDAAe;AAChE;AACA,qBAAqB,uDAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE,OAAO;AAC/E;AACA;AACA;AACA,qBAAqB,uDAAe;AACpC,qBAAqB,uDAAe;AACpC,qBAAqB,uDAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,uDAAe;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0CAA0C,OAAO;AACjD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kBAAkB,qDAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,4CAA4C,0BAA0B;AACtE;AACA,aAAa;AACb,4BAA4B,gCAAgC;AAC5D;AACA,wBAAwB,4CAA4C;AACpE;AACA,oCAAoC,sEAAuB;AAC3D,mDAAmD,sEAAuB;AAC1E;AACA;AACA;AACA,gDAAgD,mEAAoB;AACpE,mDAAmD,mEAAoB;AACvE;AACA,wBAAwB,kEAAkE;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0DAA0D,GAAG,sDAAc,CAAC,GAAG,6CAAK,CAAC,GAAG,sDAAc,CAAC;AAC/H,wBAAwB,uDAAY;AACpC,aAAa;AACb;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA,oBAAoB,mBAAmB;AACvC,kBAAkB,OAAO;AACzB,4CAA4C,+CAAW;AACvD;AACA;AACA;AACA,iDAAiD,+CAAW;AAC5D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gCAAgC,mBAAmB;AACnD;AACA;AACA,0EAA0E,sDAAc,EAAE,GAAG,KAAK,SAAS,0CAAE;AAC7G,6CAA6C,wDAAS;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+CAAG,wCAAwC,EAAE,GAAG,2BAA2B;AACnG;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA,aAAa;AACb;AACA;AACA;AACA,4CAA4C,0DAAW;AACvD;AACA;AACA;AACA,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAa;AAC/B;AACA;AACA;AACA,QAAQ,+CAAG;AACX,2FAA2F,UAAU;AACrG;AACA,4DAA4D,4BAA4B;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG,mCAAmC,0DAAkB,CAAC;AACjE,kBAAkB,qDAAa;AAC/B;AACA,SAAS;AACT,uDAAuD,0DAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wBAAwB;AACpD,mDAAmD,0DAAkB;AACrE;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG;AACX,kBAAkB,qDAAa;AAC/B;AACA,SAAS;AACT,uDAAuD,0DAAkB;AACzE,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAa;AAC/B;AACA;AACA,QAAQ,+CAAG,gCAAgC,YAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,gBAAgB,+CAAG,oBAAoB,aAAa;AACpD;AACA;AACA,4BAA4B,2CAA2C;AACvE,6BAA6B,8DAAe;AAC5C;AACA;AACA;AACA;AACA;AACA,qBAAqB,uDAAe;AACpC;AACA,oCAAoC,6CAAS;AAC7C;AACA;AACA;AACA;AACA,wBAAwB,0DAA0D,GAAG,sDAAc,CAAC,GAAG,6CAAK,CAAC,GAAG,oDAAY,CAAC;AAC7H,wBAAwB,uDAAY;AACpC;AACA,aAAa;AACb;AACA;AACA;AACA,4CAA4C,0DAAW;AACvD;AACA;AACA,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG;AACf;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,qDAAa;AAC/B;AACA;AACA;AACA,YAAY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;AACA;AACA,YAAY,+CAAG,4BAA4B,UAAU;AACrD;AACA,wBAAwB,0DAA0D,GAAG,sDAAc,CAAC,GAAG,6CAAK,CAAC,GAAG,sDAAc,CAAC,GAAG,UAAU;AAC5I,wBAAwB,uDAAY;AACpC,aAAa;AACb;AACA,4CAA4C,0DAAW;AACvD,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG,kCAAkC,UAAU;AAC3D;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;;;;AClgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;;;;;;;;;;;;;;;;;ACrBpC;AACP;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA,CAAC,8BAA8B;;;;;;;;;;;;;;;;;;ACTa;AACrC,wBAAwB,sDAAa;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;ACzBiD;AACZ;AACrC,iCAAiC,sDAAa;AACrD,aAAa,6DAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACO;;;;;;;;;;;;;;;;;ACjB+B;AACvB;AACf;AACA;AACA;AACA;AACA,4BAA4B,8CAAU;AACtC;AACA;AACA;;;;;;;;;;;;;;;;;;;ACTwD;AACZ;AACrC,wBAAwB,sDAAa;AAC5C,aAAa,6DAAkB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;ACvB2D;AAClB;AACA;;;;;;;;;;;;;;;;;;;;ACFzC;AACP;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA,CAAC,8CAA8C;;;;;;;;;;;;;;;;;;;;AC/Cb;AACA;AACc;AACzC,uBAAuB,+CAAY;AAC1C;AACA;AACA,QAAQ,+CAAM,QAAQ,WAAW,EAAE,qDAAU,OAAO,IAAI,kBAAkB,qCAAqC,MAAM;AACrH;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClB0D;AACnD;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8DAA8D;AACxD;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wDAAwD;AAClD;AACP;AACA;AACA;AACA,CAAC,oDAAoD;AAC9C;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;AACxC;AACP;AACA;AACA;AACA,CAAC,kEAAkE;AACnE;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACA;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,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G,0CAAM;AAC/F;AACA;AACA;AACA,2BAA2B,iDAAa;AACxC,yBAAyB,2BAA2B,IAAI,8CAAU,SAAS,GAAG,QAAQ,GAAG,0CAAM;AAC/F;AACA;AACA;AACA,2BAA2B,iDAAa;AACxC,yBAAyB,4BAA4B,IAAI,8CAAU,SAAS,GAAG,QAAQ,GAAG,0CAAM;AAChG;AACA;AACA;AACA,2BAA2B,iDAAa;AACxC,yBAAyB,4BAA4B,KAAK,8CAAU,OAAO,GAAG,8CAAU,SAAS,GAAG,cAAc,GAAG,0CAAM;AAC3H;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAC;;;;;;;;;;;;;;;;;;AC1HK;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AAChC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wBAAwB;;;;;;;;;;;;;;;;;;;;;ACxByC;AAC3B;AACX;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG,0CAA0C,MAAM,iEAAW,EAAE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6CAA6C,iBAAW,wBAAwB,6DAAO;AACvF,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iDAAiD,iBAAW,wBAAwB,6DAAO;AAC3F;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,iEAAW;AACrC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6CAA6C,iBAAW,wBAAwB,6DAAO;AACvF;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iDAAiD,iBAAW,wBAAwB,6DAAO;AAC3F;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,iEAAW;AACrC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,6CAA6C,iBAAW,wBAAwB,6DAAO;AACvF;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,iDAAiD,iBAAW,wBAAwB,6DAAO;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,iEAAW;AACrC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,oDAAoD,OAAO,oBAAoB,iBAAW;AAC1F,8BAA8B,iBAAW;AACzC,8BAA8B,6DAAO;AACrC,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB,gDAAY;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,oDAAoD,OAAO,oBAAoB,iBAAW;AAC1F,8BAA8B,iBAAW;AACzC,8BAA8B,6DAAO;AACrC,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG;AACnB,0BAA0B,iEAAW;AACrC;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gDAAY,yBAAyB,gDAAY;AACtE;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,yCAAyC,iBAAW,wBAAwB,6DAAO;AACnF;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,YAAY,+CAAG;AACf,sBAAsB,iEAAW;AACjC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA,iEAAe,gBAAgB,EAAC;;;;;;;;;;;;;;;;;;;;ACvQzB;AACP;AACA;AACA;AACA,CAAC,kCAAkC;AAC5B;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4CAA4C;;;;;;;;;;;;;;;;;ACtCL;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB,EAAE,qDAAa;AAChD;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,iEAAe,iCAAiC,EAAC;;;;;;;;;;;;;;;;ACtC1C;AACP;AACA;AACA;AACA,yBAAyB;AACzB;AACA,qBAAqB;AACrB;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;;;;;;;;;;;;;;;;;;;;;;;;ACX6C;AACF;AACiH;AACX;AAC1E;AAC3C;AACkN;AACvO;AACP;AACA;AACA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gD,OAAO;AACvD,4BAA4B,uDAAY;AACxC;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,uCAAuC,gBAAgB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qEAAsB;AACxD;AACA,gBAAgB,iEAAkB;AAClC;AACA;AACA;AACA;AACA;AACA,oCAAoC,sEAAuB;AAC3D;AACA;AACA;AACA,gBAAgB,4BAA4B,EAAE,iEAAkB;AAChE;AACA,0CAA0C,kEAAmB,GAAG,gEAAwB;AACxF;AACA;AACA,aAAa;AACb,uCAAuC,8DAAe,GAAG,wDAAgB;AACzE;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAyB;AAC3C;AACA;AACA;AACA,2CAA2C,iBAAiB,EAAE,UAAU;AACxE,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA,2DAA2D,uDAAQ;AACnE,6DAA6D,6DAAqB;AAClF;AACA;AACA,YAAY,+CAAG,wBAAwB,UAAU;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA,kBAAkB,iEAAyB;AAC3C;AACA;AACA;AACA,2CAA2C,iBAAiB,EAAE,UAAU,GAAG,oDAAY,CAAC;AACxF;AACA,wBAAwB,uDAAY;AACpC;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA,mCAAmC,gBAAgB;AACnD;AACA;AACA;AACA,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAyB;AAC3C;AACA;AACA;A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gB,aAAa,YAAY,KAAK;AAClF,yBAAyB,uBAAuB,EAAE,kDAAU,CAAC,GAAG,8CAAM,CAAC,GAAG,OAAO,EAAE,6CAAK,CAAC,GAAG,YAAY,EAAE,kDAAU,CAAC,GAAG,KAAK;AAC7H;AACA;AACA,wBAAwB,MAAM;AAC9B,wBAAwB,uDAAY;AACpC;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD,YAAY,+CAAG,qCAAqC,YAAY;AAChE;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA,mBAAmB,OAAO;AAC1B,2CAA2C,uBAAuB,EAAE,kDAAU,CAAC,GAAG,UAAU,GAAG,sDAAO,CAAC;AACvG,kCAAkC,qDAAqD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,uBAAuB,EAAE,kDAAU,CAAC,GAAG,+BAA+B,GAAG,sDAAO,CAAC;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,oBAAoB,oBAAoB;AACxC,oBAAoB,uDAAY;AAChC;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,qBAAqB,8DAAe;AACpC;AACA;AACA,sCAAsC,8DAAe;AACrD;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA,2CAA2C,uBAAuB,EAAE,kDAAU,CAAC,GAAG,UAAU;AAC5F;AACA;AACA,wBAAwB,uDAAY;AACpC;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA,2CAA2C,uBAAuB,EAAE,kDAAU,CAAC,GAAG,UAAU;AAC5F;AACA;AACA,wBAAwB,uDAAY;AACpC;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA,2CAA2C,uBAAuB,EAAE,kDAAU,CAAC,GAAG,UAAU;AAC5F;AACA;AACA,wBAAwB,uDAAY;AACpC;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA,QAAQ,+CAAG,qBAAqB,UAAU,KAAK;AAC/C,eAAe,OAAO;AACtB;AACA;AACA,QAAQ,+CAAG,6BAA6B,iBAAiB,KAAK;AAC9D,eAAe,OAAO;AACtB;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtR2C;AACO;AACtB;AACwB;AACc;AACQ;AAChC;AACkB;AACmB;AACjC;AACD;AACtC,wBAAwB,kDAAQ;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA;AACA,6BAA6B,0DAAgB;AAC7C,8BAA8B,gEAAiB;AAC/C;AACA,QAAQ,+CAAG,yBAAyB,uDAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,0DAAe;AAChC,4CAA4C,2EAAsB;AAClE;AACA;AACA,iBAAiB,0DAAe;AAChC,4CAA4C,mFAA0B;AACtE;AACA;AACA,iBAAiB,0DAAe;AAChC,4CAA4C,qEAAmB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB,qBAAqB,IAAI;AAC7D;AACA,qDAAqD,wDAAY,0BAA0B,uDAAW;AACtG;AACA;AACA,qDAAqD,wDAAY,gCAAgC,uDAAW;AAC5G;AACA;AACA;AACA;AACA,oCAAoC,4DAAgB;AACpD;AACA;AACA;AACA;AACA,oCAAoC,4DAAgB;AACpD;AACA;AACA;AACA;AACA;AACA,wCAAwC,4DAAgB;AACxD;AACA;AACA;AACA;AACA;AACA,oCAAoC,4DAAgB;AACpD;AACA;AACA;AACA;AACA,oCAAoC,4DAAgB;AACpD;AACA;AACA;AACA;AACA,oCAAoC,4DAAgB;AACpD;AACA;AACA;AACA;AACA;AACA,wCAAwC,4DAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;;;;;;;;;;;;;;;;;;;;;;AC7GoC;AACiI;AACX;AAC1F;AAC3C;AAC4S;AACjU;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qDAAY;AACxC;AACA,YAAY,qDAAY;AACxB;AACA,8CAA8C,kDAAU,YAAY,8CAAM;AAC1E;AACA;AACA,QAAQ,+CAAG,yBAAyB,2EAA4B;AAChE;AACA;AACA;AACA,kBAAkB,2EAA4B;AAC9C;AACA;AACA,QAAQ,+CAAG;AACX;AAC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,UAAU;AACxE;AACA;AACA,wBAAwB,uDAAY;AACpC,aAAa;AACb;AACA;AACA,wBAAwB;AACxB,yBAAyB,8DAAe;AACxC;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA;AACA,kBAAkB,2EAA4B;AAC9C;AACA;AACA;AACA,2CAA2C,iBAAiB,EAAE,UAAU,GAAG,yDAAU,CAAC;AACtF;AACA;AACA,wBAAwB,uDAAY;AACpC,aAAa;AACb;AACA,2DAA2D,0DAAW,YAAY,uDAAQ;AAC1F,uDAAuD,yDAAiB;AACxE,2DAA2D,0DAAkB;AAC7E;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,sEAAuB;AACvD;AACA;AACA;AACA;AACA,eAAe,6DAAc;AAC7B;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtRO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC5B8B;AACyB;AACgC;AACO;AACzE;AAC6C;AACmmB;AAC7N;AACpa;AACmB;AACvD;AACP;AACA,cAAc,gEAAU;AACxB;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG;AACX;AACA,qCAAqC,IAAI,EAAE,kEAAY,CAAC;AACxD;AACA;AACA;AACA,QAAQ,+CAAG;AACX;AACA,oCAAoC,IAAI,EAAE,kEAAY,CAAC;AACvD;AACA;AACA,IAAI,+CAAG;AACP;AACA,iCAAiC,iBAAiB,EAAE,kEAAY,CAAC;AACjE;AACA;AACA,gCAAgC,iBAAiB,EAAE,kEAAY,CAAC;AAChE;AACA;AACA;AACA,oBAAoB,6BAA6B;AACjD;AACA;AACA;AACA;AACA,oBAAoB,4BAA4B;AAChD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP,wBAAwB,0EAAe,OAAO,EAAE,qDAAU,UAAU,sDAAkB;AACtF,0CAA0C,qDAAU,2IAA2I,sDAAkB;AACjN;AACA;AACO;AACP,sBAAsB,0EAAe,OAAO,EAAE,qDAAU,UAAU,sDAAkB;AACpF;AACA;AACA,IAAI,+CAAG,yBAAyB,UAAU;AAC1C;AACA,aAAa,qDAAU;AACvB;AACA,YAAY,+CAAG;AACf,kDAAkD,qDAAU,4FAA4F,sDAAkB;AAC1K;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,kDAAkD,qDAAU,oGAAoG,sDAAkB;AAClL;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,kDAAkD,qDAAU,oHAAoH,sDAAkB;AAClM;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA,gBAAgB,+CAAG;AACnB,sDAAsD,qDAAU,gJAAgJ,sDAAkB;AAClO;AACA;AACA;AACA;AACA,YAAY,+CAAG,4BAA4B,KAAK;AAChD;AACA,qBAAqB,4DAAiB;AACtC;AACA,oBAAoB,+CAAG;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,4DAAiB;AACtC;AACA;AACA,0DAA0D,qDAAU,gCAAgC,sDAAkB;AACtH,oBAAoB,+CAAG;AACvB;AACA;AACA;AACA,qBAAqB,4DAAiB;AACtC;AACA,0DAA0D,qDAAU,gCAAgC,sDAAkB;AACtH,oBAAoB,+CAAG;AACvB;AACA;AACA;AACA;AACA;AACA,0DAA0D,qDAAU,gCAAgC,sDAAkB;AACtH,oBAAoB,+CAAG;AACvB;AACA;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB;AACA,YAAY,+CAAG;AACf,kDAAkD,qDAAU,+KAA+K,sDAAkB;AAC7P;AACA;AACA;AACA;AACA,kDAAkD,qDAAU,2BAA2B,sDAAkB;AACzG,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA;AACO;AACP,wBAAwB,qFAAiB,OAAO,EAAE,qDAAU,UAAU,sDAAkB;AACxF;AACA;AACA,IAAI,+CAAG,yBAAyB,UAAU;AAC1C;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,8CAA8C,qDAAU;AACxD;AACA;AACA;AACA;AACA,8CAA8C,qDAAU;AACxD,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,sBAAsB,0EAAe,oBAAoB,qDAAU;AACnE;AACA,IAAI,+CAAG,wBAAwB,UAAU;AACzC;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,kDAAkD,qDAAU;AAC5D;AACA;AACA;AACA,aAAa,qDAAU;AACvB,aAAa,qDAAU;AACvB;AACA;AACA,gBAAgB,+CAAG;AACnB,+EAA+E,qDAAU,mBAAmB,qDAAU;AACtH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,+CAAG,kCAAkC,cAAc;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA,qBAAqB,0DAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,qDAAU,mBAAmB,qDAAU;AAClH;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,kDAAkD,qDAAU;AAC5D;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf,kDAAkD,qDAAU;AAC5D;AACA;AACA;AACA;AACA,YAAY,+CAAG;AACf;AACA;AACA;AACO;AACP;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa,qDAAU;AACvB,YAAY,+CAAG;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG,SAAS,kBAAkB;AAC1C;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA,QAAQ,+CAAG;AACX,kBAAkB,gEAAU;AAC5B;AACA,SAAS;AACT,eAAe,mEAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,+DAAS;AAC1C,8CAA8C,0DAAI;AAClD;AACA;AACA,iDAAiD,8DAAQ;AACzD;AACA;AACA,8CAA8C,4EAAsB;AACpE,yCAAyC,wEAAkB;AAC3D;AACA;AACA;AACA,8CAA8C,uEAAiB;AAC/D,yCAAyC,kEAAY;AACrD;AACA;AACA;AACA;AACA,oCAAoC,yEAAmB;AACvD,uCAAuC,0EAAoB;AAC3D,uCAAuC,+DAAS;AAChD,yCAAyC,+DAAS;AAClD;AACA;AACA;AACA,8CAA8C,wEAAkB;AAChE;AACA,iCAAiC,2EAAqB;AACtD;AACA;AACA;AACA,iCAAiC,kFAA4B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iEAAW;AACzD;AACA,iCAAiC,8DAAQ;AACzC;AACA;AACA;AACA,iCAAiC,sEAAgB;AACjD;AACA;AACA;AACA,iCAAiC,oEAAc;AAC/C;AACA;AACA;AACA,iCAAiC,uEAAiB;AAClD;AACA;AACA;AACA,iCAAiC,kEAAY;AAC7C;AACA;AACA;AACA,iCAAiC,yEAAmB;AACpD;AACA;AACA;AACA,iCAAiC,iFAA2B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,+DAAS;AACvD;AACA,iCAAiC,gFAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kEAAY;AAC1D;AACA,iCAAiC,8DAAQ;AACzC;AACA;AACA;AACA,iCAAiC,kEAAY;AAC7C;AACA;AACA;AACA,iCAAiC,gEAAU;AAC3C;AACA;AACA;AACA,iCAAiC,qEAAe;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kEAAY;AAC1D;AACA,iCAAiC,4EAAsB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wCAAW,CAAC,GAAG,0CAAa,CAAC,GAAG,6CAAgB,CAAC;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AChC;AACA,aAAa;AACb;AACA,KAAK;AACL;AACA;AACO;AACP;AACA,gDAAgD,kCAAkC;AAClF;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA,QAAQ,+CAAG,oCAAoC,qBAAqB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG,iEAAiE,IAAI;AAChF;AACA,6CAA6C;AAC7C;AACA,aAAa;AACb;AACO;AACP,0BAA0B,yDAAiB,CAAC,GAAG,WAAW,GAAG,GAAG;AAChE;AACA;AACA,yBAAyB,oDAAgB;AACzC;AACA;AACA,oCAAoC,EAAE,mBAAmB,IAAI;AAC7D,YAAY,SAAS;AACrB;AACA,0CAA0C,oDAAgB;AAC1D,sCAAsC,oDAAgB;AACtD;AACA;AACA;AACO;AACP,wCAAwC,oDAAgB;AACxD;AACA;AACA,0EAA0E,gBAAgB;AAC1F;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,+CAAG;AACf,sBAAsB,gEAAU;AAChC;AACA,aAAa;AACb;AACA;AACA,mEAAmE,YAAY;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,KAAK;AACxC,2CAA2C,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,MAAM,eAAe;AAC9I;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,QAAQ,+CAAG,qDAAqD,MAAM;AACtE,kBAAkB,gEAAU;AAC5B;AACA,SAAS;AACT;AACA;AACA;AACO,0CAA0C;AACjD;AACA;AACA;AACA;AACA,QAAQ,+CAAG;AACX,kBAAkB,gEAAU;AAC5B;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACp1BO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,cAAc;AAClD,qCAAqC,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClDnC;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAoD;AACrE;AACP;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AAC9B;AACP;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AAC1C;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AACpC;AACP;AACA;AACA;AACA,CAAC,4BAA4B;AACtB;AACP;AACA;AACA;AACA,CAAC,sCAAsC;AAChC;AACP;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACd;AACP;AACA;AACA;AACA;AACA,CAAC,0BAA0B;AACpB;AACP;AACA;AACA;AACA;AACA,CAAC,4CAA4C;AACtC;AACP;AACA;AACA;AACA,CAAC,gCAAgC;AAC1B;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClEqC;AACb;AACN;AACJ;AACO;AACN;AAChC;AACiJ;AACtH;AACZ;AACY;AACqE;AACrD;AACzB;AACa;AACrB;AACqB;;;;;;;;;;;;;;;;AChB7D,iEAAe,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,GAAG,yCAAyC;;;;;;;;;;;;;;;ACApI;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;AClBqC;AACrC;AACA;AACA;AACA;;AAEA;;AAE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;;;;;;;;;;;;;;;;;;;;;;ACb6C;AAC3B;AACM;AACJ;AACb;AACQ;;AAEjD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,MAAM,mDAAQ,OAAO,mDAAQ;AAC7B;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,2DAAQ,CAAC,2DAAQ,GAAG;AACxC;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,sBAAsB,6DAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAAkB;AAC7D,gBAAgB,uDAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0DAAU;AACzB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA,iBAAiB,kDAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,kDAAS;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,QAAQ,mDAAQ;AAChB;AACA;;AAEA;AACA,6CAA6C,gEAAa,KAAK,yDAAM;AACrE;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yDAAM;;AAE/B,WAAW,2DAAQ,CAAC,2DAAQ,GAAG;AAC/B;AACA,KAAK;AACL;;AAEA;AACA,WAAW,uDAAY;AACvB;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,QAAQ,0DAAa;AACrB,MAAM,+CAAI,iFAAiF;AAC3F;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,CAAC;;AAE6E;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjRW;AACqS;AAClV;AACS;AACkE;AACqE;AAC3I;AACA;AACsG;AACrG;AACI;;AAEtD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf,cAAc;AACd,gBAAgB;AAChB,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,gEAAgE,mDAAQ,uBAAuB,oDAAS;AACxG,GAAG;AACH;AACA,EAAE,+CAAI;AACN;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qFAAqF,0DAAe;AACpG,gCAAgC,gEAAa,qBAAqB,yDAAM;AACxE;AACA;AACA;AACA;;AAEA,SAAS,0DAAa;AACtB,MAAM,+CAAI;AACV;;AAEA;AACA,uCAAuC,oDAAS;AAChD;;AAEA,mDAAmD;AACnD;AACA;AACA,OAAO;AACP,iCAAiC,2DAAQ,SAAS;AAClD;AACA,KAAK,kBAAkB;;AAEvB;;AAE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,CAAC,2DAAQ,GAAG;AACtC,cAAc,2DAAQ,CAAC,2DAAQ,GAAG;AAClC,gBAAgB,2DAAQ,CAAC,2DAAQ,GAAG;AACpC,cAAc,2DAAQ,CAAC,2DAAQ,GAAG;AAClC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA,aAAa,qDAAU;AACvB,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oDAAS;AACzB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAI;AACX,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA,8DAA8D;;AAE9D;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB,qDAAU;AAC/B,sBAAsB,kDAAK;;AAE3B,yBAAyB,iDAAM;AAC/B;AACA,OAAO;;AAEP,wBAAwB,mDAAM;;AAE9B;AACA;;AAEA,6BAA6B,kDAAO;AACpC;AACA,aAAa,2DAAQ,CAAC,2DAAQ,GAAG;AACjC;AACA,OAAO;AACP,KAAK,IAAI,kDAAO;AAChB;AACA,+BAA+B,mDAAQ;AACvC;AACA,QAAQ;AACR;AACA;AACA,aAAa,kDAAO;AACpB,eAAe,2DAAQ,CAAC,2DAAQ,GAAG;AACnC;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA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;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA,gDAAgD,uDAAY;AAC5D;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,iDAAiD,UAAU;AACvF;AACA;AACA;AACA;AACA,kCAAkC,mDAAQ;AAC1C,sBAAsB,uDAAY;AAClC,QAAQ,uDAAY,CAAC,uDAAY,2BAA2B,+CAAI;AAChE;;AAEA;AACA,iCAAiC,wDAAa;AAC9C,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,gEAAa,KAAK,yDAAM;AAC9D;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,kDAAO;AACnC;AACA,KAAK;AACL;AACA,yCAAyC,kDAAO;AAChD;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,qBAAqB,gEAAgB;AACrC,2DAA2D,gEAAgB;;AAE3E;AACA,kCAAkC,2DAAQ,gEAAgE,0BAA0B;AACpI;;AAEA,aAAa,mDAAG;AAChB;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,8BAA8B,2DAAQ,oDAAoD,sBAAsB;AAChH;;AAEA,aAAa,mDAAG,wBAAwB,mDAAG;AAC3C;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;A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AEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;AACA;AACA;;AAEA,yBAAyB,sDAAW;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA,eAAe,oDAAS;AACxB;AACA,SAAS;;AAET;AACA,YAAY,mDAAQ;AACpB;;AAEA;AACA,0BAA0B;AAC1B;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,eAAe,oDAAS;AACxB;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,WAAW,sDAAW;AACtB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,4BAA4B,0DAAe;AAC3C;AACA,SAAS;AACT;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;;AAEA,4BAA4B,0DAAU,qDAAqD;AAC3F,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA,kBAAkB;;;AAGlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,YAAY,mDAAQ;AACpB,qDAAqD,2DAAgB;AACrE,UAAU;AACV;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,UAAU,0DAAU;AACpB;AACA,QAAQ;;;AAGR;AACA,aAAa,0DAAa;AAC1B,UAAU,+CAAI;AACd;;AAEA;AACA;;AAEA,kCAAkC,uDAAY;AAC9C,aAAa,kDAAO;AACpB;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa,yDAAM;AACnB;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAc,0DAAe;AAC7B;AACA;AACA;;AAEA,4BAA4B,mDAAQ;AACpC;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,6BAA6B,kDAAO,CAAC,uDAAY;AACjD;AACA,OAAO;AACP;;AAEA,0BAA0B,qDAAU;;AAEpC,QAAQ,mDAAQ;AAChB;AACA;;AAEA,WAAW,kDAAO,CAAC,uDAAY;AAC/B;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B,kDAAO;AACjC;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB,2DAAQ,uCAAuC,UAAU;AACjF;AACA;;AAEA;AACA;AACA,6CAA6C,2DAAQ,iCAAiC,UAAU;AAChG;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,KAAK;AACL;A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AAsB,yDAAM,wBAAwB,yDAAM,oBAAoB,yDAAM;AAC7L,aAAa,kDAAO;AACpB;AACA,OAAO;AACP,KAAK;;AAEL;AACA,sCAAsC,2DAAQ,4EAA4E,8BAA8B;AACxJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;;AAEA;AACA,CAAC;;AAEoB;;;;;;;;;;;;;;;;;;;;AC9hDrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,MAAM;AAC1B;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,6EAA6E,OAAO;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;;AAE6D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7EpB;;AAEzC,YAAY,kDAAW;AACvB,WAAW,kDAAW;AACtB,YAAY,kDAAW;AACvB,WAAW,kDAAW;AACtB,aAAa,kDAAW;AACxB,gBAAgB,kDAAW;AAC3B,aAAa,kDAAW;AACxB,YAAY,kDAAW;AACvB,gBAAgB,kDAAW;AAC3B,UAAU,kDAAW;AACrB,WAAW,kDAAW;AACtB,aAAa,kDAAW;AACxB,qBAAqB,kDAAW;AAChC,oBAAoB,kDAAW;AAC/B,YAAY,kDAAW;AACvB,aAAa,kDAAW;AACxB,aAAa,kDAAW;AACxB,WAAW,kDAAW;;AAE0I;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AACjC,SAAS,2DAAQ,CAAC,2DAAQ,GAAG;AAC7B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,2DAAQ,CAAC,2DAAQ,GAAG;AACzC,QAAQ,qDAAc;AACtB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,2DAAQ,CAAC,2DAAQ,GAAG;AACzC;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,mDAAM;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,2DAAQ,CAAC,2DAAQ,GAAG;AACzC;AACA;AACA,4BAA4B;AAC5B;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA,UAAU,gDAAK;AACf;AACA;AACA;AACA;AACA;AACA,SAAS,2DAAQ,CAAC,2DAAQ,GAAG;AAC7B,WAAW,mDAAQ;AACnB;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,mDAAQ;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU,kDAAW;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,qDAAU;AAC3B;AACA,UAAU,kDAAW;AACrB;AACA;AACA;AACA;AACA;AACA,yBAAyB,qDAAU;AACnC;AACA;AACA,IAAI;AACJ;AACA,UAAU,kDAAW;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU,mDAAQ;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,kDAAW;AAC9B;AACA;AACA;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;;AAEA,mBAAmB,yDAAM,+EAA+E,kDAAO;AAC/G;AACA;;AAEA;AACA;AACA;AACA;;AAEA,WAAW,iDAAM;AACjB;AACA;AACA;;AAEA,WAAW,mDAAQ;AACnB;AACA,2BAA2B,wDAAa;AACxC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iCAAiC,2DAAQ,CAAC,2DAAQ,GAAG;AACrD;AACA;;AAEA,+BAA+B,uBAAuB;AACtD;AACA;;AAEA,mCAAmC,gEAAa,sCAAsC,yDAAM;AAC5F;AACA,WAAW;AACX;;AAEA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAE8U;;;;;;;;;;;;;;;;;;;;;ACvgB7R;AACT;AACA;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sEAAsE,uDAAU;AAChF;AACA;AACA;AACA;AACA;;AAEA;AACA,sEAAsE,kDAAK;AAC3E;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA,cAAc,qDAAU;AACxB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA,qBAAqB,qDAAU;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEmD;;;;;;;;;;;;;;;;;;;AClInD;AACA;AACA;AACA;;AAEmF;;;;;;;;;;;;;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B,kDAAO,aAAa,kDAAK;AACxD;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;;AAEA,0BAA0B,2DAAQ,CAAC,2DAAQ,GAAG;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,oDAAS;AAClC;AACA,KAAK;AACL,qBAAqB,kDAAQ;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,aAAa,yDAAO;AACpB;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA,WAAW,0DAAa;AACxB,QAAQ,+CAAI;AACZ;;AAEA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,iCAAiC,UAAU;AACvE;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB;;;AAGtB,uCAAuC;;AAEvC,yBAAyB;;AAEzB;AACA;AACA,MAAM;;;AAGN;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA,MAAM;;;AAGN;AACA;AACA,sBAAsB,2DAAQ,uCAAuC,UAAU;AAC/E;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,kCAAkC,UAAU;AACxE;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,yCAAyC,UAAU;AAC/E;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA,iBAAiB,8DAAc;;AAE/B;AACA;AACA;AACA;AACA,OAAO;AACP,2EAA2E,qDAAU;;AAErF;AACA,sBAAsB,2DAAQ,sCAAsC,UAAU;AAC9E;AACA,mBAAmB,uDAAU;AAC7B;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA,kCAAkC;;AAElC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA,kCAAkC;;AAElC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;;AAGA;;AAEA,IAAI,kDAAQ;AACZ;AACA;AACA,yEAAyE,yDAAO;AAChF,aAAa,yDAAa,uFAAuF,6CAAK;AACtH,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,kCAAkC,kDAAS;AAC3C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA,oBAAoB,2DAAQ,kCAAkC,UAAU;AACxE;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,sCAAsC,UAAU;AAC5E,iCAAiC;;AAEjC;AACA;AACA;AACA,MAAM;AACN;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AEA;AACA;;AAEA,8BAA8B,uDAAY;AAC1C,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,iBAAiB,uDAAY;;AAE7B,4BAA4B,0DAAa;AACzC,+BAA+B,0DAAa;AAC5C,KAAK;AACL;AACA;;AAEA,oBAAoB,yDAAO;AAC3B;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,2DAAQ,kCAAkC,UAAU;AACxE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,8DAAiB;AACvD,eAAe,qDAAU;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA,WAAW;AACX;;AAEA;AACA;AACA;;AAEA;AACA,WAAW,iDAAI;AACf;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,YAAY;AACZ;AACA;AACA;;AAEA;;AAEA,WAAW,mDAAM;AACjB;AACA;;AAEA,WAAW,kDAAK;AAChB;AACA;AACA;AACA;;AAEA,0CAA0C;AAC1C;AACA;;AAEA;AACA;AACA,YAAY;;;AAGZ,gCAAgC,kDAAW;AAC3C,+BAA+B,yDAAc;AAC7C;AACA;AACA;;AAEA,iBAAiB,0DAAa;AAC9B,cAAc,+CAAI;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,mBAAmB,0DAAa;AAChC,gBAAgB,+CAAI;AACpB;;AAEA;AACA;;AAEA,sCAAsC,qDAAU;;AAEhD;AACA;AACA;AACA;;AAEA,yBAAyB,qDAAU;AACnC;AACA;AACA;AAC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yBAAyB,kDAAK;;AAE9B;AACA;AACA,qBAAqB,uDAAY;AACjC;AACA,WAAW;AACX,UAAU;AACV,UAAU,+EAAoC;;AAE9C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,uBAAuB,qDAAU;AACjC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK,KAAK,uDAAgB;AAC1B;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA,iBAAiB,uDAAY;AAC7B;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN,gBAAgB,kDAAK;AACrB;;AAEA,QAAQ,wDAAa;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,uBAAuB,qDAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,YAAY,qDAAU;AACtB;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK,KAAK,uDAAgB;AAC1B;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,iBAAiB,uDAAY;AAC7B;AACA,OAAO;AACP,KAAK;AACL;;AAEA,iBAAiB,uDAAY,CAAC,kDAAK;AACnC;AACA,OAAO;AACP,KAAK;AACL;;AAEA,iBAAiB,uDAAY,CAAC,uDAAU;AACxC;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK,KAAK,uDAAgB;AAC1B;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,WAAW,0DAAa;AACxB,QAAQ,+CAAI;AACZ,QAAQ;;;AAGR;AACA,MAAM;;;AAGN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK,KAAK,uDAAgB;AAC1B;AACA,KAAK;AACL;;AAEA;AACA,iBAAiB,wDAAS;;AAE1B;AACA;AACA;AACA,oEAAoE,2DAAQ,CAAC,2DAAQ;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,oBAAoB,2DAAQ;AAC5B;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,QAAQ;;;AAGR,MAAM,8DAAe;AACrB;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,uDAAgB;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,MAAM,mDAAQ;AACd,WAAW,2DAAQ,CAAC,2DAAQ,GAAG;AAC/B;AACA,KAAK;AACL;;AAEA,SAAS,2DAAQ,CAAC,2DAAQ,CAAC,2DAAQ,GAAG;AACtC,UAAU,mDAAQ;AAClB,GAAG;AACH;;AAEA;AACA;AACA,SAAS,yDAAO;AAChB,SAAS,0DAAa;AACtB,yBAAyB,oDAAS,YAAY,qDAAU;AACxD,MAAM,+CAAI,yEAAyE,oDAAS;AAC5F;;AAEA;AACA;AACA,MAAM;AACN,aAAa,+DAAmB;AAChC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAE4D;;;;;;;;;;;;;;;;;;;ACj3CJ;AACpC;AACsB;AACtB;AACM;;AAE1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;;AAEA;AACA;AACA;AACA,SAAS,2DAAQ,CAAC,2DAAQ;AAC1B,UAAU,mDAAM;AAChB,GAAG;AACH;AACA;AACA;AACA,0BAA0B,yDAAM;;AAEhC,aAAa,2DAAQ,CAAC,2DAAQ,GAAG;AACjC,cAAc,mDAAM;AACpB;AACA,OAAO;AACP;AACA,GAAG;AACH;;AAE8C;;;;;;;;;;;;;;;;ACvC9C;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEoB;;;;;;;;;;;;;;;;;AClB4B;;AAEhD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,2DAAQ,CAAC,2DAAQ,GAAG;AACvC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA,CAAC;;AAEoB;;;;;;;;;;;;;;;;;AC9ErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACf2C;AAClC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,kDAAO;AAClC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B,2DAAQ,6DAA6D,yBAAyB;AAC7H;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA,+BAA+B,2DAAQ,6DAA6D,yBAAyB;AAC7H,uCAAuC;;AAEvC;AACA;AACA;AACA;AACA,WAAW;AACX,UAAU;AACV;AACA;AACA,WAAW;AACX;AACA,QAAQ;AACR;AACA;AACA,yCAAyC,2DAAQ,mCAAmC,UAAU;AAC9F;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;AACnB,kBAAkB;AAClB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA,+BAA+B,2DAAQ,6DAA6D,yBAAyB;AAC7H;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,+BAA+B,2DAAQ,6DAA6D,yBAAyB;AAC7H;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA,SAAS,gEAAa,KAAK,yDAAM,SAAS,kDAAO,CAAC,gEAAa,KAAK,yDAAM;AAC1E;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG,IAAI;AACP;AACA;AACA,iBAAiB,kDAAO;AACxB;AACA,GAAG;AACH;;AAEiK;;;;;;;;;;;;;;;;;ACpQjK;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;;AAEnC;;AAEA;AACA;AACA;AACA,CAAC,wCAAwC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChC0C;AACI;AACpC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0DAAe;AAC/B;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAM;;;AAGN;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,0BAA0B;AAC5C;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,2BAA2B;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,kBAAkB,2DAAQ,2CAA2C,UAAU;AAC/E;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,2DAAQ,qCAAqC,iBAAiB;AACvF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,yBAAyB,2DAAQ,qCAAqC,iBAAiB;AACvF;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,uBAAuB,2DAAQ,qCAAqC,iBAAiB;AACrF;AACA,2BAA2B;;AAE3B,sBAAsB,wBAAwB;AAC9C;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oCAAoC,gEAAa,KAAK,yDAAM;AAC5D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,kBAAkB,2DAAQ,uCAAuC,UAAU;AAC3E;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW,yDAAM;AACjB;AACA;;AAEA;AACA,uBAAuB,2DAAQ,qCAAqC,iBAAiB;AACrF;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,0DAAa;AACpB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,sBAAsB,2DAAQ,2CAA2C,UAAU;AACnF;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA,2BAA2B;AAC3B,GAAG;AACH;AACA,EAAE;;AAEF;;AAEA,KAAK,0DAAa;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ;;;AAGR;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,6DAAkB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,6DAAkB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,CAAC,IAAI;;AAEL,6BAA6B;AAC7B;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,WAAW,2DAAQ;AACnB;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS,2DAAQ;AACjB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,WAAW,2DAAQ,CAAC,2DAAQ,GAAG;AAC/B;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,yCAAyC,yDAAc;AACvD;AACA;;AAEA;AACA;AACA;AACA,OAAO,0DAAa;AACpB;;AAEA;AACA;AACA;AACA,MAAM;AACN,sGAAsG;;AAEtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,qBAAqB,6DAAkB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEmoB;;;;;;;;;;;;ACjnBtnB;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,aAAa;AACb,uBAAuB;AACvB,sBAAsB;AACtB,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,aAAa;AACzB;AACA;AACA,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;;;;;;;;;;;;ACzIa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,cAAc;AACd,kBAAe;AACf,cAAc;AACd,qBAAqB;AACrB,mBAAmB;AACnB,gBAAgB;AAChB,0CAA0C,mBAAO,CAAC,kEAAgB;AAClE,kBAAkB,mBAAO,CAAC,4DAAa;AACvC,uCAAuC,mBAAO,CAAC,qEAAY;AAC3D;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,eAAe;AAC1B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,eAAe;AAC1B,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3Ea;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,wBAAwB,GAAG,kBAAe;AAC1C,qCAAqC,mBAAO,CAAC,gDAAQ;AACrD,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,qCAAqC,mBAAO,CAAC,0DAAe;AAC5D,iBAAiB,mBAAO,CAAC,uEAAa;AACtC,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oFAAsB;AACjC,GAAG;AACH;AACA,WAAW,mFAAqB;AAChC,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;AACA;AACA,CAAC;AACD;;;;;;;;;;;;AC7Ea;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,oCAAoC,mBAAO,CAAC,wHAA8C;AAC1F;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa;AACb;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,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxEa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;;AAEA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;ACzBa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAkB,GAAG,kBAAkB,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,4CAA4C,GAAG,gCAAgC;AACxK,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA,+BAA+B,gCAAgC;AAC/D,2CAA2C,4CAA4C;AACvF;;;;;;;;;;;;ACtFa;;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;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,GAAG;AACH;AACA;;;;;;;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ACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;;;;;;;;;;;;ACtEa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,kBAAe;AACf;AACA;AACA;AACA,eAAe,kBAAe;AAC9B;;;;;;;;;;;;ACXa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,mBAAO,CAAC,2EAAQ;AACnD;;;;;;;;;;;;ACda;;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;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;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;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;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,mCAAmC,mBAAO,CAAC,iEAAU;AACrD,uCAAuC,mBAAO,CAAC,qEAAY;AAC3D,6CAA6C,mBAAO,CAAC,mFAAmB;AACxE,4CAA4C,mBAAO,CAAC,iFAAkB;AACtE,oCAAoC,mBAAO,CAAC,+DAAS;AACrD,gDAAgD,mBAAO,CAAC,2FAAuB;AAC/E,gDAAgD,mBAAO,CAAC,yFAAsB;AAC9E,wCAAwC,mBAAO,CAAC,yEAAc;AAC9D,uCAAuC,mBAAO,CAAC,qEAAY;AAC3D,cAAc,mBAAO,CAAC,iEAAU;AAChC,qBAAqB,mBAAO,CAAC,iFAAkB;AAC/C,0CAA0C,mBAAO,CAAC,6EAAgB;AAClE,oCAAoC,mBAAO,CAAC,+DAAS;AACrD,kCAAkC,mBAAO,CAAC,2DAAO;AACjD,4CAA4C,mBAAO,CAAC,mFAAmB;AACvE,wCAAwC,mBAAO,CAAC,uEAAa;AAC7D,y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AA2D,0BAA0B;AACxP,4BAA4B,gBAAgB,sBAAsB,OAAO,kDAAkD,sDAAsD,4CAA4C,sJAAsJ,uEAAuE,KAAK,YAAY;AAC3c;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,aAAa;AACb;AACA;AACA,wEAAwE,aAAa;AACrF;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,iGAAiG,eAAe;AAChH;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC9Ha;;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;AACA;AACA,WAAW,UAAU;AACrB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;ACrCa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F,6BAA6B,mBAAO,CAAC,wIAAsD;AAC3F;AACA;AACA,CAAC;AACD,kBAAe;AACf,yCAAyC,mBAAO,CAAC,gHAA0C;AAC3F,8CAA8C,mBAAO,CAAC,0HAA+C;AACrG,2CAA2C,mBAAO,CAAC,oHAA4C;AAC/F,sCAAsC,mBAAO,CAAC,8GAAyC;AACvF,mCAAmC,mBAAO,CAAC,6CAAM;AACjD;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA,4EAA4E,aAAa;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,eAAe;AAC5F;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB,iBAAiB,cAAc;AAC/B,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA,mGAAmG,eAAe;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB,iBAAiB,cAAc;AAC/B,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,mGAAmG,eAAe;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB,iBAAiB,cAAc;AAC/B,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,OAAO;AACxB,iBAAiB,cAAc;AAC/B,iBAAiB,OAAO;AACxB,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA;AACA,+EAA+E,eAAe;AAC9F;AACA;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,mBAAmB;AACnB;AACA,KAAK;AACL;AACA;AACA,2CAA2C;AAC3C;AACA,SAAS,OAAO;AAChB;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,cAAc;AACzB;AACA,aAAa;AACb;AACA;AACA,6FAA6F,eAAe;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5Oa;;AAEb,6BAA6B,mBAAO,CAAC,0IAAuD;AAC5F;AACA;AACA,CAAC;AACD,8BAA8B;AAC9B,2BAA2B;AAC3B,uBAAuB;AACvB,0BAA0B;AAC1B,wBAAwB;AACxB,wBAAwB;AACxB,0BAA0B;AAC1B,6BAA6B;AAC7B,qBAAqB;AACrB,wBAAwB;AACxB,YAAY,mBAAO,CAAC,iEAAU;AAC9B,iBAAiB,mBAAO,CAAC,uEAAa;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,MAAM;AACpB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,KAAK;AAChB,WAAW,KAAK;AAChB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5La;;AAEb,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,cAAc,mBAAO,CAAC,mDAAQ;AAC9B,kCAAkC,mBAAO,CAAC,2DAAO;AACjD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,6FAA6F,aAAa;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;;;;;;;;;;;;AC3CA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;;AAEvD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;ACxJD;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;;AAEA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,aAAa,cAAc;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;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xBa;;AAEb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,mBAAO,CAAC,yGAA6B;AACrC;AACA;AACA,mBAAO,CAAC,yGAAiC;AACzC,mBAAO,CAAC,qGAA+B;AACvC,mBAAO,CAAC,kHAA4B;AACpC,mBAAO,CAAC,yGAAiC;AACzC,mBAAO,CAAC,uGAAgC;AACxC,mBAAO,CAAC,+FAA4B;AACpC,mBAAO,CAAC,2GAAkC;AAC1C,mBAAO,CAAC,mGAA8B;AACtC,mBAAO,CAAC,mFAAsB;AAC9B,mBAAO,CAAC,uFAAwB;AAChC,mBAAO,CAAC,uFAAwB;AAChC,mBAAO,CAAC,6FAA2B;AACnC,mBAAO,CAAC,mFAAsB;AAC9B,mBAAO,CAAC,iFAAqB;AAC7B,mBAAO,CAAC,iFAAqB;AAC7B,mBAAO,CAAC,uGAAgC;AACxC,mBAAO,CAAC,uFAAwB;AAChC,YAAY,mBAAO,CAAC,wDAAc;AAClC,gBAAgB,+GAAoC;AACpD,aAAa,mBAAO,CAAC,yDAAU;;AAE/B;AACA;AACA;AACA,QAAQ,2EAA2E;AACnF,IAAI;AACJ,SAAS;AACT,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,GAAG,yBAAyB;;AAE5B;AACA;AACA;AACA","sources":["webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallHistory/CallHistory.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallHistory/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallSettings/CallSettings.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallSettings/UcmBackendConnector.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallSettings/WxCallBackendConnector.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallSettings/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/CallingClient.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/calling/CallerId/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/calling/call.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/calling/callManager.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/calling/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/calling/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/line/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/line/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/registration/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/CallingClient/registration/register.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Contacts/ContactsClient.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Contacts/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Contacts/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/catalog/CallError.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/catalog/CallingDeviceError.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/catalog/ExtendedError.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/catalog/LineError.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Errors/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Events/impl/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Events/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Logger/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Logger/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Metrics/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Metrics/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/SDKConnector/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/SDKConnector/utils.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Voicemail/BroadworksBackendConnector.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Voicemail/UcmBackendConnector.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Voicemail/Voicemail.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Voicemail/WxCallBackendConnector.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/Voicemail/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/common/Utils.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/common/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/common/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/common/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/dist/module/index.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/uuid/dist/esm-browser/regex.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/uuid/dist/esm-browser/rng.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/uuid/dist/esm-browser/stringify.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/uuid/dist/esm-browser/v4.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/uuid/dist/esm-browser/validate.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/Actor.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/Machine.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/State.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/StateNode.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/_virtual/_tslib.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/actionTypes.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/actions.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/behaviors.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/devTools.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/environment.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/interpreter.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/invokeUtils.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/registry.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/scheduler.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/serviceScope.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/stateUtils.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/types.js","webpack://@agentx/agentx/../../node_modules/@webex/calling/node_modules/xstate/es/utils.js","webpack://@agentx/agentx/../../node_modules/@webex/common-timers/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/base64.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/browser-detection.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/capped-debounce.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/check-required.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/constants.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/defer.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/deprecated.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/event-envelope.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/events.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/exception.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/in-browser/browser.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/in-browser/index.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/index.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/isBuffer.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/make-state-datatype.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/one-flight.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/patterns.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/resolve-with.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/retry.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/tap.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/template-container.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/uuid-utils.js","webpack://@agentx/agentx/../../node_modules/@webex/common/dist/while-in-flight.js","webpack://@agentx/agentx/../../node_modules/valid-url/index.js","webpack://@agentx/agentx/../../node_modules/vm-browserify/index.js","webpack://@agentx/agentx/../../node_modules/webex/dist/config-storage.shim.js","webpack://@agentx/agentx/../../node_modules/webex/dist/config.js","webpack://@agentx/agentx/../../node_modules/webex/dist/index.js","webpack://@agentx/agentx/../../node_modules/webex/dist/webex.js"],"sourcesContent":["import SDKConnector from '../SDKConnector';\nimport { ALLOWED_SERVICES, HTTP_METHODS, SORT, SORT_BY, CALLING_BACKEND, } from '../common/types';\nimport log from '../Logger';\nimport { serviceErrorCodeHandler, getVgActionEndpoint, getCallingBackEnd } from '../common/Utils';\nimport { APPLICATION_JSON, CALL_HISTORY_FILE, CONTENT_TYPE, FROM_DATE, HISTORY, LIMIT, NUMBER_OF_DAYS, UPDATE_MISSED_CALLS_ENDPOINT, SET_READ_STATE_SUCCESS_MESSAGE, VERSION_1, UNIFIED_COMMUNICATIONS, CONFIG, PEOPLE, LINES, ORG_ID, DELETE_CALL_HISTORY_RECORDS_ENDPOINT, SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE, SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE, } from './constants';\nimport { FAILURE_MESSAGE, STATUS_CODE, SUCCESS_MESSAGE, USER_SESSIONS } from '../common/constants';\nimport { COMMON_EVENT_KEYS, MOBIUS_EVENT_KEYS, } from '../Events/types';\nimport { Eventing } from '../Events/impl';\nexport class CallHistory extends Eventing {\n sdkConnector;\n webex;\n janusUrl = '';\n fromDate = '';\n loggerContext = {\n file: CALL_HISTORY_FILE,\n method: 'getCallHistoryData',\n };\n userSessions;\n constructor(webex, logger) {\n super();\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.janusUrl = this.webex.internal.services._serviceUrls.janus;\n this.registerSessionsListener();\n log.setLogger(logger.level, CALL_HISTORY_FILE);\n }\n async getCallHistoryData(days = NUMBER_OF_DAYS, limit = LIMIT, sort = SORT.DEFAULT, sortBy = SORT_BY.DEFAULT) {\n const date = new Date();\n date.setDate(date.getDate() - days);\n this.fromDate = date.toISOString();\n const sortByParam = Object.values(SORT_BY).includes(sortBy) ? sortBy : SORT_BY.DEFAULT;\n const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;\n log.log(`Janus API URL ${this.janusUrl}`, this.loggerContext);\n log.info(`Call history from date : ${this.fromDate}`, this.loggerContext);\n log.info(`Call history sort type : ${sortParam}`, this.loggerContext);\n log.info(`Call history sortby type : ${sortByParam}`, this.loggerContext);\n const url = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}${FROM_DATE}=${this.fromDate}&limit=${limit}&includeNewSessionTypes=true&sort=${sortParam}`;\n try {\n const janusResponse = await this.webex.request({\n uri: `${url}`,\n method: HTTP_METHODS.GET,\n service: ALLOWED_SERVICES.JANUS,\n });\n this.userSessions = janusResponse.body;\n if (sortByParam === SORT_BY.START_TIME) {\n if (sortParam === SORT.DESC) {\n this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(compareElement[sortByParam]).getTime() -\n new Date(element[sortByParam]).getTime());\n }\n else if (sortParam === SORT.ASC) {\n this.userSessions[USER_SESSIONS].sort((element, compareElement) => new Date(element[sortByParam]).getTime() -\n new Date(compareElement[sortByParam]).getTime());\n }\n }\n const callingBackend = getCallingBackEnd(this.webex);\n if (callingBackend === CALLING_BACKEND.UCM) {\n if (this.userSessions[USER_SESSIONS] && this.userSessions[USER_SESSIONS].length > 0) {\n const hasCucmDN = this.userSessions[USER_SESSIONS].some((session) => session.self.cucmDN && session.self.cucmDN.length > 0);\n if (hasCucmDN) {\n const ucmLinesResponse = await this.fetchUCMLinesData();\n if (ucmLinesResponse.statusCode === 200 && ucmLinesResponse.data.lines?.devices) {\n const ucmLinesData = ucmLinesResponse.data.lines.devices;\n this.userSessions[USER_SESSIONS].forEach((session) => {\n const cucmDN = session.self.cucmDN;\n if (cucmDN) {\n ucmLinesData.forEach((device) => {\n device.lines.forEach((line) => {\n if (line.dnorpattern === cucmDN) {\n session.self.ucmLineNumber = line.index;\n }\n });\n });\n }\n });\n }\n }\n }\n }\n const responseDetails = {\n statusCode: this.userSessions[STATUS_CODE],\n data: {\n userSessions: this.userSessions[USER_SESSIONS],\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, this.loggerContext);\n return errorStatus;\n }\n }\n async updateMissedCalls(endTimeSessionIds) {\n const loggerContext = {\n file: CALL_HISTORY_FILE,\n method: 'updateMissedCalls',\n };\n const santizedSessionIds = endTimeSessionIds.map((session) => ({\n ...session,\n endTime: new Date(session.endTime).getTime(),\n }));\n const requestBody = {\n endTimeSessionIds: santizedSessionIds,\n };\n try {\n const updateMissedCallContentUrl = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}/${UPDATE_MISSED_CALLS_ENDPOINT}`;\n const response = await fetch(updateMissedCallContentUrl, {\n method: HTTP_METHODS.POST,\n headers: {\n [CONTENT_TYPE]: APPLICATION_JSON,\n Authorization: await this.webex.credentials.getUserToken(),\n },\n body: JSON.stringify(requestBody),\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const data = await response.json();\n log.info(`Missed calls are succesfully read by the user`, loggerContext);\n const responseDetails = {\n statusCode: data.statusCode,\n data: {\n readStatusMessage: SET_READ_STATE_SUCCESS_MESSAGE,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async fetchUCMLinesData() {\n const loggerContext = {\n file: CALL_HISTORY_FILE,\n method: 'fetchLinesData',\n };\n const vgEndpoint = getVgActionEndpoint(this.webex, CALLING_BACKEND.UCM);\n const userId = this.webex.internal.device.userId;\n const orgId = this.webex.internal.device.orgId;\n const linesURIForUCM = `${vgEndpoint}/${VERSION_1}/${UNIFIED_COMMUNICATIONS}/${CONFIG}/${PEOPLE}/${userId}/${LINES}?${ORG_ID}=${orgId}`;\n try {\n const response = await this.webex.request({\n uri: `${linesURIForUCM}`,\n method: HTTP_METHODS.GET,\n });\n const ucmLineDetails = {\n statusCode: Number(response.statusCode),\n data: {\n lines: response.body,\n },\n message: SUCCESS_MESSAGE,\n };\n log.info(`Line details fetched successfully`, loggerContext);\n return ucmLineDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteCallHistoryRecords(deleteSessionIds) {\n const loggerContext = {\n file: CALL_HISTORY_FILE,\n method: 'deleteCallHistoryRecords',\n };\n const invalidSessions = deleteSessionIds.filter((session) => Number.isNaN(new Date(session.endTime).getTime()));\n if (invalidSessions.length > 0) {\n const invalidSessionIds = invalidSessions.map((session) => session.sessionId).join(', ');\n log.info(`The provided date is malformed or invalid for session IDs: ${invalidSessionIds}`, loggerContext);\n return {\n statusCode: 400,\n data: {\n deleteStatusMessage: SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE,\n },\n message: FAILURE_MESSAGE,\n };\n }\n const santizedSessionIds = deleteSessionIds.map((session) => ({\n ...session,\n endTime: new Date(session.endTime).getTime(),\n }));\n const deleteRequestBody = {\n deleteSessionIds: santizedSessionIds,\n };\n try {\n const deleteCallHistoryRecordContentUrl = `${this.janusUrl}/${HISTORY}/${USER_SESSIONS}/${DELETE_CALL_HISTORY_RECORDS_ENDPOINT}`;\n const response = await fetch(deleteCallHistoryRecordContentUrl, {\n method: HTTP_METHODS.POST,\n headers: {\n [CONTENT_TYPE]: APPLICATION_JSON,\n Authorization: await this.webex.credentials.getUserToken(),\n },\n body: JSON.stringify(deleteRequestBody),\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const data = await response.json();\n log.info(`Call history records are succesfully deleted by the user`, loggerContext);\n const responseDetails = {\n statusCode: data.statusCode,\n data: {\n deleteStatusMessage: SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n handleSessionEvents = async (event) => {\n if (event && event.data.userSessions.userSessions) {\n this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSION_INFO, event);\n }\n };\n handleUserReadSessionEvents = async (event) => {\n if (event && event.data.userReadSessions.userReadSessions) {\n this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_VIEWED_SESSIONS, event);\n }\n };\n handleUserSessionsDeletedEvents = async (event) => {\n if (event && event.data.deletedSessions) {\n this.emit(COMMON_EVENT_KEYS.CALL_HISTORY_USER_SESSIONS_DELETED, event);\n }\n };\n registerSessionsListener() {\n this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, this.handleSessionEvents);\n this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_LEGACY, this.handleSessionEvents);\n this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_VIEWED, this.handleUserReadSessionEvents);\n this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_DELETED, this.handleUserSessionsDeletedEvents);\n }\n}\nexport const createCallHistoryClient = (webex, logger) => new CallHistory(webex, logger);\n","export const APPLICATION_JSON = 'application/json';\nexport const CALL_HISTORY_FILE = 'CallHistory';\nexport const CONTENT_TYPE = 'Content-Type';\nexport const CONFIG = 'config';\nexport const DELETE_CALL_HISTORY_RECORDS_ENDPOINT = 'markAsDeleted';\nexport const FROM_DATE = '?from';\nexport const HISTORY = 'history';\nexport const LIMIT = 50;\nexport const LINES = 'lines';\nexport const NUMBER_OF_DAYS = 10;\nexport const ORG_ID = 'orgId';\nexport const PEOPLE = 'people';\nexport const RESPONSE_MESSAGE = 'responseMessage';\nexport const SET_READ_STATE_SUCCESS_MESSAGE = 'Missed calls are read by the user.';\nexport const SET_DELETE_CALL_RECORDS_SUCCESS_MESSAGE = 'Call history records are deleted by the user.';\nexport const SET_DELETE_CALL_RECORDS_INVALID_DATE_FORMAT_MESSAGE = 'The provided date is malformed or invalid';\nexport const SUCCESS_MESSAGE = 'SUCCESS';\nexport const STATUS_CODE = 'statusCode';\nexport const USER_SESSIONS = 'userSessions';\nexport const UPDATE_MISSED_CALLS_ENDPOINT = 'setReadState';\nexport const UNIFIED_COMMUNICATIONS = 'uc';\nexport const VERSION_1 = 'v1';\n","import { getCallingBackEnd } from '../common/Utils';\nimport SDKConnector from '../SDKConnector';\nimport log from '../Logger';\nimport { CALLING_BACKEND } from '../common/types';\nimport { WxCallBackendConnector } from './WxCallBackendConnector';\nimport { CALL_SETTINGS_FILE } from './constants';\nimport { UcmBackendConnector } from './UcmBackendConnector';\nexport class CallSettings {\n sdkConnector;\n webex;\n callingBackend;\n backendConnector;\n constructor(webex, logger, useProdWebexApis) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n log.setLogger(logger.level, CALL_SETTINGS_FILE);\n this.webex = this.sdkConnector.getWebex();\n this.initializeBackendConnector(logger, useProdWebexApis);\n }\n initializeBackendConnector(logger, useProdWebexApis) {\n this.callingBackend = getCallingBackEnd(this.webex);\n log.info(`Initializing Connector for ${this.callingBackend} backend`, {\n file: CALL_SETTINGS_FILE,\n method: this.initializeBackendConnector.name,\n });\n switch (this.callingBackend) {\n case CALLING_BACKEND.BWRKS:\n case CALLING_BACKEND.WXC:\n this.backendConnector = new WxCallBackendConnector(this.webex, logger);\n break;\n case CALLING_BACKEND.UCM:\n this.backendConnector = new UcmBackendConnector(this.webex, logger, useProdWebexApis);\n break;\n default:\n throw new Error('Calling backend is not identified, exiting....');\n }\n }\n async getCallWaitingSetting() {\n return this.backendConnector.getCallWaitingSetting();\n }\n async getDoNotDisturbSetting() {\n return this.backendConnector.getDoNotDisturbSetting();\n }\n async setDoNotDisturbSetting(enabled) {\n return this.backendConnector.setDoNotDisturbSetting(enabled);\n }\n async getCallForwardSetting() {\n return this.backendConnector.getCallForwardSetting();\n }\n async setCallForwardSetting(callForwardingRequest) {\n return this.backendConnector.setCallForwardSetting(callForwardingRequest);\n }\n async getVoicemailSetting() {\n return this.backendConnector.getVoicemailSetting();\n }\n async setVoicemailSetting(voicemailRequest) {\n return this.backendConnector.setVoicemailSetting(voicemailRequest);\n }\n async getCallForwardAlwaysSetting(directoryNumber) {\n return this.backendConnector.getCallForwardAlwaysSetting(directoryNumber);\n }\n}\nexport const createCallSettingsClient = (webex, logger, useProdWebexApis) => new CallSettings(webex, logger, useProdWebexApis);\n","import log from '../Logger';\nimport SDKConnector from '../SDKConnector';\nimport { serviceErrorCodeHandler } from '../common/Utils';\nimport { FAILURE_MESSAGE, STATUS_CODE, SUCCESS_MESSAGE, UCM_CONNECTOR_FILE, VOICEMAIL, WEBEX_API_CONFIG_INT_URL, WEBEX_API_CONFIG_PROD_URL, } from '../common/constants';\nimport { HTTP_METHODS } from '../common/types';\nimport { CF_ENDPOINT, ORG_ENDPOINT, PEOPLE_ENDPOINT } from './constants';\nexport class UcmBackendConnector {\n sdkConnector;\n webex;\n userId;\n orgId;\n useProdWebexApis;\n constructor(webex, logger, useProdWebexApis = true) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n log.setLogger(logger.level, UCM_CONNECTOR_FILE);\n this.userId = this.webex.internal.device.userId;\n this.orgId = this.webex.internal.device.orgId;\n this.useProdWebexApis = useProdWebexApis;\n }\n getCallWaitingSetting() {\n return this.getMethodNotSupportedResponse();\n }\n getDoNotDisturbSetting() {\n return this.getMethodNotSupportedResponse();\n }\n setDoNotDisturbSetting() {\n return this.getMethodNotSupportedResponse();\n }\n getCallForwardSetting() {\n return this.getMethodNotSupportedResponse();\n }\n setCallForwardSetting() {\n return this.getMethodNotSupportedResponse();\n }\n getVoicemailSetting() {\n return this.getMethodNotSupportedResponse();\n }\n setVoicemailSetting() {\n return this.getMethodNotSupportedResponse();\n }\n getMethodNotSupportedResponse() {\n const response = serviceErrorCodeHandler({ statusCode: 501 }, { file: UCM_CONNECTOR_FILE, method: this.getMethodNotSupportedResponse.name });\n return Promise.resolve(response);\n }\n async getCallForwardAlwaysSetting(directoryNumber) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: this.getCallForwardAlwaysSetting.name,\n };\n const webexApisUrl = this.useProdWebexApis\n ? WEBEX_API_CONFIG_PROD_URL\n : WEBEX_API_CONFIG_INT_URL;\n try {\n if (directoryNumber) {\n const resp = await this.webex.request({\n uri: `${webexApisUrl}/${PEOPLE_ENDPOINT}/${this.userId}/${CF_ENDPOINT.toLowerCase()}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.GET,\n });\n const { callForwarding } = resp.body;\n const cfa = callForwarding.always.find((item) => item.dn.endsWith(directoryNumber) || item.e164Number.endsWith(directoryNumber));\n if (cfa) {\n const response = {\n statusCode: Number(resp[STATUS_CODE]),\n message: SUCCESS_MESSAGE,\n data: {\n callSetting: {\n enabled: cfa.destinationVoicemailEnabled || !!cfa.destination,\n destination: cfa.destinationVoicemailEnabled ? VOICEMAIL : cfa.destination,\n },\n },\n };\n return response;\n }\n const response = {\n statusCode: 404,\n message: FAILURE_MESSAGE,\n data: {\n error: 'Directory Number is not assigned to the user',\n },\n };\n return response;\n }\n const response = {\n statusCode: 400,\n message: FAILURE_MESSAGE,\n data: {\n error: 'Directory Number is mandatory for UCM backend',\n },\n };\n return response;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n}\n","import SDKConnector from '../SDKConnector';\nimport log from '../Logger';\nimport { HTTP_METHODS, DecodeType, CALLING_BACKEND } from '../common/types';\nimport { SERVICES_ENDPOINT, STATUS_CODE, SUCCESS_MESSAGE, XML_TYPE, WEBEX_CALLING_CONNECTOR_FILE, } from '../common/constants';\nimport { CALL_SETTINGS_FILE, CALL_WAITING_ENDPOINT, CF_ENDPOINT, DND_ENDPOINT, ORG_ENDPOINT, PEOPLE_ENDPOINT, USER_ENDPOINT, VM_ENDPOINT, XSI_VERSION, } from './constants';\nimport { getXsiActionEndpoint, inferIdFromUuid, serviceErrorCodeHandler } from '../common/Utils';\nexport class WxCallBackendConnector {\n sdkConnector;\n webex;\n userId;\n personId;\n orgId;\n xsiEndpoint;\n hydraEndpoint;\n VOICEMAIL = 'VOICEMAIL';\n constructor(webex, logger) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.hydraEndpoint = this.webex.internal.services._serviceUrls.hydra;\n log.setLogger(logger.level, WEBEX_CALLING_CONNECTOR_FILE);\n this.userId = this.webex.internal.device.userId;\n this.personId = inferIdFromUuid(this.webex.internal.device.userId, DecodeType.PEOPLE);\n this.orgId = inferIdFromUuid(this.webex.internal.device.orgId, DecodeType.ORGANIZATION);\n }\n async getCallWaitingSetting() {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'getCallWaitingSetting',\n };\n try {\n if (!this.xsiEndpoint) {\n this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.WXC);\n log.info(`xsiEndpoint: ${this.xsiEndpoint}`, loggerContext);\n }\n const callWaitingUrl = `${this.xsiEndpoint}/${XSI_VERSION}/${USER_ENDPOINT}/${this.userId}/${SERVICES_ENDPOINT}/${CALL_WAITING_ENDPOINT}`;\n const response = await fetch(`${callWaitingUrl}`, {\n method: HTTP_METHODS.GET,\n headers: {\n Authorization: await this.webex.credentials.getUserToken(),\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const xmlData = await response.text();\n const parser = new DOMParser();\n const xmlDOM = parser.parseFromString(xmlData, XML_TYPE);\n const callWaitingDetails = xmlDOM.getElementsByTagName('active');\n const status = callWaitingDetails[0].childNodes[0].textContent;\n const toggleSetting = {\n enabled: status === 'true',\n };\n const responseDetails = {\n statusCode: 200,\n data: {\n callSetting: toggleSetting,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getDoNotDisturbSetting() {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'getDoNotDisturbSetting',\n };\n try {\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.GET,\n });\n const dndSettingResponse = resp.body;\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: dndSettingResponse,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async setDoNotDisturbSetting(enabled) {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'setDoNotDisturbSetting',\n };\n try {\n const dndRequestBody = {\n enabled,\n ringSplashEnabled: false,\n };\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${DND_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.PUT,\n body: dndRequestBody,\n });\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: dndRequestBody,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getCallForwardSetting() {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'getCallForwardingSetting',\n };\n try {\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.GET,\n });\n const cfResponse = resp.body;\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: cfResponse,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async setCallForwardSetting(callForwardingRequest) {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'setCallForwardingSetting',\n };\n try {\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${CF_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.PUT,\n body: callForwardingRequest,\n });\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: callForwardingRequest,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVoicemailSetting() {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'getVoicemailSetting',\n };\n try {\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.GET,\n });\n const vmResponse = resp.body;\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: vmResponse,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async setVoicemailSetting(voicemailRequest) {\n const loggerContext = {\n file: CALL_SETTINGS_FILE,\n method: 'setVoicemailSetting',\n };\n try {\n const resp = await this.webex.request({\n uri: `${this.hydraEndpoint}/${PEOPLE_ENDPOINT}/${this.personId}/${VM_ENDPOINT}?${ORG_ENDPOINT}=${this.orgId}`,\n method: HTTP_METHODS.PUT,\n body: voicemailRequest,\n });\n const responseDetails = {\n statusCode: Number(resp[STATUS_CODE]),\n data: {\n callSetting: voicemailRequest,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getCallForwardAlwaysSetting() {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: this.getCallForwardAlwaysSetting.name,\n };\n const cfResponse = await this.getCallForwardSetting();\n if (cfResponse.statusCode === 200) {\n const cfa = cfResponse.data.callSetting.callForwarding.always;\n if (cfa.enabled) {\n if (cfa.destination) {\n const response = {\n ...cfResponse,\n data: {\n callSetting: cfa,\n },\n };\n return response;\n }\n log.warn(`CFA is enabled, but destination is not set`, loggerContext);\n }\n const vmResponse = await this.getVoicemailSetting();\n if (vmResponse.statusCode === 200) {\n const vm = vmResponse.data.callSetting;\n if (vm.enabled && vm.sendAllCalls.enabled) {\n const response = {\n ...cfResponse,\n data: {\n callSetting: {\n ...cfa,\n enabled: true,\n destination: this.VOICEMAIL,\n },\n },\n };\n return response;\n }\n const response = {\n ...cfResponse,\n data: {\n callSetting: {\n ...cfa,\n enabled: false,\n destination: undefined,\n },\n },\n };\n return response;\n }\n log.warn(`Unable to retrieve voicemail settings.`, loggerContext);\n vmResponse.data.error = 'Unable to retrieve voicemail settings.';\n return vmResponse;\n }\n return cfResponse;\n }\n}\n","export const CALL_SETTINGS_FILE = 'CallSettings';\nexport const PEOPLE_ENDPOINT = 'people';\nexport const USER_ENDPOINT = 'user';\nexport const ORG_ENDPOINT = 'orgId';\nexport const DND_ENDPOINT = 'features/doNotDisturb';\nexport const CF_ENDPOINT = 'features/callForwarding';\nexport const VM_ENDPOINT = 'features/voicemail';\nexport const CALL_WAITING_ENDPOINT = 'CallWaiting';\nexport const XSI_VERSION = 'v2.0';\n","import * as Media from '@webex/internal-media-core';\nimport { Mutex } from 'async-mutex';\nimport { v4 as uuid } from 'uuid';\nimport { filterMobiusUris, handleCallingClientErrors, uploadLogs, validateServiceData, } from '../common/Utils';\nimport { LOGGER } from '../Logger/types';\nimport SDKConnector from '../SDKConnector';\nimport { Eventing } from '../Events/impl';\nimport { MOBIUS_EVENT_KEYS, SessionType, CALLING_CLIENT_EVENT_KEYS, } from '../Events/types';\nimport { ServiceIndicator, ALLOWED_SERVICES, HTTP_METHODS, RegistrationStatus, } from '../common/types';\nimport log from '../Logger';\nimport { getCallManager } from './calling/callManager';\nimport { CALLING_CLIENT_FILE, CALLS_CLEARED_HANDLER_UTIL, CALLING_USER_AGENT, CISCO_DEVICE_URL, DISCOVERY_URL, GET_MOBIUS_SERVERS_UTIL, IP_ENDPOINT, SPARK_USER_AGENT, URL_ENDPOINT, NETWORK_FLAP_TIMEOUT, API_V1, MOBIUS_US_PROD, MOBIUS_EU_PROD, MOBIUS_US_INT, MOBIUS_EU_INT, } from './constants';\nimport Line from './line';\nimport { METRIC_EVENT, REG_ACTION, METRIC_TYPE } from '../Metrics/types';\nimport { getMetricManager } from '../Metrics';\nexport class CallingClient extends Eventing {\n sdkConnector;\n webex;\n mutex;\n callManager;\n metricManager;\n sdkConfig;\n primaryMobiusUris;\n backupMobiusUris;\n mobiusClusters;\n mobiusHost;\n mediaEngine;\n lineDict = {};\n constructor(webex, config) {\n super();\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.mutex = new Mutex();\n this.webex = this.sdkConnector.getWebex();\n this.sdkConfig = config;\n const serviceData = this.sdkConfig?.serviceData?.indicator\n ? this.sdkConfig.serviceData\n : { indicator: ServiceIndicator.CALLING, domain: '' };\n const logLevel = this.sdkConfig?.logger?.level ? this.sdkConfig.logger.level : LOGGER.ERROR;\n log.setLogger(logLevel, CALLING_CLIENT_FILE);\n validateServiceData(serviceData);\n this.callManager = getCallManager(this.webex, serviceData.indicator);\n this.metricManager = getMetricManager(this.webex, serviceData.indicator);\n this.mediaEngine = Media;\n this.primaryMobiusUris = [];\n this.backupMobiusUris = [];\n let mobiusServiceHost = '';\n try {\n mobiusServiceHost = new URL(this.webex.internal.services._serviceUrls.mobius).host;\n }\n catch (error) {\n log.warn(`Failed to parse mobius service URL`, {\n file: CALLING_CLIENT_FILE,\n method: this.constructor.name,\n });\n }\n this.mobiusClusters =\n (mobiusServiceHost && this.webex.internal.services._hostCatalog[mobiusServiceHost]) ||\n this.webex.internal.services._hostCatalog[MOBIUS_US_PROD] ||\n this.webex.internal.services._hostCatalog[MOBIUS_EU_PROD] ||\n this.webex.internal.services._hostCatalog[MOBIUS_US_INT] ||\n this.webex.internal.services._hostCatalog[MOBIUS_EU_INT];\n this.mobiusHost = '';\n this.registerSessionsListener();\n this.registerCallsClearedListener();\n }\n async init() {\n await this.getMobiusServers();\n await this.createLine();\n this.detectNetworkChange();\n }\n async detectNetworkChange() {\n let retry = false;\n const line = Object.values(this.lineDict)[0];\n setInterval(async () => {\n if (!this.webex.internal.mercury.connected &&\n !retry &&\n !Object.keys(this.callManager.getActiveCalls()).length) {\n log.warn(`Network has flapped, waiting for mercury connection to be up`, {\n file: CALLING_CLIENT_FILE,\n method: this.detectNetworkChange.name,\n });\n line.registration.clearKeepaliveTimer();\n retry = true;\n }\n if (retry && this.webex.internal.mercury.connected) {\n if (line.getStatus() !== RegistrationStatus.IDLE) {\n retry = await line.registration.handleConnectionRestoration(retry);\n }\n else {\n retry = false;\n }\n }\n }, NETWORK_FLAP_TIMEOUT);\n }\n async getClientRegionInfo() {\n const regionInfo = {};\n for (const mobius of this.mobiusClusters) {\n this.mobiusHost = `https://${mobius.host}${API_V1}`;\n try {\n const temp = await this.webex.request({\n uri: `${this.mobiusHost}${URL_ENDPOINT}${IP_ENDPOINT}`,\n method: HTTP_METHODS.GET,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n service: ALLOWED_SERVICES.MOBIUS,\n });\n const myIP = temp.body.ipv4;\n const response = await this.webex.request({\n uri: `${DISCOVERY_URL}/${myIP}`,\n method: HTTP_METHODS.GET,\n addAuthHeader: false,\n headers: {\n [SPARK_USER_AGENT]: null,\n },\n });\n const clientRegionInfo = response.body;\n regionInfo.clientRegion = clientRegionInfo?.clientRegion\n ? clientRegionInfo.clientRegion\n : '';\n regionInfo.countryCode = clientRegionInfo?.countryCode ? clientRegionInfo.countryCode : '';\n break;\n }\n catch (err) {\n handleCallingClientErrors(err, (clientError) => {\n this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, clientError);\n this.emit(CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);\n }, { method: GET_MOBIUS_SERVERS_UTIL, file: CALLING_CLIENT_FILE });\n regionInfo.clientRegion = '';\n regionInfo.countryCode = '';\n }\n }\n return regionInfo;\n }\n async getMobiusServers() {\n let useDefault = false;\n let clientRegion;\n let countryCode;\n if (this.sdkConfig?.discovery?.country && this.sdkConfig?.discovery?.region) {\n log.info('Updating region and country from the SDK config', {\n file: CALLING_CLIENT_FILE,\n method: GET_MOBIUS_SERVERS_UTIL,\n });\n clientRegion = this.sdkConfig?.discovery?.region;\n countryCode = this.sdkConfig?.discovery?.country;\n this.mobiusHost = this.webex.internal.services._serviceUrls.mobius;\n }\n else {\n log.info('Updating region and country through Region discovery', {\n file: CALLING_CLIENT_FILE,\n method: GET_MOBIUS_SERVERS_UTIL,\n });\n const regionInfo = await this.getClientRegionInfo();\n clientRegion = regionInfo.clientRegion;\n countryCode = regionInfo.countryCode;\n }\n if (clientRegion && countryCode) {\n log.log(`Found Region: ${clientRegion} and country: ${countryCode}, going to fetch Mobius server`, '');\n try {\n const temp = await this.webex.request({\n uri: `${this.mobiusHost}${URL_ENDPOINT}?regionCode=${clientRegion}&countryCode=${countryCode}`,\n method: HTTP_METHODS.GET,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n service: ALLOWED_SERVICES.MOBIUS,\n });\n log.log('Mobius Server found for the region', '');\n const mobiusServers = temp.body;\n const mobiusUris = filterMobiusUris(mobiusServers, this.mobiusHost);\n this.primaryMobiusUris = mobiusUris.primary;\n this.backupMobiusUris = mobiusUris.backup;\n log.info(`Final list of Mobius Servers, primary: ${mobiusUris.primary} and backup: ${mobiusUris.backup}`, '');\n }\n catch (err) {\n handleCallingClientErrors(err, (clientError) => {\n this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, clientError);\n this.emit(CALLING_CLIENT_EVENT_KEYS.ERROR, clientError);\n }, { method: GET_MOBIUS_SERVERS_UTIL, file: CALLING_CLIENT_FILE });\n useDefault = true;\n }\n }\n else {\n useDefault = true;\n }\n if (useDefault) {\n log.warn(`Couldn't resolve the region and country code. Defaulting to the catalog entries to discover mobius servers`, '');\n this.mobiusHost = `https://${this.mobiusClusters[0].host}${API_V1}`;\n this.primaryMobiusUris = [`${this.mobiusHost}${URL_ENDPOINT}`];\n }\n }\n registerCallsClearedListener() {\n const logContext = {\n file: CALLING_CLIENT_FILE,\n method: this.registerCallsClearedListener.name,\n };\n log.log('Registering listener for all calls cleared event', logContext);\n this.callManager.on(CALLING_CLIENT_EVENT_KEYS.ALL_CALLS_CLEARED, this.callsClearedHandler);\n }\n callsClearedHandler = async () => {\n const { registration } = Object.values(this.lineDict)[0];\n if (!registration.isDeviceRegistered()) {\n await this.mutex.runExclusive(async () => {\n if (registration.isReconnectPending()) {\n log.log('All calls cleared, reconnecting', {\n file: CALLING_CLIENT_FILE,\n method: CALLS_CLEARED_HANDLER_UTIL,\n });\n await registration.reconnectOnFailure(CALLS_CLEARED_HANDLER_UTIL);\n }\n });\n }\n };\n getLoggingLevel() {\n return log.getLogLevel();\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n registerSessionsListener() {\n this.sdkConnector.registerListener(MOBIUS_EVENT_KEYS.CALL_SESSION_EVENT_INCLUSIVE, async (event) => {\n if (event && event.data.userSessions.userSessions) {\n const sessionArr = event?.data.userSessions.userSessions;\n if (sessionArr.length === 1) {\n if (sessionArr[0].sessionType !== SessionType.WEBEX_CALLING) {\n return;\n }\n }\n for (let i = 0; i < sessionArr.length; i += 1) {\n if (sessionArr[i].sessionType !== SessionType.WEBEX_CALLING) {\n sessionArr.splice(i, 1);\n }\n }\n this.emit(CALLING_CLIENT_EVENT_KEYS.USER_SESSION_INFO, event);\n }\n });\n }\n async createLine() {\n const line = new Line(this.webex.internal.device.userId, this.webex.internal.device.url, this.mutex, this.primaryMobiusUris, this.backupMobiusUris, this.getLoggingLevel(), this.sdkConfig?.serviceData, this.sdkConfig?.jwe);\n this.lineDict[line.lineId] = line;\n }\n getLines() {\n return this.lineDict;\n }\n getActiveCalls() {\n const activeCalls = {};\n const calls = this.callManager.getActiveCalls();\n Object.keys(calls).forEach((correlationId) => {\n const call = calls[correlationId];\n if (!activeCalls[call.lineId]) {\n activeCalls[call.lineId] = [];\n }\n activeCalls[call.lineId].push(call);\n });\n return activeCalls;\n }\n getConnectedCall() {\n let connectCall;\n const calls = this.callManager.getActiveCalls();\n Object.keys(calls).forEach((correlationId) => {\n if (calls[correlationId].isConnected() && !calls[correlationId].isHeld()) {\n connectCall = calls[correlationId];\n }\n });\n return connectCall;\n }\n async uploadLogs(data = {}) {\n if (!data.feedbackId) {\n data = { ...data, feedbackId: uuid() };\n }\n return uploadLogs(this.webex, data);\n }\n}\nexport const createClient = async (webex, config) => {\n const callingClientInstance = new CallingClient(webex, config);\n await callingClientInstance.init();\n return callingClientInstance;\n};\n","import log from '../../../Logger/index';\nimport { CALLER_ID_FILE, VALID_PHONE_REGEX } from '../../constants';\nimport SDKConnector from '../../../SDKConnector';\nimport { resolveCallerIdDisplay } from '../../../common';\nexport class CallerId {\n webex;\n callerInfo;\n sdkConnector;\n emitter;\n constructor(webex, emitter) {\n this.sdkConnector = SDKConnector;\n this.callerInfo = {};\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.emitter = emitter;\n }\n async resolveCallerId(filter) {\n const displayResult = (await resolveCallerIdDisplay(filter));\n let isChanged = false;\n if (displayResult.name && this.callerInfo.name !== displayResult.name) {\n log.info('Updating Name after resolution', {\n file: CALLER_ID_FILE,\n method: 'resolveCallerId',\n });\n this.callerInfo.name = displayResult.name;\n isChanged = true;\n }\n if (displayResult.num && this.callerInfo.num !== displayResult.num) {\n log.info('Updating Number after resolution', {\n file: CALLER_ID_FILE,\n method: 'resolveCallerId',\n });\n this.callerInfo.num = displayResult.num;\n isChanged = true;\n }\n if (!this.callerInfo.avatarSrc || this.callerInfo.avatarSrc !== displayResult.avatarSrc) {\n log.info('Updating Avatar Id after resolution', {\n file: CALLER_ID_FILE,\n method: 'resolveCallerId',\n });\n this.callerInfo.avatarSrc = displayResult.avatarSrc;\n isChanged = true;\n }\n if (!this.callerInfo.id || this.callerInfo.id !== displayResult.id) {\n log.info('Updating User Id after resolution', {\n file: CALLER_ID_FILE,\n method: 'resolveCallerId',\n });\n this.callerInfo.id = displayResult.id;\n isChanged = true;\n }\n if (isChanged) {\n this.emitter(this.callerInfo);\n }\n }\n async parseRemotePartyInfo(data) {\n const lastToken = data.split(';').slice(-1)[0];\n if (lastToken.includes('externalId')) {\n const externalId = lastToken.split('=')[1];\n log.info(`externalId retrieved: ${externalId}`, {\n file: CALLER_ID_FILE,\n method: 'parseRemotePartyInfo',\n });\n this.resolveCallerId(`id eq \"${externalId}\"`);\n }\n else {\n log.warn(`externalId not found!`, {\n file: CALLER_ID_FILE,\n method: 'parseRemotePartyInfo',\n });\n }\n }\n parseSipUri(paid) {\n const result = {};\n const nameMatch = paid.split('<')[0].replace(/\"/g, '');\n if (nameMatch) {\n result.name = nameMatch.trim();\n }\n else {\n log.warn(`Name field not found!`, {\n file: CALLER_ID_FILE,\n method: 'parseSipUri',\n });\n }\n const data = paid.split('@')[0].replace(/\"/g, '');\n const num = data.substring(data.indexOf(':') + 1, data.length);\n const phoneMatch = num.match(VALID_PHONE_REGEX);\n if (phoneMatch && phoneMatch[0].length === num.length) {\n result.num = num;\n }\n else {\n log.warn(`Number field not found!`, {\n file: CALLER_ID_FILE,\n method: 'parseSipUri',\n });\n }\n return result;\n }\n fetchCallerDetails(callerId) {\n this.callerInfo.id = undefined;\n this.callerInfo.avatarSrc = undefined;\n this.callerInfo.name = undefined;\n this.callerInfo.num = undefined;\n if ('p-asserted-identity' in callerId) {\n log.info('Parsing p-asserted-identity within remote party information', {\n file: CALLER_ID_FILE,\n method: 'fetchCallerDetails',\n });\n const result = this.parseSipUri(callerId['p-asserted-identity']);\n this.callerInfo.name = result.name;\n this.callerInfo.num = result.num;\n }\n if (callerId.from) {\n log.info('Parsing from header within the remote party information', {\n file: CALLER_ID_FILE,\n method: 'fetchCallerDetails',\n });\n const result = this.parseSipUri(callerId.from);\n if (!this.callerInfo.name && result.name) {\n log.info('Updating name field from From header', {\n file: CALLER_ID_FILE,\n method: 'fetchCallerDetails',\n });\n this.callerInfo.name = result.name;\n }\n if (!this.callerInfo.num && result.num) {\n log.info('Updating number field from From header', {\n file: CALLER_ID_FILE,\n method: 'fetchCallerDetails',\n });\n this.callerInfo.num = result.num;\n }\n }\n if (this.callerInfo.name || this.callerInfo.num) {\n this.emitter(this.callerInfo);\n }\n if ('x-broadworks-remote-party-info' in callerId) {\n log.info('Parsing x-broadworks-remote-party-info within remote party information', {\n file: CALLER_ID_FILE,\n method: 'fetchCallerDetails',\n });\n this.parseRemotePartyInfo(callerId['x-broadworks-remote-party-info']);\n }\n return this.callerInfo;\n }\n}\nexport const createCallerId = (webex, emitterCb) => new CallerId(webex, emitterCb);\n","import { MediaConnectionEventNames, LocalStreamEventNames, RoapMediaConnection, } from '@webex/internal-media-core';\nimport { createMachine, interpret } from 'xstate';\nimport { v4 as uuid } from 'uuid';\nimport { EffectEvent } from '@webex/web-media-effects';\nimport { RtcMetrics } from '@webex/internal-plugin-metrics';\nimport { ERROR_LAYER, ERROR_TYPE } from '../../Errors/types';\nimport { handleCallErrors, modifySdpForIPv4, parseMediaQualityStatistics, serviceErrorCodeHandler, uploadLogs, } from '../../common/Utils';\nimport { ALLOWED_SERVICES, CallDirection, HTTP_METHODS, } from '../../common/types';\nimport { createCallError } from '../../Errors/catalog/CallError';\nimport { CALL_ENDPOINT_RESOURCE, CALL_FILE, CALL_HOLD_SERVICE, CALL_STATUS_RESOURCE, CALL_TRANSFER_SERVICE, CALLING_USER_AGENT, CALLS_ENDPOINT_RESOURCE, CISCO_DEVICE_URL, DEFAULT_LOCAL_CALL_ID, DEFAULT_SESSION_TIMER, DEVICES_ENDPOINT_RESOURCE, HOLD_ENDPOINT, ICE_CANDIDATES_TIMEOUT, INITIAL_SEQ_NUMBER, MEDIA_ENDPOINT_RESOURCE, NOISE_REDUCTION_EFFECT, RESUME_ENDPOINT, SPARK_USER_AGENT, SUPPLEMENTARY_SERVICES_TIMEOUT, TRANSFER_ENDPOINT, } from '../constants';\nimport SDKConnector from '../../SDKConnector';\nimport { Eventing } from '../../Events/impl';\nimport { CALL_EVENT_KEYS, MEDIA_CONNECTION_EVENT_KEYS, MOBIUS_MIDCALL_STATE, SUPPLEMENTARY_SERVICES, } from '../../Events/types';\nimport { DisconnectCause, DisconnectCode, MidCallEventType, MobiusCallState, MUTE_TYPE, RoapScenario, TransferType, } from './types';\nimport log from '../../Logger';\nimport { createCallerId } from './CallerId';\nimport { METRIC_TYPE, METRIC_EVENT, TRANSFER_ACTION } from '../../Metrics/types';\nimport { getMetricManager } from '../../Metrics';\nimport { SERVICES_ENDPOINT } from '../../common/constants';\nexport class Call extends Eventing {\n sdkConnector;\n webex;\n destination;\n direction;\n callId;\n correlationId;\n deviceId;\n lineId;\n disconnectReason;\n callStateMachine;\n mediaStateMachine;\n seq;\n mediaConnection;\n earlyMedia;\n connected;\n mediaInactivity;\n callerInfo;\n localRoapMessage;\n mobiusUrl;\n remoteRoapMessage;\n deleteCb;\n callerId;\n sessionTimer;\n supplementaryServicesTimer;\n muted;\n held;\n metricManager;\n broadworksCorrelationInfo;\n serviceIndicator;\n mediaNegotiationCompleted;\n receivedRoapOKSeq;\n localAudioStream;\n rtcMetrics;\n isMuted() {\n return this.muted;\n }\n isConnected() {\n return this.connected;\n }\n isHeld() {\n return this.held;\n }\n constructor(activeUrl, webex, direction, deviceId, lineId, deleteCb, indicator, destination) {\n super();\n this.destination = destination;\n this.direction = direction;\n this.sdkConnector = SDKConnector;\n this.deviceId = deviceId;\n this.serviceIndicator = indicator;\n this.lineId = lineId;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.metricManager = getMetricManager(this.webex, this.serviceIndicator);\n this.callId = `${DEFAULT_LOCAL_CALL_ID}_${uuid()}`;\n this.correlationId = uuid();\n this.deleteCb = deleteCb;\n this.connected = false;\n this.mediaInactivity = false;\n this.held = false;\n this.earlyMedia = false;\n this.callerInfo = {};\n this.localRoapMessage = {};\n this.mobiusUrl = activeUrl;\n this.receivedRoapOKSeq = 0;\n this.mediaNegotiationCompleted = false;\n log.info(`Webex Calling Url:- ${this.mobiusUrl}`, {\n file: CALL_FILE,\n method: 'constructor',\n });\n this.seq = INITIAL_SEQ_NUMBER;\n this.callerId = createCallerId(webex, (callerInfo) => {\n this.callerInfo = callerInfo;\n const emitObj = {\n correlationId: this.correlationId,\n callerId: this.callerInfo,\n };\n this.emit(CALL_EVENT_KEYS.CALLER_ID, emitObj);\n });\n this.remoteRoapMessage = null;\n this.disconnectReason = { code: DisconnectCode.NORMAL, cause: DisconnectCause.NORMAL };\n this.rtcMetrics = new RtcMetrics(this.webex, { callId: this.callId }, this.correlationId);\n const callMachine = createMachine({\n schema: {\n context: {},\n events: {},\n },\n id: 'call-state',\n initial: 'S_IDLE',\n context: {},\n states: {\n S_IDLE: {\n on: {\n E_RECV_CALL_SETUP: {\n target: 'S_RECV_CALL_SETUP',\n actions: ['incomingCallSetup'],\n },\n E_SEND_CALL_SETUP: {\n target: 'S_SEND_CALL_SETUP',\n actions: ['outgoingCallSetup'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_RECV_CALL_SETUP: {\n after: {\n 10000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_SEND_CALL_ALERTING: {\n target: 'S_SEND_CALL_PROGRESS',\n actions: ['outgoingCallAlerting'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_SEND_CALL_SETUP: {\n after: {\n 10000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_RECV_CALL_PROGRESS: {\n target: 'S_RECV_CALL_PROGRESS',\n actions: ['incomingCallProgress'],\n },\n E_RECV_CALL_CONNECT: {\n target: 'S_RECV_CALL_CONNECT',\n actions: ['incomingCallConnect'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_RECV_CALL_PROGRESS: {\n after: {\n 60000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_RECV_CALL_CONNECT: {\n target: 'S_RECV_CALL_CONNECT',\n actions: ['incomingCallConnect'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_RECV_CALL_PROGRESS: {\n target: 'S_RECV_CALL_PROGRESS',\n actions: ['incomingCallProgress'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_SEND_CALL_PROGRESS: {\n after: {\n 60000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_SEND_CALL_CONNECT: {\n target: 'S_SEND_CALL_CONNECT',\n actions: ['outgoingCallConnect'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_RECV_CALL_CONNECT: {\n after: {\n 10000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_CALL_ESTABLISHED: {\n target: 'S_CALL_ESTABLISHED',\n actions: ['callEstablished'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_SEND_CALL_CONNECT: {\n after: {\n 10000: {\n target: 'S_CALL_CLEARED',\n actions: ['triggerTimeout'],\n },\n },\n on: {\n E_CALL_ESTABLISHED: {\n target: 'S_CALL_ESTABLISHED',\n actions: ['callEstablished'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_CALL_HOLD: {\n on: {\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_CALL_ESTABLISHED: {\n target: 'S_CALL_ESTABLISHED',\n actions: ['callEstablished'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_CALL_RESUME: {\n on: {\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_CALL_ESTABLISHED: {\n target: 'S_CALL_ESTABLISHED',\n actions: ['callEstablished'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_CALL_ESTABLISHED: {\n on: {\n E_CALL_HOLD: {\n target: 'S_CALL_HOLD',\n actions: ['initiateCallHold'],\n },\n E_CALL_RESUME: {\n target: 'S_CALL_RESUME',\n actions: ['initiateCallResume'],\n },\n E_RECV_CALL_DISCONNECT: {\n target: 'S_RECV_CALL_DISCONNECT',\n actions: ['incomingCallDisconnect'],\n },\n E_SEND_CALL_DISCONNECT: {\n target: 'S_SEND_CALL_DISCONNECT',\n actions: ['outgoingCallDisconnect'],\n },\n E_CALL_ESTABLISHED: {\n target: 'S_CALL_ESTABLISHED',\n actions: ['callEstablished'],\n },\n E_UNKNOWN: {\n target: 'S_UNKNOWN',\n actions: ['unknownState'],\n },\n },\n },\n S_RECV_CALL_DISCONNECT: {\n on: {\n E_CALL_CLEARED: 'S_CALL_CLEARED',\n },\n },\n S_SEND_CALL_DISCONNECT: {\n on: {\n E_CALL_CLEARED: 'S_CALL_CLEARED',\n },\n },\n S_UNKNOWN: {\n on: {\n E_CALL_CLEARED: 'S_CALL_CLEARED',\n },\n },\n S_ERROR: {\n on: {\n E_CALL_CLEARED: 'S_CALL_CLEARED',\n },\n },\n S_CALL_CLEARED: {\n type: 'final',\n },\n },\n }, {\n actions: {\n incomingCallSetup: (context, event) => this.handleIncomingCallSetup(event),\n outgoingCallSetup: (context, event) => this.handleOutgoingCallSetup(event),\n incomingCallProgress: (context, event) => this.handleIncomingCallProgress(event),\n outgoingCallAlerting: (context, event) => this.handleOutgoingCallAlerting(event),\n incomingCallConnect: (context, event) => this.handleIncomingCallConnect(event),\n outgoingCallConnect: (context, event) => this.handleOutgoingCallConnect(event),\n callEstablished: (context, event) => this.handleCallEstablished(event),\n initiateCallHold: (context, event) => this.handleCallHold(event),\n initiateCallResume: (context, event) => this.handleCallResume(event),\n incomingCallDisconnect: (context, event) => this.handleIncomingCallDisconnect(event),\n outgoingCallDisconnect: (context, event) => this.handleOutgoingCallDisconnect(event),\n unknownState: (context, event) => this.handleUnknownState(event),\n triggerTimeout: () => this.handleTimeout(),\n },\n });\n const mediaMachine = createMachine({\n schema: {\n context: {},\n events: {},\n },\n id: 'roap-state',\n initial: 'S_ROAP_IDLE',\n context: {},\n states: {\n S_ROAP_IDLE: {\n on: {\n E_RECV_ROAP_OFFER_REQUEST: {\n target: 'S_RECV_ROAP_OFFER_REQUEST',\n actions: ['incomingRoapOfferRequest'],\n },\n E_RECV_ROAP_OFFER: {\n target: 'S_RECV_ROAP_OFFER',\n actions: ['incomingRoapOffer'],\n },\n E_SEND_ROAP_OFFER: {\n target: 'S_SEND_ROAP_OFFER',\n actions: ['outgoingRoapOffer'],\n },\n },\n },\n S_RECV_ROAP_OFFER_REQUEST: {\n on: {\n E_SEND_ROAP_OFFER: {\n target: 'S_SEND_ROAP_OFFER',\n actions: ['outgoingRoapOffer'],\n },\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n },\n },\n S_RECV_ROAP_OFFER: {\n on: {\n E_SEND_ROAP_ANSWER: {\n target: 'S_SEND_ROAP_ANSWER',\n actions: ['outgoingRoapAnswer'],\n },\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n },\n },\n S_SEND_ROAP_OFFER: {\n on: {\n E_RECV_ROAP_ANSWER: {\n target: 'S_RECV_ROAP_ANSWER',\n actions: ['incomingRoapAnswer'],\n },\n E_SEND_ROAP_ANSWER: {\n target: 'S_SEND_ROAP_ANSWER',\n actions: ['outgoingRoapAnswer'],\n },\n E_SEND_ROAP_OFFER: {\n target: 'S_SEND_ROAP_OFFER',\n actions: ['outgoingRoapOffer'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n },\n },\n S_RECV_ROAP_ANSWER: {\n on: {\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n },\n },\n S_SEND_ROAP_ANSWER: {\n on: {\n E_RECV_ROAP_OFFER_REQUEST: {\n target: 'S_RECV_ROAP_OFFER_REQUEST',\n actions: ['incomingRoapOfferRequest'],\n },\n E_RECV_ROAP_OFFER: {\n target: 'S_RECV_ROAP_OFFER',\n actions: ['incomingRoapOffer'],\n },\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n E_SEND_ROAP_ANSWER: {\n target: 'S_SEND_ROAP_ANSWER',\n actions: ['outgoingRoapAnswer'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n },\n },\n S_ROAP_OK: {\n on: {\n E_RECV_ROAP_OFFER_REQUEST: {\n target: 'S_RECV_ROAP_OFFER_REQUEST',\n actions: ['incomingRoapOfferRequest'],\n },\n E_RECV_ROAP_OFFER: {\n target: 'S_RECV_ROAP_OFFER',\n actions: ['incomingRoapOffer'],\n },\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n E_SEND_ROAP_OFFER: {\n target: 'S_SEND_ROAP_OFFER',\n actions: ['outgoingRoapOffer'],\n },\n E_ROAP_ERROR: {\n target: 'S_ROAP_ERROR',\n actions: ['roapError'],\n },\n E_ROAP_TEARDOWN: {\n target: 'S_ROAP_TEARDOWN',\n },\n },\n },\n S_ROAP_ERROR: {\n on: {\n E_ROAP_TEARDOWN: {\n target: 'S_ROAP_TEARDOWN',\n },\n E_RECV_ROAP_OFFER_REQUEST: {\n target: 'S_RECV_ROAP_OFFER_REQUEST',\n actions: ['incomingRoapOfferRequest'],\n },\n E_RECV_ROAP_OFFER: {\n target: 'S_RECV_ROAP_OFFER',\n actions: ['incomingRoapOffer'],\n },\n E_RECV_ROAP_ANSWER: {\n target: 'S_RECV_ROAP_ANSWER',\n actions: ['incomingRoapAnswer'],\n },\n E_ROAP_OK: {\n target: 'S_ROAP_OK',\n actions: ['roapEstablished'],\n },\n },\n },\n S_ROAP_TEARDOWN: {\n type: 'final',\n },\n },\n }, {\n actions: {\n incomingRoapOffer: (context, event) => this.handleIncomingRoapOffer(context, event),\n incomingRoapAnswer: (context, event) => this.handleIncomingRoapAnswer(context, event),\n incomingRoapOfferRequest: (context, event) => this.handleIncomingRoapOfferRequest(context, event),\n outgoingRoapOffer: (context, event) => this.handleOutgoingRoapOffer(context, event),\n outgoingRoapAnswer: (context, event) => this.handleOutgoingRoapAnswer(context, event),\n roapEstablished: (context, event) => this.handleRoapEstablished(context, event),\n roapError: (context, event) => this.handleRoapError(context, event),\n },\n });\n this.callStateMachine = interpret(callMachine)\n .onTransition((state, event) => {\n log.log(`Call StateMachine:- state=${state.value}, event=${JSON.stringify(event.type)}`, {});\n if (state.value !== 'S_UNKNOWN') {\n this.metricManager.submitCallMetric(METRIC_EVENT.CALL, state.value.toString(), METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, undefined);\n }\n })\n .start();\n this.mediaStateMachine = interpret(mediaMachine)\n .onTransition((state, event) => {\n log.log(`Media StateMachine:- state=${state.value}, event=${JSON.stringify(event.type)}`, {});\n if (state.value !== 'S_ROAP_ERROR') {\n this.metricManager.submitMediaMetric(METRIC_EVENT.MEDIA, state.value.toString(), METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, this.localRoapMessage.sdp, this.remoteRoapMessage?.sdp, undefined);\n }\n })\n .start();\n this.muted = false;\n }\n handleIncomingCallSetup(event) {\n log.info(`handleIncomingCallSetup: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleIncomingCallSetup.name,\n });\n this.sendCallStateMachineEvt({ type: 'E_SEND_CALL_ALERTING' });\n }\n async handleOutgoingCallSetup(event) {\n log.info(`handleOutgoingCallSetup: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleOutgoingCallSetup.name,\n });\n const message = event.data;\n try {\n const response = await this.post(message);\n log.log(`handleOutgoingCallSetup: Response: ${JSON.stringify(response)}`, {\n file: CALL_FILE,\n method: this.handleOutgoingCallSetup.name,\n });\n log.log(`handleOutgoingCallSetup: Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingCallSetup.name,\n });\n this.setCallId(response.body.callId);\n }\n catch (e) {\n log.warn('Failed to setup the call', {\n file: CALL_FILE,\n method: this.handleOutgoingCallSetup.name,\n });\n const errData = e;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n async handleCallHold(event) {\n log.info(`handleCallHold: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleCallHold.name,\n });\n try {\n const response = await this.postSSRequest(undefined, SUPPLEMENTARY_SERVICES.HOLD);\n log.log(`Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleCallHold.name,\n });\n if (this.isHeld() === false) {\n this.supplementaryServicesTimer = setTimeout(async () => {\n const errorContext = { file: CALL_FILE, method: this.handleCallHold.name };\n log.warn('Hold response timed out', {\n file: CALL_FILE,\n method: this.handleCallHold.name,\n });\n const callError = createCallError('An error occurred while placing the call on hold. Wait a moment and try again.', errorContext, ERROR_TYPE.TIMEOUT, this.getCorrelationId(), ERROR_LAYER.CALL_CONTROL);\n this.emit(CALL_EVENT_KEYS.HOLD_ERROR, callError);\n this.submitCallErrorMetric(callError);\n }, SUPPLEMENTARY_SERVICES_TIMEOUT);\n }\n }\n catch (e) {\n log.warn('Failed to put the call on hold', {\n file: CALL_FILE,\n method: this.handleCallHold.name,\n });\n const errData = e;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.HOLD_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n async handleCallResume(event) {\n log.info(`handleCallResume: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleCallResume.name,\n });\n try {\n const response = await this.postSSRequest(undefined, SUPPLEMENTARY_SERVICES.RESUME);\n log.log(`Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleCallResume.name,\n });\n if (this.isHeld() === true) {\n this.supplementaryServicesTimer = setTimeout(async () => {\n const errorContext = { file: CALL_FILE, method: this.handleCallResume.name };\n log.warn('Resume response timed out', {\n file: CALL_FILE,\n method: this.handleCallResume.name,\n });\n const callError = createCallError('An error occurred while resuming the call. Wait a moment and try again.', errorContext, ERROR_TYPE.TIMEOUT, this.getCorrelationId(), ERROR_LAYER.CALL_CONTROL);\n this.emit(CALL_EVENT_KEYS.RESUME_ERROR, callError);\n this.submitCallErrorMetric(callError);\n }, SUPPLEMENTARY_SERVICES_TIMEOUT);\n }\n }\n catch (e) {\n log.warn('Failed to resume the call', {\n file: CALL_FILE,\n method: this.handleCallResume.name,\n });\n const errData = e;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.RESUME_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallSetup.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n handleIncomingCallProgress(event) {\n log.info(`handleIncomingCallProgress: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleIncomingCallProgress.name,\n });\n const data = event.data;\n if (data?.callProgressData?.inbandMedia) {\n log.log('Inband media present. Setting Early Media flag', {\n file: CALL_FILE,\n method: this.handleIncomingCallProgress.name,\n });\n this.earlyMedia = true;\n }\n else {\n log.log('Inband media not present.', {\n file: CALL_FILE,\n method: this.handleIncomingCallProgress.name,\n });\n }\n if (data?.callerId) {\n log.info('Processing Caller-Id data', {\n file: CALL_FILE,\n method: this.handleIncomingCallProgress.name,\n });\n this.startCallerIdResolution(data.callerId);\n }\n this.emit(CALL_EVENT_KEYS.PROGRESS, this.correlationId);\n }\n handleIncomingRoapOfferRequest(context, event) {\n log.info(`handleIncomingRoapOfferRequest: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleIncomingRoapOfferRequest.name,\n });\n const message = event.data;\n if (!this.mediaConnection) {\n log.info('Media connection is not up, buffer the remote Offer Request for later handling', {\n file: CALL_FILE,\n method: this.handleIncomingRoapOfferRequest.name,\n });\n this.seq = message.seq;\n log.info(`Setting Sequence No: ${this.seq}`, {\n file: CALL_FILE,\n method: this.handleIncomingRoapOfferRequest.name,\n });\n this.remoteRoapMessage = message;\n }\n else if (this.receivedRoapOKSeq === message.seq - 2) {\n log.info('Waiting for Roap OK, buffer the remote Offer Request for later handling', {\n file: CALL_FILE,\n method: this.handleIncomingRoapOfferRequest.name,\n });\n this.remoteRoapMessage = message;\n }\n else {\n message.seq = this.seq + 1;\n this.seq = message.seq;\n this.mediaConnection.roapMessageReceived(message);\n }\n }\n async handleOutgoingCallAlerting(event) {\n log.info(`handleOutgoingCallAlerting: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleOutgoingCallAlerting.name,\n });\n try {\n const res = await this.patch(MobiusCallState.ALERTING);\n log.log(`PATCH response: ${res.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingCallAlerting.name,\n });\n }\n catch (err) {\n log.warn('Failed to signal call progression', {\n file: CALL_FILE,\n method: this.handleOutgoingCallAlerting.name,\n });\n const errData = err;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallAlerting.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n handleIncomingCallConnect(event) {\n log.info(`handleIncomingCallConnect: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleIncomingCallConnect.name,\n });\n this.emit(CALL_EVENT_KEYS.CONNECT, this.correlationId);\n if (this.earlyMedia || this.mediaNegotiationCompleted) {\n this.mediaNegotiationCompleted = false;\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED' });\n }\n }\n async handleOutgoingCallConnect(event) {\n log.info(`handleOutgoingCallConnect: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleOutgoingCallConnect.name,\n });\n if (!this.remoteRoapMessage) {\n log.warn('Offer not yet received from remote end... Exiting', {\n file: CALL_FILE,\n method: this.handleOutgoingCallConnect.name,\n });\n return;\n }\n try {\n this.mediaConnection.roapMessageReceived(this.remoteRoapMessage);\n const res = await this.patch(MobiusCallState.CONNECTED);\n log.log(`PATCH response: ${res.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingCallConnect.name,\n });\n }\n catch (err) {\n log.warn('Failed to connect the call', {\n file: CALL_FILE,\n method: this.handleOutgoingCallConnect.name,\n });\n const errData = err;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: errData });\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.handleOutgoingCallConnect.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n async handleIncomingCallDisconnect(event) {\n log.info(`handleIncomingCallDisconnect: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleIncomingCallDisconnect.name,\n });\n this.setDisconnectReason();\n try {\n const response = await this.delete();\n log.log(`handleOutgoingCallDisconnect: Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleIncomingCallDisconnect.name,\n });\n }\n catch (e) {\n log.warn('Failed to delete the call', {\n file: CALL_FILE,\n method: this.handleIncomingCallDisconnect.name,\n });\n }\n this.deleteCb(this.correlationId);\n this.unregisterListeners();\n if (this.sessionTimer) {\n clearInterval(this.sessionTimer);\n }\n if (this.mediaConnection) {\n this.mediaConnection.close();\n log.info('Closing media channel', { file: CALL_FILE, method: 'handleIncomingCallDisconnect' });\n }\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_TEARDOWN' });\n this.sendCallStateMachineEvt({ type: 'E_CALL_CLEARED' });\n this.emit(CALL_EVENT_KEYS.DISCONNECT, this.correlationId);\n }\n async handleOutgoingCallDisconnect(event) {\n this.setDisconnectReason();\n try {\n const response = await this.delete();\n log.log(`handleOutgoingCallDisconnect: Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingCallDisconnect.name,\n });\n }\n catch (e) {\n log.warn('Failed to delete the call', {\n file: CALL_FILE,\n method: this.handleOutgoingCallDisconnect.name,\n });\n }\n this.deleteCb(this.correlationId);\n this.unregisterListeners();\n if (this.sessionTimer) {\n clearInterval(this.sessionTimer);\n }\n if (this.mediaConnection) {\n this.mediaConnection.close();\n log.info('Closing media channel', { file: CALL_FILE, method: 'handleOutgoingCallDisconnect' });\n }\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_TEARDOWN' });\n this.sendCallStateMachineEvt({ type: 'E_CALL_CLEARED' });\n }\n handleCallEstablished(event) {\n log.info(`handleCallEstablished: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleCallEstablished.name,\n });\n this.emit(CALL_EVENT_KEYS.ESTABLISHED, this.correlationId);\n this.earlyMedia = false;\n this.connected = true;\n if (this.sessionTimer) {\n log.log('Resetting session timer', {\n file: CALL_FILE,\n method: 'handleCallEstablished',\n });\n clearInterval(this.sessionTimer);\n }\n this.sessionTimer = setInterval(async () => {\n try {\n const res = await this.postStatus();\n log.info(`Session refresh successful`, {\n file: CALL_FILE,\n method: 'handleCallEstablished',\n });\n }\n catch (err) {\n const error = err;\n if (this.sessionTimer) {\n clearInterval(this.sessionTimer);\n }\n handleCallErrors((callError) => {\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, callError);\n this.submitCallErrorMetric(callError);\n }, ERROR_LAYER.CALL_CONTROL, (interval) => {\n setTimeout(() => {\n this.postStatus();\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED' });\n }, interval * 1000);\n }, this.getCorrelationId(), error, this.handleCallEstablished.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }, DEFAULT_SESSION_TIMER);\n }\n async handleUnknownState(event) {\n log.info(`handleUnknownState: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: this.handleUnknownState.name,\n });\n const eventData = event.data;\n if (!eventData?.media) {\n log.warn('Call failed due to signalling issue', {\n file: CALL_FILE,\n method: this.handleUnknownState.name,\n });\n }\n try {\n this.setDisconnectReason();\n const response = await this.delete();\n log.log(`handleOutgoingCallDisconnect: Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleUnknownState.name,\n });\n }\n catch (e) {\n log.warn('Failed to delete the call', {\n file: CALL_FILE,\n method: this.handleUnknownState.name,\n });\n }\n this.deleteCb(this.correlationId);\n if (this.sessionTimer) {\n clearInterval(this.sessionTimer);\n }\n if (this.mediaConnection) {\n this.mediaConnection.close();\n log.info('Closing media channel', {\n file: CALL_FILE,\n method: this.handleUnknownState.name,\n });\n }\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_TEARDOWN' });\n this.sendCallStateMachineEvt({ type: 'E_CALL_CLEARED' });\n }\n getEmitterCallback(errData) {\n return (error) => {\n switch (this.callStateMachine.state.value) {\n case 'S_CALL_HOLD':\n this.emit(CALL_EVENT_KEYS.HOLD_ERROR, error);\n if (this.supplementaryServicesTimer) {\n clearTimeout(this.supplementaryServicesTimer);\n this.supplementaryServicesTimer = undefined;\n }\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });\n return;\n case 'S_CALL_RESUME':\n this.emit(CALL_EVENT_KEYS.RESUME_ERROR, error);\n this.submitCallErrorMetric(error);\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED', data: errData });\n return;\n default:\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);\n this.submitCallErrorMetric(error);\n if (!this.connected) {\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_ERROR', data: errData });\n }\n }\n };\n }\n async handleRoapEstablished(context, event) {\n log.info(`handleRoapEstablished: ${this.getCorrelationId()} `, {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n const { received, message } = event.data;\n this.receivedRoapOKSeq = message.seq;\n if (!received) {\n log.info('Sending Media Ok to the remote End', {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n try {\n if (this.callStateMachine.state.value === 'S_RECV_CALL_PROGRESS' ||\n this.callStateMachine.state.value === 'S_SEND_CALL_SETUP') {\n log.info('Media negotiation completed before call connect. Setting media negotiation completed flag.', {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n this.mediaNegotiationCompleted = true;\n }\n message.seq = this.seq;\n const res = await this.postMedia(message);\n log.log(`handleRoapEstablished: Response code: ${res.statusCode}`, {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n if (!this.earlyMedia && !this.mediaNegotiationCompleted) {\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED' });\n }\n }\n catch (err) {\n log.warn('Failed to process MediaOk request', {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n const errData = err;\n handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {\n if (this.connected) {\n setTimeout(() => {\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_OK', data: event.data });\n }, interval * 1000);\n }\n }, this.getCorrelationId(), errData, this.handleRoapEstablished.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n else {\n log.info('Notifying internal-media-core about ROAP OK message', {\n file: CALL_FILE,\n method: 'handleRoapEstablished',\n });\n message.seq = this.seq;\n if (this.mediaConnection) {\n this.mediaConnection.roapMessageReceived(message);\n }\n if (!this.earlyMedia) {\n this.sendCallStateMachineEvt({ type: 'E_CALL_ESTABLISHED' });\n }\n if (this.remoteRoapMessage && this.remoteRoapMessage.seq > this.seq) {\n if (this.remoteRoapMessage.messageType === 'OFFER_REQUEST') {\n this.sendMediaStateMachineEvt({\n type: 'E_RECV_ROAP_OFFER_REQUEST',\n data: this.remoteRoapMessage,\n });\n }\n else if (this.remoteRoapMessage.messageType === 'OFFER') {\n this.sendMediaStateMachineEvt({ type: 'E_RECV_ROAP_OFFER', data: this.remoteRoapMessage });\n }\n }\n }\n }\n async handleRoapError(context, event) {\n log.info(`handleRoapError: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.handleRoapError.name,\n });\n const message = event.data;\n if (message) {\n try {\n const res = await this.postMedia(message);\n log.info(`Response code: ${res.statusCode}`, {\n file: CALL_FILE,\n method: this.handleRoapError.name,\n });\n }\n catch (err) {\n log.warn('Failed to communicate ROAP error to Webex Calling', {\n file: CALL_FILE,\n method: this.handleRoapError.name,\n });\n const errData = err;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.CALL_ERROR, error);\n this.submitCallErrorMetric(error);\n }, ERROR_LAYER.MEDIA, (interval) => undefined, this.getCorrelationId(), errData, this.handleRoapError.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n if (!this.connected) {\n log.warn('Call failed due to media issue', {\n file: CALL_FILE,\n method: 'handleRoapError',\n });\n this.sendCallStateMachineEvt({ type: 'E_UNKNOWN', data: { media: true } });\n }\n }\n async handleOutgoingRoapOffer(context, event) {\n log.info(`handleOutgoingRoapOffer: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.handleOutgoingRoapOffer.name,\n });\n const message = event.data;\n if (!message?.sdp) {\n log.info('Initializing Offer...', {\n file: CALL_FILE,\n method: this.handleOutgoingRoapOffer.name,\n });\n this.mediaConnection.initiateOffer();\n return;\n }\n try {\n const res = await this.postMedia(message);\n log.log(`handleOutgoingRoapOffer: Response code: ${res.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingRoapOffer.name,\n });\n }\n catch (err) {\n log.warn('Failed to process MediaOk request', {\n file: CALL_FILE,\n method: this.handleOutgoingRoapOffer.name,\n });\n const errData = err;\n handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {\n if (this.connected) {\n setTimeout(() => {\n this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER', data: event.data });\n }, interval * 1000);\n }\n }, this.getCorrelationId(), errData, this.handleOutgoingRoapOffer.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n async handleOutgoingRoapAnswer(context, event) {\n log.info(`handleOutgoingRoapAnswer: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.handleOutgoingRoapAnswer.name,\n });\n const message = event.data;\n try {\n message.seq = this.seq;\n const res = await this.postMedia(message);\n log.log(`handleOutgoingRoapAnswer: Response code: ${res.statusCode}`, {\n file: CALL_FILE,\n method: this.handleOutgoingRoapAnswer.name,\n });\n }\n catch (err) {\n log.warn('Failed to send MediaAnswer request', {\n file: CALL_FILE,\n method: this.handleOutgoingRoapAnswer.name,\n });\n const errData = err;\n handleCallErrors(this.getEmitterCallback(errData), ERROR_LAYER.MEDIA, (interval) => {\n if (this.connected) {\n setTimeout(() => {\n this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_ANSWER', data: event.data });\n }, interval * 1000);\n }\n }, this.getCorrelationId(), errData, this.handleOutgoingRoapAnswer.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n handleIncomingRoapOffer(context, event) {\n log.info(`handleIncomingRoapOffer: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.handleIncomingRoapOffer.name,\n });\n const message = event.data;\n this.remoteRoapMessage = message;\n if (!this.mediaConnection) {\n log.info('Media connection is not up, buffer the remote offer for later handling', {\n file: CALL_FILE,\n method: this.handleIncomingRoapOffer.name,\n });\n this.seq = message.seq;\n log.info(`Setting Sequence No: ${this.seq}`, {\n file: CALL_FILE,\n method: this.handleIncomingRoapOffer.name,\n });\n }\n else if (this.receivedRoapOKSeq === message.seq - 2) {\n log.info('Waiting for Roap OK, buffer the remote offer for later handling', {\n file: CALL_FILE,\n method: this.handleIncomingRoapOffer.name,\n });\n this.remoteRoapMessage = message;\n }\n else {\n log.info('Handling new offer...', {\n file: CALL_FILE,\n method: this.handleIncomingRoapOffer.name,\n });\n this.seq = message.seq;\n if (this.mediaConnection) {\n this.mediaConnection.roapMessageReceived(message);\n }\n }\n }\n handleIncomingRoapAnswer(context, event) {\n log.info(`handleIncomingRoapAnswer: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.handleIncomingRoapAnswer.name,\n });\n const message = event.data;\n this.remoteRoapMessage = message;\n message.seq = this.seq;\n if (this.mediaConnection) {\n this.mediaConnection.roapMessageReceived(message);\n }\n }\n forceSendStatsReport = async ({ callFrom }) => {\n const loggerContext = {\n file: CALL_FILE,\n method: this.forceSendStatsReport.name,\n };\n try {\n await this.mediaConnection.forceRtcMetricsSend();\n log.info(`Successfully uploaded available webrtc telemetry statistics`, loggerContext);\n log.info(`callFrom: ${callFrom}`, loggerContext);\n }\n catch (error) {\n const errorInfo = error;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n const errorLog = new Error(`Failed to upload webrtc telemetry statistics. ${errorStatus}`);\n log.error(errorLog, loggerContext);\n }\n };\n initMediaConnection(localAudioTrack, debugId) {\n const mediaConnection = new RoapMediaConnection({\n skipInactiveTransceivers: true,\n iceServers: [],\n iceCandidatesTimeout: ICE_CANDIDATES_TIMEOUT,\n sdpMunging: {\n convertPort9to0: true,\n addContentSlides: false,\n copyClineToSessionLevel: true,\n },\n }, {\n localTracks: { audio: localAudioTrack },\n direction: {\n audio: 'sendrecv',\n video: 'inactive',\n screenShareVideo: 'inactive',\n },\n }, debugId || `WebexCallSDK-${this.correlationId}`, (data) => this.rtcMetrics.addMetrics(data), () => this.rtcMetrics.closeMetrics(), () => this.rtcMetrics.sendMetricsInQueue());\n this.mediaConnection = mediaConnection;\n }\n getDirection = () => this.direction;\n getCallId = () => this.callId;\n getCorrelationId = () => this.correlationId;\n sendCallStateMachineEvt(event) {\n this.callStateMachine.send(event);\n }\n sendMediaStateMachineEvt(event) {\n this.mediaStateMachine.send(event);\n }\n setCallId = (callId) => {\n this.callId = callId;\n this.rtcMetrics.updateCallId(callId);\n log.info(`Setting callId : ${this.callId} for correlationId: ${this.correlationId}`, {\n file: CALL_FILE,\n method: this.setCallId.name,\n });\n };\n setDisconnectReason() {\n if (this.mediaInactivity) {\n this.disconnectReason.code = DisconnectCode.MEDIA_INACTIVITY;\n this.disconnectReason.cause = DisconnectCause.MEDIA_INACTIVITY;\n }\n else if (this.connected || this.direction === CallDirection.OUTBOUND) {\n this.disconnectReason.code = DisconnectCode.NORMAL;\n this.disconnectReason.cause = DisconnectCause.NORMAL;\n }\n else {\n this.disconnectReason.code = DisconnectCode.BUSY;\n this.disconnectReason.cause = DisconnectCause.BUSY;\n }\n }\n getDisconnectReason = () => {\n return this.disconnectReason;\n };\n async answer(localAudioStream) {\n this.localAudioStream = localAudioStream;\n const localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];\n if (!localAudioTrack) {\n log.warn(`Did not find a local track while answering the call ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: 'answer',\n });\n this.mediaInactivity = true;\n this.sendCallStateMachineEvt({ type: 'E_SEND_CALL_DISCONNECT' });\n return;\n }\n localAudioTrack.enabled = true;\n if (!this.mediaConnection) {\n this.initMediaConnection(localAudioTrack);\n this.mediaRoapEventsListener();\n this.mediaTrackListener();\n this.registerListeners(localAudioStream);\n }\n if (this.callStateMachine.state.value === 'S_SEND_CALL_PROGRESS') {\n this.sendCallStateMachineEvt({ type: 'E_SEND_CALL_CONNECT' });\n }\n else {\n log.warn(`Call cannot be answered because the state is : ${this.callStateMachine.state.value}`, { file: CALL_FILE, method: 'answer' });\n }\n }\n async dial(localAudioStream) {\n this.localAudioStream = localAudioStream;\n const localAudioTrack = localAudioStream.outputStream.getAudioTracks()[0];\n if (!localAudioTrack) {\n log.warn(`Did not find a local track while dialing the call ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: 'dial',\n });\n this.deleteCb(this.getCorrelationId());\n this.emit(CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());\n return;\n }\n localAudioTrack.enabled = true;\n if (!this.mediaConnection) {\n this.initMediaConnection(localAudioTrack);\n this.mediaRoapEventsListener();\n this.mediaTrackListener();\n this.registerListeners(localAudioStream);\n }\n if (this.mediaStateMachine.state.value === 'S_ROAP_IDLE') {\n this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER' });\n }\n else {\n log.warn(`Call cannot be dialed because the state is already : ${this.mediaStateMachine.state.value}`, { file: CALL_FILE, method: 'dial' });\n }\n }\n post = async (roapMessage) => {\n const basePayload = {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n localMedia: {\n roap: roapMessage,\n mediaId: uuid(),\n },\n };\n return this.webex.request({\n uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALL_ENDPOINT_RESOURCE}`,\n method: HTTP_METHODS.POST,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: this.destination\n ? {\n ...basePayload,\n callee: {\n type: this.destination.type,\n address: this.destination.address,\n },\n }\n : basePayload,\n });\n };\n async patch(state) {\n log.info(`Send a PATCH for ${state} to Webex Calling`, {\n file: CALL_FILE,\n method: this.patch.name,\n });\n return this.webex.request({\n uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}`,\n method: HTTP_METHODS.PATCH,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n callId: this.callId,\n callState: state,\n inbandMedia: false,\n },\n });\n }\n async postSSRequest(context, type) {\n const request = {\n uri: `${this.mobiusUrl}${SERVICES_ENDPOINT}`,\n method: HTTP_METHODS.POST,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n callId: this.callId,\n },\n };\n switch (type) {\n case SUPPLEMENTARY_SERVICES.HOLD: {\n request.uri = `${request.uri}/${CALL_HOLD_SERVICE}/${HOLD_ENDPOINT}`;\n break;\n }\n case SUPPLEMENTARY_SERVICES.RESUME: {\n request.uri = `${request.uri}/${CALL_HOLD_SERVICE}/${RESUME_ENDPOINT}`;\n break;\n }\n case SUPPLEMENTARY_SERVICES.TRANSFER: {\n request.uri = `${request.uri}/${CALL_TRANSFER_SERVICE}/${TRANSFER_ENDPOINT}`;\n const transferContext = context;\n if (transferContext.destination) {\n Object.assign(request.body, { blindTransferContext: transferContext });\n Object.assign(request.body, { transferType: TransferType.BLIND });\n }\n else if (transferContext.transferToCallId) {\n Object.assign(request.body, { consultTransferContext: transferContext });\n Object.assign(request.body, { transferType: TransferType.CONSULT });\n }\n break;\n }\n default: {\n log.warn(`Unknown type for PUT request: ${type}`, {\n file: CALL_FILE,\n method: this.postSSRequest.name,\n });\n }\n }\n return this.webex.request(request);\n }\n async postStatus() {\n return this.webex.request({\n uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}/${CALL_STATUS_RESOURCE}`,\n method: HTTP_METHODS.POST,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n callId: this.callId,\n },\n });\n }\n async completeTransfer(transferType, transferCallId, transferTarget) {\n if (transferType === TransferType.BLIND && transferTarget) {\n log.info(`Initiating Blind transfer with : ${transferTarget}`, {\n file: CALL_FILE,\n method: this.completeTransfer.name,\n });\n const context = {\n transferorCallId: this.getCallId(),\n destination: transferTarget,\n };\n try {\n await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);\n this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.BLIND, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);\n }\n catch (e) {\n log.warn(`Blind Transfer failed for correlationId ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.completeTransfer.name,\n });\n const errData = e;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);\n this.submitCallErrorMetric(error, TRANSFER_ACTION.BLIND);\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.completeTransfer.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n else if (transferType === TransferType.CONSULT && transferCallId) {\n log.info(`Initiating Consult transfer between : ${this.callId} and ${transferCallId}`, {\n file: CALL_FILE,\n method: this.completeTransfer.name,\n });\n const context = {\n transferorCallId: this.getCallId(),\n transferToCallId: transferCallId,\n };\n try {\n await this.postSSRequest(context, SUPPLEMENTARY_SERVICES.TRANSFER);\n this.metricManager.submitCallMetric(METRIC_EVENT.CALL, TRANSFER_ACTION.CONSULT, METRIC_TYPE.BEHAVIORAL, this.getCallId(), this.getCorrelationId(), undefined);\n }\n catch (e) {\n log.warn(`Consult Transfer failed for correlationId ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.completeTransfer.name,\n });\n const errData = e;\n handleCallErrors((error) => {\n this.emit(CALL_EVENT_KEYS.TRANSFER_ERROR, error);\n this.submitCallErrorMetric(error, TRANSFER_ACTION.CONSULT);\n }, ERROR_LAYER.CALL_CONTROL, (interval) => undefined, this.getCorrelationId(), errData, this.completeTransfer.name, CALL_FILE);\n uploadLogs(this.webex, {\n correlationId: this.correlationId,\n callId: this.callId,\n });\n }\n }\n else {\n log.warn(`Invalid information received, transfer failed for correlationId: ${this.getCorrelationId()}`, {\n file: CALL_FILE,\n method: this.completeTransfer.name,\n });\n }\n }\n async getCallStats() {\n let stats;\n try {\n stats = await this.mediaConnection.getStats();\n }\n catch (err) {\n log.warn('Stats collection failed, using dummy stats', {\n file: CALL_FILE,\n method: this.getCallStats.name,\n });\n }\n return parseMediaQualityStatistics(stats);\n }\n async postMedia(roapMessage) {\n log.log('Posting message to Webex Calling', {\n file: CALL_FILE,\n method: this.postMedia.name,\n });\n return this.webex.request({\n uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}/${MEDIA_ENDPOINT_RESOURCE}`,\n method: HTTP_METHODS.POST,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n callId: this.callId,\n localMedia: {\n roap: roapMessage,\n mediaId: uuid(),\n },\n },\n });\n }\n mediaRoapEventsListener() {\n this.mediaConnection.on(MediaConnectionEventNames.ROAP_MESSAGE_TO_SEND, async (event) => {\n log.info(`ROAP message to send (rcv from MEDIA-SDK) :\n \\n type: ${event.roapMessage?.messageType}, seq: ${event.roapMessage.seq} , version: ${event.roapMessage.version}`, {});\n log.info(`SDP message to send : \\n ${event.roapMessage?.sdp}`, {\n file: CALL_FILE,\n method: this.mediaRoapEventsListener.name,\n });\n switch (event.roapMessage.messageType) {\n case RoapScenario.OK: {\n const mediaOk = {\n received: false,\n message: event.roapMessage,\n };\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_OK', data: mediaOk });\n break;\n }\n case RoapScenario.OFFER: {\n log.info(`before modifying sdp: ${event.roapMessage.sdp}`, {\n file: CALL_FILE,\n method: this.mediaRoapEventsListener.name,\n });\n event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);\n const sdpVideoPortZero = event.roapMessage.sdp.replace(/^m=(video) (?:\\d+) /gim, 'm=$1 0 ');\n log.info(`after modification sdp: ${sdpVideoPortZero}`, {\n file: CALL_FILE,\n method: this.mediaRoapEventsListener.name,\n });\n event.roapMessage.sdp = sdpVideoPortZero;\n this.localRoapMessage = event.roapMessage;\n this.sendCallStateMachineEvt({ type: 'E_SEND_CALL_SETUP', data: event.roapMessage });\n break;\n }\n case RoapScenario.ANSWER:\n event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);\n this.localRoapMessage = event.roapMessage;\n this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_ANSWER', data: event.roapMessage });\n break;\n case RoapScenario.ERROR:\n this.sendMediaStateMachineEvt({ type: 'E_ROAP_ERROR', data: event.roapMessage });\n break;\n case RoapScenario.OFFER_RESPONSE:\n event.roapMessage.sdp = modifySdpForIPv4(event.roapMessage.sdp);\n this.localRoapMessage = event.roapMessage;\n this.sendMediaStateMachineEvt({ type: 'E_SEND_ROAP_OFFER', data: event.roapMessage });\n break;\n default:\n }\n });\n }\n mediaTrackListener() {\n this.mediaConnection.on(MediaConnectionEventNames.REMOTE_TRACK_ADDED, (e) => {\n if (e.type === MEDIA_CONNECTION_EVENT_KEYS.MEDIA_TYPE_AUDIO) {\n this.emit(CALL_EVENT_KEYS.REMOTE_MEDIA, e.track);\n }\n });\n }\n onEffectEnabled = () => {\n this.metricManager.submitBNRMetric(METRIC_EVENT.BNR_ENABLED, METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId);\n };\n onEffectDisabled = () => {\n this.metricManager.submitBNRMetric(METRIC_EVENT.BNR_DISABLED, METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId);\n };\n updateTrack = (audioTrack) => {\n this.mediaConnection.updateLocalTracks({ audio: audioTrack });\n };\n registerEffectListener = (addedEffect) => {\n if (this.localAudioStream) {\n const effect = this.localAudioStream.getEffectByKind(NOISE_REDUCTION_EFFECT);\n if (effect === addedEffect) {\n effect.on(EffectEvent.Enabled, this.onEffectEnabled);\n effect.on(EffectEvent.Disabled, this.onEffectDisabled);\n }\n }\n };\n unregisterListeners() {\n if (this.localAudioStream) {\n const effect = this.localAudioStream.getEffectByKind(NOISE_REDUCTION_EFFECT);\n if (effect) {\n effect.off(EffectEvent.Enabled, this.onEffectEnabled);\n effect.off(EffectEvent.Disabled, this.onEffectDisabled);\n }\n this.localAudioStream.off(LocalStreamEventNames.EffectAdded, this.registerEffectListener);\n this.localAudioStream.off(LocalStreamEventNames.OutputTrackChange, this.updateTrack);\n }\n }\n registerListeners(localAudioStream) {\n localAudioStream.on(LocalStreamEventNames.OutputTrackChange, this.updateTrack);\n localAudioStream.on(LocalStreamEventNames.EffectAdded, this.registerEffectListener);\n const effect = localAudioStream.getEffectByKind(NOISE_REDUCTION_EFFECT);\n if (effect) {\n effect.on(EffectEvent.Enabled, this.onEffectEnabled);\n effect.on(EffectEvent.Disabled, this.onEffectDisabled);\n if (effect.isEnabled) {\n this.onEffectEnabled();\n }\n }\n }\n async delete() {\n const disconnectMetrics = await this.getCallStats();\n return this.webex.request({\n uri: `${this.mobiusUrl}${DEVICES_ENDPOINT_RESOURCE}/${this.deviceId}/${CALLS_ENDPOINT_RESOURCE}/${this.callId}`,\n method: HTTP_METHODS.DELETE,\n service: ALLOWED_SERVICES.MOBIUS,\n headers: {\n [CISCO_DEVICE_URL]: this.webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: {\n device: {\n deviceId: this.deviceId,\n correlationId: this.correlationId,\n },\n callId: this.callId,\n metrics: disconnectMetrics,\n causecode: this.disconnectReason.code,\n cause: this.disconnectReason.cause,\n },\n });\n }\n submitCallErrorMetric(error, transferMetricAction) {\n if (error.getCallError().errorLayer === ERROR_LAYER.CALL_CONTROL) {\n this.metricManager.submitCallMetric(METRIC_EVENT.CALL_ERROR, transferMetricAction || this.callStateMachine.state.value.toString(), METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, error);\n }\n else {\n this.metricManager.submitMediaMetric(METRIC_EVENT.MEDIA_ERROR, this.mediaStateMachine.state.value.toString(), METRIC_TYPE.BEHAVIORAL, this.callId, this.correlationId, this.localRoapMessage.sdp, this.remoteRoapMessage?.sdp, error);\n }\n }\n handleMidCallEvent(event) {\n const { eventType, eventData } = event;\n switch (eventType) {\n case MidCallEventType.CALL_INFO: {\n log.log(`Received Midcall CallInfo Event for correlationId : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n const callerData = eventData;\n this.startCallerIdResolution(callerData.callerId);\n break;\n }\n case MidCallEventType.CALL_STATE: {\n log.log(`Received Midcall call event for correlationId : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n const data = eventData;\n switch (data.callState) {\n case MOBIUS_MIDCALL_STATE.HELD: {\n log.log(`Call is successfully held : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n this.emit(CALL_EVENT_KEYS.HELD, this.correlationId);\n this.held = true;\n if (this.supplementaryServicesTimer) {\n clearTimeout(this.supplementaryServicesTimer);\n this.supplementaryServicesTimer = undefined;\n }\n break;\n }\n case MOBIUS_MIDCALL_STATE.CONNECTED: {\n log.log(`Call is successfully resumed : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n this.emit(CALL_EVENT_KEYS.RESUMED, this.correlationId);\n this.held = false;\n if (this.supplementaryServicesTimer) {\n clearTimeout(this.supplementaryServicesTimer);\n this.supplementaryServicesTimer = undefined;\n }\n break;\n }\n default: {\n log.warn(`Unknown Supplementary service state: ${data.callState} for correlationId : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n }\n }\n break;\n }\n default: {\n log.warn(`Unknown Midcall type: ${eventType} for correlationId : ${this.correlationId}`, {\n file: CALL_FILE,\n method: 'handleMidCallEvent',\n });\n }\n }\n }\n getCallerInfo = () => this.callerInfo;\n end = () => {\n this.sendCallStateMachineEvt({ type: 'E_SEND_CALL_DISCONNECT' });\n };\n doHoldResume = () => {\n if (this.held) {\n this.sendCallStateMachineEvt({ type: 'E_CALL_RESUME' });\n }\n else {\n this.sendCallStateMachineEvt({ type: 'E_CALL_HOLD' });\n }\n };\n startCallerIdResolution(callerInfo) {\n this.callerInfo = this.callerId.fetchCallerDetails(callerInfo);\n }\n sendDigit(tone) {\n try {\n log.info(`Sending digit : ${tone}`, {\n file: CALL_FILE,\n method: 'sendDigit',\n });\n this.mediaConnection.insertDTMF(tone);\n }\n catch (e) {\n log.warn(`Unable to send digit on call: ${e.message}`, {\n file: CALL_FILE,\n method: 'sendDigit',\n });\n }\n }\n mute = (localAudioStream, muteType) => {\n if (!localAudioStream) {\n log.warn(`Did not find a local stream while muting the call ${this.getCorrelationId()}.`, {\n file: CALL_FILE,\n method: 'mute',\n });\n return;\n }\n if (muteType === MUTE_TYPE.SYSTEM) {\n if (!localAudioStream.userMuted) {\n this.muted = localAudioStream.systemMuted;\n }\n else {\n log.info(`Call is muted by the user already - ${this.getCorrelationId()}.`, {\n file: CALL_FILE,\n method: 'mute',\n });\n }\n }\n else if (!localAudioStream.systemMuted) {\n localAudioStream.setUserMuted(!this.muted);\n this.muted = !this.muted;\n }\n else {\n log.info(`Call is muted on the system - ${this.getCorrelationId()}.`, {\n file: CALL_FILE,\n method: 'mute',\n });\n }\n };\n updateMedia = (newAudioStream) => {\n const localAudioTrack = newAudioStream.outputStream.getAudioTracks()[0];\n if (!localAudioTrack) {\n log.warn(`Did not find a local track while updating media for call ${this.getCorrelationId()}. Will not update media`, {\n file: CALL_FILE,\n method: 'updateMedia',\n });\n return;\n }\n try {\n this.mediaConnection.updateLocalTracks({\n audio: localAudioTrack,\n });\n this.unregisterListeners();\n this.registerListeners(newAudioStream);\n this.localAudioStream = newAudioStream;\n }\n catch (e) {\n log.warn(`Unable to update media on call ${this.getCorrelationId()}. Error: ${e.message}`, {\n file: CALL_FILE,\n method: 'updateMedia',\n });\n }\n };\n setBroadworksCorrelationInfo(broadworksCorrelationInfo) {\n this.broadworksCorrelationInfo = broadworksCorrelationInfo;\n }\n getBroadworksCorrelationInfo() {\n return this.broadworksCorrelationInfo;\n }\n getCallRtpStats() {\n return this.getCallStats();\n }\n async handleTimeout() {\n log.warn(`Call timed out`, {\n file: CALL_FILE,\n method: 'handleTimeout',\n });\n this.deleteCb(this.getCorrelationId());\n this.emit(CALL_EVENT_KEYS.DISCONNECT, this.getCorrelationId());\n const response = await this.delete();\n log.log(`handleTimeout: Response code: ${response.statusCode}`, {\n file: CALL_FILE,\n method: this.handleTimeout.name,\n });\n }\n}\nexport const createCall = (activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest) => new Call(activeUrl, webex, dir, deviceId, lineId, deleteCb, indicator, dest);\n","import { CALL_MANAGER_FILE } from '../constants';\nimport { CALLING_CLIENT_EVENT_KEYS, LINE_EVENT_KEYS } from '../../Events/types';\nimport { Eventing } from '../../Events/impl';\nimport SDKConnector from '../../SDKConnector';\nimport { CallDirection } from '../../common/types';\nimport { MediaState, MobiusEventType, } from './types';\nimport { createCall } from './call';\nimport log from '../../Logger';\nlet callManager;\nexport class CallManager extends Eventing {\n sdkConnector;\n webex;\n callCollection;\n activeMobiusUrl;\n serviceIndicator;\n lineDict;\n constructor(webex, indicator) {\n super();\n this.sdkConnector = SDKConnector;\n this.serviceIndicator = indicator;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.lineDict = {};\n this.webex = this.sdkConnector.getWebex();\n this.callCollection = {};\n this.activeMobiusUrl = '';\n this.listenForWsEvents();\n }\n createCall = (direction, deviceId, lineId, destination) => {\n log.log('Creating call object', {});\n const newCall = createCall(this.activeMobiusUrl, this.webex, direction, deviceId, lineId, (correlationId) => {\n delete this.callCollection[correlationId];\n const activeCalls = Object.keys(this.getActiveCalls()).length;\n log.info(`DELETE:: Deleted corelationId: ${newCall.getCorrelationId()} from CallManager, Number of call records :- ${activeCalls}`, {});\n if (activeCalls === 0) {\n this.emit(CALLING_CLIENT_EVENT_KEYS.ALL_CALLS_CLEARED);\n }\n }, this.serviceIndicator, destination);\n this.callCollection[newCall.getCorrelationId()] = newCall;\n log.log(`New call created with correlationId: ${newCall.getCorrelationId()}`, {});\n log.info(`ADD:: Added corelationId: ${newCall.getCorrelationId()} to CallManager , Number of call records now:- ${Object.keys(this.getActiveCalls()).length}`, {});\n return newCall;\n };\n updateActiveMobius(url) {\n this.activeMobiusUrl = url;\n }\n listenForWsEvents() {\n this.sdkConnector.registerListener('event:mobius', async (event) => {\n this.dequeueWsEvents(event);\n });\n }\n dequeueWsEvents(event) {\n const mobiusEvent = event;\n const { callId, correlationId } = mobiusEvent.data;\n switch (mobiusEvent.data.eventType) {\n case MobiusEventType.CALL_SETUP: {\n log.log(`Received call Setup message for call: ${callId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n if (mobiusEvent.data.midCallService) {\n mobiusEvent.data.midCallService.forEach((midCallEvent) => {\n const call = this.getCall(correlationId);\n if (call) {\n call.handleMidCallEvent(midCallEvent);\n }\n else {\n log.log(`Dropping midcall event of type: ${midCallEvent.eventType} as it doesn't match with any existing call`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n }\n });\n return;\n }\n const newId = Object.keys(this.callCollection).find((id) => this.callCollection[id].getCallId() === callId);\n let newCall;\n if (!newId) {\n const lineId = this.getLineId(mobiusEvent.data.deviceId);\n newCall = this.createCall(CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId, {});\n log.log(`New incoming call created with correlationId from Call Setup message: ${newCall.getCorrelationId()}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n newCall.setCallId(callId);\n if (mobiusEvent.data.broadworksCorrelationInfo) {\n log.log(`Found broadworksCorrelationInfo: ${mobiusEvent.data.broadworksCorrelationInfo}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n newCall.setBroadworksCorrelationInfo(mobiusEvent.data.broadworksCorrelationInfo);\n }\n }\n else {\n log.info(`Found the call Object with a matching callId: ${callId} from our records with correlationId: ${newId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n newCall = this.getCall(newId);\n }\n if (mobiusEvent.data.callerId) {\n log.info('Processing Caller-Id data', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n newCall.startCallerIdResolution(mobiusEvent.data.callerId);\n }\n this.emit(LINE_EVENT_KEYS.INCOMING_CALL, newCall);\n newCall.sendCallStateMachineEvt({ type: 'E_RECV_CALL_SETUP', data: mobiusEvent.data });\n break;\n }\n case MobiusEventType.CALL_PROGRESS: {\n log.log(`Received call progress mobiusEvent for call: ${correlationId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n const call = this.getCall(correlationId);\n call.sendCallStateMachineEvt({ type: 'E_RECV_CALL_PROGRESS', data: mobiusEvent.data });\n break;\n }\n case MobiusEventType.CALL_MEDIA: {\n log.log(`Received call media mobiusEvent for call: ${correlationId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n let activeCall;\n if (correlationId) {\n activeCall = this.getCall(correlationId);\n }\n else {\n const newId = Object.keys(this.callCollection).find((id) => this.callCollection[id].getCallId() === callId);\n if (newId) {\n log.info(`Found the call Object with a matching callId: ${callId} from our records with correlationId: ${newId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n activeCall = this.getCall(newId);\n }\n else {\n const lineId = this.getLineId(mobiusEvent.data.deviceId);\n activeCall = this.createCall(CallDirection.INBOUND, mobiusEvent.data.deviceId, lineId, {});\n log.log(`New incoming call created with correlationId from ROAP Message: ${activeCall.getCorrelationId()}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n activeCall.setCallId(callId);\n }\n }\n if (activeCall) {\n log.info(`SDP from mobius ${mobiusEvent.data.message?.sdp}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n log.log(`ROAP message from mobius with type: ${mobiusEvent.data.message?.messageType}, seq: ${mobiusEvent.data.message?.seq} , version: ${mobiusEvent.data.message?.version}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n const mediaState = mobiusEvent.data.message?.messageType;\n switch (mediaState) {\n case MediaState.OFFER: {\n log.log('Received OFFER', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n activeCall.sendMediaStateMachineEvt({\n type: 'E_RECV_ROAP_OFFER',\n data: mobiusEvent.data.message,\n });\n break;\n }\n case MediaState.ANSWER: {\n log.log('Received ANSWER', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n activeCall.sendMediaStateMachineEvt({\n type: 'E_RECV_ROAP_ANSWER',\n data: mobiusEvent.data.message,\n });\n break;\n }\n case MediaState.OFFER_REQUEST: {\n log.log('Received OFFER_REQUEST', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n activeCall.sendMediaStateMachineEvt({\n type: 'E_RECV_ROAP_OFFER_REQUEST',\n data: mobiusEvent.data.message,\n });\n break;\n }\n case MediaState.OK: {\n log.log('Received OK', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n const mediaOk = {\n received: true,\n message: mobiusEvent.data.message,\n };\n activeCall.sendMediaStateMachineEvt({\n type: 'E_ROAP_OK',\n data: mediaOk,\n });\n break;\n }\n case MediaState.ERROR: {\n log.log('Received Error...', {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n break;\n }\n default: {\n log.log(`Unknown Media mobiusEvent: ${mediaState} `, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n }\n }\n }\n else {\n log.log(`CorrelationId: ${correlationId} doesn't exist , discarding..`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n }\n break;\n }\n case MobiusEventType.CALL_CONNECTED: {\n log.log(`Received call connect for call: ${correlationId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n const call = this.getCall(correlationId);\n call.sendCallStateMachineEvt({ type: 'E_RECV_CALL_CONNECT', data: mobiusEvent.data });\n break;\n }\n case MobiusEventType.CALL_DISCONNECTED: {\n log.log(`Received call disconnect for call: ${correlationId}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n const call = this.getCall(correlationId);\n if (call) {\n call.sendCallStateMachineEvt({ type: 'E_RECV_CALL_DISCONNECT' });\n }\n break;\n }\n default: {\n log.log(`Unknown Call Event mobiusEvent: ${mobiusEvent.data.eventType}`, {\n file: CALL_MANAGER_FILE,\n method: 'dequeueWsEvents',\n });\n }\n }\n }\n getCall = (correlationId) => {\n return this.callCollection[correlationId];\n };\n getActiveCalls = () => {\n return this.callCollection;\n };\n updateLine(deviceId, line) {\n this.lineDict[deviceId] = line;\n }\n getLineId(deviceId) {\n return this.lineDict[deviceId].lineId;\n }\n}\nexport const getCallManager = (webex, indicator) => {\n if (!callManager) {\n callManager = new CallManager(webex, indicator);\n }\n return callManager;\n};\n","export * from './call';\nexport * from './callManager';\n","export var MobiusEventType;\n(function (MobiusEventType) {\n MobiusEventType[\"CALL_SETUP\"] = \"mobius.call\";\n MobiusEventType[\"CALL_PROGRESS\"] = \"mobius.callprogress\";\n MobiusEventType[\"CALL_CONNECTED\"] = \"mobius.callconnected\";\n MobiusEventType[\"CALL_MEDIA\"] = \"mobius.media\";\n MobiusEventType[\"CALL_DISCONNECTED\"] = \"mobius.calldisconnected\";\n})(MobiusEventType || (MobiusEventType = {}));\nexport var MediaState;\n(function (MediaState) {\n MediaState[\"OFFER\"] = \"OFFER\";\n MediaState[\"ANSWER\"] = \"ANSWER\";\n MediaState[\"OFFER_REQUEST\"] = \"OFFER_REQUEST\";\n MediaState[\"OK\"] = \"OK\";\n MediaState[\"ERROR\"] = \"ERROR\";\n})(MediaState || (MediaState = {}));\nexport var DisconnectCode;\n(function (DisconnectCode) {\n DisconnectCode[DisconnectCode[\"BUSY\"] = 115] = \"BUSY\";\n DisconnectCode[DisconnectCode[\"NORMAL\"] = 0] = \"NORMAL\";\n DisconnectCode[DisconnectCode[\"MEDIA_INACTIVITY\"] = 131] = \"MEDIA_INACTIVITY\";\n})(DisconnectCode || (DisconnectCode = {}));\nexport var DisconnectCause;\n(function (DisconnectCause) {\n DisconnectCause[\"BUSY\"] = \"User Busy.\";\n DisconnectCause[\"NORMAL\"] = \"Normal Disconnect.\";\n DisconnectCause[\"MEDIA_INACTIVITY\"] = \"Media Inactivity.\";\n})(DisconnectCause || (DisconnectCause = {}));\nexport var MidCallEventType;\n(function (MidCallEventType) {\n MidCallEventType[\"CALL_INFO\"] = \"callInfo\";\n MidCallEventType[\"CALL_STATE\"] = \"callState\";\n})(MidCallEventType || (MidCallEventType = {}));\nexport var RoapScenario;\n(function (RoapScenario) {\n RoapScenario[\"ANSWER\"] = \"ANSWER\";\n RoapScenario[\"OK\"] = \"OK\";\n RoapScenario[\"OFFER\"] = \"OFFER\";\n RoapScenario[\"ERROR\"] = \"ERROR\";\n RoapScenario[\"OFFER_RESPONSE\"] = \"OFFER_RESPONSE\";\n})(RoapScenario || (RoapScenario = {}));\nexport var MobiusCallState;\n(function (MobiusCallState) {\n MobiusCallState[\"PROCEEDING\"] = \"sig_proceeding\";\n MobiusCallState[\"PROGRESS\"] = \"sig_progress\";\n MobiusCallState[\"ALERTING\"] = \"sig_alerting\";\n MobiusCallState[\"CONNECTED\"] = \"sig_connected\";\n})(MobiusCallState || (MobiusCallState = {}));\nexport var TransferType;\n(function (TransferType) {\n TransferType[\"BLIND\"] = \"BLIND\";\n TransferType[\"CONSULT\"] = \"CONSULT\";\n})(TransferType || (TransferType = {}));\nexport var MUTE_TYPE;\n(function (MUTE_TYPE) {\n MUTE_TYPE[\"USER\"] = \"user_mute\";\n MUTE_TYPE[\"SYSTEM\"] = \"system_mute\";\n})(MUTE_TYPE || (MUTE_TYPE = {}));\n","export const VERSION = 'unknown';\nexport const USER_AGENT_VERSION = 'beta';\nexport const REPO_NAME = 'webex-calling';\nexport const CALLING_USER_AGENT = `${REPO_NAME}/${USER_AGENT_VERSION}`;\nexport const CALL_ENDPOINT_RESOURCE = 'call';\nexport const CALL_STATUS_RESOURCE = 'status';\nexport const CALLS_ENDPOINT_RESOURCE = 'calls';\nexport const CISCO_DEVICE_URL = 'cisco-device-url';\nexport const CRLF = '\\r\\n';\nexport const DEFAULT_KEEPALIVE_INTERVAL = 30;\nexport const DEFAULT_LOCAL_CALL_ID = 'DefaultLocalId';\nexport const DEFAULT_REHOMING_INTERVAL_MAX = 120;\nexport const DEFAULT_REHOMING_INTERVAL_MIN = 60;\nexport const DEFAULT_SESSION_TIMER = 1000 * 60 * 10;\nexport const DEVICES_ENDPOINT_RESOURCE = 'devices';\nexport const DISCOVERY_URL = 'https://ds.ciscospark.com/v1/region';\nexport const DUMMY_METRICS = {\n 'rtp-rxstat': {\n Dur: 0,\n Pkt: 0,\n Oct: 0,\n LatePkt: 0,\n LostPkt: 0,\n AvgJit: 0,\n VQMetrics: {\n VoRxCodec: 'unknown',\n VoPktSizeMs: 0,\n maxJitter: 0,\n VoOneWayDelayMs: 0,\n networkType: 'unknown',\n hwType: 'unknown',\n },\n },\n 'rtp-txstat': {\n Dur: 0,\n Pkt: 0,\n Oct: 0,\n VQMetrics: {\n VoTxCodec: 'unknown',\n rtpBitRate: 0,\n },\n },\n};\nexport const DUMMY_MOBIUS_URL = 'https://mobius.aintgen-a-1.int.infra.webex.com/api/v1';\nexport const IP_ENDPOINT = 'myip';\nexport const INITIAL_SEQ_NUMBER = 1;\nexport const MEDIA_ENDPOINT_RESOURCE = 'media';\nexport const NETWORK_FLAP_TIMEOUT = 2000;\nexport const CALL_HOLD_SERVICE = 'callhold';\nexport const CALL_TRANSFER_SERVICE = 'calltransfer';\nexport const HOLD_ENDPOINT = 'hold';\nexport const TRANSFER_ENDPOINT = 'commit';\nexport const RESUME_ENDPOINT = 'resume';\nexport const SPARK_USER_AGENT = 'spark-user-agent';\nexport const REGISTER_RETRY_TIMEOUT = 10000;\nexport const SUPPLEMENTARY_SERVICES_TIMEOUT = 10000;\nexport const API_V1 = '/api/v1';\nexport const URL_ENDPOINT = '/calling/web/';\nexport const VALID_PHONE_REGEX = /[\\d\\s()*#+.-]+/;\nexport const WEB_AGENT = '(web)';\nexport const WEBEX = 'webex';\nexport const WEBEX_WEB_CLIENT = 'webex-web-client';\nexport const CALLER_ID_FILE = 'CallerId';\nexport const UTILS_FILE = 'utils';\nexport const CALLING_CLIENT_FILE = 'CallingClient';\nexport const LINE_FILE = 'line';\nexport const CALL_FILE = 'call';\nexport const CALL_MANAGER_FILE = 'callManager';\nexport const METRIC_FILE = 'metric';\nexport const REGISTRATION_FILE = 'register';\nexport const CODEC_ID = 'codecId';\nexport const MEDIA_ID = 'id';\nexport const RTC_ICE_CANDIDATE_PAIR = 'RTCIceCandidatePair_';\nexport const LOCAL_CANDIDATE_ID = 'localCandidateId';\nexport const RTC_ICE_CANDIDATE = 'RTCIceCandidate_';\nexport const NETWORK_TYPE = 'networkType';\nexport const RTC_CODEC = 'RTCCodec_';\nexport const INBOUND_CODEC_MATCH = 'CIT01_';\nexport const OUTBOUND_CODEC_MATCH = 'COT01_';\nexport const MIME_TYPE = 'mimeType';\nexport const REMOTE_INBOUND_RTP = 'remote-inbound-rtp';\nexport const TOTAL_ROUND_TRIP_TIME = 'totalRoundTripTime';\nexport const ROUND_TRIP_TIME_MEASUREMENTS = 'roundTripTimeMeasurements';\nexport const INBOUND_RTP = 'inbound-rtp';\nexport const OUTBOUND_RTP = 'outbound-rtp';\nexport const PACKETS_RECEIVED = 'packetsReceived';\nexport const PACKETS_SENT = 'packetsSent';\nexport const PACKETS_LOST = 'packetsLost';\nexport const PACKETS_DISCARDED = 'packetsDiscarded';\nexport const JITTER_BUFFER_DELAY = 'jitterBufferDelay';\nexport const JITTER_BUFFER_EMITTED_COUNT = 'jitterBufferEmittedCount';\nexport const TIMESTAMP = 'timestamp';\nexport const TYPE = 'type';\nexport const TRANSPORT = 'transport';\nexport const TARGET_BIT_RATE = 'targetBitrate';\nexport const MEDIA_SOURCE = 'media-source';\nexport const BYTES_RECEIVED = 'bytesReceived';\nexport const BYTES_SENT = 'bytesSent';\nexport const SELECTED_CANDIDATE_PAIR_ID = 'selectedCandidatePairId';\nexport const TOTAL_SAMPLES_DURATION = 'totalSamplesDuration';\nexport const RTP_RX_STAT = 'rtp-rxstat';\nexport const RTP_TX_STAT = 'rtp-txstat';\nexport const BASE_REG_TIMER_MFACTOR = 2;\nexport const BASE_REG_RETRY_TIMER_VAL_IN_SEC = 30;\nexport const SEC_TO_MSEC_MFACTOR = 1000;\nexport const MINUTES_TO_SEC_MFACTOR = 60;\nexport const REG_RANDOM_T_FACTOR_UPPER_LIMIT = 10000;\nexport const REG_TRY_BACKUP_TIMER_VAL_IN_SEC = 1200;\nexport const REG_TRY_BACKUP_TIMER_VAL_FOR_CC_IN_SEC = 114;\nexport const REG_FAILBACK_429_MAX_RETRIES = 5;\nexport const REGISTER_UTIL = 'registerDevice';\nexport const GET_MOBIUS_SERVERS_UTIL = 'getMobiusServers';\nexport const KEEPALIVE_UTIL = 'startKeepaliveTimer';\nexport const FAILBACK_UTIL = 'executeFailback';\nexport const FAILBACK_429_RETRY_UTIL = 'scheduleFailback429Retry';\nexport const FAILOVER_UTIL = 'startFailoverTimer';\nexport const NETWORK_CHANGE_DETECTION_UTIL = 'detectNetworkChange';\nexport const CALLS_CLEARED_HANDLER_UTIL = 'callsClearedHandler';\nexport const RECONNECT_UTIL = 'reconnectOnFailure';\nexport const NOISE_REDUCTION_EFFECT = 'noise-reduction-effect';\nexport const MOBIUS_US_PROD = 'mobius-us-east-1.prod.infra.webex.com';\nexport const MOBIUS_EU_PROD = 'mobius-eu-central-1.prod.infra.webex.com';\nexport const MOBIUS_US_INT = 'mobius-us-east-1.int.infra.webex.com';\nexport const MOBIUS_EU_INT = 'mobius-eu-central-1.int.infra.webex.com';\nexport const ICE_CANDIDATES_TIMEOUT = 3000;\n","import { v4 as uuid } from 'uuid';\nimport { CallDirection, RegistrationStatus, ServiceIndicator, } from '../../common/types';\nimport { LINE_EVENTS } from './types';\nimport { LINE_FILE, VALID_PHONE_REGEX } from '../constants';\nimport log from '../../Logger';\nimport { createRegistration } from '../registration';\nimport { Eventing } from '../../Events/impl';\nimport { LineError } from '../../Errors/catalog/LineError';\nimport { validateServiceData } from '../../common';\nimport SDKConnector from '../../SDKConnector';\nimport { LINE_EVENT_KEYS } from '../../Events/types';\nimport { getCallManager } from '../calling/callManager';\nimport { ERROR_TYPE } from '../../Errors/types';\nexport default class Line extends Eventing {\n #webex;\n #mutex;\n #sdkConnector;\n registration;\n userId;\n clientDeviceUri;\n lineId;\n mobiusDeviceId;\n mobiusUri;\n phoneNumber;\n extension;\n sipAddresses = [];\n voicemail;\n lastSeen;\n keepaliveInterval;\n callKeepaliveInterval;\n rehomingIntervalMin;\n rehomingIntervalMax;\n voicePortalNumber;\n voicePortalExtension;\n callManager;\n serviceData;\n #primaryMobiusUris;\n #backupMobiusUris;\n constructor(userId, clientDeviceUri, mutex, primaryMobiusUris, backupMobiusUris, logLevel, serviceDataConfig, jwe, phoneNumber, extension, voicemail) {\n super();\n this.lineId = uuid();\n this.userId = userId;\n this.clientDeviceUri = clientDeviceUri;\n this.phoneNumber = phoneNumber;\n this.extension = extension;\n this.voicemail = voicemail;\n this.#sdkConnector = SDKConnector;\n this.#webex = this.#sdkConnector.getWebex();\n this.#mutex = mutex;\n this.#primaryMobiusUris = primaryMobiusUris;\n this.#backupMobiusUris = backupMobiusUris;\n this.serviceData = serviceDataConfig?.indicator\n ? serviceDataConfig\n : { indicator: ServiceIndicator.CALLING, domain: '' };\n validateServiceData(this.serviceData);\n this.registration = createRegistration(this.#webex, this.serviceData, this.#mutex, this.lineEmitter, logLevel, jwe);\n log.setLogger(logLevel, LINE_FILE);\n this.callManager = getCallManager(this.#webex, this.serviceData.indicator);\n this.incomingCallListener();\n }\n async register() {\n await this.#mutex.runExclusive(async () => {\n this.emit(LINE_EVENTS.CONNECTING);\n this.registration.setMobiusServers(this.#primaryMobiusUris, this.#backupMobiusUris);\n await this.registration.triggerRegistration();\n });\n if (this.mobiusDeviceId) {\n this.callManager.updateLine(this.mobiusDeviceId, this);\n }\n }\n async deregister() {\n await this.registration.deregister();\n this.registration.setStatus(RegistrationStatus.IDLE);\n }\n normalizeLine(deviceInfo) {\n const { device, keepaliveInterval, callKeepaliveInterval, rehomingIntervalMin, rehomingIntervalMax, voicePortalNumber, voicePortalExtension, } = deviceInfo;\n this.mobiusDeviceId = device?.deviceId;\n this.mobiusUri = device?.uri;\n this.lastSeen = device?.lastSeen;\n this.sipAddresses = device?.addresses ?? [];\n this.keepaliveInterval = keepaliveInterval;\n this.callKeepaliveInterval = callKeepaliveInterval;\n this.rehomingIntervalMin = rehomingIntervalMin;\n this.rehomingIntervalMax = rehomingIntervalMax;\n this.voicePortalNumber = voicePortalNumber;\n this.voicePortalExtension = voicePortalExtension;\n }\n lineEmitter = (event, deviceInfo, lineError) => {\n switch (event) {\n case LINE_EVENTS.REGISTERED:\n if (deviceInfo) {\n this.normalizeLine(deviceInfo);\n this.emit(event, this);\n }\n break;\n case LINE_EVENTS.UNREGISTERED:\n case LINE_EVENTS.RECONNECTED:\n case LINE_EVENTS.RECONNECTING:\n this.emit(event);\n break;\n case LINE_EVENTS.ERROR:\n if (lineError) {\n this.emit(event, lineError);\n }\n break;\n default:\n break;\n }\n };\n getLoggingLevel() {\n return log.getLogLevel();\n }\n getActiveMobiusUrl() {\n return this.registration.getActiveMobiusUrl();\n }\n getStatus = () => this.registration.getStatus();\n getDeviceId = () => this.registration.getDeviceInfo().device?.deviceId;\n makeCall = (dest) => {\n let call;\n if (dest) {\n const match = dest.address.match(VALID_PHONE_REGEX);\n if (match && match[0].length === dest.address.length) {\n const sanitizedNumber = dest.address\n .replace(/[^[*+]\\d#]/gi, '')\n .replace(/\\s+/gi, '')\n .replace(/-/gi, '');\n const formattedDest = {\n type: dest.type,\n address: `tel:${sanitizedNumber}`,\n };\n call = this.callManager.createCall(CallDirection.OUTBOUND, this.registration.getDeviceInfo().device?.deviceId, this.lineId, formattedDest);\n log.log(`New call created, callId: ${call.getCallId()}`, {});\n }\n else {\n log.warn('Invalid phone number detected', {});\n const err = new LineError('An invalid phone number was detected. Check the number and try again.', {}, ERROR_TYPE.CALL_ERROR, RegistrationStatus.ACTIVE);\n this.emit(LINE_EVENTS.ERROR, err);\n }\n return call;\n }\n if (this.serviceData.indicator === ServiceIndicator.GUEST_CALLING) {\n call = this.callManager.createCall(CallDirection.OUTBOUND, this.registration.getDeviceInfo().device?.deviceId, this.lineId);\n log.log(`New guest call created, callId: ${call.getCallId()}`, {});\n return call;\n }\n return undefined;\n };\n incomingCallListener() {\n const logContext = {\n file: LINE_FILE,\n method: this.incomingCallListener.name,\n };\n log.log('Listening for incoming calls... ', logContext);\n this.callManager.on(LINE_EVENT_KEYS.INCOMING_CALL, (callObj) => {\n this.emit(LINE_EVENTS.INCOMING_CALL, callObj);\n });\n }\n getCall = (correlationId) => {\n return this.callManager.getCall(correlationId);\n };\n}\n","export var LINE_EVENTS;\n(function (LINE_EVENTS) {\n LINE_EVENTS[\"CONNECTING\"] = \"connecting\";\n LINE_EVENTS[\"ERROR\"] = \"error\";\n LINE_EVENTS[\"RECONNECTED\"] = \"reconnected\";\n LINE_EVENTS[\"RECONNECTING\"] = \"reconnecting\";\n LINE_EVENTS[\"REGISTERED\"] = \"registered\";\n LINE_EVENTS[\"UNREGISTERED\"] = \"unregistered\";\n LINE_EVENTS[\"INCOMING_CALL\"] = \"line:incoming_call\";\n})(LINE_EVENTS || (LINE_EVENTS = {}));\n","export * from './register';\n","import { v4 as uuid } from 'uuid';\nimport { ERROR_CODE } from '../../Errors/types';\nimport { emitFinalFailure, handleRegistrationErrors } from '../../common';\nimport { METRIC_EVENT, METRIC_TYPE, REG_ACTION } from '../../Metrics/types';\nimport { getMetricManager } from '../../Metrics';\nimport { getCallManager } from '../calling';\nimport log from '../../Logger';\nimport SDKConnector from '../../SDKConnector';\nimport { ALLOWED_SERVICES, HTTP_METHODS, RegistrationStatus, ServiceIndicator, WorkerMessageType, } from '../../common/types';\nimport { CALLING_USER_AGENT, CISCO_DEVICE_URL, DEVICES_ENDPOINT_RESOURCE, SPARK_USER_AGENT, WEBEX_WEB_CLIENT, BASE_REG_RETRY_TIMER_VAL_IN_SEC, BASE_REG_TIMER_MFACTOR, SEC_TO_MSEC_MFACTOR, REG_RANDOM_T_FACTOR_UPPER_LIMIT, REG_TRY_BACKUP_TIMER_VAL_IN_SEC, MINUTES_TO_SEC_MFACTOR, FAILBACK_429_RETRY_UTIL, REG_FAILBACK_429_MAX_RETRIES, FAILBACK_UTIL, REGISTRATION_FILE, DEFAULT_REHOMING_INTERVAL_MIN, DEFAULT_REHOMING_INTERVAL_MAX, DEFAULT_KEEPALIVE_INTERVAL, REG_TRY_BACKUP_TIMER_VAL_FOR_CC_IN_SEC, } from '../constants';\nimport { LINE_EVENTS } from '../line/types';\nexport class Registration {\n sdkConnector;\n webex;\n userId = '';\n serviceData;\n failback429RetryAttempts;\n registrationStatus;\n failbackTimer;\n activeMobiusUrl;\n rehomingIntervalMin;\n rehomingIntervalMax;\n mutex;\n metricManager;\n lineEmitter;\n callManager;\n deviceInfo = {};\n primaryMobiusUris;\n backupMobiusUris;\n registerRetry = false;\n reconnectPending = false;\n jwe;\n isCCFlow = false;\n failoverImmediately = false;\n webWorker;\n constructor(webex, serviceData, mutex, lineEmitter, logLevel, jwe) {\n this.jwe = jwe;\n this.sdkConnector = SDKConnector;\n this.serviceData = serviceData;\n this.isCCFlow = serviceData.indicator === ServiceIndicator.CONTACT_CENTER;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.userId = this.webex.internal.device.userId;\n this.registrationStatus = RegistrationStatus.IDLE;\n this.failback429RetryAttempts = 0;\n log.setLogger(logLevel, REGISTRATION_FILE);\n this.rehomingIntervalMin = DEFAULT_REHOMING_INTERVAL_MIN;\n this.rehomingIntervalMax = DEFAULT_REHOMING_INTERVAL_MAX;\n this.mutex = mutex;\n this.callManager = getCallManager(this.webex, serviceData.indicator);\n this.metricManager = getMetricManager(this.webex, serviceData.indicator);\n this.lineEmitter = lineEmitter;\n this.primaryMobiusUris = [];\n this.backupMobiusUris = [];\n }\n getActiveMobiusUrl() {\n return this.activeMobiusUrl;\n }\n setActiveMobiusUrl(url) {\n log.info(`ActiveMobiusUrl: ${url}`, { method: 'setActiveMobiusUrl', file: REGISTRATION_FILE });\n this.activeMobiusUrl = url;\n this.callManager.updateActiveMobius(url);\n }\n setMobiusServers(primaryMobiusUris, backupMobiusUris) {\n this.primaryMobiusUris = primaryMobiusUris;\n this.backupMobiusUris = backupMobiusUris;\n }\n async deleteRegistration(url, deviceId, deviceUrl) {\n let response;\n try {\n response = await fetch(`${url}${DEVICES_ENDPOINT_RESOURCE}/${deviceId}`, {\n method: HTTP_METHODS.DELETE,\n headers: {\n [CISCO_DEVICE_URL]: deviceUrl,\n Authorization: await this.webex.credentials.getUserToken(),\n trackingId: `${WEBEX_WEB_CLIENT}_${uuid()}`,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n });\n }\n catch (error) {\n log.warn(`Delete failed with Mobius`, {});\n }\n this.setStatus(RegistrationStatus.INACTIVE);\n this.lineEmitter(LINE_EVENTS.UNREGISTERED);\n return response?.json();\n }\n async postRegistration(url) {\n const deviceInfo = {\n userId: this.userId,\n clientDeviceUri: this.webex.internal.device.url,\n serviceData: this.jwe ? { ...this.serviceData, jwe: this.jwe } : this.serviceData,\n };\n return this.webex.request({\n uri: `${url}device`,\n method: HTTP_METHODS.POST,\n headers: {\n [CISCO_DEVICE_URL]: deviceInfo.clientDeviceUri,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n body: deviceInfo,\n service: ALLOWED_SERVICES.MOBIUS,\n });\n }\n async restorePreviousRegistration(caller) {\n let abort = false;\n if (this.activeMobiusUrl) {\n abort = await this.attemptRegistrationWithServers(caller, [this.activeMobiusUrl]);\n }\n return abort;\n }\n async scheduleFailback429Retry() {\n if (this.failback429RetryAttempts >= REG_FAILBACK_429_MAX_RETRIES) {\n return;\n }\n this.clearFailbackTimer();\n this.failback429RetryAttempts += 1;\n log.log(`Received 429 while rehoming, 429 retry count : ${this.failback429RetryAttempts}`, {\n file: REGISTRATION_FILE,\n method: FAILBACK_429_RETRY_UTIL,\n });\n const interval = this.getRegRetryInterval(this.failback429RetryAttempts);\n this.startFailbackTimer(interval);\n const abort = await this.restorePreviousRegistration(FAILBACK_429_RETRY_UTIL);\n if (!abort && !this.isDeviceRegistered()) {\n await this.restartRegistration(FAILBACK_429_RETRY_UTIL);\n }\n }\n getRegRetryInterval(attempt = 1) {\n return (BASE_REG_RETRY_TIMER_VAL_IN_SEC +\n BASE_REG_TIMER_MFACTOR ** attempt +\n Math.floor((Math.random() * (REG_RANDOM_T_FACTOR_UPPER_LIMIT - SEC_TO_MSEC_MFACTOR + 1) +\n SEC_TO_MSEC_MFACTOR) /\n SEC_TO_MSEC_MFACTOR));\n }\n async startFailoverTimer(attempt = 1, timeElapsed = 0) {\n const loggerContext = {\n file: REGISTRATION_FILE,\n method: this.startFailoverTimer.name,\n };\n let interval = this.getRegRetryInterval(attempt);\n const TIMER_THRESHOLD = this.isCCFlow\n ? REG_TRY_BACKUP_TIMER_VAL_FOR_CC_IN_SEC\n : REG_TRY_BACKUP_TIMER_VAL_IN_SEC;\n if (timeElapsed + interval > TIMER_THRESHOLD) {\n const excessVal = timeElapsed + interval - TIMER_THRESHOLD;\n interval -= excessVal;\n }\n let abort;\n if (interval > BASE_REG_RETRY_TIMER_VAL_IN_SEC && !this.failoverImmediately) {\n const scheduledTime = Math.floor(Date.now() / 1000);\n setTimeout(async () => {\n await this.mutex.runExclusive(async () => {\n abort = await this.attemptRegistrationWithServers(this.startFailoverTimer.name);\n const currentTime = Math.floor(Date.now() / 1000);\n if (!abort && !this.isDeviceRegistered()) {\n await this.startFailoverTimer(attempt + 1, timeElapsed + (currentTime - scheduledTime));\n }\n });\n }, interval * SEC_TO_MSEC_MFACTOR);\n log.log(`Scheduled retry with primary in ${interval} seconds, number of attempts : ${attempt}`, loggerContext);\n }\n else if (this.backupMobiusUris.length) {\n log.log('Failing over to backup servers.', loggerContext);\n this.failoverImmediately = false;\n abort = await this.attemptRegistrationWithServers(this.startFailoverTimer.name, this.backupMobiusUris);\n if (!abort && !this.isDeviceRegistered()) {\n interval = this.getRegRetryInterval();\n setTimeout(async () => {\n await this.mutex.runExclusive(async () => {\n abort = await this.attemptRegistrationWithServers(this.startFailoverTimer.name, this.backupMobiusUris);\n if (!abort && !this.isDeviceRegistered()) {\n emitFinalFailure((clientError) => {\n this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);\n }, loggerContext);\n }\n });\n }, interval * SEC_TO_MSEC_MFACTOR);\n log.log(`Scheduled retry with backup servers in ${interval} seconds.`, loggerContext);\n }\n }\n else {\n emitFinalFailure((clientError) => {\n this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);\n }, loggerContext);\n }\n }\n clearFailbackTimer() {\n if (this.failbackTimer) {\n clearTimeout(this.failbackTimer);\n this.failbackTimer = undefined;\n }\n }\n isFailbackRequired() {\n return this.isDeviceRegistered() && this.primaryMobiusUris.indexOf(this.activeMobiusUrl) === -1;\n }\n getFailbackInterval() {\n return Math.floor(Math.random() * (this.rehomingIntervalMax - this.rehomingIntervalMin + 1) +\n this.rehomingIntervalMin);\n }\n initiateFailback() {\n if (this.isFailbackRequired()) {\n if (!this.failbackTimer) {\n this.failback429RetryAttempts = 0;\n const intervalInMinutes = this.getFailbackInterval();\n this.startFailbackTimer(intervalInMinutes * MINUTES_TO_SEC_MFACTOR);\n }\n }\n else {\n this.failback429RetryAttempts = 0;\n this.clearFailbackTimer();\n }\n }\n startFailbackTimer(intervalInSeconds) {\n this.failbackTimer = setTimeout(async () => this.executeFailback(), intervalInSeconds * SEC_TO_MSEC_MFACTOR);\n log.log(`Failback scheduled after ${intervalInSeconds} seconds.`, {\n file: REGISTRATION_FILE,\n method: this.startFailbackTimer.name,\n });\n }\n async executeFailback() {\n await this.mutex.runExclusive(async () => {\n if (this.isFailbackRequired()) {\n if (Object.keys(this.callManager.getActiveCalls()).length === 0) {\n log.info(`Attempting failback to primary.`, {\n file: REGISTRATION_FILE,\n method: this.executeFailback.name,\n });\n await this.deregister();\n const abort = await this.attemptRegistrationWithServers(FAILBACK_UTIL);\n if (!abort && !this.isDeviceRegistered()) {\n const abortNew = await this.restorePreviousRegistration(FAILBACK_UTIL);\n if (abortNew) {\n this.clearFailbackTimer();\n return;\n }\n if (!this.isDeviceRegistered()) {\n await this.restartRegistration(this.executeFailback.name);\n }\n else {\n this.failbackTimer = undefined;\n this.initiateFailback();\n }\n }\n }\n else {\n log.info('Active calls present, deferring failback to next cycle.', {\n file: REGISTRATION_FILE,\n method: this.executeFailback.name,\n });\n this.failbackTimer = undefined;\n this.initiateFailback();\n }\n }\n });\n }\n setIntervalValues(deviceInfo) {\n if (this.primaryMobiusUris.indexOf(this.activeMobiusUrl) !== -1) {\n this.rehomingIntervalMin = deviceInfo?.rehomingIntervalMin\n ? deviceInfo.rehomingIntervalMin\n : DEFAULT_REHOMING_INTERVAL_MIN;\n this.rehomingIntervalMax = deviceInfo?.rehomingIntervalMax\n ? deviceInfo.rehomingIntervalMax\n : DEFAULT_REHOMING_INTERVAL_MAX;\n }\n }\n getDeviceInfo() {\n return this.deviceInfo;\n }\n isDeviceRegistered() {\n return this.registrationStatus === RegistrationStatus.ACTIVE;\n }\n getStatus() {\n return this.registrationStatus;\n }\n setStatus(value) {\n this.registrationStatus = value;\n }\n async restartRegistration(caller) {\n this.clearFailbackTimer();\n this.failback429RetryAttempts = 0;\n const abort = await this.attemptRegistrationWithServers(caller, this.primaryMobiusUris);\n if (!abort && !this.isDeviceRegistered()) {\n await this.startFailoverTimer();\n }\n }\n async handleConnectionRestoration(retry) {\n await this.mutex.runExclusive(async () => {\n if (retry) {\n log.info('Mercury connection is up again, re-registering with Webex Calling if needed', {\n file: REGISTRATION_FILE,\n method: this.handleConnectionRestoration.name,\n });\n this.clearKeepaliveTimer();\n if (this.isDeviceRegistered()) {\n await this.deregister();\n }\n if (this.activeMobiusUrl) {\n const abort = await this.restorePreviousRegistration(this.handleConnectionRestoration.name);\n if (!abort && !this.isDeviceRegistered()) {\n await this.restartRegistration(this.handleConnectionRestoration.name);\n }\n }\n retry = false;\n }\n });\n return retry;\n }\n restoreRegistrationCallBack() {\n return async (restoreData, caller) => {\n const logContext = { file: REGISTRATION_FILE, method: caller };\n if (!this.isRegRetry()) {\n log.info('Registration restoration in progress.', logContext);\n const restore = this.getExistingDevice(restoreData);\n if (restore) {\n this.setRegRetry(true);\n await this.deregister();\n const finalError = await this.restorePreviousRegistration(caller);\n this.setRegRetry(false);\n if (this.isDeviceRegistered()) {\n log.info('Registration restored successfully.', logContext);\n }\n return finalError;\n }\n this.lineEmitter(LINE_EVENTS.UNREGISTERED);\n }\n else {\n this.lineEmitter(LINE_EVENTS.UNREGISTERED);\n }\n return false;\n };\n }\n async triggerRegistration() {\n if (this.primaryMobiusUris.length > 0) {\n const abort = await this.attemptRegistrationWithServers(this.triggerRegistration.name, this.primaryMobiusUris);\n if (!this.isDeviceRegistered() && !abort) {\n await this.startFailoverTimer();\n }\n }\n }\n async attemptRegistrationWithServers(caller, servers = this.primaryMobiusUris) {\n let abort = false;\n if (this.failoverImmediately) {\n return abort;\n }\n if (this.isDeviceRegistered()) {\n log.log(`[${caller}] : Device already registered with : ${this.activeMobiusUrl}`, {\n file: REGISTRATION_FILE,\n method: this.attemptRegistrationWithServers.name,\n });\n return abort;\n }\n for (const url of servers) {\n try {\n abort = false;\n this.registrationStatus = RegistrationStatus.INACTIVE;\n this.lineEmitter(LINE_EVENTS.CONNECTING);\n log.log(`[${caller}] : Mobius url to contact: ${url}`, {\n file: REGISTRATION_FILE,\n method: this.attemptRegistrationWithServers.name,\n });\n const resp = await this.postRegistration(url);\n this.deviceInfo = resp.body;\n this.registrationStatus = RegistrationStatus.ACTIVE;\n this.lineEmitter(LINE_EVENTS.REGISTERED, resp.body);\n this.setActiveMobiusUrl(url);\n this.setIntervalValues(this.deviceInfo);\n this.metricManager.setDeviceInfo(this.deviceInfo);\n this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, undefined);\n this.startKeepaliveTimer(this.deviceInfo.device?.uri, this.deviceInfo.keepaliveInterval);\n this.initiateFailback();\n break;\n }\n catch (err) {\n const body = err;\n abort = await handleRegistrationErrors(body, (clientError, finalError) => {\n if (finalError) {\n this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);\n }\n else {\n this.lineEmitter(LINE_EVENTS.UNREGISTERED);\n }\n this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION_ERROR, REG_ACTION.REGISTER, METRIC_TYPE.BEHAVIORAL, clientError);\n }, { method: this.attemptRegistrationWithServers.name, file: REGISTRATION_FILE }, this.restoreRegistrationCallBack());\n if (this.registrationStatus === RegistrationStatus.ACTIVE) {\n log.info(`[${caller}] : Device is already restored, active mobius url: ${this.activeMobiusUrl}`, {\n file: REGISTRATION_FILE,\n method: this.attemptRegistrationWithServers.name,\n });\n break;\n }\n if (abort) {\n this.setStatus(RegistrationStatus.INACTIVE);\n break;\n }\n else if (caller === this.executeFailback.name) {\n const error = body.statusCode;\n if (error === ERROR_CODE.TOO_MANY_REQUESTS) {\n await this.scheduleFailback429Retry();\n abort = true;\n break;\n }\n }\n }\n }\n return abort;\n }\n async startKeepaliveTimer(url, interval) {\n this.clearKeepaliveTimer();\n const RETRY_COUNT_THRESHOLD = this.isCCFlow ? 4 : 5;\n await this.mutex.runExclusive(async () => {\n if (this.isDeviceRegistered()) {\n const accessToken = await this.webex.credentials.getUserToken();\n if (!this.webWorker) {\n this.webWorker = new Worker(new URL('./webWorker.js', import.meta.url));\n this.webWorker.postMessage({\n type: WorkerMessageType.START_KEEPALIVE,\n accessToken: String(accessToken),\n deviceUrl: String(this.webex.internal.device.url),\n interval,\n retryCountThreshold: RETRY_COUNT_THRESHOLD,\n url,\n });\n this.webWorker.onmessage = async (event) => {\n const logContext = {\n file: REGISTRATION_FILE,\n method: this.startKeepaliveTimer.name,\n };\n if (event.data.type === WorkerMessageType.KEEPALIVE_SUCCESS) {\n log.info(`Sent Keepalive, status: ${event.data.statusCode}`, logContext);\n this.lineEmitter(LINE_EVENTS.RECONNECTED);\n }\n if (event.data.type === WorkerMessageType.KEEPALIVE_FAILURE) {\n const error = event.data.err;\n log.warn(`Keep-alive missed ${event.data.keepAliveRetryCount} times. Status -> ${error.statusCode} `, logContext);\n const abort = await handleRegistrationErrors(error, (clientError, finalError) => {\n if (finalError) {\n this.lineEmitter(LINE_EVENTS.ERROR, undefined, clientError);\n }\n this.metricManager.submitRegistrationMetric(METRIC_EVENT.REGISTRATION, REG_ACTION.KEEPALIVE_FAILURE, METRIC_TYPE.BEHAVIORAL, clientError);\n }, { method: this.startKeepaliveTimer.name, file: REGISTRATION_FILE });\n if (abort || event.data.keepAliveRetryCount >= RETRY_COUNT_THRESHOLD) {\n this.failoverImmediately = this.isCCFlow;\n this.setStatus(RegistrationStatus.INACTIVE);\n this.clearKeepaliveTimer();\n this.clearFailbackTimer();\n this.lineEmitter(LINE_EVENTS.UNREGISTERED);\n if (!abort) {\n await this.reconnectOnFailure(this.startKeepaliveTimer.name);\n }\n }\n else {\n this.lineEmitter(LINE_EVENTS.RECONNECTING);\n }\n }\n };\n }\n }\n });\n }\n clearKeepaliveTimer() {\n if (this.webWorker) {\n this.webWorker.postMessage({ type: WorkerMessageType.CLEAR_KEEPALIVE });\n this.webWorker.terminate();\n this.webWorker = undefined;\n }\n }\n isReconnectPending() {\n return this.reconnectPending;\n }\n async deregister() {\n try {\n await this.deleteRegistration(this.activeMobiusUrl, this.deviceInfo.device?.deviceId, this.deviceInfo.device?.clientDeviceUri);\n }\n catch (err) {\n log.warn(`Delete failed with Mobius`, {});\n }\n this.clearKeepaliveTimer();\n this.setStatus(RegistrationStatus.INACTIVE);\n }\n isRegRetry() {\n return this.registerRetry;\n }\n setRegRetry(value) {\n this.registerRetry = value;\n }\n getExistingDevice(restoreData) {\n if (restoreData.devices && restoreData.devices.length > 0) {\n this.deviceInfo = {\n userId: restoreData.userId,\n device: restoreData.devices[0],\n keepaliveInterval: DEFAULT_KEEPALIVE_INTERVAL,\n rehomingIntervalMax: DEFAULT_REHOMING_INTERVAL_MAX,\n rehomingIntervalMin: DEFAULT_REHOMING_INTERVAL_MIN,\n };\n const stringToReplace = `${DEVICES_ENDPOINT_RESOURCE}/${restoreData.devices[0].deviceId}`;\n const uri = restoreData.devices[0].uri.replace(stringToReplace, '');\n this.setActiveMobiusUrl(uri);\n this.registrationStatus = RegistrationStatus.ACTIVE;\n return true;\n }\n return false;\n }\n async reconnectOnFailure(caller) {\n this.reconnectPending = false;\n if (!this.isDeviceRegistered()) {\n if (Object.keys(this.callManager.getActiveCalls()).length === 0) {\n const abort = await this.restorePreviousRegistration(caller);\n if (!abort && !this.isDeviceRegistered()) {\n await this.restartRegistration(caller);\n }\n }\n else {\n this.reconnectPending = true;\n log.info('Active call(s) present, deferred reconnect till call cleanup.', {\n file: REGISTRATION_FILE,\n method: this.reconnectOnFailure.name,\n });\n }\n }\n }\n}\nexport const createRegistration = (webex, serviceData, mutex, lineEmitter, logLevel, jwe) => new Registration(webex, serviceData, mutex, lineEmitter, logLevel, jwe);\n","import { FAILURE_MESSAGE, SCIM_ENTERPRISE_USER, SCIM_WEBEXIDENTITY_USER, STATUS_CODE, SUCCESS_MESSAGE, } from '../common/constants';\nimport { HTTP_METHODS } from '../common/types';\nimport SDKConnector from '../SDKConnector';\nimport log from '../Logger';\nimport { CONTACTS_FILE, CONTACTS_SCHEMA, CONTACT_FILTER, DEFAULT_GROUP_NAME, ENCRYPT_FILTER, GROUP_FILTER, OR, SCIM_ID_FILTER, USERS, encryptedFields, } from './constants';\nimport { ContactType, GroupType, } from './types';\nimport { scimQuery, serviceErrorCodeHandler } from '../common/Utils';\nexport class ContactsClient {\n sdkConnector;\n encryptionKeyUrl;\n webex;\n groups;\n contacts;\n defaultGroupId;\n constructor(webex, logger) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.encryptionKeyUrl = '';\n this.groups = undefined;\n this.contacts = undefined;\n this.defaultGroupId = '';\n log.setLogger(logger.level, CONTACTS_FILE);\n }\n async decryptContactDetail(encryptionKeyUrl, contactDetails) {\n const decryptedContactDetail = [...contactDetails];\n const decryptedValues = await Promise.all(decryptedContactDetail.map((detail) => this.webex.internal.encryption.decryptText(encryptionKeyUrl, detail.value)));\n decryptedValues.forEach((decryptedValue, index) => {\n decryptedContactDetail[index].value = decryptedValue;\n });\n return decryptedContactDetail;\n }\n async encryptContactDetail(encryptionKeyUrl, contactDetails) {\n const encryptedContactDetail = [...contactDetails];\n const encryptedValues = await Promise.all(encryptedContactDetail.map((detail) => this.webex.internal.encryption.encryptText(encryptionKeyUrl, detail.value)));\n encryptedValues.forEach((encryptedValue, index) => {\n encryptedContactDetail[index].value = encryptedValue;\n });\n return encryptedContactDetail;\n }\n async encryptContact(contact) {\n const { encryptionKeyUrl } = contact;\n const encryptedContact = { ...contact };\n const encryptionPromises = Object.values(encryptedFields).map(async (field) => {\n switch (field) {\n case encryptedFields.ADDRESS_INFO: {\n const plaintextAddressInfo = encryptedContact.addressInfo;\n let encryptedAddressInfo;\n if (plaintextAddressInfo) {\n const encryptedAddressInfoPromises = Object.entries(plaintextAddressInfo).map(async ([key, value]) => [\n key,\n await this.webex.internal.encryption.encryptText(encryptionKeyUrl, value),\n ]);\n encryptedAddressInfo = Object.fromEntries(await Promise.all(encryptedAddressInfoPromises));\n }\n return [field, encryptedAddressInfo];\n }\n case encryptedFields.EMAILS:\n case encryptedFields.PHONE_NUMBERS:\n case encryptedFields.SIP_ADDRESSES: {\n const plainTextDetails = encryptedContact[field];\n let encryptedDetails;\n if (plainTextDetails) {\n encryptedDetails = await this.encryptContactDetail(encryptionKeyUrl, plainTextDetails);\n }\n return [field, encryptedDetails];\n }\n default: {\n let encryptedValue;\n if (Object.values(encryptedFields).includes(field) && encryptedContact[field]) {\n encryptedValue = await this.webex.internal.encryption.encryptText(encryptionKeyUrl, encryptedContact[field]);\n }\n return [field, encryptedValue];\n }\n }\n });\n const encryptedFieldsList = await Promise.all(encryptionPromises);\n encryptedFieldsList.forEach(([field, value]) => {\n if (value !== undefined) {\n encryptedContact[field] = value;\n }\n });\n return encryptedContact;\n }\n async decryptContact(contact) {\n const { encryptionKeyUrl } = contact;\n const decryptedContact = { ...contact };\n const decryptionPromises = Object.values(encryptedFields).map(async (field) => {\n switch (field) {\n case encryptedFields.ADDRESS_INFO: {\n const plaintextAddressInfo = decryptedContact.addressInfo;\n let decryptedAddressInfo;\n if (plaintextAddressInfo) {\n const decryptedAddressInfoPromises = Object.entries(plaintextAddressInfo).map(async ([key, value]) => [\n key,\n await this.webex.internal.encryption.decryptText(encryptionKeyUrl, value),\n ]);\n decryptedAddressInfo = Object.fromEntries(await Promise.all(decryptedAddressInfoPromises));\n }\n return [field, decryptedAddressInfo];\n }\n case encryptedFields.EMAILS:\n case encryptedFields.PHONE_NUMBERS:\n case encryptedFields.SIP_ADDRESSES: {\n const plainTextDetails = decryptedContact[field];\n let decryptedDetails;\n if (plainTextDetails) {\n decryptedDetails = await this.decryptContactDetail(encryptionKeyUrl, plainTextDetails);\n }\n return [field, decryptedDetails];\n }\n default: {\n let decryptedValue;\n if (Object.values(encryptedFields).includes(field) && decryptedContact[field]) {\n decryptedValue = await this.webex.internal.encryption.decryptText(encryptionKeyUrl, decryptedContact[field]);\n }\n return [field, decryptedValue];\n }\n }\n });\n const decryptedFieldsList = await Promise.all(decryptionPromises);\n decryptedFieldsList.forEach(([field, value]) => {\n if (value !== undefined) {\n decryptedContact[field] = value;\n }\n });\n return decryptedContact;\n }\n resolveCloudContacts(contactsDataMap, inputList) {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: 'resolveCloudContacts',\n };\n const finalContactList = [];\n const resolvedList = [];\n try {\n inputList.Resources.forEach((item) => {\n resolvedList.push(item.id);\n });\n Object.values(contactsDataMap).forEach((item) => {\n const isResolved = resolvedList.some((listItem) => listItem === item.contactId);\n if (!isResolved) {\n finalContactList.push({ ...item, resolved: false });\n }\n });\n for (let n = 0; n < inputList.Resources.length; n += 1) {\n const filteredContact = inputList.Resources[n];\n const { displayName, emails, phoneNumbers, photos } = filteredContact;\n let sipAddresses;\n if (filteredContact[SCIM_WEBEXIDENTITY_USER]) {\n sipAddresses = filteredContact[SCIM_WEBEXIDENTITY_USER].sipAddresses;\n }\n const firstName = filteredContact.name?.givenName;\n const lastName = filteredContact.name?.familyName;\n const manager = filteredContact[SCIM_ENTERPRISE_USER]?.manager?.displayName;\n const department = filteredContact[SCIM_ENTERPRISE_USER]?.department;\n const avatarURL = photos?.length ? photos[0].value : '';\n const { contactType, avatarUrlDomain, encryptionKeyUrl, ownerId, groups } = contactsDataMap[inputList.Resources[n].id];\n const cloudContact = {\n avatarUrlDomain,\n avatarURL,\n contactId: inputList.Resources[n].id,\n contactType,\n department,\n displayName,\n emails,\n encryptionKeyUrl,\n firstName,\n groups,\n lastName,\n manager,\n ownerId,\n phoneNumbers,\n sipAddresses,\n resolved: true,\n };\n finalContactList.push(cloudContact);\n }\n }\n catch (error) {\n log.warn('Error occurred while parsing resolved contacts', loggerContext);\n return null;\n }\n return finalContactList;\n }\n async getContacts() {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: 'getContacts',\n };\n const contactList = [];\n const cloudContactsMap = {};\n try {\n const response = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${CONTACT_FILTER}`,\n method: HTTP_METHODS.GET,\n });\n const responseBody = response.body;\n if (!responseBody) {\n throw new Error(`${response}`);\n }\n const { contacts, groups } = responseBody;\n await Promise.all(contacts.map(async (contact) => {\n if (contact.contactType === ContactType.CUSTOM) {\n const decryptedContact = await this.decryptContact(contact);\n contactList.push(decryptedContact);\n }\n else if (contact.contactType === ContactType.CLOUD && contact.contactId) {\n cloudContactsMap[contact.contactId] = contact;\n }\n }));\n if (Object.keys(cloudContactsMap).length) {\n const contactIdList = Object.keys(cloudContactsMap);\n const totalContacts = contactIdList.length;\n const MAX_CONTACTS_PER_QUERY = 50;\n for (let i = 0; i < totalContacts; i += MAX_CONTACTS_PER_QUERY) {\n try {\n const contactIdListChunk = contactIdList.slice(i, i + MAX_CONTACTS_PER_QUERY);\n const query = contactIdListChunk.map((item) => `${SCIM_ID_FILTER} \"${item}\"`).join(OR);\n const result = await scimQuery(query);\n const slicedCloudContactsMap = Object.fromEntries(Object.entries(cloudContactsMap).slice(i, i + MAX_CONTACTS_PER_QUERY));\n const resolvedContacts = this.resolveCloudContacts(slicedCloudContactsMap, result.body);\n if (resolvedContacts) {\n resolvedContacts.forEach((item) => contactList.push(item));\n }\n }\n catch (error) {\n log.warn(`Error processing contact chunk ${i}-${i + MAX_CONTACTS_PER_QUERY}`, loggerContext);\n }\n }\n }\n await Promise.all(groups.map(async (group, idx) => {\n groups[idx].displayName = await this.webex.internal.encryption.decryptText(group.encryptionKeyUrl, group.displayName);\n }));\n this.groups = groups;\n this.contacts = contactList;\n const contactResponse = {\n statusCode: Number(response[STATUS_CODE]),\n data: {\n contacts: contactList,\n groups,\n },\n message: SUCCESS_MESSAGE,\n };\n return contactResponse;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async createNewEncryptionKeyUrl() {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: this.createNewEncryptionKeyUrl.name,\n };\n let unboundedKeyUri = '';\n log.info('Requesting kms for a new KRO and key', loggerContext);\n const unboundedKeys = await this.webex.internal.encryption.kms.createUnboundKeys({ count: 1 });\n unboundedKeyUri = unboundedKeys[0].uri;\n this.webex.internal.encryption.kms.createResource({ keyUris: [unboundedKeyUri] });\n return unboundedKeyUri;\n }\n async fetchEncryptionKeyUrl() {\n if (this.encryptionKeyUrl) {\n return this.encryptionKeyUrl;\n }\n if (this.groups === undefined) {\n this.getContacts();\n }\n if (this.groups && this.groups.length) {\n return this.groups[0].encryptionKeyUrl;\n }\n this.encryptionKeyUrl = await this.createNewEncryptionKeyUrl();\n log.info(`Creating a default group: ${DEFAULT_GROUP_NAME}`, {\n file: CONTACTS_FILE,\n method: this.fetchEncryptionKeyUrl.name,\n });\n const response = await this.createContactGroup(DEFAULT_GROUP_NAME, this.encryptionKeyUrl);\n if (response.data.group?.groupId) {\n this.defaultGroupId = response.data.group?.groupId;\n }\n return this.encryptionKeyUrl;\n }\n async fetchDefaultGroup() {\n if (this.defaultGroupId) {\n return this.defaultGroupId;\n }\n if (this.groups && this.groups.length) {\n for (let i = 0; i < this.groups.length; i += 1) {\n if (this.groups[i].displayName === DEFAULT_GROUP_NAME) {\n this.defaultGroupId = this.groups[i].groupId;\n return this.defaultGroupId;\n }\n }\n }\n log.info('No default group found.', {\n file: CONTACTS_FILE,\n method: this.fetchDefaultGroup.name,\n });\n const response = await this.createContactGroup(DEFAULT_GROUP_NAME);\n const { group } = response.data;\n if (group) {\n return group.groupId;\n }\n return '';\n }\n async createContactGroup(displayName, encryptionKeyUrl, groupType) {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: this.createContactGroup.name,\n };\n log.info(`Creating contact group ${displayName}`, loggerContext);\n const encryptionKeyUrlFinal = encryptionKeyUrl || (await this.fetchEncryptionKeyUrl());\n if (this.groups === undefined) {\n await this.getContacts();\n }\n if (this.groups && this.groups.length) {\n const isExistingGroup = this.groups.find((group) => {\n return group.displayName === displayName;\n });\n if (isExistingGroup) {\n log.warn(`Group name ${displayName} already exists.`, loggerContext);\n return {\n statusCode: 400,\n data: { error: 'Group displayName already exists' },\n message: FAILURE_MESSAGE,\n };\n }\n }\n const encryptedDisplayName = await this.webex.internal.encryption.encryptText(encryptionKeyUrlFinal, displayName);\n const groupInfo = {\n schemas: CONTACTS_SCHEMA,\n displayName: encryptedDisplayName,\n groupType: groupType || GroupType.NORMAL,\n encryptionKeyUrl: encryptionKeyUrlFinal,\n };\n try {\n const response = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${GROUP_FILTER}`,\n method: HTTP_METHODS.POST,\n body: groupInfo,\n });\n const group = response.body;\n group.displayName = displayName;\n const contactResponse = {\n statusCode: Number(response[STATUS_CODE]),\n data: {\n group,\n },\n message: SUCCESS_MESSAGE,\n };\n this.groups?.push(group);\n return contactResponse;\n }\n catch (err) {\n log.warn('Unable to create contact group.', loggerContext);\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteContactGroup(groupId) {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: this.deleteContactGroup.name,\n };\n try {\n log.info(`Deleting contact group: ${groupId}`, loggerContext);\n const response = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${GROUP_FILTER}/${groupId}`,\n method: HTTP_METHODS.DELETE,\n });\n const contactResponse = {\n statusCode: Number(response[STATUS_CODE]),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n const groupToDelete = this.groups?.findIndex((group) => group.groupId === groupId);\n if (groupToDelete !== undefined && groupToDelete !== -1) {\n this.groups?.splice(groupToDelete, 1);\n }\n if (!this.groups?.length) {\n this.defaultGroupId = '';\n }\n return contactResponse;\n }\n catch (err) {\n log.warn(`Unable to delete contact group ${groupId}`, loggerContext);\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async createContact(contactInfo) {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: this.createContact.name,\n };\n log.info(`Request to create contact: contactType: ${contactInfo.contactType}`, loggerContext);\n try {\n const contact = { ...contactInfo };\n if (!contact.encryptionKeyUrl) {\n contact.encryptionKeyUrl = await this.fetchEncryptionKeyUrl();\n }\n if (!contact.groups || contact.groups.length === 0) {\n const defaultGroupId = await this.fetchDefaultGroup();\n contact.groups = [defaultGroupId];\n }\n contact.schemas = CONTACTS_SCHEMA;\n let requestBody = {};\n switch (contact.contactType) {\n case ContactType.CUSTOM: {\n const encryptedContact = await this.encryptContact(contact);\n requestBody = encryptedContact;\n break;\n }\n case ContactType.CLOUD: {\n if (!contact.contactId) {\n return {\n statusCode: 400,\n data: {\n error: 'contactId is required for contactType:CLOUD.',\n },\n message: FAILURE_MESSAGE,\n };\n }\n const encryptedContact = await this.encryptContact(contact);\n requestBody = encryptedContact;\n break;\n }\n default: {\n return {\n statusCode: 400,\n data: {\n error: 'Unknown contactType received.',\n },\n message: FAILURE_MESSAGE,\n };\n }\n }\n const response = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${CONTACT_FILTER}`,\n method: HTTP_METHODS.POST,\n body: requestBody,\n });\n const newContact = response.body;\n contact.contactId = newContact.contactId;\n const contactResponse = {\n statusCode: Number(response[STATUS_CODE]),\n data: {\n contact,\n },\n message: SUCCESS_MESSAGE,\n };\n if (contact.contactType === ContactType.CLOUD && newContact.contactId) {\n const query = `${SCIM_ID_FILTER} \"${newContact.contactId}\"`;\n const res = await scimQuery(query);\n const resolvedContact = this.resolveCloudContacts(Object.fromEntries([[newContact.contactId, newContact]]), res.body);\n if (resolvedContact) {\n this.contacts?.push(resolvedContact[0]);\n }\n }\n else {\n this.contacts?.push(contact);\n }\n return contactResponse;\n }\n catch (err) {\n log.warn('Failed to create contact.', {\n file: CONTACTS_FILE,\n method: this.createContact.name,\n });\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteContact(contactId) {\n const loggerContext = {\n file: CONTACTS_FILE,\n method: this.deleteContact.name,\n };\n try {\n log.info(`Deleting contact : ${contactId}`, loggerContext);\n const response = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.contactsService}/${ENCRYPT_FILTER}/${USERS}/${CONTACT_FILTER}/${contactId}`,\n method: HTTP_METHODS.DELETE,\n });\n const contactResponse = {\n statusCode: Number(response[STATUS_CODE]),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n const contactToDelete = this.contacts?.findIndex((contact) => contact.contactId === contactId);\n if (contactToDelete !== undefined && contactToDelete !== -1) {\n this.contacts?.splice(contactToDelete, 1);\n }\n return contactResponse;\n }\n catch (err) {\n log.warn(`Unable to delete contact ${contactId}`, loggerContext);\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n}\nexport const createContactsClient = (webex, logger) => new ContactsClient(webex, logger);\n","export const CONTACTS_FILE = 'Contacts';\nexport const CONTACT_FILTER = 'contacts';\nexport const GROUP_FILTER = 'groups';\nexport const ENCRYPT_FILTER = 'encrypt';\nexport const USERS = 'Users';\nexport const DEFAULT_GROUP_NAME = 'Other contacts';\nexport const CONTACTS_SCHEMA = 'urn:cisco:codev:identity:contact:core:1.0';\nexport const SCIM_ID_FILTER = 'id eq';\nexport const OR = ' or ';\nexport var encryptedFields;\n(function (encryptedFields) {\n encryptedFields[\"ADDRESS_INFO\"] = \"addressInfo\";\n encryptedFields[\"AVATAR_URL\"] = \"avatarURL\";\n encryptedFields[\"COMPANY\"] = \"companyName\";\n encryptedFields[\"DISPLAY_NAME\"] = \"displayName\";\n encryptedFields[\"EMAILS\"] = \"emails\";\n encryptedFields[\"FIRST_NAME\"] = \"firstName\";\n encryptedFields[\"LAST_NAME\"] = \"lastName\";\n encryptedFields[\"PHONE_NUMBERS\"] = \"phoneNumbers\";\n encryptedFields[\"SIP_ADDRESSES\"] = \"sipAddresses\";\n encryptedFields[\"TITLE\"] = \"title\";\n})(encryptedFields || (encryptedFields = {}));\n","export var ContactType;\n(function (ContactType) {\n ContactType[\"CUSTOM\"] = \"CUSTOM\";\n ContactType[\"CLOUD\"] = \"CLOUD\";\n})(ContactType || (ContactType = {}));\nexport var GroupType;\n(function (GroupType) {\n GroupType[\"NORMAL\"] = \"NORMAL\";\n GroupType[\"EXTERNAL\"] = \"EXTERNAL\";\n})(GroupType || (GroupType = {}));\n","import ExtendedError from './ExtendedError';\nexport class CallError extends ExtendedError {\n correlationId;\n errorLayer;\n constructor(msg, context, type, correlationId, errorLayer) {\n super(msg, context, type);\n this.correlationId = correlationId;\n this.errorLayer = errorLayer;\n }\n setCallError(error) {\n this.message = error.message;\n this.correlationId = error.correlationId;\n this.context = error.context;\n this.type = error.type;\n }\n getCallError() {\n return {\n message: this.message,\n context: this.context,\n type: this.type,\n correlationId: this.correlationId,\n errorLayer: this.errorLayer,\n };\n }\n}\nexport const createCallError = (msg, context, type, correlationId, errorLayer) => new CallError(msg, context, type, correlationId, errorLayer);\n","import { RegistrationStatus } from '../../common/types';\nimport ExtendedError from './ExtendedError';\nexport class CallingClientError extends ExtendedError {\n status = RegistrationStatus.INACTIVE;\n constructor(msg, context, type, status) {\n super(msg, context, type);\n this.status = status;\n }\n setError(error) {\n this.message = error.message;\n this.context = error.context;\n this.type = error.type;\n }\n getError() {\n return { message: this.message, context: this.context, type: this.type };\n }\n}\nexport const createClientError = (msg, context, type, status) => new CallingClientError(msg, context, type, status);\n","import { ERROR_TYPE } from '../types';\nexport default class ExtendedError extends Error {\n type;\n context;\n constructor(msg, context, type) {\n super(msg);\n this.type = type || ERROR_TYPE.DEFAULT;\n this.context = context;\n }\n}\n","import { RegistrationStatus } from '../../common/types';\nimport ExtendedError from './ExtendedError';\nexport class LineError extends ExtendedError {\n status = RegistrationStatus.INACTIVE;\n constructor(msg, context, type, status) {\n super(msg, context, type);\n this.status = status;\n }\n setError(error) {\n this.message = error.message;\n this.context = error.context;\n this.type = error.type;\n this.status = error.status;\n }\n getError() {\n return {\n message: this.message,\n context: this.context,\n type: this.type,\n status: this.status,\n };\n }\n}\nexport const createLineError = (msg, context, type, status) => new LineError(msg, context, type, status);\n","export { CallingClientError } from './catalog/CallingDeviceError';\nexport { CallError } from './catalog/CallError';\nexport { LineError } from './catalog/LineError';\n","export var ERROR_LAYER;\n(function (ERROR_LAYER) {\n ERROR_LAYER[\"CALL_CONTROL\"] = \"call_control\";\n ERROR_LAYER[\"MEDIA\"] = \"media\";\n})(ERROR_LAYER || (ERROR_LAYER = {}));\nexport var ERROR_TYPE;\n(function (ERROR_TYPE) {\n ERROR_TYPE[\"CALL_ERROR\"] = \"call_error\";\n ERROR_TYPE[\"DEFAULT\"] = \"default_error\";\n ERROR_TYPE[\"FORBIDDEN_ERROR\"] = \"forbidden\";\n ERROR_TYPE[\"NOT_FOUND\"] = \"not_found\";\n ERROR_TYPE[\"REGISTRATION_ERROR\"] = \"registration_error\";\n ERROR_TYPE[\"SERVICE_UNAVAILABLE\"] = \"service_unavailable\";\n ERROR_TYPE[\"TIMEOUT\"] = \"timeout\";\n ERROR_TYPE[\"TOKEN_ERROR\"] = \"token_error\";\n ERROR_TYPE[\"SERVER_ERROR\"] = \"server_error\";\n})(ERROR_TYPE || (ERROR_TYPE = {}));\nexport var ERROR_CODE;\n(function (ERROR_CODE) {\n ERROR_CODE[ERROR_CODE[\"UNAUTHORIZED\"] = 401] = \"UNAUTHORIZED\";\n ERROR_CODE[ERROR_CODE[\"FORBIDDEN\"] = 403] = \"FORBIDDEN\";\n ERROR_CODE[ERROR_CODE[\"DEVICE_NOT_FOUND\"] = 404] = \"DEVICE_NOT_FOUND\";\n ERROR_CODE[ERROR_CODE[\"INTERNAL_SERVER_ERROR\"] = 500] = \"INTERNAL_SERVER_ERROR\";\n ERROR_CODE[ERROR_CODE[\"NOT_IMPLEMENTED\"] = 501] = \"NOT_IMPLEMENTED\";\n ERROR_CODE[ERROR_CODE[\"SERVICE_UNAVAILABLE\"] = 503] = \"SERVICE_UNAVAILABLE\";\n ERROR_CODE[ERROR_CODE[\"BAD_REQUEST\"] = 400] = \"BAD_REQUEST\";\n ERROR_CODE[ERROR_CODE[\"REQUEST_TIMEOUT\"] = 408] = \"REQUEST_TIMEOUT\";\n ERROR_CODE[ERROR_CODE[\"TOO_MANY_REQUESTS\"] = 429] = \"TOO_MANY_REQUESTS\";\n})(ERROR_CODE || (ERROR_CODE = {}));\nexport var CALL_ERROR_CODE;\n(function (CALL_ERROR_CODE) {\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"INVALID_STATUS_UPDATE\"] = 111] = \"INVALID_STATUS_UPDATE\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"DEVICE_NOT_REGISTERED\"] = 112] = \"DEVICE_NOT_REGISTERED\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"CALL_NOT_FOUND\"] = 113] = \"CALL_NOT_FOUND\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"ERROR_PROCESSING\"] = 114] = \"ERROR_PROCESSING\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"USER_BUSY\"] = 115] = \"USER_BUSY\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"PARSING_ERROR\"] = 116] = \"PARSING_ERROR\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"TIMEOUT_ERROR\"] = 117] = \"TIMEOUT_ERROR\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"NOT_ACCEPTABLE\"] = 118] = \"NOT_ACCEPTABLE\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"CALL_REJECTED\"] = 119] = \"CALL_REJECTED\";\n CALL_ERROR_CODE[CALL_ERROR_CODE[\"NOT_AVAILABLE\"] = 120] = \"NOT_AVAILABLE\";\n})(CALL_ERROR_CODE || (CALL_ERROR_CODE = {}));\nexport var DEVICE_ERROR_CODE;\n(function (DEVICE_ERROR_CODE) {\n DEVICE_ERROR_CODE[DEVICE_ERROR_CODE[\"DEVICE_LIMIT_EXCEEDED\"] = 101] = \"DEVICE_LIMIT_EXCEEDED\";\n DEVICE_ERROR_CODE[DEVICE_ERROR_CODE[\"DEVICE_CREATION_DISABLED\"] = 102] = \"DEVICE_CREATION_DISABLED\";\n DEVICE_ERROR_CODE[DEVICE_ERROR_CODE[\"DEVICE_CREATION_FAILED\"] = 103] = \"DEVICE_CREATION_FAILED\";\n})(DEVICE_ERROR_CODE || (DEVICE_ERROR_CODE = {}));\n","import EventEmitter from 'events';\nimport Logger from '../../Logger';\nimport { LOG_PREFIX } from '../../Logger/types';\nexport class Eventing extends EventEmitter {\n emit(event, ...args) {\n const timestamp = new Date().toUTCString();\n Logger.log(`${timestamp} ${LOG_PREFIX.EVENT}: ${event.toString()} - event emitted with parameters -> ${args} = `, {\n file: 'Events/impl/index.ts',\n method: 'emit',\n });\n return super.emit(event, ...args);\n }\n on(event, listener) {\n return super.on(event, listener);\n }\n off(event, listener) {\n return super.off(event, listener);\n }\n}\n","import { LINE_EVENTS } from '../CallingClient/line/types';\nexport var COMMON_EVENT_KEYS;\n(function (COMMON_EVENT_KEYS) {\n COMMON_EVENT_KEYS[\"CB_VOICEMESSAGE_CONTENT_GET\"] = \"call_back_voicemail_content_get\";\n COMMON_EVENT_KEYS[\"CALL_HISTORY_USER_SESSION_INFO\"] = \"callHistory:user_recent_sessions\";\n COMMON_EVENT_KEYS[\"CALL_HISTORY_USER_VIEWED_SESSIONS\"] = \"callHistory:user_viewed_sessions\";\n COMMON_EVENT_KEYS[\"CALL_HISTORY_USER_SESSIONS_DELETED\"] = \"callHistory:user_sessions_deleted\";\n})(COMMON_EVENT_KEYS || (COMMON_EVENT_KEYS = {}));\nexport var LINE_EVENT_KEYS;\n(function (LINE_EVENT_KEYS) {\n LINE_EVENT_KEYS[\"INCOMING_CALL\"] = \"incoming_call\";\n})(LINE_EVENT_KEYS || (LINE_EVENT_KEYS = {}));\nexport var CALLING_CLIENT_EVENT_KEYS;\n(function (CALLING_CLIENT_EVENT_KEYS) {\n CALLING_CLIENT_EVENT_KEYS[\"ERROR\"] = \"callingClient:error\";\n CALLING_CLIENT_EVENT_KEYS[\"OUTGOING_CALL\"] = \"callingClient:outgoing_call\";\n CALLING_CLIENT_EVENT_KEYS[\"USER_SESSION_INFO\"] = \"callingClient:user_recent_sessions\";\n CALLING_CLIENT_EVENT_KEYS[\"ALL_CALLS_CLEARED\"] = \"callingClient:all_calls_cleared\";\n})(CALLING_CLIENT_EVENT_KEYS || (CALLING_CLIENT_EVENT_KEYS = {}));\nexport var CALL_EVENT_KEYS;\n(function (CALL_EVENT_KEYS) {\n CALL_EVENT_KEYS[\"ALERTING\"] = \"alerting\";\n CALL_EVENT_KEYS[\"CALL_ERROR\"] = \"call_error\";\n CALL_EVENT_KEYS[\"CALLER_ID\"] = \"caller_id\";\n CALL_EVENT_KEYS[\"CONNECT\"] = \"connect\";\n CALL_EVENT_KEYS[\"DISCONNECT\"] = \"disconnect\";\n CALL_EVENT_KEYS[\"ESTABLISHED\"] = \"established\";\n CALL_EVENT_KEYS[\"HELD\"] = \"held\";\n CALL_EVENT_KEYS[\"HOLD_ERROR\"] = \"hold_error\";\n CALL_EVENT_KEYS[\"PROGRESS\"] = \"progress\";\n CALL_EVENT_KEYS[\"REMOTE_MEDIA\"] = \"remote_media\";\n CALL_EVENT_KEYS[\"RESUME_ERROR\"] = \"resume_error\";\n CALL_EVENT_KEYS[\"RESUMED\"] = \"resumed\";\n CALL_EVENT_KEYS[\"TRANSFER_ERROR\"] = \"transfer_error\";\n})(CALL_EVENT_KEYS || (CALL_EVENT_KEYS = {}));\nexport var SUPPLEMENTARY_SERVICES;\n(function (SUPPLEMENTARY_SERVICES) {\n SUPPLEMENTARY_SERVICES[\"HOLD\"] = \"hold\";\n SUPPLEMENTARY_SERVICES[\"RESUME\"] = \"resume\";\n SUPPLEMENTARY_SERVICES[\"DIVERT\"] = \"divert\";\n SUPPLEMENTARY_SERVICES[\"TRANSFER\"] = \"transfer\";\n SUPPLEMENTARY_SERVICES[\"PARK\"] = \"park\";\n})(SUPPLEMENTARY_SERVICES || (SUPPLEMENTARY_SERVICES = {}));\nexport var MOBIUS_MIDCALL_STATE;\n(function (MOBIUS_MIDCALL_STATE) {\n MOBIUS_MIDCALL_STATE[\"HELD\"] = \"HELD\";\n MOBIUS_MIDCALL_STATE[\"CONNECTED\"] = \"CONNECTED\";\n})(MOBIUS_MIDCALL_STATE || (MOBIUS_MIDCALL_STATE = {}));\nexport var Disposition;\n(function (Disposition) {\n Disposition[\"ANSWERED\"] = \"Answered\";\n Disposition[\"CANCELED\"] = \"Canceled\";\n Disposition[\"INITIATED\"] = \"Initiated\";\n Disposition[\"MISSED\"] = \"MISSED\";\n})(Disposition || (Disposition = {}));\nexport var SessionType;\n(function (SessionType) {\n SessionType[\"SPARK\"] = \"SPARK\";\n SessionType[\"WEBEX_CALLING\"] = \"WEBEXCALLING\";\n})(SessionType || (SessionType = {}));\nexport var MOBIUS_EVENT_KEYS;\n(function (MOBIUS_EVENT_KEYS) {\n MOBIUS_EVENT_KEYS[\"SERVER_EVENT_INCLUSIVE\"] = \"event:mobius\";\n MOBIUS_EVENT_KEYS[\"CALL_SESSION_EVENT_INCLUSIVE\"] = \"event:janus.user_recent_sessions\";\n MOBIUS_EVENT_KEYS[\"CALL_SESSION_EVENT_LEGACY\"] = \"event:janus.user_sessions\";\n MOBIUS_EVENT_KEYS[\"CALL_SESSION_EVENT_VIEWED\"] = \"event:janus.user_viewed_sessions\";\n MOBIUS_EVENT_KEYS[\"CALL_SESSION_EVENT_DELETED\"] = \"event:janus.user_sessions_deleted\";\n})(MOBIUS_EVENT_KEYS || (MOBIUS_EVENT_KEYS = {}));\nexport var MEDIA_CONNECTION_EVENT_KEYS;\n(function (MEDIA_CONNECTION_EVENT_KEYS) {\n MEDIA_CONNECTION_EVENT_KEYS[\"ROAP_MESSAGE_TO_SEND\"] = \"roap:messageToSend\";\n MEDIA_CONNECTION_EVENT_KEYS[\"MEDIA_TYPE_AUDIO\"] = \"audio\";\n})(MEDIA_CONNECTION_EVENT_KEYS || (MEDIA_CONNECTION_EVENT_KEYS = {}));\nvar CALL_STATE;\n(function (CALL_STATE) {\n CALL_STATE[\"HELD\"] = \"held\";\n CALL_STATE[\"REMOTE_HELD\"] = \"remoteheld\";\n CALL_STATE[\"CONNECTED\"] = \"connected\";\n})(CALL_STATE || (CALL_STATE = {}));\nexport const WEBSOCKET_SCOPE = 'mobius';\nexport var WEBSOCKET_KEYS;\n(function (WEBSOCKET_KEYS) {\n WEBSOCKET_KEYS[\"CALL_PROGRESS\"] = \"callprogress\";\n WEBSOCKET_KEYS[\"CALL_CONNECTED\"] = \"callconnected\";\n WEBSOCKET_KEYS[\"CALL_DISCONNECTED\"] = \"callconnected\";\n WEBSOCKET_KEYS[\"CALL_INFO\"] = \"callinfo\";\n WEBSOCKET_KEYS[\"CALL\"] = \"call\";\n WEBSOCKET_KEYS[\"ROAP\"] = \"ROAP\";\n})(WEBSOCKET_KEYS || (WEBSOCKET_KEYS = {}));\n","import { REPO_NAME } from '../CallingClient/constants';\nimport { LOGGING_LEVEL, LOGGER, LOG_PREFIX } from './types';\nlet currentLogLevel = LOGGING_LEVEL.error;\nlet webexLogger = console;\nconst writeToLogger = (message, level) => {\n switch (level) {\n case LOGGER.INFO:\n webexLogger.info(message);\n break;\n case LOGGER.LOG: {\n webexLogger.log(message);\n break;\n }\n case LOGGER.WARN: {\n webexLogger.warn(message);\n break;\n }\n case LOGGER.ERROR: {\n webexLogger.error(message);\n break;\n }\n case LOGGER.TRACE: {\n webexLogger.trace(message);\n break;\n }\n default: {\n }\n }\n};\nconst format = (context, level) => {\n const timestamp = new Date().toUTCString();\n return `${REPO_NAME}: ${timestamp}: ${level}: ${LOG_PREFIX.FILE}:${context.file} - ${LOG_PREFIX.METHOD}:${context.method}`;\n};\nconst setLogger = (level, module) => {\n switch (level) {\n case LOGGER.WARN: {\n currentLogLevel = LOGGING_LEVEL.warn;\n break;\n }\n case LOGGER.LOG: {\n currentLogLevel = LOGGING_LEVEL.log;\n break;\n }\n case LOGGER.INFO: {\n currentLogLevel = LOGGING_LEVEL.info;\n break;\n }\n case LOGGER.TRACE: {\n currentLogLevel = LOGGING_LEVEL.trace;\n break;\n }\n default: {\n currentLogLevel = LOGGING_LEVEL.error;\n }\n }\n const message = `Logger initialized for module: ${module} with level: ${currentLogLevel}`;\n writeToLogger(`${format({ file: 'logger.ts', method: 'setLogger' }, '')} - ${LOG_PREFIX.MESSAGE}:${message}`, LOGGER.INFO);\n};\nconst getLogLevel = () => {\n let level;\n switch (currentLogLevel) {\n case LOGGING_LEVEL.warn: {\n level = LOGGER.WARN;\n break;\n }\n case LOGGING_LEVEL.log: {\n level = LOGGER.LOG;\n break;\n }\n case LOGGING_LEVEL.info: {\n level = LOGGER.INFO;\n break;\n }\n case LOGGING_LEVEL.trace: {\n level = LOGGER.TRACE;\n break;\n }\n default: {\n level = LOGGER.ERROR;\n }\n }\n return level;\n};\nconst logMessage = (message, context) => {\n if (currentLogLevel >= LOGGING_LEVEL.log) {\n writeToLogger(`${format(context, '[LOG]')} - ${LOG_PREFIX.MESSAGE}:${message}`, LOGGER.LOG);\n }\n};\nconst logInfo = (message, context) => {\n if (currentLogLevel >= LOGGING_LEVEL.info) {\n writeToLogger(`${format(context, '[INFO]')} - ${LOG_PREFIX.MESSAGE}:${message}`, LOGGER.INFO);\n }\n};\nconst logWarn = (message, context) => {\n if (currentLogLevel >= LOGGING_LEVEL.warn) {\n writeToLogger(`${format(context, '[WARN]')} - ${LOG_PREFIX.MESSAGE}:${message}`, LOGGER.WARN);\n }\n};\nconst logTrace = (message, context) => {\n if (currentLogLevel >= LOGGING_LEVEL.trace) {\n writeToLogger(`${format(context, '[TRACE]')} - ${LOG_PREFIX.MESSAGE}:${message}`, LOGGER.TRACE);\n }\n};\nconst logError = (error, context) => {\n if (currentLogLevel >= LOGGING_LEVEL.error) {\n writeToLogger(`${format(context, '[ERROR]')} - !${LOG_PREFIX.ERROR}!${LOG_PREFIX.MESSAGE}:${error.message}`, LOGGER.ERROR);\n }\n};\nconst setWebexLogger = (logger) => {\n if (logger) {\n webexLogger = logger;\n }\n};\nexport default {\n log: logMessage,\n error: logError,\n info: logInfo,\n warn: logWarn,\n trace: logTrace,\n setLogger,\n getLogLevel,\n setWebexLogger,\n};\n","export var LOG_PREFIX;\n(function (LOG_PREFIX) {\n LOG_PREFIX[\"MAIN\"] = \"CALLING_SDK\";\n LOG_PREFIX[\"FILE\"] = \"file\";\n LOG_PREFIX[\"METHOD\"] = \"method\";\n LOG_PREFIX[\"EVENT\"] = \"event\";\n LOG_PREFIX[\"MESSAGE\"] = \"message\";\n LOG_PREFIX[\"ERROR\"] = \"error\";\n})(LOG_PREFIX || (LOG_PREFIX = {}));\nexport var LOGGING_LEVEL;\n(function (LOGGING_LEVEL) {\n LOGGING_LEVEL[LOGGING_LEVEL[\"error\"] = 1] = \"error\";\n LOGGING_LEVEL[LOGGING_LEVEL[\"warn\"] = 2] = \"warn\";\n LOGGING_LEVEL[LOGGING_LEVEL[\"log\"] = 3] = \"log\";\n LOGGING_LEVEL[LOGGING_LEVEL[\"info\"] = 4] = \"info\";\n LOGGING_LEVEL[LOGGING_LEVEL[\"trace\"] = 5] = \"trace\";\n})(LOGGING_LEVEL || (LOGGING_LEVEL = {}));\nexport var LOGGER;\n(function (LOGGER) {\n LOGGER[\"ERROR\"] = \"error\";\n LOGGER[\"WARN\"] = \"warn\";\n LOGGER[\"INFO\"] = \"info\";\n LOGGER[\"LOG\"] = \"log\";\n LOGGER[\"TRACE\"] = \"trace\";\n})(LOGGER || (LOGGER = {}));\n","import { METRIC_FILE, VERSION } from '../CallingClient/constants';\nimport { METRIC_EVENT } from './types';\nimport log from '../Logger';\nlet metricManager;\nclass MetricManager {\n webex;\n deviceInfo;\n serviceIndicator;\n constructor(webex, indicator) {\n log.info('Initializing metric manager...', { file: METRIC_FILE });\n this.webex = webex;\n this.serviceIndicator = indicator;\n }\n setDeviceInfo(deviceInfo) {\n this.deviceInfo = deviceInfo;\n }\n submitRegistrationMetric(name, metricAction, type, clientError) {\n let data;\n switch (name) {\n case METRIC_EVENT.REGISTRATION: {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n },\n type,\n };\n break;\n }\n case METRIC_EVENT.REGISTRATION_ERROR: {\n if (clientError) {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n error: clientError.getError().message,\n error_type: clientError.getError().type,\n },\n type,\n };\n }\n break;\n }\n default:\n log.warn('Invalid metric name received. Rejecting request to submit metric.', {\n file: METRIC_FILE,\n method: this.submitRegistrationMetric.name,\n });\n break;\n }\n if (data) {\n this.webex.internal.metrics.submitClientMetrics(name, data);\n }\n }\n submitCallMetric(name, metricAction, type, callId, correlationId, callError) {\n let data;\n switch (name) {\n case METRIC_EVENT.CALL: {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n call_id: callId,\n correlation_id: correlationId,\n },\n type,\n };\n break;\n }\n case METRIC_EVENT.CALL_ERROR: {\n if (callError) {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n call_id: callId,\n correlation_id: correlationId,\n error: callError.getCallError().message,\n error_type: callError.getCallError().type,\n },\n type,\n };\n }\n break;\n }\n default:\n log.warn('Invalid metric name received. Rejecting request to submit metric.', {\n file: METRIC_FILE,\n method: this.submitCallMetric.name,\n });\n break;\n }\n if (data) {\n this.webex.internal.metrics.submitClientMetrics(name, data);\n }\n }\n submitMediaMetric(name, metricAction, type, callId, correlationId, localSdp, remoteSdp, callError) {\n let data;\n switch (name) {\n case METRIC_EVENT.MEDIA: {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n call_id: callId,\n correlation_id: correlationId,\n local_media_details: localSdp,\n remote_media_details: remoteSdp,\n },\n type,\n };\n break;\n }\n case METRIC_EVENT.MEDIA_ERROR: {\n if (callError) {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n call_id: callId,\n correlation_id: correlationId,\n local_media_details: localSdp,\n remote_media_details: remoteSdp,\n error: callError.getCallError().message,\n error_type: callError.getCallError().type,\n },\n type,\n };\n }\n break;\n }\n default:\n log.warn('Invalid metric name received. Rejecting request to submit metric.', {\n file: METRIC_FILE,\n method: this.submitMediaMetric.name,\n });\n break;\n }\n if (data) {\n this.webex.internal.metrics.submitClientMetrics(name, data);\n }\n }\n submitVoicemailMetric(name, metricAction, type, messageId, voicemailError, statusCode) {\n let data;\n switch (name) {\n case METRIC_EVENT.VOICEMAIL: {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n message_id: messageId,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n calling_sdk_version: typeof process !== 'undefined' && process.env.CALLING_SDK_VERSION\n ? process.env.CALLING_SDK_VERSION\n : VERSION,\n },\n type,\n };\n break;\n }\n case METRIC_EVENT.VOICEMAIL_ERROR: {\n data = {\n tags: {\n action: metricAction,\n device_id: this.deviceInfo?.device?.deviceId,\n message_id: messageId,\n error: voicemailError,\n status_code: statusCode,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n calling_sdk_version: typeof process !== 'undefined' && process.env.CALLING_SDK_VERSION\n ? process.env.CALLING_SDK_VERSION\n : VERSION,\n },\n type,\n };\n break;\n }\n default:\n log.warn('Invalid metric name received. Rejecting request to submit metric.', {\n file: METRIC_FILE,\n method: this.submitVoicemailMetric.name,\n });\n break;\n }\n if (data) {\n this.webex.internal.metrics.submitClientMetrics(name, data);\n }\n }\n submitBNRMetric(name, type, callId, correlationId) {\n let data;\n if (name === METRIC_EVENT.BNR_ENABLED || name === METRIC_EVENT.BNR_DISABLED) {\n data = {\n tags: {\n device_id: this.deviceInfo?.device?.deviceId,\n service_indicator: this.serviceIndicator,\n },\n fields: {\n device_url: this.deviceInfo?.device?.clientDeviceUri,\n mobius_url: this.deviceInfo?.device?.uri,\n calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION,\n call_id: callId,\n correlation_id: correlationId,\n },\n type,\n };\n }\n else {\n log.warn('Invalid metric name received. Rejecting request to submit metric.', {\n file: METRIC_FILE,\n method: this.submitBNRMetric.name,\n });\n }\n if (data) {\n this.webex.internal.metrics.submitClientMetrics(name, data);\n }\n }\n}\nexport const getMetricManager = (webex, indicator) => {\n if (!metricManager) {\n metricManager = new MetricManager(webex, indicator);\n }\n return metricManager;\n};\nexport default getMetricManager;\n","export var METRIC_TYPE;\n(function (METRIC_TYPE) {\n METRIC_TYPE[\"OPERATIONAL\"] = \"operational\";\n METRIC_TYPE[\"BEHAVIORAL\"] = \"behavioral\";\n})(METRIC_TYPE || (METRIC_TYPE = {}));\nexport var METRIC_EVENT;\n(function (METRIC_EVENT) {\n METRIC_EVENT[\"BNR_ENABLED\"] = \"web-calling-sdk-bnr-enabled\";\n METRIC_EVENT[\"BNR_DISABLED\"] = \"web-calling-sdk-bnr-disabled\";\n METRIC_EVENT[\"CALL\"] = \"web-calling-sdk-callcontrol\";\n METRIC_EVENT[\"CALL_ERROR\"] = \"web-calling-sdk-callcontrol-error\";\n METRIC_EVENT[\"MEDIA\"] = \"web-calling-sdk-media\";\n METRIC_EVENT[\"MEDIA_ERROR\"] = \"web-calling-sdk-media-error\";\n METRIC_EVENT[\"REGISTRATION\"] = \"web-calling-sdk-registration\";\n METRIC_EVENT[\"REGISTRATION_ERROR\"] = \"web-calling-sdk-registration-error\";\n METRIC_EVENT[\"VOICEMAIL\"] = \"web-calling-sdk-voicemail\";\n METRIC_EVENT[\"VOICEMAIL_ERROR\"] = \"web-calling-sdk-voicemail-error\";\n})(METRIC_EVENT || (METRIC_EVENT = {}));\nexport var REG_ACTION;\n(function (REG_ACTION) {\n REG_ACTION[\"REGISTER\"] = \"register\";\n REG_ACTION[\"DEREGISTER\"] = \"deregister\";\n REG_ACTION[\"KEEPALIVE_FAILURE\"] = \"keepaliveFailure\";\n})(REG_ACTION || (REG_ACTION = {}));\nexport var TRANSFER_ACTION;\n(function (TRANSFER_ACTION) {\n TRANSFER_ACTION[\"BLIND\"] = \"TRANSFER_BLIND\";\n TRANSFER_ACTION[\"CONSULT\"] = \"TRANSFER_CONSULT\";\n})(TRANSFER_ACTION || (TRANSFER_ACTION = {}));\nexport var VOICEMAIL_ACTION;\n(function (VOICEMAIL_ACTION) {\n VOICEMAIL_ACTION[\"GET_VOICEMAILS\"] = \"get_voicemails\";\n VOICEMAIL_ACTION[\"GET_VOICEMAIL_CONTENT\"] = \"get_voicemail_content\";\n VOICEMAIL_ACTION[\"GET_VOICEMAIL_SUMMARY\"] = \"get_voicemail_summary\";\n VOICEMAIL_ACTION[\"MARK_READ\"] = \"mark_read\";\n VOICEMAIL_ACTION[\"MARK_UNREAD\"] = \"mark_unread\";\n VOICEMAIL_ACTION[\"DELETE\"] = \"delete\";\n VOICEMAIL_ACTION[\"TRANSCRIPT\"] = \"transcript\";\n})(VOICEMAIL_ACTION || (VOICEMAIL_ACTION = {}));\n","import { validateWebex } from './utils';\nlet instance;\nlet webex;\nclass SDKConnector {\n setWebex(webexInstance) {\n if (instance) {\n throw new Error('You cannot set the SDKConnector instance more than once');\n }\n const { error, success } = validateWebex(webexInstance);\n if (error) {\n throw error;\n }\n else if (success) {\n webex = webexInstance;\n }\n else {\n throw new Error('An unknown error occurred setting up the webex instance.');\n }\n instance = this;\n }\n get() {\n return instance;\n }\n getWebex() {\n return webex;\n }\n request(request) {\n return instance.getWebex().request(request);\n }\n registerListener(event, cb) {\n instance.getWebex().internal.mercury.on(event, (data) => {\n cb(data);\n });\n }\n unregisterListener(event) {\n instance.getWebex().internal.mercury.off(event);\n }\n}\nexport default Object.freeze(new SDKConnector());\n","export const validateWebex = (webexInstance) => {\n if (webexInstance.canAuthorize) {\n if (webexInstance.ready) {\n if (webexInstance.internal.mercury) {\n return { error: undefined, success: true };\n }\n return { error: new Error('webex.internal.mercury is not available'), success: false };\n }\n return { error: new Error('webex.ready is not true'), success: false };\n }\n return { error: new Error('webex.canAuthorize is not true'), success: false };\n};\n","import { ERROR_CODE } from '../Errors/types';\nimport SDKConnector from '../SDKConnector';\nimport { BASE64, BEARER, BINARY, SUCCESS_MESSAGE, SUCCESS_STATUS_CODE, OBJECT, TOKEN, USER, XML_TYPE, BW_XSI_ENDPOINT_VERSION, } from '../common/constants';\nimport { serviceErrorCodeHandler, getXsiActionEndpoint, getSortedVoicemailList, storeVoicemailList, fetchVoicemailList, } from '../common/Utils';\nimport { CALLING_BACKEND, HTTP_METHODS, SORT, } from '../common/types';\nimport log from '../Logger';\nimport { BROADWORKS_VOICEMAIL_FILE, BW_TOKEN_FETCH_ENDPOINT, JSON_FORMAT, MARK_AS_READ, MARK_AS_UNREAD, MESSAGE_MEDIA_CONTENT, VOICE_MESSAGING_MESSAGES, NO_VOICEMAIL_MSG, NO_VOICEMAIL_STATUS_CODE, RADIX_RAND, PREFIX, } from './constants';\nexport class BroadworksBackendConnector {\n bwtoken;\n userId;\n xsiAccessToken;\n xsiEndpoint;\n context;\n sdkConnector;\n webex;\n xsiVoiceMessageURI;\n constructor(webex, logger) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.context = Math.random().toString(RADIX_RAND).substring(PREFIX);\n log.setLogger(logger.level, BROADWORKS_VOICEMAIL_FILE);\n }\n init() {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'init',\n };\n log.info('Initializing Broadworks voicemail connector', loggerContext);\n const response = this.setXsiVoiceMessageURI();\n return response;\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n async getUserId() {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'getUserId',\n };\n try {\n await this.getBwToken();\n if (this.bwtoken && this.bwtoken.split('.').length > 1) {\n const decodedString = Buffer.from(this.bwtoken.split('.')[1], BASE64).toString(BINARY);\n this.userId = JSON.parse(decodedString).sub;\n return this.userId;\n }\n const error = ERROR_CODE.UNAUTHORIZED;\n throw new Error(`${error}`);\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n return serviceErrorCodeHandler(errorInfo, loggerContext);\n }\n }\n async getBwToken() {\n try {\n const bwTokenResponse = await this.webex.request({\n uri: `${this.webex.internal.services._serviceUrls.broadworksIdpProxy}${BW_TOKEN_FETCH_ENDPOINT}`,\n method: HTTP_METHODS.GET,\n });\n const response = bwTokenResponse.body;\n this.bwtoken = response[TOKEN][BEARER];\n }\n catch (err) {\n log.info(`Broadworks token exception ${err}`, {});\n }\n }\n async setXsiVoiceMessageURI() {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'setXsiVoiceMessageURI',\n };\n let userIdResponse = await this.getUserId();\n this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.BWRKS);\n this.xsiAccessToken = `${BEARER} ${this.bwtoken}`;\n log.info(`XsiEndpoint is ${this.xsiEndpoint}`, loggerContext);\n if (userIdResponse && typeof userIdResponse !== OBJECT) {\n this.xsiVoiceMessageURI = `${this.xsiEndpoint}/${BW_XSI_ENDPOINT_VERSION}/${USER}/${userIdResponse}/${VOICE_MESSAGING_MESSAGES}`;\n userIdResponse = {\n statusCode: SUCCESS_STATUS_CODE,\n data: {},\n message: SUCCESS_MESSAGE,\n };\n }\n return userIdResponse;\n }\n async getVoicemailList(offset, offsetLimit, sort, refresh) {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'getVoicemailList',\n };\n log.info(`Offset: ${offset} Offset limit: ${offsetLimit} Sort type:${sort}`, loggerContext);\n const urlXsi = `${this.xsiVoiceMessageURI}${JSON_FORMAT}`;\n let messageinfo;\n const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;\n if (refresh) {\n try {\n const response = await fetch(`${urlXsi}`, {\n method: HTTP_METHODS.GET,\n headers: {\n Authorization: this.xsiAccessToken,\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const voicemailListResponse = (await response.json());\n if (Object.keys(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList).length === 0) {\n messageinfo = [];\n }\n else if (!Array.isArray(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList?.messageInfo)) {\n messageinfo = Array(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList?.messageInfo);\n }\n else {\n messageinfo = voicemailListResponse?.VoiceMessagingMessages?.messageInfoList\n ?.messageInfo;\n messageinfo = getSortedVoicemailList(messageinfo, sortParam);\n }\n storeVoicemailList(this.context, messageinfo);\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n const { messages, moreVMAvailable } = fetchVoicemailList(this.context, offset, offsetLimit, loggerContext);\n const responseDetails = {\n statusCode: moreVMAvailable ? SUCCESS_STATUS_CODE : NO_VOICEMAIL_STATUS_CODE,\n data: {\n voicemailList: messages,\n },\n message: moreVMAvailable ? SUCCESS_MESSAGE : NO_VOICEMAIL_MSG,\n };\n return responseDetails;\n }\n async getVoicemailContent(messageId) {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'getVoicemailContent',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}`;\n const response = await fetch(`${voicemailContentUrl}`, {\n method: 'GET',\n headers: {\n Authorization: this.xsiAccessToken,\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const xmlData = await response.text();\n const parser = new DOMParser();\n const xmlDOM = parser.parseFromString(xmlData, XML_TYPE);\n const mediaDetails = xmlDOM.getElementsByTagName(MESSAGE_MEDIA_CONTENT)[0];\n const mediaType = mediaDetails.childNodes[1]?.textContent;\n const mediaContent = mediaDetails.childNodes[2]?.textContent;\n log.info(`Media type is ${mediaType}`, loggerContext);\n const responseDetails = {\n statusCode: response?.status,\n data: {\n voicemailContent: {\n type: mediaType,\n content: mediaContent,\n },\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVoicemailSummary() {\n return Promise.resolve(null);\n }\n async voicemailMarkAsRead(messageId) {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'voicemailMarkAsRead',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}/${MARK_AS_READ}`;\n const response = await fetch(voicemailContentUrl, {\n method: HTTP_METHODS.PUT,\n headers: {\n Authorization: this.xsiAccessToken,\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const responseDetails = {\n statusCode: response.status,\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async voicemailMarkAsUnread(messageId) {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'voicemailMarkAsUnread',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}/${MARK_AS_UNREAD}`;\n const response = await fetch(voicemailContentUrl, {\n method: HTTP_METHODS.PUT,\n headers: {\n Authorization: this.xsiAccessToken,\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const responseDetails = {\n statusCode: response.status,\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteVoicemail(messageId) {\n const loggerContext = {\n file: BROADWORKS_VOICEMAIL_FILE,\n method: 'deleteVoicemail',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}`;\n const response = await fetch(voicemailContentUrl, {\n method: HTTP_METHODS.DELETE,\n headers: {\n Authorization: this.xsiAccessToken,\n },\n });\n if (!response.ok) {\n throw new Error(`${response.status}`);\n }\n const responseDetails = {\n statusCode: response.status,\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = {\n statusCode: err instanceof Error ? Number(err.message) : '',\n };\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVMTranscript(messageId) {\n log.info(`Message Id: ${messageId}`, {});\n return Promise.resolve(null);\n }\n resolveContact(callingPartyInfo) {\n log.info(`Calling Party Info: ${callingPartyInfo}`, {});\n return Promise.resolve(null);\n }\n}\n","import SDKConnector from '../SDKConnector';\nimport { HTTP_METHODS, CALLING_BACKEND, } from '../common/types';\nimport { getVgActionEndpoint, serviceErrorCodeHandler } from '../common/Utils';\nimport { SUCCESS_MESSAGE, USERS, CONTENT, UCM_CONNECTOR_FILE, FAILURE_MESSAGE, } from '../common/constants';\nimport log from '../Logger';\nimport { API_V1, LIMIT, OFFSET, SORT_ORDER, VMGATEWAY, VOICEMAILS } from './constants';\nexport class UcmBackendConnector {\n vgEndpoint;\n userId;\n orgId;\n sdkConnector;\n webex;\n vgVoiceMessageURI;\n constructor(webex, logger) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.userId = this.webex.internal.device.userId;\n this.orgId = this.webex.internal.device.orgId;\n log.setLogger(logger.level, UCM_CONNECTOR_FILE);\n }\n init() {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'init',\n };\n log.info('Initializing UCM calling voicemail connector', loggerContext);\n const response = this.setUcmVoiceMessageBaseURI();\n return response;\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n setUcmVoiceMessageBaseURI() {\n this.vgEndpoint = getVgActionEndpoint(this.webex, CALLING_BACKEND.UCM);\n this.vgVoiceMessageURI = `${this.vgEndpoint}/${VMGATEWAY}/${API_V1}/${USERS}/${this.userId}/`;\n return this.vgVoiceMessageURI;\n }\n async getVoicemailList(offset, offsetLimit, sort) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'getVoicemailList',\n };\n log.info(`Offset: ${offset} Offset limit: ${offsetLimit} Sort type:${sort}`, loggerContext);\n const urlVg = `${this.vgVoiceMessageURI}${VOICEMAILS}/${OFFSET}=${offset}${LIMIT}=${offsetLimit}${SORT_ORDER}=${sort}`;\n try {\n const response = await this.webex.request({\n uri: `${urlVg}`,\n method: HTTP_METHODS.GET,\n headers: {\n orgId: this.orgId,\n },\n });\n const msgInfo = response.body;\n const messageinfoArray = [];\n const ucmVmMsgInfo = msgInfo.Message;\n ucmVmMsgInfo.forEach((msgInfoObj) => {\n const message = {};\n let stringObj = {};\n const numberObj = {};\n stringObj.$ = msgInfoObj.Duration;\n message.duration = stringObj;\n numberObj.$ = Number(msgInfoObj.ArrivalTime);\n message.time = numberObj;\n stringObj = { $: '' };\n stringObj.$ = msgInfoObj.MsgId;\n message.messageId = stringObj;\n if (msgInfoObj.Read === 'true') {\n message.read = {};\n }\n const callerIdObj = msgInfoObj.CallerId;\n const callingParty = {};\n stringObj = { $: '' };\n stringObj.$ = callerIdObj.CallerName;\n callingParty.name = stringObj;\n stringObj = { $: '' };\n stringObj.$ = this.userId;\n callingParty.userId = stringObj;\n stringObj = { $: '' };\n stringObj.$ = callerIdObj.CallerNumber;\n callingParty.address = stringObj;\n message.callingPartyInfo = callingParty;\n messageinfoArray.push(message);\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {\n voicemailList: messageinfoArray,\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVoicemailContent(messageId) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'getVoicemailContent',\n };\n try {\n const response = (await this.getVoicemailContentUcm(messageId));\n return response;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n log.info(`Voice mail content error is ${errorStatus}`, loggerContext);\n return errorStatus;\n }\n }\n async getVoicemailSummary() {\n return Promise.resolve(null);\n }\n async getVoicemailContentUcm(messageId) {\n return new Promise((resolve, reject) => {\n const voicemailContentUrl = `${this.vgVoiceMessageURI}${VOICEMAILS}/${messageId}/${CONTENT}`;\n const mercuryApi = `${this.webex.internal.services._serviceUrls.mercuryApi}`;\n this.returnUcmPromise(voicemailContentUrl, mercuryApi)\n .then((response) => {\n if (response.statusCode === 200) {\n resolve(response);\n }\n else if (response.statusCode === 202) {\n this.sdkConnector.registerListener('event:ucm.voicemail_download_complete', async (event) => {\n const responseEvent = event;\n const voicemailContentUrl = `${this.vgVoiceMessageURI}${VOICEMAILS}/${responseEvent?.data?.messageId}/${CONTENT}`;\n const response = await this.returnUcmPromise(voicemailContentUrl, mercuryApi);\n if (response.statusCode === 200) {\n this.sdkConnector.unregisterListener('event:ucm.voicemail_download_complete');\n resolve(response);\n }\n else {\n this.sdkConnector.unregisterListener('event:ucm.voicemail_download_complete');\n reject(response);\n }\n });\n }\n else {\n reject(response);\n }\n })\n .catch((err) => {\n reject(err);\n });\n });\n }\n async returnUcmPromise(voicemailContentUrl, mercuryApi) {\n const response = await this.webex.request({\n uri: `${voicemailContentUrl}`,\n method: HTTP_METHODS.GET,\n headers: {\n orgId: this.orgId,\n deviceUrl: this.webex.internal.device.url,\n mercuryHostname: mercuryApi,\n },\n });\n const contentInfo = response?.body;\n const respHeaders = response.headers;\n const statusCode = response.statusCode;\n const mediaType = respHeaders?.mediatype;\n const mediaContent = contentInfo;\n const responseDetails = {\n statusCode: Number(statusCode),\n data: {\n voicemailContent: {\n type: mediaType,\n content: mediaContent,\n },\n },\n message: SUCCESS_MESSAGE,\n };\n if (statusCode !== 200 && statusCode !== 202) {\n responseDetails.message = FAILURE_MESSAGE;\n }\n return responseDetails;\n }\n async voicemailMarkAsRead(messageId) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'voicemailMarkAsRead',\n };\n try {\n const voicemailContentUrl = `${this.vgVoiceMessageURI}${VOICEMAILS}/${messageId}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.PUT,\n headers: {\n orgId: this.orgId,\n },\n body: {\n read: 'true',\n },\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async voicemailMarkAsUnread(messageId) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'voicemailMarkAsUnread',\n };\n try {\n const voicemailContentUrl = `${this.vgVoiceMessageURI}${VOICEMAILS}/${messageId}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.PUT,\n headers: {\n orgId: this.orgId,\n },\n body: {\n read: 'false',\n },\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteVoicemail(messageId) {\n const loggerContext = {\n file: UCM_CONNECTOR_FILE,\n method: 'deleteVoicemail',\n };\n try {\n const voicemailContentUrl = `${this.vgVoiceMessageURI}${VOICEMAILS}/${messageId}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.DELETE,\n headers: {\n orgId: this.orgId,\n },\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVMTranscript(messageId) {\n log.info(`Message Id: ${messageId}`, {});\n return Promise.resolve(null);\n }\n resolveContact(callingPartyInfo) {\n log.info(`Calling Party Info: ${callingPartyInfo}`, {});\n return Promise.resolve(null);\n }\n}\n","import SDKConnector from '../SDKConnector';\nimport { CALLING_BACKEND } from '../common/types';\nimport log from '../Logger';\nimport { getCallingBackEnd } from '../common/Utils';\nimport { WxCallBackendConnector } from './WxCallBackendConnector';\nimport { BroadworksBackendConnector } from './BroadworksBackendConnector';\nimport { Eventing } from '../Events/impl';\nimport { UcmBackendConnector } from './UcmBackendConnector';\nimport { METRIC_EVENT, METRIC_TYPE, VOICEMAIL_ACTION } from '../Metrics/types';\nimport { getMetricManager } from '../Metrics';\nimport { VOICEMAIL_FILE } from './constants';\nexport class Voicemail extends Eventing {\n logger;\n sdkConnector;\n webex;\n callingBackend;\n backendConnector;\n metricManager;\n constructor(webex, logger) {\n super();\n this.logger = logger;\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.webex = this.sdkConnector.getWebex();\n this.metricManager = getMetricManager(this.webex, undefined);\n this.callingBackend = getCallingBackEnd(this.webex);\n this.initializeBackendConnector();\n log.setLogger(logger.level, VOICEMAIL_FILE);\n }\n init() {\n const response = this.backendConnector.init();\n return response;\n }\n initializeBackendConnector() {\n switch (this.callingBackend) {\n case CALLING_BACKEND.WXC: {\n this.backendConnector = new WxCallBackendConnector(this.webex, this.logger);\n break;\n }\n case CALLING_BACKEND.BWRKS: {\n this.backendConnector = new BroadworksBackendConnector(this.webex, this.logger);\n break;\n }\n case CALLING_BACKEND.UCM: {\n this.backendConnector = new UcmBackendConnector(this.webex, this.logger);\n break;\n }\n default: {\n throw new Error('Calling backend is not identified, exiting....');\n }\n }\n }\n submitMetric(response, metricAction, messageId) {\n const { statusCode, data: { error: errorMessage }, } = response;\n if (statusCode >= 200 && statusCode < 300) {\n this.metricManager.submitVoicemailMetric(METRIC_EVENT.VOICEMAIL, metricAction, METRIC_TYPE.BEHAVIORAL, messageId);\n }\n else {\n this.metricManager.submitVoicemailMetric(METRIC_EVENT.VOICEMAIL_ERROR, metricAction, METRIC_TYPE.BEHAVIORAL, messageId, errorMessage, statusCode);\n }\n }\n async getVoicemailList(offset, offsetLimit, sort, refresh) {\n const response = await this.backendConnector.getVoicemailList(offset, offsetLimit, sort, refresh);\n this.submitMetric(response, VOICEMAIL_ACTION.GET_VOICEMAILS);\n return response;\n }\n async getVoicemailContent(messageId) {\n const response = await this.backendConnector.getVoicemailContent(messageId);\n this.submitMetric(response, VOICEMAIL_ACTION.GET_VOICEMAIL_CONTENT, messageId);\n return response;\n }\n async getVoicemailSummary() {\n const response = await this.backendConnector.getVoicemailSummary();\n if (response !== null) {\n this.submitMetric(response, VOICEMAIL_ACTION.GET_VOICEMAIL_SUMMARY);\n }\n return response;\n }\n async voicemailMarkAsRead(messageId) {\n const response = await this.backendConnector.voicemailMarkAsRead(messageId);\n this.submitMetric(response, VOICEMAIL_ACTION.MARK_READ, messageId);\n return response;\n }\n async voicemailMarkAsUnread(messageId) {\n const response = await this.backendConnector.voicemailMarkAsUnread(messageId);\n this.submitMetric(response, VOICEMAIL_ACTION.MARK_UNREAD, messageId);\n return response;\n }\n async deleteVoicemail(messageId) {\n const response = await this.backendConnector.deleteVoicemail(messageId);\n this.submitMetric(response, VOICEMAIL_ACTION.DELETE, messageId);\n return response;\n }\n async getVMTranscript(messageId) {\n const response = await this.backendConnector.getVMTranscript(messageId);\n if (response !== null) {\n this.submitMetric(response, VOICEMAIL_ACTION.TRANSCRIPT, messageId);\n }\n return response;\n }\n resolveContact(callingPartyInfo) {\n return this.backendConnector.resolveContact(callingPartyInfo);\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n}\nexport const createVoicemailClient = (webex, logger) => new Voicemail(webex, logger);\n","import SDKConnector from '../SDKConnector';\nimport { RAW_REQUEST, SUCCESS_MESSAGE, SUCCESS_STATUS_CODE, TRANSCRIPT, USER, XML_TYPE, BW_XSI_ENDPOINT_VERSION, WEBEX_CALLING_CONNECTOR_FILE, } from '../common/constants';\nimport { serviceErrorCodeHandler, getXsiActionEndpoint, getSortedVoicemailList, resolveContact, storeVoicemailList, fetchVoicemailList, } from '../common/Utils';\nimport { CALLING_BACKEND, HTTP_METHODS, SORT, } from '../common/types';\nimport log from '../Logger';\nimport { JSON_FORMAT, MARK_AS_READ, MARK_AS_UNREAD, MESSAGE_MEDIA_CONTENT, TRANSCRIPT_CONTENT, VOICE_MESSAGING_MESSAGES, NO_VOICEMAIL_MSG, NO_VOICEMAIL_STATUS_CODE, RADIX_RAND, PREFIX, TRANSCRIPT_STATUS, MESSAGE_SUMMARY, CALLS, SUMMARY, NEW_MESSAGES, NEW_URGENT_MESSAGES, OLD_URGENT_MESSAGES, OLD_MESSAGES, } from './constants';\nexport class WxCallBackendConnector {\n xsiEndpoint;\n userId;\n context;\n sdkConnector;\n xsiVoiceMessageURI;\n webex;\n constructor(webex, logger) {\n this.sdkConnector = SDKConnector;\n if (!this.sdkConnector.getWebex()) {\n SDKConnector.setWebex(webex);\n }\n this.context = Math.random().toString(RADIX_RAND).substring(PREFIX);\n this.webex = this.sdkConnector.getWebex();\n this.userId = this.webex.internal.device.userId;\n log.setLogger(logger.level, WEBEX_CALLING_CONNECTOR_FILE);\n }\n init() {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'init',\n };\n log.info('Initializing Webex calling voicemail connector', loggerContext);\n const response = this.setXsiVoiceMessageURI();\n return response;\n }\n getSDKConnector() {\n return this.sdkConnector;\n }\n async setXsiVoiceMessageURI() {\n let responseDetails;\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'setXsiVoiceMessageURI',\n };\n this.xsiEndpoint = await getXsiActionEndpoint(this.webex, loggerContext, CALLING_BACKEND.WXC);\n log.info(`XsiEndpoint is ${this.xsiEndpoint}`, loggerContext);\n if (this.userId) {\n this.xsiVoiceMessageURI = `${this.xsiEndpoint}/${BW_XSI_ENDPOINT_VERSION}/${USER}/${this.userId}/${VOICE_MESSAGING_MESSAGES}`;\n responseDetails = {\n statusCode: SUCCESS_STATUS_CODE,\n data: {},\n message: SUCCESS_MESSAGE,\n };\n }\n return responseDetails;\n }\n async getVoicemailList(offset, offsetLimit, sort, refresh) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'getVoicemailList',\n };\n log.info(`Offset: ${offset} Offset limit: ${offsetLimit} Sort type:${sort}`, loggerContext);\n let messageinfo;\n if (refresh) {\n const urlXsi = `${this.xsiVoiceMessageURI}${JSON_FORMAT}`;\n const sortParam = Object.values(SORT).includes(sort) ? sort : SORT.DEFAULT;\n try {\n const response = await this.webex.request({\n uri: `${urlXsi}`,\n method: HTTP_METHODS.GET,\n });\n const voicemailListResponse = response.body;\n if (Object.keys(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList).length === 0) {\n messageinfo = [];\n }\n else if (!Array.isArray(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList?.messageInfo)) {\n messageinfo = Array(voicemailListResponse?.VoiceMessagingMessages?.messageInfoList?.messageInfo);\n }\n else {\n messageinfo = voicemailListResponse?.VoiceMessagingMessages?.messageInfoList\n ?.messageInfo;\n messageinfo = getSortedVoicemailList(messageinfo, sortParam);\n }\n storeVoicemailList(this.context, messageinfo);\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n const { messages, moreVMAvailable } = fetchVoicemailList(this.context, offset, offsetLimit, loggerContext);\n const responseDetails = {\n statusCode: moreVMAvailable ? SUCCESS_STATUS_CODE : NO_VOICEMAIL_STATUS_CODE,\n data: {\n voicemailList: messages,\n },\n message: moreVMAvailable ? SUCCESS_MESSAGE : NO_VOICEMAIL_MSG,\n };\n return responseDetails;\n }\n async getVoicemailContent(messageId) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'getVoicemailContent',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}`;\n const response = await this.webex.request({\n uri: `${voicemailContentUrl}`,\n method: HTTP_METHODS.GET,\n });\n const parser = new DOMParser();\n const xmlDOM = parser.parseFromString(response[RAW_REQUEST].response, XML_TYPE);\n const mediaDetails = xmlDOM.getElementsByTagName(MESSAGE_MEDIA_CONTENT)[0];\n const mediaType = mediaDetails.childNodes[1]?.textContent;\n const mediaContent = mediaDetails.childNodes[2]?.textContent;\n log.info(`Media type is ${mediaType}`, loggerContext);\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {\n voicemailContent: {\n type: mediaType,\n content: mediaContent,\n },\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n log.info(`Voice mail content error is ${errorStatus}`, loggerContext);\n return errorStatus;\n }\n }\n async getVoicemailSummary() {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'getVoicemailSummary',\n };\n try {\n const voicemailSummaryUrl = `${this.xsiEndpoint}/${BW_XSI_ENDPOINT_VERSION}/${USER}/${this.userId}/${CALLS}/${MESSAGE_SUMMARY}`;\n const response = await this.webex.request({\n uri: `${voicemailSummaryUrl}`,\n method: HTTP_METHODS.GET,\n });\n const parser = new DOMParser();\n const xmlDOM = parser.parseFromString(response[RAW_REQUEST].response, XML_TYPE);\n const voicemailSummary = xmlDOM.getElementsByTagName(SUMMARY)[0];\n const newMessages = voicemailSummary.getElementsByTagName(NEW_MESSAGES)[0];\n const newUrgentMessages = voicemailSummary.getElementsByTagName(NEW_URGENT_MESSAGES)[0];\n const oldMessages = voicemailSummary.getElementsByTagName(OLD_MESSAGES)[0];\n const oldUrgentMessages = voicemailSummary.getElementsByTagName(OLD_URGENT_MESSAGES)[0];\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {\n voicemailSummary: {\n newMessages: newMessages ? Number(newMessages.textContent) : 0,\n newUrgentMessages: newUrgentMessages ? Number(newUrgentMessages.textContent) : 0,\n oldMessages: oldMessages ? Number(oldMessages.textContent) : 0,\n oldUrgentMessages: oldUrgentMessages ? Number(oldUrgentMessages.textContent) : 0,\n },\n },\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n log.error(new Error(`Voicemail summary error is ${errorStatus}`), loggerContext);\n return errorStatus;\n }\n }\n async voicemailMarkAsRead(messageId) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'voicemailMarkAsRead',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}/${MARK_AS_READ}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.PUT,\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async voicemailMarkAsUnread(messageId) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'voicemailMarkAsUnread',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}/${MARK_AS_UNREAD}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.PUT,\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async deleteVoicemail(messageId) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'deleteVoicemail',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.DELETE,\n });\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {},\n message: SUCCESS_MESSAGE,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n async getVMTranscript(messageId) {\n const loggerContext = {\n file: WEBEX_CALLING_CONNECTOR_FILE,\n method: 'getVMTranscript',\n };\n try {\n const voicemailContentUrl = `${this.xsiEndpoint}${messageId}/${TRANSCRIPT}`;\n const response = await this.webex.request({\n uri: voicemailContentUrl,\n method: HTTP_METHODS.GET,\n });\n const parser = new DOMParser();\n const xmlDOM = parser.parseFromString(response[RAW_REQUEST].response, XML_TYPE);\n const status = xmlDOM.getElementsByTagName(TRANSCRIPT_STATUS)[0];\n const transcript = xmlDOM.getElementsByTagName(TRANSCRIPT_CONTENT)[0];\n const responseDetails = {\n statusCode: Number(response.statusCode),\n data: {\n voicemailTranscript: transcript?.textContent,\n },\n message: status.textContent,\n };\n return responseDetails;\n }\n catch (err) {\n const errorInfo = err;\n const errorStatus = serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorStatus;\n }\n }\n resolveContact(callingPartyInfo) {\n return resolveContact(callingPartyInfo);\n }\n}\n","export const API_V1 = 'api/v1';\nexport const VOICEMAIL_FILE = 'VoicemailClient';\nexport const BROADWORKS_VOICEMAIL_FILE = 'BroadworksBackendConnector';\nexport const CALLS = 'calls';\nexport const BW_TOKEN_FETCH_ENDPOINT = '/idp/bwtoken/fetch';\nexport const JSON_FORMAT = '?format=json';\nexport const LIMIT = '&limit';\nexport const MARK_AS_READ = 'MarkAsRead';\nexport const MARK_AS_UNREAD = 'MarkAsUnread';\nexport const MESSAGE_MEDIA_CONTENT = 'messageMediaContent';\nexport const MESSAGE_SUMMARY = 'MessageSummary';\nexport const NO_VOICEMAIL_MSG = 'No additional voicemails';\nexport const NO_VOICEMAIL_STATUS_CODE = 204;\nexport const OFFSET = '?offset';\nexport const OFFSET_INDEX = 0;\nexport const OFFSET_LIMIT = 100;\nexport const PREFIX = 2;\nexport const RADIX_RAND = 36;\nexport const SORT_ORDER = '&sortOrder';\nexport const TRANSCRIPT_STATUS = 'status';\nexport const SUMMARY = 'summary';\nexport const TRANSCRIPT_CONTENT = 'content';\nexport const VMGATEWAY = 'vmgateway';\nexport const VOICEMAILS = 'voicemails';\nexport const VOICE_MESSAGING_MESSAGES = 'VoiceMessagingMessages';\nexport const NEW_MESSAGES = 'newMessages';\nexport const OLD_MESSAGES = 'oldMessages';\nexport const NEW_URGENT_MESSAGES = 'newUrgentMessages';\nexport const OLD_URGENT_MESSAGES = 'oldUrgentMessages';\n","import * as platform from 'platform';\nimport { createCallError } from '../Errors/catalog/CallError';\nimport { DEVICE_ERROR_CODE, ERROR_CODE, ERROR_TYPE, CALL_ERROR_CODE, } from '../Errors/types';\nimport { CALLING_BACKEND, HTTP_METHODS, RegistrationStatus, SORT, ServiceIndicator, } from './types';\nimport log from '../Logger';\nimport { createClientError } from '../Errors/catalog/CallingDeviceError';\nimport { BYTES_RECEIVED, BYTES_SENT, CALLING_USER_AGENT, CISCO_DEVICE_URL, CODEC_ID, DUMMY_METRICS, INBOUND_CODEC_MATCH, INBOUND_RTP, JITTER_BUFFER_DELAY, JITTER_BUFFER_EMITTED_COUNT, LOCAL_CANDIDATE_ID, MEDIA_ID, MEDIA_SOURCE, MIME_TYPE, NETWORK_TYPE, OUTBOUND_CODEC_MATCH, OUTBOUND_RTP, PACKETS_DISCARDED, PACKETS_LOST, PACKETS_RECEIVED, PACKETS_SENT, REMOTE_INBOUND_RTP, ROUND_TRIP_TIME_MEASUREMENTS, RTC_CODEC, RTC_ICE_CANDIDATE, RTC_ICE_CANDIDATE_PAIR, RTP_RX_STAT, RTP_TX_STAT, SELECTED_CANDIDATE_PAIR_ID, SPARK_USER_AGENT, TARGET_BIT_RATE, TIMESTAMP, TOTAL_ROUND_TRIP_TIME, TOTAL_SAMPLES_DURATION, TRANSPORT, TYPE, URL_ENDPOINT, UTILS_FILE, } from '../CallingClient/constants';\nimport { DEVICES, ITEMS, SETTINGS, VALUES, KEY, TIME, PLACEHOLDER_KEY, XSI_ACTION_ENDPOINT_ORG_URL_PARAM, XSI_ACTION_ENDPOINT, INFER_ID_CONSTANT, BW_XSI_URL, ENTITLEMENT_BASIC, ENTITLEMENT_BROADWORKS_CONN, ENTITLEMENT_STANDARD, NATIVE_WEBEX_TEAMS_CALLING, NATIVE_SIP_CALL_TO_UCM, BW_XSI_ENDPOINT_VERSION, IDENTITY_ENDPOINT_RESOURCE, SCIM_ENDPOINT_RESOURCE, SCIM_USER_FILTER, WEBEX_API_PROD, WEBEX_API_BTS, BW_XSI_ENDPOINT_VERSION_WITH_SLASH, } from './constants';\nimport SDKConnector from '../SDKConnector';\nimport { createLineError } from '../Errors/catalog/LineError';\nexport function filterMobiusUris(mobiusServers, defaultMobiusUrl) {\n const logContext = {\n file: UTILS_FILE,\n method: filterMobiusUris.name,\n };\n const urisArrayPrimary = [];\n const urisArrayBackup = [];\n if (mobiusServers?.primary?.uris) {\n log.info('Adding Primary uris', logContext);\n for (const uri of mobiusServers.primary.uris) {\n urisArrayPrimary.push(`${uri}${URL_ENDPOINT}`);\n }\n }\n if (mobiusServers?.backup?.uris) {\n log.info('Adding Backup uris', logContext);\n for (const uri of mobiusServers.backup.uris) {\n urisArrayBackup.push(`${uri}${URL_ENDPOINT}`);\n }\n }\n log.info('Adding Default uri', logContext);\n if (!urisArrayPrimary.length && !urisArrayBackup.length) {\n urisArrayPrimary.push(`${defaultMobiusUrl}${URL_ENDPOINT}`);\n }\n else {\n urisArrayBackup.push(`${defaultMobiusUrl}${URL_ENDPOINT}`);\n }\n const primaryUris = [];\n const backupUris = [];\n for (let i = 0; i < urisArrayPrimary.length; i += 1) {\n if (primaryUris.indexOf(urisArrayPrimary[i]) === -1) {\n primaryUris.push(urisArrayPrimary[i]);\n }\n }\n for (let i = 0; i < urisArrayBackup.length; i += 1) {\n if (backupUris.indexOf(urisArrayBackup[i]) === -1) {\n backupUris.push(urisArrayBackup[i]);\n }\n }\n return { primary: primaryUris, backup: backupUris };\n}\nfunction updateCallErrorContext(errContext, type, message, correlationId, callError) {\n const errObj = {};\n errObj.context = errContext;\n errObj.type = type;\n errObj.message = message;\n errObj.correlationId = correlationId;\n callError.setCallError(errObj);\n}\nfunction updateLineErrorContext(errContext, type, message, status, lineError) {\n const errObj = {};\n errObj.context = errContext;\n errObj.type = type;\n errObj.message = message;\n errObj.status = status;\n lineError.setError(errObj);\n}\nfunction updateErrorContext(errContext, type, message, clientError) {\n const errObj = {};\n errObj.context = errContext;\n errObj.type = type;\n errObj.message = message;\n clientError.setError(errObj);\n}\nexport function emitFinalFailure(emitterCb, loggerContext) {\n const clientError = createLineError('', {}, ERROR_TYPE.DEFAULT, RegistrationStatus.INACTIVE);\n updateLineErrorContext(loggerContext, ERROR_TYPE.SERVICE_UNAVAILABLE, 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.', RegistrationStatus.INACTIVE, clientError);\n emitterCb(clientError);\n}\nexport async function handleRegistrationErrors(err, emitterCb, loggerContext, restoreRegCb) {\n const lineError = createLineError('', {}, ERROR_TYPE.DEFAULT, RegistrationStatus.INACTIVE);\n const errorCode = Number(err.statusCode);\n let finalError = false;\n log.warn(`Status code: -> ${errorCode}`, loggerContext);\n switch (errorCode) {\n case ERROR_CODE.UNAUTHORIZED: {\n finalError = true;\n log.warn(`401 Unauthorized`, loggerContext);\n updateLineErrorContext(loggerContext, ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token. Sign out, then sign back in.', RegistrationStatus.INACTIVE, lineError);\n emitterCb(lineError, finalError);\n break;\n }\n case ERROR_CODE.INTERNAL_SERVER_ERROR: {\n log.warn(`500 Internal Server Error`, loggerContext);\n updateLineErrorContext(loggerContext, ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred while placing the request. Wait a moment and try again.', RegistrationStatus.INACTIVE, lineError);\n emitterCb(lineError, finalError);\n break;\n }\n case ERROR_CODE.SERVICE_UNAVAILABLE: {\n log.warn(`503 Service Unavailable`, loggerContext);\n updateLineErrorContext(loggerContext, ERROR_TYPE.SERVICE_UNAVAILABLE, 'An error occurred on the server while processing the request. Wait a moment and try again.', RegistrationStatus.INACTIVE, lineError);\n emitterCb(lineError, finalError);\n break;\n }\n case ERROR_CODE.FORBIDDEN: {\n log.warn(`403 Forbidden`, loggerContext);\n const errorBody = err.body;\n if (!errorBody) {\n log.warn('Error response has no body, throwing default error', loggerContext);\n updateLineErrorContext(loggerContext, ERROR_TYPE.FORBIDDEN_ERROR, 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.', RegistrationStatus.INACTIVE, lineError);\n emitterCb(lineError, finalError);\n return finalError;\n }\n const code = Number(errorBody.errorCode);\n log.warn(`Error code found : ${code}`, loggerContext);\n switch (code) {\n case DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED: {\n const errorMessage = 'User device limit exceeded';\n log.warn(errorMessage, loggerContext);\n if (restoreRegCb) {\n const caller = loggerContext.method || 'handleErrors';\n await restoreRegCb(errorBody, caller);\n }\n break;\n }\n case DEVICE_ERROR_CODE.DEVICE_CREATION_DISABLED: {\n const errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';\n finalError = true;\n updateLineErrorContext(loggerContext, ERROR_TYPE.FORBIDDEN_ERROR, errorMessage, RegistrationStatus.INACTIVE, lineError);\n log.warn(errorMessage, loggerContext);\n emitterCb(lineError, true);\n break;\n }\n case DEVICE_ERROR_CODE.DEVICE_CREATION_FAILED: {\n const errorMessage = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';\n updateLineErrorContext(loggerContext, ERROR_TYPE.FORBIDDEN_ERROR, errorMessage, RegistrationStatus.INACTIVE, lineError);\n log.warn(errorMessage, loggerContext);\n emitterCb(lineError, finalError);\n break;\n }\n default: {\n const errorMessage = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';\n updateLineErrorContext(loggerContext, ERROR_TYPE.FORBIDDEN_ERROR, errorMessage, RegistrationStatus.INACTIVE, lineError);\n log.warn(errorMessage, loggerContext);\n emitterCb(lineError, finalError);\n }\n }\n break;\n }\n case ERROR_CODE.DEVICE_NOT_FOUND: {\n finalError = true;\n log.warn(`404 Device Not Found`, loggerContext);\n updateLineErrorContext(loggerContext, ERROR_TYPE.NOT_FOUND, 'The client has unregistered. Please wait for the client to register before attempting the call. If error persists, sign out, sign back in and attempt the call.', RegistrationStatus.INACTIVE, lineError);\n emitterCb(lineError, finalError);\n break;\n }\n default: {\n updateLineErrorContext(loggerContext, ERROR_TYPE.DEFAULT, 'Unknown error', RegistrationStatus.INACTIVE, lineError);\n log.warn(`Unknown Error`, loggerContext);\n emitterCb(lineError, finalError);\n }\n }\n return finalError;\n}\nexport async function handleCallingClientErrors(err, emitterCb, loggerContext) {\n const clientError = createClientError('', {}, ERROR_TYPE.DEFAULT, RegistrationStatus.INACTIVE);\n const errorCode = Number(err.statusCode);\n const finalError = false;\n log.warn(`Status code: -> ${errorCode}`, loggerContext);\n switch (errorCode) {\n case ERROR_CODE.INTERNAL_SERVER_ERROR: {\n log.warn(`500 Internal Server Error`, loggerContext);\n updateErrorContext(loggerContext, ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred while placing the request. Wait a moment and try again.', clientError);\n emitterCb(clientError, finalError);\n break;\n }\n default: {\n updateErrorContext(loggerContext, ERROR_TYPE.DEFAULT, 'Unknown error', clientError);\n log.warn(`Unknown Error`, loggerContext);\n emitterCb(clientError, finalError);\n }\n }\n return finalError;\n}\nexport async function handleCallErrors(emitterCb, errorLayer, retryCb, correlationId, err, caller, file) {\n const loggerContext = {\n file,\n method: caller,\n };\n const callError = createCallError('', loggerContext, ERROR_TYPE.DEFAULT, '', errorLayer);\n const errorCode = Number(err.statusCode);\n log.warn(`Status code: ->${errorCode}`, loggerContext);\n switch (errorCode) {\n case ERROR_CODE.UNAUTHORIZED: {\n log.warn(`401 Unauthorized`, loggerContext);\n updateCallErrorContext(loggerContext, ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token. Sign out, then sign back in.', correlationId, callError);\n emitterCb(callError);\n break;\n }\n case ERROR_CODE.FORBIDDEN:\n case ERROR_CODE.SERVICE_UNAVAILABLE: {\n const errorBody = err.body;\n if (!errorBody) {\n log.warn('Error response has no body, throwing default error', loggerContext);\n updateCallErrorContext(loggerContext, err.statusCode === 403 ? ERROR_TYPE.FORBIDDEN_ERROR : ERROR_TYPE.SERVICE_UNAVAILABLE, err.statusCode === 403\n ? 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.'\n : 'An error occurred on the server while processing the request. Wait a moment and try again.', correlationId, callError);\n emitterCb(callError);\n return;\n }\n if (err.headers && 'retry-after' in err.headers && retryCb) {\n const retryInterval = Number(err.headers['retry-after']);\n log.warn(`Retry Interval received: ${retryInterval}`, loggerContext);\n retryCb(retryInterval);\n return;\n }\n const code = Number(errorBody.errorCode);\n let message;\n switch (code) {\n case CALL_ERROR_CODE.INVALID_STATUS_UPDATE: {\n message =\n 'An invalid status update has been received for the call. Wait a moment and try again.';\n break;\n }\n case CALL_ERROR_CODE.DEVICE_NOT_REGISTERED: {\n message =\n 'The client has unregistered. Please wait for the client to register before attempting the call. If error persists, sign out, sign back in and attempt the call.';\n break;\n }\n case CALL_ERROR_CODE.CALL_NOT_FOUND: {\n message = 'Call is not found on the server. Wait a moment and try again.';\n break;\n }\n case CALL_ERROR_CODE.ERROR_PROCESSING: {\n message =\n 'An error occurred while processing the call on the server. Wait a moment and try again.';\n break;\n }\n case CALL_ERROR_CODE.USER_BUSY: {\n message = 'Called user is busy.';\n break;\n }\n case CALL_ERROR_CODE.PARSING_ERROR: {\n message =\n 'An error occurred while parsing the provided information. Wait a moment and try again.';\n break;\n }\n case CALL_ERROR_CODE.NOT_ACCEPTABLE: {\n message =\n 'An error occurred on the server while accepting the call. Wait a moment and try again. Please contact the administrator if this persists.';\n break;\n }\n case CALL_ERROR_CODE.CALL_REJECTED: {\n message =\n 'Call rejected by the server. Wait a moment and try again. Please contact the administrator if this persists.';\n break;\n }\n case CALL_ERROR_CODE.NOT_AVAILABLE: {\n message =\n 'Calling services not available. Wait a moment and try again. Please contact the administrator if this persists.';\n break;\n }\n default: {\n message = 'An unknown error occurred. Wait a moment and try again.';\n }\n }\n updateCallErrorContext(loggerContext, err.statusCode === 403 ? ERROR_TYPE.FORBIDDEN_ERROR : ERROR_TYPE.SERVICE_UNAVAILABLE, message, correlationId, callError);\n emitterCb(callError);\n break;\n }\n case ERROR_CODE.DEVICE_NOT_FOUND: {\n log.warn(`404 Call Not Found`, loggerContext);\n updateCallErrorContext(loggerContext, ERROR_TYPE.NOT_FOUND, 'Call is no longer active. Wait a moment and try again.', correlationId, callError);\n emitterCb(callError);\n break;\n }\n case ERROR_CODE.INTERNAL_SERVER_ERROR: {\n log.warn(`500 Internal Server Error`, loggerContext);\n updateCallErrorContext(loggerContext, ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred in the call. Wait a moment and try again.', correlationId, callError);\n emitterCb(callError);\n break;\n }\n default: {\n log.warn(`Unknown Error`, loggerContext);\n }\n }\n}\nexport async function serviceErrorCodeHandler(err, loggerContext) {\n const errorCode = Number(err.statusCode);\n const failureMessage = 'FAILURE';\n switch (errorCode) {\n case ERROR_CODE.BAD_REQUEST: {\n log.warn(`400 Bad request`, loggerContext);\n const errorDetails = {\n statusCode: 400,\n data: {\n error: '400 Bad request',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.UNAUTHORIZED: {\n log.warn(`401 User is unauthorised, possible token expiry`, loggerContext);\n const errorDetails = {\n statusCode: 401,\n data: {\n error: 'User is unauthorised, possible token expiry',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.FORBIDDEN: {\n log.warn(`403 User request is forbidden`, loggerContext);\n const errorDetails = {\n statusCode: 403,\n data: {\n error: 'User request is forbidden',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.DEVICE_NOT_FOUND: {\n log.warn(`404 User info not found`, loggerContext);\n const errorDetails = {\n statusCode: 404,\n data: {\n error: 'User info not found',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.REQUEST_TIMEOUT: {\n log.warn(`408 Request to the server timedout`, loggerContext);\n const errorDetails = {\n statusCode: 408,\n data: {\n error: 'Request to the server timedout',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.NOT_IMPLEMENTED: {\n log.warn(`501 Not Implemented error occurred`, loggerContext);\n const errorDetails = {\n statusCode: 501,\n data: {\n error: 'Method is not implemented at the backend',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.INTERNAL_SERVER_ERROR: {\n log.warn(`500 Internal server error occurred`, loggerContext);\n const errorDetails = {\n statusCode: 500,\n data: {\n error: 'Internal server error occurred',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n case ERROR_CODE.SERVICE_UNAVAILABLE: {\n log.warn(`503 Unable to establish a connection with the server`, loggerContext);\n const errorDetails = {\n statusCode: 503,\n data: {\n error: 'Unable to establish a connection with the server',\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n default: {\n log.warn(`${errorCode || 422} Exception has occurred`, loggerContext);\n const errorDetails = {\n statusCode: errorCode || 422,\n data: {\n error: `${errorCode || 422} Exception has occurred`,\n },\n message: failureMessage,\n };\n return errorDetails;\n }\n }\n}\nexport function parseMediaQualityStatistics(stats) {\n if (!stats || navigator.userAgent.indexOf('Firefox') !== -1) {\n log.info('RTCStatsReport is null, adding dummy stats', {\n file: UTILS_FILE,\n method: parseMediaQualityStatistics.name,\n });\n return DUMMY_METRICS;\n }\n try {\n let type;\n let id;\n let inboundCodec;\n let outboundCodec;\n const localCandidates = {};\n const candidatePairs = {};\n const codecList = {};\n const rxStat = {};\n const txStat = {};\n const vqPayload = {};\n let jitterBufferDelay = 0;\n let jitterBufferEmittedCount = 0;\n let totalRoundTripTime = 0;\n let roundTripTimeMeasurements = 0;\n let selectedPair = '';\n let bitRate = 0;\n vqPayload.maxJitter = 0;\n vqPayload.VoPktSizeMs = 20;\n stats.forEach((report) => {\n Object.keys(report).forEach((statName) => {\n if (statName !== TIMESTAMP) {\n if (!type || statName === TYPE) {\n type = report[statName];\n }\n else if (!id || statName === MEDIA_ID) {\n id = report[statName];\n }\n else if (id && id.indexOf(RTC_ICE_CANDIDATE_PAIR) !== -1) {\n if (statName === LOCAL_CANDIDATE_ID) {\n candidatePairs[id] = report[statName];\n }\n }\n else if (id && id.indexOf(RTC_ICE_CANDIDATE) !== -1) {\n if (statName === NETWORK_TYPE) {\n localCandidates[id] = report[statName];\n }\n }\n else if (id &&\n (id.indexOf(INBOUND_CODEC_MATCH) !== -1 ||\n id.indexOf(OUTBOUND_CODEC_MATCH) !== -1 ||\n id.indexOf(RTC_CODEC) !== -1)) {\n if (statName === MIME_TYPE) {\n codecList[id] = report[statName];\n }\n }\n else if (type && type === REMOTE_INBOUND_RTP) {\n switch (statName) {\n case TOTAL_ROUND_TRIP_TIME: {\n totalRoundTripTime = report[statName];\n break;\n }\n case ROUND_TRIP_TIME_MEASUREMENTS: {\n roundTripTimeMeasurements = report[statName];\n break;\n }\n default: {\n }\n }\n }\n else if (type && type === INBOUND_RTP) {\n switch (statName) {\n case CODEC_ID: {\n inboundCodec = report[statName];\n break;\n }\n case PACKETS_RECEIVED: {\n rxStat.Pkt = report[statName];\n break;\n }\n case BYTES_RECEIVED: {\n rxStat.Oct = report[statName];\n break;\n }\n case PACKETS_DISCARDED: {\n rxStat.LatePkt = report[statName];\n break;\n }\n case PACKETS_LOST: {\n rxStat.LostPkt = report[statName];\n break;\n }\n case JITTER_BUFFER_DELAY: {\n jitterBufferDelay = report[statName];\n break;\n }\n case JITTER_BUFFER_EMITTED_COUNT: {\n jitterBufferEmittedCount = report[statName];\n break;\n }\n default: {\n }\n }\n }\n else if (type && type === TRANSPORT) {\n switch (statName) {\n case SELECTED_CANDIDATE_PAIR_ID: {\n selectedPair = report[statName];\n break;\n }\n default: {\n }\n }\n }\n else if (type && type === OUTBOUND_RTP) {\n switch (statName) {\n case CODEC_ID: {\n outboundCodec = report[statName];\n break;\n }\n case PACKETS_SENT: {\n txStat.Pkt = report[statName];\n break;\n }\n case BYTES_SENT: {\n txStat.Oct = report[statName];\n break;\n }\n case TARGET_BIT_RATE: {\n bitRate = report[statName];\n break;\n }\n default: {\n }\n }\n }\n else if (type && type === MEDIA_SOURCE) {\n switch (statName) {\n case TOTAL_SAMPLES_DURATION: {\n rxStat.Dur = report[statName];\n txStat.Dur = report[statName];\n break;\n }\n default: {\n }\n }\n }\n }\n });\n });\n if (roundTripTimeMeasurements !== 0) {\n vqPayload.VoOneWayDelayMs = totalRoundTripTime / (2 * roundTripTimeMeasurements);\n }\n else {\n vqPayload.VoOneWayDelayMs = 0;\n }\n vqPayload.hwType = `${platform.os}/${platform.name}-${platform.version}`;\n vqPayload.networkType = localCandidates[candidatePairs[selectedPair]];\n rxStat.AvgJit = jitterBufferDelay / jitterBufferEmittedCount;\n vqPayload.VoRxCodec = codecList[inboundCodec].split('/')[1];\n const txVqPayload = {};\n txVqPayload.VoTxCodec = codecList[outboundCodec].split('/')[1];\n txVqPayload.rtpBitRate = bitRate;\n const byeStats = {};\n rxStat.VQMetrics = vqPayload;\n txStat.VQMetrics = txVqPayload;\n byeStats[RTP_RX_STAT] = rxStat;\n byeStats[RTP_TX_STAT] = txStat;\n log.log(JSON.stringify(byeStats), { file: UTILS_FILE, method: parseMediaQualityStatistics.name });\n return byeStats;\n }\n catch (err) {\n log.warn(`Caught error while parsing RTP stats, ${err}`, {\n file: UTILS_FILE,\n method: parseMediaQualityStatistics.name,\n });\n return DUMMY_METRICS;\n }\n}\nexport const waitForMsecs = (msec) => new Promise((resolve) => {\n setTimeout(resolve, msec);\n});\nexport function getCallingBackEnd(webex) {\n const entModels = webex.internal.device.features.entitlement.models;\n let callingBackend;\n if (webex.internal.device.callingBehavior === NATIVE_WEBEX_TEAMS_CALLING) {\n for (let i = 0; i < entModels.length; i += 1) {\n if (entModels[i][VALUES][KEY] === ENTITLEMENT_BASIC ||\n entModels[i][VALUES][KEY] === ENTITLEMENT_STANDARD) {\n callingBackend = CALLING_BACKEND.WXC;\n break;\n }\n else if (entModels[i][VALUES][KEY] === ENTITLEMENT_BROADWORKS_CONN) {\n callingBackend = CALLING_BACKEND.BWRKS;\n break;\n }\n }\n }\n else if (webex.internal.device.callingBehavior === NATIVE_SIP_CALL_TO_UCM) {\n callingBackend = CALLING_BACKEND.UCM;\n }\n else {\n callingBackend = CALLING_BACKEND.INVALID;\n }\n return callingBackend;\n}\nexport async function getXsiActionEndpoint(webex, loggerContext, callingBackend) {\n try {\n switch (callingBackend) {\n case CALLING_BACKEND.WXC: {\n const userIdResponse = await webex.request({\n uri: `${webex.internal.services._serviceUrls.hydra}/${XSI_ACTION_ENDPOINT_ORG_URL_PARAM}`,\n method: HTTP_METHODS.GET,\n });\n const response = userIdResponse.body;\n const xsiEndpoint = response[ITEMS][0][XSI_ACTION_ENDPOINT];\n return xsiEndpoint;\n }\n case CALLING_BACKEND.BWRKS: {\n const bwTokenResponse = await webex.request({\n uri: `${webex.internal.services._serviceUrls.wdm}/${DEVICES}`,\n method: HTTP_METHODS.GET,\n });\n const response = bwTokenResponse.body;\n let xsiEndpoint = response[DEVICES][0][SETTINGS][BW_XSI_URL];\n const xsiUrl = response[DEVICES][0][SETTINGS][BW_XSI_URL];\n if (xsiUrl.endsWith(BW_XSI_ENDPOINT_VERSION)) {\n xsiEndpoint = xsiUrl.slice(0, -5);\n }\n else if (xsiUrl.endsWith(BW_XSI_ENDPOINT_VERSION_WITH_SLASH)) {\n xsiEndpoint = xsiUrl.slice(0, -6);\n }\n return xsiEndpoint;\n }\n default: {\n throw new Error('Calling backend is not identified, exiting....');\n }\n }\n }\n catch (err) {\n const errorInfo = err;\n serviceErrorCodeHandler(errorInfo, loggerContext);\n return errorInfo;\n }\n}\nexport function getVgActionEndpoint(webex, callingBackend) {\n try {\n if (callingBackend && callingBackend === CALLING_BACKEND.UCM) {\n return webex.internal.services._serviceUrls['ucmgmt-gateway'];\n }\n throw new Error('Calling backend is not identified, exiting....');\n }\n catch (err) {\n const errorInfo = err;\n return errorInfo;\n }\n}\nexport function getSortedVoicemailList(voiceMessageList, sortOrder) {\n if (sortOrder === SORT.DESC) {\n voiceMessageList.sort((voiceMail, nextVoiceMail) => nextVoiceMail[TIME][PLACEHOLDER_KEY] - voiceMail[TIME][PLACEHOLDER_KEY]);\n }\n else if (sortOrder === SORT.ASC) {\n voiceMessageList.sort((voiceMail, nextVoiceMail) => voiceMail[TIME][PLACEHOLDER_KEY] - nextVoiceMail[TIME][PLACEHOLDER_KEY]);\n }\n return voiceMessageList;\n}\nexport async function scimQuery(filter) {\n log.info(`Starting resolution for filter:- ${filter}`, {\n file: UTILS_FILE,\n method: 'scimQuery',\n });\n const sdkConnector = SDKConnector;\n const webex = sdkConnector.getWebex();\n const isProd = !webex.internal.device.url.includes('-int');\n const webexHost = isProd ? WEBEX_API_PROD : WEBEX_API_BTS;\n const scimUrl = `${webexHost}/${IDENTITY_ENDPOINT_RESOURCE}/${SCIM_ENDPOINT_RESOURCE}/${webex.internal.device.orgId}/${SCIM_USER_FILTER}`;\n const query = scimUrl + encodeURIComponent(filter);\n return webex.request({\n uri: query,\n method: HTTP_METHODS.GET,\n headers: {\n [CISCO_DEVICE_URL]: webex.internal.device.url,\n [SPARK_USER_AGENT]: CALLING_USER_AGENT,\n },\n });\n}\nexport async function resolveCallerIdDisplay(filter) {\n let resolution;\n const displayResult = {};\n try {\n const response = await scimQuery(filter);\n resolution = response.body;\n log.info(`Number of records found for this user :- ${resolution.totalResults}`, {\n file: UTILS_FILE,\n method: 'resolveCallerIdDisplay',\n });\n }\n catch (err) {\n const res = err;\n log.warn(`Error response: - ${res.statusCode}`, {\n file: UTILS_FILE,\n method: 'resolveCallerIdDisplay',\n });\n }\n if (resolution?.totalResults && resolution.totalResults > 0) {\n const scimResource = resolution.Resources[0];\n displayResult.name = scimResource.displayName;\n const numberObj = scimResource.phoneNumbers?.find((num) => num.primary) ||\n scimResource.phoneNumbers?.find((num) => num.type.toLowerCase() === 'work');\n if (numberObj) {\n displayResult.num = numberObj.value;\n }\n else if (scimResource.phoneNumbers && scimResource.phoneNumbers.length > 0) {\n log.info('Failure to resolve caller information. Setting number as caller ID', {\n file: UTILS_FILE,\n method: 'resolveCallerIdDisplay',\n });\n displayResult.num = scimResource.phoneNumbers[0].value;\n }\n const photo = scimResource.photos?.find((photo) => photo.type === 'thumbnail');\n displayResult.avatarSrc = photo ? photo.value : 'unknown';\n displayResult.id = scimResource.id;\n }\n return displayResult;\n}\nexport async function resolveCallerIdByName(name) {\n const displayResult = {};\n const sdkConnector = SDKConnector;\n const webex = sdkConnector.getWebex();\n const searchDirectory = (query) => {\n return webex.people.list({\n displayName: query,\n });\n };\n await searchDirectory(name).then((results) => {\n log.info(`DS Result: ${results}`, {\n file: UTILS_FILE,\n method: 'resolveCallerIdByName',\n });\n if (results && results.items && results.items.length > 0) {\n const resolution = results.items[0];\n displayResult.name = resolution.displayName;\n const id = Buffer.from(resolution.id, 'base64').toString('binary');\n displayResult.id = id.split('/').pop();\n const numObj = resolution.phoneNumbers.find((num) => num.type === 'work');\n if (numObj) {\n displayResult.num = numObj.value;\n }\n else if (resolution.phoneNumbers.length > 0) {\n displayResult.num = resolution.phoneNumbers[0].value;\n }\n displayResult.avatarSrc = resolution.avatar;\n log.info(`Extracted details:- name: ${displayResult.name} , number: ${displayResult.num}, photo: ${displayResult.avatarSrc}, id: ${displayResult.id}`, {\n file: UTILS_FILE,\n method: 'resolveCallerIdByName',\n });\n }\n });\n return displayResult;\n}\nexport async function resolveContact(callingPartyInfo) {\n if (callingPartyInfo.userExternalId && callingPartyInfo.userExternalId.$) {\n return resolveCallerIdDisplay(`id eq \"${callingPartyInfo.userExternalId.$}\"`);\n }\n if (callingPartyInfo.name && callingPartyInfo.name.$) {\n return resolveCallerIdByName(callingPartyInfo.name.$);\n }\n return null;\n}\nexport function storeVoicemailList(context, voiceMessageList) {\n const vmEncodedList = Buffer.from(JSON.stringify(voiceMessageList), 'utf8').toString('base64');\n sessionStorage.setItem(context, vmEncodedList.toString());\n}\nexport function fetchVoicemailList(context, offset, offsetLimit, loggerContext) {\n let moreVoicemails = false;\n let requiredVoicemailList = [];\n try {\n const voicemailList = JSON.parse(Buffer.from(sessionStorage.getItem(context), 'base64').toString('utf8'));\n log.info(`Length of voicemail list: ${voicemailList.length}`, loggerContext);\n if (voicemailList.length > offset + offsetLimit) {\n moreVoicemails = true;\n }\n requiredVoicemailList = voicemailList.slice(offset, offset + offsetLimit);\n }\n catch (err) {\n log.warn(`Caught exception while fetching voicemail from storage. ${err}`, loggerContext);\n const errorInfo = err;\n serviceErrorCodeHandler(errorInfo, {});\n }\n return { messages: requiredVoicemailList, moreVMAvailable: moreVoicemails };\n}\nexport function inferIdFromUuid(id, decodeType) {\n return Buffer.from(`${INFER_ID_CONSTANT}/${decodeType}/${id}`, 'binary').toString('base64');\n}\nfunction isValidServiceIndicator(indicator) {\n return Object.values(ServiceIndicator).some((v) => v === indicator);\n}\nfunction isValidServiceDomain(serviceData) {\n const regexp = /^[a-z0-9]+([-.]{1}[a-z0-9]+)*\\.[a-z]{2,6}$/i;\n const { domain } = serviceData;\n if (!domain) {\n return (serviceData.indicator === ServiceIndicator.CALLING ||\n serviceData.indicator === ServiceIndicator.GUEST_CALLING);\n }\n return regexp.test(domain);\n}\nexport function validateServiceData(serviceData) {\n const allowedValues = Object.values(ServiceIndicator);\n const formattedValues = allowedValues.join(', ').replace(/,([^,]*)$/, ' and$1');\n if (!isValidServiceIndicator(serviceData.indicator)) {\n throw new Error(`Invalid service indicator, Allowed values are: ${formattedValues}`);\n }\n if (!isValidServiceDomain(serviceData)) {\n throw new Error('Invalid service domain.');\n }\n}\nexport function modifySdpForIPv4(sdp) {\n try {\n sdp = sdp.replace(/\\r\\n|\\r/g, '\\n');\n sdp = sdp.replace(/^[ \\t]+/gm, '');\n const ipv6CLineMatches = sdp.match(/c=IN IP6 [\\da-f:.]+/gi) || [];\n const hasIPv6CLine = ipv6CLineMatches.length > 0;\n if (hasIPv6CLine) {\n log.info('Modifying SDP for IPv4 compatibility', {\n file: UTILS_FILE,\n method: modifySdpForIPv4.name,\n });\n const ipv4CandidateMatch = sdp.match(/a=candidate:\\d+ \\d+ \\w+ \\d+ ([\\d.]+) \\d+ typ \\w+/);\n const ipv4Address = ipv4CandidateMatch?.[1] || '192.1.1.1';\n sdp = sdp.replace(/c=IN IP6 [\\da-f:.]+/gi, `c=IN IP4 ${ipv4Address}`);\n if (!ipv4CandidateMatch) {\n let ipv4CandidateAdded = false;\n sdp = sdp.replace(/(a=candidate:(\\d+) (\\d+) (\\w+) (\\d+) ([\\da-f:.]+) (\\d+) typ (\\w+)[^\\n]*)/g, (match, full, foundation, componentId, transport, priority, connectionAddress, port, candidateType) => {\n if (!ipv4CandidateAdded && connectionAddress.includes(':')) {\n ipv4CandidateAdded = true;\n const newFoundation = (parseInt(foundation, 10) + 1).toString();\n return (`${full}\\n` +\n `a=candidate:${newFoundation} ${componentId} ${transport} ${priority} ${ipv4Address} ${port} typ ${candidateType} generation 0 network-id 1 network-cost 10`);\n }\n return match;\n });\n }\n }\n return sdp;\n }\n catch (error) {\n log.warn(`Error modifying SDP for IPv4 compatibility: ${error}`, {\n file: UTILS_FILE,\n method: modifySdpForIPv4.name,\n });\n return sdp;\n }\n}\nexport async function uploadLogs(webex, data = {}) {\n try {\n await webex.internal.support.submitLogs(data);\n }\n catch (error) {\n log.error(error, {\n file: UTILS_FILE,\n method: 'uploadLogs',\n });\n }\n}\n","export const BASE64 = 'base64';\nexport const BEARER = 'bearer';\nexport const BINARY = 'binary';\nexport const CONTENT = 'content';\nexport const DEVICES = 'devices';\nexport const FAILURE_MESSAGE = 'FAILURE';\nexport const IDENTITY_ENDPOINT_RESOURCE = 'identity';\nexport const ITEMS = 'items';\nexport const KEY = 'key';\nexport const OBJECT = 'object';\nexport const PLACEHOLDER_KEY = '$';\nexport const RAW_REQUEST = 'rawRequest';\nexport const RESPONSE = 'response';\nexport const RESPONSE_DATA = 'responseData';\nexport const RESPONSE_MESSAGE = 'responseMessage';\nexport const SCIM_ENDPOINT_RESOURCE = 'scim';\nexport const SCIM_USER_FILTER = 'v2/Users?filter=';\nexport const SETTINGS = 'settings';\nexport const STATUS_CODE = 'statusCode';\nexport const SUCCESS_MESSAGE = 'SUCCESS';\nexport const SUCCESS_STATUS_CODE = 200;\nexport const UNPROCESSABLE_CONTENT_CODE = 422;\nexport const TIME = 'time';\nexport const TOKEN = 'token';\nexport const TRANSCRIPT = 'transcript';\nexport const USER = 'user';\nexport const USERS = 'users';\nexport const USER_SESSIONS = 'userSessions';\nexport const VALUES = '_values';\nexport const XML_TYPE = 'text/xml';\nexport const XSI_ACTION_ENDPOINT = 'xsiActionsEndpoint';\nexport const XSI_ACTION_ENDPOINT_ORG_URL_PARAM = 'organizations?callingData=true';\nexport const SERVICES_ENDPOINT = 'services';\nexport const INFER_ID_CONSTANT = 'ciscospark://us';\nexport const ENTITLEMENT_BASIC = 'bc-sp-basic';\nexport const ENTITLEMENT_BROADWORKS_CONN = 'broadworks-connector';\nexport const ENTITLEMENT_STANDARD = 'bc-sp-standard';\nexport const NATIVE_SIP_CALL_TO_UCM = 'NATIVE_SIP_CALL_TO_UCM';\nexport const NATIVE_WEBEX_TEAMS_CALLING = 'NATIVE_WEBEX_TEAMS_CALLING';\nexport const BW_XSI_ENDPOINT_VERSION = 'v2.0';\nexport const BW_XSI_ENDPOINT_VERSION_WITH_SLASH = 'v2.0/';\nexport const BW_XSI_URL = 'broadworksXsiActionsUrl';\nexport const WEBEX_CALLING_CONNECTOR_FILE = 'WxCallBackendConnector';\nexport const UCM_CONNECTOR_FILE = 'UcmBackendConnector';\nexport const VOICEMAIL = 'VOICEMAIL';\nexport const SCIM_WEBEXIDENTITY_USER = 'urn:scim:schemas:extension:cisco:webexidentity:2.0:User';\nexport const SCIM_ENTERPRISE_USER = 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User';\nexport const WEBEX_API_PROD = 'https://webexapis.com';\nexport const WEBEX_API_BTS = 'https://integration.webexapis.com';\nexport const WEBEX_API_CONFIG_INT_URL = `${WEBEX_API_BTS}/v1/uc/config`;\nexport const WEBEX_API_CONFIG_PROD_URL = `${WEBEX_API_PROD}/v1/uc/config`;\n","export * from './Utils';\n","import { SCIM_ENTERPRISE_USER, SCIM_WEBEXIDENTITY_USER } from './constants';\nexport var ALLOWED_SERVICES;\n(function (ALLOWED_SERVICES) {\n ALLOWED_SERVICES[\"MOBIUS\"] = \"mobius\";\n ALLOWED_SERVICES[\"JANUS\"] = \"janus\";\n})(ALLOWED_SERVICES || (ALLOWED_SERVICES = {}));\nexport var HTTP_METHODS;\n(function (HTTP_METHODS) {\n HTTP_METHODS[\"GET\"] = \"GET\";\n HTTP_METHODS[\"POST\"] = \"POST\";\n HTTP_METHODS[\"PATCH\"] = \"PATCH\";\n HTTP_METHODS[\"PUT\"] = \"PUT\";\n HTTP_METHODS[\"DELETE\"] = \"DELETE\";\n})(HTTP_METHODS || (HTTP_METHODS = {}));\nexport var RegistrationStatus;\n(function (RegistrationStatus) {\n RegistrationStatus[\"IDLE\"] = \"IDLE\";\n RegistrationStatus[\"ACTIVE\"] = \"active\";\n RegistrationStatus[\"INACTIVE\"] = \"inactive\";\n})(RegistrationStatus || (RegistrationStatus = {}));\nexport var CALLING_BACKEND;\n(function (CALLING_BACKEND) {\n CALLING_BACKEND[\"WXC\"] = \"WEBEX_CALLING\";\n CALLING_BACKEND[\"BWRKS\"] = \"BROADWORKS_CALLING\";\n CALLING_BACKEND[\"UCM\"] = \"UCM_CALLING\";\n CALLING_BACKEND[\"INVALID\"] = \"Calling backend is currently not supported\";\n})(CALLING_BACKEND || (CALLING_BACKEND = {}));\nexport var CallType;\n(function (CallType) {\n CallType[\"URI\"] = \"uri\";\n CallType[\"TEL\"] = \"tel\";\n})(CallType || (CallType = {}));\nexport var CallDirection;\n(function (CallDirection) {\n CallDirection[\"INBOUND\"] = \"inbound\";\n CallDirection[\"OUTBOUND\"] = \"outbound\";\n})(CallDirection || (CallDirection = {}));\nexport var SORT;\n(function (SORT) {\n SORT[\"ASC\"] = \"ASC\";\n SORT[\"DESC\"] = \"DESC\";\n SORT[\"DEFAULT\"] = \"DESC\";\n})(SORT || (SORT = {}));\nexport var SORT_BY;\n(function (SORT_BY) {\n SORT_BY[\"END_TIME\"] = \"endTime\";\n SORT_BY[\"DEFAULT\"] = \"endTime\";\n SORT_BY[\"START_TIME\"] = \"startTime\";\n})(SORT_BY || (SORT_BY = {}));\nexport var ServiceIndicator;\n(function (ServiceIndicator) {\n ServiceIndicator[\"CALLING\"] = \"calling\";\n ServiceIndicator[\"CONTACT_CENTER\"] = \"contactcenter\";\n ServiceIndicator[\"GUEST_CALLING\"] = \"guestcalling\";\n})(ServiceIndicator || (ServiceIndicator = {}));\nexport var DecodeType;\n(function (DecodeType) {\n DecodeType[\"PEOPLE\"] = \"PEOPLE\";\n DecodeType[\"ORGANIZATION\"] = \"ORGANIZATION\";\n})(DecodeType || (DecodeType = {}));\nexport var WorkerMessageType;\n(function (WorkerMessageType) {\n WorkerMessageType[\"START_KEEPALIVE\"] = \"START_KEEPALIVE\";\n WorkerMessageType[\"CLEAR_KEEPALIVE\"] = \"CLEAR_KEEPALIVE\";\n WorkerMessageType[\"KEEPALIVE_SUCCESS\"] = \"KEEPALIVE_SUCCESS\";\n WorkerMessageType[\"KEEPALIVE_FAILURE\"] = \"KEEPALIVE_FAILURE\";\n})(WorkerMessageType || (WorkerMessageType = {}));\n","import { NoiseReductionEffect, createMicrophoneStream } from '@webex/media-helpers';\nimport { createCallSettingsClient } from './CallSettings/CallSettings';\nimport { createContactsClient } from './Contacts/ContactsClient';\nimport { createClient } from './CallingClient/CallingClient';\nimport { createCallHistoryClient } from './CallHistory/CallHistory';\nimport { createVoicemailClient } from './Voicemail/Voicemail';\nimport Logger from './Logger';\nexport { createClient, createCallHistoryClient, createCallSettingsClient, createContactsClient, createMicrophoneStream, createVoicemailClient, Logger, NoiseReductionEffect, };\nexport { ERROR_LAYER, ERROR_TYPE } from './Errors/types';\nexport { GroupType } from './Contacts/types';\nexport { LINE_EVENTS } from './CallingClient/line/types';\nexport { CALLING_CLIENT_EVENT_KEYS, CALL_EVENT_KEYS, Disposition, LINE_EVENT_KEYS, COMMON_EVENT_KEYS, } from './Events/types';\nexport { CallDirection, CallType, SORT, SORT_BY, } from './common/types';\nexport { CallError, LineError } from './Errors';\nexport { TransferType } from './CallingClient/calling/types';\nexport { LOGGER } from './Logger/types';\nexport { LocalMicrophoneStream } from '@webex/media-helpers';\n","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import { __assign } from './_virtual/_tslib.js';\nimport { symbolObservable, toInvokeSource, mapContext, isMachine } from './utils.js';\nimport { provide } from './serviceScope.js';\n\nfunction createNullActor(id) {\n var _a;\n\n return _a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a;\n}\n/**\r\n * Creates a deferred actor that is able to be invoked given the provided\r\n * invocation information in its `.meta` value.\r\n *\r\n * @param invokeDefinition The meta information needed to invoke the actor.\r\n */\n\nfunction createInvocableActor(invokeDefinition, machine, context, _event) {\n var _a;\n\n var invokeSrc = toInvokeSource(invokeDefinition.src);\n var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];\n var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : undefined;\n var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore\n\n tempActor.meta = invokeDefinition;\n return tempActor;\n}\nfunction createDeferredActor(entity, id, data) {\n var tempActor = createNullActor(id); // @ts-ignore\n\n tempActor.deferred = true;\n\n if (isMachine(entity)) {\n // \"mute\" the existing service scope so potential spawned actors within the `.initialState` stay deferred here\n var initialState_1 = tempActor.state = provide(undefined, function () {\n return (data ? entity.withContext(data) : entity).initialState;\n });\n\n tempActor.getSnapshot = function () {\n return initialState_1;\n };\n }\n\n return tempActor;\n}\nfunction isActor(item) {\n try {\n return typeof item.send === 'function';\n } catch (e) {\n return false;\n }\n}\nfunction isSpawnedActor(item) {\n return isActor(item) && 'id' in item;\n} // TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now\n\nfunction toActorRef(actorRefLike) {\n var _a;\n\n return __assign((_a = {\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n id: 'anonymous',\n getSnapshot: function () {\n return undefined;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a), actorRefLike);\n}\n\nexport { createDeferredActor, createInvocableActor, createNullActor, isActor, isSpawnedActor, toActorRef };\n","import { StateNode } from './StateNode.js';\n\nfunction Machine(config, options, initialContext) {\n if (initialContext === void 0) {\n initialContext = config.context;\n }\n\n return new StateNode(config, options, initialContext);\n}\nfunction createMachine(config, options) {\n return new StateNode(config, options);\n}\n\nexport { Machine, createMachine };\n","import { __assign, __spreadArray, __read, __rest } from './_virtual/_tslib.js';\nimport { EMPTY_ACTIVITY_MAP } from './constants.js';\nimport { isString, matchesState, warn } from './utils.js';\nimport { getMeta, nextEvents } from './stateUtils.js';\nimport { initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nfunction stateValuesEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a === undefined || b === undefined) {\n return false;\n }\n\n if (isString(a) || isString(b)) {\n return a === b;\n }\n\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n return aKeys.length === bKeys.length && aKeys.every(function (key) {\n return stateValuesEqual(a[key], b[key]);\n });\n}\nfunction isStateConfig(state) {\n if (typeof state !== 'object' || state === null) {\n return false;\n }\n\n return 'value' in state && '_event' in state;\n}\n/**\r\n * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.\r\n */\n\nvar isState = isStateConfig;\nfunction bindActionToState(action, state) {\n var exec = action.exec;\n\n var boundAction = __assign(__assign({}, action), {\n exec: exec !== undefined ? function () {\n return exec(state.context, state.event, {\n action: action,\n state: state,\n _event: state._event\n });\n } : undefined\n });\n\n return boundAction;\n}\n\nvar State =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new State instance.\r\n * @param value The state value\r\n * @param context The extended state\r\n * @param historyValue The tree representing historical values of the state nodes\r\n * @param history The previous state\r\n * @param actions An array of action objects to execute as side-effects\r\n * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).\r\n * @param meta\r\n * @param events Internal event queue. Should be empty with run-to-completion semantics.\r\n * @param configuration\r\n */\n function State(config) {\n var _this = this;\n\n var _a;\n\n this.actions = [];\n this.activities = EMPTY_ACTIVITY_MAP;\n this.meta = {};\n this.events = [];\n this.value = config.value;\n this.context = config.context;\n this._event = config._event;\n this._sessionid = config._sessionid;\n this.event = this._event.data;\n this.historyValue = config.historyValue;\n this.history = config.history;\n this.actions = config.actions || [];\n this.activities = config.activities || EMPTY_ACTIVITY_MAP;\n this.meta = getMeta(config.configuration);\n this.events = config.events || [];\n this.matches = this.matches.bind(this);\n this.toStrings = this.toStrings.bind(this);\n this.configuration = config.configuration;\n this.transitions = config.transitions;\n this.children = config.children;\n this.done = !!config.done;\n this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();\n this.machine = config.machine;\n Object.defineProperty(this, 'nextEvents', {\n get: function () {\n return nextEvents(_this.configuration);\n }\n });\n }\n /**\r\n * Creates a new State instance for the given `stateValue` and `context`.\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.from = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (stateValue.context !== context) {\n return new State({\n value: stateValue.value,\n context: context,\n _event: stateValue._event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n actions: [],\n activities: stateValue.activities,\n meta: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n }\n\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: undefined,\n history: undefined,\n actions: [],\n activities: undefined,\n meta: undefined,\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n };\n /**\r\n * Creates a new State instance for the given `config`.\r\n * @param config The state config\r\n */\n\n\n State.create = function (config) {\n return new State(config);\n };\n /**\r\n * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.inert = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (!stateValue.actions.length) {\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue.value,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n activities: stateValue.activities,\n configuration: stateValue.configuration,\n transitions: [],\n children: {}\n });\n }\n\n return State.from(stateValue, context);\n };\n /**\r\n * Returns an array of all the string leaf state node paths.\r\n * @param stateValue\r\n * @param delimiter The character(s) that separate each subpath in the string state node path.\r\n */\n\n\n State.prototype.toStrings = function (stateValue, delimiter) {\n var _this = this;\n\n if (stateValue === void 0) {\n stateValue = this.value;\n }\n\n if (delimiter === void 0) {\n delimiter = '.';\n }\n\n if (isString(stateValue)) {\n return [stateValue];\n }\n\n var valueKeys = Object.keys(stateValue);\n return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function (key) {\n return _this.toStrings(stateValue[key], delimiter).map(function (s) {\n return key + delimiter + s;\n });\n })), false));\n };\n\n State.prototype.toJSON = function () {\n var _a = this;\n _a.configuration;\n _a.transitions;\n var tags = _a.tags;\n _a.machine;\n var jsonValues = __rest(_a, [\"configuration\", \"transitions\", \"tags\", \"machine\"]);\n\n return __assign(__assign({}, jsonValues), {\n tags: Array.from(tags)\n });\n };\n\n State.prototype.matches = function (parentStateValue) {\n return matchesState(parentStateValue, this.value);\n };\n /**\r\n * Whether the current state configuration has a state node with the specified `tag`.\r\n * @param tag\r\n */\n\n\n State.prototype.hasTag = function (tag) {\n return this.tags.has(tag);\n };\n /**\r\n * Determines whether sending the `event` will cause a non-forbidden transition\r\n * to be selected, even if the transitions have no actions nor\r\n * change the state value.\r\n *\r\n * @param event The event to test\r\n * @returns Whether the event will cause a transition\r\n */\n\n\n State.prototype.can = function (event) {\n var _a;\n\n if (IS_PRODUCTION) {\n warn(!!this.machine, \"state.can(...) used outside of a machine-created State object; this will always return false.\");\n }\n\n var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);\n return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden\n transitionData.transitions.some(function (t) {\n return t.target !== undefined || t.actions.length;\n });\n };\n\n return State;\n}();\n\nexport { State, bindActionToState, isState, isStateConfig, stateValuesEqual };\n","import { __assign, __spreadArray, __read, __values, __rest } from './_virtual/_tslib.js';\nimport { isFunction, mapValues, isArray, flatten, toArray, toStateValue, isString, getEventType, toSCXMLEvent, matchesState, path, evaluateGuard, mapContext, pathToStateValue, isBuiltInEvent, partition, updateHistoryValue, toStatePath, mapFilterValues, warn, toStatePaths, nestedPath, normalizeTarget, toGuard, toTransitionConfigArray, isMachine, createInvokeId } from './utils.js';\nimport { SpecialTargets } from './types.js';\nimport { State, stateValuesEqual } from './State.js';\nimport { start as start$1, stop as stop$1, raise as raise$1, send, invoke, update, nullEvent } from './actionTypes.js';\nimport { done, start, raise, stop, toActionObjects, resolveActions, doneInvoke, error, toActionObject, toActivityDefinition, after, send as send$1, cancel, initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { STATE_DELIMITER } from './constants.js';\nimport { getAllStateNodes, getConfiguration, isInFinalState, getTagsFromConfiguration, has, getChildren, getValue, isLeafNode } from './stateUtils.js';\nimport { createInvocableActor } from './Actor.js';\nimport { toInvokeDefinition } from './invokeUtils.js';\n\nvar NULL_EVENT = '';\nvar STATE_IDENTIFIER = '#';\nvar WILDCARD = '*';\nvar EMPTY_OBJECT = {};\n\nvar isStateId = function (str) {\n return str[0] === STATE_IDENTIFIER;\n};\n\nvar createDefaultOptions = function () {\n return {\n actions: {},\n guards: {},\n services: {},\n activities: {},\n delays: {}\n };\n};\n\nvar validateArrayifiedTransitions = function (stateNode, event, transitions) {\n var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {\n return !('cond' in transition) && !('in' in transition) && (isString(transition.target) || isMachine(transition.target));\n });\n var eventText = event === NULL_EVENT ? 'the transient event' : \"event '\".concat(event, \"'\");\n warn(!hasNonLastUnguardedTarget, \"One or more transitions for \".concat(eventText, \" on state '\").concat(stateNode.id, \"' are unreachable. \") + \"Make sure that the default transition is the last one defined.\");\n};\n\nvar StateNode =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function StateNode(\n /**\r\n * The raw config used to create the machine.\r\n */\n config, options,\n /**\r\n * The initial extended state\r\n */\n _context, // TODO: this is unsafe, but we're removing it in v5 anyway\n _stateInfo) {\n var _this = this;\n\n if (_context === void 0) {\n _context = 'context' in config ? config.context : undefined;\n }\n\n var _a;\n\n this.config = config;\n this._context = _context;\n /**\r\n * The order this state node appears. Corresponds to the implicit SCXML document order.\r\n */\n\n this.order = -1;\n this.__xstatenode = true;\n this.__cache = {\n events: undefined,\n relativeValue: new Map(),\n initialStateValue: undefined,\n initialState: undefined,\n on: undefined,\n transitions: undefined,\n candidates: {},\n delayedTransitions: undefined\n };\n this.idMap = {};\n this.tags = [];\n this.options = Object.assign(createDefaultOptions(), options);\n this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;\n this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.key) || this.config.id || '(machine)';\n this.machine = this.parent ? this.parent.machine : this;\n this.path = this.parent ? this.parent.path.concat(this.key) : [];\n this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : STATE_DELIMITER);\n this.id = this.config.id || __spreadArray([this.machine.key], __read(this.path), false).join(this.delimiter);\n this.version = this.parent ? this.parent.version : this.config.version;\n this.type = this.config.type || (this.config.parallel ? 'parallel' : this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n this.schema = this.parent ? this.machine.schema : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};\n this.description = this.config.description;\n\n if (!IS_PRODUCTION) {\n warn(!('parallel' in this.config), \"The \\\"parallel\\\" property is deprecated and will be removed in version 4.1. \".concat(this.config.parallel ? \"Replace with `type: 'parallel'`\" : \"Use `type: '\".concat(this.type, \"'`\"), \" in the config for state node '\").concat(this.id, \"' instead.\"));\n }\n\n this.initial = this.config.initial;\n this.states = this.config.states ? mapValues(this.config.states, function (stateConfig, key) {\n var _a;\n\n var stateNode = new StateNode(stateConfig, {}, undefined, {\n parent: _this,\n key: key\n });\n Object.assign(_this.idMap, __assign((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));\n return stateNode;\n }) : EMPTY_OBJECT; // Document order\n\n var order = 0;\n\n function dfs(stateNode) {\n var e_1, _a;\n\n stateNode.order = order++;\n\n try {\n for (var _b = __values(getChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n dfs(child);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n dfs(this); // History config\n\n this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {\n var event = _a.event;\n return event === NULL_EVENT;\n }) : NULL_EVENT in this.config.on);\n this.strict = !!this.config.strict; // TODO: deprecate (entry)\n\n this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function (action) {\n return toActionObject(action);\n }); // TODO: deprecate (exit)\n\n this.onExit = toArray(this.config.exit || this.config.onExit).map(function (action) {\n return toActionObject(action);\n });\n this.meta = this.config.meta;\n this.doneData = this.type === 'final' ? this.config.data : undefined;\n this.invoke = toArray(this.config.invoke).map(function (invokeConfig, i) {\n var _a, _b;\n\n if (isMachine(invokeConfig)) {\n var invokeId = createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);\n return toInvokeDefinition({\n src: invokeId,\n id: invokeId\n });\n } else if (isString(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n return toInvokeDefinition(__assign(__assign({}, invokeConfig), {\n id: invokeId,\n src: invokeConfig.src\n }));\n } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);\n return toInvokeDefinition(__assign(__assign({\n id: invokeId\n }, invokeConfig), {\n src: invokeId\n }));\n } else {\n var invokeSource = invokeConfig.src;\n return toInvokeDefinition(__assign(__assign({\n id: createInvokeId(_this.id, i)\n }, invokeConfig), {\n src: invokeSource\n }));\n }\n });\n this.activities = toArray(this.config.activities).concat(this.invoke).map(function (activity) {\n return toActivityDefinition(activity);\n });\n this.transition = this.transition.bind(this);\n this.tags = toArray(this.config.tags); // TODO: this is the real fix for initialization once\n // state node getters are deprecated\n // if (!this.parent) {\n // this._init();\n // }\n }\n\n StateNode.prototype._init = function () {\n if (this.__cache.transitions) {\n return;\n }\n\n getAllStateNodes(this).forEach(function (stateNode) {\n return stateNode.on;\n });\n };\n /**\r\n * Clones this state machine with custom options and context.\r\n *\r\n * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.\r\n * @param context Custom context (will override predefined context)\r\n */\n\n\n StateNode.prototype.withConfig = function (options, context) {\n var _a = this.options,\n actions = _a.actions,\n activities = _a.activities,\n guards = _a.guards,\n services = _a.services,\n delays = _a.delays;\n return new StateNode(this.config, {\n actions: __assign(__assign({}, actions), options.actions),\n activities: __assign(__assign({}, activities), options.activities),\n guards: __assign(__assign({}, guards), options.guards),\n services: __assign(__assign({}, services), options.services),\n delays: __assign(__assign({}, delays), options.delays)\n }, context !== null && context !== void 0 ? context : this.context);\n };\n /**\r\n * Clones this state machine with custom context.\r\n *\r\n * @param context Custom context (will override predefined context, not recursive)\r\n */\n\n\n StateNode.prototype.withContext = function (context) {\n return new StateNode(this.config, this.options, context);\n };\n\n Object.defineProperty(StateNode.prototype, \"context\", {\n get: function () {\n return isFunction(this._context) ? this._context() : this._context;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"definition\", {\n /**\r\n * The well-structured state node definition.\r\n */\n get: function () {\n return {\n id: this.id,\n key: this.key,\n version: this.version,\n context: this.context,\n type: this.type,\n initial: this.initial,\n history: this.history,\n states: mapValues(this.states, function (state) {\n return state.definition;\n }),\n on: this.on,\n transitions: this.transitions,\n entry: this.onEntry,\n exit: this.onExit,\n activities: this.activities || [],\n meta: this.meta,\n order: this.order || -1,\n data: this.doneData,\n invoke: this.invoke,\n description: this.description,\n tags: this.tags\n };\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.toJSON = function () {\n return this.definition;\n };\n\n Object.defineProperty(StateNode.prototype, \"on\", {\n /**\r\n * The mapping of events to transitions.\r\n */\n get: function () {\n if (this.__cache.on) {\n return this.__cache.on;\n }\n\n var transitions = this.transitions;\n return this.__cache.on = transitions.reduce(function (map, transition) {\n map[transition.eventType] = map[transition.eventType] || [];\n map[transition.eventType].push(transition);\n return map;\n }, {});\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"after\", {\n get: function () {\n return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"transitions\", {\n /**\r\n * All the transitions that can be taken from this state node.\r\n */\n get: function () {\n return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getCandidates = function (eventName) {\n if (this.__cache.candidates[eventName]) {\n return this.__cache.candidates[eventName];\n }\n\n var transient = eventName === NULL_EVENT;\n var candidates = this.transitions.filter(function (transition) {\n var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions\n\n return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;\n });\n this.__cache.candidates[eventName] = candidates;\n return candidates;\n };\n /**\r\n * All delayed transitions from the config.\r\n */\n\n\n StateNode.prototype.getDelayedTransitions = function () {\n var _this = this;\n\n var afterConfig = this.config.after;\n\n if (!afterConfig) {\n return [];\n }\n\n var mutateEntryExit = function (delay, i) {\n var delayRef = isFunction(delay) ? \"\".concat(_this.id, \":delay[\").concat(i, \"]\") : delay;\n var eventType = after(delayRef, _this.id);\n\n _this.onEntry.push(send$1(eventType, {\n delay: delay\n }));\n\n _this.onExit.push(cancel(eventType));\n\n return eventType;\n };\n\n var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function (transition, i) {\n var eventType = mutateEntryExit(transition.delay, i);\n return __assign(__assign({}, transition), {\n event: eventType\n });\n }) : flatten(Object.keys(afterConfig).map(function (delay, i) {\n var configTransition = afterConfig[delay];\n var resolvedTransition = isString(configTransition) ? {\n target: configTransition\n } : configTransition;\n var resolvedDelay = !isNaN(+delay) ? +delay : delay;\n var eventType = mutateEntryExit(resolvedDelay, i);\n return toArray(resolvedTransition).map(function (transition) {\n return __assign(__assign({}, transition), {\n event: eventType,\n delay: resolvedDelay\n });\n });\n }));\n return delayedTransitions.map(function (delayedTransition) {\n var delay = delayedTransition.delay;\n return __assign(__assign({}, _this.formatTransition(delayedTransition)), {\n delay: delay\n });\n });\n };\n /**\r\n * Returns the state nodes represented by the current state value.\r\n *\r\n * @param state The state value or State instance\r\n */\n\n\n StateNode.prototype.getStateNodes = function (state) {\n var _a;\n\n var _this = this;\n\n if (!state) {\n return [];\n }\n\n var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);\n\n if (isString(stateValue)) {\n var initialStateValue = this.getStateNode(stateValue).initial;\n return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];\n }\n\n var subStateKeys = Object.keys(stateValue);\n var subStateNodes = [this];\n subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function (subStateKey) {\n return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);\n }))), false));\n return subStateNodes;\n };\n /**\r\n * Returns `true` if this state node explicitly handles the given event.\r\n *\r\n * @param event The event in question\r\n */\n\n\n StateNode.prototype.handles = function (event) {\n var eventType = getEventType(event);\n return this.events.includes(eventType);\n };\n /**\r\n * Resolves the given `state` to a new `State` instance relative to this machine.\r\n *\r\n * This ensures that `.events` and `.nextEvents` represent the correct values.\r\n *\r\n * @param state The state to resolve\r\n */\n\n\n StateNode.prototype.resolveState = function (state) {\n var stateFromConfig = state instanceof State ? state : State.create(state);\n var configuration = Array.from(getConfiguration([], this.getStateNodes(stateFromConfig.value)));\n return new State(__assign(__assign({}, stateFromConfig), {\n value: this.resolve(stateFromConfig.value),\n configuration: configuration,\n done: isInFinalState(configuration, this),\n tags: getTagsFromConfiguration(configuration),\n machine: this.machine\n }));\n };\n\n StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {\n var stateNode = this.getStateNode(stateValue);\n var next = stateNode.next(state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {\n var subStateKeys = Object.keys(stateValue);\n var stateNode = this.getStateNode(subStateKeys[0]);\n\n var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {\n var e_2, _a;\n\n var transitionMap = {};\n\n try {\n for (var _b = __values(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var subStateKey = _c.value;\n var subStateValue = stateValue[subStateKey];\n\n if (!subStateValue) {\n continue;\n }\n\n var subStateNode = this.getStateNode(subStateKey);\n\n var next = subStateNode._transition(subStateValue, state, _event);\n\n if (next) {\n transitionMap[subStateKey] = next;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n var stateTransitions = Object.keys(transitionMap).map(function (key) {\n return transitionMap[key];\n });\n var enabledTransitions = flatten(stateTransitions.map(function (st) {\n return st.transitions;\n }));\n var willTransition = stateTransitions.some(function (st) {\n return st.transitions.length > 0;\n });\n\n if (!willTransition) {\n return this.next(state, _event);\n }\n\n var entryNodes = flatten(stateTransitions.map(function (t) {\n return t.entrySet;\n }));\n var configuration = flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].configuration;\n }));\n return {\n transitions: enabledTransitions,\n entrySet: entryNodes,\n exitSet: flatten(stateTransitions.map(function (t) {\n return t.exitSet;\n })),\n configuration: configuration,\n source: state,\n actions: flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].actions;\n }))\n };\n };\n\n StateNode.prototype._transition = function (stateValue, state, _event) {\n // leaf node\n if (isString(stateValue)) {\n return this.transitionLeafNode(stateValue, state, _event);\n } // hierarchical node\n\n\n if (Object.keys(stateValue).length === 1) {\n return this.transitionCompoundNode(stateValue, state, _event);\n } // orthogonal node\n\n\n return this.transitionParallelNode(stateValue, state, _event);\n };\n\n StateNode.prototype.getTransitionData = function (state, event) {\n return this._transition(state.value, state, toSCXMLEvent(event));\n };\n\n StateNode.prototype.next = function (state, _event) {\n var e_3, _a;\n\n var _this = this;\n\n var eventName = _event.name;\n var actions = [];\n var nextStateNodes = [];\n var selectedTransition;\n\n try {\n for (var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var candidate = _c.value;\n var cond = candidate.cond,\n stateIn = candidate.in;\n var resolvedContext = state.context;\n var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? // Check if in state by ID\n state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent\n matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;\n var guardPassed = false;\n\n try {\n guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);\n } catch (err) {\n throw new Error(\"Unable to evaluate guard '\".concat(cond.name || cond.type, \"' in transition for event '\").concat(eventName, \"' in state node '\").concat(this.id, \"':\\n\").concat(err.message));\n }\n\n if (guardPassed && isInState) {\n if (candidate.target !== undefined) {\n nextStateNodes = candidate.target;\n }\n\n actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));\n selectedTransition = candidate;\n break;\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n if (!selectedTransition) {\n return undefined;\n }\n\n if (!nextStateNodes.length) {\n return {\n transitions: [selectedTransition],\n entrySet: [],\n exitSet: [],\n configuration: state.value ? [this] : [],\n source: state,\n actions: actions\n };\n }\n\n var allNextStateNodes = flatten(nextStateNodes.map(function (stateNode) {\n return _this.getRelativeStateNodes(stateNode, state.historyValue);\n }));\n var isInternal = !!selectedTransition.internal;\n var reentryNodes = isInternal ? [] : flatten(allNextStateNodes.map(function (n) {\n return _this.nodesFromChild(n);\n }));\n return {\n transitions: [selectedTransition],\n entrySet: reentryNodes,\n exitSet: isInternal ? [] : [this],\n configuration: allNextStateNodes,\n source: state,\n actions: actions\n };\n };\n\n StateNode.prototype.nodesFromChild = function (childStateNode) {\n if (childStateNode.escapes(this)) {\n return [];\n }\n\n var nodes = [];\n var marker = childStateNode;\n\n while (marker && marker !== this) {\n nodes.push(marker);\n marker = marker.parent;\n }\n\n nodes.push(this); // inclusive\n\n return nodes;\n };\n /**\r\n * Whether the given state node \"escapes\" this state node. If the `stateNode` is equal to or the parent of\r\n * this state node, it does not escape.\r\n */\n\n\n StateNode.prototype.escapes = function (stateNode) {\n if (this === stateNode) {\n return false;\n }\n\n var parent = this.parent;\n\n while (parent) {\n if (parent === stateNode) {\n return false;\n }\n\n parent = parent.parent;\n }\n\n return true;\n };\n\n StateNode.prototype.getActions = function (transition, currentContext, _event, prevState) {\n var e_4, _a, e_5, _b;\n\n var prevConfig = getConfiguration([], prevState ? this.getStateNodes(prevState.value) : [this]);\n var resolvedConfig = transition.configuration.length ? getConfiguration(prevConfig, transition.configuration) : prevConfig;\n\n try {\n for (var resolvedConfig_1 = __values(resolvedConfig), resolvedConfig_1_1 = resolvedConfig_1.next(); !resolvedConfig_1_1.done; resolvedConfig_1_1 = resolvedConfig_1.next()) {\n var sn = resolvedConfig_1_1.value;\n\n if (!has(prevConfig, sn)) {\n transition.entrySet.push(sn);\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (resolvedConfig_1_1 && !resolvedConfig_1_1.done && (_a = resolvedConfig_1.return)) _a.call(resolvedConfig_1);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n try {\n for (var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {\n var sn = prevConfig_1_1.value;\n\n if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {\n transition.exitSet.push(sn);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n var doneEvents = flatten(transition.entrySet.map(function (sn) {\n var events = [];\n\n if (sn.type !== 'final') {\n return events;\n }\n\n var parent = sn.parent;\n\n if (!parent.parent) {\n return events;\n }\n\n events.push(done(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.\n done(parent.id, sn.doneData ? mapContext(sn.doneData, currentContext, _event) : undefined));\n var grandparent = parent.parent;\n\n if (grandparent.type === 'parallel') {\n if (getChildren(grandparent).every(function (parentNode) {\n return isInFinalState(transition.configuration, parentNode);\n })) {\n events.push(done(grandparent.id));\n }\n }\n\n return events;\n }));\n transition.exitSet.sort(function (a, b) {\n return b.order - a.order;\n });\n transition.entrySet.sort(function (a, b) {\n return a.order - b.order;\n });\n var entryStates = new Set(transition.entrySet);\n var exitStates = new Set(transition.exitSet);\n\n var _c = __read([flatten(Array.from(entryStates).map(function (stateNode) {\n return __spreadArray(__spreadArray([], __read(stateNode.activities.map(function (activity) {\n return start(activity);\n })), false), __read(stateNode.onEntry), false);\n })).concat(doneEvents.map(raise)), flatten(Array.from(exitStates).map(function (stateNode) {\n return __spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {\n return stop(activity);\n })), false);\n }))], 2),\n entryActions = _c[0],\n exitActions = _c[1];\n\n var actions = toActionObjects(exitActions.concat(transition.actions).concat(entryActions), this.machine.options.actions);\n return actions;\n };\n /**\r\n * Determines the next state given the current `state` and sent `event`.\r\n *\r\n * @param state The current State instance or state value\r\n * @param event The event that was sent at the current state\r\n * @param context The current context (extended state) of the current state\r\n */\n\n\n StateNode.prototype.transition = function (state, event, context) {\n if (state === void 0) {\n state = this.initialState;\n }\n\n var _event = toSCXMLEvent(event);\n\n var currentState;\n\n if (state instanceof State) {\n currentState = context === undefined ? state : this.resolveState(State.from(state, context));\n } else {\n var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);\n var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;\n currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));\n }\n\n if (!IS_PRODUCTION && _event.name === WILDCARD) {\n throw new Error(\"An event cannot have the wildcard type ('\".concat(WILDCARD, \"')\"));\n }\n\n if (this.strict) {\n if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {\n throw new Error(\"Machine '\".concat(this.id, \"' does not accept event '\").concat(_event.name, \"'\"));\n }\n }\n\n var stateTransition = this._transition(currentState.value, currentState, _event) || {\n transitions: [],\n configuration: [],\n entrySet: [],\n exitSet: [],\n source: currentState,\n actions: []\n };\n var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));\n var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;\n stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);\n return this.resolveTransition(stateTransition, currentState, currentState.context, _event);\n };\n\n StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent) {\n var _a;\n\n var currentActions = state.actions;\n state = this.transition(state, _event); // Save original event to state\n // TODO: this should be the raised event! Delete in V5 (breaking)\n\n state._event = originalEvent;\n state.event = originalEvent.data;\n\n (_a = state.actions).unshift.apply(_a, __spreadArray([], __read(currentActions), false));\n\n return state;\n };\n\n StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, _event) {\n var e_6, _a;\n\n var _this = this;\n\n if (_event === void 0) {\n _event = initEvent;\n }\n\n var configuration = stateTransition.configuration; // Transition will \"apply\" if:\n // - this is the initial state (there is no current state)\n // - OR there are transitions\n\n var willTransition = !currentState || stateTransition.transitions.length > 0;\n var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;\n var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;\n var actions = this.getActions(stateTransition, context, _event, currentState);\n var activities = currentState ? __assign({}, currentState.activities) : {};\n\n try {\n for (var actions_1 = __values(actions), actions_1_1 = actions_1.next(); !actions_1_1.done; actions_1_1 = actions_1.next()) {\n var action = actions_1_1.value;\n\n if (action.type === start$1) {\n activities[action.activity.id || action.activity.type] = action;\n } else if (action.type === stop$1) {\n activities[action.activity.id || action.activity.type] = false;\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n var _b = __read(resolveActions(this, currentState, context, _event, actions, this.machine.config.preserveActionOrder), 2),\n resolvedActions = _b[0],\n updatedContext = _b[1];\n\n var _c = __read(partition(resolvedActions, function (action) {\n return action.type === raise$1 || action.type === send && action.to === SpecialTargets.Internal;\n }), 2),\n raisedEvents = _c[0],\n nonRaisedActions = _c[1];\n\n var invokeActions = resolvedActions.filter(function (action) {\n var _a;\n\n return action.type === start$1 && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === invoke;\n });\n var children = invokeActions.reduce(function (acc, action) {\n acc[action.activity.id] = createInvocableActor(action.activity, _this.machine, updatedContext, _event);\n return acc;\n }, currentState ? __assign({}, currentState.children) : {});\n var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];\n var isDone = isInFinalState(resolvedConfiguration, this);\n var nextState = new State({\n value: resolvedStateValue || currentState.value,\n context: updatedContext,\n _event: _event,\n // Persist _sessionid between states\n _sessionid: currentState ? currentState._sessionid : null,\n historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,\n history: !resolvedStateValue || stateTransition.source ? currentState : undefined,\n actions: resolvedStateValue ? nonRaisedActions : [],\n activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},\n events: [],\n configuration: resolvedConfiguration,\n transitions: stateTransition.transitions,\n children: children,\n done: isDone,\n tags: currentState === null || currentState === void 0 ? void 0 : currentState.tags,\n machine: this\n });\n var didUpdateContext = context !== updatedContext;\n nextState.changed = _event.name === update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks\n\n var history = nextState.history;\n\n if (history) {\n delete history.history;\n } // There are transient transitions if the machine is not in a final state\n // and if some of the state nodes have transient (\"always\") transitions.\n\n\n var isTransient = !isDone && (this._transient || configuration.some(function (stateNode) {\n return stateNode._transient;\n })); // If there are no enabled transitions, check if there are transient transitions.\n // If there are transient transitions, continue checking for more transitions\n // because an transient transition should be triggered even if there are no\n // enabled transitions.\n //\n // If we're already working on an transient transition (by checking\n // if the event is a NULL_EVENT), then stop to prevent an infinite loop.\n //\n // Otherwise, if there are no enabled nor transient transitions, we are done.\n\n if (!willTransition && (!isTransient || _event.name === NULL_EVENT)) {\n return nextState;\n }\n\n var maybeNextState = nextState;\n\n if (!isDone) {\n if (isTransient) {\n maybeNextState = this.resolveRaisedTransition(maybeNextState, {\n type: nullEvent\n }, _event);\n }\n\n while (raisedEvents.length) {\n var raisedEvent = raisedEvents.shift();\n maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event);\n }\n } // Detect if state changed\n\n\n var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : undefined);\n maybeNextState.changed = changed; // Preserve original history after raised events\n\n maybeNextState.history = history;\n maybeNextState.tags = getTagsFromConfiguration(maybeNextState.configuration);\n return maybeNextState;\n };\n /**\r\n * Returns the child state node from its relative `stateKey`, or throws.\r\n */\n\n\n StateNode.prototype.getStateNode = function (stateKey) {\n if (isStateId(stateKey)) {\n return this.machine.getStateNodeById(stateKey);\n }\n\n if (!this.states) {\n throw new Error(\"Unable to retrieve child state '\".concat(stateKey, \"' from '\").concat(this.id, \"'; no child states exist.\"));\n }\n\n var result = this.states[stateKey];\n\n if (!result) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return result;\n };\n /**\r\n * Returns the state node with the given `stateId`, or throws.\r\n *\r\n * @param stateId The state ID. The prefix \"#\" is removed.\r\n */\n\n\n StateNode.prototype.getStateNodeById = function (stateId) {\n var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;\n\n if (resolvedStateId === this.id) {\n return this;\n }\n\n var stateNode = this.machine.idMap[resolvedStateId];\n\n if (!stateNode) {\n throw new Error(\"Child state node '#\".concat(resolvedStateId, \"' does not exist on machine '\").concat(this.id, \"'\"));\n }\n\n return stateNode;\n };\n /**\r\n * Returns the relative state node from the given `statePath`, or throws.\r\n *\r\n * @param statePath The string or string array relative path to the state node.\r\n */\n\n\n StateNode.prototype.getStateNodeByPath = function (statePath) {\n if (typeof statePath === 'string' && isStateId(statePath)) {\n try {\n return this.getStateNodeById(statePath.slice(1));\n } catch (e) {// try individual paths\n // throw e;\n }\n }\n\n var arrayStatePath = toStatePath(statePath, this.delimiter).slice();\n var currentStateNode = this;\n\n while (arrayStatePath.length) {\n var key = arrayStatePath.shift();\n\n if (!key.length) {\n break;\n }\n\n currentStateNode = currentStateNode.getStateNode(key);\n }\n\n return currentStateNode;\n };\n /**\r\n * Resolves a partial state value with its full representation in this machine.\r\n *\r\n * @param stateValue The partial state value to resolve.\r\n */\n\n\n StateNode.prototype.resolve = function (stateValue) {\n var _a;\n\n var _this = this;\n\n if (!stateValue) {\n return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties\n }\n\n switch (this.type) {\n case 'parallel':\n return mapValues(this.initialStateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;\n });\n\n case 'compound':\n if (isString(stateValue)) {\n var subStateNode = this.getStateNode(stateValue);\n\n if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {\n return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;\n }\n\n return stateValue;\n }\n\n if (!Object.keys(stateValue).length) {\n return this.initialStateValue || {};\n }\n\n return mapValues(stateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;\n });\n\n default:\n return stateValue || EMPTY_OBJECT;\n }\n };\n\n StateNode.prototype.getResolvedPath = function (stateIdentifier) {\n if (isStateId(stateIdentifier)) {\n var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];\n\n if (!stateNode) {\n throw new Error(\"Unable to find state node '\".concat(stateIdentifier, \"'\"));\n }\n\n return stateNode.path;\n }\n\n return toStatePath(stateIdentifier, this.delimiter);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateValue\", {\n get: function () {\n var _a;\n\n if (this.__cache.initialStateValue) {\n return this.__cache.initialStateValue;\n }\n\n var initialStateValue;\n\n if (this.type === 'parallel') {\n initialStateValue = mapFilterValues(this.states, function (state) {\n return state.initialStateValue || EMPTY_OBJECT;\n }, function (stateNode) {\n return !(stateNode.type === 'history');\n });\n } else if (this.initial !== undefined) {\n if (!this.states[this.initial]) {\n throw new Error(\"Initial state '\".concat(this.initial, \"' not found on '\").concat(this.key, \"'\"));\n }\n\n initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);\n } else {\n // The finite state value of a machine without child states is just an empty object\n initialStateValue = {};\n }\n\n this.__cache.initialStateValue = initialStateValue;\n return this.__cache.initialStateValue;\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getInitialState = function (stateValue, context) {\n this._init(); // TODO: this should be in the constructor (see note in constructor)\n\n\n var configuration = this.getStateNodes(stateValue);\n return this.resolveTransition({\n configuration: configuration,\n entrySet: configuration,\n exitSet: [],\n transitions: [],\n source: undefined,\n actions: []\n }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialState\", {\n /**\r\n * The initial State instance, which includes all actions to be executed from\r\n * entering the initial state.\r\n */\n get: function () {\n var initialStateValue = this.initialStateValue;\n\n if (!initialStateValue) {\n throw new Error(\"Cannot retrieve initial state from simple state '\".concat(this.id, \"'.\"));\n }\n\n return this.getInitialState(initialStateValue);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"target\", {\n /**\r\n * The target state value of the history state node, if it exists. This represents the\r\n * default state value to transition to if no history value exists yet.\r\n */\n get: function () {\n var target;\n\n if (this.type === 'history') {\n var historyConfig = this.config;\n\n if (isString(historyConfig.target)) {\n target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;\n } else {\n target = historyConfig.target;\n }\n }\n\n return target;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Returns the leaf nodes from a state path relative to this state node.\r\n *\r\n * @param relativeStateId The relative state path to retrieve the state nodes\r\n * @param history The previous state to retrieve history\r\n * @param resolve Whether state nodes should resolve to initial child state nodes\r\n */\n\n StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {\n if (resolve === void 0) {\n resolve = true;\n }\n\n return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateNodes\", {\n get: function () {\n var _this = this;\n\n if (isLeafNode(this)) {\n return [this];\n } // Case when state node is compound but no initial state is defined\n\n\n if (this.type === 'compound' && !this.initial) {\n if (!IS_PRODUCTION) {\n warn(false, \"Compound state node '\".concat(this.id, \"' has no initial state.\"));\n }\n\n return [this];\n }\n\n var initialStateNodePaths = toStatePaths(this.initialStateValue);\n return flatten(initialStateNodePaths.map(function (initialPath) {\n return _this.getFromRelativePath(initialPath);\n }));\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Retrieves state nodes from a relative path to this state node.\r\n *\r\n * @param relativePath The relative path from this state node\r\n * @param historyValue\r\n */\n\n StateNode.prototype.getFromRelativePath = function (relativePath) {\n if (!relativePath.length) {\n return [this];\n }\n\n var _a = __read(relativePath),\n stateKey = _a[0],\n childStatePath = _a.slice(1);\n\n if (!this.states) {\n throw new Error(\"Cannot retrieve subPath '\".concat(stateKey, \"' from node with no states\"));\n }\n\n var childStateNode = this.getStateNode(stateKey);\n\n if (childStateNode.type === 'history') {\n return childStateNode.resolveHistory();\n }\n\n if (!this.states[stateKey]) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return this.states[stateKey].getFromRelativePath(childStatePath);\n };\n\n StateNode.prototype.historyValue = function (relativeStateValue) {\n if (!Object.keys(this.states).length) {\n return undefined;\n }\n\n return {\n current: relativeStateValue || this.initialStateValue,\n states: mapFilterValues(this.states, function (stateNode, key) {\n if (!relativeStateValue) {\n return stateNode.historyValue();\n }\n\n var subStateValue = isString(relativeStateValue) ? undefined : relativeStateValue[key];\n return stateNode.historyValue(subStateValue || stateNode.initialStateValue);\n }, function (stateNode) {\n return !stateNode.history;\n })\n };\n };\n /**\r\n * Resolves to the historical value(s) of the parent state node,\r\n * represented by state nodes.\r\n *\r\n * @param historyValue\r\n */\n\n\n StateNode.prototype.resolveHistory = function (historyValue) {\n var _this = this;\n\n if (this.type !== 'history') {\n return [this];\n }\n\n var parent = this.parent;\n\n if (!historyValue) {\n var historyTarget = this.target;\n return historyTarget ? flatten(toStatePaths(historyTarget).map(function (relativeChildPath) {\n return parent.getFromRelativePath(relativeChildPath);\n })) : parent.initialStateNodes;\n }\n\n var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;\n\n if (isString(subHistoryValue)) {\n return [parent.getStateNode(subHistoryValue)];\n }\n\n return flatten(toStatePaths(subHistoryValue).map(function (subStatePath) {\n return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];\n }));\n };\n\n Object.defineProperty(StateNode.prototype, \"stateIds\", {\n /**\r\n * All the state node IDs of this state node and its descendant state nodes.\r\n */\n get: function () {\n var _this = this;\n\n var childStateIds = flatten(Object.keys(this.states).map(function (stateKey) {\n return _this.states[stateKey].stateIds;\n }));\n return [this.id].concat(childStateIds);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"events\", {\n /**\r\n * All the event types accepted by this state node and its descendants.\r\n */\n get: function () {\n var e_7, _a, e_8, _b;\n\n if (this.__cache.events) {\n return this.__cache.events;\n }\n\n var states = this.states;\n var events = new Set(this.ownEvents);\n\n if (states) {\n try {\n for (var _c = __values(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var stateId = _d.value;\n var state = states[stateId];\n\n if (state.states) {\n try {\n for (var _e = (e_8 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var event_1 = _f.value;\n events.add(\"\".concat(event_1));\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n }\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return this.__cache.events = Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"ownEvents\", {\n /**\r\n * All the events that have transitions directly from this state node.\r\n *\r\n * Excludes any inert events.\r\n */\n get: function () {\n var events = new Set(this.transitions.filter(function (transition) {\n return !(!transition.target && !transition.actions.length && transition.internal);\n }).map(function (transition) {\n return transition.eventType;\n }));\n return Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.resolveTarget = function (_target) {\n var _this = this;\n\n if (_target === undefined) {\n // an undefined target signals that the state node should not transition from that state when receiving that event\n return undefined;\n }\n\n return _target.map(function (target) {\n if (!isString(target)) {\n return target;\n }\n\n var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,\n // do not include machine key on target\n\n if (isInternalTarget && !_this.parent) {\n return _this.getStateNodeByPath(target.slice(1));\n }\n\n var resolvedTarget = isInternalTarget ? _this.key + target : target;\n\n if (_this.parent) {\n try {\n var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);\n\n return targetStateNode;\n } catch (err) {\n throw new Error(\"Invalid transition definition for state node '\".concat(_this.id, \"':\\n\").concat(err.message));\n }\n } else {\n return _this.getStateNodeByPath(resolvedTarget);\n }\n });\n };\n\n StateNode.prototype.formatTransition = function (transitionConfig) {\n var _this = this;\n\n var normalizedTarget = normalizeTarget(transitionConfig.target);\n var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {\n return isString(_target) && _target[0] === _this.delimiter;\n }) : true;\n var guards = this.machine.options.guards;\n var target = this.resolveTarget(normalizedTarget);\n\n var transition = __assign(__assign({}, transitionConfig), {\n actions: toActionObjects(toArray(transitionConfig.actions)),\n cond: toGuard(transitionConfig.cond, guards),\n target: target,\n source: this,\n internal: internal,\n eventType: transitionConfig.event,\n toJSON: function () {\n return __assign(__assign({}, transition), {\n target: transition.target ? transition.target.map(function (t) {\n return \"#\".concat(t.id);\n }) : undefined,\n source: \"#\".concat(_this.id)\n });\n }\n });\n\n return transition;\n };\n\n StateNode.prototype.formatTransitions = function () {\n var e_9, _a;\n\n var _this = this;\n\n var onConfig;\n\n if (!this.config.on) {\n onConfig = [];\n } else if (Array.isArray(this.config.on)) {\n onConfig = this.config.on;\n } else {\n var _b = this.config.on,\n _c = WILDCARD,\n _d = _b[_c],\n wildcardConfigs = _d === void 0 ? [] : _d,\n strictTransitionConfigs_1 = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\"]);\n\n onConfig = flatten(Object.keys(strictTransitionConfigs_1).map(function (key) {\n if (!IS_PRODUCTION && key === NULL_EVENT) {\n warn(false, \"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. \" + \"Please check the `on` configuration for \\\"#\".concat(_this.id, \"\\\".\"));\n }\n\n var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);\n\n if (!IS_PRODUCTION) {\n validateArrayifiedTransitions(_this, key, transitionConfigArray);\n }\n\n return transitionConfigArray;\n }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));\n }\n\n var eventlessConfig = this.config.always ? toTransitionConfigArray('', this.config.always) : [];\n var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];\n\n if (!IS_PRODUCTION) {\n warn(!(this.config.onDone && !this.parent), \"Root nodes cannot have an \\\".onDone\\\" transition. Please check the config of \\\"\".concat(this.id, \"\\\".\"));\n }\n\n var invokeConfig = flatten(this.invoke.map(function (invokeDef) {\n var settleTransitions = [];\n\n if (invokeDef.onDone) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));\n }\n\n if (invokeDef.onError) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error(invokeDef.id)), invokeDef.onError)), false));\n }\n\n return settleTransitions;\n }));\n var delayedTransitions = this.after;\n var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function (transitionConfig) {\n return toArray(transitionConfig).map(function (transition) {\n return _this.formatTransition(transition);\n });\n }));\n\n try {\n for (var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {\n var delayedTransition = delayedTransitions_1_1.value;\n formattedTransitions.push(delayedTransition);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n return formattedTransitions;\n };\n\n return StateNode;\n}();\n\nexport { StateNode };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexport { __assign, __read, __rest, __spreadArray, __values };\n","import { ActionTypes } from './types.js';\n\nvar start = ActionTypes.Start;\nvar stop = ActionTypes.Stop;\nvar raise = ActionTypes.Raise;\nvar send = ActionTypes.Send;\nvar cancel = ActionTypes.Cancel;\nvar nullEvent = ActionTypes.NullEvent;\nvar assign = ActionTypes.Assign;\nvar after = ActionTypes.After;\nvar doneState = ActionTypes.DoneState;\nvar log = ActionTypes.Log;\nvar init = ActionTypes.Init;\nvar invoke = ActionTypes.Invoke;\nvar errorExecution = ActionTypes.ErrorExecution;\nvar errorPlatform = ActionTypes.ErrorPlatform;\nvar error = ActionTypes.ErrorCustom;\nvar update = ActionTypes.Update;\nvar choose = ActionTypes.Choose;\nvar pure = ActionTypes.Pure;\n\nexport { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };\n","import { __assign, __read, __spreadArray } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { init, send as send$1, raise as raise$1, update, log as log$1, cancel as cancel$1, assign as assign$1, error as error$1, stop as stop$1, pure as pure$1, choose as choose$1 } from './actionTypes.js';\nimport * as actionTypes from './actionTypes.js';\nexport { actionTypes };\nimport { toSCXMLEvent, isString, isFunction, toEventObject, getEventType, partition, updateContext, flatten, toArray, toGuard, evaluateGuard, warn, isArray } from './utils.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar initEvent = /*#__PURE__*/toSCXMLEvent({\n type: init\n});\nfunction getActionFunction(actionType, actionFunctionMap) {\n return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;\n}\nfunction toActionObject(action, actionFunctionMap) {\n var actionObject;\n\n if (isString(action) || typeof action === 'number') {\n var exec = getActionFunction(action, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = {\n type: action,\n exec: exec\n };\n } else if (exec) {\n actionObject = exec;\n } else {\n actionObject = {\n type: action,\n exec: undefined\n };\n }\n } else if (isFunction(action)) {\n actionObject = {\n // Convert action to string if unnamed\n type: action.name || action.toString(),\n exec: action\n };\n } else {\n var exec = getActionFunction(action.type, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = __assign(__assign({}, action), {\n exec: exec\n });\n } else if (exec) {\n var actionType = exec.type || action.type;\n actionObject = __assign(__assign(__assign({}, exec), action), {\n type: actionType\n });\n } else {\n actionObject = action;\n }\n }\n\n return actionObject;\n}\nvar toActionObjects = function (action, actionFunctionMap) {\n if (!action) {\n return [];\n }\n\n var actions = isArray(action) ? action : [action];\n return actions.map(function (subAction) {\n return toActionObject(subAction, actionFunctionMap);\n });\n};\nfunction toActivityDefinition(action) {\n var actionObject = toActionObject(action);\n return __assign(__assign({\n id: isString(action) ? action : actionObject.id\n }, actionObject), {\n type: actionObject.type\n });\n}\n/**\r\n * Raises an event. This places the event in the internal event queue, so that\r\n * the event is immediately consumed by the machine in the current step.\r\n *\r\n * @param eventType The event to raise.\r\n */\n\nfunction raise(event) {\n if (!isString(event)) {\n return send(event, {\n to: SpecialTargets.Internal\n });\n }\n\n return {\n type: raise$1,\n event: event\n };\n}\nfunction resolveRaise(action) {\n return {\n type: raise$1,\n _event: toSCXMLEvent(action.event)\n };\n}\n/**\r\n * Sends an event. This returns an action that will be read by an interpreter to\r\n * send the event in the next step, after the current step is finished executing.\r\n *\r\n * @param event The event to send.\r\n * @param options Options to pass into the send event:\r\n * - `id` - The unique send event identifier (used with `cancel()`).\r\n * - `delay` - The number of milliseconds to delay the sending of the event.\r\n * - `to` - The target of this event (by default, the machine the event was sent from).\r\n */\n\nfunction send(event, options) {\n return {\n to: options ? options.to : undefined,\n type: send$1,\n event: isFunction(event) ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n id: options && options.id !== undefined ? options.id : isFunction(event) ? event.name : getEventType(event)\n };\n}\nfunction resolveSend(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n }; // TODO: helper function for resolving Expr\n\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;\n return __assign(__assign({}, action), {\n to: resolvedTarget,\n _event: resolvedEvent,\n event: resolvedEvent.data,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event to this machine's parent.\r\n *\r\n * @param event The event to send to the parent machine.\r\n * @param options Options to pass into the send event.\r\n */\n\nfunction sendParent(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\n/**\r\n * Sends an event to an actor.\r\n *\r\n * @param actor The `ActorRef` to send the event to.\r\n * @param event The event to send, or an expression that evaluates to the event to send\r\n * @param options Send action options\r\n * @returns An XState send action object\r\n */\n\nfunction sendTo(actor, event, options) {\n return send(event, __assign(__assign({}, options), {\n to: actor\n }));\n}\n/**\r\n * Sends an update event to this machine's parent.\r\n */\n\nfunction sendUpdate() {\n return sendParent(update);\n}\n/**\r\n * Sends an event back to the sender of the original event.\r\n *\r\n * @param event The event to send back to the sender\r\n * @param options Options to pass into the send event\r\n */\n\nfunction respond(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: function (_, __, _a) {\n var _event = _a._event;\n return _event.origin; // TODO: handle when _event.origin is undefined\n }\n }));\n}\n\nvar defaultLogExpr = function (context, event) {\n return {\n context: context,\n event: event\n };\n};\n/**\r\n *\r\n * @param expr The expression function to evaluate which will be logged.\r\n * Takes in 2 arguments:\r\n * - `ctx` - the current state context\r\n * - `event` - the event that caused this action to be executed.\r\n * @param label The label to give to the logged expression.\r\n */\n\n\nfunction log(expr, label) {\n if (expr === void 0) {\n expr = defaultLogExpr;\n }\n\n return {\n type: log$1,\n label: label,\n expr: expr\n };\n}\nvar resolveLog = function (action, ctx, _event) {\n return __assign(__assign({}, action), {\n value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {\n _event: _event\n })\n });\n};\n/**\r\n * Cancels an in-flight `send(...)` action. A canceled sent action will not\r\n * be executed, nor will its event be sent, unless it has already been sent\r\n * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).\r\n *\r\n * @param sendId The `id` of the `send(...)` action to cancel.\r\n */\n\nvar cancel = function (sendId) {\n return {\n type: cancel$1,\n sendId: sendId\n };\n};\n/**\r\n * Starts an activity.\r\n *\r\n * @param activity The activity to start.\r\n */\n\nfunction start(activity) {\n var activityDef = toActivityDefinition(activity);\n return {\n type: ActionTypes.Start,\n activity: activityDef,\n exec: undefined\n };\n}\n/**\r\n * Stops an activity.\r\n *\r\n * @param actorRef The activity to stop.\r\n */\n\nfunction stop(actorRef) {\n var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);\n return {\n type: ActionTypes.Stop,\n activity: activity,\n exec: undefined\n };\n}\nfunction resolveStop(action, context, _event) {\n var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;\n var resolvedActorRef = typeof actorRefOrString === 'string' ? {\n id: actorRefOrString\n } : actorRefOrString;\n var actionObject = {\n type: ActionTypes.Stop,\n activity: resolvedActorRef\n };\n return actionObject;\n}\n/**\r\n * Updates the current context of the machine.\r\n *\r\n * @param assignment An object that represents the partial context to update.\r\n */\n\nvar assign = function (assignment) {\n return {\n type: assign$1,\n assignment: assignment\n };\n};\nfunction isActionObject(action) {\n return typeof action === 'object' && 'type' in action;\n}\n/**\r\n * Returns an event type that represents an implicit event that\r\n * is sent after the specified `delay`.\r\n *\r\n * @param delayRef The delay in milliseconds\r\n * @param id The state node ID where this event is handled\r\n */\n\nfunction after(delayRef, id) {\n var idSuffix = id ? \"#\".concat(id) : '';\n return \"\".concat(ActionTypes.After, \"(\").concat(delayRef, \")\").concat(idSuffix);\n}\n/**\r\n * Returns an event that represents that a final state node\r\n * has been reached in the parent state node.\r\n *\r\n * @param id The final state node's parent state node `id`\r\n * @param data The data to pass into the event\r\n */\n\nfunction done(id, data) {\n var type = \"\".concat(ActionTypes.DoneState, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\n/**\r\n * Returns an event that represents that an invoked service has terminated.\r\n *\r\n * An invoked service is terminated when it has reached a top-level final state node,\r\n * but not when it is canceled.\r\n *\r\n * @param id The final state node ID\r\n * @param data The data to pass into the event\r\n */\n\nfunction doneInvoke(id, data) {\n var type = \"\".concat(ActionTypes.DoneInvoke, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction error(id, data) {\n var type = \"\".concat(ActionTypes.ErrorPlatform, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction pure(getActions) {\n return {\n type: ActionTypes.Pure,\n get: getActions\n };\n}\n/**\r\n * Forwards (sends) an event to a specified service.\r\n *\r\n * @param target The target service to forward the event to.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction forwardTo(target, options) {\n return send(function (_, event) {\n return event;\n }, __assign(__assign({}, options), {\n to: target\n }));\n}\n/**\r\n * Escalates an error by sending it as an event to this machine's parent.\r\n *\r\n * @param errorData The error data to send, or the expression function that\r\n * takes in the `context`, `event`, and `meta`, and returns the error data to send.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction escalate(errorData, options) {\n return sendParent(function (context, event, meta) {\n return {\n type: error$1,\n data: isFunction(errorData) ? errorData(context, event, meta) : errorData\n };\n }, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\nfunction choose(conds) {\n return {\n type: ActionTypes.Choose,\n conds: conds\n };\n}\nfunction resolveActions(machine, currentState, currentContext, _event, actions, preserveActionOrder) {\n if (preserveActionOrder === void 0) {\n preserveActionOrder = false;\n }\n\n var _a = __read(preserveActionOrder ? [[], actions] : partition(actions, function (action) {\n return action.type === assign$1;\n }), 2),\n assignActions = _a[0],\n otherActions = _a[1];\n\n var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;\n var preservedContexts = preserveActionOrder ? [currentContext] : undefined;\n var resolvedActions = flatten(otherActions.map(function (actionObject) {\n var _a;\n\n switch (actionObject.type) {\n case raise$1:\n return resolveRaise(actionObject);\n\n case send$1:\n var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init\n\n if (!IS_PRODUCTION) {\n // warn after resolving as we can create better contextual message here\n warn(!isString(actionObject.delay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length\n \"No delay reference for delay expression '\".concat(actionObject.delay, \"' was found on machine '\").concat(machine.id, \"'\"));\n }\n\n return sendAction;\n\n case log$1:\n return resolveLog(actionObject, updatedContext, _event);\n\n case choose$1:\n {\n var chooseAction = actionObject;\n var matchedActions = (_a = chooseAction.conds.find(function (condition) {\n var guard = toGuard(condition.cond, machine.options.guards);\n return !guard || evaluateGuard(machine, guard, updatedContext, _event, currentState);\n })) === null || _a === void 0 ? void 0 : _a.actions;\n\n if (!matchedActions) {\n return [];\n }\n\n var _b = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), preserveActionOrder), 2),\n resolvedActionsFromChoose = _b[0],\n resolvedContextFromChoose = _b[1];\n\n updatedContext = resolvedContextFromChoose;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromChoose;\n }\n\n case pure$1:\n {\n var matchedActions = actionObject.get(updatedContext, _event.data);\n\n if (!matchedActions) {\n return [];\n }\n\n var _c = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), preserveActionOrder), 2),\n resolvedActionsFromPure = _c[0],\n resolvedContext = _c[1];\n\n updatedContext = resolvedContext;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromPure;\n }\n\n case stop$1:\n {\n return resolveStop(actionObject, updatedContext, _event);\n }\n\n case assign$1:\n {\n updatedContext = updateContext(updatedContext, _event, [actionObject], currentState);\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n break;\n }\n\n default:\n var resolvedActionObject = toActionObject(actionObject, machine.options.actions);\n var exec_1 = resolvedActionObject.exec;\n\n if (exec_1 && preservedContexts) {\n var contextIndex_1 = preservedContexts.length - 1;\n resolvedActionObject = __assign(__assign({}, resolvedActionObject), {\n exec: function (_ctx) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n exec_1.apply(void 0, __spreadArray([preservedContexts[contextIndex_1]], __read(args), false));\n }\n });\n }\n\n return resolvedActionObject;\n }\n }).filter(function (a) {\n return !!a;\n }));\n return [resolvedActions, updatedContext];\n}\n\nexport { after, assign, cancel, choose, done, doneInvoke, error, escalate, forwardTo, getActionFunction, initEvent, isActionObject, log, pure, raise, resolveActions, resolveLog, resolveRaise, resolveSend, resolveStop, respond, send, sendParent, sendTo, sendUpdate, start, stop, toActionObject, toActionObjects, toActivityDefinition };\n","import { error, doneInvoke } from './actions.js';\nimport { toActorRef } from './Actor.js';\nimport { toObserver } from './utils.js';\n\n/**\r\n * Returns an actor behavior from a reducer and its initial state.\r\n *\r\n * @param transition The pure reducer that returns the next state given the current state and event.\r\n * @param initialState The initial state of the reducer.\r\n * @returns An actor behavior\r\n */\n\nfunction fromReducer(transition, initialState) {\n return {\n transition: transition,\n initialState: initialState\n };\n}\nfunction fromPromise(promiseFn) {\n var initialState = {\n error: undefined,\n data: undefined,\n status: 'pending'\n };\n return {\n transition: function (state, event, _a) {\n var parent = _a.parent,\n id = _a.id,\n observers = _a.observers;\n\n switch (event.type) {\n case 'fulfill':\n parent === null || parent === void 0 ? void 0 : parent.send(doneInvoke(id, event.data));\n return {\n error: undefined,\n data: event.data,\n status: 'fulfilled'\n };\n\n case 'reject':\n parent === null || parent === void 0 ? void 0 : parent.send(error(id, event.error));\n observers.forEach(function (observer) {\n observer.error(event.error);\n });\n return {\n error: event.error,\n data: undefined,\n status: 'rejected'\n };\n\n default:\n return state;\n }\n },\n initialState: initialState,\n start: function (_a) {\n var self = _a.self;\n promiseFn().then(function (data) {\n self.send({\n type: 'fulfill',\n data: data\n });\n }, function (reason) {\n self.send({\n type: 'reject',\n error: reason\n });\n });\n return initialState;\n }\n };\n}\nfunction spawnBehavior(behavior, options) {\n if (options === void 0) {\n options = {};\n }\n\n var state = behavior.initialState;\n var observers = new Set();\n var mailbox = [];\n var flushing = false;\n\n var flush = function () {\n if (flushing) {\n return;\n }\n\n flushing = true;\n\n while (mailbox.length > 0) {\n var event_1 = mailbox.shift();\n state = behavior.transition(state, event_1, actorCtx);\n observers.forEach(function (observer) {\n return observer.next(state);\n });\n }\n\n flushing = false;\n };\n\n var actor = toActorRef({\n id: options.id,\n send: function (event) {\n mailbox.push(event);\n flush();\n },\n getSnapshot: function () {\n return state;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n observers.add(observer);\n observer.next(state);\n return {\n unsubscribe: function () {\n observers.delete(observer);\n }\n };\n }\n });\n var actorCtx = {\n parent: options.parent,\n self: actor,\n id: options.id || 'anonymous',\n observers: observers\n };\n state = behavior.start ? behavior.start(actorCtx) : state;\n return actor;\n}\n\nexport { fromPromise, fromReducer, spawnBehavior };\n","var STATE_DELIMITER = '.';\nvar EMPTY_ACTIVITY_MAP = {};\nvar DEFAULT_GUARD_TYPE = 'xstate.guard';\nvar TARGETLESS_KEY = '';\n\nexport { DEFAULT_GUARD_TYPE, EMPTY_ACTIVITY_MAP, STATE_DELIMITER, TARGETLESS_KEY };\n","import { IS_PRODUCTION } from './environment.js';\n\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n\n if (typeof self !== 'undefined') {\n return self;\n }\n\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n if (!IS_PRODUCTION) {\n console.warn('XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues');\n }\n}\n\nfunction getDevTools() {\n var global = getGlobal();\n\n if (global && '__xstate__' in global) {\n return global.__xstate__;\n }\n\n return undefined;\n}\n\nfunction registerService(service) {\n if (!getGlobal()) {\n return;\n }\n\n var devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport { getGlobal, registerService };\n","var IS_PRODUCTION = process.env.NODE_ENV === 'production';\n\nexport { IS_PRODUCTION };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { ActionTypes, SpecialTargets } from './types.js';\nimport { isStateConfig, State, bindActionToState } from './State.js';\nimport { errorPlatform, log, stop, start, cancel, send, update, error as error$1 } from './actionTypes.js';\nimport { doneInvoke, initEvent, getActionFunction, error } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { warn, mapContext, isFunction, toSCXMLEvent, toInvokeSource, isMachine, isPromiseLike, isObservable, isBehavior, reportUnhandledExceptionOnInvocation, symbolObservable, isArray, toEventObject, isString, isActor, uniqueId, toObserver } from './utils.js';\nimport { Scheduler } from './scheduler.js';\nimport { isSpawnedActor, createDeferredActor } from './Actor.js';\nimport { isInFinalState } from './stateUtils.js';\nimport { registry } from './registry.js';\nimport { getGlobal, registerService } from './devTools.js';\nimport { provide, consume } from './serviceScope.js';\nimport { spawnBehavior } from './behaviors.js';\n\nvar DEFAULT_SPAWN_OPTIONS = {\n sync: false,\n autoForward: false\n};\nvar InterpreterStatus;\n\n(function (InterpreterStatus) {\n InterpreterStatus[InterpreterStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n InterpreterStatus[InterpreterStatus[\"Running\"] = 1] = \"Running\";\n InterpreterStatus[InterpreterStatus[\"Stopped\"] = 2] = \"Stopped\";\n})(InterpreterStatus || (InterpreterStatus = {}));\n\nvar Interpreter =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to be interpreted\r\n * @param options Interpreter options\r\n */\n function Interpreter(machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n this.machine = machine;\n this.scheduler = new Scheduler();\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this.nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString(to) ? _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n }\n\n return;\n }\n\n if ('machine' in target) {\n // Send SCXML events to machines\n target.send(__assign(__assign({}, event), {\n name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n origin: _this.sessionId\n }));\n } else {\n // Send normal events to other targets\n target.send(event.data);\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }\n\n Object.defineProperty(Interpreter.prototype, \"initialState\", {\n get: function () {\n var _this = this;\n\n if (this._initialState) {\n return this._initialState;\n }\n\n return provide(this, function () {\n _this._initialState = _this.machine.initialState;\n return _this._initialState;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Interpreter.prototype, \"state\", {\n get: function () {\n if (!IS_PRODUCTION) {\n warn(this.status !== InterpreterStatus.NotStarted, \"Attempted to read state from uninitialized service '\".concat(this.id, \"'. Make sure the service is started first.\"));\n }\n\n return this._state;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Executes the actions of the given state, with that state's `context` and `event`.\r\n *\r\n * @param state The state whose actions will be executed\r\n * @param actionsConfig The action implementations to use\r\n */\n\n Interpreter.prototype.execute = function (state, actionsConfig) {\n var e_1, _a;\n\n try {\n for (var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n this.exec(action, state, actionsConfig);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n };\n\n Interpreter.prototype.update = function (state, _event) {\n var e_2, _a, e_3, _b, e_4, _c, e_5, _d;\n\n var _this = this; // Attach session ID to state\n\n\n state._sessionid = this.sessionId; // Update state\n\n this._state = state; // Execute actions\n\n if (this.options.execute) {\n this.execute(this.state);\n } // Update children\n\n\n this.children.forEach(function (child) {\n _this.state.children[child.id] = child;\n }); // Dev tools\n\n if (this.devTools) {\n this.devTools.send(_event.data, state);\n } // Execute listeners\n\n\n if (state.event) {\n try {\n for (var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {\n var listener = _f.value;\n listener(state.event);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n\n try {\n for (var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {\n var listener = _h.value;\n listener(state, state.event);\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n try {\n for (var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {\n var contextListener = _k.value;\n contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_k && !_k.done && (_c = _j.return)) _c.call(_j);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n var isDone = isInFinalState(state.configuration || [], this.machine);\n\n if (this.state.configuration && isDone) {\n // get final child state node\n var finalChildStateNode = state.configuration.find(function (sn) {\n return sn.type === 'final' && sn.parent === _this.machine;\n });\n var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : undefined;\n\n try {\n for (var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {\n var listener = _m.value;\n listener(doneInvoke(this.id, doneData));\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_m && !_m.done && (_d = _l.return)) _d.call(_l);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n this.stop();\n }\n };\n /*\r\n * Adds a listener that is notified whenever a state transition happens. The listener is called with\r\n * the next state and the event object that caused the state transition.\r\n *\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onTransition = function (listener) {\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state, this.state.event);\n }\n\n return this;\n };\n\n Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener\n completeListener) {\n var _this = this;\n\n if (!nextListenerOrObserver) {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n }\n\n var listener;\n var resolvedCompleteListener = completeListener;\n\n if (typeof nextListenerOrObserver === 'function') {\n listener = nextListenerOrObserver;\n } else {\n listener = nextListenerOrObserver.next.bind(nextListenerOrObserver);\n resolvedCompleteListener = nextListenerOrObserver.complete.bind(nextListenerOrObserver);\n }\n\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state);\n }\n\n if (resolvedCompleteListener) {\n this.onDone(resolvedCompleteListener);\n }\n\n return {\n unsubscribe: function () {\n listener && _this.listeners.delete(listener);\n resolvedCompleteListener && _this.doneListeners.delete(resolvedCompleteListener);\n }\n };\n };\n /**\r\n * Adds an event listener that is notified whenever an event is sent to the running interpreter.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onEvent = function (listener) {\n this.eventListeners.add(listener);\n return this;\n };\n /**\r\n * Adds an event listener that is notified whenever a `send` event occurs.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onSend = function (listener) {\n this.sendListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a context listener that is notified whenever the state context changes.\r\n * @param listener The context listener\r\n */\n\n\n Interpreter.prototype.onChange = function (listener) {\n this.contextListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a listener that is notified when the machine is stopped.\r\n * @param listener The listener\r\n */\n\n\n Interpreter.prototype.onStop = function (listener) {\n this.stopListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a state listener that is notified when the statechart has reached its final state.\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onDone = function (listener) {\n this.doneListeners.add(listener);\n return this;\n };\n /**\r\n * Removes a listener.\r\n * @param listener The listener to remove\r\n */\n\n\n Interpreter.prototype.off = function (listener) {\n this.listeners.delete(listener);\n this.eventListeners.delete(listener);\n this.sendListeners.delete(listener);\n this.stopListeners.delete(listener);\n this.doneListeners.delete(listener);\n this.contextListeners.delete(listener);\n return this;\n };\n /**\r\n * Starts the interpreter from the given state, or the initial state.\r\n * @param initialState The state to start the statechart from\r\n */\n\n\n Interpreter.prototype.start = function (initialState) {\n var _this = this;\n\n if (this.status === InterpreterStatus.Running) {\n // Do not restart the service if it is already started\n return this;\n } // yes, it's a hack but we need the related cache to be populated for some things to work (like delayed transitions)\n // this is usually called by `machine.getInitialState` but if we rehydrate from a state we might bypass this call\n // we also don't want to call this method here as it resolves the full initial state which might involve calling assign actions\n // and that could potentially lead to some unwanted side-effects (even such as creating some rogue actors)\n\n\n this.machine._init();\n\n registry.register(this.sessionId, this);\n this.initialized = true;\n this.status = InterpreterStatus.Running;\n var resolvedState = initialState === undefined ? this.initialState : provide(this, function () {\n return isStateConfig(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));\n });\n\n if (this.options.devTools) {\n this.attachDev();\n }\n\n this.scheduler.initialize(function () {\n _this.update(resolvedState, initEvent);\n });\n return this;\n };\n /**\r\n * Stops the interpreter and unsubscribe all listeners.\r\n *\r\n * This will also notify the `onStop` listeners.\r\n */\n\n\n Interpreter.prototype.stop = function () {\n var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;\n\n var _this = this;\n\n try {\n for (var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {\n var listener = _g.value;\n this.listeners.delete(listener);\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n try {\n for (var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {\n var listener = _j.value; // call listener, then remove\n\n listener();\n this.stopListeners.delete(listener);\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n\n try {\n for (var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {\n var listener = _l.value;\n this.contextListeners.delete(listener);\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n\n try {\n for (var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {\n var listener = _o.value;\n this.doneListeners.delete(listener);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_o && !_o.done && (_d = _m.return)) _d.call(_m);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n if (!this.initialized) {\n // Interpreter already stopped; do nothing\n return this;\n }\n\n __spreadArray([], __read(this.state.configuration), false).sort(function (a, b) {\n return b.order - a.order;\n }).forEach(function (stateNode) {\n var e_11, _a;\n\n try {\n for (var _b = __values(stateNode.definition.exit), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n\n _this.exec(action, _this.state);\n }\n } catch (e_11_1) {\n e_11 = {\n error: e_11_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_11) throw e_11.error;\n }\n }\n }); // Stop all children\n\n\n this.children.forEach(function (child) {\n if (isFunction(child.stop)) {\n child.stop();\n }\n });\n\n try {\n // Cancel all delayed events\n for (var _p = __values(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n this.clock.clearTimeout(this.delayedEventsMap[key]);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n } finally {\n if (e_10) throw e_10.error;\n }\n }\n\n this.scheduler.clear();\n this.initialized = false;\n this.status = InterpreterStatus.Stopped;\n registry.free(this.sessionId);\n return this;\n };\n\n Interpreter.prototype.batch = function (events) {\n var _this = this;\n\n if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\" and are deferred. Make sure .start() is called for this service.\\nEvent: \").concat(JSON.stringify(event)));\n }\n } else if (this.status !== InterpreterStatus.Running) {\n throw new Error( // tslint:disable-next-line:max-line-length\n \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\"));\n }\n\n this.scheduler.schedule(function () {\n var e_12, _a;\n\n var nextState = _this.state;\n var batchChanged = false;\n var batchedActions = [];\n\n var _loop_1 = function (event_1) {\n var _event = toSCXMLEvent(event_1);\n\n _this.forward(_event);\n\n nextState = provide(_this, function () {\n return _this.machine.transition(nextState, _event);\n });\n batchedActions.push.apply(batchedActions, __spreadArray([], __read(nextState.actions.map(function (a) {\n return bindActionToState(a, nextState);\n })), false));\n batchChanged = batchChanged || !!nextState.changed;\n };\n\n try {\n for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {\n var event_1 = events_1_1.value;\n\n _loop_1(event_1);\n }\n } catch (e_12_1) {\n e_12 = {\n error: e_12_1\n };\n } finally {\n try {\n if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);\n } finally {\n if (e_12) throw e_12.error;\n }\n }\n\n nextState.changed = batchChanged;\n nextState.actions = batchedActions;\n\n _this.update(nextState, toSCXMLEvent(events[events.length - 1]));\n });\n };\n /**\r\n * Returns a send function bound to this interpreter instance.\r\n *\r\n * @param event The event to be sent by the sender.\r\n */\n\n\n Interpreter.prototype.sender = function (event) {\n return this.send.bind(this, event);\n };\n /**\r\n * Returns the next state given the interpreter's current state and the event.\r\n *\r\n * This is a pure method that does _not_ update the interpreter's state.\r\n *\r\n * @param event The event to determine the next state\r\n */\n\n\n Interpreter.prototype.nextState = function (event) {\n var _this = this;\n\n var _event = toSCXMLEvent(event);\n\n if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {\n return nextEvent.indexOf(errorPlatform) === 0;\n })) {\n throw _event.data.data;\n }\n\n var nextState = provide(this, function () {\n return _this.machine.transition(_this.state, _event);\n });\n return nextState;\n };\n\n Interpreter.prototype.forward = function (event) {\n var e_13, _a;\n\n try {\n for (var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {\n var id = _c.value;\n var child = this.children.get(id);\n\n if (!child) {\n throw new Error(\"Unable to forward event '\".concat(event, \"' from interpreter '\").concat(this.id, \"' to nonexistant child '\").concat(id, \"'.\"));\n }\n\n child.send(event);\n }\n } catch (e_13_1) {\n e_13 = {\n error: e_13_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_13) throw e_13.error;\n }\n }\n };\n\n Interpreter.prototype.defer = function (sendAction) {\n var _this = this;\n\n this.delayedEventsMap[sendAction.id] = this.clock.setTimeout(function () {\n if (sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to);\n } else {\n _this.send(sendAction._event);\n }\n }, sendAction.delay);\n };\n\n Interpreter.prototype.cancel = function (sendId) {\n this.clock.clearTimeout(this.delayedEventsMap[sendId]);\n delete this.delayedEventsMap[sendId];\n };\n\n Interpreter.prototype.exec = function (action, state, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = this.machine.options.actions;\n }\n\n var context = state.context,\n _event = state._event;\n var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);\n var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;\n\n if (exec) {\n try {\n return exec(context, _event.data, {\n action: action,\n state: this.state,\n _event: _event\n });\n } catch (err) {\n if (this.parent) {\n this.parent.send({\n type: 'xstate.error',\n data: err\n });\n }\n\n throw err;\n }\n }\n\n switch (action.type) {\n case send:\n var sendAction = action;\n\n if (typeof sendAction.delay === 'number') {\n this.defer(sendAction);\n return;\n } else {\n if (sendAction.to) {\n this.sendTo(sendAction._event, sendAction.to);\n } else {\n this.send(sendAction._event);\n }\n }\n\n break;\n\n case cancel:\n this.cancel(action.sendId);\n break;\n\n case start:\n {\n if (this.status !== InterpreterStatus.Running) {\n return;\n }\n\n var activity = action.activity; // If the activity will be stopped right after it's started\n // (such as in transient states)\n // don't bother starting the activity.\n\n if (!this.state.activities[activity.id || activity.type]) {\n break;\n } // Invoked services\n\n\n if (activity.type === ActionTypes.Invoke) {\n var invokeSource = toInvokeSource(activity.src);\n var serviceCreator = this.machine.options.services ? this.machine.options.services[invokeSource.type] : undefined;\n var id = activity.id,\n data = activity.data;\n\n if (!IS_PRODUCTION) {\n warn(!('forward' in activity), // tslint:disable-next-line:max-line-length\n \"`forward` property is deprecated (found in invocation of '\".concat(activity.src, \"' in in machine '\").concat(this.machine.id, \"'). \") + \"Please use `autoForward` instead.\");\n }\n\n var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;\n\n if (!serviceCreator) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"No service found for invocation '\".concat(activity.src, \"' in machine '\").concat(this.machine.id, \"'.\"));\n }\n\n return;\n }\n\n var resolvedData = data ? mapContext(data, context, _event) : undefined;\n\n if (typeof serviceCreator === 'string') {\n // TODO: warn\n return;\n }\n\n var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {\n data: resolvedData,\n src: invokeSource,\n meta: activity.meta\n }) : serviceCreator;\n\n if (!source) {\n // TODO: warn?\n return;\n }\n\n var options = void 0;\n\n if (isMachine(source)) {\n source = resolvedData ? source.withContext(resolvedData) : source;\n options = {\n autoForward: autoForward\n };\n }\n\n this.spawn(source, id, options);\n } else {\n this.spawnActivity(activity);\n }\n\n break;\n }\n\n case stop:\n {\n this.stopChild(action.activity.id);\n break;\n }\n\n case log:\n var label = action.label,\n value = action.value;\n\n if (label) {\n this.logger(label, value);\n } else {\n this.logger(value);\n }\n\n break;\n\n default:\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for action type '\".concat(action.type, \"'\"));\n }\n\n break;\n }\n\n return undefined;\n };\n\n Interpreter.prototype.removeChild = function (childId) {\n var _a;\n\n this.children.delete(childId);\n this.forwardTo.delete(childId); // this.state might not exist at the time this is called,\n // such as when a child is added then removed while initializing the state\n\n (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];\n };\n\n Interpreter.prototype.stopChild = function (childId) {\n var child = this.children.get(childId);\n\n if (!child) {\n return;\n }\n\n this.removeChild(childId);\n\n if (isFunction(child.stop)) {\n child.stop();\n }\n };\n\n Interpreter.prototype.spawn = function (entity, name, options) {\n if (isPromiseLike(entity)) {\n return this.spawnPromise(Promise.resolve(entity), name);\n } else if (isFunction(entity)) {\n return this.spawnCallback(entity, name);\n } else if (isSpawnedActor(entity)) {\n return this.spawnActor(entity, name);\n } else if (isObservable(entity)) {\n return this.spawnObservable(entity, name);\n } else if (isMachine(entity)) {\n return this.spawnMachine(entity, __assign(__assign({}, options), {\n id: name\n }));\n } else if (isBehavior(entity)) {\n return this.spawnBehavior(entity, name);\n } else {\n throw new Error(\"Unable to spawn entity \\\"\".concat(name, \"\\\" of type \\\"\").concat(typeof entity, \"\\\".\"));\n }\n };\n\n Interpreter.prototype.spawnMachine = function (machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var childService = new Interpreter(machine, __assign(__assign({}, this.options), {\n parent: this,\n id: options.id || machine.id\n }));\n\n var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);\n\n if (resolvedOptions.sync) {\n childService.onTransition(function (state) {\n _this.send(update, {\n state: state,\n id: childService.id\n });\n });\n }\n\n var actor = childService;\n this.children.set(childService.id, actor);\n\n if (resolvedOptions.autoForward) {\n this.forwardTo.add(childService.id);\n }\n\n childService.onDone(function (doneEvent) {\n _this.removeChild(childService.id);\n\n _this.send(toSCXMLEvent(doneEvent, {\n origin: childService.id\n }));\n }).start();\n return actor;\n };\n\n Interpreter.prototype.spawnBehavior = function (behavior, id) {\n var actorRef = spawnBehavior(behavior, {\n id: id,\n parent: this\n });\n this.children.set(id, actorRef);\n return actorRef;\n };\n\n Interpreter.prototype.spawnPromise = function (promise, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var resolvedData;\n promise.then(function (response) {\n if (!canceled) {\n resolvedData = response;\n\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id, response), {\n origin: id\n }));\n }\n }, function (errorData) {\n if (!canceled) {\n _this.removeChild(id);\n\n var errorEvent = error(id, errorData);\n\n try {\n // Send \"error.platform.id\" to this (parent).\n _this.send(toSCXMLEvent(errorEvent, {\n origin: id\n }));\n } catch (error) {\n reportUnhandledExceptionOnInvocation(errorData, error, id);\n\n if (_this.devTools) {\n _this.devTools.send(errorEvent, _this.state);\n }\n\n if (_this.machine.strict) {\n // it would be better to always stop the state machine if unhandled\n // exception/promise rejection happens but because we don't want to\n // break existing code so enforce it on strict mode only especially so\n // because documentation says that onError is optional\n _this.stop();\n }\n }\n }\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n var unsubscribed = false;\n promise.then(function (response) {\n if (unsubscribed) {\n return;\n }\n\n observer.next(response);\n\n if (unsubscribed) {\n return;\n }\n\n observer.complete();\n }, function (err) {\n if (unsubscribed) {\n return;\n }\n\n observer.error(err);\n });\n return {\n unsubscribe: function () {\n return unsubscribed = true;\n }\n };\n },\n stop: function () {\n canceled = true;\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return resolvedData;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnCallback = function (callback, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var receivers = new Set();\n var listeners = new Set();\n var emitted;\n\n var receive = function (e) {\n emitted = e;\n listeners.forEach(function (listener) {\n return listener(e);\n });\n\n if (canceled) {\n return;\n }\n\n _this.send(toSCXMLEvent(e, {\n origin: id\n }));\n };\n\n var callbackStop;\n\n try {\n callbackStop = callback(receive, function (newListener) {\n receivers.add(newListener);\n });\n } catch (err) {\n this.send(error(id, err));\n }\n\n if (isPromiseLike(callbackStop)) {\n // it turned out to be an async function, can't reliably check this before calling `callback`\n // because transpiled async functions are not recognizable\n return this.spawnPromise(callbackStop, id);\n }\n\n var actor = (_a = {\n id: id,\n send: function (event) {\n return receivers.forEach(function (receiver) {\n return receiver(event);\n });\n },\n subscribe: function (next) {\n var observer = toObserver(next);\n listeners.add(observer.next);\n return {\n unsubscribe: function () {\n listeners.delete(observer.next);\n }\n };\n },\n stop: function () {\n canceled = true;\n\n if (isFunction(callbackStop)) {\n callbackStop();\n }\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return emitted;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnObservable = function (source, id) {\n var _a;\n\n var _this = this;\n\n var emitted;\n var subscription = source.subscribe(function (value) {\n emitted = value;\n\n _this.send(toSCXMLEvent(value, {\n origin: id\n }));\n }, function (err) {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(error(id, err), {\n origin: id\n }));\n }, function () {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id), {\n origin: id\n }));\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n return source.subscribe(next, handleError, complete);\n },\n stop: function () {\n return subscription.unsubscribe();\n },\n getSnapshot: function () {\n return emitted;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActor = function (actor, name) {\n this.children.set(name, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActivity = function (activity) {\n var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;\n\n if (!implementation) {\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for activity '\".concat(activity.type, \"'\"));\n } // tslint:disable-next-line:no-console\n\n\n return;\n } // Start implementation\n\n\n var dispose = implementation(this.state.context, activity);\n this.spawnEffect(activity.id, dispose);\n };\n\n Interpreter.prototype.spawnEffect = function (id, dispose) {\n var _a;\n\n this.children.set(id, (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n stop: dispose || undefined,\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a));\n };\n\n Interpreter.prototype.attachDev = function () {\n var global = getGlobal();\n\n if (this.options.devTools && global) {\n if (global.__REDUX_DEVTOOLS_EXTENSION__) {\n var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;\n this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({\n name: this.id,\n autoPause: true,\n stateSanitizer: function (state) {\n return {\n value: state.value,\n context: state.context,\n actions: state.actions\n };\n }\n }, devToolsOptions), {\n features: __assign({\n jump: false,\n skip: false\n }, devToolsOptions ? devToolsOptions.features : undefined)\n }), this.machine);\n this.devTools.init(this.state);\n } // add XState-specific dev tooling hook\n\n\n registerService(this);\n }\n };\n\n Interpreter.prototype.toJSON = function () {\n return {\n id: this.id\n };\n };\n\n Interpreter.prototype[symbolObservable] = function () {\n return this;\n };\n\n Interpreter.prototype.getSnapshot = function () {\n if (this.status === InterpreterStatus.NotStarted) {\n return this.initialState;\n }\n\n return this._state;\n };\n /**\r\n * The default interpreter options:\r\n *\r\n * - `clock` uses the global `setTimeout` and `clearTimeout` functions\r\n * - `logger` uses the global `console.log()` method\r\n */\n\n\n Interpreter.defaultOptions = {\n execute: true,\n deferEvents: true,\n clock: {\n setTimeout: function (fn, ms) {\n return setTimeout(fn, ms);\n },\n clearTimeout: function (id) {\n return clearTimeout(id);\n }\n },\n logger: /*#__PURE__*/console.log.bind(console),\n devTools: false\n };\n Interpreter.interpret = interpret;\n return Interpreter;\n}();\n\nvar resolveSpawnOptions = function (nameOrOptions) {\n if (isString(nameOrOptions)) {\n return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: nameOrOptions\n });\n }\n\n return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: uniqueId()\n }), nameOrOptions);\n};\n\nfunction spawn(entity, nameOrOptions) {\n var resolvedOptions = resolveSpawnOptions(nameOrOptions);\n return consume(function (service) {\n if (!IS_PRODUCTION) {\n var isLazyEntity = isMachine(entity) || isFunction(entity);\n warn(!!service || isLazyEntity, \"Attempted to spawn an Actor (ID: \\\"\".concat(isMachine(entity) ? entity.id : 'undefined', \"\\\") outside of a service. This will have no effect.\"));\n }\n\n if (service) {\n return service.spawn(entity, resolvedOptions.name, resolvedOptions);\n } else {\n return createDeferredActor(entity, resolvedOptions.name);\n }\n });\n}\n/**\r\n * Creates a new Interpreter instance for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to interpret\r\n * @param options Interpreter options\r\n */\n\nfunction interpret(machine, options) {\n var interpreter = new Interpreter(machine, options);\n return interpreter;\n}\n\nexport { Interpreter, InterpreterStatus, interpret, spawn };\n","import { __assign, __rest } from './_virtual/_tslib.js';\nimport './types.js';\nimport { invoke } from './actionTypes.js';\nimport './utils.js';\nimport './environment.js';\n\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n var simpleSrc = {\n type: src\n };\n\n simpleSrc.toString = function () {\n return src;\n }; // v4 compat - TODO: remove in v5\n\n\n return simpleSrc;\n }\n\n return src;\n}\nfunction toInvokeDefinition(invokeConfig) {\n return __assign(__assign({\n type: invoke\n }, invokeConfig), {\n toJSON: function () {\n invokeConfig.onDone;\n invokeConfig.onError;\n var invokeDef = __rest(invokeConfig, [\"onDone\", \"onError\"]);\n\n return __assign(__assign({}, invokeDef), {\n type: invoke,\n src: toInvokeSource(invokeConfig.src)\n });\n }\n });\n}\n\nexport { toInvokeDefinition, toInvokeSource };\n","var children = /*#__PURE__*/new Map();\nvar sessionIdIndex = 0;\nvar registry = {\n bookId: function () {\n return \"x:\".concat(sessionIdIndex++);\n },\n register: function (id, actor) {\n children.set(id, actor);\n return id;\n },\n get: function (id) {\n return children.get(id);\n },\n free: function (id) {\n children.delete(id);\n }\n};\n\nexport { registry };\n","import { __assign } from './_virtual/_tslib.js';\n\nvar defaultOptions = {\n deferEvents: false\n};\n\nvar Scheduler =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function Scheduler(options) {\n this.processingEvent = false;\n this.queue = [];\n this.initialized = false;\n this.options = __assign(__assign({}, defaultOptions), options);\n }\n\n Scheduler.prototype.initialize = function (callback) {\n this.initialized = true;\n\n if (callback) {\n if (!this.options.deferEvents) {\n this.schedule(callback);\n return;\n }\n\n this.process(callback);\n }\n\n this.flushEvents();\n };\n\n Scheduler.prototype.schedule = function (task) {\n if (!this.initialized || this.processingEvent) {\n this.queue.push(task);\n return;\n }\n\n if (this.queue.length !== 0) {\n throw new Error('Event queue should be empty when it is not processing events');\n }\n\n this.process(task);\n this.flushEvents();\n };\n\n Scheduler.prototype.clear = function () {\n this.queue = [];\n };\n\n Scheduler.prototype.flushEvents = function () {\n var nextCallback = this.queue.shift();\n\n while (nextCallback) {\n this.process(nextCallback);\n nextCallback = this.queue.shift();\n }\n };\n\n Scheduler.prototype.process = function (callback) {\n this.processingEvent = true;\n\n try {\n callback();\n } catch (e) {\n // there is no use to keep the future events\n // as the situation is not anymore the same\n this.clear();\n throw e;\n } finally {\n this.processingEvent = false;\n }\n };\n\n return Scheduler;\n}();\n\nexport { Scheduler };\n","/**\r\n * Maintains a stack of the current service in scope.\r\n * This is used to provide the correct service to spawn().\r\n */\nvar serviceStack = [];\nvar provide = function (service, fn) {\n serviceStack.push(service);\n var result = fn(service);\n serviceStack.pop();\n return result;\n};\nvar consume = function (fn) {\n return fn(serviceStack[serviceStack.length - 1]);\n};\n\nexport { consume, provide };\n","import { __values, __spreadArray, __read } from './_virtual/_tslib.js';\nimport { flatten } from './utils.js';\n\nvar isLeafNode = function (stateNode) {\n return stateNode.type === 'atomic' || stateNode.type === 'final';\n};\nfunction getChildren(stateNode) {\n return Object.keys(stateNode.states).map(function (key) {\n return stateNode.states[key];\n });\n}\nfunction getAllStateNodes(stateNode) {\n var stateNodes = [stateNode];\n\n if (isLeafNode(stateNode)) {\n return stateNodes;\n }\n\n return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));\n}\nfunction getConfiguration(prevStateNodes, stateNodes) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d;\n\n var prevConfiguration = new Set(prevStateNodes);\n var prevAdjList = getAdjList(prevConfiguration);\n var configuration = new Set(stateNodes);\n\n try {\n // add all ancestors\n for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {\n var s = configuration_1_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n var adjList = getAdjList(configuration);\n\n try {\n // add descendants\n for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {\n var s = configuration_2_1.value; // if previously active, add existing child nodes\n\n if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n if (prevAdjList.get(s)) {\n prevAdjList.get(s).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n s.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n } else {\n if (s.type === 'parallel') {\n try {\n for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n\n if (child.type === 'history') {\n continue;\n }\n\n if (!configuration.has(child)) {\n configuration.add(child);\n\n if (prevAdjList.get(child)) {\n prevAdjList.get(child).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n child.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n }\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n try {\n // add all ancestors\n for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {\n var s = configuration_3_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return configuration;\n}\n\nfunction getValueFromAdj(baseNode, adjList) {\n var childStateNodes = adjList.get(baseNode);\n\n if (!childStateNodes) {\n return {}; // todo: fix?\n }\n\n if (baseNode.type === 'compound') {\n var childStateNode = childStateNodes[0];\n\n if (childStateNode) {\n if (isLeafNode(childStateNode)) {\n return childStateNode.key;\n }\n } else {\n return {};\n }\n }\n\n var stateValue = {};\n childStateNodes.forEach(function (csn) {\n stateValue[csn.key] = getValueFromAdj(csn, adjList);\n });\n return stateValue;\n}\n\nfunction getAdjList(configuration) {\n var e_5, _a;\n\n var adjList = new Map();\n\n try {\n for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {\n var s = configuration_4_1.value;\n\n if (!adjList.has(s)) {\n adjList.set(s, []);\n }\n\n if (s.parent) {\n if (!adjList.has(s.parent)) {\n adjList.set(s.parent, []);\n }\n\n adjList.get(s.parent).push(s);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return adjList;\n}\nfunction getValue(rootNode, configuration) {\n var config = getConfiguration([rootNode], configuration);\n return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction has(iterable, item) {\n if (Array.isArray(iterable)) {\n return iterable.some(function (member) {\n return member === item;\n });\n }\n\n if (iterable instanceof Set) {\n return iterable.has(item);\n }\n\n return false; // TODO: fix\n}\nfunction nextEvents(configuration) {\n return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {\n return sn.ownEvents;\n })), false)))), false);\n}\nfunction isInFinalState(configuration, stateNode) {\n if (stateNode.type === 'compound') {\n return getChildren(stateNode).some(function (s) {\n return s.type === 'final' && has(configuration, s);\n });\n }\n\n if (stateNode.type === 'parallel') {\n return getChildren(stateNode).every(function (sn) {\n return isInFinalState(configuration, sn);\n });\n }\n\n return false;\n}\nfunction getMeta(configuration) {\n if (configuration === void 0) {\n configuration = [];\n }\n\n return configuration.reduce(function (acc, stateNode) {\n if (stateNode.meta !== undefined) {\n acc[stateNode.id] = stateNode.meta;\n }\n\n return acc;\n }, {});\n}\nfunction getTagsFromConfiguration(configuration) {\n return new Set(flatten(configuration.map(function (sn) {\n return sn.tags;\n })));\n}\n\nexport { getAdjList, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };\n","var ActionTypes;\n\n(function (ActionTypes) {\n ActionTypes[\"Start\"] = \"xstate.start\";\n ActionTypes[\"Stop\"] = \"xstate.stop\";\n ActionTypes[\"Raise\"] = \"xstate.raise\";\n ActionTypes[\"Send\"] = \"xstate.send\";\n ActionTypes[\"Cancel\"] = \"xstate.cancel\";\n ActionTypes[\"NullEvent\"] = \"\";\n ActionTypes[\"Assign\"] = \"xstate.assign\";\n ActionTypes[\"After\"] = \"xstate.after\";\n ActionTypes[\"DoneState\"] = \"done.state\";\n ActionTypes[\"DoneInvoke\"] = \"done.invoke\";\n ActionTypes[\"Log\"] = \"xstate.log\";\n ActionTypes[\"Init\"] = \"xstate.init\";\n ActionTypes[\"Invoke\"] = \"xstate.invoke\";\n ActionTypes[\"ErrorExecution\"] = \"error.execution\";\n ActionTypes[\"ErrorCommunication\"] = \"error.communication\";\n ActionTypes[\"ErrorPlatform\"] = \"error.platform\";\n ActionTypes[\"ErrorCustom\"] = \"xstate.error\";\n ActionTypes[\"Update\"] = \"xstate.update\";\n ActionTypes[\"Pure\"] = \"xstate.pure\";\n ActionTypes[\"Choose\"] = \"xstate.choose\";\n})(ActionTypes || (ActionTypes = {}));\n\nvar SpecialTargets;\n\n(function (SpecialTargets) {\n SpecialTargets[\"Parent\"] = \"#_parent\";\n SpecialTargets[\"Internal\"] = \"#_internal\";\n})(SpecialTargets || (SpecialTargets = {}));\n\nexport { ActionTypes, SpecialTargets };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { DEFAULT_GUARD_TYPE, TARGETLESS_KEY, STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar _a;\nfunction keys(value) {\n return Object.keys(value);\n}\nfunction matchesState(parentStateId, childStateId, delimiter) {\n if (delimiter === void 0) {\n delimiter = STATE_DELIMITER;\n }\n\n var parentStateValue = toStateValue(parentStateId, delimiter);\n var childStateValue = toStateValue(childStateId, delimiter);\n\n if (isString(childStateValue)) {\n if (isString(parentStateValue)) {\n return childStateValue === parentStateValue;\n } // Parent more specific than child\n\n\n return false;\n }\n\n if (isString(parentStateValue)) {\n return parentStateValue in childStateValue;\n }\n\n return Object.keys(parentStateValue).every(function (key) {\n if (!(key in childStateValue)) {\n return false;\n }\n\n return matchesState(parentStateValue[key], childStateValue[key]);\n });\n}\nfunction getEventType(event) {\n try {\n return isString(event) || typeof event === 'number' ? \"\".concat(event) : event.type;\n } catch (e) {\n throw new Error('Events must be strings or objects with a string event.type property.');\n }\n}\nfunction getActionType(action) {\n try {\n return isString(action) || typeof action === 'number' ? \"\".concat(action) : isFunction(action) ? action.name : action.type;\n } catch (e) {\n throw new Error('Actions must be strings or objects with a string action.type property.');\n }\n}\nfunction toStatePath(stateId, delimiter) {\n try {\n if (isArray(stateId)) {\n return stateId;\n }\n\n return stateId.toString().split(delimiter);\n } catch (e) {\n throw new Error(\"'\".concat(stateId, \"' is not a valid state path.\"));\n }\n}\nfunction isStateLike(state) {\n return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;\n}\nfunction toStateValue(stateValue, delimiter) {\n if (isStateLike(stateValue)) {\n return stateValue.value;\n }\n\n if (isArray(stateValue)) {\n return pathToStateValue(stateValue);\n }\n\n if (typeof stateValue !== 'string') {\n return stateValue;\n }\n\n var statePath = toStatePath(stateValue, delimiter);\n return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n if (statePath.length === 1) {\n return statePath[0];\n }\n\n var value = {};\n var marker = value;\n\n for (var i = 0; i < statePath.length - 1; i++) {\n if (i === statePath.length - 2) {\n marker[statePath[i]] = statePath[i + 1];\n } else {\n marker[statePath[i]] = {};\n marker = marker[statePath[i]];\n }\n }\n\n return value;\n}\nfunction mapValues(collection, iteratee) {\n var result = {};\n var collectionKeys = Object.keys(collection);\n\n for (var i = 0; i < collectionKeys.length; i++) {\n var key = collectionKeys[i];\n result[key] = iteratee(collection[key], key, collection, i);\n }\n\n return result;\n}\nfunction mapFilterValues(collection, iteratee, predicate) {\n var e_1, _a;\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var item = collection[key];\n\n if (!predicate(item)) {\n continue;\n }\n\n result[key] = iteratee(item, key, collection);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return result;\n}\n/**\r\n * Retrieves a value at the given path.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nvar path = function (props) {\n return function (object) {\n var e_2, _a;\n\n var result = object;\n\n try {\n for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n result = result[prop];\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n return result;\n };\n};\n/**\r\n * Retrieves a value at the given path via the nested accessor prop.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nfunction nestedPath(props, accessorProp) {\n return function (object) {\n var e_3, _a;\n\n var result = object;\n\n try {\n for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {\n var prop = props_2_1.value;\n result = result[accessorProp][prop];\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n return result;\n };\n}\nfunction toStatePaths(stateValue) {\n if (!stateValue) {\n return [[]];\n }\n\n if (isString(stateValue)) {\n return [[stateValue]];\n }\n\n var result = flatten(Object.keys(stateValue).map(function (key) {\n var subStateValue = stateValue[key];\n\n if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {\n return [[key]];\n }\n\n return toStatePaths(stateValue[key]).map(function (subPath) {\n return [key].concat(subPath);\n });\n }));\n return result;\n}\nfunction pathsToStateValue(paths) {\n var e_4, _a;\n\n var result = {};\n\n if (paths && paths.length === 1 && paths[0].length === 1) {\n return paths[0][0];\n }\n\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var currentPath = paths_1_1.value;\n var marker = result; // tslint:disable-next-line:prefer-for-of\n\n for (var i = 0; i < currentPath.length; i++) {\n var subPath = currentPath[i];\n\n if (i === currentPath.length - 2) {\n marker[subPath] = currentPath[i + 1];\n break;\n }\n\n marker[subPath] = marker[subPath] || {};\n marker = marker[subPath];\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return result;\n}\nfunction flatten(array) {\n var _a;\n\n return (_a = []).concat.apply(_a, __spreadArray([], __read(array), false));\n}\nfunction toArrayStrict(value) {\n if (isArray(value)) {\n return value;\n }\n\n return [value];\n}\nfunction toArray(value) {\n if (value === undefined) {\n return [];\n }\n\n return toArrayStrict(value);\n}\nfunction mapContext(mapper, context, _event) {\n var e_5, _a;\n\n if (isFunction(mapper)) {\n return mapper(context, _event.data);\n }\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var subMapper = mapper[key];\n\n if (isFunction(subMapper)) {\n result[key] = subMapper(context, _event.data);\n } else {\n result[key] = subMapper;\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return result;\n}\nfunction isBuiltInEvent(eventType) {\n return /^(done|error)\\./.test(eventType);\n}\nfunction isPromiseLike(value) {\n if (value instanceof Promise) {\n return true;\n } // Check if shape matches the Promise/A+ specification for a \"thenable\".\n\n\n if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {\n return true;\n }\n\n return false;\n}\nfunction isBehavior(value) {\n return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';\n}\nfunction partition(items, predicate) {\n var e_6, _a;\n\n var _b = __read([[], []], 2),\n truthy = _b[0],\n falsy = _b[1];\n\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n\n if (predicate(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n return [truthy, falsy];\n}\nfunction updateHistoryStates(hist, stateValue) {\n return mapValues(hist.states, function (subHist, key) {\n if (!subHist) {\n return undefined;\n }\n\n var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);\n\n if (!subStateValue) {\n return undefined;\n }\n\n return {\n current: subStateValue,\n states: updateHistoryStates(subHist, subStateValue)\n };\n });\n}\nfunction updateHistoryValue(hist, stateValue) {\n return {\n current: stateValue,\n states: updateHistoryStates(hist, stateValue)\n };\n}\nfunction updateContext(context, _event, assignActions, state) {\n if (!IS_PRODUCTION) {\n warn(!!context, 'Attempting to update undefined context');\n }\n\n var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {\n var e_7, _a;\n\n var assignment = assignAction.assignment;\n var meta = {\n state: state,\n action: assignAction,\n _event: _event\n };\n var partialUpdate = {};\n\n if (isFunction(assignment)) {\n partialUpdate = assignment(acc, _event.data, meta);\n } else {\n try {\n for (var _b = __values(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var propAssignment = assignment[key];\n partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return Object.assign({}, acc, partialUpdate);\n }, context) : context;\n return updatedContext;\n} // tslint:disable-next-line:no-empty\n\nvar warn = function () {};\n\nif (!IS_PRODUCTION) {\n warn = function (condition, message) {\n var error = condition instanceof Error ? condition : undefined;\n\n if (!error && condition) {\n return;\n }\n\n if (console !== undefined) {\n var args = [\"Warning: \".concat(message)];\n\n if (error) {\n args.push(error);\n } // tslint:disable-next-line:no-console\n\n\n console.warn.apply(console, args);\n }\n };\n}\nfunction isArray(value) {\n return Array.isArray(value);\n} // tslint:disable-next-line:ban-types\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction toGuard(condition, guardMap) {\n if (!condition) {\n return undefined;\n }\n\n if (isString(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition,\n predicate: guardMap ? guardMap[condition] : undefined\n };\n }\n\n if (isFunction(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition.name,\n predicate: condition\n };\n }\n\n return condition;\n}\nfunction isObservable(value) {\n try {\n return 'subscribe' in value && isFunction(value.subscribe);\n } catch (e) {\n return false;\n }\n}\nvar symbolObservable = /*#__PURE__*/function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}(); // TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages\n\nvar interopSymbols = (_a = {}, _a[symbolObservable] = function () {\n return this;\n}, _a[Symbol.observable] = function () {\n return this;\n}, _a);\nfunction isMachine(value) {\n return !!value && '__xstatenode' in value;\n}\nfunction isActor(value) {\n return !!value && typeof value.send === 'function';\n}\nvar uniqueId = /*#__PURE__*/function () {\n var currentId = 0;\n return function () {\n currentId++;\n return currentId.toString(16);\n };\n}();\nfunction toEventObject(event, payload // id?: TEvent['type']\n) {\n if (isString(event) || typeof event === 'number') {\n return __assign({\n type: event\n }, payload);\n }\n\n return event;\n}\nfunction toSCXMLEvent(event, scxmlEvent) {\n if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {\n return event;\n }\n\n var eventObject = toEventObject(event);\n return __assign({\n name: eventObject.type,\n data: eventObject,\n $$type: 'scxml',\n type: 'external'\n }, scxmlEvent);\n}\nfunction toTransitionConfigArray(event, configLike) {\n var transitions = toArrayStrict(configLike).map(function (transitionLike) {\n if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {\n return {\n target: transitionLike,\n event: event\n };\n }\n\n return __assign(__assign({}, transitionLike), {\n event: event\n });\n });\n return transitions;\n}\nfunction normalizeTarget(target) {\n if (target === undefined || target === TARGETLESS_KEY) {\n return undefined;\n }\n\n return toArray(target);\n}\nfunction reportUnhandledExceptionOnInvocation(originalError, currentError, id) {\n if (!IS_PRODUCTION) {\n var originalStackTrace = originalError.stack ? \" Stacktrace was '\".concat(originalError.stack, \"'\") : '';\n\n if (originalError === currentError) {\n // tslint:disable-next-line:no-console\n console.error(\"Missing onError handler for invocation '\".concat(id, \"', error was '\").concat(originalError, \"'.\").concat(originalStackTrace));\n } else {\n var stackTrace = currentError.stack ? \" Stacktrace was '\".concat(currentError.stack, \"'\") : ''; // tslint:disable-next-line:no-console\n\n console.error(\"Missing onError handler and/or unhandled exception/promise rejection for invocation '\".concat(id, \"'. \") + \"Original error: '\".concat(originalError, \"'. \").concat(originalStackTrace, \" Current error is '\").concat(currentError, \"'.\").concat(stackTrace));\n }\n }\n}\nfunction evaluateGuard(machine, guard, context, _event, state) {\n var guards = machine.options.guards;\n var guardMeta = {\n state: state,\n cond: guard,\n _event: _event\n }; // TODO: do not hardcode!\n\n if (guard.type === DEFAULT_GUARD_TYPE) {\n return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);\n }\n\n var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];\n\n if (!condFn) {\n throw new Error(\"Guard '\".concat(guard.type, \"' is not implemented on machine '\").concat(machine.id, \"'.\"));\n }\n\n return condFn(context, _event.data, guardMeta);\n}\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n return {\n type: src\n };\n }\n\n return src;\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n if (typeof nextHandler === 'object') {\n return nextHandler;\n }\n\n var noop = function () {\n return void 0;\n };\n\n return {\n next: nextHandler,\n error: errorHandler || noop,\n complete: completionHandler || noop\n };\n}\nfunction createInvokeId(stateNodeId, index) {\n return \"\".concat(stateNodeId, \":invocation[\").concat(index, \"]\");\n}\n\nexport { createInvokeId, evaluateGuard, flatten, getActionType, getEventType, interopSymbols, isActor, isArray, isBehavior, isBuiltInEvent, isFunction, isMachine, isObservable, isPromiseLike, isStateLike, isString, keys, mapContext, mapFilterValues, mapValues, matchesState, nestedPath, normalizeTarget, partition, path, pathToStateValue, pathsToStateValue, reportUnhandledExceptionOnInvocation, symbolObservable, toArray, toArrayStrict, toEventObject, toGuard, toInvokeSource, toObserver, toSCXMLEvent, toStatePath, toStatePaths, toStateValue, toTransitionConfigArray, uniqueId, updateContext, updateHistoryStates, updateHistoryValue, warn };\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.Timer = void 0;\nexports.safeSetInterval = safeSetInterval;\nexports.safeSetTimeout = safeSetTimeout;\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\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Wrapper around setTimout which (in node) unrefs the returned timer to avoid\n * wedging the process open unexpectedly.\n * @param {Mixed} args\n * @protected\n * @returns {NodeJS.Timeout|Number}\n */\nfunction safeSetTimeout() {\n var timer = setTimeout.apply(void 0, arguments);\n if (timer.unref) {\n timer.unref();\n }\n return timer;\n}\n\n/**\n * Wrapper around setInterval which (in node) unrefs the returned timer to avoid\n * wedging the process open unexpectedly.\n * @param {Mixed} args\n * @protected\n * @returns {NodeJS.Timeout|Number}\n */\nfunction safeSetInterval() {\n var interval = setInterval.apply(void 0, arguments);\n if (interval.unref) {\n interval.unref();\n }\n return interval;\n}\n\n/**\n * Create a restartable timer\n */\nvar Timer = exports.Timer = /*#__PURE__*/function () {\n /**\n * Construct timer\n * @param {Function} callback Function called when the timer expired\n * @param {number} timeout duration of the timeout in milliseconds\n */\n function Timer(callback, timeout) {\n var _this = this;\n (0, _classCallCheck2.default)(this, Timer);\n (0, _defineProperty2.default)(this, \"state\", void 0);\n (0, _defineProperty2.default)(this, \"timeout\", void 0);\n (0, _defineProperty2.default)(this, \"callback\", void 0);\n (0, _defineProperty2.default)(this, \"currentTimer\", void 0);\n this.state = 'init';\n this.timeout = timeout;\n this.callback = function () {\n _this.state = 'done';\n callback();\n };\n }\n\n /**\n * Start timer\n * @returns {void}\n */\n (0, _createClass2.default)(Timer, [{\n key: \"start\",\n value: function start() {\n if (this.state !== 'init') {\n throw new Error(\"Can't start the timer when it's in \".concat(this.state, \" state\"));\n }\n this.startTimer();\n this.state = 'running';\n }\n\n /**\n * Clear the current timer and start a new one\n * @returns {void}\n */\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.state !== 'running') {\n throw new Error(\"Can't reset the timer when it's in \".concat(this.state, \" state\"));\n }\n this.clearTimer();\n this.startTimer();\n }\n\n /**\n * Clear the timer\n * @returns {void}\n */\n }, {\n key: \"cancel\",\n value: function cancel() {\n if (this.state !== 'running') {\n throw new Error(\"Can't cancel the timer when it's in \".concat(this.state, \" state\"));\n }\n this.clearTimer();\n this.state = 'done';\n }\n\n /**\n * Create the actual timer\n * @private\n * @returns {undefined}\n */\n }, {\n key: \"startTimer\",\n value: function startTimer() {\n this.currentTimer = safeSetTimeout(this.callback, this.timeout);\n }\n\n /**\n * Clear the actual timer\n * @private\n * @returns {undefined}\n */\n }, {\n key: \"clearTimer\",\n value: function clearTimer() {\n clearTimeout(this.currentTimer);\n }\n }]);\n return Timer;\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.decode = decode;\nexports.default = void 0;\nexports.encode = encode;\nexports.fromBase64url = fromBase64url;\nexports.toBase64Url = toBase64Url;\nexports.validate = validate;\nvar _urlsafeBase = _interopRequireDefault(require(\"urlsafe-base64\"));\nvar _safeBuffer = require(\"safe-buffer\");\nvar _isBuffer = _interopRequireDefault(require(\"./isBuffer\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Converts a string from a base64url-encoded string\n * @param {string} str\n * @returns {string}\n */\nfunction fromBase64url(str) {\n return _urlsafeBase.default.decode(str).toString();\n}\n\n/**\n * Converts a string to a base64url-encoded string. It also accepts a buffer\n * @param {string|buffer} str\n * @returns {string}\n */\nfunction toBase64Url(str) {\n var buffer = str;\n if (!(0, _isBuffer.default)(buffer)) {\n buffer = _safeBuffer.Buffer.from(buffer);\n }\n return _urlsafeBase.default.encode(buffer);\n}\n\n/**\n * Converts a string to a base64url-encoded string. It also accepts a buffer\n * @param {string|buffer} str\n * @returns {string}\n */\nfunction encode(str) {\n return toBase64Url(str);\n}\n\n/**\n * Converts a string from a base64url-encoded string\n * @param {string} str\n * @returns {string}\n */\nfunction decode(str) {\n return fromBase64url(str);\n}\n\n/**\n * Indicates if the provided string is, in fact, a base64 string\n * @param {String} str\n * @returns {Boolean}\n */\nfunction validate(str) {\n return _urlsafeBase.default.validate(str);\n}\nvar _default = exports.default = {\n fromBase64url: fromBase64url,\n toBase64Url: toBase64Url,\n encode: encode,\n decode: decode,\n validate: validate\n};\n//# sourceMappingURL=base64.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.getBrowserSerial = exports.default = void 0;\nvar _bowser = _interopRequireDefault(require(\"bowser\"));\nvar _lodash = require(\"lodash\");\nvar _window = _interopRequireDefault(require(\"global/window\"));\nvar _constants = require(\"./constants\");\nvar getBrowserSerial = exports.getBrowserSerial = function getBrowserSerial() {\n var browserData;\n try {\n var _window$navigator;\n browserData = _window.default !== null && _window.default !== void 0 && (_window$navigator = _window.default.navigator) !== null && _window$navigator !== void 0 && _window$navigator.userAgent ? _bowser.default.getParser(_window.default.navigator.userAgent) : {\n error: _constants.browserDetection.unableToAccessUserAgent\n };\n } catch (err) {\n browserData = {\n error: err.message\n };\n }\n return browserData;\n};\nvar mockDetectionObject = {\n /* eslint-disable global-require */\n getOSName: function getOSName() {\n return require('os').platform();\n },\n getOSVersion: function getOSVersion() {\n return require('os').release();\n },\n /* eslint-enable global-require */\n getBrowserName: function getBrowserName() {\n return '';\n },\n getBrowserVersion: function getBrowserVersion() {\n return '';\n },\n isBrowser: function isBrowser() {\n return false;\n }\n};\nvar createDetectionObject = function createDetectionObject(results) {\n var getOSName = function getOSName() {\n var _results$getOSName;\n return (_results$getOSName = results === null || results === void 0 ? void 0 : results.getOSName()) !== null && _results$getOSName !== void 0 ? _results$getOSName : '';\n };\n var getOSVersion = function getOSVersion() {\n var _results$getOSVersion;\n return (_results$getOSVersion = results === null || results === void 0 ? void 0 : results.getOSVersion()) !== null && _results$getOSVersion !== void 0 ? _results$getOSVersion : '';\n };\n var getBrowserName = function getBrowserName() {\n var _results$getBrowserNa;\n return (_results$getBrowserNa = results === null || results === void 0 ? void 0 : results.getBrowserName()) !== null && _results$getBrowserNa !== void 0 ? _results$getBrowserNa : '';\n };\n var getBrowserVersion = function getBrowserVersion() {\n var _results$getBrowserVe;\n return (_results$getBrowserVe = results === null || results === void 0 ? void 0 : results.getBrowserVersion()) !== null && _results$getBrowserVe !== void 0 ? _results$getBrowserVe : '';\n };\n var isBrowser = function isBrowser(name) {\n return !!(results !== null && results !== void 0 && results.isBrowser(name, true));\n };\n return {\n getOSName: getOSName,\n getOSVersion: getOSVersion,\n getBrowserName: getBrowserName,\n getBrowserVersion: getBrowserVersion,\n isBrowser: isBrowser\n };\n};\nvar _default = exports.default = (0, _lodash.memoize)(function (agent) {\n var _window$navigator2;\n return agent || (_window$navigator2 = _window.default.navigator) !== null && _window$navigator2 !== void 0 && _window$navigator2.userAgent ? createDetectionObject(_bowser.default.getParser(agent || _window.default.navigator.userAgent)) : mockDetectionObject;\n});\n//# sourceMappingURL=browser-detection.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 = debounce;\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Behaves like debounce, but additionally executes after a number of calls are\n * attempted, rather than just time\n * @param {Function} fn\n * @param {Number} wait\n * @param {Object} options\n * @returns {Function}\n */\nfunction debounce(fn, wait, options) {\n /* eslint no-invalid-this: [0] */\n\n if (!fn) {\n throw new Error('`fn` must be a function');\n }\n if (!wait) {\n throw new Error('`wait` is required');\n }\n options = options || {};\n if (!options.maxWait) {\n throw new Error('`options.maxWait` is required');\n }\n if (!options.maxCalls) {\n throw new Error('`options.maxCalls` is required');\n }\n var _options = options,\n maxCalls = _options.maxCalls,\n maxWait = _options.maxWait;\n var count = 0;\n var maxWaitTimer;\n var waitTimer;\n return function wrapper() {\n count += 1;\n clearTimeout(waitTimer);\n waitTimer = setTimeout(function () {\n return exec();\n }, wait);\n if (!maxWaitTimer) {\n maxWaitTimer = setTimeout(function () {\n return exec();\n }, maxWait);\n }\n if (count >= maxCalls) {\n (0, _apply.default)(exec, this, []);\n }\n };\n\n /**\n * @private\n * @returns {undefined}\n */\n function exec() {\n clearTimeout(waitTimer);\n waitTimer = null;\n clearTimeout(maxWaitTimer);\n maxWaitTimer = null;\n count = 0;\n (0, _apply.default)(fn, this, []);\n }\n}\n//# sourceMappingURL=capped-debounce.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 = checkRequired;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Check object for the specified keys\n * @param {Array} keys\n * @param {Object} object\n * @returns {undefined}\n * @throws Error\n */\nfunction checkRequired(keys, object) {\n keys.forEach(function (key) {\n if (!object[key]) {\n throw new Error(\"missing required property \".concat(key, \" from \").concat(object));\n }\n });\n}\n//# sourceMappingURL=check-required.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.hydraTypes = exports.deviceType = exports.browserDetection = exports.SDK_EVENT = exports.INTERNAL_US_INTEGRATION_CLUSTER_NAME = exports.INTERNAL_US_CLUSTER_NAME = void 0;\nvar SDK_EVENT = exports.SDK_EVENT = {\n INTERNAL: {\n WEBEX_ACTIVITY: 'event:conversation.activity',\n ACTIVITY_FIELD: {\n ACTOR: 'actor',\n OBJECT: 'object',\n TARGET: 'target'\n },\n ACTIVITY_VERB: {\n ACKNOWLEDGE: 'acknowledge',\n CARD_ACTION: 'cardAction',\n CREATE: 'create',\n POST: 'post',\n SHARE: 'share',\n DELETE: 'delete',\n ADD: 'add',\n LEAVE: 'leave',\n ADD_MODERATOR: 'assignModerator',\n REMOVE_MODERATOR: 'unassignModerator',\n LOCK: 'lock',\n UNLOCK: 'unlock',\n HIDE: 'hide',\n UPDATE: 'update'\n },\n ACTIVITY_TAG: {\n HIDDEN: 'HIDDEN',\n ONE_ON_ONE: 'ONE_ON_ONE',\n LOCKED: 'LOCKED'\n }\n },\n EXTERNAL: {\n EVENT_TYPE: {\n CREATED: 'created',\n DELETED: 'deleted',\n UPDATED: 'updated',\n SEEN: 'seen'\n },\n OWNER: {\n CREATOR: 'creator',\n ORG: 'org'\n },\n STATUS: {\n ACTIVE: 'active',\n DISABLED: 'disabled'\n },\n SPACE_TYPE: {\n DIRECT: 'direct',\n GROUP: 'group'\n },\n RESOURCE: {\n ATTACHMENT_ACTIONS: 'attachmentActions',\n MEMBERSHIPS: 'memberships',\n MESSAGES: 'messages',\n ROOMS: 'rooms'\n },\n ATTACHMENTS: {\n CARD_CONTENT_TYPE: 'application/vnd.microsoft.card.adaptive'\n }\n }\n};\nvar browserDetection = exports.browserDetection = {\n unableToAccessUserAgent: 'unable to access window.navigator.userAgent'\n};\nvar hydraTypes = exports.hydraTypes = {\n ATTACHMENT_ACTION: 'ATTACHMENT_ACTION',\n CONTENT: 'CONTENT',\n MEMBERSHIP: 'MEMBERSHIP',\n MESSAGE: 'MESSAGE',\n ORGANIZATION: 'ORGANIZATION',\n PEOPLE: 'PEOPLE',\n ROOM: 'ROOM',\n TEAM: 'TEAM'\n};\nvar deviceType = exports.deviceType = {\n PROVISIONAL: 'PROVISIONAL',\n WEB: 'WEB'\n};\nvar INTERNAL_US_CLUSTER_NAME = exports.INTERNAL_US_CLUSTER_NAME = 'urn:TEAM:us-east-2_a';\nvar INTERNAL_US_INTEGRATION_CLUSTER_NAME = exports.INTERNAL_US_INTEGRATION_CLUSTER_NAME = 'urn:TEAM:us-east-1_int13';\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});\nexports.default = Defer;\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/**\n * Creates a new `Defer`red object,\n * @returns {Defer}\n */\nfunction Defer() {\n var _this = this;\n this.promise = new _promise.default(function (resolve, reject) {\n /**\n * @instance\n * @memberof Defer\n * @type {function}\n */\n _this.resolve = resolve;\n /**\n * @instance\n * @memberof Defer\n * @type {function}\n */\n _this.reject = reject;\n });\n}\n//# sourceMappingURL=defer.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 _coreDecorators = require(\"core-decorators\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * @private\n * @returns {function}\n */\nfunction emptyDecorator() {\n return function noop() {\n /* eslint no-empty:[0] */\n };\n}\nvar exportedDeprecated = process.env.NODE_ENV === 'production' ? emptyDecorator : _coreDecorators.deprecated;\nvar _default = exports.default = exportedDeprecated;\n//# sourceMappingURL=deprecated.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.createEventEnvelope = createEventEnvelope;\nexports.ensureMyIdIsAvailable = ensureMyIdIsAvailable;\nvar _regenerator = _interopRequireDefault(require(\"@babel/runtime-corejs2/regenerator\"));\nvar _asyncToGenerator2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/asyncToGenerator\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _constants = require(\"./constants\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Creates a 'webhook' envelope to wrap Webex events in\n * @param {object} webex - sdk object\n * @param {string} resource - resource to create an envelope for\n * @returns {object} - Returns a promise of an event envelope object\n */\nfunction createEventEnvelope(webex, resource) {\n return ensureMyIdIsAvailable(webex).then(function () {\n return _promise.default.resolve({\n createdBy: webex.internal.me.id,\n orgId: webex.internal.me.orgId,\n resource: resource,\n // id -- webhook id concept does not correlate to SDK socket event\n // name -- webhook name concept does not correlate to SDK socket event\n // targetUrl -- targetUrl concept does not correlate to SDK socket event\n // secret -- secret concept does not correlate to SDK socket event\n ownedBy: _constants.SDK_EVENT.EXTERNAL.OWNER.CREATOR,\n status: _constants.SDK_EVENT.EXTERNAL.STATUS.ACTIVE,\n created: new Date().toISOString(),\n data: {}\n });\n }).catch(function (e) {\n _promise.default.reject(new Error(\"Unable to get person info for \".concat(resource, \" event envelope: \").concat(e.message)));\n });\n}\n\n/**\n * Stores SDK users info in the sdk object if it doesn't already exist\n * @param {object} webex - sdk object\n * @returns {Promise} - Returns a promise that user info will be available\n */\nfunction ensureMyIdIsAvailable(_x) {\n return _ensureMyIdIsAvailable.apply(this, arguments);\n}\nfunction _ensureMyIdIsAvailable() {\n _ensureMyIdIsAvailable = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(webex) {\n return _regenerator.default.wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!('me' in webex.internal)) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", _promise.default.resolve());\n case 2:\n return _context.abrupt(\"return\", webex.people.get('me').then(function (person) {\n webex.internal.me = person;\n return _promise.default.resolve();\n }));\n case 3:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return _ensureMyIdIsAvailable.apply(this, arguments);\n}\n//# sourceMappingURL=event-envelope.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.proxyEvents = proxyEvents;\nexports.transferEvents = transferEvents;\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _lodash = require(\"lodash\");\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Proxies the event binding methods of emitter onto proxy\n * @param {EventEmitter|EventEmitterProxy} emitter\n * @param {mixed} proxy (probably a promise)\n * @returns {EventEmitter} Returns the source emitter to ease use in promise chains\n */\nfunction proxyEvents(emitter, proxy) {\n ['on', 'once'].forEach(function (key) {\n proxy[key] = function () {\n emitter[key].apply(emitter, arguments);\n return proxy;\n };\n });\n return emitter;\n}\n\n/**\n * Given a list of events, fires them on drain when they're emitted from source\n * @param {Array|string} events\n * @param {EventEmitter} source\n * @param {EventEmitter} drain\n * @returns {undefined}\n */\nfunction transferEvents(events, source, drain) {\n events = (0, _lodash.isArray)(events) ? events : [events];\n events.forEach(function (event) {\n if (source.on) {\n source.on(event, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return emit.apply(void 0, [drain, event].concat(args));\n });\n }\n });\n}\n\n/**\n * Emits an event\n * @param {EventEmitter} target The EventEmitter from which to emit an event\n * @returns {mixed}\n */\nfunction emit(target) {\n var method = target.trigger || target.emit;\n\n /* istanbul ignore if */\n if (!method) {\n throw new Error('count not determine emit method');\n }\n for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n rest[_key2 - 1] = arguments[_key2];\n }\n return (0, _apply.default)(method, target, rest);\n}\n//# sourceMappingURL=events.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 _wrapNativeSuper2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/wrapNativeSuper\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\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 * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n/**\n * Base Exception class\n */\nvar Exception = exports.default = /*#__PURE__*/function (_Error) {\n (0, _inherits2.default)(Exception, _Error);\n var _super = _createSuper(Exception);\n /**\n * constructor\n * @param {mixed} args\n * @returns {Exception}\n */\n function Exception() {\n var _this;\n (0, _classCallCheck2.default)(this, Exception);\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 var message;\n if (_this.parse) {\n var _this2;\n message = (_this2 = _this).parse.apply(_this2, args);\n } else if (_this.constructor.parse) {\n var _this$constructor;\n message = (_this$constructor = _this.constructor).parse.apply(_this$constructor, args);\n }\n if (!message) {\n message = _this.constructor.defaultMessage;\n }\n _this.name = _this.constructor.name;\n _this.message = message;\n return _this;\n }\n\n /**\n * Generates the value assigned to `this.message`. You'll probably want to\n * override this in your custom Exception\n * @param {mixed} args\n * @returns {string}\n */\n (0, _createClass2.default)(Exception, null, [{\n key: \"parse\",\n value: function parse() {\n return arguments.length <= 0 ? undefined : arguments[0];\n }\n }]);\n return Exception;\n}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));\n(0, _defineProperty2.default)(Exception, \"defaultMessage\", 'An error occurred');\n//# sourceMappingURL=exception.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 = true;\n//# sourceMappingURL=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, \"default\", {\n enumerable: true,\n get: function get() {\n return _node.default;\n }\n});\nvar _node = _interopRequireDefault(require(\"./node\"));\n//# sourceMappingURL=index.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, \"BrowserDetection\", {\n enumerable: true,\n get: function get() {\n return _browserDetection.default;\n }\n});\n_Object$defineProperty(exports, \"Defer\", {\n enumerable: true,\n get: function get() {\n return _defer.default;\n }\n});\n_Object$defineProperty(exports, \"Exception\", {\n enumerable: true,\n get: function get() {\n return _exception.default;\n }\n});\n_Object$defineProperty(exports, \"INTERNAL_US_CLUSTER_NAME\", {\n enumerable: true,\n get: function get() {\n return _constants.INTERNAL_US_CLUSTER_NAME;\n }\n});\n_Object$defineProperty(exports, \"INTERNAL_US_INTEGRATION_CLUSTER_NAME\", {\n enumerable: true,\n get: function get() {\n return _constants.INTERNAL_US_INTEGRATION_CLUSTER_NAME;\n }\n});\n_Object$defineProperty(exports, \"SDK_EVENT\", {\n enumerable: true,\n get: function get() {\n return _constants.SDK_EVENT;\n }\n});\n_Object$defineProperty(exports, \"base64\", {\n enumerable: true,\n get: function get() {\n return _base.default;\n }\n});\n_Object$defineProperty(exports, \"buildHydraMembershipId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.buildHydraMembershipId;\n }\n});\n_Object$defineProperty(exports, \"buildHydraMessageId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.buildHydraMessageId;\n }\n});\n_Object$defineProperty(exports, \"buildHydraOrgId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.buildHydraOrgId;\n }\n});\n_Object$defineProperty(exports, \"buildHydraPersonId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.buildHydraPersonId;\n }\n});\n_Object$defineProperty(exports, \"buildHydraRoomId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.buildHydraRoomId;\n }\n});\n_Object$defineProperty(exports, \"cappedDebounce\", {\n enumerable: true,\n get: function get() {\n return _cappedDebounce.default;\n }\n});\n_Object$defineProperty(exports, \"checkRequired\", {\n enumerable: true,\n get: function get() {\n return _checkRequired.default;\n }\n});\n_Object$defineProperty(exports, \"constructHydraId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.constructHydraId;\n }\n});\n_Object$defineProperty(exports, \"createEventEnvelope\", {\n enumerable: true,\n get: function get() {\n return _eventEnvelope.createEventEnvelope;\n }\n});\n_Object$defineProperty(exports, \"deconstructHydraId\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.deconstructHydraId;\n }\n});\n_Object$defineProperty(exports, \"deprecated\", {\n enumerable: true,\n get: function get() {\n return _deprecated.default;\n }\n});\n_Object$defineProperty(exports, \"deviceType\", {\n enumerable: true,\n get: function get() {\n return _constants.deviceType;\n }\n});\n_Object$defineProperty(exports, \"ensureMyIdIsAvailable\", {\n enumerable: true,\n get: function get() {\n return _eventEnvelope.ensureMyIdIsAvailable;\n }\n});\n_Object$defineProperty(exports, \"getBrowserSerial\", {\n enumerable: true,\n get: function get() {\n return _browserDetection.getBrowserSerial;\n }\n});\n_Object$defineProperty(exports, \"getHydraClusterString\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.getHydraClusterString;\n }\n});\n_Object$defineProperty(exports, \"getHydraFiles\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.getHydraFiles;\n }\n});\n_Object$defineProperty(exports, \"getHydraRoomType\", {\n enumerable: true,\n get: function get() {\n return _uuidUtils.getHydraRoomType;\n }\n});\n_Object$defineProperty(exports, \"hydraTypes\", {\n enumerable: true,\n get: function get() {\n return _constants.hydraTypes;\n }\n});\n_Object$defineProperty(exports, \"inBrowser\", {\n enumerable: true,\n get: function get() {\n return _inBrowser.default;\n }\n});\n_Object$defineProperty(exports, \"isBuffer\", {\n enumerable: true,\n get: function get() {\n return _isBuffer.default;\n }\n});\n_Object$defineProperty(exports, \"make\", {\n enumerable: true,\n get: function get() {\n return _templateContainer.default;\n }\n});\n_Object$defineProperty(exports, \"makeStateDataType\", {\n enumerable: true,\n get: function get() {\n return _makeStateDatatype.default;\n }\n});\n_Object$defineProperty(exports, \"oneFlight\", {\n enumerable: true,\n get: function get() {\n return _oneFlight.default;\n }\n});\n_Object$defineProperty(exports, \"patterns\", {\n enumerable: true,\n get: function get() {\n return _patterns.default;\n }\n});\n_Object$defineProperty(exports, \"proxyEvents\", {\n enumerable: true,\n get: function get() {\n return _events.proxyEvents;\n }\n});\n_Object$defineProperty(exports, \"resolveWith\", {\n enumerable: true,\n get: function get() {\n return _resolveWith.default;\n }\n});\n_Object$defineProperty(exports, \"retry\", {\n enumerable: true,\n get: function get() {\n return _retry.default;\n }\n});\n_Object$defineProperty(exports, \"tap\", {\n enumerable: true,\n get: function get() {\n return _tap.default;\n }\n});\n_Object$defineProperty(exports, \"transferEvents\", {\n enumerable: true,\n get: function get() {\n return _events.transferEvents;\n }\n});\n_Object$defineProperty(exports, \"whileInFlight\", {\n enumerable: true,\n get: function get() {\n return _whileInFlight.default;\n }\n});\nvar _base = _interopRequireDefault(require(\"./base64\"));\nvar _isBuffer = _interopRequireDefault(require(\"./isBuffer\"));\nvar _cappedDebounce = _interopRequireDefault(require(\"./capped-debounce\"));\nvar _checkRequired = _interopRequireDefault(require(\"./check-required\"));\nvar _defer = _interopRequireDefault(require(\"./defer\"));\nvar _makeStateDatatype = _interopRequireDefault(require(\"./make-state-datatype\"));\nvar _templateContainer = _interopRequireDefault(require(\"./template-container\"));\nvar _oneFlight = _interopRequireDefault(require(\"./one-flight\"));\nvar _patterns = _interopRequireDefault(require(\"./patterns\"));\nvar _events = require(\"./events\");\nvar _eventEnvelope = require(\"./event-envelope\");\nvar _resolveWith = _interopRequireDefault(require(\"./resolve-with\"));\nvar _retry = _interopRequireDefault(require(\"./retry\"));\nvar _tap = _interopRequireDefault(require(\"./tap\"));\nvar _whileInFlight = _interopRequireDefault(require(\"./while-in-flight\"));\nvar _exception = _interopRequireDefault(require(\"./exception\"));\nvar _deprecated = _interopRequireDefault(require(\"./deprecated\"));\nvar _inBrowser = _interopRequireDefault(require(\"./in-browser\"));\nvar _constants = require(\"./constants\");\nvar _browserDetection = _interopRequireWildcard(require(\"./browser-detection\"));\nvar _uuidUtils = require(\"./uuid-utils\");\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//# 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.default = void 0;\n/**\n *\n * Grabbed from https://github.com/feross/is-buffer/blob/master/index.js => es6 + prettier\n *\n * @param {buffer} buffer\n * @returns {boolean}\n */\nvar _default = exports.default = function _default(buffer) {\n return buffer != null && buffer.constructor != null && typeof buffer.constructor.isBuffer === 'function' && buffer.constructor.isBuffer(buffer);\n};\n//# sourceMappingURL=isBuffer.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 = makeStateDataType;\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n// Reminder: any class using this function must have something like the\n// following in its initialize method:\n//\n// // HACK to deal with the fact that AmpersandState#dataTypes#set is a pure\n// // function.\n// this._dataTypes = cloneDeep(this._dataTypes);\n// Object.keys(this._dataTypes).forEach((key) => {\n// if (this._dataTypes[key].set) {\n// this._dataTypes[key].set = this._dataTypes[key].set.bind(this);\n// }\n// });\n// // END HACK\n\n/**\n * Creates an ampersand state object that wires its event handlers like a an\n * ampersand child\n * @param {Function} Constructor\n * @param {string} name\n * @returns {Object}\n */\nfunction makeStateDataType(Constructor, name) {\n if (!Constructor || !name) {\n throw new Error('missing parameter for makeStateDataType');\n }\n return {\n dataType: {\n set: function set(newVal) {\n // newVal.parent = this;\n if (newVal instanceof Constructor) {\n newVal.parent = this;\n return {\n val: newVal,\n type: name\n };\n }\n\n // We only want to construct the new instance if we have some set of\n // attributes (even an empty object) to base it on. This is to deal with\n // the unexpected side effect that AmpState#unset will create a new\n // instance.\n return {\n val: newVal ? new Constructor(newVal, {\n parent: this\n }) : undefined,\n type: name\n };\n },\n compare: function compare(currentValue, newVal) {\n return currentValue === newVal;\n },\n onChange: function onChange(newVal, previousVal, attributeName) {\n // Copied from ampersand-state.js\n // if this has changed we want to also handle\n // event propagation\n if (previousVal) {\n this.stopListening(previousVal, 'all', this._getCachedEventBubblingHandler(attributeName));\n }\n if (newVal) {\n this.listenTo(newVal, 'all', this._getCachedEventBubblingHandler(attributeName));\n }\n }\n },\n prop: {\n /**\n * This is a really unfortunate hack to deal with ampersand`s decision to\n * make the dateType#set function pure. The only function called with the\n * scope of the parent at set time seems to be test\n * @param {AmpersandState} newVal\n * @returns {boolean}\n */\n test: function test(newVal) {\n if (!newVal) {\n return false;\n }\n newVal.parent = this;\n return false;\n },\n type: name\n }\n };\n}\n//# sourceMappingURL=make-state-datatype.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 = oneFlight;\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/typeof\"));\nvar _weakMap = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/weak-map\"));\nvar _map = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/map\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _lodash = require(\"lodash\");\nvar _templateContainer = _interopRequireDefault(require(\"./template-container\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n// Alias Map and WeakMap to get around a babel compiler bug\nvar W = _weakMap.default;\nvar M = _map.default;\nvar WeakMappedMappedMap = (0, _templateContainer.default)(W, M, M);\nvar flights = new WeakMappedMappedMap();\n\n/**\n * @memberof Util\n * @param {Object} options\n * @param {Function} options.keyFactory\n * @param {boolean} options.cacheFailures\n * @param {boolean} options.cacheSuccesses\n * @returns {Function}\n */\nfunction oneFlight() {\n for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n if (params.length === 3) {\n return (0, _apply.default)(oneFlightDecorator, null, params);\n }\n var options = params[0] || {};\n var cacheFailures = options.cacheFailures,\n cacheSuccesses = options.cacheSuccesses,\n keyFactory = options.keyFactory;\n return oneFlightDecorator;\n\n /**\n * @param {Object} target\n * @param {string} prop\n * @param {Object} descriptor\n * @private\n * @returns {Object}\n */\n function oneFlightDecorator(target, prop, descriptor) {\n var key = prop;\n descriptor.value = (0, _lodash.wrap)(descriptor.value, function oneFlightExecutor(fn) {\n var _this = this;\n var innerKey = key;\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n if (keyFactory) {\n innerKey = \"\".concat(innerKey, \"_\").concat(keyFactory.apply(void 0, args));\n }\n\n /* eslint no-invalid-this: [0] */\n var flight = flights.get(this, target, innerKey);\n if (flight) {\n return flight;\n }\n flight = (0, _apply.default)(fn, this, args);\n if (!cacheFailures && flight && flight.catch) {\n flight = flight.catch(function (reason) {\n flights.delete(_this, target, innerKey);\n return _promise.default.reject(reason);\n });\n }\n if (!cacheSuccesses && flight && flight.then) {\n flight = flight.then(function (result) {\n flights.delete(_this, target, innerKey);\n return result;\n });\n }\n flights.set(this, target, innerKey, flight);\n return flight;\n });\n\n // This *should* make decorators compatible with AmpersandState class\n // definitions\n if ((0, _typeof2.default)(target) === 'object' && !target.prototype) {\n target[prop] = descriptor.value;\n }\n return descriptor;\n }\n}\n//# sourceMappingURL=one-flight.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 */\n/**\n * @description Set of regex patterns to compile once and use throughout the\n * app. All non-prefixed patterns have start/end characters to ensure exact\n * matches. Patterns prefixed with \"exec\" are the same as their non-prefixed\n * counterparts but without the start/end characters so they can be used with\n * methods like `RegExp#exec`.\n */\nvar _default = exports.default = {\n /**\n * Regular express that validates a string is strictly an email.\n * Allows for validation of emails within services such as conversation\n * activities or user details.\n * See [RegEx information here]{@link https://ihateregex.io/expr/email-2}.\n *\n * @type {RegExp}\n */\n email: /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/,\n /**\n * Regular expression that validates an ambiguous string contains emails\n * (one or more) within.\n * See [RegEx information here]{@link https://ihateregex.io/expr/email-2}.\n *\n * @type {RegExp}\n */\n containsEmails: /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/g,\n /**\n * Matches a UUID\n * @type {RegExp}\n */\n uuid: /^[a-f\\d]{8}(?:-[a-f\\d]{4}){3}-[a-f\\d]{12}$/,\n /**\n * Regular expression that validates an ambiguous string contains MTID\n * @type {RegExp}\n */\n containsMTID: /(MTID=)[^&$#]*/g,\n /**\n * Same as this.email, but allows for surrounding characters\n * @type {RegExp}\n */\n execEmail: /[^\\s]+?@[^\\s]+?/,\n /**\n * Same as this.uuid but allows for surrounding characters\n * @type {RegExp}\n */\n execUuid: /[a-f\\d]{8}(?:-[a-f\\d]{4}){3}-[a-f\\d]{12}/\n};\n//# sourceMappingURL=patterns.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 = resolveWith;\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/**\n * Sugar method for returning the desired object at the end of a promise chain\n * @param {any} object the item with which to resolve the promise chain\n * @returns {function}\n * @example\n * var item = {\n * prop: 2\n * };\n * Promise\n * .resolve(item.prop)\n * .then(resolveWith(item))\n * .then(function(res) {\n * require('assert').deepEqual(res, {prop:2});\n * return 'success'\n * })\n * // => success\n *\n */\nfunction resolveWith(object) {\n return function resolver() {\n return _promise.default.resolve(object);\n };\n}\n//# sourceMappingURL=resolve-with.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 = retry;\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _typeof2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/typeof\"));\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/defineProperty\"));\nvar _events = require(\"events\");\nvar _lodash = require(\"lodash\");\nvar _backoff = _interopRequireDefault(require(\"backoff\"));\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/* eslint max-nested-callbacks: [0] */\n/**\n * Makes a promise-returning method retryable according to the specified backoff\n * pattern\n * @param {Object} options\n * @param {boolean} options.backoff\n * @param {number} options.delay\n * @param {number} options.initialDelay\n * @param {number} options.maxAttempts\n * @param {number} options.maxDelay\n *\n * @returns {Function}\n */\nfunction retry() {\n for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {\n params[_key] = arguments[_key];\n }\n var options = params[0] || {};\n options = _objectSpread({}, options);\n (0, _lodash.defaults)(options, {\n backoff: true,\n delay: 1,\n maxAttempts: 3\n });\n var strategyOptions;\n if (options.backoff) {\n strategyOptions = {\n initialDelay: options.delay,\n maxDelay: options.maxDelay\n };\n } else {\n strategyOptions = {\n initialDelay: 1,\n maxDelay: 1\n };\n }\n if (params.length === 3) {\n return (0, _apply.default)(retryDecorator, null, params);\n }\n return retryDecorator;\n\n /**\n * @param {Object} target\n * @param {string} prop\n * @param {Object} descriptor\n * @private\n * @returns {Object}\n */\n function retryDecorator(target, prop, descriptor) {\n descriptor.value = (0, _lodash.wrap)(descriptor.value, function retryExecutor(fn) {\n var _this = this;\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n var emitter = new _events.EventEmitter();\n var promise = new _promise.default(function (resolve, reject) {\n // backoff.call is not Function.prototype.call; it's an unfortunate naming\n // collision.\n /* eslint prefer-reflect: [0] */\n var call = _backoff.default.call(function (cb) {\n /* eslint no-invalid-this: [0] */\n var innerPromise = (0, _apply.default)(fn, _this, args);\n if ((0, _lodash.isFunction)(innerPromise.on)) {\n innerPromise.on('progress', emitter.emit.bind(emitter, 'progress'));\n innerPromise.on('upload-progress', emitter.emit.bind(emitter, 'upload-progress'));\n innerPromise.on('download-progress', emitter.emit.bind(emitter, 'download-progress'));\n }\n return innerPromise.then(function (res) {\n cb(null, res);\n }).catch(function (reason) {\n if (!reason) {\n reason = new Error('retryable method failed without providing an error object');\n }\n cb(reason);\n });\n }, function (err, res) {\n if (err) {\n return reject(err);\n }\n return resolve(res);\n });\n call.setStrategy(new _backoff.default.ExponentialStrategy(strategyOptions));\n if (options.maxAttempts) {\n call.failAfter(options.maxAttempts - 1);\n }\n call.start();\n });\n promise.on = function on(key, callback) {\n emitter.on(key, callback);\n return promise;\n };\n return promise;\n });\n\n // This *should* make decorators compatible with AmpersandState class\n // definitions\n if ((0, _typeof2.default)(target) === 'object' && !target.prototype) {\n target[prop] = descriptor.value;\n }\n return descriptor;\n }\n}\n//# sourceMappingURL=retry.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 = tap;\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/**\n * Injects code into a promise chain without modifying the promise chain's result\n * @param {Function} fn\n * @returns {Promise}\n * @example\n * function f() {\n * return Promise.resolve(5);\n * }\n *\n * f()\n * .then(tap(() => 12))\n * // => 5\n */\nfunction tap(fn) {\n return function (r) {\n return new _promise.default(function (resolve) {\n resolve(fn(r));\n }).then(function () {\n return r;\n }).catch(function () {\n return r;\n });\n };\n}\n//# sourceMappingURL=tap.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 = make;\nvar _construct2 = _interopRequireDefault(require(\"@babel/runtime-corejs2/helpers/construct\"));\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 _util = _interopRequireDefault(require(\"util\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/**\n * Factory which produces a multi-keyed container based on the provided set of\n * constructors\n * @param {mixed} containers\n * @returns {Container}\n */\nfunction make() {\n for (var _len = arguments.length, containers = new Array(_len), _key = 0; _key < _len; _key++) {\n containers[_key] = arguments[_key];\n }\n var TopContainer = containers.shift();\n var data = new _weakMap.default();\n var sizes = new _weakMap.default();\n var ChildContainer = containers.length > 1 ? make.apply(void 0, containers) : containers[0];\n var name = \"(\".concat([TopContainer.name].concat(containers.map(function (container) {\n return container.name;\n })).join(', '), \")\");\n\n /**\n * Container that wraps an arbitrary set of tupples to their values\n */\n var Container = /*#__PURE__*/function () {\n /**\n * @constructs Container\n */\n function Container() {\n (0, _classCallCheck2.default)(this, Container);\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n data.set(this, (0, _construct2.default)(TopContainer, args));\n sizes.set(this, 0);\n }\n\n /**\n * getter for .size\n * @returns {number}\n */\n (0, _createClass2.default)(Container, [{\n key: \"size\",\n get: function get() {\n return sizes.get(this);\n }\n\n /**\n * Identical to Container#set() but leads slightly more intuitive code when\n * the container is based on a Set rather than a Map.\n * @returns {Container}\n */\n }, {\n key: \"add\",\n value: function add() {\n return this.set.apply(this, arguments);\n }\n\n /**\n * Removes all items from the container\n * @returns {undefined}\n */\n }, {\n key: \"clear\",\n value: function clear() {\n var ret = data.get(this).clear();\n sizes.set(this, 0);\n return ret;\n }\n\n /**\n * Removes the specified item to the container\n * @param {mixed} key\n * @param {Array} keys\n * @returns {boolean}\n */\n }, {\n key: \"delete\",\n value: function _delete(key) {\n var mine = data.get(this);\n for (var _len3 = arguments.length, keys = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n keys[_key3 - 1] = arguments[_key3];\n }\n if (!keys.length) {\n return mine.delete(key);\n }\n var next = mine.get(key);\n if (!next) {\n return false;\n }\n var ret = next.delete.apply(next, keys);\n if (ret) {\n sizes.set(this, sizes.get(this) - 1);\n }\n if (next.size === 0) {\n mine.delete(key);\n }\n return ret;\n }\n\n /**\n * Retrieves the specified item from the container\n * @param {mixed} key\n * @param {Array} keys\n * @returns {mixed}\n */\n }, {\n key: \"get\",\n value: function get(key) {\n var mine = data.get(this);\n if (!mine.get) {\n return mine;\n }\n for (var _len4 = arguments.length, keys = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n keys[_key4 - 1] = arguments[_key4];\n }\n if (!keys.length) {\n return mine.get(key);\n }\n var next = mine.get(key);\n if (!next) {\n return undefined;\n }\n if (!next.get) {\n return next;\n }\n return next.get.apply(next, keys);\n }\n\n /**\n * Indicates whether the container holds the specified item\n * @param {mixed} key\n * @param {Array} keys\n * @returns {Boolean}\n */\n }, {\n key: \"has\",\n value: function has() {\n return typeof this.get.apply(this, arguments) !== 'undefined';\n }\n\n /**\n * Stores the specified item in the container\n * @param {mixed} key\n * @param {Array} args\n * @param {mixed} value\n * @returns {Container}\n */\n }, {\n key: \"set\",\n value: function set() {\n var overwrite = false;\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n if (this.has.apply(this, args)) {\n overwrite = true;\n }\n var mine = data.get(this);\n var key = args.shift();\n if (!mine.get) {\n insert.apply(void 0, [mine, key].concat(args));\n return this;\n }\n var next = mine.get(key);\n if (!next) {\n if (!ChildContainer) {\n insert.apply(void 0, [mine, key].concat(args));\n return this;\n }\n next = new ChildContainer();\n insert(mine, key, next);\n }\n insert.apply(void 0, [next].concat(args));\n if (!overwrite) {\n sizes.set(this, sizes.get(this) + 1);\n }\n return this;\n }\n\n /**\n * @private\n * @returns {string}\n */\n }, {\n key: \"inspect\",\n value: function inspect() {\n return \"Container\".concat(name, \" {\\n \").concat(_util.default.inspect(data.get(this), {\n depth: null\n }), \"\\n}\");\n }\n }]);\n return Container;\n }();\n return Container;\n}\n\n/**\n * Inserts into an arbitrary container\n * @param {Map|WeakMap|Set|WeakSet} container\n * @param {Array} args\n * @private\n * @returns {undefined}\n */\nfunction insert(container) {\n for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {\n args[_key6 - 1] = arguments[_key6];\n }\n if (container.add) {\n container.add.apply(container, args);\n return;\n }\n if (container.set) {\n container.set.apply(container, args);\n return;\n }\n if (container.push) {\n container.push.apply(container, args);\n return;\n }\n throw new TypeError('Could not determine how to insert into the specified container');\n}\n//# sourceMappingURL=template-container.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.buildHydraMembershipId = buildHydraMembershipId;\nexports.buildHydraMessageId = buildHydraMessageId;\nexports.buildHydraOrgId = buildHydraOrgId;\nexports.buildHydraPersonId = buildHydraPersonId;\nexports.buildHydraRoomId = buildHydraRoomId;\nexports.constructHydraId = constructHydraId;\nexports.deconstructHydraId = deconstructHydraId;\nexports.getHydraClusterString = getHydraClusterString;\nexports.getHydraFiles = getHydraFiles;\nexports.getHydraRoomType = getHydraRoomType;\nvar _base = require(\"./base64\");\nvar _constants = require(\"./constants\");\nvar hydraBaseUrl = 'https://api.ciscospark.com/v1';\nvar isRequired = function isRequired() {\n throw Error('parameter is required');\n};\n\n/**\n * Constructs a Hydra ID for a given UUID and type.\n *\n * @export\n * @param {string} type one of PEOPLE, TEAM, ROOM\n * @param {any} id identifying the \"TYPE\" object\n * @param {string} cluster containing the \"TYPE\" object\n * @returns {string}\n */\nfunction constructHydraId() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : isRequired();\n var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isRequired();\n var cluster = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'us';\n if (!type.toUpperCase) {\n throw Error('\"type\" must be a string');\n }\n if (type === _constants.hydraTypes.PEOPLE || type === _constants.hydraTypes.ORGANIZATION) {\n // Cluster is always \"us\" for people and orgs\n return (0, _base.encode)(\"ciscospark://us/\".concat(type.toUpperCase(), \"/\").concat(id));\n }\n return (0, _base.encode)(\"ciscospark://\".concat(cluster, \"/\").concat(type.toUpperCase(), \"/\").concat(id));\n}\n\n/**\n * @typedef {Object} DeconstructedHydraId\n * @property {UUID} id identifying the object\n * @property {String} type of the object\n * @property {String} cluster containing the object\n */\n\n/**\n * Deconstructs a Hydra ID.\n *\n * @export\n * @param {String} id Hydra style id\n * @returns {DeconstructedHydraId} deconstructed id\n */\nfunction deconstructHydraId(id) {\n var payload = (0, _base.decode)(id).split('/');\n return {\n id: payload.pop(),\n type: payload.pop(),\n cluster: payload.pop()\n };\n}\n\n/**\n * Constructs a Hydra ID for a message based on internal UUID\n *\n * @export\n * @param {any} uuid\n * @param {string} cluster containing the message\n * @returns {string}\n */\nfunction buildHydraMessageId(uuid, cluster) {\n return constructHydraId(_constants.hydraTypes.MESSAGE, uuid, cluster);\n}\n\n/**\n * Constructs a Hydra ID for a person based on internal UUID\n *\n * @export\n * @param {any} uuid\n * @param {string} cluster containing the person\n * @returns {string}\n */\nfunction buildHydraPersonId(uuid, cluster) {\n return constructHydraId(_constants.hydraTypes.PEOPLE, uuid, cluster);\n}\n\n/**\n * Constructs a Hydra ID for a room based on internal UUID\n *\n * @export\n * @param {any} uuid\n * @param {string} cluster containing the room\n * @returns {string}\n */\nfunction buildHydraRoomId(uuid, cluster) {\n return constructHydraId(_constants.hydraTypes.ROOM, uuid, cluster);\n}\n\n/**\n * Constructs a Hydra ID for an organization based on internal UUID\n *\n * @export\n * @param {any} uuid\n * @param {string} cluster containing the organization\n * @returns {string}\n */\nfunction buildHydraOrgId(uuid, cluster) {\n return constructHydraId(_constants.hydraTypes.ORGANIZATION, uuid, cluster);\n}\n\n/**\n * Constructs a Hydra ID for an membership based on an\n * internal UUID for the person, and the space\n *\n * @export\n * @param {any} personUUID\n * @param {any} spaceUUID\n * @param {string} cluster containing the membership\n * @returns {string}\n */\nfunction buildHydraMembershipId(personUUID, spaceUUID, cluster) {\n return constructHydraId(_constants.hydraTypes.MEMBERSHIP, \"\".concat(personUUID, \":\").concat(spaceUUID), cluster);\n}\n\n/**\n * Returns a hydra cluster string based on a conversation url\n * @private\n * @memberof Messages\n * @param {Object} webex sdk instance\n * @param {String} conversationUrl url of space where activity took place\n * @returns {String} string suitable for UUID -> public ID encoding\n */\nfunction getHydraClusterString(webex, conversationUrl) {\n var internalClusterString = webex.internal.services.getClusterId(conversationUrl);\n if (internalClusterString.startsWith(_constants.INTERNAL_US_CLUSTER_NAME) || internalClusterString.startsWith(_constants.INTERNAL_US_INTEGRATION_CLUSTER_NAME)) {\n // Original US cluster is simply 'us' for backwards compatibility\n return 'us';\n }\n var clusterParts = internalClusterString.split(':');\n if (clusterParts.length < 3) {\n throw Error(\"Unable to determine cluster for convo: \".concat(conversationUrl));\n }\n return \"\".concat(clusterParts[0], \":\").concat(clusterParts[1], \":\").concat(clusterParts[2]);\n}\n\n/**\n * Returns a Hydra roomType based on conversation tags\n *\n * @export\n * @param {arra} tags\n * @returns {string}\n */\nfunction getHydraRoomType(tags) {\n if (tags.includes(_constants.SDK_EVENT.INTERNAL.ACTIVITY_TAG.ONE_ON_ONE)) {\n return _constants.SDK_EVENT.EXTERNAL.SPACE_TYPE.DIRECT;\n }\n return _constants.SDK_EVENT.EXTERNAL.SPACE_TYPE.GROUP;\n}\n\n/**\n * Returns file URLs for the activity, adhering to Hydra details,\n * e.g., https://api.ciscospark.com/v1/contents/Y2lzY29zcGF...\n * @see https://developer.webex.com/docs/api/v1/messages/get-message-details\n * @param {Object} activity from mercury\n * @param {string} cluster containing the files\n * @returns {Array} file URLs\n */\nfunction getHydraFiles(activity, cluster) {\n var hydraFiles = [];\n var files = activity.object.files;\n if (files) {\n var items = files.items;\n\n // Note: Generated ID is dependent on file order.\n for (var i = 0; i < items.length; i += 1) {\n var contentId = constructHydraId(_constants.hydraTypes.CONTENT, \"\".concat(activity.id, \"/\").concat(i), cluster);\n hydraFiles.push(\"\".concat(hydraBaseUrl, \"/contents/\").concat(contentId));\n }\n }\n return hydraFiles;\n}\n//# sourceMappingURL=uuid-utils.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 = whileInFlight;\nvar _promise = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/promise\"));\nvar _apply = _interopRequireDefault(require(\"@babel/runtime-corejs2/core-js/reflect/apply\"));\nvar _lodash = require(\"lodash\");\nvar _tap = _interopRequireDefault(require(\"./tap\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint no-invalid-this: [0] */\n\n/**\n * While the promise returned by the decorated is unfullfilled, sets, the\n * specified boolean on the target class to `true`\n * @param {string} param\n * @returns {Function}\n */\nfunction whileInFlight(param) {\n return function whileInFlightDecorator(target, name, descriptor) {\n descriptor.value = (0, _lodash.wrap)(descriptor.value, function whileInFlightExecutor(fn) {\n var _this = this;\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return new _promise.default(function (resolve) {\n _this[param] = true;\n resolve((0, _apply.default)(fn, _this, args).then((0, _tap.default)(function () {\n _this[param] = false;\n })).catch(function (reason) {\n _this[param] = false;\n return _promise.default.reject(reason);\n }));\n });\n });\n };\n}\n//# sourceMappingURL=while-in-flight.js.map\n","(function(module) {\n 'use strict';\n\n module.exports.is_uri = is_iri;\n module.exports.is_http_uri = is_http_iri;\n module.exports.is_https_uri = is_https_iri;\n module.exports.is_web_uri = is_web_iri;\n // Create aliases\n module.exports.isUri = is_iri;\n module.exports.isHttpUri = is_http_iri;\n module.exports.isHttpsUri = is_https_iri;\n module.exports.isWebUri = is_web_iri;\n\n\n // private function\n // internal URI spitter method - direct from RFC 3986\n var splitUri = function(uri) {\n var splitted = uri.match(/(?:([^:\\/?#]+):)?(?:\\/\\/([^\\/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?/);\n return splitted;\n };\n\n function is_iri(value) {\n if (!value) {\n return;\n }\n\n // check for illegal characters\n if (/[^a-z0-9\\:\\/\\?\\#\\[\\]\\@\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=\\.\\-\\_\\~\\%]/i.test(value)) return;\n\n // check for hex escapes that aren't complete\n if (/%[^0-9a-f]/i.test(value)) return;\n if (/%[0-9a-f](:?[^0-9a-f]|$)/i.test(value)) return;\n\n var splitted = [];\n var scheme = '';\n var authority = '';\n var path = '';\n var query = '';\n var fragment = '';\n var out = '';\n\n // from RFC 3986\n splitted = splitUri(value);\n scheme = splitted[1]; \n authority = splitted[2];\n path = splitted[3];\n query = splitted[4];\n fragment = splitted[5];\n\n // scheme and path are required, though the path can be empty\n if (!(scheme && scheme.length && path.length >= 0)) return;\n\n // if authority is present, the path must be empty or begin with a /\n if (authority && authority.length) {\n if (!(path.length === 0 || /^\\//.test(path))) return;\n } else {\n // if authority is not present, the path must not start with //\n if (/^\\/\\//.test(path)) return;\n }\n\n // scheme must begin with a letter, then consist of letters, digits, +, ., or -\n if (!/^[a-z][a-z0-9\\+\\-\\.]*$/.test(scheme.toLowerCase())) return;\n\n // re-assemble the URL per section 5.3 in RFC 3986\n out += scheme + ':';\n if (authority && authority.length) {\n out += '//' + authority;\n }\n\n out += path;\n\n if (query && query.length) {\n out += '?' + query;\n }\n\n if (fragment && fragment.length) {\n out += '#' + fragment;\n }\n\n return out;\n }\n\n function is_http_iri(value, allowHttps) {\n if (!is_iri(value)) {\n return;\n }\n\n var splitted = [];\n var scheme = '';\n var authority = '';\n var path = '';\n var port = '';\n var query = '';\n var fragment = '';\n var out = '';\n\n // from RFC 3986\n splitted = splitUri(value);\n scheme = splitted[1]; \n authority = splitted[2];\n path = splitted[3];\n query = splitted[4];\n fragment = splitted[5];\n\n if (!scheme) return;\n\n if(allowHttps) {\n if (scheme.toLowerCase() != 'https') return;\n } else {\n if (scheme.toLowerCase() != 'http') return;\n }\n\n // fully-qualified URIs must have an authority section that is\n // a valid host\n if (!authority) {\n return;\n }\n\n // enable port component\n if (/:(\\d+)$/.test(authority)) {\n port = authority.match(/:(\\d+)$/)[0];\n authority = authority.replace(/:\\d+$/, '');\n }\n\n out += scheme + ':';\n out += '//' + authority;\n \n if (port) {\n out += port;\n }\n \n out += path;\n \n if(query && query.length){\n out += '?' + query;\n }\n\n if(fragment && fragment.length){\n out += '#' + fragment;\n }\n \n return out;\n }\n\n function is_https_iri(value) {\n return is_http_iri(value, true);\n }\n\n function is_web_iri(value) {\n return (is_http_iri(value) || is_https_iri(value));\n }\n\n})(module);\n","var indexOf = function (xs, item) {\n if (xs.indexOf) return xs.indexOf(item);\n else for (var i = 0; i < xs.length; i++) {\n if (xs[i] === item) return i;\n }\n return -1;\n};\nvar Object_keys = function (obj) {\n if (Object.keys) return Object.keys(obj)\n else {\n var res = [];\n for (var key in obj) res.push(key)\n return res;\n }\n};\n\nvar forEach = function (xs, fn) {\n if (xs.forEach) return xs.forEach(fn)\n else for (var i = 0; i < xs.length; i++) {\n fn(xs[i], i, xs);\n }\n};\n\nvar defineProp = (function() {\n try {\n Object.defineProperty({}, '_', {});\n return function(obj, name, value) {\n Object.defineProperty(obj, name, {\n writable: true,\n enumerable: false,\n configurable: true,\n value: value\n })\n };\n } catch(e) {\n return function(obj, name, value) {\n obj[name] = value;\n };\n }\n}());\n\nvar globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',\n'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',\n'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',\n'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',\n'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];\n\nfunction Context() {}\nContext.prototype = {};\n\nvar Script = exports.Script = function NodeScript (code) {\n if (!(this instanceof Script)) return new Script(code);\n this.code = code;\n};\n\nScript.prototype.runInContext = function (context) {\n if (!(context instanceof Context)) {\n throw new TypeError(\"needs a 'context' argument.\");\n }\n \n var iframe = document.createElement('iframe');\n if (!iframe.style) iframe.style = {};\n iframe.style.display = 'none';\n \n document.body.appendChild(iframe);\n \n var win = iframe.contentWindow;\n var wEval = win.eval, wExecScript = win.execScript;\n\n if (!wEval && wExecScript) {\n // win.eval() magically appears when this is called in IE:\n wExecScript.call(win, 'null');\n wEval = win.eval;\n }\n \n forEach(Object_keys(context), function (key) {\n win[key] = context[key];\n });\n forEach(globals, function (key) {\n if (context[key]) {\n win[key] = context[key];\n }\n });\n \n var winKeys = Object_keys(win);\n\n var res = wEval.call(win, this.code);\n \n forEach(Object_keys(win), function (key) {\n // Avoid copying circular objects like `top` and `window` by only\n // updating existing context properties or new properties in the `win`\n // that was only introduced after the eval.\n if (key in context || indexOf(winKeys, key) === -1) {\n context[key] = win[key];\n }\n });\n\n forEach(globals, function (key) {\n if (!(key in context)) {\n defineProp(context, key, win[key]);\n }\n });\n \n document.body.removeChild(iframe);\n \n return res;\n};\n\nScript.prototype.runInThisContext = function () {\n return eval(this.code); // maybe...\n};\n\nScript.prototype.runInNewContext = function (context) {\n var ctx = Script.createContext(context);\n var res = this.runInContext(ctx);\n\n if (context) {\n forEach(Object_keys(ctx), function (key) {\n context[key] = ctx[key];\n });\n }\n\n return res;\n};\n\nforEach(Object_keys(Script.prototype), function (name) {\n exports[name] = Script[name] = function (code) {\n var s = Script(code);\n return s[name].apply(s, [].slice.call(arguments, 1));\n };\n});\n\nexports.isContext = function (context) {\n return context instanceof Context;\n};\n\nexports.createScript = function (code) {\n return exports.Script(code);\n};\n\nexports.createContext = Script.createContext = function (context) {\n var copy = new Context();\n if(typeof context === 'object') {\n forEach(Object_keys(context), function (key) {\n copy[key] = context[key];\n });\n }\n return copy;\n};\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 _storageAdapterLocalStorage = _interopRequireDefault(require(\"@webex/storage-adapter-local-storage\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n boundedAdapter: new _storageAdapterLocalStorage.default('webex'),\n unboundedAdapter: _webexCore.MemoryStoreAdapter\n};\n//# sourceMappingURL=config-storage.shim.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 _configStorage = _interopRequireDefault(require(\"./config-storage\"));\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nvar _default = exports.default = {\n hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1',\n credentials: {\n clientType: 'confidential'\n },\n device: {\n validateDomains: true,\n ephemeral: true\n },\n storage: {\n boundedAdapter: _configStorage.default,\n unboundedAdapter: _configStorage.default\n }\n};\n//# sourceMappingURL=config.js.map\n","\"use strict\";\n\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* istanbul ignore else */\nif (!global._babelPolyfill) {\n /* eslint global-require: [0] */\n require('@babel/polyfill');\n}\nmodule.exports = require('./webex');\n\n/**\n * The date and time, specified in ISO 8601 extended offset date/time\n * format (e.g. `2015-10-18T14:26:16+00:00`).\n *\n * @typedef {string} isoDate\n */\n\n/**\n * An email address, as a string.\n * @typedef {string} email\n */\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n\n/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n// Note: this file is written using commonjs instead of import/export to\n// simplify consumption by those less familiar with the current state of\n// JavaScript modularization\n\n/* eslint camelcase: [0] */\n\nrequire('@webex/plugin-authorization');\n// explicitly load wdm, since we're relying on preDiscoveryServices and the\n// url interceptor\nrequire('@webex/internal-plugin-calendar');\nrequire('@webex/internal-plugin-device');\nrequire('@webex/internal-plugin-dss');\nrequire('@webex/internal-plugin-presence');\nrequire('@webex/internal-plugin-support');\nrequire('@webex/internal-plugin-llm');\nrequire('@webex/plugin-attachment-actions');\nrequire('@webex/plugin-device-manager');\nrequire('@webex/plugin-logger');\nrequire('@webex/plugin-meetings');\nrequire('@webex/plugin-messages');\nrequire('@webex/plugin-memberships');\nrequire('@webex/plugin-people');\nrequire('@webex/plugin-rooms');\nrequire('@webex/plugin-teams');\nrequire('@webex/plugin-team-memberships');\nrequire('@webex/plugin-webhooks');\nvar merge = require('lodash/merge');\nvar WebexCore = require('@webex/webex-core').default;\nvar config = require('./config');\n\n// documentation.js puts hashes in relative urls, so need to specify full urls\n// here\n/**\n * See {@link https://webex.github.io/webex-js-sdk/example/browsers|Browser Guide} and\n * {@link https://webex.github.io/webex-js-sdk/example/servers|Server Guide}\n * @see {@link /example/browsers|Browser Guide}\n * @see {@link /example/servers|Server Guide}\n * @class Webex\n */\nvar Webex = WebexCore.extend({\n webex: true,\n version: \"3.7.0-web-workers-keepalive.2\"\n});\n\n/**\n * Create a new {@link Webex} instance\n *\n * @example\n * Create a new Webex instance configured for your OAuth client\n * const webex = Webex.init({\n * config: {\n * credentials: {\n * authorizationString: ``\n * }\n * }\n * });\n *\n * @example\n * Create a new Webex instance configured for a Bot\n * const webex = Webex.init({\n * credentials: ``\n * });\n *\n *\n * @param {Object} attrs\n * @param {Object} attrs.config (optional)\n * @memberof Webex\n * @returns {Webex}\n */\nWebex.init = function init() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n attrs.config = merge({\n sdkType: 'webex'\n }, config, attrs.config); // eslint-disable-line no-param-reassign\n\n return new Webex(attrs);\n};\nmodule.exports = Webex;\n//# sourceMappingURL=webex.js.map\n"],"names":[],"sourceRoot":""}