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pB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oEAAiB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAW;AAC5B,yBAAyB,2DAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,yDAAU;AACvC;AACA;AACA;AACA;AACA;AACA,oBAAoB,8DAAU;AAC9B;AACA;AACA,oBAAoB,8DAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,wDAAW;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAU;AAC1B;AACA;AACA;AACA;AACA;AACA,gBAAgB,8DAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,SAAS;AACzB;AACA;AACA,iBAAiB,8DAAU;AAC3B;AACA;;;;;;;;;;;;;;;;;;;AC9J+C;AAC2B;AACvB;AACF;AAC1C;AACP;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,QAAQ,wDAAW;AACnB,QAAQ,wDAAW;AACnB,QAAQ,wDAAW;AACnB;AACA,iCAAiC,4DAAa;AAC9C;AACA;AACA;AACA,uCAAuC,KAAK,IAAI,MAAM;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,YAAY,wDAAW;AACvB;AACA;AACA,QAAQ,wDAAW,aAAa,uDAAS;AACzC;AACA,YAAY,wDAAW,iBA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P;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACRgD;AACS;AAClD,sCAAsC,kEAAgB;AAC7D;AACA,0BAA0B,wDAAW;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;;;;;;;;;;ACXO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChCU;;;;;;;;;;;;;;;;;;;;;;ACAqC;AACU;AACU;AACF;AACM;AACM;AAChC;AACtC;AACP,YAAY,sDAAU,SAAS,wDAAW;AAC1C,YAAY,sDAAU,gBAAgB,kEAAgB;AACtD,YAAY,sDAAU,uBAAuB,4EAAqB;AAClE,YAAY,sDAAU,oBAAoB,0EAAoB;AAC9D,YAAY,sDAAU,uBAAuB,gFAAuB;AACpE,YAAY,sDAAU,0BAA0B,sFAA0B;AAC1E;;;;;;;;;;;;;;;;;ACdyD;AACN;AAC5C,oCAAoC,kEAAgB;AAC3D;AACA;AACA,gCAAgC,2DAAW;AAC3C;AACA;;;;;;;;;;;;;;;;;ACPuC;AACO;AACvC,+BAA+B,gDAAO;AAC7C;AACA;AACA,gCAAgC,sDAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACpBgD;AACT;AACJ;AACnC;AACA;AACA;AACO,mCAAmC,gDAAO;AACjD;AACA,wBAAwB,wDAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,6CAAG;AACzB;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;;;;ACxB4C;AACL;AAChC,0BAA0B,gDAAO;AACxC;AACA,gCAAgC,oDAAI;AACpC;AACA;;;;;;;;;;;;;;;;;ACNgD;AACT;AAChC,yCAAyC,gDAAO;AACvD;AACA,4BAA4B,wDAAW;AACvC;AACA;;;;;;;;;;;;;;;ACNO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;;;;;;;;;;;;;;;;;ACRD;AACK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACDF;AACC;AACF;AACN;AACK;AACG;AACS;;;;;;;;;;;;;;;;;ACNJ;AACM;AACxC,uBAAuB,kDAAQ;AACtC,gBAAgB,uDAAS;AACzB;;;;;;;;;;;;;;;;ACJqC;AACrC;AACA;AACA;AACO,0BAA0B,8CAAM;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC3DgD;AACP;AACzC;AACA;AACA;AACO,mBAAmB,kDAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wDAAW;AAC3B;AACA;AACA;AACA,oBAAoB,wDAAW;AAC/B;AACA,iDAAiD;AACjD;AACA,wBAAwB,wDAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,wDAAW,YAAY,wDAAW;AAC9C,+BAA+B,wDAAW;AAC1C;AACA;AACA;;;;;;;;;;;;;;;;ACnCgD;AACzC;AACP,YAAY,wDAAW;AACvB,iBAAiB,wDAAW;AAC5B,kBAAkB,wDAAW;AAC7B,uBAAuB,wDAAW;AAClC;;;;;;;;;;;;;;;;;ACNgD;AACP;AAClC,qBAAqB,kDAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB;AACA;AACA;AACA,2BAA2B,wDAAW;AACtC,yBAAyB,wDAAW;AACpC;AACA,YAAY,wDAAW;AACvB,4BAA4B,wDAAW;AACvC,4BAA4B,wDAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,IAAI;AACjB;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACrG8B;AACG;AACP;AACI;AACF;;;;;;;;;;;;;;;ACJ5B;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACO;AACP;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,CAAC,8BAA8B;;;;;;;;;;;;;;;AC9B/B;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACO;AACP;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,CAAC,sCAAsC;;;;;;;;;;;;;;;ACxBvC;AACA;AACA;AACO;AACP;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,CAAC,kCAAkC;;;;;;;;;;;;;;;;;;;;ACtBJ;AACI;AACF;;;;;;;;;;;;;;;ACFjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC3E2C;AACE;AACZ;AACmB;AACpD;AACA;AACA;AACA;AACA;AACA;AACO,kBAAkB,oDAAS;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6DAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA,eAAe,UAAU;AACzB;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,sDAAQ;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,eAAe,QAAQ;AACvB;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gCAAgC,0CAAI;AACpC;AACA;AACA,sBAAsB,sDAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,sDAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAQ,yBAAyB,KAAK;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACvkBO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,YAAY,iBAAiB,iBAAiB;AACvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACzE2C;AACM;AAClB;AACqC;AAC7D,sBAAsB,oDAAS;AACtC;AACA;AACA;AACA,8BAA8B,wCAAG;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mDAAM;AACrC;AACA;AACA;AACA;AACA;AACA,0BAA0B,mDAAM;AAChC;AACA;AACA;AACA;AACA;AACA,qCAAqC,mDAAM;AAC3C;AACA;AACA;AACA;AACA;AACA,4BAA4B,mDAAM;AAClC;AACA;AACA;AACA;AACA;AACA,uCAAuC,mDAAM;AAC7C;AACA;AACA;AACA;AACA;AACA,kCAAkC,mDAAM;AACxC;AACA;AACA;AACA;AACA;AACA,6CAA6C,mDAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mDAAM;AAC/B;AACA;AACA;AACA;AACA;AACA,oCAAoC,mDAAM;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mDAAM;AACjC;AACA;AACA;AACA,yBAAyB,mDAAM;AAC/B,gCAAgC,qEAAwB;AACxD;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA,cAAc,wCAAG;AACjB,sBAAsB,wCAAG;AACzB;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA,sBAAsB,EAAE;AACxB;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;AC/fgH;AAClE;AACa;AACpB;AACvC;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,iBAAiB;AAChC,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,kBAAkB,iEAAkB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8DAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAc;AACjC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA,0BAA0B,gDAAO;AACjC;AACA,wBAAwB,SAAS;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wDAAS;AACvC,oDAAoD,wDAAS;AAC7D,4BAA4B,uDAAU,WAAW,oEAAU,qBAAqB,wDAAS;AACzF,YAAY,6DAAc;AAC1B;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACtEkE;AAC3D;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAa;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAa;AACnC;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC/E2C;AACpC;AACP,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB,YAAY,mDAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC/BU;;;;;;;;;;;;;;;;;;;;;;ACAiC;AACA;AACyC;AAChC;AACc;AACtB;AACY;AACjD;AACP,+BAA+B,6DAAa;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAa,8BAA8B,gBAAgB,aAAa,QAAQ;AACtG;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oDAAO;AAC/B,uBAAuB,uDAAU,QAAQ,uDAAU,qBAAqB,oDAAS;AACjF;AACA,gCAAgC,gEAAe;AAC/C;AACA;AACA;AACA,0BAA0B,oDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,oDAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,2DAAa,mBAAmB,QAAQ,IAAI,IAAI,IAAI,YAAY;AAC1F;AACA,SAAS;AACT;AACA,eAAe,oDAAS;AACxB;AACA;AACA,yBAAyB,oDAAS;AAClC;AACA,wBAAwB,oDAAO;AAC/B,8BAA8B,uDAAU,oCAAoC,oDAAS,CAAC,oDAAM,YAAY,oDAAS,CAAC,oDAAM;AACxH;AACA,wBAAwB,oDAAO;AAC/B,0BAA0B,oDAAS;AACnC;AACA;AACA,gCAAgC,gEAAe;AAC/C;AACA;AACA,0BAA0B,oDAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,oDAAM;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gEAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,2DAAa;AAC3C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACzGmD;AACC;AAC7C;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,qBAAqB;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F,4DAAe;AAC3G;AACA,qFAAqF,4DAAe;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sBAAsB,2DAAa;AACnC;AACA;AACA,sBAAsB,2DAAa;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAa,qBAAqB,gBAAgB;AACxE;AACA;AACA;AACA;;;;;;;;;;;;;;;ACnIO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACR8C;AACS;AAChD;AACP;AACA,eAAe,sDAAU;AACzB;AACA;AACA;AACA,sBAAsB,2DAAa;AACnC;AACA;AACA,qBAAqB,sDAAU;AAC/B;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACd8C;AACO;AACN;AACc;AAChB;AACE;AACwC;AACxB;AACxD;AACP;AACA,SAAS,mDAAM,WAAW,sDAAU;AACpC,SAAS,mDAAM,WAAW,wDAAW;AACrC,SAAS,mDAAM,eAAe,wDAAW;AACzC,SAAS,mDAAM,SAAS,sDAAU;AAClC,SAAS,mDAAM,cAAc,sDAAU;AACvC,SAAS,mDAAM,iBAAiB,sDAAU;AAC1C,SAAS,mDAAM,mBAAmB,wDAAW;AAC7C,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oDAAS,cAAc,oDAAS;AAC7G,qBAAqB,oDAAS;AAC9B,4BAA4B,gBAAgB;AAC5C,iCAAiC,8DAAc,oCAAoC,oDAAS;AAC5F,yBAAyB,oDAAS;AAClC,4CAA4C,sDAAU,oCAAoC,oDAAS,YAAY,oDAAS;AACxH,yBAAyB,oDAAS;AAClC;AACA,wCAAwC,sDAAU,oCAAoC,oDAAS,YAAY,oDAAS;AACpH,6BAA6B,oDAAS;AACtC;AACA,kCAAkC,2DAAa,oCAAoC,aAAa,eAAe,oBAAoB;AACnI;AACA,sDAAsD,kBAAkB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC5GO;AACP;AACA;AACA;AACA,CAAC,gDAAgD;;;;;;;;;;;;;;;;;;;;;;ACJH;AACN;AACK;AACQ;AACQ;AACA;AACP;AAC/C;AACP;AACA;AACA;AACA;AACA;AACA,yBAAyB,sDAAU,qBAAqB,gDAAS;AACjE;AACA;AACA;AACA;AACA,6BAA6B,gDAAS,SAAS,gDAAS;AACxD;AACA,gCAAgC,gDAAS,gBAAgB,gDAAS,iBAAiB,gDAAS;AAC5F;AACA,yCAAyC,gDAAS;AAClD;AACA;AACA;AACA,wBAAwB,8DAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gDAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gDAAS;AAC5C,mCAAmC,gDAAS;AAC5C;AACA;AACA,SAAS;AACT;AACA,iCAAiC,sEAAkB;AACnD;AACA;AACA;AACA,iCAAiC,sEAAkB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,sDAAU,4BAA4B,gDAAS,SAAS,gDAAS;AACvF,iBAAiB,gDAAS;AAC1B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;AACA;AACA;AACA;AACA;AACyB;;;;;;;;;;;;;;;ACjBzB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACyB;;;;;;;;;;;;;;;ACjBzB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACoB;;;;;;;;;;;;;;;ACjBpB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA,+BAA+B,aAAa,aAAa,WAAW,EAAE,IAAI;AAC1E;AACA;AACA;AACwB;;;;;;;;;;;;;;;;;;;;;;AClBW;AACA;AACL;AACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHlC;AACmC;AACD;AACD;AACF;AACN;AACC;AACG;AACC;;;;;;;;;;;;;;;;ACRc;AACrC,+BAA+B,oDAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,UAAU;AACzB,gBAAgB,kBAAkB;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;;;;;;;;;;;;;;;AC1QO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzCU;;;;;;;;;;;;;;;ACAH;AACP;AACA;AACA;AACA;AACA,CAAC,8EAA8E;;;;;;;;;;;;;;;ACLxE;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC5BU;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;ACAkC;AACM;AACK;AAChD,iCAAiC,oDAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,eAAe,EAAE,iCAAiC,EAAE,qBAAqB;AAC3F;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,gEAAe;AACrD,yCAAyC,gEAAe;AACxD,yCAAyC,gEAAe;AACxD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;ACpE6D;AACJ;AACF;AACX;AACrC,uCAAuC,oDAAS;AACvD;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gEAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gEAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,gEAAe;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA,uCAAuC,kEAAgB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wBAAwB,gBAAgB;AACxC;AACA,mCAAmC,kEAAgB,iBAAiB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA,wBAAwB,iCAAiC;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sEAAkB;AAChD;AACA;AACA;AACA,0BAA0B,sEAAkB;AAC5C;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B,sEAAkB;AAC7C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,sEAAkB;AAC7D;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;AC7RA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;;;;;;;;;;;;;;;ACnBpC;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,0BAA0B;;;;;;;;;;;;;;;;ACNY;AAChC;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,gDAAO;AACf,QAAQ,gDAAO;AACf,QAAQ,gDAAO;AACf,QAAQ,gDAAO;AACf;AACA;AACA,SAAS,gDAAO;AAChB,SAAS,gDAAO;AAChB,SAAS,gDAAO;AAChB,SAAS,gDAAO;AAChB;AACA;;;;;;;;;;;;;;;;;ACpB4C;AACM;AAClD;AACA;AACA;AACO,qBAAqB,oDAAS;AACrC;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,0BAA0B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;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,0DAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,gBAAgB;AAChB;AACA;AACA,eAAe,SAAS;AACxB,eAAe,QAAQ;AACvB;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChKU;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAV;AACU;;;;;;;;;;;;ACDA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;;;;;;ACAV;AACwC;AACN;AACL;AACG;AACF;AACD;AACF;AACC;AACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACTM;AACA;AACV;AACA;AACA;AACY;AACM;AACS;AACjB;AACD;AACR;AACG;AACJ;AACG;;;;;;;UCb/B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACsC;AACuB;AACT;AACpD,MAAMyE,QAAQ,GAAG,GAAG;AACpB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,sBAAsB,GAAGC,SAAS,CAACC,iBAAiB,IAAI,CAAC,GAAG,IA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M,KAAK,CAACkO,OAAO,GAAG,OAAO;UACtEuF,IAAI,CAAC3G,aAAa,CAAC,uBAAuB,CAAC,CAAC9M,KAAK,CAACkO,OAAO,GAAG,MAAM;QACnE;QACA,IAAIlB,QAAQ,GAAG9N,QAAQ,CAAC+N,sBAAsB,CAAC,CAAC;QAChDD,QAAQ,CAAC9M,WAAW,CAACuT,IAAI,CAAC;QAC1BnF,eAAe,CAACpO,WAAW,CAACuT,IAAI,CAAC;MAClC;IACD;IAEAvU,QAAQ,CAAC4N,aAAa,CAAC,oBAAoB,CAAC,CAAC9M,KAAK,CAACkO,OAAO,GAAG,OAAO;IACpEhP,QAAQ,CAAC4N,aAAa,CAAC,iCAAiC,CAAC,CAAC9M,KAAK,CAACkO,OAAO,GAAG,MAAM;EACjF,CAAC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACAhP,QAAQ,CAACqD,gBAAgB,CAAC,qBAAqB,EAAE,UAAU+C,CAAC,EAAE;EAC7D,IAAIhC,SAAS,CAACgF,KAAK,EAAE5H,OAAO,CAACC,GAAG,CAAC,oCAAoC,CAAC;EACtEM,QAAQ,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAC/B,CAAC,CAAC,C","sources":["webpack://tcf/./ccpa/src/uspapi.js","webpack://tcf/./ccpa/src/usprivacy-string.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/CallResponder.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/CmpApi.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/CmpApiModel.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/CustomCommands.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/EventListenerQueue.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/SupportedVersions.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/AddEventListenerCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/Command.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/CommandCallback.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/CommandMap.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/GetInAppTCDataCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/GetTCDataCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/GetVendorListCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/PingCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/RemoveEventListenerCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/TCFCommand.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/command/index.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/index.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/Disabled.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/InAppTCData.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/Ping.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/Response.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/TCData.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/response/index.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/status/CmpStatus.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/status/DisplayStatus.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/status/EventStatus.js","webpack://tcf/./node_modules/@iabtcf/cmpapi/lib/mjs/status/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/Cloneable.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/GVL.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/Json.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/TCModel.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/TCString.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/Base64Url.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/BitLength.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/EncodingOptions.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/SegmentEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/SemanticPreEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/BooleanEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/DateEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/FieldEncoderMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/FixedVectorEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/IntEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/LangEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/PurposeRestrictionVectorEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/VectorEncodingType.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/VendorVectorEncoder.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/field/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/sequence/FieldSequence.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/sequence/SegmentSequence.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/sequence/SequenceVersionMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/encoder/sequence/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/errors/DecodingError.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/errors/EncodingError.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/errors/GVLError.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/errors/TCModelError.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/errors/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/BinarySearchTree.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/ConsentLanguages.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/DeviceDisclosure.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/DeviceDisclosureStorageAccessType.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/Fields.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/IntMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/KeyMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/PurposeRestriction.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/PurposeRestrictionVector.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/RestrictionType.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/Segment.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/SegmentIDs.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/Vector.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/ByPurposeVendorMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/Declarations.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/Feature.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/GVLMapItem.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/IDSetMap.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/Purpose.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/Stack.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/Vendor.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/VendorList.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/gvl/index.js","webpack://tcf/./node_modules/@iabtcf/core/lib/mjs/model/index.js","webpack://tcf/webpack/bootstrap","webpack://tcf/webpack/runtime/define property getters","webpack://tcf/webpack/runtime/hasOwnProperty shorthand","webpack://tcf/webpack/runtime/make namespace object","webpack://tcf/./src/index.js"],"sourcesContent":["/**\n * IAB's Reference UspAPI reference implementation\n **/\n\n// import the UsprivacyString class\nimport UsprivacyString from './usprivacy-string';\n\n// global vars\nconst API_VERSION = 1;\nlet pendingCalls = [];\nlet uspString = new UsprivacyString();\n\n// helper functions\nlet getCookie = function(cookiename) {\n var name = cookiename + \"=\";\n var cookiearray = document.cookie.split(';');\n for (var i = 0; i < cookiearray.length; i++) {\n var cookie = cookiearray[i];\n while (cookie.charAt(0) == ' ') {\n cookie = cookie.substring(1);\n }\n if (cookie.indexOf(name) == 0) {\n return cookie.substring(name.length, cookie.length);\n }\n }\n return \"\";\n};\n\n// function to dynamically add the \"__uspapiLocator\" frame to the window\nlet addFrame = function() {\n // if the frame does not already exist\n if (!window.frames['__uspapiLocator']) {\n // in case this is running in the , make sure exists\n // (can't/shouldn't add a frame to the \n if (document.body) {\n // create iframe and append it to \n const iframe = document.createElement('iframe');\n iframe.style.cssText = 'display:none';\n iframe.name = '__uspapiLocator';\n document.body.appendChild(iframe);\n } else {\n /**\n * Wait for the body tag to exist.\n *\n * Since this API \"stub\" is located in the ,\n * setTimeout allows us to inject the iframe more\n * quickly than relying on DOMContentLoaded or\n * other events.\n */\n setTimeout(addFrame, 5);\n }\n }\n}\n\n// add the \"__uspapiLocator\" frame to the window\naddFrame();\n\nlet getuspdata = function(apiver, callback) {\n if (typeof callback === 'function') {\n if (\n apiver !== null &&\n apiver !== undefined &&\n apiver != API_VERSION\n ) {\n if (typeof callback === 'function') \n callback(null, false);\n return;\n }\n\n // Get the data from the storage\n let str1 = null;\n if ((str1 = getCookie(\"usprivacy\"))) {\n if (!uspString.setUsprivacyString(str1)) {\n console.log(\"Warning: uspString not set.\");\n }\n } \n\n // get the uspstring and stuff it into the uspdata object\n let str = uspString.getUsprivacyString();\n if (str) {\n callback(\n {\n version: uspString.getVersion(),\n uspString: str\n },\n true\n );\n } else {\n callback(\n {\n version: null,\n uspString: null\n },\n false\n );\n }\n } else {\n console.error(\"__uspapi: callback parameter not a function\"); \n }\n};\n\n/**\n * U.S. Privacy API implementation\n */\nwindow.__uspapi = new function (win) {\n if (win.__uspapi) {\n try {\n // if the api was already loaded, then use it\n if (win.__uspapi('__uspapi')) {\n return win.__uspapi;\n } else {\n // Making a call to __uspapi with no arguments will return the pending calls;\n pendingCalls = win.__uspapi() || [];\n }\n } catch (nfe) {\n return win.__uspapi;\n }\n }\n\n let api = function (cmd) {\n try {\n return {\n getUSPData: getuspdata,\n __uspapi: function () {\n return true;\n }\n } [cmd].apply(null, [].slice.call(arguments, 1));\n }\n catch (err) {\n console.error(\"__uspapi: Invalid command: \", cmd)\n }\n };\n\n return api;\n} (window);\n\n// register postMessage handler\nfunction __handleUspapiMessage (event) {\n const data = event && event.data && event.data.__uspapiCall;\n if (data) {\n window.__uspapi(data.command, data.version, (returnValue, success) => {\n event.source.postMessage({\n __uspapiReturn: {\n returnValue,\n success,\n callId: data.callId\n }\n }, '*');\n });\n }\n}\n\nwindow.addEventListener('message', __handleUspapiMessage, false);\n","/**\n * usprivacy-string.js\n * \n * Implements class UsprivacyString\n * \n * The class contains the methods to get/set the usprivacy string \n * and a method to get the current version.\n * \n * The usprivacy string as the format: ”vnol” where \n * v = version\n * n = Notice Given\n * o = OptedOut\n * l = lspact (Limited Service Provider Agreement Covered Transaction)\n * Example: “1YYY” Version 1, Notice given, Opted out, LSAPCT in place.\n * Default is null.\n * \n **/\nconst validStringRegExp = /^[1][nNyY-][nNyY-][nNyY-]$/;\n\nclass UsprivacyString {\n constructor() {\n this.version = 1;\n this.baseString = null; // default is null\n }\n \n // getUsprivacyString()\n // return the usprivacy string or null if an error occurs\n getUsprivacyString() {\n return this.baseString;\n }\n \n // setUsprivacyString(newstr)\n // checks for validity of the string before setting internals\n // returns true if success otherwise false\n setUsprivacyString(newstr) {\n let didSet = false;\n if(validStringRegExp.test(newstr)) {\n this.baseString = newstr;\n didSet = true;\n }\n return didSet;\n }\n\n // getVerion()\n // returns the version number\n getVersion () { \n return this.version;\n }\n}\n\nexport default UsprivacyString;","import { TCFCommand } from './command/index.js';\nimport { CommandMap } from './command/CommandMap.js';\nimport { CmpApiModel } from './CmpApiModel.js';\nimport { Disabled } from './response/Disabled.js';\nimport { SupportedVersions } from './SupportedVersions.js';\nexport const API_KEY = '__tcfapi';\nexport class CallResponder {\n callQueue;\n customCommands;\n constructor(customCommands) {\n if (customCommands) {\n /**\n * The addEventListener command and removeEventListener are the only ones\n * that shouldn't be overwritten. The addEventListener command utilizes\n * getTCData command, so overridding the TCData response should happen\n * there.\n */\n let command = TCFCommand.ADD_EVENT_LISTENER;\n if (customCommands?.[command]) {\n throw new Error(`Built-In Custom Commmand for ${command} not allowed: Use ${TCFCommand.GET_TC_DATA} instead`);\n }\n command = TCFCommand.REMOVE_EVENT_LISTENER;\n if (customCommands?.[command]) {\n throw new Error(`Built-In Custom Commmand for ${command} not allowed`);\n }\n /**\n * If `getTCData` custom command handler is specified, we should use it\n * for `addEventListener` and `removeEventListener` commands.\n */\n if (customCommands?.[TCFCommand.GET_TC_DATA]) {\n customCommands[TCFCommand.ADD_EVENT_LISTENER] = customCommands[TCFCommand.GET_TC_DATA];\n customCommands[TCFCommand.REMOVE_EVENT_LISTENER] = customCommands[TCFCommand.GET_TC_DATA];\n }\n this.customCommands = customCommands;\n }\n /**\n * Attempt to grab the queue – we could call ping and see if it is the stub,\n * but instead we'll just a feature-detection method of just trying to get\n * a queue by calling the function with no parameters and see if we get a\n * queue back. If there is no stub or the stub doesn't return the queue by\n * calling with no arguments, then we'll just move on and create our\n * function.\n */\n try {\n // get queued commands\n this.callQueue = window[API_KEY]() || [];\n }\n catch (err) {\n this.callQueue = [];\n }\n finally {\n window[API_KEY] = this.apiCall.bind(this);\n this.purgeQueuedCalls();\n }\n }\n /**\n * Handler for all page call commands\n * @param {string} command\n * @param {number} version\n * @param {CommandCallback} callback\n * @param {any} params\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n apiCall(command, version, callback, ...params) {\n if (typeof command !== 'string') {\n callback(null, false);\n }\n else if (!SupportedVersions.has(version)) {\n /**\n * Loosely checking version here on purpose. If a string is passed\n * that's probably ok, we don't need strict adherence here.\n */\n callback(null, false);\n }\n else if (typeof callback !== 'function') {\n throw new Error('invalid callback function');\n }\n else if (CmpApiModel.disabled) {\n callback(new Disabled(), false);\n }\n else if (!this.isCustomCommand(command) && !this.isBuiltInCommand(command)) {\n /**\n * This check is here just because the call shouldn't be queued if it's\n * something we know isn't going to work. It's kind of like breaking off a bad\n * relationshipthe instant you know things are not going to work out\n * instead of letting it linger.\n */\n callback(null, false);\n }\n else if (this.isCustomCommand(command) && !this.isBuiltInCommand(command)) {\n this.customCommands[command](callback, ...params);\n }\n else if (command === TCFCommand.PING) {\n /**\n * if it's a ping we always respond right away regardless of our tcModel\n * status or other things.\n */\n if (this.isCustomCommand(command)) {\n new CommandMap[command](this.customCommands[command], params[0], null, callback);\n }\n else {\n new CommandMap[command](callback, params[0]);\n }\n /**\n * tcModel will be either:\n * 1. undefined - update has not been called\n * 2. null - gdpr does not apply\n * 3. Valid TCModel - gdpr applies and update was called\n */\n }\n else if (CmpApiModel.tcModel === undefined) {\n /**\n * If we are still waiting for the TC data to be set we can push this\n * onto the queue that we have and once the model is set it'll be called\n */\n this.callQueue.push([command, version, callback, ...params]);\n }\n else if (this.isCustomCommand(command) && this.isBuiltInCommand(command)) {\n new CommandMap[command](this.customCommands[command], params[0], null, callback);\n }\n else {\n /**\n * at this point we know the command exists and we are free to call it\n */\n new CommandMap[command](callback, params[0]);\n }\n }\n /**\n * purgeQueuedCalls - if there have been calls that are queued up this method\n * will go through and call them in a FIFO order\n *\n * @return {void}\n */\n purgeQueuedCalls() {\n const queueCopy = this.callQueue;\n this.callQueue = [];\n queueCopy.forEach((args) => {\n window[API_KEY](...args);\n });\n }\n /**\n * Checks to see if the command exists in the set of custom commands\n *\n * @param {string} command - command to check\n * @return {boolean} - whether or not this command is a custom command\n */\n isCustomCommand(command) {\n return ((this.customCommands && typeof this.customCommands[command] === 'function'));\n }\n /**\n * Checks to see if the command exists in the set of TCF Commands\n *\n * @param {string} command - command to check\n * @return {boolean} - whether or not this command is a built-in command\n */\n isBuiltInCommand(command) {\n return ((CommandMap[command] !== undefined));\n }\n}\n","import { CmpApiModel } from './CmpApiModel.js';\nimport { CmpStatus, DisplayStatus, EventStatus } from './status/index.js';\nimport { CallResponder } from './CallResponder.js';\nimport { TCString, TCModel } from '@iabtcf/core';\nexport class CmpApi {\n callResponder;\n isServiceSpecific;\n numUpdates = 0;\n /**\n * @param {number} cmpId - IAB assigned CMP ID\n * @param {number} cmpVersion - integer version of the CMP\n * @param {boolean} isServiceSpecific - whether or not this cmp is configured to be service specific\n * @param {CustomCommands} [customCommands] - custom commands from the cmp\n */\n constructor(cmpId, cmpVersion, isServiceSpecific = false, customCommands) {\n this.throwIfInvalidInt(cmpId, 'cmpId', 2);\n this.throwIfInvalidInt(cmpVersion, 'cmpVersion', 0);\n CmpApiModel.cmpId = cmpId;\n CmpApiModel.cmpVersion = cmpVersion;\n CmpApiModel.tcfPolicyVersion = 2;\n this.isServiceSpecific = !!isServiceSpecific;\n this.callResponder = new CallResponder(customCommands);\n }\n throwIfInvalidInt(value, name, minValue) {\n if (!(typeof value === 'number' && Number.isInteger(value) && value >= minValue)) {\n throw new Error(`Invalid ${name}: ${value}`);\n }\n }\n /**\n * update - When the state of a CMP changes this function should be called\n * with the updated tc string and whether or not the UI is visible or not\n *\n * @param {string|null} encodedTCString - set a string to signal that\n * gdprApplies and that an encoded tc string is being passed. If GDPR does\n * not apply, set to null.\n * @param {boolean} uiVisible - default false. set to true if the ui is\n * being shown with this tc string update, this will set the correct values\n * for eventStatus and displayStatus.\n * @return {void}\n */\n update(encodedTCString, uiVisible = false) {\n if (CmpApiModel.disabled) {\n throw new Error('CmpApi Disabled');\n }\n CmpApiModel.cmpStatus = CmpStatus.LOADED;\n if (uiVisible) {\n CmpApiModel.displayStatus = DisplayStatus.VISIBLE;\n CmpApiModel.eventStatus = EventStatus.CMP_UI_SHOWN;\n }\n else {\n if (CmpApiModel.tcModel === undefined) {\n CmpApiModel.displayStatus = DisplayStatus.DISABLED;\n CmpApiModel.eventStatus = EventStatus.TC_LOADED;\n }\n else {\n CmpApiModel.displayStatus = DisplayStatus.HIDDEN;\n CmpApiModel.eventStatus = EventStatus.USER_ACTION_COMPLETE;\n }\n }\n CmpApiModel.gdprApplies = (encodedTCString !== null);\n if (!CmpApiModel.gdprApplies) {\n CmpApiModel.tcModel = null;\n }\n else {\n if (encodedTCString === '') {\n CmpApiModel.tcModel = new TCModel();\n CmpApiModel.tcModel.cmpId = CmpApiModel.cmpId;\n CmpApiModel.tcModel.cmpVersion = CmpApiModel.cmpVersion;\n }\n else {\n CmpApiModel.tcModel = TCString.decode(encodedTCString);\n }\n CmpApiModel.tcModel.isServiceSpecific = this.isServiceSpecific;\n CmpApiModel.tcfPolicyVersion = Number(CmpApiModel.tcModel.policyVersion);\n CmpApiModel.tcString = encodedTCString;\n }\n if (this.numUpdates === 0) {\n /**\n * Will make AddEventListener Commands respond immediately.\n */\n this.callResponder.purgeQueuedCalls();\n }\n else {\n /**\n * Should be no queued calls and only any addEventListener commands\n */\n CmpApiModel.eventQueue.exec();\n }\n this.numUpdates++;\n }\n /**\n * Disables the CmpApi from serving anything but ping and custom commands\n * Cannot be undone\n *\n * @return {void}\n */\n disable() {\n CmpApiModel.disabled = true;\n CmpApiModel.cmpStatus = CmpStatus.ERROR;\n }\n}\n","import { CmpStatus, DisplayStatus } from './status/index.js';\nimport { EventListenerQueue } from './EventListenerQueue.js';\n/**\n * Class holds shareable data across cmp api and provides change event listener for TcModel.\n * Within the context of the CmpApi, this class acts much like a global state or database,\n * where CmpApi sets data and Commands read the data.\n */\nexport class CmpApiModel {\n static apiVersion = '2';\n static tcfPolicyVersion;\n static eventQueue = new EventListenerQueue();\n static cmpStatus = CmpStatus.LOADING;\n static disabled = false;\n static displayStatus = DisplayStatus.HIDDEN;\n static cmpId;\n static cmpVersion;\n static eventStatus;\n static gdprApplies;\n static tcModel;\n static tcString;\n static reset() {\n delete this.cmpId;\n delete this.cmpVersion;\n delete this.eventStatus;\n delete this.gdprApplies;\n delete this.tcModel;\n delete this.tcString;\n delete this.tcfPolicyVersion;\n this.cmpStatus = CmpStatus.LOADING;\n this.disabled = false;\n this.displayStatus = DisplayStatus.HIDDEN;\n this.eventQueue.clear();\n }\n}\n","export {};\n","import { GetTCDataCommand } from './command/GetTCDataCommand.js';\nexport class EventListenerQueue {\n eventQueue = new Map();\n queueNumber = 0;\n add(eventItems) {\n this.eventQueue.set(this.queueNumber, eventItems);\n return this.queueNumber++;\n }\n remove(listenerId) {\n return this.eventQueue.delete(listenerId);\n }\n exec() {\n this.eventQueue.forEach((eventItem, listenerId) => {\n new GetTCDataCommand(eventItem.callback, eventItem.param, listenerId, eventItem.next);\n });\n }\n clear() {\n this.queueNumber = 0;\n this.eventQueue.clear();\n }\n get size() {\n return this.eventQueue.size;\n }\n}\n","export class SupportedVersions {\n static set_ = new Set([0, 2, undefined, null]);\n static has(value) {\n if (typeof value === 'string') {\n value = Number(value);\n }\n return this.set_.has(value);\n }\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nimport { GetTCDataCommand } from './GetTCDataCommand.js';\nexport class AddEventListenerCommand extends GetTCDataCommand {\n respond() {\n this.listenerId = CmpApiModel.eventQueue.add({\n callback: this.callback,\n param: this.param,\n next: this.next,\n });\n super.respond();\n }\n}\n","export class Command {\n listenerId;\n callback;\n next;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n param;\n success = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(callback, param, listenerId, next) {\n Object.assign(this, {\n callback,\n listenerId,\n param,\n next,\n });\n try {\n this.respond();\n }\n catch (error) {\n this.invokeCallback(null);\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n invokeCallback(response) {\n const success = response !== null;\n if (typeof this.next === 'function') {\n this.callback(this.next, response, success);\n }\n else {\n this.callback(response, success);\n }\n }\n}\n","export {};\n","import { PingCommand } from './PingCommand.js';\nimport { GetTCDataCommand } from './GetTCDataCommand.js';\nimport { GetInAppTCDataCommand } from './GetInAppTCDataCommand.js';\nimport { GetVendorListCommand } from './GetVendorListCommand.js';\nimport { AddEventListenerCommand } from './AddEventListenerCommand.js';\nimport { RemoveEventListenerCommand } from './RemoveEventListenerCommand.js';\nimport { TCFCommand } from './TCFCommand.js';\nexport class CommandMap {\n static [TCFCommand.PING] = PingCommand;\n static [TCFCommand.GET_TC_DATA] = GetTCDataCommand;\n static [TCFCommand.GET_IN_APP_TC_DATA] = GetInAppTCDataCommand;\n static [TCFCommand.GET_VENDOR_LIST] = GetVendorListCommand;\n static [TCFCommand.ADD_EVENT_LISTENER] = AddEventListenerCommand;\n static [TCFCommand.REMOVE_EVENT_LISTENER] = RemoveEventListenerCommand;\n}\n","import { GetTCDataCommand } from './GetTCDataCommand.js';\nimport { InAppTCData } from '../response/index.js';\nexport class GetInAppTCDataCommand extends GetTCDataCommand {\n respond() {\n this.throwIfParamInvalid();\n this.invokeCallback(new InAppTCData(this.param));\n }\n}\n","import { Command } from './Command.js';\nimport { TCData } from '../response/index.js';\nexport class GetTCDataCommand extends Command {\n respond() {\n this.throwIfParamInvalid();\n this.invokeCallback(new TCData(this.param, this.listenerId));\n }\n throwIfParamInvalid() {\n /**\n * if they have passed something in as a parameter we'll need to see if\n * it's usable. If not then we'll need to throw an error. Check to see if\n * the array is not undefined and is an array of integers, otherwise it's\n * unusable\n */\n if (this.param !== undefined &&\n (!Array.isArray(this.param) ||\n !this.param.every(Number.isInteger))) {\n throw new Error('Invalid Parameter');\n }\n }\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nimport { Command } from './Command.js';\nimport { GVL } from '@iabtcf/core';\n/**\n * Gets a version of the Global Vendors List\n */\nexport class GetVendorListCommand extends Command {\n respond() {\n const tcModel = CmpApiModel.tcModel;\n const tcModelVersion = tcModel.vendorListVersion;\n let gvl;\n if (this.param === undefined) {\n this.param = tcModelVersion;\n }\n if (this.param === tcModelVersion && tcModel.gvl) {\n gvl = tcModel.gvl;\n }\n else {\n gvl = new GVL(this.param);\n }\n gvl.readyPromise.then(() => {\n this.invokeCallback(gvl.getJson());\n });\n }\n}\n","import { Ping } from '../response/index.js';\nimport { Command } from './Command.js';\nexport class PingCommand extends Command {\n respond() {\n this.invokeCallback(new Ping());\n }\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nimport { Command } from './Command.js';\nexport class RemoveEventListenerCommand extends Command {\n respond() {\n this.invokeCallback(CmpApiModel.eventQueue.remove(this.param));\n }\n}\n","export var TCFCommand;\n(function (TCFCommand) {\n TCFCommand[\"PING\"] = \"ping\";\n TCFCommand[\"GET_TC_DATA\"] = \"getTCData\";\n TCFCommand[\"GET_IN_APP_TC_DATA\"] = \"getInAppTCData\";\n TCFCommand[\"GET_VENDOR_LIST\"] = \"getVendorList\";\n TCFCommand[\"ADD_EVENT_LISTENER\"] = \"addEventListener\";\n TCFCommand[\"REMOVE_EVENT_LISTENER\"] = \"removeEventListener\";\n})(TCFCommand || (TCFCommand = {}));\n","export * from './TCFCommand.js';\nexport * from './CommandCallback.js';\n","export * from './command/index.js';\nexport * from './response/index.js';\nexport * from './status/index.js';\nexport * from './CmpApi.js';\nexport * from './CmpApiModel.js';\nexport * from './CustomCommands.js';\nexport { API_KEY } from './CallResponder.js';\n","import { Response } from './Response.js';\nimport { CmpStatus } from '../status/index.js';\nexport class Disabled extends Response {\n cmpStatus = CmpStatus.ERROR;\n}\n","import { TCData } from './TCData.js';\n/**\n * InAppTCData response builder\n */\nexport class InAppTCData extends TCData {\n constructor(vendorIds) {\n super(vendorIds);\n delete this.outOfBand;\n }\n /**\n * Creates a string bit field with a value for each id where each value is '1' if its id is in the passed in vector\n * @override\n * @param {Vector} vector\n * @return {string}\n */\n createVectorField(vector) {\n return [...vector].reduce((str, tpl) => {\n str += tpl[1] ? '1' : '0';\n return str;\n }, '');\n }\n /**\n * Creates a restrictions object given a PurposeRestrictionVector\n * @override\n * @param {PurposeRestrictionVector} purpRestrictions\n * @return {Restrictions}\n */\n createRestrictions(purpRestrictions) {\n const retr = {};\n if (purpRestrictions.numRestrictions > 0) {\n const maxVendorId = purpRestrictions.getMaxVendorId();\n /**\n * First create a string of empty values for each purpose that is long\n * enough to contain up to the max vendor id\n */\n purpRestrictions.getRestrictions().forEach((pRestrict) => {\n retr[pRestrict.purposeId.toString()] = '_'.repeat(maxVendorId);\n });\n /**\n * go through all of the vendor ids and insert their restriction type\n * number at the index of their vendor id on the purposeID string\n */\n for (let i = 0; i < maxVendorId; i++) {\n // offset by one\n const vendorId = i + 1;\n // Gets a list of purpose restrictions for this vendor\n purpRestrictions.getRestrictions(vendorId).forEach((pRestrict) => {\n const strType = pRestrict.restrictionType.toString();\n const strPurp = pRestrict.purposeId.toString();\n // insert the restriction type at the index of the vendor ID\n const firstPart = retr[strPurp].substr(0, i);\n const lastPart = retr[strPurp].substr(i + 1);\n retr[strPurp] = firstPart + strType + lastPart;\n });\n }\n }\n return retr;\n }\n ;\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nimport { Response } from './Response.js';\n/**\n * Ping response builder\n */\nexport class Ping extends Response {\n /**\n * true - CMP main script is loaded\n * false - still running stub\n */\n cmpLoaded = true;\n /**\n * see Ping Status Codes in following table\n */\n cmpStatus = CmpApiModel.cmpStatus;\n /**\n * see Ping Status Codes in following table\n */\n displayStatus = CmpApiModel.displayStatus;\n /**\n * version of the CMP API that is supported; e.g. “2”\n */\n apiVersion = String(CmpApiModel.apiVersion);\n /**\n * Version of the GVL currently loaded by the CMP\n * undefined if still the stub\n */\n gvlVersion;\n constructor() {\n super();\n // only if the tcModel is defined\n if (CmpApiModel.tcModel && CmpApiModel.tcModel.vendorListVersion) {\n this.gvlVersion = +CmpApiModel.tcModel.vendorListVersion;\n }\n }\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nexport class Response {\n cmpId = CmpApiModel.cmpId;\n cmpVersion = CmpApiModel.cmpVersion;\n gdprApplies = CmpApiModel.gdprApplies;\n tcfPolicyVersion = CmpApiModel.tcfPolicyVersion;\n}\n","import { CmpApiModel } from '../CmpApiModel.js';\nimport { Response } from './Response.js';\nexport class TCData extends Response {\n tcString;\n listenerId;\n eventStatus;\n cmpStatus;\n isServiceSpecific;\n useNonStandardStacks;\n publisherCC;\n purposeOneTreatment;\n outOfBand;\n purpose;\n vendor;\n specialFeatureOptins;\n publisher;\n /**\n * Constructor to create a TCData object from a TCModel\n * @param {number[]} vendorIds - if not undefined, will be used to filter vendor ids\n * @param {number} listenerId - if there is a listenerId to add\n */\n constructor(vendorIds, listenerId) {\n super();\n this.eventStatus = CmpApiModel.eventStatus;\n this.cmpStatus = CmpApiModel.cmpStatus;\n this.listenerId = listenerId;\n if (CmpApiModel.gdprApplies) {\n const tcModel = CmpApiModel.tcModel;\n this.tcString = CmpApiModel.tcString;\n this.isServiceSpecific = tcModel.isServiceSpecific;\n this.useNonStandardStacks = tcModel.useNonStandardStacks;\n this.purposeOneTreatment = tcModel.purposeOneTreatment;\n this.publisherCC = tcModel.publisherCountryCode;\n this.outOfBand = {\n allowedVendors: this.createVectorField(tcModel.vendorsAllowed, vendorIds),\n disclosedVendors: this.createVectorField(tcModel.vendorsDisclosed, vendorIds),\n };\n this.purpose = {\n consents: this.createVectorField(tcModel.purposeConsents),\n legitimateInterests: this.createVectorField(tcModel.purposeLegitimateInterests),\n };\n this.vendor = {\n consents: this.createVectorField(tcModel.vendorConsents, vendorIds),\n legitimateInterests: this.createVectorField(tcModel.vendorLegitimateInterests, vendorIds),\n };\n this.specialFeatureOptins = this.createVectorField(tcModel.specialFeatureOptins);\n this.publisher = {\n consents: this.createVectorField(tcModel.publisherConsents),\n legitimateInterests: this.createVectorField(tcModel.publisherLegitimateInterests),\n customPurpose: {\n consents: this.createVectorField(tcModel.publisherCustomConsents),\n legitimateInterests: this.createVectorField(tcModel.publisherCustomLegitimateInterests),\n },\n restrictions: this.createRestrictions(tcModel.publisherRestrictions),\n };\n }\n }\n /**\n * Creates a restrictions object given a PurposeRestrictionVector\n * @param {PurposeRestrictionVector} purpRestrictions\n * @return {Restrictions}\n */\n createRestrictions(purpRestrictions) {\n const retr = {};\n if (purpRestrictions.numRestrictions > 0) {\n const max = purpRestrictions.getMaxVendorId();\n for (let vendorId = 1; vendorId <= max; vendorId++) {\n const strVendorId = vendorId.toString();\n // vendors restrictions\n purpRestrictions.getRestrictions(vendorId).forEach((pRestrict) => {\n const strPurpId = pRestrict.purposeId.toString();\n if (!retr[strPurpId]) {\n retr[strPurpId] = {};\n }\n retr[strPurpId][strVendorId] = pRestrict.restrictionType;\n });\n }\n }\n return retr;\n }\n ;\n /**\n * Creates a string bit field with a value for each id where each value is\n * '1' if its id is in the passed in vector Can be overwritten to return a\n * string\n * @param {Vector} vector\n * @param {number[]} ids filter\n * @return {BooleanVector | string}\n */\n createVectorField(vector, ids) {\n if (ids) {\n return ids.reduce((booleanVector, obj) => {\n booleanVector[String(obj)] = vector.has(Number(obj));\n return booleanVector;\n }, {});\n }\n return [...vector].reduce((booleanVector, keys) => {\n booleanVector[keys[0].toString(10)] = keys[1];\n return booleanVector;\n }, {});\n }\n}\n","export * from './Disabled.js';\nexport * from './InAppTCData.js';\nexport * from './Ping.js';\nexport * from './Response.js';\nexport * from './TCData.js';\n","/**\n * An enum representing all the possible statuses for the cmpStatus returned\n * through the CMP API\n *\n * @readonly\n * @enum {string}\n */\nexport var CmpStatus;\n(function (CmpStatus) {\n /**\n * CMP not yet loaded – stub still in place\n * @type {string}\n */\n CmpStatus[\"STUB\"] = \"stub\";\n /**\n * CMP is loading\n * @type {string}\n */\n CmpStatus[\"LOADING\"] = \"loading\";\n /**\n * CMP is finished loading\n * @type {string}\n */\n CmpStatus[\"LOADED\"] = \"loaded\";\n /**\n * CMP is in an error state. A CMP shall not respond to any other API requests if this cmpStatus is present.\n * A CMP may set this status if, for any reason, it is unable to perform the operations in compliance with the TCF.\n * @type {string}\n */\n CmpStatus[\"ERROR\"] = \"error\";\n})(CmpStatus || (CmpStatus = {}));\n","/**\n * An enum representing all the possible statuses for the displayStatus\n * returned through the CMP API\n *\n * @readonly\n * @enum {string}\n */\nexport var DisplayStatus;\n(function (DisplayStatus) {\n /**\n * User interface is currently displayed\n * @type {string}\n */\n DisplayStatus[\"VISIBLE\"] = \"visible\";\n /**\n * User interface is not yet or no longer displayed\n * @type {string}\n */\n DisplayStatus[\"HIDDEN\"] = \"hidden\";\n /**\n * User interface will not show (e.g. GDPR does not apply or TC data is current and does not need renewal)\n * @type {string}\n */\n DisplayStatus[\"DISABLED\"] = \"disabled\";\n})(DisplayStatus || (DisplayStatus = {}));\n","/**\n * EventStatus enum represents the possible values of the eventStatus property of the TCData\n */\nexport var EventStatus;\n(function (EventStatus) {\n /**\n * A CMP is loaded and is prepared to surface a TC String to any calling scripts on the page\n * @type {string}\n */\n EventStatus[\"TC_LOADED\"] = \"tcloaded\";\n /**\n * The UI is surfaced or re-surfaced\n * And TC String is available and has rendered \"Transparency\" in accordance with the TCF Policy.\n * @type {string}\n */\n EventStatus[\"CMP_UI_SHOWN\"] = \"cmpuishown\";\n /**\n * User has confirmed or re-confirmed their choices in accordance with TCF Policy\n * and a CMP is prepared to respond to any calling scripts with the corresponding TC String.\n * @type {string}\n */\n EventStatus[\"USER_ACTION_COMPLETE\"] = \"useractioncomplete\";\n})(EventStatus || (EventStatus = {}));\n","export * from './CmpStatus.js';\nexport * from './DisplayStatus.js';\nexport * from './EventStatus.js';\n","/**\n * Abstract Class Cloneable can be extended to give the child class the ability to clone its self.\n * The child class must pass its class to super. You can then pass any needed arguments to help build\n * the cloned class to the protected _clone() method.\n *\n * Example:\n *\n * class Example extends Cloneable {\n *\n * }\n * Todo: There must be more non primitive build in types to check. But for our current purposes, this works great.\n */\nexport class Cloneable {\n /**\n * clone - returns a copy of the classes with new values and not references\n *\n * @return {T}\n */\n clone() {\n const myClone = new this.constructor();\n const keys = Object.keys(this);\n keys.forEach((key) => {\n const value = this.deepClone(this[key]);\n if (value !== undefined) {\n myClone[key] = value;\n }\n });\n return myClone;\n }\n ;\n /**\n * deepClone - recursive function that makes copies of reference values\n *\n * @param {unknown} item\n * @return {unknown}\n */\n deepClone(item) {\n const itsType = typeof item;\n if (itsType === 'number' || itsType === 'string' || itsType === 'boolean') {\n return item;\n }\n else if (item !== null && itsType === 'object') {\n if (typeof item.clone === 'function') {\n return item.clone();\n }\n else if (item instanceof Date) {\n return new Date(item.getTime());\n }\n else if (item[Symbol.iterator] !== undefined) {\n const ar = [];\n for (const subItem of item) {\n ar.push(this.deepClone(subItem));\n }\n if (item instanceof Array) {\n return ar;\n }\n else {\n return new item.constructor(ar);\n }\n }\n else {\n const retr = {};\n for (const prop in item) {\n if (item.hasOwnProperty(prop)) {\n retr[prop] = this.deepClone(item[prop]);\n }\n }\n return retr;\n }\n }\n /**\n * ignore functions because those will be initialized with the cloning\n * process\n */\n }\n}\n","import { Cloneable } from './Cloneable.js';\nimport { GVLError } from './errors/index.js';\nimport { Json } from './Json.js';\nimport { ConsentLanguages } from './model/index.js';\n/**\n * class with utilities for managing the global vendor list. Will use JSON to\n * fetch the vendor list from specified url and will serialize it into this\n * object and provide accessors. Provides ways to group vendors on the list by\n * purpose and feature.\n */\nexport class GVL extends Cloneable {\n static LANGUAGE_CACHE = new Map();\n static CACHE = new Map();\n static LATEST_CACHE_KEY = 0;\n static DEFAULT_LANGUAGE = 'EN';\n /**\n * Set of available consent languages published by the IAB\n */\n static consentLanguages = new ConsentLanguages();\n static baseUrl_;\n /**\n * baseUrl - Entities using the vendor-list.json are required by the iab to\n * host their own copy of it to reduce the load on the iab's infrastructure\n * so a 'base' url must be set to be put together with the versioning scheme\n * of the filenames.\n *\n * @static\n * @param {string} url - the base url to load the vendor-list.json from. This is\n * broken out from the filename because it follows a different scheme for\n * latest file vs versioned files.\n *\n * @throws {GVLError} - If the url is http[s]://vendorlist.consensu.org/...\n * this will throw an error. IAB Europe requires that that CMPs and Vendors\n * cache their own copies of the GVL to minimize load on their\n * infrastructure. For more information regarding caching of the\n * vendor-list.json, please see [the TCF documentation on 'Caching the Global\n * Vendor List'\n * ](https://github.com/InteractiveAdvertisingBureau/GDPR-Transparency-and-Consent-Framework/blob/master/TCFv2/IAB%20Tech%20Lab%20-%20Consent%20string%20and%20vendor%20list%20formats%20v2.md#caching-the-global-vendor-list)\n */\n static set baseUrl(url) {\n const notValid = /^https?:\\/\\/vendorlist\\.consensu\\.org\\//;\n if (notValid.test(url)) {\n throw new GVLError('Invalid baseUrl! You may not pull directly from vendorlist.consensu.org and must provide your own cache');\n }\n // if a trailing slash was forgotten\n if (url.length > 0 && url[url.length - 1] !== '/') {\n url += '/';\n }\n this.baseUrl_ = url;\n }\n ;\n /**\n * baseUrl - Entities using the vendor-list.json are required by the iab to\n * host their own copy of it to reduce the load on the iab's infrastructure\n * so a 'base' url must be set to be put together with the versioning scheme\n * of the filenames.\n *\n * @static\n * @return {string} - returns the previously set baseUrl, the default is\n * `undefined`\n */\n static get baseUrl() {\n return this.baseUrl_;\n }\n /**\n * @static\n * @param {string} - the latest is assumed to be vendor-list.json because\n * that is what the iab uses, but it could be different... if you want\n */\n static latestFilename = 'vendor-list.json';\n /**\n * @static\n * @param {string} - the versioned name is assumed to be\n * vendor-list-v[VERSION].json where [VERSION] will be replaced with the\n * specified version. But it could be different... if you want just make\n * sure to include the [VERSION] macro if you have a numbering scheme, it's a\n * simple string substitution.\n *\n * eg.\n * ```javascript\n * GVL.baseUrl = \"http://www.mydomain.com/iabcmp/\";\n * GVL.versionedFilename = \"vendorlist?getVersion=[VERSION]\";\n * ```\n */\n static versionedFilename = 'archives/vendor-list-v[VERSION].json';\n /**\n * @param {string} - Translations of the names and descriptions for Purposes,\n * Special Purposes, Features, and Special Features to non-English languages\n * are contained in a file where attributes containing English content\n * (except vendor declaration information) are translated. The iab publishes\n * one following the scheme below where the LANG is the iso639-1 language\n * code. For a list of available translations\n * [please go here](https://register.consensu.org/Translation).\n *\n * eg.\n * ```javascript\n * GVL.baseUrl = \"http://www.mydomain.com/iabcmp/\";\n * GVL.languageFilename = \"purposes?getPurposes=[LANG]\";\n * ```\n */\n static languageFilename = 'purposes-[LANG].json';\n /**\n * @param {Promise} resolved when this GVL object is populated with the data\n * or rejected if there is an error.\n */\n readyPromise;\n /**\n * @param {number} gvlSpecificationVersion - schema version for the GVL that is used\n */\n gvlSpecificationVersion;\n /**\n * @param {number} incremented with each published file change\n */\n vendorListVersion;\n /**\n * @param {number} tcfPolicyVersion - The TCF MO will increment this value\n * whenever a GVL change (such as adding a new Purpose or Feature or a change\n * in Purpose wording) legally invalidates existing TC Strings and requires\n * CMPs to re-establish transparency and consent from users. If the policy\n * version number in the latest GVL is different from the value in your TC\n * String, then you need to re-establish transparency and consent for that\n * user. A version 1 format TC String is considered to have a version value\n * of 1.\n */\n tcfPolicyVersion;\n /**\n * @param {string | Date} lastUpdated - the date in which the vendor list\n * json file was last updated.\n */\n lastUpdated;\n /**\n * @param {IntMap} a collection of [[Purpose]]s\n */\n purposes;\n /**\n * @param {IntMap} a collection of [[Purpose]]s\n */\n specialPurposes;\n /**\n * @param {IntMap} a collection of [[Feature]]s\n */\n features;\n /**\n * @param {IntMap} a collection of [[Feature]]s\n */\n specialFeatures;\n /**\n * @param {boolean} internal reference of when the GVL is ready to be used\n */\n isReady_ = false;\n /**\n * @param {IntMap} a collection of [[Vendor]]s\n */\n vendors_;\n vendorIds;\n /**\n * @param {IntMap} a collection of [[Vendor]]. Used as a backup if a whitelist is sets\n */\n fullVendorList;\n /**\n * @param {ByPurposeVendorMap} vendors by purpose\n */\n byPurposeVendorMap;\n /**\n * @param {IDSetMap} vendors by special purpose\n */\n bySpecialPurposeVendorMap;\n /**\n * @param {IDSetMap} vendors by feature\n */\n byFeatureVendorMap;\n /**\n * @param {IDSetMap} vendors by special feature\n */\n bySpecialFeatureVendorMap;\n /**\n * @param {IntMap} a collection of [[Stack]]s\n */\n stacks;\n lang_;\n isLatest = false;\n /**\n * @param {VersionOrVendorList} [versionOrVendorList] - can be either a\n * [[VendorList]] object or a version number represented as a string or\n * number to download. If nothing is passed the latest version of the GVL\n * will be loaded\n */\n constructor(versionOrVendorList) {\n super();\n /**\n * should have been configured before and instance was created and will\n * persist through the app\n */\n let url = GVL.baseUrl;\n this.lang_ = GVL.DEFAULT_LANGUAGE;\n if (this.isVendorList(versionOrVendorList)) {\n this.populate(versionOrVendorList);\n this.readyPromise = Promise.resolve();\n }\n else {\n if (!url) {\n throw new GVLError('must specify GVL.baseUrl before loading GVL json');\n }\n if (versionOrVendorList > 0) {\n const version = versionOrVendorList;\n if (GVL.CACHE.has(version)) {\n this.populate(GVL.CACHE.get(version));\n this.readyPromise = Promise.resolve();\n }\n else {\n // load version specified\n url += GVL.versionedFilename.replace('[VERSION]', String(version));\n this.readyPromise = this.fetchJson(url);\n }\n }\n else {\n /**\n * whatever it is (or isn't)... it doesn't matter we'll just get the\n * latest. In this case we may have cached the latest version at key 0.\n * If we have then we'll just use that instead of making a request.\n * Otherwise we'll have to load it (and then we'll cache it for next\n * time)\n */\n if (GVL.CACHE.has(GVL.LATEST_CACHE_KEY)) {\n this.populate(GVL.CACHE.get(GVL.LATEST_CACHE_KEY));\n this.readyPromise = Promise.resolve();\n }\n else {\n this.isLatest = true;\n this.readyPromise = this.fetchJson(url + GVL.latestFilename);\n }\n }\n }\n }\n /**\n * emptyLanguageCache\n *\n * @param {string} [lang] - Optional ISO 639-1 langauge code to remove from\n * the cache. Should be one of the languages in GVL.consentLanguages set.\n * If not then the whole cache will be deleted.\n * @return {boolean} - true if anything was deleted from the cache\n */\n static emptyLanguageCache(lang) {\n let retr = false;\n if (lang === undefined && GVL.LANGUAGE_CACHE.size > 0) {\n GVL.LANGUAGE_CACHE = new Map();\n retr = true;\n }\n else if (typeof lang === 'string' && this.consentLanguages.has(lang.toUpperCase())) {\n GVL.LANGUAGE_CACHE.delete(lang.toUpperCase());\n retr = true;\n }\n return retr;\n }\n /**\n * emptyCache\n *\n * @param {number} [vendorListVersion] - version of the vendor list to delete\n * from the cache. If none is specified then the whole cache is deleted.\n * @return {boolean} - true if anything was deleted from the cache\n */\n static emptyCache(vendorListVersion) {\n let retr = false;\n if (Number.isInteger(vendorListVersion) && vendorListVersion >= 0) {\n GVL.CACHE.delete(vendorListVersion);\n retr = true;\n }\n else if (vendorListVersion === undefined) {\n GVL.CACHE = new Map();\n retr = true;\n }\n return retr;\n }\n cacheLanguage() {\n if (!GVL.LANGUAGE_CACHE.has(this.lang_)) {\n GVL.LANGUAGE_CACHE.set(this.lang_, {\n purposes: this.purposes,\n specialPurposes: this.specialPurposes,\n features: this.features,\n specialFeatures: this.specialFeatures,\n stacks: this.stacks,\n });\n }\n }\n async fetchJson(url) {\n try {\n this.populate(await Json.fetch(url));\n }\n catch (err) {\n throw new GVLError(err.message);\n }\n }\n /**\n * getJson - Method for getting the JSON that was downloaded to created this\n * `GVL` object\n *\n * @return {VendorList} - The basic JSON structure without the extra\n * functionality and methods of this class.\n */\n getJson() {\n return JSON.parse(JSON.stringify({\n gvlSpecificationVersion: this.gvlSpecificationVersion,\n vendorListVersion: this.vendorListVersion,\n tcfPolicyVersion: this.tcfPolicyVersion,\n lastUpdated: this.lastUpdated,\n purposes: this.purposes,\n specialPurposes: this.specialPurposes,\n features: this.features,\n specialFeatures: this.specialFeatures,\n stacks: this.stacks,\n vendors: this.fullVendorList,\n }));\n }\n /**\n * changeLanguage - retrieves the purpose language translation and sets the\n * internal language variable\n *\n * @param {string} lang - ISO 639-1 langauge code to change language to\n * @return {Promise} - returns the `readyPromise` and\n * resolves when this GVL is populated with the data from the language file.\n */\n async changeLanguage(lang) {\n const langUpper = lang.toUpperCase();\n if (GVL.consentLanguages.has(langUpper)) {\n if (langUpper !== this.lang_) {\n this.lang_ = langUpper;\n if (GVL.LANGUAGE_CACHE.has(langUpper)) {\n const cached = GVL.LANGUAGE_CACHE.get(langUpper);\n for (const prop in cached) {\n if (cached.hasOwnProperty(prop)) {\n this[prop] = cached[prop];\n }\n }\n }\n else {\n // load Language specified\n const url = GVL.baseUrl + GVL.languageFilename.replace('[LANG]', lang);\n try {\n await this.fetchJson(url);\n this.cacheLanguage();\n }\n catch (err) {\n throw new GVLError('unable to load language: ' + err.message);\n }\n }\n }\n }\n else {\n throw new GVLError(`unsupported language ${lang}`);\n }\n }\n get language() {\n return this.lang_;\n }\n isVendorList(gvlObject) {\n return gvlObject !== undefined && gvlObject.vendors !== undefined;\n }\n populate(gvlObject) {\n /**\n * these are populated regardless of whether it's a Declarations file or\n * a VendorList\n */\n this.purposes = gvlObject.purposes;\n this.specialPurposes = gvlObject.specialPurposes;\n this.features = gvlObject.features;\n this.specialFeatures = gvlObject.specialFeatures;\n this.stacks = gvlObject.stacks;\n if (this.isVendorList(gvlObject)) {\n this.gvlSpecificationVersion = gvlObject.gvlSpecificationVersion;\n this.tcfPolicyVersion = gvlObject.tcfPolicyVersion;\n this.vendorListVersion = gvlObject.vendorListVersion;\n this.lastUpdated = gvlObject.lastUpdated;\n if (typeof this.lastUpdated === 'string') {\n this.lastUpdated = new Date(this.lastUpdated);\n }\n this.vendors_ = gvlObject.vendors;\n this.fullVendorList = gvlObject.vendors;\n this.mapVendors();\n this.isReady_ = true;\n if (this.isLatest) {\n /**\n * If the \"LATEST\" was requested then this flag will be set to true.\n * In that case we'll cache the GVL at the special key\n */\n GVL.CACHE.set(GVL.LATEST_CACHE_KEY, this.getJson());\n }\n /**\n * Whether or not it's the \"LATEST\" we'll cache the gvl at the version it\n * is declared to be (if it's not already). to avoid downloading it again\n * in the future.\n */\n if (!GVL.CACHE.has(this.vendorListVersion)) {\n GVL.CACHE.set(this.vendorListVersion, this.getJson());\n }\n }\n this.cacheLanguage();\n }\n mapVendors(vendorIds) {\n // create new instances of the maps\n this.byPurposeVendorMap = {};\n this.bySpecialPurposeVendorMap = {};\n this.byFeatureVendorMap = {};\n this.bySpecialFeatureVendorMap = {};\n // initializes data structure for purpose map\n Object.keys(this.purposes).forEach((purposeId) => {\n this.byPurposeVendorMap[purposeId] = {\n legInt: new Set(),\n consent: new Set(),\n flexible: new Set(),\n };\n });\n // initializes data structure for special purpose map\n Object.keys(this.specialPurposes).forEach((purposeId) => {\n this.bySpecialPurposeVendorMap[purposeId] = new Set();\n });\n // initializes data structure for feature map\n Object.keys(this.features).forEach((featureId) => {\n this.byFeatureVendorMap[featureId] = new Set();\n });\n // initializes data structure for feature map\n Object.keys(this.specialFeatures).forEach((featureId) => {\n this.bySpecialFeatureVendorMap[featureId] = new Set();\n });\n if (!Array.isArray(vendorIds)) {\n vendorIds = Object.keys(this.fullVendorList).map((vId) => +vId);\n }\n this.vendorIds = new Set(vendorIds);\n // assigns vendor ids to their respective maps\n this.vendors_ = vendorIds.reduce((vendors, vendorId) => {\n const vendor = this.vendors_[String(vendorId)];\n if (vendor && vendor.deletedDate === undefined) {\n vendor.purposes.forEach((purposeId) => {\n const purpGroup = this.byPurposeVendorMap[String(purposeId)];\n purpGroup.consent.add(vendorId);\n });\n vendor.specialPurposes.forEach((purposeId) => {\n this.bySpecialPurposeVendorMap[String(purposeId)].add(vendorId);\n });\n vendor.legIntPurposes.forEach((purposeId) => {\n this.byPurposeVendorMap[String(purposeId)].legInt.add(vendorId);\n });\n // could not be there\n if (vendor.flexiblePurposes) {\n vendor.flexiblePurposes.forEach((purposeId) => {\n this.byPurposeVendorMap[String(purposeId)].flexible.add(vendorId);\n });\n }\n vendor.features.forEach((featureId) => {\n this.byFeatureVendorMap[String(featureId)].add(vendorId);\n });\n vendor.specialFeatures.forEach((featureId) => {\n this.bySpecialFeatureVendorMap[String(featureId)].add(vendorId);\n });\n vendors[vendorId] = vendor;\n }\n return vendors;\n }, {});\n }\n getFilteredVendors(purposeOrFeature, id, subType, special) {\n const properPurposeOrFeature = purposeOrFeature.charAt(0).toUpperCase() + purposeOrFeature.slice(1);\n let vendorSet;\n const retr = {};\n if (purposeOrFeature === 'purpose' && subType) {\n vendorSet = this['by' + properPurposeOrFeature + 'VendorMap'][String(id)][subType];\n }\n else {\n vendorSet = this['by' + (special ? 'Special' : '') + properPurposeOrFeature + 'VendorMap'][String(id)];\n }\n vendorSet.forEach((vendorId) => {\n retr[String(vendorId)] = this.vendors[String(vendorId)];\n });\n return retr;\n }\n /**\n * getVendorsWithConsentPurpose\n *\n * @param {number} purposeId\n * @return {IntMap} - list of vendors that have declared the consent purpose id\n */\n getVendorsWithConsentPurpose(purposeId) {\n return this.getFilteredVendors('purpose', purposeId, 'consent');\n }\n /**\n * getVendorsWithLegIntPurpose\n *\n * @param {number} purposeId\n * @return {IntMap} - list of vendors that have declared the legInt (Legitimate Interest) purpose id\n */\n getVendorsWithLegIntPurpose(purposeId) {\n return this.getFilteredVendors('purpose', purposeId, 'legInt');\n }\n /**\n * getVendorsWithFlexiblePurpose\n *\n * @param {number} purposeId\n * @return {IntMap} - list of vendors that have declared the flexible purpose id\n */\n getVendorsWithFlexiblePurpose(purposeId) {\n return this.getFilteredVendors('purpose', purposeId, 'flexible');\n }\n /**\n * getVendorsWithSpecialPurpose\n *\n * @param {number} specialPurposeId\n * @return {IntMap} - list of vendors that have declared the special purpose id\n */\n getVendorsWithSpecialPurpose(specialPurposeId) {\n return this.getFilteredVendors('purpose', specialPurposeId, undefined, true);\n }\n /**\n * getVendorsWithFeature\n *\n * @param {number} featureId\n * @return {IntMap} - list of vendors that have declared the feature id\n */\n getVendorsWithFeature(featureId) {\n return this.getFilteredVendors('feature', featureId);\n }\n /**\n * getVendorsWithSpecialFeature\n *\n * @param {number} specialFeatureId\n * @return {IntMap} - list of vendors that have declared the special feature id\n */\n getVendorsWithSpecialFeature(specialFeatureId) {\n return this.getFilteredVendors('feature', specialFeatureId, undefined, true);\n }\n /**\n * vendors\n *\n * @return {IntMap} - the list of vendors as it would on the JSON file\n * except if `narrowVendorsTo` was called, it would be that narrowed list\n */\n get vendors() {\n return this.vendors_;\n }\n /**\n * narrowVendorsTo - narrows vendors represented in this GVL to the list of ids passed in\n *\n * @param {number[]} vendorIds - list of ids to narrow this GVL to\n * @return {void}\n */\n narrowVendorsTo(vendorIds) {\n this.mapVendors(vendorIds);\n }\n /**\n * isReady - Whether or not this instance is ready to be used. This will be\n * immediately and synchronously true if a vendorlist object is passed into\n * the constructor or once the JSON vendorllist is retrieved.\n *\n * @return {boolean} whether or not the instance is ready to be interacted\n * with and all the data is populated\n */\n get isReady() {\n return this.isReady_;\n }\n /**\n * clone - overrides base `clone()` method since GVL is a special class that\n * represents a JSON structure with some additional functionality.\n *\n * @return {GVL}\n */\n clone() {\n const result = new GVL(this.getJson());\n /*\n * If the current language of the GVL is not the default language, we set the language of\n * the clone to the current language since a new GVL is always created with the default\n * language. */\n if (this.lang_ !== GVL.DEFAULT_LANGUAGE) {\n /*\n * Since the GVL language was changed, this means that an asynchronous changeLanguage\n * call was made prior to cloning the GVL. The new language specified has been cached\n * by the GVL and this changeLanguage call made as a part of cloning the GVL will be\n * synchronous. The code will look for the language definitions in the cache instead\n * of creating a http request. */\n result.changeLanguage(this.lang_);\n }\n return result;\n }\n static isInstanceOf(questionableInstance) {\n const isSo = typeof questionableInstance === 'object';\n return (isSo && typeof questionableInstance.narrowVendorsTo === 'function');\n }\n}\n","export class Json {\n static absCall(url, body, sendCookies, timeout) {\n return new Promise((resolve, reject) => {\n const req = new XMLHttpRequest();\n const onLoad = () => {\n // is the response done\n if (req.readyState == XMLHttpRequest.DONE) {\n /**\n * For our purposes if it's not a 200 range response, then it's a\n * failure.\n */\n if (req.status >= 200 && req.status < 300) {\n let response = req.response;\n if (typeof response === 'string') {\n try {\n response = JSON.parse(response);\n }\n catch (e) { }\n }\n resolve(response);\n }\n else {\n reject(new Error(`HTTP Status: ${req.status} response type: ${req.responseType}`));\n }\n }\n };\n const onError = () => {\n reject(new Error('error'));\n };\n const onAbort = () => {\n reject(new Error('aborted'));\n };\n const onTimeout = () => {\n reject(new Error('Timeout ' + timeout + 'ms ' + url));\n };\n req.withCredentials = sendCookies;\n req.addEventListener('load', onLoad);\n req.addEventListener('error', onError);\n req.addEventListener('abort', onAbort);\n if (body === null) {\n req.open('GET', url, true);\n }\n else {\n req.open('POST', url, true);\n }\n req.responseType = 'json';\n // IE has a problem if this is before the open\n req.timeout = timeout;\n req.ontimeout = onTimeout;\n req.send(body);\n });\n }\n /**\n * @static\n * @param {string} url - full path to POST to\n * @param {object} body - JSON object to post\n * @param {boolean} sendCookies - Whether or not to send the XMLHttpRequest with credentials or not\n * @param {number} [timeout] - optional timeout in milliseconds\n * @return {Promise} - if the server responds the response will be returned here\n */\n static post(url, body, sendCookies = false, timeout = 0) {\n return this.absCall(url, JSON.stringify(body), sendCookies, timeout);\n }\n /**\n * @static\n * @param {string} url - full path to the json\n * @param {boolean} sendCookies - Whether or not to send the XMLHttpRequest with credentials or not\n * @param {number} [timeout] - optional timeout in milliseconds\n * @return {Promise} - resolves with parsed JSON\n */\n static fetch(url, sendCookies = false, timeout = 0) {\n return this.absCall(url, null, sendCookies, timeout);\n }\n}\n","import { Cloneable } from './Cloneable.js';\nimport { TCModelError } from './errors/index.js';\nimport { GVL } from './GVL.js';\nimport { PurposeRestrictionVector, Vector } from './model/index.js';\nexport class TCModel extends Cloneable {\n /**\n * Set of available consent languages published by the IAB\n */\n static consentLanguages = GVL.consentLanguages;\n isServiceSpecific_ = false;\n supportOOB_ = true;\n useNonStandardStacks_ = false;\n purposeOneTreatment_ = false;\n publisherCountryCode_ = 'AA';\n version_ = 2;\n consentScreen_ = 0;\n policyVersion_ = 2;\n consentLanguage_ = 'EN';\n cmpId_ = 0;\n cmpVersion_ = 0;\n vendorListVersion_ = 0;\n numCustomPurposes_ = 0;\n // Member Variable for GVL\n gvl_;\n created;\n lastUpdated;\n /**\n * The TCF designates certain Features as special, that is, a CMP must afford\n * the user a means to opt in to their use. These Special Features are\n * published and numbered in the GVL separately from normal Features.\n * Provides for up to 12 special features.\n */\n specialFeatureOptins = new Vector();\n /**\n * Renamed from `PurposesAllowed` in TCF v1.1\n * The user’s consent value for each Purpose established on the legal basis\n * of consent. Purposes are published in the Global Vendor List (see. [[GVL]]).\n */\n purposeConsents = new Vector();\n /**\n * The user’s permission for each Purpose established on the legal basis of\n * legitimate interest. If the user has exercised right-to-object for a\n * purpose.\n */\n purposeLegitimateInterests = new Vector();\n /**\n * The user’s consent value for each Purpose established on the legal basis\n * of consent, for the publisher. Purposes are published in the Global\n * Vendor List.\n */\n publisherConsents = new Vector();\n /**\n * The user’s permission for each Purpose established on the legal basis of\n * legitimate interest. If the user has exercised right-to-object for a\n * purpose.\n */\n publisherLegitimateInterests = new Vector();\n /**\n * The user’s consent value for each Purpose established on the legal basis\n * of consent, for the publisher. Purposes are published in the Global\n * Vendor List.\n */\n publisherCustomConsents = new Vector();\n /**\n * The user’s permission for each Purpose established on the legal basis of\n * legitimate interest. If the user has exercised right-to-object for a\n * purpose that is established in the publisher's custom purposes.\n */\n publisherCustomLegitimateInterests = new Vector();\n /**\n * set by a publisher if they wish to collect consent and LI Transparency for\n * purposes outside of the TCF\n */\n customPurposes;\n /**\n * Each [[Vendor]] is keyed by id. Their consent value is true if it is in\n * the Vector\n */\n vendorConsents = new Vector();\n /**\n * Each [[Vendor]] is keyed by id. Whether their Legitimate Interests\n * Disclosures have been established is stored as boolean.\n * see: [[Vector]]\n */\n vendorLegitimateInterests = new Vector();\n /**\n * The value included for disclosed vendors signals which vendors have been\n * disclosed to the user in the interface surfaced by the CMP. This section\n * content is required when writing a TC string to the global (consensu)\n * scope. When a CMP has read from and is updating a TC string from the\n * global consensu.org storage, the CMP MUST retain the existing disclosure\n * information and only add information for vendors that it has disclosed\n * that had not been disclosed by other CMPs in prior interactions with this\n * device/user agent.\n */\n vendorsDisclosed = new Vector();\n /**\n * Signals which vendors the publisher permits to use OOB legal bases.\n */\n vendorsAllowed = new Vector();\n publisherRestrictions = new PurposeRestrictionVector();\n /**\n * Constructs the TCModel. Passing a [[GVL]] is optional when constructing\n * as this TCModel may be constructed from decoding an existing encoded\n * TCString.\n *\n * @param {GVL} [gvl]\n */\n constructor(gvl) {\n super();\n if (gvl) {\n this.gvl = gvl;\n }\n this.updated();\n }\n /**\n * sets the [[GVL]] with side effects of also setting the `vendorListVersion`, `policyVersion`, and `consentLanguage`\n * @param {GVL} gvl\n */\n set gvl(gvl) {\n /**\n * set the reference, but make sure it's our GVL wrapper class.\n */\n if (!(GVL.isInstanceOf(gvl))) {\n gvl = new GVL(gvl);\n }\n this.gvl_ = gvl;\n this.publisherRestrictions.gvl = gvl;\n }\n /**\n * @return {GVL} the gvl instance set on this TCModel instance\n */\n get gvl() {\n return this.gvl_;\n }\n /**\n * @param {number} integer - A unique ID will be assigned to each Consent\n * Manager Provider (CMP) from the iab.\n *\n * @throws {TCModelError} if the value is not an integer greater than 1 as those are not valid.\n */\n set cmpId(integer) {\n integer = Number(integer);\n if (Number.isInteger(integer) && integer > 1) {\n this.cmpId_ = integer;\n }\n else {\n throw new TCModelError('cmpId', integer);\n }\n }\n get cmpId() {\n return this.cmpId_;\n }\n /**\n * Each change to an operating CMP should receive a\n * new version number, for logging proof of consent. CmpVersion defined by\n * each CMP.\n *\n * @param {number} integer\n *\n * @throws {TCModelError} if the value is not an integer greater than 1 as those are not valid.\n */\n set cmpVersion(integer) {\n integer = Number(integer);\n if (Number.isInteger(integer) && integer > -1) {\n this.cmpVersion_ = integer;\n }\n else {\n throw new TCModelError('cmpVersion', integer);\n }\n }\n get cmpVersion() {\n return this.cmpVersion_;\n }\n /**\n * The screen number is CMP and CmpVersion\n * specific, and is for logging proof of consent.(For example, a CMP could\n * keep records so that a publisher can request information about the context\n * in which consent was gathered.)\n *\n * @param {number} integer\n *\n * @throws {TCModelError} if the value is not an integer greater than 0 as those are not valid.\n */\n set consentScreen(integer) {\n integer = Number(integer);\n if (Number.isInteger(integer) && integer > -1) {\n this.consentScreen_ = integer;\n }\n else {\n throw new TCModelError('consentScreen', integer);\n }\n }\n get consentScreen() {\n return this.consentScreen_;\n }\n /**\n * @param {string} lang - [two-letter ISO 639-1 language\n * code](http://www.loc.gov/standards/iso639-2/php/code_list.php) in which\n * the CMP UI was presented\n *\n * @throws {TCModelError} if the value is not a length-2 string of alpha characters\n */\n set consentLanguage(lang) {\n this.consentLanguage_ = lang;\n }\n get consentLanguage() {\n return this.consentLanguage_;\n }\n /**\n * @param {string} countryCode - [two-letter ISO 3166-1 alpha-2 country\n * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the publisher,\n * determined by the CMP-settings of the publisher.\n *\n * @throws {TCModelError} if the value is not a length-2 string of alpha characters\n */\n set publisherCountryCode(countryCode) {\n if (/^([A-z]){2}$/.test(countryCode)) {\n this.publisherCountryCode_ = countryCode.toUpperCase();\n }\n else {\n throw new TCModelError('publisherCountryCode', countryCode);\n }\n }\n get publisherCountryCode() {\n return this.publisherCountryCode_;\n }\n /**\n * Version of the GVL used to create this TCModel. Global\n * Vendor List versions will be released periodically.\n *\n * @param {number} integer\n *\n * @throws {TCModelError} if the value is not an integer greater than 0 as those are not valid.\n */\n set vendorListVersion(integer) {\n /**\n * first coerce to a number via leading '+' then take the integer value by\n * bitshifting to the right. This works on all types in JavaScript and if\n * it's not valid then value will be 0.\n */\n integer = Number(integer) >> 0;\n if (integer < 0) {\n throw new TCModelError('vendorListVersion', integer);\n }\n else {\n this.vendorListVersion_ = integer;\n }\n }\n get vendorListVersion() {\n if (this.gvl) {\n return this.gvl.vendorListVersion;\n }\n else {\n return this.vendorListVersion_;\n }\n }\n /**\n * From the corresponding field in the GVL that was\n * used for obtaining consent. A new policy version invalidates existing\n * strings and requires CMPs to re-establish transparency and consent from\n * users.\n *\n * If a TCF policy version number is different from the one from the latest\n * GVL, the CMP must re-establish transparency and consent.\n *\n * @param {number} num - You do not need to set this. This comes\n * directly from the [[GVL]].\n *\n */\n set policyVersion(num) {\n this.policyVersion_ = parseInt(num, 10);\n if (this.policyVersion_ < 0) {\n throw new TCModelError('policyVersion', num);\n }\n }\n get policyVersion() {\n if (this.gvl) {\n return this.gvl.tcfPolicyVersion;\n }\n else {\n return this.policyVersion_;\n }\n }\n set version(num) {\n this.version_ = parseInt(num, 10);\n }\n get version() {\n return this.version_;\n }\n /**\n * Whether the signals encoded in this TC String were from site-specific\n * storage `true` versus ‘global’ consensu.org shared storage `false`. A\n * string intended to be stored in global/shared scope but the CMP is unable\n * to store due to a user agent not accepting third-party cookies would be\n * considered site-specific `true`.\n *\n * @param {boolean} bool - value to set. Some changes to other fields in this\n * model will automatically change this value like adding publisher\n * restrictions.\n */\n set isServiceSpecific(bool) {\n this.isServiceSpecific_ = bool;\n }\n get isServiceSpecific() {\n return this.isServiceSpecific_;\n }\n /**\n * Non-standard stacks means that a CMP is using publisher-customized stack\n * descriptions. Stacks (in terms of purposes in a stack) are pre-set by the\n * IAB. As are titles. Descriptions are pre-set, but publishers can customize\n * them. If they do, they need to set this bit to indicate that they've\n * customized descriptions.\n *\n * @param {boolean} bool - value to set\n */\n set useNonStandardStacks(bool) {\n this.useNonStandardStacks_ = bool;\n }\n get useNonStandardStacks() {\n return this.useNonStandardStacks_;\n }\n /**\n * Whether or not this publisher supports OOB signaling. On Global TC String\n * OOB Vendors Disclosed will be included if the publish wishes to no allow\n * these vendors they should set this to false.\n * @param {boolean} bool - value to set\n */\n set supportOOB(bool) {\n this.supportOOB_ = bool;\n }\n get supportOOB() {\n return this.supportOOB_;\n }\n /**\n * `false` There is no special Purpose 1 status.\n * Purpose 1 was disclosed normally (consent) as expected by Policy. `true`\n * Purpose 1 not disclosed at all. CMPs use PublisherCC to indicate the\n * publisher’s country of establishment to help Vendors determine whether the\n * vendor requires Purpose 1 consent. In global scope TC strings, this field\n * must always have a value of `false`. When a CMP encounters a global scope\n * string with `purposeOneTreatment=true` then that string should be\n * considered invalid and the CMP must re-establish transparency and consent.\n *\n * @param {boolean} bool\n */\n set purposeOneTreatment(bool) {\n this.purposeOneTreatment_ = bool;\n }\n get purposeOneTreatment() {\n return this.purposeOneTreatment_;\n }\n /**\n * setAllVendorConsents - sets all vendors on the GVL Consent (true)\n *\n * @return {void}\n */\n setAllVendorConsents() {\n this.vendorConsents.set(this.gvl.vendors);\n }\n /**\n * unsetAllVendorConsents - unsets all vendors on the GVL Consent (false)\n *\n * @return {void}\n */\n unsetAllVendorConsents() {\n this.vendorConsents.empty();\n }\n /**\n * setAllVendorsDisclosed - sets all vendors on the GVL Vendors Disclosed (true)\n *\n * @return {void}\n */\n setAllVendorsDisclosed() {\n this.vendorsDisclosed.set(this.gvl.vendors);\n }\n /**\n * unsetAllVendorsDisclosed - unsets all vendors on the GVL Consent (false)\n *\n * @return {void}\n */\n unsetAllVendorsDisclosed() {\n this.vendorsDisclosed.empty();\n }\n /**\n * setAllVendorsAllowed - sets all vendors on the GVL Consent (true)\n *\n * @return {void}\n */\n setAllVendorsAllowed() {\n this.vendorsAllowed.set(this.gvl.vendors);\n }\n /**\n * unsetAllVendorsAllowed - unsets all vendors on the GVL Consent (false)\n *\n * @return {void}\n */\n unsetAllVendorsAllowed() {\n this.vendorsAllowed.empty();\n }\n /**\n * setAllVendorLegitimateInterests - sets all vendors on the GVL LegitimateInterests (true)\n *\n * @return {void}\n */\n setAllVendorLegitimateInterests() {\n this.vendorLegitimateInterests.set(this.gvl.vendors);\n }\n /**\n * unsetAllVendorLegitimateInterests - unsets all vendors on the GVL LegitimateInterests (false)\n *\n * @return {void}\n */\n unsetAllVendorLegitimateInterests() {\n this.vendorLegitimateInterests.empty();\n }\n /**\n * setAllPurposeConsents - sets all purposes on the GVL Consent (true)\n *\n * @return {void}\n */\n setAllPurposeConsents() {\n this.purposeConsents.set(this.gvl.purposes);\n }\n /**\n * unsetAllPurposeConsents - unsets all purposes on the GVL Consent (false)\n *\n * @return {void}\n */\n unsetAllPurposeConsents() {\n this.purposeConsents.empty();\n }\n /**\n * setAllPurposeLegitimateInterests - sets all purposes on the GVL LI Transparency (true)\n *\n * @return {void}\n */\n setAllPurposeLegitimateInterests() {\n this.purposeLegitimateInterests.set(this.gvl.purposes);\n }\n /**\n * unsetAllPurposeLegitimateInterests - unsets all purposes on the GVL LI Transparency (false)\n *\n * @return {void}\n */\n unsetAllPurposeLegitimateInterests() {\n this.purposeLegitimateInterests.empty();\n }\n /**\n * setAllSpecialFeatureOptins - sets all special featuresOptins on the GVL (true)\n *\n * @return {void}\n */\n setAllSpecialFeatureOptins() {\n this.specialFeatureOptins.set(this.gvl.specialFeatures);\n }\n /**\n * unsetAllSpecialFeatureOptins - unsets all special featuresOptins on the GVL (true)\n *\n * @return {void}\n */\n unsetAllSpecialFeatureOptins() {\n this.specialFeatureOptins.empty();\n }\n setAll() {\n this.setAllVendorConsents();\n this.setAllPurposeLegitimateInterests();\n this.setAllSpecialFeatureOptins();\n this.setAllPurposeConsents();\n this.setAllVendorLegitimateInterests();\n }\n unsetAll() {\n this.unsetAllVendorConsents();\n this.unsetAllPurposeLegitimateInterests();\n this.unsetAllSpecialFeatureOptins();\n this.unsetAllPurposeConsents();\n this.unsetAllVendorLegitimateInterests();\n }\n get numCustomPurposes() {\n let len = this.numCustomPurposes_;\n if (typeof this.customPurposes === 'object') {\n /**\n * Keys are not guaranteed to be in order and likewise there is no\n * requirement that the customPurposes be non-sparse. So we have to sort\n * and take the highest value. Even if the set only contains 3 purposes\n * but goes to ID 6 we need to set the number to 6 for the encoding to\n * work properly since it's positional.\n */\n const purposeIds = Object.keys(this.customPurposes)\n .sort((a, b) => Number(a) - Number(b));\n len = parseInt(purposeIds.pop(), 10);\n }\n return len;\n }\n set numCustomPurposes(num) {\n this.numCustomPurposes_ = parseInt(num, 10);\n if (this.numCustomPurposes_ < 0) {\n throw new TCModelError('numCustomPurposes', num);\n }\n }\n /**\n * updated - updates the created and lastUpdated dates with a 'now' day-level UTC timestamp\n *\n * @return {void}\n */\n updated() {\n const date = new Date();\n const utcDate = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));\n this.created = utcDate;\n this.lastUpdated = utcDate;\n }\n}\n","import { Base64Url, BitLength, SegmentEncoder, SegmentSequence, SemanticPreEncoder, } from './encoder/index.js';\nimport { SegmentIDs } from './model/index.js';\nimport { IntEncoder } from './encoder/field/IntEncoder.js';\nimport { TCModel } from './TCModel.js';\n/**\n * Main class for encoding and decoding a\n * TCF Transparency and Consent String\n */\nexport class TCString {\n /**\n * encodes a model into a TCString\n *\n * @param {TCModel} tcModel - model to convert into encoded string\n * @param {EncodingOptions} options - for encoding options other than default\n * @return {string} - base64url encoded Transparency and Consent String\n */\n static encode(tcModel, options) {\n let out = '';\n let sequence;\n tcModel = SemanticPreEncoder.process(tcModel, options);\n /**\n * If they pass in a special segment sequence.\n */\n if (Array.isArray(options?.segments)) {\n sequence = options.segments;\n }\n else {\n sequence = new SegmentSequence(tcModel, options)['' + tcModel.version];\n }\n sequence.forEach((segment, idx) => {\n let dotMaybe = '';\n if (idx < sequence.length - 1) {\n dotMaybe = '.';\n }\n out += SegmentEncoder.encode(tcModel, segment) + dotMaybe;\n });\n return out;\n }\n /**\n * Decodes a string into a TCModel\n *\n * @param {string} encodedTCString - base64url encoded Transparency and\n * Consent String to decode - can also be a single or group of segments of\n * the string\n * @param {string} [tcModel] - model to enhance with the information. If\n * none is passed a new instance of TCModel will be created.\n * @return {TCModel} - Returns populated TCModel\n */\n static decode(encodedTCString, tcModel) {\n const segments = encodedTCString.split('.');\n const len = segments.length;\n if (!tcModel) {\n tcModel = new TCModel();\n }\n for (let i = 0; i < len; i++) {\n const segString = segments[i];\n /**\n * first char will contain 6 bits, we only need the first 3. In version 1\n * and 2 of the TC string there is no segment type for the CORE string.\n * Instead the first 6 bits are reserved for the encoding version, but\n * because we're only on a maximum of encoding version 2 the first 3 bits\n * in the core segment will evaluate to 0.\n */\n const firstChar = Base64Url.decode(segString.charAt(0));\n const segTypeBits = firstChar.substr(0, BitLength.segmentType);\n const segment = SegmentIDs.ID_TO_KEY[IntEncoder.decode(segTypeBits, BitLength.segmentType).toString()];\n SegmentEncoder.decode(segString, tcModel, segment);\n }\n return tcModel;\n }\n}\n","import { DecodingError, EncodingError } from '../errors/index.js';\nexport class Base64Url {\n /**\n * Base 64 URL character set. Different from standard Base64 char set\n * in that '+' and '/' are replaced with '-' and '_'.\n */\n static DICT = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';\n static REVERSE_DICT = new Map([\n ['A', 0], ['B', 1], ['C', 2], ['D', 3], ['E', 4], ['F', 5],\n ['G', 6], ['H', 7], ['I', 8], ['J', 9], ['K', 10], ['L', 11],\n ['M', 12], ['N', 13], ['O', 14], ['P', 15], ['Q', 16], ['R', 17],\n ['S', 18], ['T', 19], ['U', 20], ['V', 21], ['W', 22], ['X', 23],\n ['Y', 24], ['Z', 25], ['a', 26], ['b', 27], ['c', 28], ['d', 29],\n ['e', 30], ['f', 31], ['g', 32], ['h', 33], ['i', 34], ['j', 35],\n ['k', 36], ['l', 37], ['m', 38], ['n', 39], ['o', 40], ['p', 41],\n ['q', 42], ['r', 43], ['s', 44], ['t', 45], ['u', 46], ['v', 47],\n ['w', 48], ['x', 49], ['y', 50], ['z', 51], ['0', 52], ['1', 53],\n ['2', 54], ['3', 55], ['4', 56], ['5', 57], ['6', 58], ['7', 59],\n ['8', 60], ['9', 61], ['-', 62], ['_', 63],\n ]);\n /**\n * log2(64) = 6\n */\n static BASIS = 6;\n static LCM = 24;\n /**\n * encodes an arbitrary-length bitfield string into base64url\n *\n * @static\n * @param {string} str - arbitrary-length bitfield string to be encoded to base64url\n * @return {string} - base64url encoded result\n */\n static encode(str) {\n /**\n * should only be 0 or 1\n */\n if (!/^[0-1]+$/.test(str)) {\n throw new EncodingError('Invalid bitField');\n }\n /**\n * Pad the end of the string to the least common mutliple of 6 (basis for\n * base64) and 8 (one byte)\n */\n const padding = str.length % this.LCM;\n str += padding ? '0'.repeat(this.LCM - padding) : '';\n let result = '';\n for (let i = 0; i < str.length; i += this.BASIS) {\n result += this.DICT[parseInt(str.substr(i, this.BASIS), 2)];\n }\n return result;\n }\n /**\n * decodes a base64url encoded bitfield string\n *\n * @static\n * @param {string} str - base64url encoded bitfield string to be decoded\n * @return {string} - bitfield string\n */\n static decode(str) {\n /**\n * should contain only characters from the base64url set\n */\n if (!/^[A-Za-z0-9\\-_]+$/.test(str)) {\n throw new DecodingError('Invalidly encoded Base64URL string');\n }\n let result = '';\n for (let i = 0; i < str.length; i++) {\n /**\n * index the binary value of the character from out reverse map\n */\n const strBits = this.REVERSE_DICT.get(str[i]).toString(2);\n /**\n * Since a bit string converted to an integer on encoding will lose\n * leading zeros – pad to the left for those missing leading zeros\n */\n result += '0'.repeat(this.BASIS - strBits.length) + strBits;\n }\n return result;\n }\n}\n","import { Fields } from '../model/index.js';\nexport class BitLength {\n static [Fields.cmpId] = 12;\n static [Fields.cmpVersion] = 12;\n static [Fields.consentLanguage] = 12;\n static [Fields.consentScreen] = 6;\n static [Fields.created] = 36;\n static [Fields.isServiceSpecific] = 1;\n static [Fields.lastUpdated] = 36;\n static [Fields.policyVersion] = 6;\n static [Fields.publisherCountryCode] = 12;\n static [Fields.publisherLegitimateInterests] = 24;\n static [Fields.publisherConsents] = 24;\n static [Fields.purposeConsents] = 24;\n static [Fields.purposeLegitimateInterests] = 24;\n static [Fields.purposeOneTreatment] = 1;\n static [Fields.specialFeatureOptins] = 12;\n static [Fields.useNonStandardStacks] = 1;\n static [Fields.vendorListVersion] = 12;\n static [Fields.version] = 6;\n static anyBoolean = 1;\n static encodingType = 1;\n static maxId = 16;\n static numCustomPurposes = 6;\n static numEntries = 12;\n static numRestrictions = 12;\n static purposeId = 6;\n static restrictionType = 2;\n static segmentType = 3;\n static singleOrRange = 1;\n static vendorId = 16;\n}\n","export {};\n","import { Base64Url } from './Base64Url.js';\nimport { BitLength } from './BitLength.js';\nimport { FieldEncoderMap, IntEncoder, VendorVectorEncoder } from './field/index.js';\nimport { FieldSequence } from './sequence/index.js';\nimport { EncodingError, DecodingError } from '../errors/index.js';\nimport { Fields } from '../model/Fields.js';\nimport { Segment, SegmentIDs } from '../model/index.js';\nexport class SegmentEncoder {\n static fieldSequence = new FieldSequence();\n static encode(tcModel, segment) {\n let sequence;\n try {\n sequence = this.fieldSequence[String(tcModel.version)][segment];\n }\n catch (err) {\n throw new EncodingError(`Unable to encode version: ${tcModel.version}, segment: ${segment}`);\n }\n let bitField = '';\n /**\n * If this is anything other than the core segment we have a \"segment id\"\n * to append to the front of the string\n */\n if (segment !== Segment.CORE) {\n bitField = IntEncoder.encode(SegmentIDs.KEY_TO_ID[segment], BitLength.segmentType);\n }\n const fieldEncoderMap = FieldEncoderMap();\n sequence.forEach((key) => {\n const value = tcModel[key];\n const encoder = fieldEncoderMap[key];\n let numBits = BitLength[key];\n if (numBits === undefined) {\n if (this.isPublisherCustom(key)) {\n /**\n * publisherCustom[Consents | LegitimateInterests] are an edge case\n * because they are of variable length. The length is defined in a\n * separate field named numCustomPurposes.\n */\n numBits = Number(tcModel[Fields.numCustomPurposes]);\n }\n }\n try {\n bitField += encoder.encode(value, numBits);\n }\n catch (err) {\n throw new EncodingError(`Error encoding ${segment}->${key}: ${err.message}`);\n }\n });\n // base64url encode the string and return\n return Base64Url.encode(bitField);\n }\n static decode(encodedString, tcModel, segment) {\n const bitField = Base64Url.decode(encodedString);\n let bStringIdx = 0;\n if (segment === Segment.CORE) {\n tcModel.version = IntEncoder.decode(bitField.substr(bStringIdx, BitLength[Fields.version]), BitLength[Fields.version]);\n }\n if (segment !== Segment.CORE) {\n bStringIdx += BitLength.segmentType;\n }\n const sequence = this.fieldSequence[String(tcModel.version)][segment];\n const fieldEncoderMap = FieldEncoderMap();\n sequence.forEach((key) => {\n const encoder = fieldEncoderMap[key];\n let numBits = BitLength[key];\n if (numBits === undefined) {\n if (this.isPublisherCustom(key)) {\n /**\n * publisherCustom[Consents | LegitimateInterests] are an edge case\n * because they are of variable length. The length is defined in a\n * separate field named numCustomPurposes.\n */\n numBits = Number(tcModel[Fields.numCustomPurposes]);\n }\n }\n if (numBits !== 0) {\n /**\n * numBits could be 0 if this is a publisher custom purposes field and\n * no custom purposes are defined. If that is the case, we don't need\n * to gather no bits and we don't need to increment our bStringIdx\n * pointer because those would all be 0 increments and would mess up\n * the next logical if statement.\n */\n const bits = bitField.substr(bStringIdx, numBits);\n if (encoder === VendorVectorEncoder) {\n tcModel[key] = encoder.decode(bits, tcModel.version);\n }\n else {\n tcModel[key] = encoder.decode(bits, numBits);\n }\n if (Number.isInteger(numBits)) {\n bStringIdx += numBits;\n }\n else if (Number.isInteger(tcModel[key].bitLength)) {\n bStringIdx += tcModel[key].bitLength;\n }\n else {\n throw new DecodingError(key);\n }\n }\n });\n return tcModel;\n }\n static isPublisherCustom(key) {\n return key.indexOf('publisherCustom') === 0;\n }\n}\n","import { EncodingError } from '../errors/index.js';\nimport { RestrictionType } from '../model/index.js';\nexport class SemanticPreEncoder {\n static processor = [\n (tcModel) => tcModel,\n (tcModel, gvl) => {\n /**\n * in case this wasn't set previously. This should filter out invalid\n * purpose restrictions.\n */\n tcModel.publisherRestrictions.gvl = gvl;\n /**\n * Purpose 1 is never allowed to be true for legitimate interest\n */\n tcModel.purposeLegitimateInterests.unset(1);\n /**\n * If a Vendor does not declare a purpose for consent or legitimate\n * interest they should not have a positive signal for it. This code\n * removes positive signals created mistakingly.\n */\n const vectorToIntMap = new Map();\n vectorToIntMap.set('legIntPurposes', tcModel.vendorLegitimateInterests);\n vectorToIntMap.set('purposes', tcModel.vendorConsents);\n vectorToIntMap.forEach((vector, gvlVendorKey) => {\n vector.forEach((value, vendorId) => {\n if (value) {\n const vendor = gvl.vendors[vendorId];\n if (!vendor || vendor.deletedDate) {\n /**\n * If the vendor doesn't exist, then they should not receive a\n * positive signal\n */\n vector.unset(vendorId);\n }\n else if (vendor[gvlVendorKey].length === 0) {\n if (gvlVendorKey === 'legIntPurposes' && vendor['purposes'].length === 0 && vendor['legIntPurposes'].length === 0 && vendor['specialPurposes'].length > 0) {\n /**\n * Per June 2021 Policy change, Vendors declaring only Special Purposes must\n * have their legitimate interest Vendor bit set if they have been disclosed.\n * This empty block ensures their LI bit remains set\n */\n }\n else {\n /**\n * If the vendor does exist, but they haven't declared any\n * purposes for this legal basis, then we need to see if they can\n * possibly have the legal basis from their flexible purposes.\n */\n if (tcModel.isServiceSpecific) {\n if (vendor.flexiblePurposes.length === 0) {\n /**\n * No flexible basis for any purposes, so we can safely remove\n * this vendor from the legal basis.\n */\n vector.unset(vendorId);\n }\n else {\n /**\n * They have some flexible purposes, we should check for a\n * publisher restriction value that would enable this vendor to\n * have the override-preferred basis.\n */\n const restrictions = tcModel.publisherRestrictions.getRestrictions(vendorId);\n let isValid = false;\n for (let i = 0, len = restrictions.length; i < len && !isValid; i++) {\n /**\n * If this condition is true the loop will break. If we are\n * dealing with the consent purposes ('purposes') and the\n * publisher restriction overrides to consent then it is\n * valid for the vendor to have a positive signal for\n * consent. Likewise for legitimate interest purposes\n * ('legIntPurposes') and requiring legitimate interest.\n */\n isValid = ((restrictions[i].restrictionType === RestrictionType.REQUIRE_CONSENT &&\n gvlVendorKey === 'purposes') ||\n (restrictions[i].restrictionType === RestrictionType.REQUIRE_LI &&\n gvlVendorKey === 'legIntPurposes'));\n }\n if (!isValid) {\n /**\n * if we came through the previous loop without finding a\n * valid reasing: no overriding restrictions (changes in\n * legal basis) then it's not valid for this vendor to have\n * this legal basis.\n */\n vector.unset(vendorId);\n }\n }\n }\n else {\n /**\n * This is a globally-scoped string so flexible purposes will not\n * be able to change this value because purposeRestrictions only\n * apply to service-specific strings.\n */\n vector.unset(vendorId);\n }\n }\n }\n }\n });\n });\n tcModel.vendorsDisclosed.set(gvl.vendors);\n return tcModel;\n },\n ];\n static process(tcModel, options) {\n const gvl = tcModel.gvl;\n if (!gvl) {\n throw new EncodingError('Unable to encode TCModel without a GVL');\n }\n if (!gvl.isReady) {\n throw new EncodingError('Unable to encode TCModel tcModel.gvl.readyPromise is not resolved');\n }\n tcModel = tcModel.clone();\n tcModel.consentLanguage = gvl.language.toUpperCase();\n if (options?.version > 0 && options?.version <= this.processor.length) {\n tcModel.version = options.version;\n }\n else {\n /**\n * this is equal to the latest or most current version\n */\n tcModel.version = this.processor.length;\n }\n const processorFunctionIndex = tcModel.version - 1;\n if (!this.processor[processorFunctionIndex]) {\n throw new EncodingError(`Invalid version: ${tcModel.version}`);\n }\n return this.processor[processorFunctionIndex](tcModel, gvl);\n }\n}\n","export class BooleanEncoder {\n static encode(value) {\n return String(Number(value));\n }\n static decode(value) {\n // less operations than !!parseInt(value, 2)\n return value === '1';\n }\n}\n","import { IntEncoder, } from './IntEncoder.js';\nimport { DecodingError, } from '../../errors/index.js';\nexport class DateEncoder {\n static encode(value, numBits) {\n return IntEncoder.encode(Math.round(value.getTime() / 100), numBits);\n }\n static decode(value, numBits) {\n if (numBits !== value.length) {\n throw new DecodingError('invalid bit length');\n }\n const date = new Date();\n date.setTime(IntEncoder.decode(value, numBits) * 100);\n return date;\n }\n}\n","import { Fields } from '../../model/index.js';\nimport { BooleanEncoder } from './BooleanEncoder.js';\nimport { DateEncoder } from './DateEncoder.js';\nimport { FixedVectorEncoder } from './FixedVectorEncoder.js';\nimport { IntEncoder } from './IntEncoder.js';\nimport { LangEncoder } from './LangEncoder.js';\nimport { PurposeRestrictionVectorEncoder } from './PurposeRestrictionVectorEncoder.js';\nimport { VendorVectorEncoder } from './VendorVectorEncoder.js';\nexport function FieldEncoderMap() {\n return {\n [Fields.version]: IntEncoder,\n [Fields.created]: DateEncoder,\n [Fields.lastUpdated]: DateEncoder,\n [Fields.cmpId]: IntEncoder,\n [Fields.cmpVersion]: IntEncoder,\n [Fields.consentScreen]: IntEncoder,\n [Fields.consentLanguage]: LangEncoder,\n [Fields.vendorListVersion]: IntEncoder,\n [Fields.policyVersion]: IntEncoder,\n [Fields.isServiceSpecific]: BooleanEncoder,\n [Fields.useNonStandardStacks]: BooleanEncoder,\n [Fields.specialFeatureOptins]: FixedVectorEncoder,\n [Fields.purposeConsents]: FixedVectorEncoder,\n [Fields.purposeLegitimateInterests]: FixedVectorEncoder,\n [Fields.purposeOneTreatment]: BooleanEncoder,\n [Fields.publisherCountryCode]: LangEncoder,\n [Fields.vendorConsents]: VendorVectorEncoder,\n [Fields.vendorLegitimateInterests]: VendorVectorEncoder,\n [Fields.publisherRestrictions]: PurposeRestrictionVectorEncoder,\n segmentType: IntEncoder,\n [Fields.vendorsDisclosed]: VendorVectorEncoder,\n [Fields.vendorsAllowed]: VendorVectorEncoder,\n [Fields.publisherConsents]: FixedVectorEncoder,\n [Fields.publisherLegitimateInterests]: FixedVectorEncoder,\n [Fields.numCustomPurposes]: IntEncoder,\n [Fields.publisherCustomConsents]: FixedVectorEncoder,\n [Fields.publisherCustomLegitimateInterests]: FixedVectorEncoder,\n };\n}\n","import { BooleanEncoder } from './BooleanEncoder.js';\nimport { DecodingError } from '../../errors/index.js';\nimport { Vector } from '../../model/index.js';\nexport class FixedVectorEncoder {\n static encode(value, numBits) {\n let bitString = '';\n for (let i = 1; i <= numBits; i++) {\n bitString += BooleanEncoder.encode(value.has(i));\n }\n return bitString;\n }\n static decode(value, numBits) {\n if (value.length !== numBits) {\n throw new DecodingError('bitfield encoding length mismatch');\n }\n const vector = new Vector();\n for (let i = 1; i <= numBits; i++) {\n if (BooleanEncoder.decode(value[i - 1])) {\n vector.set(i);\n }\n }\n vector.bitLength = value.length;\n return vector;\n }\n}\n","import { EncodingError, DecodingError, } from '../../errors/index.js';\nexport class IntEncoder {\n static encode(value, numBits) {\n let bitString;\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n bitString = value.toString(2);\n if (bitString.length > numBits || value < 0) {\n throw new EncodingError(`${value} too large to encode into ${numBits}`);\n }\n // Pad the string if not filling all bits\n if (bitString.length < numBits) {\n // pad left\n bitString = '0'.repeat(numBits - bitString.length) + bitString;\n }\n return bitString;\n }\n static decode(value, numBits) {\n if (numBits !== value.length) {\n throw new DecodingError('invalid bit length');\n }\n return parseInt(value, 2);\n }\n}\n","import { IntEncoder, } from './IntEncoder.js';\nimport { DecodingError, EncodingError, } from '../../errors/index.js';\nexport class LangEncoder {\n static encode(value, numBits) {\n value = value.toUpperCase();\n const ASCII_START = 65;\n const firstLetter = value.charCodeAt(0) - ASCII_START;\n const secondLetter = value.charCodeAt(1) - ASCII_START;\n // check some things to throw some good errors\n if (firstLetter < 0 || firstLetter > 25 || secondLetter < 0 || secondLetter > 25) {\n throw new EncodingError(`invalid language code: ${value}`);\n }\n if (numBits % 2 === 1) {\n throw new EncodingError(`numBits must be even, ${numBits} is not valid`);\n }\n numBits = numBits / 2;\n const firstLetterBString = IntEncoder.encode(firstLetter, numBits);\n const secondLetterBString = IntEncoder.encode(secondLetter, numBits);\n return firstLetterBString + secondLetterBString;\n }\n static decode(value, numBits) {\n let retr;\n // is it an even number of bits? we have to divide it\n if (numBits === value.length && !(value.length % 2)) {\n const ASCII_START = 65;\n const mid = value.length / 2;\n const firstLetter = IntEncoder.decode(value.slice(0, mid), mid) + ASCII_START;\n const secondLetter = IntEncoder.decode(value.slice(mid), mid) + ASCII_START;\n retr = String.fromCharCode(firstLetter) + String.fromCharCode(secondLetter);\n }\n else {\n throw new DecodingError('invalid bit length for language');\n }\n return retr;\n }\n}\n","import { BitLength } from '../BitLength.js';\nimport { BooleanEncoder } from './BooleanEncoder.js';\nimport { DecodingError } from '../../errors/index.js';\nimport { IntEncoder } from './IntEncoder.js';\nimport { PurposeRestrictionVector, PurposeRestriction } from '../../model/index.js';\nexport class PurposeRestrictionVectorEncoder {\n static encode(prVector) {\n // start with the number of restrictions\n let bitString = IntEncoder.encode(prVector.numRestrictions, BitLength.numRestrictions);\n // if the vector is empty we'll just return a string with just the numRestricitons being 0\n if (!prVector.isEmpty()) {\n // create each restriction group\n prVector.getRestrictions().forEach((purpRestriction) => {\n // every restriction group has the purposeId and the restrictionType;\n bitString += IntEncoder.encode(purpRestriction.purposeId, BitLength.purposeId);\n bitString += IntEncoder.encode(purpRestriction.restrictionType, BitLength.restrictionType);\n // now get all the vendors under that restriction\n const vendors = prVector.getVendors(purpRestriction);\n const len = vendors.length;\n /**\n * numEntries comes first so we will have to keep a counter and the do\n * the encoding at the end\n */\n let numEntries = 0;\n let startId = 0;\n let rangeField = '';\n for (let i = 0; i < len; i++) {\n const vendorId = vendors[i];\n if (startId === 0) {\n numEntries++;\n startId = vendorId;\n }\n // we know that `len` is greater than zero because we entered the loop\n const lastVendorId = vendors[len - 1];\n const gvlVendorIds = prVector.gvl.vendorIds;\n const nextGvlVendor = (vendorId) => {\n while (++vendorId <= lastVendorId && !gvlVendorIds.has(vendorId)) {\n }\n return vendorId;\n };\n /**\n * either end of the loop or there are GVL vendor IDs before the next one\n */\n if (i === len - 1 || vendors[i + 1] > nextGvlVendor(vendorId)) {\n /**\n * it's a range entry if we've got something other than the start\n * ID\n */\n const isRange = !(vendorId === startId);\n // 0 means single 1 means range\n rangeField += BooleanEncoder.encode(isRange);\n rangeField += IntEncoder.encode(startId, BitLength.vendorId);\n if (isRange) {\n rangeField += IntEncoder.encode(vendorId, BitLength.vendorId);\n }\n // reset the startId so we grab the next id in the list\n startId = 0;\n }\n }\n /**\n * now that the range encoding is built, encode the number of ranges\n * and then append the range field to the bitString.\n */\n bitString += IntEncoder.encode(numEntries, BitLength.numEntries);\n bitString += rangeField;\n });\n }\n return bitString;\n }\n static decode(encodedString) {\n let index = 0;\n const vector = new PurposeRestrictionVector();\n const numRestrictions = IntEncoder.decode(encodedString.substr(index, BitLength.numRestrictions), BitLength.numRestrictions);\n index += BitLength.numRestrictions;\n for (let i = 0; i < numRestrictions; i++) {\n // First is purpose ID\n const purposeId = IntEncoder.decode(encodedString.substr(index, BitLength.purposeId), BitLength.purposeId);\n index += BitLength.purposeId;\n // Second Restriction Type\n const restrictionType = IntEncoder.decode(encodedString.substr(index, BitLength.restrictionType), BitLength.restrictionType);\n index += BitLength.restrictionType;\n const purposeRestriction = new PurposeRestriction(purposeId, restrictionType);\n // Num Entries (number of vendors)\n const numEntries = IntEncoder.decode(encodedString.substr(index, BitLength.numEntries), BitLength.numEntries);\n index += BitLength.numEntries;\n for (let j = 0; j < numEntries; j++) {\n const isARange = BooleanEncoder.decode(encodedString.substr(index, BitLength.anyBoolean));\n index += BitLength.anyBoolean;\n const startOrOnlyVendorId = IntEncoder.decode(encodedString.substr(index, BitLength.vendorId), BitLength.vendorId);\n index += BitLength.vendorId;\n if (isARange) {\n const endVendorId = IntEncoder.decode(encodedString.substr(index, BitLength.vendorId), BitLength.vendorId);\n index += BitLength.vendorId;\n if (endVendorId < startOrOnlyVendorId) {\n throw new DecodingError(`Invalid RangeEntry: endVendorId ${endVendorId} is less than ${startOrOnlyVendorId}`);\n }\n for (let k = startOrOnlyVendorId; k <= endVendorId; k++) {\n vector.add(k, purposeRestriction);\n }\n }\n else {\n vector.add(startOrOnlyVendorId, purposeRestriction);\n }\n }\n }\n vector.bitLength = index;\n return vector;\n }\n}\n","export var VectorEncodingType;\n(function (VectorEncodingType) {\n VectorEncodingType[VectorEncodingType[\"FIELD\"] = 0] = \"FIELD\";\n VectorEncodingType[VectorEncodingType[\"RANGE\"] = 1] = \"RANGE\";\n})(VectorEncodingType || (VectorEncodingType = {}));\n","import { Vector } from '../../model/index.js';\nimport { BitLength } from '../index.js';\nimport { IntEncoder } from './IntEncoder.js';\nimport { BooleanEncoder } from './BooleanEncoder.js';\nimport { FixedVectorEncoder } from './FixedVectorEncoder.js';\nimport { VectorEncodingType } from './VectorEncodingType.js';\nimport { DecodingError } from '../../errors/index.js';\nexport class VendorVectorEncoder {\n static encode(value) {\n // collectors for range encoding\n const ranges = [];\n let range = [];\n // since both encodings need the maxId, start with that\n let retrString = IntEncoder.encode(value.maxId, BitLength.maxId);\n // bit field will be just the vendors as we walk through the vector\n let bitField = '';\n let rangeIsSmaller;\n // some math\n const headerLength = BitLength.maxId + BitLength.encodingType;\n const bitFieldLength = headerLength + value.maxId;\n const minRangeLength = (BitLength.vendorId * 2 + BitLength.singleOrRange + BitLength.numEntries);\n // gets larger as we walk through the vector\n let rangeLength = headerLength + BitLength.numEntries;\n // walk through every value in the vector\n value.forEach((curValue, i) => {\n // build our bitfield no matter what\n bitField += BooleanEncoder.encode(curValue);\n /**\n * A range is a minimum of 45 bits, if the number of vendors in this\n * vector is less than 45 then we know that a bitfield encoding will be\n * shorter than any range encoding.\n *\n * The second check checks while we walk through the vector and abandons\n * building the ranges once it becomes larger\n */\n rangeIsSmaller = (value.maxId > minRangeLength && rangeLength < bitFieldLength);\n /**\n * if the curValue is true and our rangeLength is less than the bitField\n * length, we'll continue to push these ranges into the array. Once the\n * ranges become a larger encoding there is no reason to continue\n * building the structure because we will be choosing the bitfield\n * encoding\n */\n if (rangeIsSmaller && curValue) {\n /**\n * Look ahead to see if this is the last value in our range\n */\n const nextValue = value.has(i + 1);\n // if there isn't a next value, then we'll wrap up this range\n if (!nextValue) {\n /**\n * this is the last value of the range, so we'll push it on to the\n * end into position 1\n */\n range.push(i);\n // add to the range length the additional vendorId\n rangeLength += BitLength.vendorId;\n // store the array in our bigger array\n ranges.push(range);\n // clear the array for the next range\n range = [];\n }\n else if (range.length === 0) {\n // this is the first value for this range\n range.push(i);\n // update our count with new range overhead\n rangeLength += BitLength.singleOrRange;\n rangeLength += BitLength.vendorId;\n }\n }\n });\n if (rangeIsSmaller) {\n retrString += String(VectorEncodingType.RANGE);\n retrString += this.buildRangeEncoding(ranges);\n }\n else {\n retrString += String(VectorEncodingType.FIELD);\n retrString += bitField;\n }\n return retrString;\n }\n static decode(value, version) {\n let vector;\n let index = 0;\n const maxId = IntEncoder.decode(value.substr(index, BitLength.maxId), BitLength.maxId);\n index += BitLength.maxId;\n const encodingType = IntEncoder.decode(value.charAt(index), BitLength.encodingType);\n index += BitLength.encodingType;\n /**\n * Range is handled in batches so we'll need a different decoding scheme\n */\n if (encodingType === VectorEncodingType.RANGE) {\n vector = new Vector();\n if (version === 1) {\n if (value.substr(index, 1) === '1') {\n throw new DecodingError('Unable to decode default consent=1');\n }\n // jump over the default encoding\n index++;\n }\n const numEntries = IntEncoder.decode(value.substr(index, BitLength.numEntries), BitLength.numEntries);\n index += BitLength.numEntries;\n // loop through each group of entries\n for (let i = 0; i < numEntries; i++) {\n // Ranges can represent a single id or a range of ids.\n const isIdRange = BooleanEncoder.decode(value.charAt(index));\n index += BitLength.singleOrRange;\n /**\n * regardless of whether or not it's a single entry or range, the next\n * set of bits is a vendor ID\n */\n const firstId = IntEncoder.decode(value.substr(index, BitLength.vendorId), BitLength.vendorId);\n index += BitLength.vendorId;\n // if it's a range, the next set of bits is the second id\n if (isIdRange) {\n const secondId = IntEncoder.decode(value.substr(index, BitLength.vendorId), BitLength.vendorId);\n index += BitLength.vendorId;\n // we'll need to set or unset all the vendor ids between the first and second\n for (let j = firstId; j <= secondId; j++) {\n vector.set(j);\n }\n }\n else {\n vector.set(firstId);\n }\n }\n }\n else {\n const bitField = value.substr(index, maxId);\n index += maxId;\n vector = FixedVectorEncoder.decode(bitField, maxId);\n }\n vector.bitLength = index;\n return vector;\n }\n static buildRangeEncoding(ranges) {\n // describe the number of entries to follow\n const numEntries = ranges.length;\n let rangeString = IntEncoder.encode(numEntries, BitLength.numEntries);\n // each range\n ranges.forEach((range) => {\n // is this range a single?\n const single = (range.length === 1);\n // first is the indicator of whether this is a single id or range (two)\n // 0 is single and range is 1\n rangeString += BooleanEncoder.encode(!single);\n // second is the first (or only) vendorId\n rangeString += IntEncoder.encode(range[0], BitLength.vendorId);\n if (!single) {\n // add the second id if it exists\n rangeString += IntEncoder.encode(range[1], BitLength.vendorId);\n }\n });\n return rangeString;\n }\n}\n","export * from './BooleanEncoder.js';\nexport * from './DateEncoder.js';\nexport * from './FieldEncoderMap.js';\nexport * from './FixedVectorEncoder.js';\nexport * from './IntEncoder.js';\nexport * from './LangEncoder.js';\nexport * from './PurposeRestrictionVectorEncoder.js';\nexport * from './VectorEncodingType.js';\nexport * from './VendorVectorEncoder.js';\n","export * from './Base64Url.js';\nexport * from './BitLength.js';\nexport * from './EncodingOptions.js';\nexport * from './SegmentEncoder.js';\nexport * from './SemanticPreEncoder.js';\nexport * from './field/index.js';\nexport * from './sequence/index.js';\n","import { Segment, Fields } from '../../model/index.js';\nexport class FieldSequence {\n '1' = {\n [Segment.CORE]: [\n Fields.version,\n Fields.created,\n Fields.lastUpdated,\n Fields.cmpId,\n Fields.cmpVersion,\n Fields.consentScreen,\n Fields.consentLanguage,\n Fields.vendorListVersion,\n Fields.purposeConsents,\n Fields.vendorConsents,\n ],\n };\n '2' = {\n [Segment.CORE]: [\n Fields.version,\n Fields.created,\n Fields.lastUpdated,\n Fields.cmpId,\n Fields.cmpVersion,\n Fields.consentScreen,\n Fields.consentLanguage,\n Fields.vendorListVersion,\n Fields.policyVersion,\n Fields.isServiceSpecific,\n Fields.useNonStandardStacks,\n Fields.specialFeatureOptins,\n Fields.purposeConsents,\n Fields.purposeLegitimateInterests,\n Fields.purposeOneTreatment,\n Fields.publisherCountryCode,\n Fields.vendorConsents,\n Fields.vendorLegitimateInterests,\n Fields.publisherRestrictions,\n ],\n [Segment.PUBLISHER_TC]: [\n Fields.publisherConsents,\n Fields.publisherLegitimateInterests,\n Fields.numCustomPurposes,\n Fields.publisherCustomConsents,\n Fields.publisherCustomLegitimateInterests,\n ],\n [Segment.VENDORS_ALLOWED]: [\n Fields.vendorsAllowed,\n ],\n [Segment.VENDORS_DISCLOSED]: [\n Fields.vendorsDisclosed,\n ],\n };\n}\n","import { Segment, Fields, } from '../../model/index.js';\nexport class SegmentSequence {\n '1' = [\n Segment.CORE,\n ];\n '2' = [\n Segment.CORE,\n ];\n constructor(tcModel, options) {\n if (tcModel.version === 2) {\n if (tcModel.isServiceSpecific) {\n /**\n * If it's service specific only, then the publisher TC String can be\n * stored in the cookie and would be transmitted if it's not for\n * storage. So it's included regardless of whether or not it's for\n * saving or the cmp api to surface.\n */\n this['2'].push(Segment.PUBLISHER_TC);\n }\n else {\n const isForVendors = !!(options && options.isForVendors);\n /**\n * including vendors disclosed only if it is for saving (to the global\n * scope and not for vendors through the CMP API) or supportOOB is\n * turned on (either or both). The compliment of this being not for\n * saving (surfaced to CMP) and no support of OOB.\n */\n if (!isForVendors || tcModel[Fields.supportOOB] === true) {\n this['2'].push(Segment.VENDORS_DISCLOSED);\n }\n if (isForVendors) {\n /**\n * If a publisher does support OOB and they have narrowed the allowed\n * vendors to utilize it, then we should include the vendors allowed\n * segment. If it is empty then there are no restrictions, if that\n * is intended to mean no support for OOB, then the flag should be\n * set for that instead.\n *\n */\n if (tcModel[Fields.supportOOB] && tcModel[Fields.vendorsAllowed].size > 0) {\n this['2'].push(Segment.VENDORS_ALLOWED);\n }\n /**\n * Always include the publisher TC segment as long as this TC string\n * is not intended to be saved in the global scope.\n */\n this['2'].push(Segment.PUBLISHER_TC);\n }\n }\n }\n }\n}\n","export {};\n","// created from 'create-ts-index'\nexport * from './FieldSequence.js';\nexport * from './SegmentSequence.js';\nexport * from './SequenceVersionMap.js';\n","/**\n * class for decoding errors\n *\n * @extends {Error}\n */\nclass DecodingError extends Error {\n /**\n * constructor - constructs an DecodingError\n *\n * @param {string} msg - Decoding Error Message\n * @return {undefined}\n */\n constructor(msg) {\n super(msg);\n this.name = 'DecodingError';\n }\n}\nexport { DecodingError };\n","/**\n * class for encoding errors\n *\n * @extends {Error}\n */\nclass EncodingError extends Error {\n /**\n * constructor - constructs an EncodingError\n *\n * @param {string} msg - Encoding Error Message\n * @return {undefined}\n */\n constructor(msg) {\n super(msg);\n this.name = 'EncodingError';\n }\n}\nexport { EncodingError };\n","/**\n * class for General GVL Errors\n *\n * @extends {Error}\n */\nclass GVLError extends Error {\n /**\n * constructor - constructs a GVLError\n *\n * @param {string} msg - Error message to display\n * @return {undefined}\n */\n constructor(msg) {\n super(msg);\n this.name = 'GVLError';\n }\n}\nexport { GVLError };\n","/**\n * class for decoding errors\n *\n * @extends {Error}\n */\nclass TCModelError extends Error {\n /**\n * constructor - constructs an TCModelError\n *\n * @param {string} fieldName - the errored field\n * @param {string} passedValue - what was passed\n * @return {undefined}\n */\n constructor(fieldName, passedValue, msg = '') {\n super(`invalid value ${passedValue} passed for ${fieldName} ${msg}`);\n this.name = 'TCModelError';\n }\n}\nexport { TCModelError };\n","export * from './DecodingError.js';\nexport * from './EncodingError.js';\nexport * from './GVLError.js';\nexport * from './TCModelError.js';\n","// created from 'create-ts-index'\nexport * from './encoder/index.js';\nexport * from './errors/index.js';\nexport * from './model/index.js';\nexport * from './Cloneable.js';\nexport * from './GVL.js';\nexport * from './Json.js';\nexport * from './TCModel.js';\nexport * from './TCString.js';\n","import { Cloneable } from '../Cloneable.js';\nexport class BinarySearchTree extends Cloneable {\n root = null;\n getRoot() {\n return this.root;\n }\n isEmpty() {\n // if root is undefined or null then by definition this is empty\n return !(this.root);\n }\n add(value) {\n // create new node object\n const node = {\n value: value,\n left: null,\n right: null,\n };\n let current;\n // first item?\n if (this.isEmpty()) {\n this.root = node;\n }\n else {\n // start at the root\n current = this.root;\n // infinite loop, figure out where to put it\n while (true) {\n // if the value is less than current value; go left\n if (value < current.value) {\n // if it's empty, we can insert\n if (current.left === null) {\n // insert on the left\n current.left = node;\n // our work is done here\n break;\n }\n else {\n /**\n * if there's something there already, we'll reset the pointer and\n * wait for the next loop to do something ie. keep traversing\n */\n current = current.left;\n }\n }\n else if (value > current.value) {\n // if the value is greater than our current value; go right\n if (current.right === null) {\n // there's nothing to the right, so put it here\n current.right = node;\n break;\n }\n else {\n /**\n * if there's something there already, we'll reset the pointer and\n * wait for the next loop to do something ie. keep traversing\n */\n current = current.right;\n }\n }\n else {\n /**\n * If it's neither greater than the right or less than the right then\n * it is equal to the current nodes value. In that case we won't do\n * anything with it because we will only insert unique values.\n */\n break;\n }\n }\n }\n }\n /**\n * performs Morris in-order traversal\n * @return {number[]} sorted array\n */\n get() {\n const retr = [];\n let current = this.root;\n while (current) {\n if (!current.left) {\n retr.push(current.value); // if there is no left child, visit current node\n current = current.right; // then we go the right branch\n }\n else {\n // find the right most leaf of root.left node.\n let pre = current.left;\n // when pre.right == null, it means we go to the right most leaf\n // when pre.right == current, it means the right most leaf has been visited in the last round\n while (pre.right && pre.right != current) {\n pre = pre.right;\n }\n // this means the pre.right has been set, it's time to go to current node\n if (pre.right == current) {\n pre.right = null;\n // means the current node is pointed by left right most child\n // the left branch has been visited, it's time to push the current node\n retr.push(current.value);\n current = current.right;\n }\n else {\n // the fist time to visit the pre node, make its right child point to current node\n pre.right = current;\n current = current.left;\n }\n }\n }\n return retr;\n }\n contains(value) {\n let retr = false;\n let current = this.root;\n while (current) {\n if (current.value === value) {\n retr = true;\n break;\n }\n else if (value > current.value) {\n current = current.right;\n }\n else if (value < current.value) {\n current = current.left;\n }\n }\n return retr;\n }\n min(current = this.root) {\n let retr;\n while (current) {\n if (current.left) {\n current = current.left;\n }\n else {\n retr = current.value;\n current = null;\n }\n }\n return retr;\n }\n max(current = this.root) {\n let retr;\n while (current) {\n if (current.right) {\n current = current.right;\n }\n else {\n retr = current.value;\n current = null;\n }\n }\n return retr;\n }\n remove(value, current = this.root) {\n // we start at the root, so the parent is null\n let parent = null;\n let parentSide = 'left';\n while (current) {\n if (value < current.value) {\n // set our parent to the current value\n parent = current;\n // value is less than current value, so go left\n current = current.left;\n parentSide = 'left';\n }\n else if (value > current.value) {\n // set our parent to the current value\n parent = current;\n // value is greater than current value, so go right\n current = current.right;\n parentSide = 'right';\n }\n else {\n /**\n * if it's neither greater than or less than, then it's equal so BINGO!\n * we've found it\n *\n * If we have children, we've got to figure out what to do with\n * them once we are no longer around... Woah, code is like real\n * life...\n *\n * There are three cases we care about when it comes to this removal\n * process:\n *\n * 1. No children -- If not children we just delete an do nothing\n * else, no harm no foul.\n *\n * 2. One child -- Just link the parent's link to current to the\n * child.\n *\n * 3. Two children -- Find the minimum value from the right subtree\n * replace us with the minimum value and of course remove that\n * minimum value from the right stubtree\n */\n if (!current.left && !current.right) {\n // case 1 there are no children easy peasy lemon squeezy\n if (parent) {\n parent[parentSide] = null;\n }\n else {\n this.root = null;\n }\n }\n else if (!current.left) {\n // no left side only right, so link right\n if (parent) {\n parent[parentSide] = current.right;\n }\n else {\n this.root = current.right;\n }\n }\n else if (!current.right) {\n // no right side only left, so link left\n if (parent) {\n parent[parentSide] = current.left;\n }\n else {\n this.root = current.left;\n }\n }\n else {\n /**\n * case 3 just like real life, if you delete a parent the more kids\n * that parent has the more complicated things get... in this case we\n * have two children. We're gonna have to figure out who goes where.\n */\n const minVal = this.min(current.right);\n // little bit of recursion...\n this.remove(minVal, current.right);\n current.value = minVal;\n }\n current = null;\n }\n }\n }\n /**\n * Build Binary Search Tree from the ordered number array.\n * The depth of the tree will be the `log2` of the array length.\n * @param {number[]} values number array in ascending order\n * @return {BinarySearchTree} Binary Search Tree\n */\n static build(values) {\n if (!values || values.length === 0) {\n return null;\n }\n else if (values.length === 1) {\n const tree = new BinarySearchTree();\n tree.add(values[0]);\n return tree;\n }\n else {\n const rootIndex = values.length >> 1;\n const tree = new BinarySearchTree();\n tree.add(values[rootIndex]);\n const root = tree.getRoot();\n if (root) {\n if (rootIndex + 1 < values.length) {\n const rightTree = BinarySearchTree.build(values.slice(rootIndex + 1));\n root.right = rightTree ? rightTree.getRoot() : null;\n }\n if (rootIndex - 1 > 0) {\n const leftTree = BinarySearchTree.build(values.slice(0, rootIndex - 1));\n root.left = leftTree ? leftTree.getRoot() : null;\n }\n }\n return tree;\n }\n }\n}\n","export class ConsentLanguages {\n static langSet = new Set([\n 'BG',\n 'CA',\n 'CS',\n 'DA',\n 'DE',\n 'EL',\n 'EN',\n 'ES',\n 'ET',\n 'FI',\n 'FR',\n 'HR',\n 'HU',\n 'IT',\n 'JA',\n 'LT',\n 'LV',\n 'MT',\n 'NL',\n 'NO',\n 'PL',\n 'PT',\n 'RO',\n 'RU',\n 'SK',\n 'SL',\n 'SV',\n 'TR',\n 'ZH',\n ]);\n has(key) {\n return ConsentLanguages.langSet.has(key);\n }\n forEach(callback) {\n ConsentLanguages.langSet.forEach(callback);\n }\n get size() {\n return ConsentLanguages.langSet.size;\n }\n}\n","export {};\n","export var DeviceDisclosureStorageAccessType;\n(function (DeviceDisclosureStorageAccessType) {\n DeviceDisclosureStorageAccessType[\"COOKIE\"] = \"cookie\";\n DeviceDisclosureStorageAccessType[\"WEB\"] = \"web\";\n DeviceDisclosureStorageAccessType[\"APP\"] = \"app\";\n})(DeviceDisclosureStorageAccessType || (DeviceDisclosureStorageAccessType = {}));\n","export class Fields {\n static cmpId = 'cmpId';\n static cmpVersion = 'cmpVersion';\n static consentLanguage = 'consentLanguage';\n static consentScreen = 'consentScreen';\n static created = 'created';\n static supportOOB = 'supportOOB';\n static isServiceSpecific = 'isServiceSpecific';\n static lastUpdated = 'lastUpdated';\n static numCustomPurposes = 'numCustomPurposes';\n static policyVersion = 'policyVersion';\n static publisherCountryCode = 'publisherCountryCode';\n static publisherCustomConsents = 'publisherCustomConsents';\n static publisherCustomLegitimateInterests = 'publisherCustomLegitimateInterests';\n static publisherLegitimateInterests = 'publisherLegitimateInterests';\n static publisherConsents = 'publisherConsents';\n static publisherRestrictions = 'publisherRestrictions';\n static purposeConsents = 'purposeConsents';\n static purposeLegitimateInterests = 'purposeLegitimateInterests';\n static purposeOneTreatment = 'purposeOneTreatment';\n static specialFeatureOptins = 'specialFeatureOptins';\n static useNonStandardStacks = 'useNonStandardStacks';\n static vendorConsents = 'vendorConsents';\n static vendorLegitimateInterests = 'vendorLegitimateInterests';\n static vendorListVersion = 'vendorListVersion';\n static vendorsAllowed = 'vendorsAllowed';\n static vendorsDisclosed = 'vendorsDisclosed';\n static version = 'version';\n}\n","export {};\n","export {};\n","import { Cloneable } from '../Cloneable.js';\nimport { TCModelError } from '../errors/index.js';\nimport { RestrictionType } from './RestrictionType.js';\nexport class PurposeRestriction extends Cloneable {\n static hashSeparator = '-';\n purposeId_;\n restrictionType;\n /**\n * constructor\n *\n * @param {number} purposeId? - may optionally pass the purposeId into the\n * constructor\n * @param {RestrictionType} restrictionType? - may\n * optionally pass the restrictionType into the constructor\n * @return {undefined}\n */\n constructor(purposeId, restrictionType) {\n super();\n if (purposeId !== undefined) {\n this.purposeId = purposeId;\n }\n if (restrictionType !== undefined) {\n this.restrictionType = restrictionType;\n }\n }\n static unHash(hash) {\n const splitUp = hash.split(this.hashSeparator);\n const purpRestriction = new PurposeRestriction();\n if (splitUp.length !== 2) {\n throw new TCModelError('hash', hash);\n }\n purpRestriction.purposeId = parseInt(splitUp[0], 10);\n purpRestriction.restrictionType = parseInt(splitUp[1], 10);\n return purpRestriction;\n }\n get hash() {\n if (!this.isValid()) {\n throw new Error('cannot hash invalid PurposeRestriction');\n }\n return `${this.purposeId}${PurposeRestriction.hashSeparator}${this.restrictionType}`;\n }\n /**\n * @return {number} The purpose Id associated with a publisher\n * purpose-by-vendor restriction that resulted in a different consent or LI\n * status than the consent or LI purposes allowed lists.\n */\n get purposeId() {\n return this.purposeId_;\n }\n /**\n * @param {number} idNum - The purpose Id associated with a publisher\n * purpose-by-vendor restriction that resulted in a different consent or LI\n * status than the consent or LI purposes allowed lists.\n */\n set purposeId(idNum) {\n this.purposeId_ = idNum;\n }\n isValid() {\n return (Number.isInteger(this.purposeId) &&\n this.purposeId > 0 &&\n (this.restrictionType === RestrictionType.NOT_ALLOWED ||\n this.restrictionType === RestrictionType.REQUIRE_CONSENT ||\n this.restrictionType === RestrictionType.REQUIRE_LI));\n }\n isSameAs(otherPR) {\n return (this.purposeId === otherPR.purposeId &&\n this.restrictionType === otherPR.restrictionType);\n }\n}\n","import { PurposeRestriction } from './PurposeRestriction.js';\nimport { BinarySearchTree } from './BinarySearchTree.js';\nimport { RestrictionType } from './RestrictionType.js';\nimport { Cloneable } from '../Cloneable.js';\nexport class PurposeRestrictionVector extends Cloneable {\n /**\n * if this originatd from an encoded string we'll need a place to store the\n * bit length; it can be set and got from here\n */\n bitLength = 0;\n /**\n * a map indexed by a string which will be a 'hash' of the purpose and\n * restriction type.\n *\n * Using a BST to keep vendors in a sorted order for encoding later\n */\n map = new Map();\n gvl_;\n has(hash) {\n return this.map.has(hash);\n }\n isOkToHave(restrictionType, purposeId, vendorId) {\n let result = true;\n /**\n * without a gvl set, there's no way to know... in that case we'll return\n * true but once the GVL is set later we'll go through these and clean up\n * the mess.\n */\n if (this.gvl?.vendors) {\n const vendor = this.gvl.vendors[vendorId];\n if (vendor) {\n if (restrictionType === RestrictionType.NOT_ALLOWED) {\n /**\n * if it's \"not allowed\" then flexible declaration is ignored but if\n * if it isn't even listed as one of the purposes the vendor uses,\n * then there is no reason to encode the value so check both arrays\n * to see if it exists. If it does then we can restrict it.\n */\n result = (vendor.legIntPurposes.includes(purposeId) || vendor.purposes.includes(purposeId));\n }\n else if (vendor.flexiblePurposes.length) {\n switch (restrictionType) {\n /**\n * If the vendor has the purposeId in flexiblePurposes and it is\n * listed as a legitimate interest purpose we can set the\n * override to require consent.\n */\n case RestrictionType.REQUIRE_CONSENT:\n result = (vendor.flexiblePurposes.includes(purposeId) && vendor.legIntPurposes.includes(purposeId));\n break;\n /**\n * If the vendor has the purposeId in flexiblePurposes and it is\n * listed as a consent purpose we can set the\n * override to require legitimate interest.\n */\n case RestrictionType.REQUIRE_LI:\n result = (vendor.flexiblePurposes.includes(purposeId) && vendor.purposes.includes(purposeId));\n break;\n }\n }\n else {\n result = false;\n }\n }\n else {\n // this vendor doesn't exist\n result = false;\n }\n }\n // if the gvl isn't defined, we can't do anything until later\n return result;\n }\n /**\n * add - adds a given Vendor ID under a given Purpose Restriction\n *\n * @param {number} vendorId\n * @param {PurposeRestriction} purposeRestriction\n * @return {void}\n */\n add(vendorId, purposeRestriction) {\n if (this.isOkToHave(purposeRestriction.restrictionType, purposeRestriction.purposeId, vendorId)) {\n const hash = purposeRestriction.hash;\n if (!this.has(hash)) {\n this.map.set(hash, new BinarySearchTree());\n this.bitLength = 0;\n }\n /**\n * Previously I had a check here to remove a duplicate value, but because\n * we're using a tree the value is guaranteed to be unique so there is no\n * need to add an additional de-duplication here.\n */\n this.map.get(hash).add(vendorId);\n }\n }\n /**\n * restrictPurposeToLegalBasis - adds all Vendors under a given Purpose Restriction\n *\n * @param {PurposeRestriction} purposeRestriction\n * @return {void}\n */\n restrictPurposeToLegalBasis(purposeRestriction) {\n const vendors = this.gvl.vendorIds;\n const hash = purposeRestriction.hash;\n const lastEntry = (function () {\n let value;\n for (value of vendors)\n ;\n return value;\n })();\n /**\n * Create an ordered array of vendor IDs from `1` (the minimum value for Vendor ID) to `lastEntry`\n */\n const values = [...Array(lastEntry).keys()].map((i) => i + 1);\n for (let i = 1; i <= lastEntry; i++) {\n if (!this.has(hash)) {\n this.map.set(hash, BinarySearchTree.build(values)); // use static method `build` to create a `BST` from the ordered array of IDs\n this.bitLength = 0;\n }\n /**\n * Previously I had a check here to remove a duplicate value, but because\n * we're using a tree the value is guaranteed to be unique so there is no\n * need to add an additional de-duplication here.\n */\n this.map.get(hash).add(i);\n }\n }\n /**\n * getVendors - returns array of vendor ids optionally narrowed by a given\n * Purpose Restriction. If no purpose restriction is passed then all vendor\n * ids will be returned. One can expect this result to be a unique set of\n * ids no duplicates.\n *\n * @param {PurposeRestriction} [purposeRestriction] - optionally passed to\n * get only Vendor IDs restricted under the given Purpose Restriction\n * @return {number[]} - Unique ID set of vendors\n */\n getVendors(purposeRestriction) {\n let vendorIds = [];\n if (purposeRestriction) {\n const hash = purposeRestriction.hash;\n if (this.has(hash)) {\n vendorIds = this.map.get(hash).get();\n }\n }\n else {\n const vendorSet = new Set();\n this.map.forEach((bst) => {\n bst.get().forEach((vendorId) => {\n vendorSet.add(vendorId);\n });\n });\n vendorIds = Array.from(vendorSet);\n }\n return vendorIds;\n }\n getRestrictionType(vendorId, purposeId) {\n let rType;\n this.getRestrictions(vendorId).forEach((purposeRestriction) => {\n if (purposeRestriction.purposeId === purposeId) {\n if (rType === undefined || rType > purposeRestriction.restrictionType) {\n rType = purposeRestriction.restrictionType;\n }\n }\n });\n return rType;\n }\n /**\n * vendorHasRestriction - determines whether a given Vendor ID is under a\n * given Purpose Restriction\n *\n * @param {number} vendorId\n * @param {PurposeRestriction} purposeRestriction\n * @return {boolean} - true if the give Vendor ID is under the given Purpose\n * Restriction\n */\n vendorHasRestriction(vendorId, purposeRestriction) {\n let has = false;\n const restrictions = this.getRestrictions(vendorId);\n for (let i = 0; i < restrictions.length && !has; i++) {\n has = purposeRestriction.isSameAs(restrictions[i]);\n }\n return has;\n }\n /**\n * getMaxVendorId - gets the Maximum Vendor ID regardless of Purpose\n * Restriction\n *\n * @return {number} - maximum Vendor ID\n */\n getMaxVendorId() {\n let retr = 0;\n this.map.forEach((bst) => {\n retr = Math.max(bst.max(), retr);\n });\n return retr;\n }\n getRestrictions(vendorId) {\n const retr = [];\n this.map.forEach((bst, hash) => {\n if (vendorId) {\n if (bst.contains(vendorId)) {\n retr.push(PurposeRestriction.unHash(hash));\n }\n }\n else {\n retr.push(PurposeRestriction.unHash(hash));\n }\n });\n return retr;\n }\n getPurposes() {\n const purposeIds = new Set();\n this.map.forEach((bst, hash) => {\n purposeIds.add(PurposeRestriction.unHash(hash).purposeId);\n });\n return Array.from(purposeIds);\n }\n /**\n * remove - removes Vendor ID from a Purpose Restriction\n *\n * @param {number} vendorId\n * @param {PurposeRestriction} purposeRestriction\n * @return {void}\n */\n remove(vendorId, purposeRestriction) {\n const hash = purposeRestriction.hash;\n const bst = this.map.get(hash);\n if (bst) {\n bst.remove(vendorId);\n // if it's empty let's delete the key so it doesn't show up empty\n if (bst.isEmpty()) {\n this.map.delete(hash);\n this.bitLength = 0;\n }\n }\n }\n /**\n * Essential for being able to determine whether we can actually set a\n * purpose restriction since they have to have a flexible legal basis\n *\n * @param {GVL} value - the GVL instance\n */\n set gvl(value) {\n if (!this.gvl_) {\n this.gvl_ = value;\n /**\n * if we have restrictions set before the gvl is set then we'll have to\n * go through and remove some if they're not valid\n */\n this.map.forEach((bst, hash) => {\n const purposeRestriction = PurposeRestriction.unHash(hash);\n const vendors = bst.get();\n vendors.forEach((vendorId) => {\n if (!this.isOkToHave(purposeRestriction.restrictionType, purposeRestriction.purposeId, vendorId)) {\n bst.remove(vendorId);\n }\n });\n });\n }\n }\n /**\n * gvl returns local copy of the GVL these restrictions apply to\n *\n * @return {GVL}\n */\n get gvl() {\n return this.gvl_;\n }\n /**\n * isEmpty - whether or not this vector has any restrictions in it\n *\n * @return {boolean}\n */\n isEmpty() {\n return this.map.size === 0;\n }\n ;\n /**\n * numRestrictions - returns the number of Purpose Restrictions.\n *\n * @return {number}\n */\n get numRestrictions() {\n return this.map.size;\n }\n}\n","/**\n * if a Vendor has declared flexible purposes (see: [[Vendor]] under\n * `flexiblePurposeIds`) on the Global Vendor List ([[Declarations]]) a CMP may\n * change their legal basis for processing in the encoding.\n */\nexport var RestrictionType;\n(function (RestrictionType) {\n /**\n * under no circumstances is this purpose allowed.\n */\n RestrictionType[RestrictionType[\"NOT_ALLOWED\"] = 0] = \"NOT_ALLOWED\";\n /**\n * if the default declaration is legitimate interest then this flips the purpose to consent in the encoding.\n */\n RestrictionType[RestrictionType[\"REQUIRE_CONSENT\"] = 1] = \"REQUIRE_CONSENT\";\n /**\n * if the default declaration is consent then this flips the purpose to Legitimate Interest in the encoding.\n */\n RestrictionType[RestrictionType[\"REQUIRE_LI\"] = 2] = \"REQUIRE_LI\";\n})(RestrictionType || (RestrictionType = {}));\n","export var Segment;\n(function (Segment) {\n Segment[\"CORE\"] = \"core\";\n Segment[\"VENDORS_DISCLOSED\"] = \"vendorsDisclosed\";\n Segment[\"VENDORS_ALLOWED\"] = \"vendorsAllowed\";\n Segment[\"PUBLISHER_TC\"] = \"publisherTC\";\n})(Segment || (Segment = {}));\n","import { Segment } from './Segment.js';\nexport class SegmentIDs {\n /**\n * 0 = default - reserved for core string (does not need to be present in the core string)\n * 1 = OOB vendors disclosed\n * 2 = OOB vendors allowed\n * 3 = PublisherTC\n */\n static ID_TO_KEY = [\n Segment.CORE,\n Segment.VENDORS_DISCLOSED,\n Segment.VENDORS_ALLOWED,\n Segment.PUBLISHER_TC,\n ];\n static KEY_TO_ID = {\n [Segment.CORE]: 0,\n [Segment.VENDORS_DISCLOSED]: 1,\n [Segment.VENDORS_ALLOWED]: 2,\n [Segment.PUBLISHER_TC]: 3,\n };\n}\n","import { Cloneable } from '../Cloneable.js';\nimport { TCModelError } from '../errors/index.js';\n/**\n * Vector class is like a Set except it keeps track of a max id\n */\nexport class Vector extends Cloneable {\n /**\n * if this originatd from an encoded string we'll need a place to store the\n * bit length; it can be set and got from here\n */\n bitLength = 0;\n maxId_ = 0;\n set_ = new Set();\n *[Symbol.iterator]() {\n for (let i = 1; i <= this.maxId; i++) {\n yield [i, this.has(i)];\n }\n }\n /**\n * values()\n *\n * @return {IterableIterator} - returns an iterator of the positive\n * values in the set\n */\n values() {\n return this.set_.values();\n }\n /**\n * maxId\n *\n * @return {number} - the highest id in this Vector\n */\n get maxId() {\n return this.maxId_;\n }\n /**\n * get\n *\n * @param {number} id - key for value to check\n * @return {boolean} - value of that key, if never set it will be false\n */\n has(id) {\n /**\n * if it exists in the set we'll return true\n */\n return this.set_.has(id);\n }\n /**\n * unset\n *\n * @param {SingleIDOrCollection} id - id or ids to unset\n * @return {void}\n */\n unset(id) {\n if (Array.isArray(id)) {\n id.forEach((id) => this.unset(id));\n }\n else if (typeof id === 'object') {\n this.unset(Object.keys(id).map((strId) => Number(strId)));\n }\n else {\n this.set_.delete(Number(id));\n /**\n * if bitLength was set before, it must now be unset\n */\n this.bitLength = 0;\n if (id === this.maxId) {\n /**\n * aww bummer we lost our maxId... now we've got to search through\n * all the ids and find the biggest one.\n */\n this.maxId_ = 0;\n this.set_.forEach((id) => {\n this.maxId_ = Math.max(this.maxId, id);\n });\n }\n }\n }\n isIntMap(item) {\n let result = (typeof item === 'object');\n result = (result && Object.keys(item).every((key) => {\n let itemResult = Number.isInteger(parseInt(key, 10));\n itemResult = (itemResult && this.isValidNumber(item[key].id));\n itemResult = (itemResult && item[key].name !== undefined);\n return itemResult;\n }));\n return result;\n }\n isValidNumber(item) {\n return (parseInt(item, 10) > 0);\n }\n isSet(item) {\n let result = false;\n if (item instanceof Set) {\n result = Array.from(item).every(this.isValidNumber);\n }\n return result;\n }\n /**\n * set - sets an item assumed to be a truthy value by its presence\n *\n * @param {SingleIDOrCollection} item - May be a single id (positive integer)\n * or collection of ids in a set, GVL Int Map, or Array.\n *\n * @return {void}\n */\n set(item) {\n /**\n * strategy here is to just recursively call set if it's a collection until\n * we get to the final integer ID\n */\n if (Array.isArray(item)) {\n item.forEach((item) => this.set(item));\n }\n else if (this.isSet(item)) {\n this.set(Array.from(item));\n }\n else if (this.isIntMap(item)) {\n this.set(Object.keys(item).map((strId) => Number(strId)));\n }\n else if (this.isValidNumber(item)) {\n this.set_.add(item);\n this.maxId_ = Math.max(this.maxId, item);\n /**\n * if bitLength was set before, it must now be unset\n */\n this.bitLength = 0;\n }\n else {\n /**\n * Super not cool to try and set something that's not valid\n */\n throw new TCModelError('set()', item, 'must be positive integer array, positive integer, Set, or IntMap');\n }\n }\n empty() {\n this.set_ = new Set();\n }\n /**\n * forEach - to traverse from id=1 to id=maxId in a sequential non-sparse manner\n *\n *\n * @param {forEachCallback} callback - callback to execute\n * @return {void}\n *\n * @callback forEachCallback\n * @param {boolean} value - whether or not this id exists in the vector\n * @param {number} id - the id number of the current iteration\n */\n forEach(callback) {\n for (let i = 1; i <= this.maxId; i++) {\n callback(this.has(i), i);\n }\n }\n get size() {\n return this.set_.size;\n }\n setAll(intMap) {\n this.set(intMap);\n }\n}\n","export {};\n","export {};\n",";\nexport {};\n","export {};\n","export {};\n","export {};\n","export {};\n","export {};\n","export {};\n","// created from 'create-ts-index'\nexport * from './ByPurposeVendorMap.js';\nexport * from './Declarations.js';\nexport * from './Feature.js';\nexport * from './GVLMapItem.js';\nexport * from './IDSetMap.js';\nexport * from './Purpose.js';\nexport * from './Stack.js';\nexport * from './Vendor.js';\nexport * from './VendorList.js';\n","export * from './BinarySearchTree.js';\nexport * from './ConsentLanguages.js';\nexport * from './Fields.js';\nexport * from './IntMap.js';\nexport * from './KeyMap.js';\nexport * from './PurposeRestriction.js';\nexport * from './PurposeRestrictionVector.js';\nexport * from './DeviceDisclosureStorageAccessType.js';\nexport * from './DeviceDisclosure.js';\nexport * from './RestrictionType.js';\nexport * from './Segment.js';\nexport * from './SegmentIDs.js';\nexport * from './Vector.js';\nexport * from './gvl/index.js';\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Resources\n * https://github.com/InteractiveAdvertisingBureau/iabtcf-es\n * */\nimport {CmpApi} from '@iabtcf/cmpapi';\nimport {TCModel, TCString, GVL, Segment} from '@iabtcf/core';\nimport UsprivacyString from '../ccpa/src/uspapi.js';\nconst cmplzCMP = 332;\nconst cmplzCMPVersion = 1;\nconst cmplzIsServiceSpecific = cmplz_tcf.isServiceSpecific == 1 ? true : false;\nconst cmplzExistingLanguages = ['gl','eu','bg', 'ca', 'cs', 'da', 'de', 'el', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'it', 'ja', 'lt', 'lv', 'mt', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'tr', 'zh',];\nvar langCount = cmplzExistingLanguages.length;\nlet cmplz_html_lang_attr = document.documentElement.lang.length ? document.documentElement.lang.toLowerCase() : 'en';\nlet cmplzLanguage = 'en';\nfor (var i = 0; i < langCount; i++) {\n\tvar cmplzLocale = cmplzExistingLanguages[i];\n\tif (cmplz_html_lang_attr.indexOf(cmplzLocale)!=-1) {\n\t\tcmplzLanguage = cmplzLocale;\n\t\tbreak;\n\t}\n}\nif (cmplzLanguage==='eu') cmplzLanguage='eus';\nlet cmplzLanguageJson;\n\nlet onOptOutPolicyPage = document.getElementById('cmplz-tcf-us-vendor-container') !== null;\nlet onOptInPolicyPage = document.getElementById('cmplz-tcf-vendor-container') !== null;\n/**\n * initialize the __tcfapi function and post message\n * https://github.com/InteractiveAdvertisingBureau/iabtcf-es/tree/master/modules/stub\n */\n\nlet purposesUrl = cmplz_tcf.cmp_url+'cmp/vendorlist'+'/purposes-'+cmplzLanguage+'.json';\nif (!cmplzExistingLanguages.includes(cmplzLanguage)) {\n\tcmplzLanguage = 'en';\n\tpurposesUrl = cmplz_tcf.cmp_url + 'cmp/vendorlist' + '/vendor-list.json';\n}\n\n/**\n * Create an element\n * @param el\n * @param content\n * @returns {*}\n */\nfunction create_element(el, content) {\n\tlet obj = document.createElement(el);\n\tobj.innerHtml = content;\n\treturn obj;\n}\n\n/**\n * Get a cookie by name\n * @param name\n * @returns {string}\n */\n\nfunction cmplz_tcf_get_cookie(name) {\n\tif (typeof document === \"undefined\") {\n\t\treturn \"\";\n\t}\n\tname = complianz.prefix + name;\n\tconst value = \"; \" + document.cookie;\n\tconst parts = value.split(\"; \" + name + \"=\");\n\tif ( parts.length === 2 ) {\n\t\treturn parts.pop().split(\";\").shift();\n\t}\n\treturn \"\";\n}\n\n/**\n * Add an event\n * @param event\n * @param selector\n * @param callback\n * @param context\n */\nfunction cmplz_tcf_add_event(event, selector, callback, context) {\n\tdocument.addEventListener(event, e => {\n\t\tif ( e.target.closest(selector) ) {\n\t\t\tcallback(e);\n\t\t}\n\t});\n}\n\n/**\n * Check if the element is hidden\n * @param el\n * @returns {boolean}\n */\nfunction is_hidden(el) {\n\treturn (el.offsetParent === null)\n}\n\nvar bannerDataLoadedResolve;\nvar tcModelLoadedResolve;\nvar tcfLanguageLoadedResolve;\nvar bannerLoadedResolve;\nvar revokeResolve;\nvar bannerDataLoaded = new Promise(function(resolve, reject){\n\tbannerDataLoadedResolve = resolve;\n});\nvar tcModelLoaded = new Promise(function(resolve, reject){\n\ttcModelLoadedResolve = resolve;\n});\nvar tcfLanguageLoaded = new Promise(function(resolve, reject){\n\ttcfLanguageLoadedResolve = resolve;\n});\nvar bannerLoaded = new Promise(function(resolve, reject){\n\tbannerLoadedResolve = resolve;\n});\nvar revoke = new Promise(function(resolve, reject){\n\trevokeResolve = resolve;\n});\n\nfetch(purposesUrl, {\n\tmethod: \"GET\",\n}).then(response => response.json())\n\t.then(\n\t\tfunction (data) {\n\t\t\tcmplzLanguageJson = data;\n\t\t\ttcfLanguageLoadedResolve();\n\t\t}\n\t);\n\ndocument.addEventListener('wp_consent_type_defined', function (e) {\n\tbannerDataLoadedResolve();\n});\ndocument.addEventListener('cmplz_cookie_warning_loaded', function (e) {\n\tif ( !complianz.disable_cookiebanner) {\n\t\tbannerLoadedResolve();\n\t}\n});\ndocument.addEventListener('cmplz_revoke', function (e) {\n\tconst reload = e.detail;\n\trevokeResolve(reload);\n});\n\nbannerDataLoaded.then(()=>{\n\n});\n\ntcfLanguageLoaded.then(()=>{\n\tGVL.baseUrl = cmplz_tcf.cmp_url + \"cmp/vendorlist\";\n\tlet gvl = new GVL(cmplzLanguageJson);\n\tlet sourceGvl = gvl.clone();\n\tlet tcModel = new TCModel(gvl);\n\ttcModel.publisherCountryCode = cmplz_tcf.publisherCountryCode;\n\ttcModel.version = 2;\n\ttcModel.cmpId = cmplzCMP;\n\ttcModel.cmpVersion = cmplzCMPVersion;\n\ttcModel.isServiceSpecific = cmplzIsServiceSpecific;\n\ttcModel.UseNonStandardStacks = 0; //A CMP that services multiple publishers sets this value to 0\n\tconst cmpApi = new CmpApi(cmplzCMP, cmplzCMPVersion, cmplzIsServiceSpecific);//Whether the signals encoded in this TC String were from service-specific storage (true) versus ‘global’ consensu.org shared storage (false).\n\tconst storedTCString = cmplzGetTCString();\n\n\t/**\n\t * After banner data is fully loaded\n\t */\n\n\ttcModel.gvl.readyPromise.then(() => {\n\t\tconst json = tcModel.gvl.getJson();\n\t\tlet vendors = json.vendors;\n\t\tlet vendorIds = cmplzFilterVendors(vendors);\n\t\ttcModel.gvl.narrowVendorsTo(vendorIds);\n\t\t//update model with given consents\n\t\ttry {\n\t\t\ttcModel = TCString.decode(storedTCString, tcModel);\n\t\t} catch (err) {}\n\n\t\ttcModelLoadedResolve();\n\t});\n\n\tPromise.all([bannerDataLoaded, tcModelLoaded]).then(()=> {\n\t\tinsertVendorsInPolicy(tcModel.gvl.vendors);\n\t\tif (complianz.consenttype === 'optin'){\n\t\t\tif (cmplz_tcf.debug) console.log(tcModel);\n\t\t\tvar date = new Date();\n\t\t\t/**\n\t\t\t * If the TC String was created over a year ago, we clear it.\n\t\t\t */\n\t\t\tif (Date.parse(tcModel.created) < date.getTime() - 365 * 24 * 60 * 60 * 1000) {\n\t\t\t\tcmplzSetTCString(null, cmplzUIVisible() );\n\t\t\t} else {\n\t\t\t\tcmplzSetTCString(tcModel, cmplzUIVisible() );\n\t\t\t}\n\t\t} else {\n\t\t\tif (cmplz_tcf.debug) console.log(\"not an optin tcf region\");\n\t\t\tcmplzSetTCString(null, false );\n\t\t}\n\t});\n\n\tPromise.all([bannerLoaded, tcModelLoaded, tcfLanguageLoaded]).then(()=> {\n\t\tconfigureOptinBanner();\n\t});\n\n\trevoke.then(reload => {\n\t\tif (cmplz_is_tcf_region(complianz.region)) {\n\t\t\trevokeAllVendors(reload);\n\t\t}\n\t});\n\n\t/**\n\t * When the marketing is accepted, make sure all vendors are allowed\n\t */\n\n\tdocument.addEventListener(\"cmplz_fire_categories\", function (e) {\n\t\t//skip if not gdpr\n\t\tif (complianz.consenttype !== 'optin') {\n\t\t\treturn;\n\t\t}\n\t\tif (cmplz_in_array('marketing', e.detail.categories)) {\n\t\t\tacceptAllVendors();\n\t\t}\n\t});\n\n\t/**\n\t * Accept all vendors\n\t */\n\tfunction acceptAllVendors() {\n\t\tcmplzSetAllVendorLegitimateInterests();\n\t\ttcModel.setAllPurposeLegitimateInterests();\n\t\tfor (var key in cmplz_tcf.purposes) {\n\t\t\ttcModel.purposeConsents.set(cmplz_tcf.purposes[key]);\n\t\t\tcmplzSetTypeByVendor('purpose_legitimate_interest', cmplz_tcf.purposes[key]);\n\t\t}\n\n\t\ttcModel.setAllSpecialFeatureOptins()\n\t\tfor (var key in cmplz_tcf.specialFeatures) {\n\t\t\ttcModel.specialFeatureOptins.set(cmplz_tcf.specialFeatures[key]);\n\t\t\tcmplzSetTypeByVendor('specialfeature', cmplz_tcf.specialFeatures[key]);\n\t\t}\n\n\t\ttcModel.setAllPurposeConsents();\n\t\tfor (var key in cmplz_tcf.purposes) {\n\t\t\ttcModel.purposeConsents.set(cmplz_tcf.purposes[key]);\n\t\t\tcmplzSetTypeByVendor('purpose_consent', cmplz_tcf.purposes[key]);\n\t\t}\n\n\t\ttcModel.setAllVendorConsents();\n\t\tdocument.querySelectorAll('.cmplz-tcf-input').forEach(checkbox => {\n\t\t\tcheckbox.checked = true;\n\t\t});\n\n\t\tcmplzSetTCString(tcModel, cmplzUIVisible() );\n\t\tcmplz_set_cookie('banner-status', 'dismissed');\n\t}\n\n\t/**\n\t * Revoke all vendors\n\t * @param reload\n\t */\n\tfunction revokeAllVendors(reload) {\n\t\t//legint should be handled by right to object checkbox in vendor overview.\n\t\t// tcModel.unsetAllVendorLegitimateInterests();\n\t\ttcModel.unsetAllPurposeLegitimateInterests();\n\n\t\tcmplzUnsetAllVendorLegitimateInterests();\n\t\tfor (var key in cmplz_tcf.specialFeatures) {\n\t\t\ttcModel.specialFeatureOptins.set(cmplz_tcf.specialFeatures[key]);\n\t\t\tcmplzUnsetTypeByVendor('specialfeature', cmplz_tcf.specialFeatures[key]);\n\t\t}\n\n\t\tfor (var key in cmplz_tcf.purposes) {\n\t\t\ttcModel.purposeConsents.set(cmplz_tcf.purposes[key]);\n\t\t\tcmplzUnsetTypeByVendor('purpose_consent', cmplz_tcf.purposes[key]);\n\t\t}\n\n\t\ttcModel.unsetAllVendorConsents();\n\t\tdocument.querySelectorAll('.cmplz-tcf-input').forEach(checkbox => {\n\t\t\tif (!checkbox.disabled) checkbox.checked = false;\n\t\t});\n\n\t\tcmplzSetTCString(tcModel, cmplzUIVisible() );\n\t\tcmplz_set_cookie('banner-status', 'dismissed');\n\t\tif (reload) {\n\t\t\tlocation.reload();\n\t\t}\n\t}\n\n\t/**\n\t * Set all legitimate interests, except when a vendor does not have legints or special purposes.\n\t */\n\tfunction cmplzSetAllVendorLegitimateInterests() {\n\t\ttcModel.setAllVendorLegitimateInterests();\n\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t/**\n\t\t\t * no legint, and no special purposes, set legint signal to 0.\n\t\t\t */\n\t\t\tif (vendor.legIntPurposes.length == 0 && vendor.specialPurposes.length == 0) {\n\t\t\t\ttcModel.vendorLegitimateInterests.unset(vendor.id);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Set all purpose legint that are currently used\n\t */\n\tfunction cmplzSetAllPurposeLegitimateInterests() {\n\t\tconst purposes = cmplzIABfilterArray(cmplzLanguageJson.purposes, cmplz_tcf.purposes);\n\t\tfor (var key in purposes) {\n\t\t\tconst purpose = purposes[key];\n\t\t\ttcModel.purposeLegitimateInterests.set(purpose.id);\n\t\t}\n\t}\n\n\t/**\n\t * UnSet all legitimate interests, except when a vendor does not have legints or special purposes.\n\t */\n\tfunction cmplzUnsetAllVendorLegitimateInterests() {\n\t\ttcModel.unsetAllVendorLegitimateInterests();\n\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t/**\n\t\t\t * If a vendor only has special purposes, and no other purposes, there's no right to object.\n\t\t\t */\n\t\t\tif (vendor.legIntPurposes.length == 0 && vendor.purposes.length == 0 && vendor.flexiblePurposes.length == 0 && vendor.specialFeatures.length == 0 && vendor.specialPurposes.length != 0) {\n\t\t\t\ttcModel.vendorLegitimateInterests.set(vendor.id);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If a purpose has been selected/deselected, we need to re-check for al vendors if this has consenquences for legint\n\t */\n\tfunction cmplzUpdateAllVendorLegitimateInterests() {\n\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\n\t\t\t/**\n\t\t\t * no legint, and no special purposes, set legint signal to 0.\n\t\t\t */\n\t\t\tif (vendor.legIntPurposes.length == 0 && vendor.specialPurposes.length == 0) {\n\t\t\t\ttcModel.vendorLegitimateInterests.unset(vendor.id);\n\t\t\t}\n\n\t\t\tif (vendor.legIntPurposes.length == 0 && vendor.purposes.length == 0 && vendor.flexiblePurposes.length == 0 && vendor.specialFeatures.length == 0 && vendor.specialPurposes.length != 0) {\n\t\t\t\ttcModel.vendorLegitimateInterests.set(vendor.id);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * We use this method to keep track of consents per vendor. This is not stored in the core tcString\n\t *\n\t * @param type\n\t * @param typeId\n\t */\n\tfunction cmplzSetTypeByVendor(type, typeId) {\n\t\tif (type === 'purpose_consent') {\n\t\t\ttcModel.purposeConsents.set(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tif (sourceGvl.vendors[vendor.id].purposes.includes(typeId) && !vendor.purposes.includes(typeId)) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].purposes.push(typeId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'purpose_legitimate_interest') {\n\t\t\ttcModel.purposeLegitimateInterests.set(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tif (sourceGvl.vendors[vendor.id].purposes.includes(typeId) && !vendor.purposes.includes(typeId)) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].purposes.push(typeId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'specialfeature') {\n\t\t\ttcModel.specialFeatureOptins.set(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tif (sourceGvl.vendors[vendor.id].specialFeatures.includes(typeId) && !vendor.specialFeatures.includes(typeId)) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].specialFeatures.push(typeId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'feature') {\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tif (sourceGvl.vendors[vendor.id].features.includes(typeId) && !vendor.features.includes(typeId)) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].features.push(typeId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction cmplzUnsetTypeByVendor(type, typeId) {\n\t\tif (type === 'purpose_consent') {\n\t\t\ttcModel.purposeConsents.unset(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tlet index = vendor.purposes.indexOf(typeId);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].purposes.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'purpose_legitimate_interest') {\n\t\t\ttcModel.purposeLegitimateInterests.unset(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tlet index = vendor.legIntPurposes.indexOf(typeId);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].legIntPurposes.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'specialfeature') {\n\t\t\ttcModel.specialFeatureOptins.unset(typeId);\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tconst index = vendor.specialFeatures.indexOf(typeId);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].specialFeatures.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === 'feature') {\n\t\t\tfor (var key in tcModel.gvl.vendors) {\n\t\t\t\tvar vendor = tcModel.gvl.vendors[key];\n\t\t\t\tconst index = vendor.features.indexOf(typeId);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\ttcModel.gvl.vendors[vendor.id].features.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * When revoke button is clicked, so banner shows again\n\t *\n\t */\n\n\tcmplz_tcf_add_event('click', '.cmplz-manage-consent', function () {\n\t\tconst storedTCString = cmplzGetTCString();\n\t\tcmpApi.update(storedTCString, true); //just got the banner to show again, so we have to pass ui visible true\n\t});\n\n\t/**\n\t * Create a checkbox, clickable\n\t * @param type\n\t * @param object\n\t * @param container\n\t * @param checked\n\t * @param disabled\n\t */\n\tfunction cmplzRenderCheckbox(type, object, container, checked, disabled) {\n\t\tlet template = document.getElementById('cmplz-tcf-type-template').innerHTML;\n\t\tlet description = object.descriptionLegal;\n\t\tconst descArr = description.split('*');\n\t\tlet header = descArr[0];\n\t\tdescArr.splice(0, 1);\n\t\tdescription = header + '
  • ' + descArr.join('
  • ') + '
';\n\t\ttemplate = template.replace(/{type_name}/g, object.name);\n\t\ttemplate = template.replace(/{type_description}/g, description);\n\t\ttemplate = template.replace(/{type_id}/g, object.id);\n\t\ttemplate = template.replace(/{type}/g, type);\n\n\t\tconst wrapper = document.createElement('div');\n\t\twrapper.innerHTML = template;\n\t\tconst checkbox = wrapper.firstChild;\n\t\tcheckbox.querySelector('.cmplz-tcf-' + type + '-input').checked = checked;\n\t\tcheckbox.querySelector('.cmplz-tcf-' + type + '-input').disabled = disabled;\n\n\t\tcheckbox.querySelector('.cmplz-tcf-' + type + '-input').setAttribute('data-' + type + '_id', object.id);\n\t\tvar fragment = document.createDocumentFragment();\n\t\tfragment.appendChild(checkbox);\n\t\tcontainer.appendChild(checkbox);\n\t}\n\n\t/**\n\t * Generate entire block of checkboxes with event listener\n\t * @param type\n\t * @param objects\n\t * @param filterBy\n\t */\n\n\tfunction generateTypeBlock(type, objects, filterBy) {\n\t\tlet containerid = type;\n\t\tlet srcPurposes;\n\t\tif (filterBy !== false) {\n\t\t\tcontainerid = filterBy + '-' + containerid;\n\t\t\tsrcPurposes = cmplzGetPurposes(filterBy, false);\n\t\t}\n\n\t\tconst container = document.getElementById('cmplz-tcf-' + containerid + 's-container');\n\t\tif (container === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.innerHTML = '';\n\t\tfor (var key in objects) {\n\t\t\tif (objects.hasOwnProperty(key)) {\n\t\t\t\tconst object = objects[key];\n\t\t\t\tlet addItem = true;\n\t\t\t\tif (filterBy) {\n\t\t\t\t\tif (!srcPurposes.includes(object.id)) {\n\t\t\t\t\t\taddItem = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (addItem) {\n\t\t\t\t\tconst object = objects[key];\n\t\t\t\t\tlet checked = false;\n\t\t\t\t\tlet disabled = false;\n\t\t\t\t\tif (type === 'purpose_consent') {\n\t\t\t\t\t\tchecked = tcModel.purposeConsents.has(object.id);\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 'purpose_legitimate_interest') {\n\t\t\t\t\t\tchecked = tcModel.purposeLegitimateInterests.has(object.id);\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 'specialfeature') {\n\t\t\t\t\t\tchecked = tcModel.specialFeatureOptins.has(object.id);\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 'feature') {\n\t\t\t\t\t\tchecked = true;\n\t\t\t\t\t\tdisabled = true;\n\t\t\t\t\t}\n\t\t\t\t\tif (type === 'specialpurpose') {\n\t\t\t\t\t\tchecked = true;\n\t\t\t\t\t\tdisabled = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tcmplzRenderCheckbox(type, object, container, checked, disabled);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//add event listener\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-' + type + '-input', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\tconst typeId = parseInt(obj.getAttribute('data-'+type + '_id'));\n\t\t\tif (obj.checked) {\n\t\t\t\t//set all of this id to checked\n\t\t\t\tdocument.querySelectorAll('[data-' + type + '_id=\"' + typeId + '\"]').forEach(obj => {\n\t\t\t\t\tobj.checked = true;\n\t\t\t\t});\n\t\t\t\tif (type === 'purpose_consent') {\n\t\t\t\t\ttcModel.purposeConsents.set(typeId);\n\t\t\t\t}\n\t\t\t\tif (type === 'purpose_legitimate_interest') {\n\t\t\t\t\ttcModel.purposeLegitimateInterests.set(typeId);\n\t\t\t\t}\n\t\t\t\tif (type === 'specialfeature') {\n\t\t\t\t\ttcModel.specialFeatureOptins.set(typeId);\n\t\t\t\t}\n\t\t\t\tcmplzSetTypeByVendor(type, typeId);\n\t\t\t} else {\n\t\t\t\t//set all of this id to unchecked\n\t\t\t\tdocument.querySelectorAll('[data-' + type + '_id=\"' + typeId + '\"]').forEach(obj => {\n\t\t\t\t\tobj.checked = false;\n\t\t\t\t});\n\t\t\t\tif (type === 'purpose_consent') {\n\t\t\t\t\ttcModel.purposeConsents.unset(typeId);\n\t\t\t\t}\n\t\t\t\tif (type === 'purpose_legitimate_interest') {\n\t\t\t\t\ttcModel.purposeLegitimateInterests.unset(typeId);\n\t\t\t\t}\n\t\t\t\tif (type === 'specialfeature') {\n\t\t\t\t\ttcModel.specialFeatureOptins.unset(typeId);\n\t\t\t\t}\n\t\t\t\tcmplzUnsetTypeByVendor(type, typeId);\n\t\t\t}\n\t\t\tcmplzUpdateAllVendorLegitimateInterests();\n\t\t\tcmplzSetTCString(tcModel, true);\n\t\t});\n\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-toggle', function (e) {\n\t\t\tlet obj = e.target;\n\n\t\t\te.preventDefault();\n\t\t\tlet label = obj.closest('label');\n\t\t\tlet description = label.querySelector('.cmplz-tcf-type-description');\n\n\t\t\tif ( is_hidden(description) ) {\n\t\t\t\tobj.classList.add('cmplz-tcf-rl');\n\t\t\t\tobj.classList.remove('cmplz-tcf-rm');\n\t\t\t\tdescription.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tobj.classList.add('cmplz-tcf-rm');\n\t\t\t\tobj.classList.remove('cmplz-tcf-rl');\n\t\t\t\tdescription.style.display = 'none';\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction cmplzUIVisible() {\n\t\tlet bannerVisible = true;\n\t\tconst bannerStatus = cmplz_tcf_get_cookie('banner-status');\n\t\tif (bannerStatus === 'dismissed') {\n\t\t\tbannerVisible = false;\n\t\t}\n\n\t\tconst policyVisible = document.getElementById('cmplz-tcf-vendor-container') !== null;\n\t\treturn bannerVisible || policyVisible;\n\t}\n\n\t/**\n\t * Create a list of checkable vendors in the cookie policy\n\t * @param vendors\n\t */\n\n\tfunction insertVendorsInPolicy(vendors) {\n\t\tconst vendorContainer = document.getElementById('cmplz-tcf-vendor-container');\n\t\tif (vendorContainer === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tvendorContainer.innerHTML = '';\n\t\tconst template = document.getElementById('cmplz-tcf-vendor-template').innerHTML;\n\t\tconst purposes = cmplzIABfilterArray(cmplzLanguageJson.purposes, cmplz_tcf.purposes);\n\t\tconst specialPurposes = cmplzIABfilterArray(cmplzLanguageJson.specialPurposes, cmplz_tcf.specialPurposes);\n\t\tconst features = cmplzIABfilterArray(cmplzLanguageJson.features, cmplz_tcf.features);\n\t\tconst specialFeatures = cmplzIABfilterArray(cmplzLanguageJson.specialFeatures, cmplz_tcf.specialFeatures);\n\t\tgenerateTypeBlock('purpose_consent', purposes, 'statistics');\n\t\tgenerateTypeBlock('purpose_consent', purposes, 'marketing');\n\t\tgenerateTypeBlock('purpose_legitimate_interest', purposes, 'statistics');\n\t\tgenerateTypeBlock('purpose_legitimate_interest', purposes, 'marketing');\n\t\tgenerateTypeBlock('feature', features, false);\n\t\tgenerateTypeBlock('specialpurpose', specialPurposes, false);\n\t\tgenerateTypeBlock('specialfeature', specialFeatures, false);\n\n\t\tif (specialFeatures.length == 0) {\n\t\t\tdocument.getElementById('cmplz-tcf-specialfeatures-wrapper').style.display = 'none';\n\t\t}\n\t\tfor (var key in vendors) {\n\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\tlet customTemplate = template;\n\t\t\t\tconst vendor = vendors[key];\n\t\t\t\tconst vendorPurposes = vendor.purposes + vendor.legIntPurposes;\n\t\t\t\tlet purposeString = '';\n\t\t\t\tfor (var p_key in vendorPurposes) {\n\t\t\t\t\tif (vendorPurposes.hasOwnProperty(p_key)) {\n\t\t\t\t\t\tlet purposeName = false;\n\t\t\t\t\t\tfor (var src_p_key in purposes) {\n\t\t\t\t\t\t\tif (purposes.hasOwnProperty(src_p_key)) {\n\t\t\t\t\t\t\t\tif (purposes[src_p_key].id == vendorPurposes[p_key]) {\n\t\t\t\t\t\t\t\t\tpurposeName = purposes[src_p_key].name;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (purposeName) {\n\t\t\t\t\t\t\tconst purposeLink = 'https://cookiedatabase.org/tcf/' + purposeName.replace(/ /g, '-').replace(/\\//g, '-').toLowerCase();\n\t\t\t\t\t\t\tpurposeString += '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar retentionInDays = Math.round(vendor.cookieMaxAgeSeconds / (60 * 60 * 24));\n\t\t\t\t//if result is 0, get day in decimals.\n\t\t\t\tcustomTemplate = customTemplate.replace(/{cookie_retention_seconds}/g, vendor.cookieMaxAgeSeconds);\n\t\t\t\tcustomTemplate = customTemplate.replace(/{cookie_retention_days}/g, retentionInDays);\n\t\t\t\tcustomTemplate = customTemplate.replace(/{vendor_name}/g, vendor.name);\n\t\t\t\tcustomTemplate = customTemplate.replace(/{vendor_id}/g, vendor.id);\n\t\t\t\tcustomTemplate = customTemplate.replace(/{purposes}/g, purposeString);\n\t\t\t\tcustomTemplate = customTemplate.replace(/{privacy_policy}/g, vendor.policyUrl);\n\n\t\t\t\tconst wrapper = document.createElement('div');\n\t\t\t\twrapper.innerHTML = customTemplate;\n\t\t\t\tconst checkbox = wrapper.firstChild;\n\t\t\t\tcheckbox.querySelector('.cmplz-tcf-vendor-input').checked = tcModel.vendorConsents.has(vendor.id) || tcModel.vendorLegitimateInterests.has(vendor.id);\n\t\t\t\tcheckbox.querySelector('.cmplz-tcf-vendor-input').setAttribute('data-vendor_id', vendor.id);\n\n\t\t\t\t//set consent\n\t\t\t\tcheckbox.querySelector('.cmplz-tcf-consent-input').checked = tcModel.vendorConsents.has(vendor.id);\n\t\t\t\tcheckbox.querySelector('.cmplz-tcf-consent-input').setAttribute('data-vendor_id', vendor.id);\n\n\t\t\t\t//show legint option if vendor has legintpurposes\n\t\t\t\tif (vendor.legIntPurposes.length != 0) {\n\t\t\t\t\tcheckbox.querySelector('.cmplz_tcf_legitimate_interest_checkbox').style.display = 'block';\n\t\t\t\t\tcheckbox.querySelector('.cmplz-tcf-legitimate-interest-input').setAttribute('data-vendor_id', vendor.id);\n\t\t\t\t\tcheckbox.querySelector('.cmplz-tcf-legitimate-interest-input').checked = tcModel.vendorLegitimateInterests.has(vendor.id);\n\t\t\t\t}\n\n\t\t\t\t//handle non cookie access\n\t\t\t\tif (vendor.usesNonCookieAccess) {\n\t\t\t\t\twrapper.querySelector('.non-cookie-storage-active').style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\twrapper.querySelector('.non-cookie-storage-inactive').style.display = 'block';\n\t\t\t\t}\n\n\t\t\t\tif (vendor.cookieRefresh) {\n\t\t\t\t\twrapper.querySelector('.non-cookie-refresh-active').style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\twrapper.querySelector('.non-cookie-refresh-inactive').style.display = 'block';\n\t\t\t\t}\n\n\t\t\t\tif (vendor.cookieMaxAgeSeconds <= 0) {\n\t\t\t\t\twrapper.querySelector('.session-storage').style.display = 'block';\n\t\t\t\t} else if (vendor.cookieMaxAgeSeconds <= 60 * 60 * 24) {\n\t\t\t\t\twrapper.querySelector('.retention_seconds').style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\twrapper.querySelector('.retention_days').style.display = 'block';\n\t\t\t\t}\n\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tfragment.appendChild(checkbox);\n\t\t\t\tvendorContainer.appendChild(checkbox);\n\t\t\t}\n\t\t}\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-legitimate-interest-input', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\tconst vendorId = parseInt(obj.getAttribute('data-vendor_id'));\n\t\t\tif ( obj.checked ) {\n\t\t\t\ttcModel.vendorLegitimateInterests.set(vendorId);\n\t\t\t\tlet container = obj.closest('.cmplz-tcf-vendor-container');\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-vendor-input').checked = true;\n\t\t\t} else {\n\t\t\t\ttcModel.vendorLegitimateInterests.unset(vendorId);\n\t\t\t}\n\t\t\tcmplzSetTCString(tcModel, true);\n\t\t\tcmplz_set_cookie('banner-status', 'dismissed');\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-consent-input', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\tconst vendorId = parseInt(obj.getAttribute('data-vendor_id'));\n\t\t\tif ( obj.checked ) {\n\t\t\t\ttcModel.vendorConsents.set(vendorId);\n\t\t\t\tlet container = obj.closest('.cmplz-tcf-vendor-container');\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-vendor-input' ).prop('checked', true);\n\t\t\t} else {\n\t\t\t\ttcModel.vendorConsents.unset(vendorId);\n\t\t\t}\n\t\t\t//now we update the tcstring\n\t\t\tcmplzSetTCString(tcModel, true);\n\t\t\tcmplz_set_cookie('banner-status', 'dismissed');\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-vendor-input', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\tconst vendorId = parseInt(obj.getAttribute('data-vendor_id'));\n\t\t\tlet container = obj.closest('.cmplz-tcf-vendor-container');\n\t\t\tif (obj.checked) {\n\t\t\t\ttcModel.vendorConsents.set(vendorId);\n\t\t\t\t//positive leg int should not be set.\n\t\t\t\ttcModel.vendorLegitimateInterests.set(vendorId);\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-legitimate-interest-input' ).checked = true;\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-consent-input' ).checked = true;\n\t\t\t} else {\n\t\t\t\ttcModel.vendorConsents.unset(vendorId);\n\t\t\t\ttcModel.vendorLegitimateInterests.unset(vendorId);\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-legitimate-interest-input').checked = false;\n\t\t\t\tcontainer.querySelector('.cmplz-tcf-consent-input').checked = false;\n\t\t\t}\n\t\t\tcmplzSetTCString(tcModel, true);\n\t\t\tcmplz_set_cookie('banner-status', 'dismissed');\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-toggle-info', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\te.preventDefault();\n\t\t\tif ( is_hidden() ) {\n\t\t\t\tobj.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tobj.style.display = 'none';\n\t\t\t}\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", '.cmplz-tcf-toggle-vendor', function (e) {\n\t\t\tlet obj = e.target;\n\t\t\te.preventDefault();\n\t\t\tconst container = obj.closest('.cmplz-tcf-vendor-container');\n\t\t\tconst info = container.querySelector('.cmplz-tcf-info');\n\t\t\tif ( is_hidden(info) ) {\n\t\t\t\tobj.classList.add('cmplz-tcf-rl');\n\t\t\t\tobj.classList.remove('cmplz-tcf-rm');\n\t\t\t\tinfo.style.display = 'block';\n\t\t\t} else {\n\t\t\t\tobj.classList.add('cmplz-tcf-rm');\n\t\t\t\tobj.classList.remove('cmplz-tcf-rl');\n\t\t\t\tinfo.style.display = 'none';\n\t\t\t}\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", \"#cmplz-tcf-selectall\", function () {\n\t\t\tfor (var key in vendors) {\n\t\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\t\tconst vendor = vendors[key];\n\t\t\t\t\ttcModel.vendorConsents.set(vendor.id);\n\t\t\t\t\tdocument.querySelector('#cmplz-tcf-' + vendor.id).checked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst vendorCheckboxes = document.querySelectorAll('[data-vendor_id]');\n\t\t\tvendorCheckboxes.forEach(vendorCheckbox => {\n\t\t\t\tvendorCheckbox.checked = true;\n\t\t\t});\n\t\t\tacceptAllVendors();\n\t\t});\n\n\t\tcmplz_tcf_add_event(\"click\", \"#cmplz-tcf-deselectall\", function () {\n\t\t\tfor (var key in vendors) {\n\t\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\t\tconst vendor = vendors[key];\n\t\t\t\t\ttcModel.vendorConsents.unset(vendor.id);\n\t\t\t\t\tdocument.querySelector('#cmplz-tcf-' + vendor.id).checked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\trevokeAllVendors(true);\n\t\t});\n\t\tlet event = new CustomEvent('cmplz_vendor_container_loaded', {detail: complianz.region});\n\t\tdocument.dispatchEvent(event);\n\t}\n\n\n\t/**\n\t * Filter the list of vendors\n\t *\n\t * @param vendors\n\t * @returns {*}\n\t */\n\tfunction cmplzFilterVendors(vendors) {\n\t\tlet vendorIds = [];\n\t\tfor (var key in vendors) {\n\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\tconst vendor = vendors[key];\n\t\t\t\t// if (vendor.id==755 || vendor.legIntPurposes.length==0){\n\t\t\t\t\tvendorIds.push(vendor.id);\n\t\t\t\t// }\n\t\t\t}\n\t\t}\n\t\tlet addVendorIds = cmplzFilterVendorsBy('purposes', vendors, cmplz_tcf.purposes);\n\t\tvendorIds = vendorIds.filter(value => addVendorIds.includes(value));\n\n\t\taddVendorIds = cmplzFilterVendorsBy('specialPurposes', vendors, cmplz_tcf.specialPurposes);\n\t\tvendorIds = vendorIds.filter(value => addVendorIds.includes(value));\n\n\t\taddVendorIds = cmplzFilterVendorsBy('features', vendors, cmplz_tcf.features);\n\t\tvendorIds = vendorIds.filter(value => addVendorIds.includes(value));\n\n\t\taddVendorIds = cmplzFilterVendorsBy('specialFeatures', vendors, cmplz_tcf.specialFeatures);\n\t\tvendorIds = vendorIds.filter(value => addVendorIds.includes(value));\n\t\treturn vendorIds;\n\t}\n\n\n\t/**\n\t * Get vendors who only have one of these purposes\n\t * @param vendors\n\t * @param category_purposes\n\t * @returns {[]}\n\t */\n\tfunction cmplzFilterVendorsBy(type, vendors, category_purposes) {\n\t\tlet output = [];\n\t\tfor (var key in vendors) {\n\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\tconst vendor = vendors[key];\n\t\t\t\t//for each vendor purpose, check if it exists in the category purposes list. If not, don't add this vendor\n\t\t\t\tlet allPurposesAreCategoryPurpose = true;\n\t\t\t\tconst vendorProperties = vendor[type];\n\t\t\t\tfor (var p_key in vendorProperties) {\n\t\t\t\t\tif (vendorProperties.hasOwnProperty(p_key)) {\n\t\t\t\t\t\tconst purpose = vendorProperties[p_key];\n\n\t\t\t\t\t\tconst inPurposeArray = category_purposes.includes(purpose);\n\t\t\t\t\t\tif (!inPurposeArray) {\n\t\t\t\t\t\t\tallPurposesAreCategoryPurpose = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst inOutPutArray = output.includes(vendor.id);\n\t\t\t\tif (!inOutPutArray && allPurposesAreCategoryPurpose) {\n\t\t\t\t\toutput.push(vendor.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Get thet TC String\n\t * @returns {string}\n\t */\n\tfunction cmplzGetTCString() {\n\t\tlet user_policy_id = cmplz_tcf_get_cookie('policy_id');\n\t\tif ( !user_policy_id || (typeof complianz!=='undefined' && complianz.current_policy_id !== user_policy_id) ) {\n\t\t\tif (localStorage.cmplz_tcf_consent) localStorage.removeItem('cmplz_tcf_consent');\n\t\t}\n\t\treturn window.localStorage.getItem('cmplz_tcf_consent');\n\t}\n\n\t/**\n\t * Set the tcstring, and update the api if needed\n\t * @param tcModel\n\t * @param uiVisible\n\t */\n\tfunction cmplzSetTCString( tcModel, uiVisible ) {\n\t\tlet encodedTCString = null;\n\t\tif ( tcModel ) {\n\t\t\ttcModel.created = cmplzRemoveTime(tcModel.lastUpdated);\n\t\t\ttcModel.lastUpdated = cmplzRemoveTime(tcModel.lastUpdated);\n\t\t\tencodedTCString = TCString.encode(tcModel);\n\t\t}\n\t\tcmpApi.update(encodedTCString, uiVisible);\n\t\twindow.localStorage.setItem('cmplz_tcf_consent', encodedTCString);\n\t}\n\n\t/**\n\t * Ensure the date does not contain hours or minutes\n\t * @param date\n\t * @returns {Date}\n\t */\n\n\tfunction cmplzRemoveTime(date) {\n\t\treturn new Date(\n\t\t\tdate.getFullYear(),\n\t\t\tdate.getMonth(),\n\t\t\tdate.getDate()\n\t\t);\n\t}\n\n\t/**\n\t * Get list of purposes\n\t * @param category\n\t * @param includeLowerCategories\n\t * @returns {*[]|number[]}\n\t */\n\tfunction cmplzGetPurposes(category, includeLowerCategories) {\n\t\t//these categories aren't used\n\t\tif (category === 'functional' || category === 'preferences') {\n\t\t\treturn [];\n\t\t}\n\n\t\tif (category === 'marketing') {\n\t\t\tif (includeLowerCategories) {\n\t\t\t\treturn [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n\t\t\t} else {\n\t\t\t\treturn [1, 2, 3, 4, 5, 6, 10];\n\t\t\t}\n\t\t} else if (category === 'statistics') {\n\t\t\treturn [1, 7, 8, 9];\n\t\t}\n\t}\n\n\t/**\n\t * Check if a region is a TCF region\n\t * @param region\n\t * @returns {boolean}\n\t */\n\tfunction cmplz_is_tcf_region(region) {\n\t\tif (cmplz_in_array(region, complianz.tcf_regions)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction configureOptinBanner() {\n\t\t//don't do this for non TCF regions\n\t\tif (!cmplz_is_tcf_region(complianz.region)) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Filter purposes based on passed purposes\n\t\t */\n\t\t//only optin variant of tcf has these purposes on the banner.\n\t\tif ( complianz.consenttype === 'optin' ) {\n\t\t\tconst srcMarketingPurposes = cmplzGetPurposes('marketing', false);\n\t\t\tconst srcStatisticsPurposes = cmplzGetPurposes('statistics', false);\n\t\t\tconst marketingPurposes = cmplzIABfilterArray(cmplzIABfilterArray(cmplzLanguageJson.purposes, cmplz_tcf.purposes), srcMarketingPurposes);\n\t\t\tconst statisticsPurposes = cmplzIABfilterArray(cmplzIABfilterArray(cmplzLanguageJson.purposes, cmplz_tcf.purposes), srcStatisticsPurposes);\n\t\t\tconst features = cmplzIABfilterArray(cmplzLanguageJson.features, cmplz_tcf.features);\n\t\t\tconst specialPurposes = cmplzIABfilterArray(cmplzLanguageJson.specialPurposes, cmplz_tcf.specialPurposes);\n\t\t\tconst specialFeatures = cmplzIABfilterArray(cmplzLanguageJson.specialFeatures, cmplz_tcf.specialFeatures);\n\n\t\t\tconst marketingPurposesContainer = document.querySelector('.cmplz-tcf .cmplz-marketing .cmplz-description');\n\t\t\tconst statisticsPurposesContainer = document.querySelector('.cmplz-tcf .cmplz-statistics .cmplz-description');\n\t\t\tconst featuresContainer = document.querySelector('.cmplz-tcf .cmplz-features .cmplz-description');\n\t\t\tconst specialFeaturesContainer = document.querySelector('.cmplz-tcf .cmplz-specialfeatures .cmplz-title');\n\t\t\tconst specialPurposesContainer = document.querySelector('.cmplz-tcf .cmplz-specialpurposes .cmplz-title');\n\n\t\t\tif (features.length === 0) document.querySelector('.cmplz-tcf .cmplz-features').style.display = 'none';\n\t\t\tif (specialPurposes.length === 0) document.querySelector('.cmplz-tcf .cmplz-specialpurposes').style.display = 'none';\n\t\t\tif (specialFeatures.length === 0) document.querySelector('.cmplz-tcf .cmplz-specialfeatures').style.display = 'none';\n\t\t\tif (statisticsPurposes.length === 0) document.querySelector('.cmplz-tcf .cmplz-statistics').style.display = 'none';\n\n\t\t\tstatisticsPurposesContainer.innerHTML = cmplzConcatenateString(statisticsPurposes);\n\t\t\tmarketingPurposesContainer.innerHTML = cmplzConcatenateString(marketingPurposes);\n\t\t\tfeaturesContainer.innerHTML = cmplzConcatenateString(features);\n\t\t\tspecialFeaturesContainer.innerHTML = cmplzConcatenateString(specialFeatures);\n\t\t\tspecialPurposesContainer.innerHTML = cmplzConcatenateString(specialPurposes);\n\t\t}\n\n\t\t//on pageload, show vendorlist area\n\t\tlet wrapper = document.getElementById('cmplz-tcf-wrapper');\n\t\tlet noscript_wrapper = document.getElementById('cmplz-tcf-wrapper-nojavascript');\n\t\tif ( wrapper ){\n\t\t\twrapper.style.display = 'block';\n\t\t\tnoscript_wrapper.style.display = 'none';\n\t\t}\n\t}\n\n\tfunction cmplzIABfilterArray(arrayToFilter, arrayToFilterBy) {\n\t\tlet output = [];\n\t\tfor (var key in arrayToFilter) {\n\t\t\tif (arrayToFilterBy.includes(arrayToFilter[key].id)) {\n\t\t\t\toutput.push(arrayToFilter[key]);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction cmplzConcatenateString(array) {\n\t\tlet string = '';\n\t\tconst max = array.length - 1;\n\t\tfor (var key in array) {\n\t\t\tif (array.hasOwnProperty(key)) {\n\t\t\t\tstring += array[key].name;\n\t\t\t\tif (key < max) {\n\t\t\t\t\tstring += ', ';\n\t\t\t\t} else {\n\t\t\t\t\tstring += '.';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n\n});\n\n/**\n * TCF for CCPA\n */\n\nconst USPSTR_NN = \"1NN\";\nconst USPSTR_YN = \"1YN\";\nconst USPSTR_YY = \"1YY\";\nconst USPSTR_NA = \"1---\";\nlet ccpaVendorlistLoadedResolve;\nvar ccpaVendorlistLoaded = new Promise(function(resolve, reject){\n\tccpaVendorlistLoadedResolve = resolve;\n});\nlet USvendorlistUrl = cmplz_tcf.cmp_url + 'cmp/vendorlist' + '/lspa.json';\nlet ccpaVendorList;\nbannerDataLoaded.then(()=> {\n\tif (complianz.consenttype === 'optout' || onOptOutPolicyPage) {\n\t\tfetch(USvendorlistUrl, {\n\t\t\tmethod: \"GET\",\n\t\t}).then(response => response.json())\n\t\t\t.then(\n\t\t\t\tfunction (data) {\n\t\t\t\t\tccpaVendorList = data;\n\t\t\t\t\tccpaVendorlistLoadedResolve();\n\t\t\t\t}\n\t\t\t);\n\t\tcmplz_set_ccpa_tc_string();\n\t\tcmplzRenderUSVendorsInPolicy();\n\t} else {\n\t\tif (cmplz_tcf.debug) console.log(\"not an optout tcf region or page\");\n\t}\n});\n\n/**\n * When CCPA applies, we set the TC string in the usprivacy cookie\n */\nfunction cmplz_set_ccpa_tc_string() {\n\tif ( cmplz_tcf.ccpa_applies ) {\n\t\tcmplz_set_cookie('usprivacy', USPSTR_YN + cmplz_tcf.lspact, false);\n\t\tdocument.addEventListener(\"cmplz_fire_categories\", function (e) {\n\t\t\tlet val = USPSTR_YY + cmplz_tcf.lspact;\n\t\t\tif (cmplz_in_array('marketing', e.detail.categories)) {\n\t\t\t\tval = USPSTR_YN + cmplz_tcf.lspact;\n\t\t\t}\n\t\t\tcmplz_set_cookie('usprivacy', val, false);\n\t\t});\n\t} else {\n\t\tcmplz_set_cookie('usprivacy', USPSTR_NA + cmplz_tcf.lspact, false );\n\t}\n}\n\nfunction cmplzRenderUSVendorsInPolicy() {\n\tccpaVendorlistLoaded.then(()=> {\n\t\tlet vendors = ccpaVendorList.signatories;\n\t\tconst vendorContainer = document.getElementById('cmplz-tcf-us-vendor-container');\n\n\t\tif (vendorContainer === null) {\n\t\t\treturn;\n\t\t}\n\t\tvendorContainer.innerHTML = '';\n\t\tconst template = document.getElementById('cmplz-tcf-vendor-template').innerHTML;\n\n\t\tfor (var key in vendors) {\n\t\t\tif (vendors.hasOwnProperty(key)) {\n\t\t\t\tlet customTemplate = template;\n\t\t\t\tlet vendor = vendors[key];\n\t\t\t\tcustomTemplate = customTemplate.replace(/{vendor_name}/g, vendor.signatoryLegalName);\n\t\t\t\tlet hasOptoutUrl = true;\n\t\t\t\tif (vendor.optoutUrl.indexOf('http') === -1) {\n\t\t\t\t\thasOptoutUrl = false;\n\t\t\t\t\tcustomTemplate = customTemplate.replace(/{optout_string}/g, vendor.optoutUrl);\n\t\t\t\t} else {\n\t\t\t\t\tcustomTemplate = customTemplate.replace(/{optout_url}/g, vendor.optoutUrl);\n\t\t\t\t}\n\n\t\t\t\tconst wrapper = document.createElement('div');\n\t\t\t\twrapper.innerHTML = customTemplate;\n\t\t\t\tconst html = wrapper.firstChild;\n\t\t\t\tif (hasOptoutUrl) {\n\t\t\t\t\thtml.querySelector('.cmplz-tcf-optout-string').style.display = 'none';\n\t\t\t\t\thtml.querySelector('.cmplz-tcf-optout-url').style.display = 'block';\n\n\t\t\t\t} else {\n\t\t\t\t\thtml.querySelector('.cmplz-tcf-optout-string').style.display = 'block';\n\t\t\t\t\thtml.querySelector('.cmplz-tcf-optout-url').style.display = 'none';\n\t\t\t\t}\n\t\t\t\tvar fragment = document.createDocumentFragment();\n\t\t\t\tfragment.appendChild(html);\n\t\t\t\tvendorContainer.appendChild(html);\n\t\t\t}\n\t\t}\n\n\t\tdocument.querySelector('#cmplz-tcf-wrapper').style.display = 'block'\n\t\tdocument.querySelector('#cmplz-tcf-wrapper-nojavascript').style.display = 'none';\n\t})\n}\n\n/**\n * @todo get a list of ddr.js files. Not currently available\n * https://github.com/InteractiveAdvertisingBureau/USPrivacy/issues/17\n */\n// Add all Vendor scripts; this is just an array of string sources\n//https://github.com/InteractiveAdvertisingBureau/USPrivacy/blob/master/CCPA/Data%20Deletion%20Request%20Handling.md\n// vendorDeleteScriptSources.forEach((vendorDeleteScriptSource) => {\n//\n// \tconst scriptElement = document.createElement(\"script\");\n// \tscriptElement.src = vendorDeleteScriptSource;\n//\n// \tdocument.body.appendChild(scriptElement);\n//\n// });\n\n/**\n * Fire a data deletion request.\n */\ndocument.addEventListener(\"cmplz_dnsmpi_submit\", function (e) {\n\tif (cmplz_tcf.debug) console.log(\"fire data deletion request for TCF\");\n\t__uspapi('performDeletion', 1);\n});\n"],"names":["UsprivacyString","API_VERSION","pendingCalls","uspString","getCookie","cookiename","name","cookiearray","document","cookie","split","i","length","charAt","substring","indexOf","addFrame","window","frames","body","iframe","createElement","style","cssText","appendChild","setTimeout","getuspdata","apiver","callback","undefined","str1","setUsprivacyString","console","log","str","getUsprivacyString","version","getVersion","error","__uspapi","win","nfe","api","cmd","getUSPData","apply","slice","call","arguments","err","__handleUspapiMessage","event","data","__uspapiCall","command","returnValue","success","source","postMessage","__uspapiReturn","callId","addEventListener","validStringRegExp","constructor","baseString","newstr","didSet","test","CmpApi","TCModel","TCString","GVL","Segment","cmplzCMP","cmplzCMPVersion","cmplzIsServiceSpecific","cmplz_tcf","isServiceSpecific","cmplzExistingLanguages","langCount","cmplz_html_lang_attr","documentElement","lang","toLowerCase","cmplzLanguage","cmplzLocale","cmplzLanguageJson","onOptOutPolicyPage","getElementById","onOptInPolicyPage","purposesUrl","cmp_url","includes","create_element","el","content","obj","innerHtml","cmplz_tcf_get_cookie","complianz","prefix","value","parts","pop","shift","cmplz_tcf_add_event","selector","context","e","target","closest","is_hidden","offsetParent","bannerDataLoadedResolve","tcModelLoadedResolve","tcfLanguageLoadedResolve","bannerLoadedResolve","revokeResolve","bannerDataLoaded","Promise","resolve","reject","tcModelLoaded","tcfLanguageLoaded","bannerLoaded","revoke","fetch","method","then","response","json","disable_cookiebanner","reload","detail","baseUrl","gvl","sourceGvl","clone","tcModel","publisherCountryCode","cmpId","cmpVersion","UseNonStandardStacks","cmpApi","storedTCString","cmplzGetTCString","readyPromise","getJson","vendors","vendorIds","cmplzFilterVendors","narrowVendorsTo","decode","all","insertVendorsInPolicy","consenttype","debug","date","Date","parse","created","getTime","cmplzSetTCString","cmplzUIVisible","configureOptinBanner","cmplz_is_tcf_region","region","revokeAllVendors","cmplz_in_array","categories","acceptAllVendors","cmplzSetAllVendorLegitimateInterests","setAllPurposeLegitimateInterests","key","purposes","purposeConsents","set","cmplzSetTypeByVendor","setAllSpecialFeatureOptins","specialFeatures","specialFeatureOptins","setAllPurposeConsents","setAllVendorConsents","querySelectorAll","forEach","checkbox","checked","cmplz_set_cookie","unsetAllPurposeLegitimateInterests","cmplzUnsetAllVendorLegitimateInterests","cmplzUnsetTypeByVendor","unsetAllVendorConsents","disabled","location","setAllVendorLegitimateInterests","vendor","legIntPurposes","specialPurposes","vendorLegitimateInterests","unset","id","cmplzSetAllPurposeLegitimateInterests","cmplzIABfilterArray","purpose","purposeLegitimateInterests","unsetAllVendorLegitimateInterests","flexiblePurposes","cmplzUpdateAllVendorLegitimateInterests","type","typeId","push","features","index","splice","update","cmplzRenderCheckbox","object","container","template","innerHTML","description","descriptionLegal","descArr","header","join","replace","wrapper","firstChild","querySelector","setAttribute","fragment","createDocumentFragment","generateTypeBlock","objects","filterBy","containerid","srcPurposes","cmplzGetPurposes","hasOwnProperty","addItem","has","parseInt","getAttribute","preventDefault","label","classList","add","remove","display","bannerVisible","bannerStatus","policyVisible","vendorContainer","customTemplate","vendorPurposes","purposeString","p_key","purposeName","src_p_key","purposeLink","retentionInDays","Math","round","cookieMaxAgeSeconds","policyUrl","vendorConsents","usesNonCookieAccess","cookieRefresh","vendorId","prop","info","vendorCheckboxes","vendorCheckbox","CustomEvent","dispatchEvent","addVendorIds","cmplzFilterVendorsBy","filter","category_purposes","output","allPurposesAreCategoryPurpose","vendorProperties","inPurposeArray","inOutPutArray","user_policy_id","current_policy_id","localStorage","cmplz_tcf_consent","removeItem","getItem","uiVisible","encodedTCString","cmplzRemoveTime","lastUpdated","encode","setItem","getFullYear","getMonth","getDate","category","includeLowerCategories","tcf_regions","srcMarketingPurposes","srcStatisticsPurposes","marketingPurposes","statisticsPurposes","marketingPurposesContainer","statisticsPurposesContainer","featuresContainer","specialFeaturesContainer","specialPurposesContainer","cmplzConcatenateString","noscript_wrapper","arrayToFilter","arrayToFilterBy","array","string","max","USPSTR_NN","USPSTR_YN","USPSTR_YY","USPSTR_NA","ccpaVendorlistLoadedResolve","ccpaVendorlistLoaded","USvendorlistUrl","ccpaVendorList","cmplz_set_ccpa_tc_string","cmplzRenderUSVendorsInPolicy","ccpa_applies","lspact","val","signatories","signatoryLegalName","hasOptoutUrl","optoutUrl","html"],"sourceRoot":""}