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AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B,WAAW,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2DAA2D,kCAAkC;AAC7F,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2DAA2D,GAAG,sBAAsB,GAAG;AACvF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC,uCAAuC;AACvC,yCAAyC;AACzC,kDAAkD;AAClD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB;AAChB;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,oBAAoB;AACpB,sBAAsB;AACtB,yBAAyB;AACzB,yBAAyB;;AAEzB,eAAe;AACf;;AAEA;AACA;AACA;AACA,2FAA2F,oBAAoB;AAC/G;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;;AAEN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;AChnBA;AACA;AACA;AACA;AACA;AACA,sEAAqF;AACrF,qEAAkF;AAClF,uDAA4D;;;;;;;ACP5D,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,gBAAgB,mBAAO,CAAC,CAAc;AACtC,WAAW,mBAAO,CAAC,CAAQ;AAC3B,eAAe,iCAA+B;AAC9C,kBAAkB,oCAAqC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C,SAAS;AACpD;AACA;;AAEA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;;;;;;;ACxa1B,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D;AAC5D,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;;;;;;;AC3IA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd,qBAAqB;AACrB,qBAAqB;;AAErB,qBAAqB;AACrB,qBAAqB;;AAErB,qBAAqB;AACrB,qBAAqB;;AAErB,qBAAqB;AACrB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AClEA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA,cAAc;;AAEd;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+CAA+C,QAAQ;AACvD;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;;AAEZ,kBAAkB;AAClB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB;;AAEhB;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;;AAEnB;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;;AAEA;AACA,eAAe;AACf;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;;;;;;ACvexB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,CAAQ;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uCAAuC,SAAS;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAgB;;;;;;;ACxHhB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,CAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;;;;;;;AC9EnB,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,WAAW,mBAAO,CAAC,CAAQ;AAC3B,mBAAmB,mBAAO,CAAC,EAAiB;AAC5C,eAAe,iCAA+B;AAC9C,gBAAgB,mBAAO,CAAC,CAAc;AACtC,gBAAgB,mCAAiC;;AAEjD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA,QAAQ;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,MAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,kCAAkC;AAChD;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,uDAAuD,YAAY;AACnE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,0BAA0B,cAAc;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,wCAAwC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,oBAAoB;AACpE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,8BAA8B;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,oBAAoB;AACrC;AACA;AACA;AACA;AACA;AACA,6BAA6B,MAAM;AACnC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C,sBAAsB,+CAA+C;AACrE;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,2BAA2B;AAC/C;AACA;AACA,sBAAsB,4BAA4B;AAClD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gCAAgC;;;;;;;ACxnChC,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,4BAA4B;AAC5B,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AC9GA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,UAAU;AACrB;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,WAAW,UAAU;AACrB;AACA;AACA,iBAAiB;AACjB;AACA;;;;;;;ACjHA,iBAAiB,oBAAoB;AACrC;AACA;AACA;AACA;AACA;;AAEA,yBAAyB,2CAAoD;AAC7E,WAAW,mBAAO,CAAC,CAAQ;;AAE3B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;;AAEA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,6CAA6C,cAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA,QAAQ;AACR;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;;AAEH,WAAW;AACX;;AAEA,kBAAkB;;;;;;;;AC5ZlB;;;;;;;ACAA;;;;;;ACAA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;ACvEA;;;;;;;ACAa;AACb,aAAa,mBAAO,CAAC,EAAM;AAC3B,OAAO,mCAAmC,EAAE,mBAAO,CAAC,EAAU;AAC9D,uBAAuB,mBAAO,CAAC,EAAiB;AAChD,aAAa,mBAAO,CAAC,EAAM;AAC3B,gBAAgB,mBAAO,CAAC,EAAU;;AAElC;AACA;;AAEA;AACA;AACA;;AAEA,WAAW,KAAK,GAAG,kBAAkB;AACrC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA,iEAAiE,UAAU;;AAE3E;AACA,8BAA8B,sBAAsB;AACpD,IAAI;AACJ;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,wCAAwC,kCAAkC;AAC1E;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,EAAE;AACF;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;;AAEF;AACA,CAAC;;;;;;;;ACvNY;AACb,mBAAmB,mBAAO,CAAC,EAAa;AACxC,uBAAuB,mBAAO,CAAC,EAAiB;;AAEhD;AACA;AACA,mEAAmE,UAAU,GAAG,UAAU,GAAG,UAAU;AACvG;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAsB;;AAEtB,mBAAmB;AACnB;AACA;AACA;AACA;;;;;;;;ACvBa;AACb,WAAW,mBAAO,CAAC,EAAI;AACvB,OAAO,WAAW,EAAE,mBAAO,CAAC,EAAM;;AAElC;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA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;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,cAAc,iBAAiB;AAC/B,cAAc,iBAAiB;AAC/B,kBAAkB,qBAAqB;AACvC,mBAAmB,sBAAsB;AACzC,0BAA0B,6BAA6B;AACvD,wBAAwB,2BAA2B;AACnD,yBAAyB,4BAA4B;AACrD;AACA;AACA;AACA;AACA;AACA;;;;;;;ACzLA;AACA;AACA,QAAQ,mBAAO,CAAC,EAAa;AAC7B,EAAE;AACF,QAAQ,mBAAO,CAAC,EAAI;AACpB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,eAAe;AACf;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrIA,SAAS,mBAAO,CAAC,EAAI;AACrB,gBAAgB,mBAAO,CAAC,EAAgB;AACxC,aAAa,mBAAO,CAAC,EAAqB;AAC1C,YAAY,mBAAO,CAAC,EAAY;;AAEhC,WAAW,mBAAO,CAAC,EAAM;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAM,6BAAuB;AAC7B,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8BAA8B;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC/bA,gBAAgB,mBAAO,CAAC,EAAW;;AAEnC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,YAAY;AACZ,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,cAAc;AACd,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA,MAAM;AACN,+CAA+C;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;AClWA;;;;;;ACAA,aAAa,gCAAwB;;AAErC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACrHA;;;;;;;ACAY;;AAEZ;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;;AAEA;AACA;AACA,GAAG;;AAE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;AACA,qBAAqB;AACrB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA,SAAS,WAAW;AACpB;AACA;AACA,sCAAsC,KAAK;;AAE3C;AACA,sBAAsB,kBAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,sBAAsB,UAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,aAAa;AAC/C;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,aAAa;AAC/C;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,aAAa;AAChD;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,uEAAuE,UAAU;AACjF;AACA,8CAA8C,UAAU;AACxD;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA8B;AAC9B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC;AACzC;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA8C,WAAW;;AAEzD;AACA,sDAAsD,WAAW;AACjE,IAAI;;AAEJ;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;;;;;;;ACzba;AACb,kBAAkB,mBAAO,CAAC,EAAY;AACtC,oBAAoB,mBAAO,CAAC,EAAc;;AAE1C;AACA;AACA;AACA;;AAEA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,QAAQ,0CAA0C;AAClD;AACA;;AAEA;AACA,gEAAgE,YAAY;AAC5E;;AAEA;AACA,kEAAkE,eAAe;AACjF;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,qGAAqG,SAAS;AAC9G;;;;;;;;ACzGa;AACb,6BAA6B,mBAAO,CAAC,EAAyB;AAC9D,oBAAoB,mBAAO,CAAC,EAAc;AAC1C,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;;AAEA,4BAA4B,WAAW,GAAG,KAAK;;AAE/C;AACA;AACA;;AAEA;AACA;AACA,uBAAuB;AACvB,+BAA+B;AAC/B;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,IAAI;AACJ;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,YAAY;AAChC;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;AChGA;AACa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,yBAAsB;;;;;;;;ACjDT;AACb;;AAEA,yEAAyE,MAAM;;AAE/E;;;;;;;;;ACLa;;AAEb;AACA;AACA,kBAAkB,cAAc;AAChC;;AAEA;AACA;AACA,kBAAkB,aAAa,EAAE,EAAE,KAAK;AACxC;;AAEA;AACA;AACA,kBAAkB,aAAa,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;AAC9D;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA,GAAG;AACH;AACA;AACA,EAAE;AACF;;AAEA,WAAW,gCAAgC;AAC3C;AACA;AACA;AACA,iBAAiB,mBAAO,CAAC,EAAe;AACxC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,SAAS;AAC7B,qBAAqB,SAAS;AAC9B;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,EAAE;;AAEF;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClKD,oBAAoB,mBAAO,CAA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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA8B;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ,QAAQ;AAClC,kBAAkB,QAAQ,QAAQ;AAClC,kBAAkB,QAAQ,OAAO;AACjC,kBAAkB,QAAQ,OAAO;AACjC,kBAAkB,QAAQ,OAAO;AACjC,kBAAkB,QAAQ,OAAO;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,0EAA0E;;AAE1E;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,uBAAuB;AACvB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iDAAiD,EAAE,UAAU,EAAE;AAC/D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,aAAa,aAAa;AAC1C;AACA,gBAAgB,aAAa,aAAa;AAC1C;AACA,gBAAgB,aAAa,aAAa;AAC1C;AACA,gBAAgB,aAAa,aAAa;AAC1C;AACA,gBAAgB,aAAa,aAAa;AAC1C;AACA,gBAAgB,aAAa;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;ACt0BY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvJA,oBAAoB,mBAAO,CAAC,EAAe;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,4BAA4B;;AAE5B;;AAEA;AACA;AACA;;AAEA,0CAA0C,SAAS;AACnD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,sCAAsC,SAAS;AAC/C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;AC/Fa;AACb,kBAAkB,mBAAO,CAAC,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A;;AAEA;;;;;;;;ACnCA;;;;;;ACAA;AACA;AACA;AACA;;AAEA;AACA,EAAE,wCAAwC;AAC1C,EAAE;AACF,EAAE,wCAAqC;AACvC;;;;;;;ACTA;AACA;AACA;AACA;AACA;;AAEA,UAAU,wCAAmC;AAC7C,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN,MAAM,qBAAqB;AAC3B;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;;;;;;;;ACvLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd,eAAe;AACf,cAAc;AACd,eAAe;AACf,0CAAgC;;AAEhC;AACA;AACA;;AAEA,aAAa;AACb,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA,kBAAkB;;AAElB;AACA;AACA;;AAEA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;;AAEA;AACA;AACA,eAAe;AACf;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;;AAEA,EAAE,aAAa;AACf,EAAE,aAAa;;AAEf;AACA;;AAEA,kBAAkB,SAAS;AAC3B,6BAA6B;AAC7B;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;;;;;;;ACzMA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,eAAe;AAC1B,WAAW,QAAQ;AACnB,YAAY,OAAO;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvJA;AACA;AACA;;AAEA,UAAU,mBAAO,CAAC,EAAK;AACvB,WAAW,mBAAO,CAAC,EAAM;;AAEzB;AACA;AACA;AACA;AACA;;AAEA,UAAU,wCAAmC;AAC7C,YAAY;AACZ,WAAW;AACX,kBAAkB;AAClB,YAAY;AACZ,YAAY;AACZ,iBAAiB;;AAEjB;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,4CAA4C,wBAAwB;;AAEpE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC,IAAI;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA,oBAAoB;AACpB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC;;AAEtC;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,EAAI;AAC3B,4CAA4C,kBAAkB;AAC9D;AACA;;AAEA;AACA;AACA,gBAAgB,mBAAO,CAAC,EAAK;AAC7B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,kBAAkB,iBAAiB;AACnC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;ACvPA;;;;;;;ACAA;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA;;;;;UEJA;UACA;UACA;UACA","sources":["webpack://nativefier-placeholder/./src/main.ts","webpack://nativefier-placeholder/./node_modules/source-map-support/register.js","webpack://nativefier-placeholder/./node_modules/source-map-support/source-map-support.js","webpack://nativefier-placeholder/./node_modules/source-map/source-map.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/source-map-generator.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/base64-vlq.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/base64.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/util.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/array-set.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/mapping-list.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/source-map-consumer.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/binary-search.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/quick-sort.js","webpack://nativefier-placeholder/./node_modules/source-map/lib/source-node.js","webpack://nativefier-placeholder/external node-commonjs \"path\"","webpack://nativefier-placeholder/external node-commonjs \"fs\"","webpack://nativefier-placeholder/./node_modules/buffer-from/index.js","webpack://nativefier-placeholder/external commonjs \"electron\"","webpack://nativefier-placeholder/./node_modules/electron-dl/index.js","webpack://nativefier-placeholder/./node_modules/unused-filename/index.js","webpack://nativefier-placeholder/./node_modules/path-exists/index.js","webpack://nativefier-placeholder/external node-commonjs \"util\"","webpack://nativefier-placeholder/./node_modules/modify-filename/index.js","webpack://nativefier-placeholder/./node_modules/pupa/index.js","webpack://nativefier-placeholder/./node_modules/escape-goat/index.js","webpack://nativefier-placeholder/./node_modules/ext-name/index.js","webpack://nativefier-placeholder/./node_modules/ext-list/index.js","webpack://nativefier-placeholder/./node_modules/mime-db/index.js","webpack://nativefier-placeholder/./node_modules/sort-keys-length/index.js","webpack://nativefier-placeholder/./node_modules/sort-keys/index.js","webpack://nativefier-placeholder/./node_modules/is-plain-obj/index.js","webpack://nativefier-placeholder/./src/components/loginWindow.ts","webpack://nativefier-placeholder/./src/helpers/loggingHelper.ts","webpack://nativefier-placeholder/./node_modules/loglevel/lib/loglevel.js","webpack://nativefier-placeholder/./src/helpers/playwrightHelpers.ts","webpack://nativefier-placeholder/./src/components/mainWindow.ts","webpack://nativefier-placeholder/./node_modules/electron-window-state/index.js","webpack://nativefier-placeholder/./node_modules/jsonfile/index.js","webpack://nativefier-placeholder/./node_modules/graceful-fs/graceful-fs.js","webpack://nativefier-placeholder/./node_modules/graceful-fs/polyfills.js","webpack://nativefier-placeholder/external node-commonjs \"constants\"","webpack://nativefier-placeholder/./node_modules/graceful-fs/legacy-streams.js","webpack://nativefier-placeholder/external node-commonjs \"stream\"","webpack://nativefier-placeholder/./node_modules/graceful-fs/clone.js","webpack://nativefier-placeholder/external node-commonjs \"assert\"","webpack://nativefier-placeholder/./node_modules/mkdirp/index.js","webpack://nativefier-placeholder/./src/components/contextMenu.ts","webpack://nativefier-placeholder/./node_modules/electron-context-menu/index.js","webpack://nativefier-placeholder/./node_modules/cli-truncate/index.js","webpack://nativefier-placeholder/./node_modules/slice-ansi/index.js","webpack://nativefier-placeholder/./node_modules/is-fullwidth-code-point/index.js","webpack://nativefier-placeholder/./node_modules/astral-regex/index.js","webpack://nativefier-placeholder/./node_modules/ansi-styles/index.js","webpack://nativefier-placeholder/./node_modules/color-convert/index.js","webpack://nativefier-placeholder/./node_modules/color-convert/conversions.js","webpack://nativefier-placeholder/./node_modules/color-name/index.js","webpack://nativefier-placeholder/./node_modules/color-convert/route.js","webpack://nativefier-placeholder/./node_modules/string-width/index.js","webpack://nativefier-placeholder/./node_modules/strip-ansi/index.js","webpack://nativefier-placeholder/./node_modules/ansi-regex/index.js","webpack://nativefier-placeholder/./node_modules/emoji-regex/index.js","webpack://nativefier-placeholder/./node_modules/electron-is-dev/index.js","webpack://nativefier-placeholder/./src/helpers/helpers.ts","webpack://nativefier-placeholder/external node-commonjs \"os\"","webpack://nativefier-placeholder/./src/helpers/windowHelpers.ts","webpack://nativefier-placeholder/./src/helpers/windowEvents.ts","webpack://nativefier-placeholder/../shared/src/options/model.ts","webpack://nativefier-placeholder/./src/components/menu.ts","webpack://nativefier-placeholder/./src/components/trayIcon.ts","webpack://nativefier-placeholder/./src/helpers/inferFlash.ts","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/index.js","webpack://nativefier-placeholder/external node-commonjs \"child_process\"","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/node_modules/debug/src/index.js","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/node_modules/debug/src/browser.js","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/node_modules/debug/src/debug.js","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/node_modules/ms/index.js","webpack://nativefier-placeholder/./node_modules/electron-squirrel-startup/node_modules/debug/src/node.js","webpack://nativefier-placeholder/external node-commonjs \"tty\"","webpack://nativefier-placeholder/external node-commonjs \"net\"","webpack://nativefier-placeholder/webpack/bootstrap","webpack://nativefier-placeholder/webpack/runtime/node module decorator","webpack://nativefier-placeholder/webpack/before-startup","webpack://nativefier-placeholder/webpack/startup","webpack://nativefier-placeholder/webpack/after-startup"],"sourcesContent":["import 'source-map-support/register';\n\nimport fs from 'fs';\nimport * as path from 'path';\n\nimport electron, {\n app,\n dialog,\n globalShortcut,\n systemPreferences,\n BrowserWindow,\n Event,\n} from 'electron';\nimport electronDownload from 'electron-dl';\n\nimport { createLoginWindow } from './components/loginWindow';\nimport {\n createMainWindow,\n saveAppArgs,\n APP_ARGS_FILE_PATH,\n} from './components/mainWindow';\nimport { createTrayIcon } from './components/trayIcon';\nimport { isOSX, isWindows, removeUserAgentSpecifics } from './helpers/helpers';\nimport { inferFlashPath } from './helpers/inferFlash';\nimport * as log from './helpers/loggingHelper';\nimport {\n IS_PLAYWRIGHT,\n PLAYWRIGHT_CONFIG,\n safeGetEnv,\n} from './helpers/playwrightHelpers';\nimport { setupNativefierWindow } from './helpers/windowEvents';\nimport {\n OutputOptions,\n outputOptionsToWindowOptions,\n} from '../../shared/src/options/model';\n\n// Entrypoint for Squirrel, a windows update framework. See https://github.com/nativefier/nativefier/pull/744\nif (require('electron-squirrel-startup')) {\n app.exit();\n}\n\nif (process.argv.indexOf('--verbose') > -1 || safeGetEnv('VERBOSE') === '1') {\n log.setLevel('DEBUG');\n process.traceDeprecation = true;\n process.traceProcessWarnings = true;\n process.argv.slice(1);\n}\n\nlet mainWindow: BrowserWindow;\n\nconst appArgs =\n IS_PLAYWRIGHT && PLAYWRIGHT_CONFIG\n ? (JSON.parse(PLAYWRIGHT_CONFIG) as OutputOptions)\n : (JSON.parse(\n fs.readFileSync(APP_ARGS_FILE_PATH, 'utf8'),\n ) as OutputOptions);\n\nlog.debug('appArgs', appArgs);\n// Do this relatively early so that we can start storing appData with the app\nif (appArgs.portable) {\n log.debug(\n 'App was built as portable; setting appData and userData to the app folder: ',\n path.resolve(path.join(__dirname, '..', 'appData')),\n );\n app.setPath('appData', path.join(__dirname, '..', 'appData'));\n app.setPath('userData', path.join(__dirname, '..', 'appData'));\n}\n\nif (!appArgs.userAgentHonest) {\n if (appArgs.userAgent) {\n app.userAgentFallback = appArgs.userAgent;\n } else {\n app.userAgentFallback = removeUserAgentSpecifics(\n app.userAgentFallback,\n app.getName(),\n app.getVersion(),\n );\n }\n}\n\n// this step is required to allow app names to be displayed correctly in notifications on windows\n// https://www.electronjs.org/docs/latest/api/app#appsetappusermodelidid-windows\n// https://www.electronjs.org/docs/latest/tutorial/notifications#windows\nif (isWindows()) {\n app.setAppUserModelId(app.getName());\n}\n\nconst urlArgv = process.argv.filter((a) => a.startsWith('http'));\n\n// Take in a URL on the command line as an override\nif (urlArgv.length > 0) {\n const maybeUrl = urlArgv[0];\n try {\n new URL(maybeUrl);\n appArgs.targetUrl = maybeUrl;\n log.info('Loading override URL passed as argument:', maybeUrl);\n } catch (err: unknown) {\n log.error(\n 'Not loading override URL passed as argument, because failed to parse:',\n maybeUrl,\n err,\n );\n }\n}\n\n// Nativefier is a browser, and an old browser is an insecure / badly-performant one.\n// Given our builder/app design, we currently don't have an easy way to offer\n// upgrades from the app themselves (like browsers do).\n// As a workaround, we ask for a manual upgrade & re-build if the build is old.\n// The period in days is chosen to be not too small to be exceedingly annoying,\n// but not too large to be exceedingly insecure.\nconst OLD_BUILD_WARNING_THRESHOLD_DAYS = 90;\nconst OLD_BUILD_WARNING_THRESHOLD_MS =\n OLD_BUILD_WARNING_THRESHOLD_DAYS * 24 * 60 * 60 * 1000;\n\nconst fileDownloadOptions = { ...appArgs.fileDownloadOptions };\nelectronDownload(fileDownloadOptions);\n\nif (appArgs.processEnvs) {\n let processEnvs: Record<string, string> =\n appArgs.processEnvs as unknown as Record<string, string>;\n // This is compatibility if just a string was passed.\n if (typeof appArgs.processEnvs === 'string') {\n try {\n processEnvs = JSON.parse(appArgs.processEnvs) as Record<string, string>;\n } catch {\n // This wasn't JSON. Fall back to the old code\n processEnvs = {};\n process.env.processEnvs = appArgs.processEnvs;\n }\n }\n Object.keys(processEnvs)\n .filter((key) => key !== undefined)\n .forEach((key) => {\n process.env[key] = processEnvs[key];\n });\n}\n\nif (typeof appArgs.flashPluginDir === 'string') {\n app.commandLine.appendSwitch('ppapi-flash-path', appArgs.flashPluginDir);\n} else if (appArgs.flashPluginDir) {\n const flashPath = inferFlashPath();\n app.commandLine.appendSwitch('ppapi-flash-path', flashPath);\n}\n\nif (appArgs.ignoreCertificate) {\n app.commandLine.appendSwitch('ignore-certificate-errors');\n}\n\nif (appArgs.disableGpu) {\n app.disableHardwareAcceleration();\n}\n\nif (appArgs.ignoreGpuBlacklist) {\n app.commandLine.appendSwitch('ignore-gpu-blacklist');\n}\n\nif (appArgs.enableEs3Apis) {\n app.commandLine.appendSwitch('enable-es3-apis');\n}\n\nif (appArgs.diskCacheSize) {\n app.commandLine.appendSwitch(\n 'disk-cache-size',\n appArgs.diskCacheSize.toString(),\n );\n}\n\nif (appArgs.basicAuthUsername) {\n app.commandLine.appendSwitch(\n 'basic-auth-username',\n appArgs.basicAuthUsername,\n );\n}\n\nif (appArgs.basicAuthPassword) {\n app.commandLine.appendSwitch(\n 'basic-auth-password',\n appArgs.basicAuthPassword,\n );\n}\n\nif (appArgs.lang) {\n const langParts = appArgs.lang.split(',');\n // Convert locales to languages, because for some reason locales don't work. Stupid Chromium\n const langPartsParsed = Array.from(\n // Convert to set to dedupe in case something like \"en-GB,en-US\" was passed\n new Set(langParts.map((l) => l.split('-')[0])),\n );\n const langFlag = langPartsParsed.join(',');\n log.debug('Setting --lang flag to', langFlag);\n app.commandLine.appendSwitch('--lang', langFlag);\n}\n\nlet currentBadgeCount = 0;\nconst setDockBadge = isOSX()\n ? (count?: number | string, bounce = false): void => {\n if (count !== undefined) {\n app.dock.setBadge(count.toString());\n if (bounce && count > currentBadgeCount) app.dock.bounce();\n currentBadgeCount = typeof count === 'number' ? count : 0;\n }\n }\n : (): void => undefined;\n\napp.on('window-all-closed', () => {\n log.debug('app.window-all-closed');\n if (!isOSX() || appArgs.fastQuit || IS_PLAYWRIGHT) {\n app.quit();\n }\n});\n\napp.on('before-quit', () => {\n log.debug('app.before-quit');\n // not fired when the close button on the window is clicked\n if (isOSX()) {\n // need to force a quit as a workaround here to simulate the osx app hiding behaviour\n // Somehow sokution at https://github.com/atom/electron/issues/444#issuecomment-76492576 does not work,\n // e.prevent default appears to persist\n\n // might cause issues in the future as before-quit and will-quit events are not called\n app.exit(0);\n }\n});\n\napp.on('will-quit', (event) => {\n log.debug('app.will-quit', event);\n});\n\napp.on('quit', (event, exitCode) => {\n log.debug('app.quit', { event, exitCode });\n});\n\napp.on('will-finish-launching', () => {\n log.debug('app.will-finish-launching');\n});\n\napp.on('open-url', (event, url) => {\n log.debug('app.open-url', { event, url });\n\n event.preventDefault();\n if (mainWindow) {\n mainWindow.webContents.send('open-url', url);\n }\n});\n\nif (appArgs.widevine) {\n // @ts-expect-error This event only appears on the widevine version of electron, which we'd see at runtime\n app.on('widevine-ready', (version: string, lastVersion: string) => {\n log.debug('app.widevine-ready', { version, lastVersion });\n onReady().catch((err) => log.error('onReady ERROR', err));\n });\n\n app.on(\n // @ts-expect-error This event only appears on the widevine version of electron, which we'd see at runtime\n 'widevine-update-pending',\n (currentVersion: string, pendingVersion: string) => {\n log.debug('app.widevine-update-pending', {\n currentVersion,\n pendingVersion,\n });\n },\n );\n\n // @ts-expect-error This event only appears on the widevine version of electron, which we'd see at runtime\n app.on('widevine-error', (error: Error) => {\n log.error('app.widevine-error', error);\n });\n} else {\n app.on('ready', () => {\n log.debug('ready');\n onReady().catch((err) => log.error('onReady ERROR', err));\n });\n}\n\napp.on('activate', (event: electron.Event, hasVisibleWindows: boolean) => {\n log.debug('app.activate', { event, hasVisibleWindows });\n if (isOSX() && !IS_PLAYWRIGHT) {\n // this is called when the dock is clicked\n if (!hasVisibleWindows) {\n mainWindow.show();\n }\n }\n});\n\n// quit if singleInstance mode and there's already another instance running\nconst shouldQuit = appArgs.singleInstance && !app.requestSingleInstanceLock();\nif (shouldQuit) {\n app.quit();\n} else {\n app.on('second-instance', () => {\n log.debug('app.second-instance');\n if (mainWindow) {\n if (!mainWindow.isVisible()) {\n // try\n mainWindow.show();\n }\n if (mainWindow.isMinimized()) {\n // minimized\n mainWindow.restore();\n }\n mainWindow.focus();\n }\n });\n}\n\napp.on('new-window-for-tab', () => {\n log.debug('app.new-window-for-tab');\n if (mainWindow) {\n mainWindow.emit('new-tab');\n }\n});\n\napp.on(\n 'login',\n (\n event,\n webContents,\n request,\n authInfo,\n callback: (username?: string, password?: string) => void,\n ) => {\n log.debug('app.login', { event, request });\n // for http authentication\n event.preventDefault();\n\n if (appArgs.basicAuthUsername && appArgs.basicAuthPassword) {\n callback(appArgs.basicAuthUsername, appArgs.basicAuthPassword);\n } else {\n createLoginWindow(callback, mainWindow).catch((err) =>\n log.error('createLoginWindow ERROR', err),\n );\n }\n },\n);\n\nasync function onReady(): Promise<void> {\n // Warning: `mainWindow` below is the *global* unique `mainWindow`, created at init time\n mainWindow = await createMainWindow(appArgs, setDockBadge);\n\n createTrayIcon(appArgs, mainWindow);\n\n // Register global shortcuts\n if (appArgs.globalShortcuts) {\n appArgs.globalShortcuts.forEach((shortcut) => {\n globalShortcut.register(shortcut.key, () => {\n shortcut.inputEvents.forEach((inputEvent) => {\n // @ts-expect-error without including electron in our models, these will never match\n mainWindow.webContents.sendInputEvent(inputEvent);\n });\n });\n });\n\n if (isOSX() && appArgs.accessibilityPrompt) {\n const mediaKeys = [\n 'MediaPlayPause',\n 'MediaNextTrack',\n 'MediaPreviousTrack',\n 'MediaStop',\n ];\n const globalShortcutsKeys = appArgs.globalShortcuts.map((g) => g.key);\n const mediaKeyWasSet = globalShortcutsKeys.find((g) =>\n mediaKeys.includes(g),\n );\n if (\n mediaKeyWasSet &&\n !systemPreferences.isTrustedAccessibilityClient(false)\n ) {\n // Since we're trying to set global keyboard shortcuts for media keys, we need to prompt\n // the user for permission on Mac.\n // For reference:\n // https://www.electronjs.org/docs/api/global-shortcut?q=MediaPlayPause#globalshortcutregisteraccelerator-callback\n const accessibilityPromptResult = dialog.showMessageBoxSync(\n mainWindow,\n {\n type: 'question',\n message: 'Accessibility Permissions Needed',\n buttons: ['Yes', 'No', 'No and never ask again'],\n defaultId: 0,\n detail:\n `${appArgs.name} would like to use one or more of your keyboard's media keys (start, stop, next track, or previous track) to control it.\\n\\n` +\n `Would you like Mac OS to ask for your permission to do so?\\n\\n` +\n `If so, you will need to restart ${appArgs.name} after granting permissions for these keyboard shortcuts to begin working.`,\n },\n );\n switch (accessibilityPromptResult) {\n // User clicked Yes, prompt for accessibility\n case 0:\n systemPreferences.isTrustedAccessibilityClient(true);\n break;\n // User cliecked Never Ask Me Again, save that info\n case 2:\n appArgs.accessibilityPrompt = false;\n saveAppArgs(appArgs);\n break;\n // User clicked No\n default:\n break;\n }\n }\n }\n }\n if (\n !appArgs.disableOldBuildWarning &&\n new Date().getTime() - appArgs.buildDate > OLD_BUILD_WARNING_THRESHOLD_MS\n ) {\n const oldBuildWarningText =\n appArgs.oldBuildWarningText ||\n 'This app was built a long time ago. Nativefier uses the Chrome browser (through Electron), and it is insecure to keep using an old version of it. Please upgrade Nativefier and rebuild this app.';\n dialog\n .showMessageBox(mainWindow, {\n type: 'warning',\n message: 'Old build detected',\n detail: oldBuildWarningText,\n })\n .catch((err) => log.error('dialog.showMessageBox ERROR', err));\n }\n\n if (appArgs.targetUrl) {\n await mainWindow.loadURL(appArgs.targetUrl);\n }\n}\n\napp.on(\n 'accessibility-support-changed',\n (event: Event, accessibilitySupportEnabled: boolean) => {\n log.debug('app.accessibility-support-changed', {\n event,\n accessibilitySupportEnabled,\n });\n },\n);\n\napp.on(\n 'activity-was-continued',\n (event: Event, type: string, userInfo: unknown) => {\n log.debug('app.activity-was-continued', { event, type, userInfo });\n },\n);\n\napp.on('browser-window-blur', () => {\n log.debug('app.browser-window-blur');\n});\n\napp.on('browser-window-created', () => {\n log.debug('app.browser-window-created');\n});\n\napp.on('browser-window-focus', () => {\n log.debug('app.browser-window-focus');\n});\n","require('./').install();\n","var SourceMapConsumer = require('source-map').SourceMapConsumer;\nvar path = require('path');\n\nvar fs;\ntry {\n fs = require('fs');\n if (!fs.existsSync || !fs.readFileSync) {\n // fs doesn't have all methods we need\n fs = null;\n }\n} catch (err) {\n /* nop */\n}\n\nvar bufferFrom = require('buffer-from');\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param {NodeModule} mod\n * @param {string} request\n */\nfunction dynamicRequire(mod, request) {\n return mod.require(request);\n}\n\n// Only install once if called multiple times\nvar errorFormatterInstalled = false;\nvar uncaughtShimInstalled = false;\n\n// If true, the caches are reset before a stack trace formatting operation\nvar emptyCacheBetweenOperations = false;\n\n// Supports {browser, node, auto}\nvar environment = \"auto\";\n\n// Maps a file path to a string containing the file contents\nvar fileContentsCache = {};\n\n// Maps a file path to a source map for that file\nvar sourceMapCache = {};\n\n// Regex for detecting source maps\nvar reSourceMap = /^data:application\\/json[^,]+base64,/;\n\n// Priority list of retrieve handlers\nvar retrieveFileHandlers = [];\nvar retrieveMapHandlers = [];\n\nfunction isInBrowser() {\n if (environment === \"browser\")\n return true;\n if (environment === \"node\")\n return false;\n return ((typeof window !== 'undefined') && (typeof XMLHttpRequest === 'function') && !(window.require && window.module && window.process && window.process.type === \"renderer\"));\n}\n\nfunction hasGlobalProcessEventEmitter() {\n return ((typeof process === 'object') && (process !== null) && (typeof process.on === 'function'));\n}\n\nfunction globalProcessVersion() {\n if ((typeof process === 'object') && (process !== null)) {\n return process.version;\n } else {\n return '';\n }\n}\n\nfunction globalProcessStderr() {\n if ((typeof process === 'object') && (process !== null)) {\n return process.stderr;\n }\n}\n\nfunction globalProcessExit(code) {\n if ((typeof process === 'object') && (process !== null) && (typeof process.exit === 'function')) {\n return process.exit(code);\n }\n}\n\nfunction handlerExec(list) {\n return function(arg) {\n for (var i = 0; i < list.length; i++) {\n var ret = list[i](arg);\n if (ret) {\n return ret;\n }\n }\n return null;\n };\n}\n\nvar retrieveFile = handlerExec(retrieveFileHandlers);\n\nretrieveFileHandlers.push(function(path) {\n // Trim the path to make sure there is no extra whitespace.\n path = path.trim();\n if (/^file:/.test(path)) {\n // existsSync/readFileSync can't handle file protocol, but once stripped, it works\n path = path.replace(/file:\\/\\/\\/(\\w:)?/, function(protocol, drive) {\n return drive ?\n '' : // file:///C:/dir/file -> C:/dir/file\n '/'; // file:///root-dir/file -> /root-dir/file\n });\n }\n if (path in fileContentsCache) {\n return fileContentsCache[path];\n }\n\n var contents = '';\n try {\n if (!fs) {\n // Use SJAX if we are in the browser\n var xhr = new XMLHttpRequest();\n xhr.open('GET', path, /** async */ false);\n xhr.send(null);\n if (xhr.readyState === 4 && xhr.status === 200) {\n contents = xhr.responseText;\n }\n } else if (fs.existsSync(path)) {\n // Otherwise, use the filesystem\n contents = fs.readFileSync(path, 'utf8');\n }\n } catch (er) {\n /* ignore any errors */\n }\n\n return fileContentsCache[path] = contents;\n});\n\n// Support URLs relative to a directory, but be careful about a protocol prefix\n// in case we are in the browser (i.e. directories may start with \"http://\" or \"file:///\")\nfunction supportRelativeURL(file, url) {\n if (!file) return url;\n var dir = path.dirname(file);\n var match = /^\\w+:\\/\\/[^\\/]*/.exec(dir);\n var protocol = match ? match[0] : '';\n var startPath = dir.slice(protocol.length);\n if (protocol && /^\\/\\w\\:/.test(startPath)) {\n // handle file:///C:/ paths\n protocol += '/';\n return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\\\/g, '/');\n }\n return protocol + path.resolve(dir.slice(protocol.length), url);\n}\n\nfunction retrieveSourceMapURL(source) {\n var fileData;\n\n if (isInBrowser()) {\n try {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', source, false);\n xhr.send(null);\n fileData = xhr.readyState === 4 ? xhr.responseText : null;\n\n // Support providing a sourceMappingURL via the SourceMap header\n var sourceMapHeader = xhr.getResponseHeader(\"SourceMap\") ||\n xhr.getResponseHeader(\"X-SourceMap\");\n if (sourceMapHeader) {\n return sourceMapHeader;\n }\n } catch (e) {\n }\n }\n\n // Get the URL of the source map\n fileData = retrieveFile(source);\n var re = /(?:\\/\\/[@#][\\s]*sourceMappingURL=([^\\s'\"]+)[\\s]*$)|(?:\\/\\*[@#][\\s]*sourceMappingURL=([^\\s*'\"]+)[\\s]*(?:\\*\\/)[\\s]*$)/mg;\n // Keep executing the search to find the *last* sourceMappingURL to avoid\n // picking up sourceMappingURLs from comments, strings, etc.\n var lastMatch, match;\n while (match = re.exec(fileData)) lastMatch = match;\n if (!lastMatch) return null;\n return lastMatch[1];\n};\n\n// Can be overridden by the retrieveSourceMap option to install. Takes a\n// generated source filename; returns a {map, optional url} object, or null if\n// there is no source map. The map field may be either a string or the parsed\n// JSON object (ie, it must be a valid argument to the SourceMapConsumer\n// constructor).\nvar retrieveSourceMap = handlerExec(retrieveMapHandlers);\nretrieveMapHandlers.push(function(source) {\n var sourceMappingURL = retrieveSourceMapURL(source);\n if (!sourceMappingURL) return null;\n\n // Read the contents of the source map\n var sourceMapData;\n if (reSourceMap.test(sourceMappingURL)) {\n // Support source map URL as a data url\n var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(',') + 1);\n sourceMapData = bufferFrom(rawData, \"base64\").toString();\n sourceMappingURL = source;\n } else {\n // Support source map URLs relative to the source URL\n sourceMappingURL = supportRelativeURL(source, sourceMappingURL);\n sourceMapData = retrieveFile(sourceMappingURL);\n }\n\n if (!sourceMapData) {\n return null;\n }\n\n return {\n url: sourceMappingURL,\n map: sourceMapData\n };\n});\n\nfunction mapSourcePosition(position) {\n var sourceMap = sourceMapCache[position.source];\n if (!sourceMap) {\n // Call the (overrideable) retrieveSourceMap function to get the source map.\n var urlAndMap = retrieveSourceMap(position.source);\n if (urlAndMap) {\n sourceMap = sourceMapCache[position.source] = {\n url: urlAndMap.url,\n map: new SourceMapConsumer(urlAndMap.map)\n };\n\n // Load all sources stored inline with the source map into the file cache\n // to pretend like they are already loaded. They may not exist on disk.\n if (sourceMap.map.sourcesContent) {\n sourceMap.map.sources.forEach(function(source, i) {\n var contents = sourceMap.map.sourcesContent[i];\n if (contents) {\n var url = supportRelativeURL(sourceMap.url, source);\n fileContentsCache[url] = contents;\n }\n });\n }\n } else {\n sourceMap = sourceMapCache[position.source] = {\n url: null,\n map: null\n };\n }\n }\n\n // Resolve the source URL relative to the URL of the source map\n if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === 'function') {\n var originalPosition = sourceMap.map.originalPositionFor(position);\n\n // Only return the original position if a matching line was found. If no\n // matching line is found then we return position instead, which will cause\n // the stack trace to print the path and line for the compiled file. It is\n // better to give a precise location in the compiled file than a vague\n // location in the original file.\n if (originalPosition.source !== null) {\n originalPosition.source = supportRelativeURL(\n sourceMap.url, originalPosition.source);\n return originalPosition;\n }\n }\n\n return position;\n}\n\n// Parses code generated by FormatEvalOrigin(), a function inside V8:\n// https://code.google.com/p/v8/source/browse/trunk/src/messages.js\nfunction mapEvalOrigin(origin) {\n // Most eval() calls are in this format\n var match = /^eval at ([^(]+) \\((.+):(\\d+):(\\d+)\\)$/.exec(origin);\n if (match) {\n var position = mapSourcePosition({\n source: match[2],\n line: +match[3],\n column: match[4] - 1\n });\n return 'eval at ' + match[1] + ' (' + position.source + ':' +\n position.line + ':' + (position.column + 1) + ')';\n }\n\n // Parse nested eval() calls using recursion\n match = /^eval at ([^(]+) \\((.+)\\)$/.exec(origin);\n if (match) {\n return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')';\n }\n\n // Make sure we still return useful information if we didn't find anything\n return origin;\n}\n\n// This is copied almost verbatim from the V8 source code at\n// https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The\n// implementation of wrapCallSite() used to just forward to the actual source\n// code of CallSite.prototype.toString but unfortunately a new release of V8\n// did something to the prototype chain and broke the shim. The only fix I\n// could find was copy/paste.\nfunction CallSiteToString() {\n var fileName;\n var fileLocation = \"\";\n if (this.isNative()) {\n fileLocation = \"native\";\n } else {\n fileName = this.getScriptNameOrSourceURL();\n if (!fileName && this.isEval()) {\n fileLocation = this.getEvalOrigin();\n fileLocation += \", \"; // Expecting source position to follow.\n }\n\n if (fileName) {\n fileLocation += fileName;\n } else {\n // Source code does not originate from a file and is not native, but we\n // can still get the source position inside the source string, e.g. in\n // an eval string.\n fileLocation += \"<anonymous>\";\n }\n var lineNumber = this.getLineNumber();\n if (lineNumber != null) {\n fileLocation += \":\" + lineNumber;\n var columnNumber = this.getColumnNumber();\n if (columnNumber) {\n fileLocation += \":\" + columnNumber;\n }\n }\n }\n\n var line = \"\";\n var functionName = this.getFunctionName();\n var addSuffix = true;\n var isConstructor = this.isConstructor();\n var isMethodCall = !(this.isToplevel() || isConstructor);\n if (isMethodCall) {\n var typeName = this.getTypeName();\n // Fixes shim to be backward compatable with Node v0 to v4\n if (typeName === \"[object Object]\") {\n typeName = \"null\";\n }\n var methodName = this.getMethodName();\n if (functionName) {\n if (typeName && functionName.indexOf(typeName) != 0) {\n line += typeName + \".\";\n }\n line += functionName;\n if (methodName && functionName.indexOf(\".\" + methodName) != functionName.length - methodName.length - 1) {\n line += \" [as \" + methodName + \"]\";\n }\n } else {\n line += typeName + \".\" + (methodName || \"<anonymous>\");\n }\n } else if (isConstructor) {\n line += \"new \" + (functionName || \"<anonymous>\");\n } else if (functionName) {\n line += functionName;\n } else {\n line += fileLocation;\n addSuffix = false;\n }\n if (addSuffix) {\n line += \" (\" + fileLocation + \")\";\n }\n return line;\n}\n\nfunction cloneCallSite(frame) {\n var object = {};\n Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {\n object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name];\n });\n object.toString = CallSiteToString;\n return object;\n}\n\nfunction wrapCallSite(frame, state) {\n // provides interface backward compatibility\n if (state === undefined) {\n state = { nextPosition: null, curPosition: null }\n }\n if(frame.isNative()) {\n state.curPosition = null;\n return frame;\n }\n\n // Most call sites will return the source file from getFileName(), but code\n // passed to eval() ending in \"//# sourceURL=...\" will return the source file\n // from getScriptNameOrSourceURL() instead\n var source = frame.getFileName() || frame.getScriptNameOrSourceURL();\n if (source) {\n var line = frame.getLineNumber();\n var column = frame.getColumnNumber() - 1;\n\n // Fix position in Node where some (internal) code is prepended.\n // See https://github.com/evanw/node-source-map-support/issues/36\n // Header removed in node at ^10.16 || >=11.11.0\n // v11 is not an LTS candidate, we can just test the one version with it.\n // Test node versions for: 10.16-19, 10.20+, 12-19, 20-99, 100+, or 11.11\n var noHeader = /^v(10\\.1[6-9]|10\\.[2-9][0-9]|10\\.[0-9]{3,}|1[2-9]\\d*|[2-9]\\d|\\d{3,}|11\\.11)/;\n var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;\n if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {\n column -= headerLength;\n }\n\n var position = mapSourcePosition({\n source: source,\n line: line,\n column: column\n });\n state.curPosition = position;\n frame = cloneCallSite(frame);\n var originalFunctionName = frame.getFunctionName;\n frame.getFunctionName = function() {\n if (state.nextPosition == null) {\n return originalFunctionName();\n }\n return state.nextPosition.name || originalFunctionName();\n };\n frame.getFileName = function() { return position.source; };\n frame.getLineNumber = function() { return position.line; };\n frame.getColumnNumber = function() { return position.column + 1; };\n frame.getScriptNameOrSourceURL = function() { return position.source; };\n return frame;\n }\n\n // Code called using eval() needs special handling\n var origin = frame.isEval() && frame.getEvalOrigin();\n if (origin) {\n origin = mapEvalOrigin(origin);\n frame = cloneCallSite(frame);\n frame.getEvalOrigin = function() { return origin; };\n return frame;\n }\n\n // If we get here then we were unable to change the source position\n return frame;\n}\n\n// This function is part of the V8 stack trace API, for more info see:\n// https://v8.dev/docs/stack-trace-api\nfunction prepareStackTrace(error, stack) {\n if (emptyCacheBetweenOperations) {\n fileContentsCache = {};\n sourceMapCache = {};\n }\n\n var name = error.name || 'Error';\n var message = error.message || '';\n var errorString = name + \": \" + message;\n\n var state = { nextPosition: null, curPosition: null };\n var processedStack = [];\n for (var i = stack.length - 1; i >= 0; i--) {\n processedStack.push('\\n at ' + wrapCallSite(stack[i], state));\n state.nextPosition = state.curPosition;\n }\n state.curPosition = state.nextPosition = null;\n return errorString + processedStack.reverse().join('');\n}\n\n// Generate position and snippet of original source with pointer\nfunction getErrorSource(error) {\n var match = /\\n at [^(]+ \\((.*):(\\d+):(\\d+)\\)/.exec(error.stack);\n if (match) {\n var source = match[1];\n var line = +match[2];\n var column = +match[3];\n\n // Support the inline sourceContents inside the source map\n var contents = fileContentsCache[source];\n\n // Support files on disk\n if (!contents && fs && fs.existsSync(source)) {\n try {\n contents = fs.readFileSync(source, 'utf8');\n } catch (er) {\n contents = '';\n }\n }\n\n // Format the line from the original source code like node does\n if (contents) {\n var code = contents.split(/(?:\\r\\n|\\r|\\n)/)[line - 1];\n if (code) {\n return source + ':' + line + '\\n' + code + '\\n' +\n new Array(column).join(' ') + '^';\n }\n }\n }\n return null;\n}\n\nfunction printErrorAndExit (error) {\n var source = getErrorSource(error);\n\n // Ensure error is printed synchronously and not truncated\n var stderr = globalProcessStderr();\n if (stderr && stderr._handle && stderr._handle.setBlocking) {\n stderr._handle.setBlocking(true);\n }\n\n if (source) {\n console.error();\n console.error(source);\n }\n\n console.error(error.stack);\n globalProcessExit(1);\n}\n\nfunction shimEmitUncaughtException () {\n var origEmit = process.emit;\n\n process.emit = function (type) {\n if (type === 'uncaughtException') {\n var hasStack = (arguments[1] && arguments[1].stack);\n var hasListeners = (this.listeners(type).length > 0);\n\n if (hasStack && !hasListeners) {\n return printErrorAndExit(arguments[1]);\n }\n }\n\n return origEmit.apply(this, arguments);\n };\n}\n\nvar originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);\nvar originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);\n\nexports.wrapCallSite = wrapCallSite;\nexports.getErrorSource = getErrorSource;\nexports.mapSourcePosition = mapSourcePosition;\nexports.retrieveSourceMap = retrieveSourceMap;\n\nexports.install = function(options) {\n options = options || {};\n\n if (options.environment) {\n environment = options.environment;\n if ([\"node\", \"browser\", \"auto\"].indexOf(environment) === -1) {\n throw new Error(\"environment \" + environment + \" was unknown. Available options are {auto, browser, node}\")\n }\n }\n\n // Allow sources to be found by methods other than reading the files\n // directly from disk.\n if (options.retrieveFile) {\n if (options.overrideRetrieveFile) {\n retrieveFileHandlers.length = 0;\n }\n\n retrieveFileHandlers.unshift(options.retrieveFile);\n }\n\n // Allow source maps to be found by methods other than reading the files\n // directly from disk.\n if (options.retrieveSourceMap) {\n if (options.overrideRetrieveSourceMap) {\n retrieveMapHandlers.length = 0;\n }\n\n retrieveMapHandlers.unshift(options.retrieveSourceMap);\n }\n\n // Support runtime transpilers that include inline source maps\n if (options.hookRequire && !isInBrowser()) {\n // Use dynamicRequire to avoid including in browser bundles\n var Module = dynamicRequire(module, 'module');\n var $compile = Module.prototype._compile;\n\n if (!$compile.__sourceMapSupport) {\n Module.prototype._compile = function(content, filename) {\n fileContentsCache[filename] = content;\n sourceMapCache[filename] = undefined;\n return $compile.call(this, content, filename);\n };\n\n Module.prototype._compile.__sourceMapSupport = true;\n }\n }\n\n // Configure options\n if (!emptyCacheBetweenOperations) {\n emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ?\n options.emptyCacheBetweenOperations : false;\n }\n\n // Install the error reformatter\n if (!errorFormatterInstalled) {\n errorFormatterInstalled = true;\n Error.prepareStackTrace = prepareStackTrace;\n }\n\n if (!uncaughtShimInstalled) {\n var installHandler = 'handleUncaughtExceptions' in options ?\n options.handleUncaughtExceptions : true;\n\n // Do not override 'uncaughtException' with our own handler in Node.js\n // Worker threads. Workers pass the error to the main thread as an event,\n // rather than printing something to stderr and exiting.\n try {\n // We need to use `dynamicRequire` because `require` on it's own will be optimized by WebPack/Browserify.\n var worker_threads = dynamicRequire(module, 'worker_threads');\n if (worker_threads.isMainThread === false) {\n installHandler = false;\n }\n } catch(e) {}\n\n // Provide the option to not install the uncaught exception handler. This is\n // to support other uncaught exception handlers (in test frameworks, for\n // example). If this handler is not installed and there are no other uncaught\n // exception handlers, uncaught exceptions will be caught by node's built-in\n // exception handler and the process will still be terminated. However, the\n // generated JavaScript code will be shown above the stack trace instead of\n // the original source code.\n if (installHandler && hasGlobalProcessEventEmitter()) {\n uncaughtShimInstalled = true;\n shimEmitUncaughtException();\n }\n }\n};\n\nexports.resetRetrieveHandlers = function() {\n retrieveFileHandlers.length = 0;\n retrieveMapHandlers.length = 0;\n\n retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);\n retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);\n\n retrieveSourceMap = handlerExec(retrieveMapHandlers);\n retrieveFile = handlerExec(retrieveFileHandlers);\n}\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","module.exports = require(\"path\");","module.exports = require(\"fs\");","/* eslint-disable node/no-deprecated-api */\n\nvar toString = Object.prototype.toString\n\nvar isModern = (\n typeof Buffer !== 'undefined' &&\n typeof Buffer.alloc === 'function' &&\n typeof Buffer.allocUnsafe === 'function' &&\n typeof Buffer.from === 'function'\n)\n\nfunction isArrayBuffer (input) {\n return toString.call(input).slice(8, -1) === 'ArrayBuffer'\n}\n\nfunction fromArrayBuffer (obj, byteOffset, length) {\n byteOffset >>>= 0\n\n var maxLength = obj.byteLength - byteOffset\n\n if (maxLength < 0) {\n throw new RangeError(\"'offset' is out of bounds\")\n }\n\n if (length === undefined) {\n length = maxLength\n } else {\n length >>>= 0\n\n if (length > maxLength) {\n throw new RangeError(\"'length' is out of bounds\")\n }\n }\n\n return isModern\n ? Buffer.from(obj.slice(byteOffset, byteOffset + length))\n : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n return isModern\n ? Buffer.from(string, encoding)\n : new Buffer(string, encoding)\n}\n\nfunction bufferFrom (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (isArrayBuffer(value)) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n return isModern\n ? Buffer.from(value)\n : new Buffer(value)\n}\n\nmodule.exports = bufferFrom\n","module.exports = require(\"electron\");","'use strict';\nconst path = require('path');\nconst {app, BrowserWindow, shell, dialog} = require('electron');\nconst unusedFilename = require('unused-filename');\nconst pupa = require('pupa');\nconst extName = require('ext-name');\n\nconst getFilenameFromMime = (name, mime) => {\n\tconst extensions = extName.mime(mime);\n\n\tif (extensions.length !== 1) {\n\t\treturn name;\n\t}\n\n\treturn `${name}.${extensions[0].ext}`;\n};\n\nconst majorElectronVersion = () => {\n\tconst version = process.versions.electron.split('.');\n\treturn Number.parseInt(version[0], 10);\n};\n\nconst getWindowFromBrowserView = webContents => {\n\tfor (const currentWindow of BrowserWindow.getAllWindows()) {\n\t\tfor (const currentBrowserView of currentWindow.getBrowserViews()) {\n\t\t\tif (currentBrowserView.webContents.id === webContents.id) {\n\t\t\t\treturn currentWindow;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst getWindowFromWebContents = webContents => {\n\tlet window_;\n\tconst webContentsType = webContents.getType();\n\tswitch (webContentsType) {\n\t\tcase 'webview':\n\t\t\twindow_ = BrowserWindow.fromWebContents(webContents.hostWebContents);\n\t\t\tbreak;\n\t\tcase 'browserView':\n\t\t\twindow_ = getWindowFromBrowserView(webContents);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\twindow_ = BrowserWindow.fromWebContents(webContents);\n\t\t\tbreak;\n\t}\n\n\treturn window_;\n};\n\nfunction registerListener(session, options, callback = () => {}) {\n\tconst downloadItems = new Set();\n\tlet receivedBytes = 0;\n\tlet completedBytes = 0;\n\tlet totalBytes = 0;\n\tconst activeDownloadItems = () => downloadItems.size;\n\tconst progressDownloadItems = () => receivedBytes / totalBytes;\n\n\toptions = {\n\t\tshowBadge: true,\n\t\tshowProgressBar: true,\n\t\t...options\n\t};\n\n\tconst listener = (event, item, webContents) => {\n\t\tdownloadItems.add(item);\n\t\ttotalBytes += item.getTotalBytes();\n\n\t\tconst window_ = majorElectronVersion() >= 12 ? BrowserWindow.fromWebContents(webContents) : getWindowFromWebContents(webContents);\n\n\t\tif (options.directory && !path.isAbsolute(options.directory)) {\n\t\t\tthrow new Error('The `directory` option must be an absolute path');\n\t\t}\n\n\t\tconst directory = options.directory || app.getPath('downloads');\n\n\t\tlet filePath;\n\t\tif (options.filename) {\n\t\t\tfilePath = path.join(directory, options.filename);\n\t\t} else {\n\t\t\tconst filename = item.getFilename();\n\t\t\tconst name = path.extname(filename) ? filename : getFilenameFromMime(filename, item.getMimeType());\n\n\t\t\tfilePath = options.overwrite ? path.join(directory, name) : unusedFilename.sync(path.join(directory, name));\n\t\t}\n\n\t\tconst errorMessage = options.errorMessage || 'The download of {filename} was interrupted';\n\n\t\tif (options.saveAs) {\n\t\t\titem.setSaveDialogOptions({defaultPath: filePath});\n\t\t} else {\n\t\t\titem.setSavePath(filePath);\n\t\t}\n\n\t\tif (typeof options.onStarted === 'function') {\n\t\t\toptions.onStarted(item);\n\t\t}\n\n\t\titem.on('updated', () => {\n\t\t\treceivedBytes = completedBytes;\n\t\t\tfor (const item of downloadItems) {\n\t\t\t\treceivedBytes += item.getReceivedBytes();\n\t\t\t}\n\n\t\t\tif (options.showBadge && ['darwin', 'linux'].includes(process.platform)) {\n\t\t\t\tapp.badgeCount = activeDownloadItems();\n\t\t\t}\n\n\t\t\tif (!window_.isDestroyed() && options.showProgressBar) {\n\t\t\t\twindow_.setProgressBar(progressDownloadItems());\n\t\t\t}\n\n\t\t\tif (typeof options.onProgress === 'function') {\n\t\t\t\tconst itemTransferredBytes = item.getReceivedBytes();\n\t\t\t\tconst itemTotalBytes = item.getTotalBytes();\n\n\t\t\t\toptions.onProgress({\n\t\t\t\t\tpercent: itemTotalBytes ? itemTransferredBytes / itemTotalBytes : 0,\n\t\t\t\t\ttransferredBytes: itemTransferredBytes,\n\t\t\t\t\ttotalBytes: itemTotalBytes\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof options.onTotalProgress === 'function') {\n\t\t\t\toptions.onTotalProgress({\n\t\t\t\t\tpercent: progressDownloadItems(),\n\t\t\t\t\ttransferredBytes: receivedBytes,\n\t\t\t\t\ttotalBytes\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\titem.on('done', (event, state) => {\n\t\t\tcompletedBytes += item.getTotalBytes();\n\t\t\tdownloadItems.delete(item);\n\n\t\t\tif (options.showBadge && ['darwin', 'linux'].includes(process.platform)) {\n\t\t\t\tapp.badgeCount = activeDownloadItems();\n\t\t\t}\n\n\t\t\tif (!window_.isDestroyed() && !activeDownloadItems()) {\n\t\t\t\twindow_.setProgressBar(-1);\n\t\t\t\treceivedBytes = 0;\n\t\t\t\tcompletedBytes = 0;\n\t\t\t\ttotalBytes = 0;\n\t\t\t}\n\n\t\t\tif (options.unregisterWhenDone) {\n\t\t\t\tsession.removeListener('will-download', listener);\n\t\t\t}\n\n\t\t\t// eslint-disable-next-line unicorn/prefer-switch\n\t\t\tif (state === 'cancelled') {\n\t\t\t\tif (typeof options.onCancel === 'function') {\n\t\t\t\t\toptions.onCancel(item);\n\t\t\t\t}\n\t\t\t} else if (state === 'interrupted') {\n\t\t\t\tconst message = pupa(errorMessage, {filename: path.basename(filePath)});\n\t\t\t\tcallback(new Error(message));\n\t\t\t} else if (state === 'completed') {\n\t\t\t\tconst savePath = item.getSavePath();\n\n\t\t\t\tif (process.platform === 'darwin') {\n\t\t\t\t\tapp.dock.downloadFinished(savePath);\n\t\t\t\t}\n\n\t\t\t\tif (options.openFolderWhenDone) {\n\t\t\t\t\tshell.showItemInFolder(savePath);\n\t\t\t\t}\n\n\t\t\t\tif (typeof options.onCompleted === 'function') {\n\t\t\t\t\toptions.onCompleted({\n\t\t\t\t\t\tfileName: item.getFilename(), // Just for backwards compatibility. TODO: Remove in the next major version.\n\t\t\t\t\t\tfilename: item.getFilename(),\n\t\t\t\t\t\tpath: savePath,\n\t\t\t\t\t\tfileSize: item.getReceivedBytes(),\n\t\t\t\t\t\tmimeType: item.getMimeType(),\n\t\t\t\t\t\turl: item.getURL()\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tcallback(null, item);\n\t\t\t}\n\t\t});\n\t};\n\n\tsession.on('will-download', listener);\n}\n\nmodule.exports = (options = {}) => {\n\tapp.on('session-created', session => {\n\t\tregisterListener(session, options, (error, _) => {\n\t\t\tif (error) {\n\t\t\t\tconst errorTitle = options.errorTitle || 'Download Error';\n\t\t\t\tdialog.showErrorBox(errorTitle, error.message);\n\t\t\t}\n\t\t});\n\t});\n};\n\nmodule.exports.download = (window_, url, options) => new Promise((resolve, reject) => {\n\toptions = {\n\t\t...options,\n\t\tunregisterWhenDone: true\n\t};\n\n\tregisterListener(window_.webContents.session, options, (error, item) => {\n\t\tif (error) {\n\t\t\treject(error);\n\t\t} else {\n\t\t\tresolve(item);\n\t\t}\n\t});\n\n\twindow_.webContents.downloadURL(url);\n});\n","'use strict';\nconst pathExists = require('path-exists');\nconst modifyFilename = require('modify-filename');\n\nconst incrementer = filePath => {\n\tlet counter = 0;\n\treturn () => modifyFilename(filePath, (filename, extension) => `${filename} (${++counter})${extension}`);\n};\n\nconst unusedFilename = filePath => {\n\tconst getFilePath = incrementer(filePath);\n\tconst find = async newFilePath => await pathExists(newFilePath) ? find(getFilePath()) : newFilePath;\n\treturn find(filePath);\n};\n\nmodule.exports = unusedFilename;\n// TODO: Remove this for the next major release\nmodule.exports.default = unusedFilename;\n\nmodule.exports.sync = filePath => {\n\tconst getFilePath = incrementer(filePath);\n\tconst find = newFilePath => pathExists.sync(newFilePath) ? find(getFilePath()) : newFilePath;\n\treturn find(filePath);\n};\n","'use strict';\nconst fs = require('fs');\nconst {promisify} = require('util');\n\nconst pAccess = promisify(fs.access);\n\nmodule.exports = async path => {\n\ttry {\n\t\tawait pAccess(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n\nmodule.exports.sync = path => {\n\ttry {\n\t\tfs.accessSync(path);\n\t\treturn true;\n\t} catch (_) {\n\t\treturn false;\n\t}\n};\n","module.exports = require(\"util\");","'use strict';\nvar path = require('path');\n\nmodule.exports = function modifyFilename(pth, modifier) {\n\tif (arguments.length !== 2) {\n\t\tthrow new Error('`path` and `modifier` required');\n\t}\n\n\tif (Array.isArray(pth)) {\n\t\treturn pth.map(function (el) {\n\t\t\treturn modifyFilename(el, modifier);\n\t\t});\n\t}\n\n\tvar ext = path.extname(pth);\n\treturn path.join(path.dirname(pth), modifier(path.basename(pth, ext), ext));\n};\n","'use strict';\nconst {htmlEscape} = require('escape-goat');\n\nmodule.exports = (template, data) => {\n\tif (typeof template !== 'string') {\n\t\tthrow new TypeError(`Expected a \\`string\\` in the first argument, got \\`${typeof template}\\``);\n\t}\n\n\tif (typeof data !== 'object') {\n\t\tthrow new TypeError(`Expected an \\`object\\` or \\`Array\\` in the second argument, got \\`${typeof data}\\``);\n\t}\n\n\t// The regex tries to match either a number inside `{{ }}` or a valid JS identifier or key path.\n\tconst doubleBraceRegex = /{{(\\d+|[a-z$_][a-z\\d$_]*?(?:\\.[a-z\\d$_]*?)*?)}}/gi;\n\n\tif (doubleBraceRegex.test(template)) {\n\t\ttemplate = template.replace(doubleBraceRegex, (_, key) => {\n\t\t\tlet result = data;\n\n\t\t\tfor (const property of key.split('.')) {\n\t\t\t\tresult = result ? result[property] : '';\n\t\t\t}\n\n\t\t\treturn htmlEscape(String(result));\n\t\t});\n\t}\n\n\tconst braceRegex = /{(\\d+|[a-z$_][a-z\\d$_]*?(?:\\.[a-z\\d$_]*?)*?)}/gi;\n\n\treturn template.replace(braceRegex, (_, key) => {\n\t\tlet result = data;\n\n\t\tfor (const property of key.split('.')) {\n\t\t\tresult = result ? result[property] : '';\n\t\t}\n\n\t\treturn String(result);\n\t});\n};\n","'use strict';\n\nexports.htmlEscape = string => string\n\t.replace(/&/g, '&amp;')\n\t.replace(/\"/g, '&quot;')\n\t.replace(/'/g, '&#39;')\n\t.replace(/</g, '&lt;')\n\t.replace(/>/g, '&gt;');\n\nexports.htmlUnescape = htmlString => htmlString\n\t.replace(/&gt;/g, '>')\n\t.replace(/&lt;/g, '<')\n\t.replace(/&#0?39;/g, '\\'')\n\t.replace(/&quot;/g, '\"')\n\t.replace(/&amp;/g, '&');\n\nexports.htmlEscapeTag = (strings, ...values) => {\n\tlet output = strings[0];\n\tfor (let i = 0; i < values.length; i++) {\n\t\toutput = output + exports.htmlEscape(String(values[i])) + strings[i + 1];\n\t}\n\n\treturn output;\n};\n\nexports.htmlUnescapeTag = (strings, ...values) => {\n\tlet output = strings[0];\n\tfor (let i = 0; i < values.length; i++) {\n\t\toutput = output + exports.htmlUnescape(String(values[i])) + strings[i + 1];\n\t}\n\n\treturn output;\n};\n","'use strict';\nconst extList = require('ext-list');\nconst sortKeysLength = require('sort-keys-length');\n\nmodule.exports = str => {\n\tconst obj = sortKeysLength.desc(extList());\n\tconst exts = Object.keys(obj).filter(x => str.endsWith(x));\n\n\tif (exts.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn exts.map(x => ({\n\t\text: x,\n\t\tmime: obj[x]\n\t}));\n};\n\nmodule.exports.mime = str => {\n\tconst obj = sortKeysLength.desc(extList());\n\tconst exts = Object.keys(obj).filter(x => obj[x] === str);\n\n\tif (exts.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn exts.map(x => ({\n\t\text: x,\n\t\tmime: obj[x]\n\t}));\n};\n","'use strict';\nvar mimeDb = require('mime-db');\n\nmodule.exports = function () {\n\tvar ret = {};\n\n\tObject.keys(mimeDb).forEach(function (x) {\n\t\tvar val = mimeDb[x];\n\n\t\tif (val.extensions && val.extensions.length > 0) {\n\t\t\tval.extensions.forEach(function (y) {\n\t\t\t\tret[y] = x;\n\t\t\t});\n\t\t}\n\t});\n\n\treturn ret;\n};\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","'use strict';\n\nvar sortKeys = require('sort-keys');\n\n/**\n * Sort object keys by length\n *\n * @param obj\n * @api public\n */\n\nmodule.exports.desc = function (obj) {\n\treturn sortKeys(obj, function (a, b) {\n\t\treturn b.length - a.length;\n\t});\n}\n\nmodule.exports.asc = function (obj) {\n\treturn sortKeys(obj, function (a, b) {\n\t\treturn a.length - b.length;\n\t});\n}\n","'use strict';\nvar isPlainObj = require('is-plain-obj');\n\nmodule.exports = function (obj, opts) {\n\tif (!isPlainObj(obj)) {\n\t\tthrow new TypeError('Expected a plain object');\n\t}\n\n\topts = opts || {};\n\n\t// DEPRECATED\n\tif (typeof opts === 'function') {\n\t\topts = {compare: opts};\n\t}\n\n\tvar deep = opts.deep;\n\tvar seenInput = [];\n\tvar seenOutput = [];\n\n\tvar sortKeys = function (x) {\n\t\tvar seenIndex = seenInput.indexOf(x);\n\n\t\tif (seenIndex !== -1) {\n\t\t\treturn seenOutput[seenIndex];\n\t\t}\n\n\t\tvar ret = {};\n\t\tvar keys = Object.keys(x).sort(opts.compare);\n\n\t\tseenInput.push(x);\n\t\tseenOutput.push(ret);\n\n\t\tfor (var i = 0; i < keys.length; i++) {\n\t\t\tvar key = keys[i];\n\t\t\tvar val = x[key];\n\n\t\t\tret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;\n\t\t}\n\n\t\treturn ret;\n\t};\n\n\treturn sortKeys(obj);\n};\n","'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n","import * as path from 'path';\n\nimport { BrowserWindow, ipcMain } from 'electron';\n\nimport * as log from '../helpers/loggingHelper';\n\nexport async function createLoginWindow(\n loginCallback: (username?: string, password?: string) => void,\n parent?: BrowserWindow,\n): Promise<BrowserWindow> {\n log.debug('createLoginWindow', { loginCallback, parent });\n\n const loginWindow = new BrowserWindow({\n parent,\n width: 300,\n height: 400,\n frame: false,\n resizable: false,\n webPreferences: {\n nodeIntegration: true, // TODO work around this; insecure\n contextIsolation: false, // https://github.com/electron/electron/issues/28017\n },\n });\n await loginWindow.loadURL(\n `file://${path.join(__dirname, 'static/login.html')}`,\n );\n\n ipcMain.once('login-message', (event, usernameAndPassword: string[]) => {\n log.debug('login-message', { event, username: usernameAndPassword[0] });\n loginCallback(usernameAndPassword[0], usernameAndPassword[1]);\n loginWindow.close();\n });\n return loginWindow;\n}\n","// This helper allows logs to either be printed to the console as they would normally or if\n// the USE_LOG_FILE environment variable is set (such as through our playwright tests), then\n// the logs can be diverted from the command line to a log file, so that they can be displayed\n// later (such as at the end of a playwright test run to help diagnose potential failures).\n// Use this instead of loglevel whenever logging messages inside the app.\n\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport loglevel from 'loglevel';\n\nimport { safeGetEnv } from './playwrightHelpers';\n\nconst USE_LOG_FILE = safeGetEnv('USE_LOG_FILE') === '1';\nconst LOG_FILE_DIR = safeGetEnv('LOG_FILE_DIR') ?? process.cwd();\nconst LOG_FILENAME = path.join(LOG_FILE_DIR, `${new Date().getTime()}.log`);\n\nconst logLevelNames = ['TRACE', 'DEBUG', 'INFO ', 'WARN ', 'ERROR'];\n\nfunction _logger(\n logFunc: (...args: unknown[]) => void,\n level: loglevel.LogLevelNumbers,\n ...args: unknown[]\n): void {\n if (USE_LOG_FILE && loglevel.getLevel() >= level) {\n for (const arg of args) {\n try {\n const lines =\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n JSON.stringify(arg, null, 2)?.split('\\n') ?? `${arg}`.split('\\n');\n for (const line of lines) {\n fs.appendFileSync(\n LOG_FILENAME,\n `${new Date().getTime()} ${logLevelNames[level]} ${line}\\n`,\n );\n }\n } catch {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n fs.appendFileSync(LOG_FILENAME, `${logLevelNames[level]} ${arg}\\n`);\n }\n }\n } else {\n logFunc(...args);\n }\n}\n\nexport function debug(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.debug, loglevel.levels.DEBUG, ...args);\n}\n\nexport function error(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.error, loglevel.levels.ERROR, ...args);\n}\n\nexport function info(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.info, loglevel.levels.INFO, ...args);\n}\n\nexport function log(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.info, loglevel.levels.INFO, ...args);\n}\n\nexport function setLevel(\n level: loglevel.LogLevelDesc,\n persist?: boolean,\n): void {\n loglevel.setLevel(level, persist);\n}\n\nexport function trace(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.trace, loglevel.levels.TRACE, ...args);\n}\n\nexport function warn(...args: unknown[]): void {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n _logger(loglevel.warn, loglevel.levels.WARN, ...args);\n}\n","/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n \"use strict\";\n if (typeof define === 'function' && define.amd) {\n define(definition);\n } else if (typeof module === 'object' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n \"use strict\";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = \"undefined\";\n var isIE = (typeof window !== undefinedType) && (typeof window.navigator !== undefinedType) && (\n /Trident\\/|MSIE /.test(window.navigator.userAgent)\n );\n\n var logMethods = [\n \"trace\",\n \"debug\",\n \"info\",\n \"warn\",\n \"error\"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === 'function') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Trace() doesn't print the message in IE, so for that case we need to wrap it\n function traceForIE() {\n if (console.log) {\n if (console.log.apply) {\n console.log.apply(console, arguments);\n } else {\n // In old IE, native console methods themselves don't have apply().\n Function.prototype.apply.apply(console.log, [console, arguments]);\n }\n }\n if (console.trace) console.trace();\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === 'debug') {\n methodName = 'log';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (methodName === 'trace' && isIE) {\n return traceForIE;\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, 'log');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn't present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n defaultLevel = defaultLevel == null ? \"WARN\" : defaultLevel;\n\n var storageKey = \"loglevel\";\n if (typeof name === \"string\") {\n storageKey += \":\" + name;\n } else if (typeof name === \"symbol\") {\n storageKey = undefined;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || 'silent').toUpperCase();\n\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=\" + levelName + \";\";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType || !storageKey) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + \"=\");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n function clearPersistedLevel() {\n if (typeof window === undefinedType || !storageKey) return;\n\n // Use localStorage if available\n try {\n window.localStorage.removeItem(storageKey);\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + \"=; expires=Thu, 01 Jan 1970 00:00:00 UTC\";\n } catch (ignore) {}\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { \"TRACE\": 0, \"DEBUG\": 1, \"INFO\": 2, \"WARN\": 3,\n \"ERROR\": 4, \"SILENT\": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === \"string\" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === \"number\" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return \"No console available for logging\";\n }\n } else {\n throw \"log.setLevel() called with invalid level: \" + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n defaultLevel = level;\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.resetLevel = function () {\n self.setLevel(defaultLevel, false);\n clearPersistedLevel();\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if ((typeof name !== \"symbol\" && typeof name !== \"string\") || name === \"\") {\n throw new TypeError(\"You must supply a name when creating a logger.\");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n // ES6 default export, for compatibility\n defaultLogger['default'] = defaultLogger;\n\n return defaultLogger;\n}));\n","export const IS_PLAYWRIGHT = safeGetEnv('PLAYWRIGHT_TEST') === '1';\nexport const PLAYWRIGHT_CONFIG = safeGetEnv('PLAYWRIGHT_CONFIG');\n\nexport function safeGetEnv(key: string): string | undefined {\n return key in process.env ? process.env[key] : undefined;\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\n\nimport { ipcMain, BrowserWindow, Event } from 'electron';\nimport windowStateKeeper from 'electron-window-state';\n\nimport { initContextMenu } from './contextMenu';\nimport { createMenu } from './menu';\nimport {\n getAppIcon,\n getCounterValue,\n isOSX,\n nativeTabsSupported,\n} from '../helpers/helpers';\nimport * as log from '../helpers/loggingHelper';\nimport { IS_PLAYWRIGHT } from '../helpers/playwrightHelpers';\nimport { onNewWindow, setupNativefierWindow } from '../helpers/windowEvents';\nimport {\n clearCache,\n createNewTab,\n getDefaultWindowOptions,\n hideWindow,\n} from '../helpers/windowHelpers';\nimport {\n OutputOptions,\n outputOptionsToWindowOptions,\n} from '../../../shared/src/options/model';\n\nexport const APP_ARGS_FILE_PATH = path.join(__dirname, '..', 'nativefier.json');\n\ntype SessionInteractionRequest = {\n id?: string;\n func?: string;\n funcArgs?: unknown[];\n property?: string;\n propertyValue?: unknown;\n};\n\ntype SessionInteractionResult = {\n id?: string;\n value?: unknown | Promise<unknown>;\n error?: Error;\n};\n\n/**\n * @param {{}} nativefierOptions AppArgs from nativefier.json\n * @param {function} setDockBadge\n */\nexport async function createMainWindow(\n nativefierOptions: OutputOptions,\n setDockBadge: (value: number | string, bounce?: boolean) => void,\n): Promise<BrowserWindow> {\n const options = { ...nativefierOptions };\n\n const mainWindowState = windowStateKeeper({\n defaultWidth: options.width || 1280,\n defaultHeight: options.height || 800,\n });\n\n const mainWindow = new BrowserWindow({\n frame: !options.hideWindowFrame,\n width: mainWindowState.width,\n height: mainWindowState.height,\n minWidth: options.minWidth,\n minHeight: options.minHeight,\n maxWidth: options.maxWidth,\n maxHeight: options.maxHeight,\n x: options.x,\n y: options.y,\n autoHideMenuBar: !options.showMenuBar,\n icon: getAppIcon(),\n fullscreen: options.fullScreen,\n // Whether the window should always stay on top of other windows. Default is false.\n alwaysOnTop: options.alwaysOnTop,\n titleBarStyle: options.titleBarStyle ?? 'default',\n // Maximize window visual glitch on Windows fix\n // We want a consistent behavior on all OSes, but Windows needs help to not glitch.\n // So, we manually mainWindow.show() later, see a few lines below\n show: options.tray !== 'start-in-tray' && process.platform !== 'win32',\n backgroundColor: options.backgroundColor,\n ...getDefaultWindowOptions(outputOptionsToWindowOptions(options)),\n });\n\n // Just load about:blank to start, gives playwright something to latch onto initially for testing.\n if (IS_PLAYWRIGHT) {\n await mainWindow.loadURL('about:blank');\n }\n\n mainWindowState.manage(mainWindow);\n\n // after first run, no longer force maximize to be true\n if (options.maximize) {\n mainWindow.maximize();\n options.maximize = undefined;\n saveAppArgs(options);\n }\n\n if (options.tray === 'start-in-tray') {\n mainWindow.hide();\n } else if (process.platform === 'win32') {\n // See other \"Maximize window visual glitch on Windows fix\" comment above.\n mainWindow.show();\n }\n\n const windowOptions = outputOptionsToWindowOptions(options);\n createMenu(options, mainWindow);\n createContextMenu(options, mainWindow);\n setupNativefierWindow(windowOptions, mainWindow);\n\n // .on('new-window', ...) is deprected in favor of setWindowOpenHandler(...)\n // We can't quite cut over to that yet for a few reasons:\n // 1. Our version of Electron does not yet support a parameter to\n // setWindowOpenHandler that contains `disposition', which we need.\n // See https://github.com/electron/electron/issues/28380\n // 2. setWindowOpenHandler doesn't support newGuest as well\n // Though at this point, 'new-window' bugs seem to be coming up and downstream\n // users are being pointed to use setWindowOpenHandler.\n // E.g., https://github.com/electron/electron/issues/28374\n\n // Note it is important to add these handlers only to the *main* window,\n // else we run into weird behavior like opening tabs twice\n mainWindow.webContents.on(\n 'new-window',\n (event, url, frameName, disposition) => {\n onNewWindow(\n windowOptions,\n setupNativefierWindow,\n event,\n url,\n frameName,\n disposition,\n ).catch((err) => log.error('onNewWindow ERROR', err));\n },\n );\n // @ts-expect-error new-tab isn't in the type definition, but it does exist\n mainWindow.on('new-tab', () => {\n createNewTab(\n windowOptions,\n setupNativefierWindow,\n options.targetUrl,\n true,\n mainWindow,\n );\n });\n\n if (options.counter) {\n setupCounter(options, mainWindow, setDockBadge);\n } else {\n setupNotificationBadge(options, mainWindow, setDockBadge);\n }\n\n ipcMain.on('notification-click', () => {\n log.debug('ipcMain.notification-click');\n mainWindow.show();\n });\n\n setupSessionInteraction(options, mainWindow);\n\n if (options.clearCache) {\n await clearCache(mainWindow);\n }\n\n setupCloseEvent(options, mainWindow);\n\n return mainWindow;\n}\n\nfunction createContextMenu(\n options: OutputOptions,\n window: BrowserWindow,\n): void {\n if (!options.disableContextMenu) {\n initContextMenu(options, window);\n }\n}\n\nexport function saveAppArgs(newAppArgs: OutputOptions): void {\n try {\n fs.writeFileSync(APP_ARGS_FILE_PATH, JSON.stringify(newAppArgs, null, 2));\n } catch (err: unknown) {\n log.warn(\n `WARNING: Ignored nativefier.json rewrital (${(err as Error).message})`,\n );\n }\n}\n\nfunction setupCloseEvent(options: OutputOptions, window: BrowserWindow): void {\n window.on('close', (event: Event) => {\n log.debug('mainWindow.close', event);\n if (window.isFullScreen()) {\n if (nativeTabsSupported()) {\n window.moveTabToNewWindow();\n }\n window.setFullScreen(false);\n window.once('leave-full-screen', (event: Event) =>\n hideWindow(\n window,\n event,\n options.fastQuit ?? false,\n options.tray ?? 'false',\n ),\n );\n }\n hideWindow(\n window,\n event,\n options.fastQuit ?? false,\n options.tray ?? 'false',\n );\n\n if (options.clearCache) {\n clearCache(window).catch((err) => log.error('clearCache ERROR', err));\n }\n });\n}\n\nfunction setupCounter(\n options: OutputOptions,\n window: BrowserWindow,\n setDockBadge: (value: number | string, bounce?: boolean) => void,\n): void {\n window.on('page-title-updated', (event, title) => {\n log.debug('mainWindow.page-title-updated', { event, title });\n const counterValue = getCounterValue(title);\n if (counterValue) {\n setDockBadge(counterValue, options.bounce);\n } else {\n setDockBadge('');\n }\n });\n}\n\nfunction setupNotificationBadge(\n options: OutputOptions,\n window: BrowserWindow,\n setDockBadge: (value: number | string, bounce?: boolean) => void,\n): void {\n ipcMain.on('notification', () => {\n log.debug('ipcMain.notification');\n if (!isOSX() || window.isFocused()) {\n return;\n }\n setDockBadge('•', options.bounce);\n });\n window.on('focus', () => {\n log.debug('mainWindow.focus');\n setDockBadge('');\n });\n}\n\nfunction setupSessionInteraction(\n options: OutputOptions,\n window: BrowserWindow,\n): void {\n // See API.md / \"Accessing The Electron Session\"\n ipcMain.on(\n 'session-interaction',\n (event, request: SessionInteractionRequest) => {\n log.debug('ipcMain.session-interaction', { event, request });\n\n const result: SessionInteractionResult = { id: request.id };\n let awaitingPromise = false;\n try {\n if (request.func !== undefined) {\n // If no funcArgs provided, we'll just use an empty array\n if (request.funcArgs === undefined || request.funcArgs === null) {\n request.funcArgs = [];\n }\n\n // If funcArgs isn't an array, we'll be nice and make it a single item array\n if (typeof request.funcArgs[Symbol.iterator] !== 'function') {\n request.funcArgs = [request.funcArgs];\n }\n\n // Call func with funcArgs\n // @ts-expect-error accessing a func by string name\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n result.value = window.webContents.session[request.func](\n ...request.funcArgs,\n );\n\n if (result.value !== undefined && result.value instanceof Promise) {\n // This is a promise. We'll resolve it here otherwise it will blow up trying to serialize it in the reply\n (result.value as Promise<unknown>)\n .then((trueResultValue) => {\n result.value = trueResultValue;\n log.debug('ipcMain.session-interaction:result', result);\n event.reply('session-interaction-reply', result);\n })\n .catch((err) =>\n log.error('session-interaction ERROR', request, err),\n );\n awaitingPromise = true;\n }\n } else if (request.property !== undefined) {\n if (request.propertyValue !== undefined) {\n // Set the property\n // @ts-expect-error setting a property by string name\n window.webContents.session[request.property] =\n request.propertyValue;\n }\n\n // Get the property value\n // @ts-expect-error accessing a property by string name\n result.value = window.webContents.session[request.property];\n } else {\n // Why even send the event if you're going to do this? You're just wasting time! ;)\n throw new Error(\n 'Received neither a func nor a property in the request. Unable to process.',\n );\n }\n\n // If we are awaiting a promise, that will return the reply instead, else\n if (!awaitingPromise) {\n log.debug('session-interaction:result', result);\n event.reply('session-interaction-reply', result);\n }\n } catch (err: unknown) {\n log.error('session-interaction:error', err, event, request);\n result.error = err as Error;\n result.value = undefined; // Clear out the value in case serializing the value is what got us into this mess in the first place\n event.reply('session-interaction-reply', result);\n }\n },\n );\n}\n","'use strict';\n\nconst path = require('path');\nconst electron = require('electron');\nconst jsonfile = require('jsonfile');\nconst mkdirp = require('mkdirp');\n\nmodule.exports = function (options) {\n const app = electron.app || electron.remote.app;\n const screen = electron.screen || electron.remote.screen;\n let state;\n let winRef;\n let stateChangeTimer;\n const eventHandlingDelay = 100;\n const config = Object.assign({\n file: 'window-state.json',\n path: app.getPath('userData'),\n maximize: true,\n fullScreen: true\n }, options);\n const fullStoreFileName = path.join(config.path, config.file);\n\n function isNormal(win) {\n return !win.isMaximized() && !win.isMinimized() && !win.isFullScreen();\n }\n\n function hasBounds() {\n return state &&\n Number.isInteger(state.x) &&\n Number.isInteger(state.y) &&\n Number.isInteger(state.width) && state.width > 0 &&\n Number.isInteger(state.height) && state.height > 0;\n }\n\n function resetStateToDefault() {\n const displayBounds = screen.getPrimaryDisplay().bounds;\n\n // Reset state to default values on the primary display\n state = {\n width: config.defaultWidth || 800,\n height: config.defaultHeight || 600,\n x: 0,\n y: 0,\n displayBounds\n };\n }\n\n function windowWithinBounds(bounds) {\n return (\n state.x >= bounds.x &&\n state.y >= bounds.y &&\n state.x + state.width <= bounds.x + bounds.width &&\n state.y + state.height <= bounds.y + bounds.height\n );\n }\n\n function ensureWindowVisibleOnSomeDisplay() {\n const visible = screen.getAllDisplays().some(display => {\n return windowWithinBounds(display.bounds);\n });\n\n if (!visible) {\n // Window is partially or fully not visible now.\n // Reset it to safe defaults.\n return resetStateToDefault();\n }\n }\n\n function validateState() {\n const isValid = state && (hasBounds() || state.isMaximized || state.isFullScreen);\n if (!isValid) {\n state = null;\n return;\n }\n\n if (hasBounds() && state.displayBounds) {\n ensureWindowVisibleOnSomeDisplay();\n }\n }\n\n function updateState(win) {\n win = win || winRef;\n if (!win) {\n return;\n }\n // Don't throw an error when window was closed\n try {\n const winBounds = win.getBounds();\n if (isNormal(win)) {\n state.x = winBounds.x;\n state.y = winBounds.y;\n state.width = winBounds.width;\n state.height = winBounds.height;\n }\n state.isMaximized = win.isMaximized();\n state.isFullScreen = win.isFullScreen();\n state.displayBounds = screen.getDisplayMatching(winBounds).bounds;\n } catch (err) {}\n }\n\n function saveState(win) {\n // Update window state only if it was provided\n if (win) {\n updateState(win);\n }\n\n // Save state\n try {\n mkdirp.sync(path.dirname(fullStoreFileName));\n jsonfile.writeFileSync(fullStoreFileName, state);\n } catch (err) {\n // Don't care\n }\n }\n\n function stateChangeHandler() {\n // Handles both 'resize' and 'move'\n clearTimeout(stateChangeTimer);\n stateChangeTimer = setTimeout(updateState, eventHandlingDelay);\n }\n\n function closeHandler() {\n updateState();\n }\n\n function closedHandler() {\n // Unregister listeners and save state\n unmanage();\n saveState();\n }\n\n function manage(win) {\n if (config.maximize && state.isMaximized) {\n win.maximize();\n }\n if (config.fullScreen && state.isFullScreen) {\n win.setFullScreen(true);\n }\n win.on('resize', stateChangeHandler);\n win.on('move', stateChangeHandler);\n win.on('close', closeHandler);\n win.on('closed', closedHandler);\n winRef = win;\n }\n\n function unmanage() {\n if (winRef) {\n winRef.removeListener('resize', stateChangeHandler);\n winRef.removeListener('move', stateChangeHandler);\n clearTimeout(stateChangeTimer);\n winRef.removeListener('close', closeHandler);\n winRef.removeListener('closed', closedHandler);\n winRef = null;\n }\n }\n\n // Load previous state\n try {\n state = jsonfile.readFileSync(fullStoreFileName);\n } catch (err) {\n // Don't care\n }\n\n // Check state validity\n validateState();\n\n // Set state fallback values\n state = Object.assign({\n width: config.defaultWidth || 800,\n height: config.defaultHeight || 600\n }, state);\n\n return {\n get x() { return state.x; },\n get y() { return state.y; },\n get width() { return state.width; },\n get height() { return state.height; },\n get displayBounds() { return state.displayBounds; },\n get isMaximized() { return state.isMaximized; },\n get isFullScreen() { return state.isFullScreen; },\n saveState,\n unmanage,\n manage,\n resetStateToDefault\n };\n};\n","var _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\n\nfunction readFile (file, options, callback) {\n if (callback == null) {\n callback = options\n options = {}\n }\n\n if (typeof options === 'string') {\n options = {encoding: options}\n }\n\n options = options || {}\n var fs = options.fs || _fs\n\n var shouldThrow = true\n if ('throws' in options) {\n shouldThrow = options.throws\n }\n\n fs.readFile(file, options, function (err, data) {\n if (err) return callback(err)\n\n data = stripBom(data)\n\n var obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err2) {\n if (shouldThrow) {\n err2.message = file + ': ' + err2.message\n return callback(err2)\n } else {\n return callback(null, null)\n }\n }\n\n callback(null, obj)\n })\n}\n\nfunction readFileSync (file, options) {\n options = options || {}\n if (typeof options === 'string') {\n options = {encoding: options}\n }\n\n var fs = options.fs || _fs\n\n var shouldThrow = true\n if ('throws' in options) {\n shouldThrow = options.throws\n }\n\n try {\n var content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = file + ': ' + err.message\n throw err\n } else {\n return null\n }\n }\n}\n\nfunction stringify (obj, options) {\n var spaces\n var EOL = '\\n'\n if (typeof options === 'object' && options !== null) {\n if (options.spaces) {\n spaces = options.spaces\n }\n if (options.EOL) {\n EOL = options.EOL\n }\n }\n\n var str = JSON.stringify(obj, options ? options.replacer : null, spaces)\n\n return str.replace(/\\n/g, EOL) + EOL\n}\n\nfunction writeFile (file, obj, options, callback) {\n if (callback == null) {\n callback = options\n options = {}\n }\n options = options || {}\n var fs = options.fs || _fs\n\n var str = ''\n try {\n str = stringify(obj, options)\n } catch (err) {\n // Need to return whether a callback was passed or not\n if (callback) callback(err, null)\n return\n }\n\n fs.writeFile(file, str, options, callback)\n}\n\nfunction writeFileSync (file, obj, options) {\n options = options || {}\n var fs = options.fs || _fs\n\n var str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n content = content.replace(/^\\uFEFF/, '')\n return content\n}\n\nvar jsonfile = {\n readFile: readFile,\n readFileSync: readFileSync,\n writeFile: writeFile,\n writeFileSync: writeFileSync\n}\n\nmodule.exports = jsonfile\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n resetQueue()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n resetQueue()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb, startTime) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb, startTime) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb, startTime) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return go$copyFile(src, dest, flags, cb)\n\n function go$copyFile (src, dest, flags, cb, startTime) {\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n var noReaddirOptionVersions = /^v[0-5]\\./\n function readdir (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n var go$readdir = noReaddirOptionVersions.test(process.version)\n ? function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n : function go$readdir (path, options, cb, startTime) {\n return fs$readdir(path, options, fs$readdirCallback(\n path, options, cb, startTime\n ))\n }\n\n return go$readdir(path, options, cb)\n\n function fs$readdirCallback (path, options, cb, startTime) {\n return function (err, files) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([\n go$readdir,\n [path, options, cb],\n err,\n startTime || Date.now(),\n Date.now()\n ])\n else {\n if (files && files.sort)\n files.sort()\n\n if (typeof cb === 'function')\n cb.call(this, err, files)\n }\n }\n }\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb, startTime) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n retry()\n}\n\n// keep track of the timeout between retry() calls\nvar retryTimer\n\n// reset the startTime and lastTime to now\n// this resets the start of the 60 second overall timeout as well as the\n// delay between attempts so that we'll retry these jobs sooner\nfunction resetQueue () {\n var now = Date.now()\n for (var i = 0; i < fs[gracefulQueue].length; ++i) {\n // entries that are only a length of 2 are from an older version, don't\n // bother modifying those since they'll be retried anyway.\n if (fs[gracefulQueue][i].length > 2) {\n fs[gracefulQueue][i][3] = now // startTime\n fs[gracefulQueue][i][4] = now // lastTime\n }\n }\n // call retry to make sure we're actively processing the queue\n retry()\n}\n\nfunction retry () {\n // clear the timer and remove it to help prevent unintended concurrency\n clearTimeout(retryTimer)\n retryTimer = undefined\n\n if (fs[gracefulQueue].length === 0)\n return\n\n var elem = fs[gracefulQueue].shift()\n var fn = elem[0]\n var args = elem[1]\n // these items may be unset if they were added by an older graceful-fs\n var err = elem[2]\n var startTime = elem[3]\n var lastTime = elem[4]\n\n // if we don't have a startTime we have no way of knowing if we've waited\n // long enough, so go ahead and retry this item now\n if (startTime === undefined) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args)\n } else if (Date.now() - startTime >= 60000) {\n // it's been more than 60 seconds total, bail now\n debug('TIMEOUT', fn.name, args)\n var cb = args.pop()\n if (typeof cb === 'function')\n cb.call(null, err)\n } else {\n // the amount of time between the last attempt and right now\n var sinceAttempt = Date.now() - lastTime\n // the amount of time between when we first tried, and when we last tried\n // rounded up to at least 1\n var sinceStart = Math.max(lastTime - startTime, 1)\n // backoff. wait longer than the total time we've been retrying, but only\n // up to a maximum of 100ms\n var desiredDelay = Math.min(sinceStart * 1.2, 100)\n // it's been long enough since the last retry, do it again\n if (sinceAttempt >= desiredDelay) {\n debug('RETRY', fn.name, args)\n fn.apply(null, args.concat([startTime]))\n } else {\n // if we can't do this job yet, push it to the end of the queue\n // and let the next iteration check again\n fs[gracefulQueue].push(elem)\n }\n }\n\n // schedule our next run if one isn't already scheduled\n if (retryTimer === undefined) {\n retryTimer = setTimeout(retry, 0)\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (fs.chmod && !fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (fs.chown && !fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = typeof fs.rename !== 'function' ? fs.rename\n : (function (fs$rename) {\n function rename (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename)\n return rename\n })(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = typeof fs.read !== 'function' ? fs.read\n : (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync\n : (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\") && fs.futimes) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else if (fs.futimes) {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","module.exports = require(\"constants\");","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","module.exports = require(\"stream\");","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","module.exports = require(\"assert\");","var path = require('path');\nvar fs = require('fs');\nvar _0777 = parseInt('0777', 8);\n\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\n\nfunction mkdirP (p, opts, f, made) {\n if (typeof opts === 'function') {\n f = opts;\n opts = {};\n }\n else if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n \n var cb = f || /* istanbul ignore next */ function () {};\n p = path.resolve(p);\n \n xfs.mkdir(p, mode, function (er) {\n if (!er) {\n made = made || p;\n return cb(null, made);\n }\n switch (er.code) {\n case 'ENOENT':\n /* istanbul ignore if */\n if (path.dirname(p) === p) return cb(er);\n mkdirP(path.dirname(p), opts, function (er, made) {\n /* istanbul ignore if */\n if (er) cb(er, made);\n else mkdirP(p, opts, cb, made);\n });\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n xfs.stat(p, function (er2, stat) {\n // if the stat fails, then that's super weird.\n // let the original error be the failure reason.\n if (er2 || !stat.isDirectory()) cb(er, made)\n else cb(null, made);\n });\n break;\n }\n });\n}\n\nmkdirP.sync = function sync (p, opts, made) {\n if (!opts || typeof opts !== 'object') {\n opts = { mode: opts };\n }\n \n var mode = opts.mode;\n var xfs = opts.fs || fs;\n \n if (mode === undefined) {\n mode = _0777\n }\n if (!made) made = null;\n\n p = path.resolve(p);\n\n try {\n xfs.mkdirSync(p, mode);\n made = made || p;\n }\n catch (err0) {\n switch (err0.code) {\n case 'ENOENT' :\n made = sync(path.dirname(p), opts, made);\n sync(p, opts, made);\n break;\n\n // In the case of any other error, just see if there's a dir\n // there already. If so, then hooray! If not, then something\n // is borked.\n default:\n var stat;\n try {\n stat = xfs.statSync(p);\n }\n catch (err1) /* istanbul ignore next */ {\n throw err0;\n }\n /* istanbul ignore if */\n if (!stat.isDirectory()) throw err0;\n break;\n }\n }\n\n return made;\n};\n","import {\n BrowserWindow,\n ContextMenuParams,\n NewWindowWebContentsEvent,\n} from 'electron';\nimport contextMenu from 'electron-context-menu';\n\nimport { nativeTabsSupported, openExternal } from '../helpers/helpers';\nimport * as log from '../helpers/loggingHelper';\nimport { setupNativefierWindow } from '../helpers/windowEvents';\nimport { createNewWindow } from '../helpers/windowHelpers';\nimport {\n OutputOptions,\n outputOptionsToWindowOptions,\n} from '../../../shared/src/options/model';\n\nexport function initContextMenu(\n options: OutputOptions,\n window?: BrowserWindow,\n): void {\n log.debug('initContextMenu');\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n contextMenu({\n prepend: (actions: contextMenu.Actions, params: ContextMenuParams) => {\n log.debug('contextMenu.prepend', { actions, params });\n const items = [];\n if (params.linkURL) {\n items.push({\n label: 'Open Link in Default Browser',\n click: () => {\n openExternal(params.linkURL).catch((err) =>\n log.error('contextMenu Open Link in Default Browser ERROR', err),\n );\n },\n });\n items.push({\n label: 'Open Link in New Window',\n click: () =>\n createNewWindow(\n outputOptionsToWindowOptions(options),\n setupNativefierWindow,\n params.linkURL,\n window,\n ),\n });\n if (nativeTabsSupported()) {\n items.push({\n label: 'Open Link in New Tab',\n click: () =>\n // Fire a new window event for a foreground tab\n // Previously we called createNewTab directly, but it had incosistent and buggy behavior\n // as it was mostly designed for running off of events. So this will create a new event\n // for a foreground-tab for the event handler to grab and take care of instead.\n (window as BrowserWindow).webContents.emit(\n // event name\n 'new-window',\n // event object\n {\n // Leave to the default for a NewWindowWebContentsEvent\n newGuest: undefined,\n ...new Event('new-window'),\n } as NewWindowWebContentsEvent,\n // url\n params.linkURL,\n // frameName\n window?.webContents.mainFrame.name ?? '',\n // disposition\n 'foreground-tab',\n ),\n });\n }\n }\n return items;\n },\n showCopyImage: true,\n showCopyImageAddress: true,\n showSaveImage: true,\n });\n}\n","'use strict';\nconst electron = require('electron');\nconst cliTruncate = require('cli-truncate');\nconst {download} = require('electron-dl');\nconst isDev = require('electron-is-dev');\n\nconst webContents = win => win.webContents || (win.id && win);\n\nconst decorateMenuItem = menuItem => {\n\treturn (options = {}) => {\n\t\tif (options.transform && !options.click) {\n\t\t\tmenuItem.transform = options.transform;\n\t\t}\n\n\t\treturn menuItem;\n\t};\n};\n\nconst removeUnusedMenuItems = menuTemplate => {\n\tlet notDeletedPreviousElement;\n\n\treturn menuTemplate\n\t\t.filter(menuItem => menuItem !== undefined && menuItem !== false && menuItem.visible !== false && menuItem.visible !== '')\n\t\t.filter((menuItem, index, array) => {\n\t\t\tconst toDelete = menuItem.type === 'separator' && (!notDeletedPreviousElement || index === array.length - 1 || array[index + 1].type === 'separator');\n\t\t\tnotDeletedPreviousElement = toDelete ? notDeletedPreviousElement : menuItem;\n\t\t\treturn !toDelete;\n\t\t});\n};\n\nconst create = (win, options) => {\n\tconst handleContextMenu = (event, props) => {\n\t\tif (typeof options.shouldShowMenu === 'function' && options.shouldShowMenu(event, props) === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst {editFlags} = props;\n\t\tconst hasText = props.selectionText.length > 0;\n\t\tconst isLink = Boolean(props.linkURL);\n\t\tconst can = type => editFlags[`can${type}`] && hasText;\n\n\t\tconst defaultActions = {\n\t\t\tseparator: () => ({type: 'separator'}),\n\t\t\tlearnSpelling: decorateMenuItem({\n\t\t\t\tid: 'learnSpelling',\n\t\t\t\tlabel: '&Learn Spelling',\n\t\t\t\tvisible: Boolean(props.isEditable && hasText && props.misspelledWord),\n\t\t\t\tclick() {\n\t\t\t\t\tconst target = webContents(win);\n\t\t\t\t\ttarget.session.addWordToSpellCheckerDictionary(props.misspelledWord);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tlookUpSelection: decorateMenuItem({\n\t\t\t\tid: 'lookUpSelection',\n\t\t\t\tlabel: 'Look Up “{selection}”',\n\t\t\t\tvisible: process.platform === 'darwin' && hasText && !isLink,\n\t\t\t\tclick() {\n\t\t\t\t\tif (process.platform === 'darwin') {\n\t\t\t\t\t\twebContents(win).showDefinitionForSelection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsearchWithGoogle: decorateMenuItem({\n\t\t\t\tid: 'searchWithGoogle',\n\t\t\t\tlabel: '&Search with Google',\n\t\t\t\tvisible: hasText,\n\t\t\t\tclick() {\n\t\t\t\t\tconst url = new URL('https://www.google.com/search');\n\t\t\t\t\turl.searchParams.set('q', props.selectionText);\n\t\t\t\t\telectron.shell.openExternal(url.toString());\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcut: decorateMenuItem({\n\t\t\t\tid: 'cut',\n\t\t\t\tlabel: 'Cu&t',\n\t\t\t\tenabled: can('Cut'),\n\t\t\t\tvisible: props.isEditable,\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tconst target = webContents(win);\n\n\t\t\t\t\tif (!menuItem.transform && target) {\n\t\t\t\t\t\ttarget.cut();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprops.selectionText = menuItem.transform ? menuItem.transform(props.selectionText) : props.selectionText;\n\t\t\t\t\t\telectron.clipboard.writeText(props.selectionText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcopy: decorateMenuItem({\n\t\t\t\tid: 'copy',\n\t\t\t\tlabel: '&Copy',\n\t\t\t\tenabled: can('Copy'),\n\t\t\t\tvisible: props.isEditable || hasText,\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tconst target = webContents(win);\n\n\t\t\t\t\tif (!menuItem.transform && target) {\n\t\t\t\t\t\ttarget.copy();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprops.selectionText = menuItem.transform ? menuItem.transform(props.selectionText) : props.selectionText;\n\t\t\t\t\t\telectron.clipboard.writeText(props.selectionText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tpaste: decorateMenuItem({\n\t\t\t\tid: 'paste',\n\t\t\t\tlabel: '&Paste',\n\t\t\t\tenabled: editFlags.canPaste,\n\t\t\t\tvisible: props.isEditable,\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tconst target = webContents(win);\n\n\t\t\t\t\tif (menuItem.transform) {\n\t\t\t\t\t\tlet clipboardContent = electron.clipboard.readText(props.selectionText);\n\t\t\t\t\t\tclipboardContent = menuItem.transform ? menuItem.transform(clipboardContent) : clipboardContent;\n\t\t\t\t\t\ttarget.insertText(clipboardContent);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.paste();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tselectAll: decorateMenuItem({\n\t\t\t\tid: 'selectAll',\n\t\t\t\tlabel: 'Select &All',\n\t\t\t\tclick() {\n\t\t\t\t\twebContents(win).selectAll();\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsaveImage: decorateMenuItem({\n\t\t\t\tid: 'saveImage',\n\t\t\t\tlabel: 'Save I&mage',\n\t\t\t\tvisible: props.mediaType === 'image',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\t\t\t\t\tdownload(win, props.srcURL);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsaveImageAs: decorateMenuItem({\n\t\t\t\tid: 'saveImageAs',\n\t\t\t\tlabel: 'Sa&ve Image As…',\n\t\t\t\tvisible: props.mediaType === 'image',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\t\t\t\t\tdownload(win, props.srcURL, {saveAs: true});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsaveVideo: decorateMenuItem({\n\t\t\t\tid: 'saveVideo',\n\t\t\t\tlabel: 'Save Vide&o',\n\t\t\t\tvisible: props.mediaType === 'video',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\t\t\t\t\tdownload(win, props.srcURL);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsaveVideoAs: decorateMenuItem({\n\t\t\t\tid: 'saveVideoAs',\n\t\t\t\tlabel: 'Save Video& As…',\n\t\t\t\tvisible: props.mediaType === 'video',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\t\t\t\t\tdownload(win, props.srcURL, {saveAs: true});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcopyLink: decorateMenuItem({\n\t\t\t\tid: 'copyLink',\n\t\t\t\tlabel: 'Copy Lin&k',\n\t\t\t\tvisible: props.linkURL.length > 0 && props.mediaType === 'none',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.linkURL = menuItem.transform ? menuItem.transform(props.linkURL) : props.linkURL;\n\n\t\t\t\t\telectron.clipboard.write({\n\t\t\t\t\t\tbookmark: props.linkText,\n\t\t\t\t\t\ttext: props.linkURL\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tsaveLinkAs: decorateMenuItem({\n\t\t\t\tid: 'saveLinkAs',\n\t\t\t\tlabel: 'Save Link As…',\n\t\t\t\tvisible: props.linkURL.length > 0 && props.mediaType === 'none',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.linkURL = menuItem.transform ? menuItem.transform(props.linkURL) : props.linkURL;\n\t\t\t\t\tdownload(win, props.linkURL, {saveAs: true});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcopyImage: decorateMenuItem({\n\t\t\t\tid: 'copyImage',\n\t\t\t\tlabel: 'Cop&y Image',\n\t\t\t\tvisible: props.mediaType === 'image',\n\t\t\t\tclick() {\n\t\t\t\t\twebContents(win).copyImageAt(props.x, props.y);\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcopyImageAddress: decorateMenuItem({\n\t\t\t\tid: 'copyImageAddress',\n\t\t\t\tlabel: 'C&opy Image Address',\n\t\t\t\tvisible: props.mediaType === 'image',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\n\t\t\t\t\telectron.clipboard.write({\n\t\t\t\t\t\tbookmark: props.srcURL,\n\t\t\t\t\t\ttext: props.srcURL\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcopyVideoAddress: decorateMenuItem({\n\t\t\t\tid: 'copyVideoAddress',\n\t\t\t\tlabel: 'Copy Video Ad&dress',\n\t\t\t\tvisible: props.mediaType === 'video',\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tprops.srcURL = menuItem.transform ? menuItem.transform(props.srcURL) : props.srcURL;\n\n\t\t\t\t\telectron.clipboard.write({\n\t\t\t\t\t\tbookmark: props.srcURL,\n\t\t\t\t\t\ttext: props.srcURL\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}),\n\t\t\tinspect: () => ({\n\t\t\t\tid: 'inspect',\n\t\t\t\tlabel: 'I&nspect Element',\n\t\t\t\tclick() {\n\t\t\t\t\twin.inspectElement(props.x, props.y);\n\n\t\t\t\t\tif (webContents(win).isDevToolsOpened()) {\n\t\t\t\t\t\twebContents(win).devToolsWebContents.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t\tservices: () => ({\n\t\t\t\tid: 'services',\n\t\t\t\tlabel: 'Services',\n\t\t\t\trole: 'services',\n\t\t\t\tvisible: process.platform === 'darwin' && (props.isEditable || hasText)\n\t\t\t})\n\t\t};\n\n\t\tconst shouldShowInspectElement = typeof options.showInspectElement === 'boolean' ? options.showInspectElement : isDev;\n\t\tconst shouldShowSelectAll = options.showSelectAll || (options.showSelectAll !== false && process.platform !== 'darwin');\n\n\t\tfunction word(suggestion) {\n\t\t\treturn {\n\t\t\t\tid: 'dictionarySuggestions',\n\t\t\t\tlabel: suggestion,\n\t\t\t\tvisible: Boolean(props.isEditable && hasText && props.misspelledWord),\n\t\t\t\tclick(menuItem) {\n\t\t\t\t\tconst target = webContents(win);\n\t\t\t\t\ttarget.replaceMisspelling(menuItem.label);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tlet dictionarySuggestions = [];\n\t\tif (hasText && props.misspelledWord && props.dictionarySuggestions.length > 0) {\n\t\t\tdictionarySuggestions = props.dictionarySuggestions.map(suggestion => word(suggestion));\n\t\t} else {\n\t\t\tdictionarySuggestions.push(\n\t\t\t\t{\n\t\t\t\t\tid: 'dictionarySuggestions',\n\t\t\t\t\tlabel: 'No Guesses Found',\n\t\t\t\t\tvisible: Boolean(hasText && props.misspelledWord),\n\t\t\t\t\tenabled: false\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tlet menuTemplate = [\n\t\t\tdictionarySuggestions.length > 0 && defaultActions.separator(),\n\t\t\t...dictionarySuggestions,\n\t\t\tdefaultActions.separator(),\n\t\t\toptions.showLearnSpelling !== false && defaultActions.learnSpelling(),\n\t\t\tdefaultActions.separator(),\n\t\t\toptions.showLookUpSelection !== false && defaultActions.lookUpSelection(),\n\t\t\tdefaultActions.separator(),\n\t\t\toptions.showSearchWithGoogle !== false && defaultActions.searchWithGoogle(),\n\t\t\tdefaultActions.separator(),\n\t\t\tdefaultActions.cut(),\n\t\t\tdefaultActions.copy(),\n\t\t\tdefaultActions.paste(),\n\t\t\tshouldShowSelectAll && defaultActions.selectAll(),\n\t\t\tdefaultActions.separator(),\n\t\t\toptions.showSaveImage && defaultActions.saveImage(),\n\t\t\toptions.showSaveImageAs && defaultActions.saveImageAs(),\n\t\t\toptions.showCopyImage !== false && defaultActions.copyImage(),\n\t\t\toptions.showCopyImageAddress && defaultActions.copyImageAddress(),\n\t\t\toptions.showSaveVideo && defaultActions.saveVideo(),\n\t\t\toptions.showSaveVideoAs && defaultActions.saveVideoAs(),\n\t\t\toptions.showCopyVideoAddress && defaultActions.copyVideoAddress(),\n\t\t\tdefaultActions.separator(),\n\t\t\toptions.showCopyLink !== false && defaultActions.copyLink(),\n\t\t\toptions.showSaveLinkAs && defaultActions.saveLinkAs(),\n\t\t\tdefaultActions.separator(),\n\t\t\tshouldShowInspectElement && defaultActions.inspect(),\n\t\t\toptions.showServices && defaultActions.services(),\n\t\t\tdefaultActions.separator()\n\t\t];\n\n\t\tif (options.menu) {\n\t\t\tmenuTemplate = options.menu(defaultActions, props, win, dictionarySuggestions, event);\n\t\t}\n\n\t\tif (options.prepend) {\n\t\t\tconst result = options.prepend(defaultActions, props, win, event);\n\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tmenuTemplate.unshift(...result);\n\t\t\t}\n\t\t}\n\n\t\tif (options.append) {\n\t\t\tconst result = options.append(defaultActions, props, win, event);\n\n\t\t\tif (Array.isArray(result)) {\n\t\t\t\tmenuTemplate.push(...result);\n\t\t\t}\n\t\t}\n\n\t\t// Filter out leading/trailing separators\n\t\t// TODO: https://github.com/electron/electron/issues/5869\n\t\tmenuTemplate = removeUnusedMenuItems(menuTemplate);\n\n\t\tfor (const menuItem of menuTemplate) {\n\t\t\t// Apply custom labels for default menu items\n\t\t\tif (options.labels && options.labels[menuItem.id]) {\n\t\t\t\tmenuItem.label = options.labels[menuItem.id];\n\t\t\t}\n\n\t\t\t// Replace placeholders in menu item labels\n\t\t\tif (typeof menuItem.label === 'string' && menuItem.label.includes('{selection}')) {\n\t\t\t\tconst selectionString = typeof props.selectionText === 'string' ? props.selectionText.trim() : '';\n\t\t\t\tmenuItem.label = menuItem.label.replace('{selection}', cliTruncate(selectionString, 25).replace(/&/g, '&&'));\n\t\t\t}\n\t\t}\n\n\t\tif (menuTemplate.length > 0) {\n\t\t\tconst menu = electron.Menu.buildFromTemplate(menuTemplate);\n\n\t\t\tif (typeof options.onShow === 'function') {\n\t\t\t\tmenu.on('menu-will-show', options.onShow);\n\t\t\t}\n\n\t\t\tif (typeof options.onClose === 'function') {\n\t\t\t\tmenu.on('menu-will-close', options.onClose);\n\t\t\t}\n\n\t\t\tmenu.popup(win);\n\t\t}\n\t};\n\n\twebContents(win).on('context-menu', handleContextMenu);\n\n\treturn () => {\n\t\tif (win.isDestroyed()) {\n\t\t\treturn;\n\t\t}\n\n\t\twebContents(win).removeListener('context-menu', handleContextMenu);\n\t};\n};\n\nmodule.exports = (options = {}) => {\n\tif (process.type === 'renderer') {\n\t\tthrow new Error('Cannot use electron-context-menu in the renderer process!');\n\t}\n\n\tlet isDisposed = false;\n\tconst disposables = [];\n\n\tconst init = win => {\n\t\tif (isDisposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst disposeMenu = create(win, options);\n\n\t\tdisposables.push(disposeMenu);\n\t\tconst removeDisposable = () => {\n\t\t\tconst index = disposables.indexOf(disposeMenu);\n\t\t\tif (index !== -1) {\n\t\t\t\tdisposables.splice(index, 1);\n\t\t\t}\n\t\t};\n\n\t\tif (typeof win.once !== 'undefined') { // Support for BrowserView\n\t\t\twin.once('closed', removeDisposable);\n\t\t}\n\n\t\tdisposables.push(() => {\n\t\t\twin.off('closed', removeDisposable);\n\t\t});\n\t};\n\n\tconst dispose = () => {\n\t\tfor (const dispose of disposables) {\n\t\t\tdispose();\n\t\t}\n\n\t\tdisposables.length = 0;\n\t\tisDisposed = true;\n\t};\n\n\tif (options.window) {\n\t\tconst win = options.window;\n\n\t\t// When window is a webview that has not yet finished loading webContents is not available\n\t\tif (webContents(win) === undefined) {\n\t\t\tconst onDomReady = () => {\n\t\t\t\tinit(win);\n\t\t\t};\n\n\t\t\tconst listenerFunction = win.addEventListener || win.addListener;\n\t\t\tlistenerFunction('dom-ready', onDomReady, {once: true});\n\n\t\t\tdisposables.push(() => {\n\t\t\t\twin.removeEventListener('dom-ready', onDomReady, {once: true});\n\t\t\t});\n\n\t\t\treturn dispose;\n\t\t}\n\n\t\tinit(win);\n\n\t\treturn dispose;\n\t}\n\n\tfor (const win of electron.BrowserWindow.getAllWindows()) {\n\t\tinit(win);\n\t}\n\n\tconst onWindowCreated = (event, win) => {\n\t\tinit(win);\n\t};\n\n\telectron.app.on('browser-window-created', onWindowCreated);\n\tdisposables.push(() => {\n\t\telectron.app.removeListener('browser-window-created', onWindowCreated);\n\t});\n\n\treturn dispose;\n};\n","'use strict';\nconst sliceAnsi = require('slice-ansi');\nconst stringWidth = require('string-width');\n\nfunction getIndexOfNearestSpace(string, index, shouldSearchRight) {\n\tif (string.charAt(index) === ' ') {\n\t\treturn index;\n\t}\n\n\tfor (let i = 1; i <= 3; i++) {\n\t\tif (shouldSearchRight) {\n\t\t\tif (string.charAt(index + i) === ' ') {\n\t\t\t\treturn index + i;\n\t\t\t}\n\t\t} else if (string.charAt(index - i) === ' ') {\n\t\t\treturn index - i;\n\t\t}\n\t}\n\n\treturn index;\n}\n\nmodule.exports = (text, columns, options) => {\n\toptions = {\n\t\tposition: 'end',\n\t\tpreferTruncationOnSpace: false,\n\t\t...options\n\t};\n\n\tconst {position, space, preferTruncationOnSpace} = options;\n\tlet ellipsis = '…';\n\tlet ellipsisWidth = 1;\n\n\tif (typeof text !== 'string') {\n\t\tthrow new TypeError(`Expected \\`input\\` to be a string, got ${typeof text}`);\n\t}\n\n\tif (typeof columns !== 'number') {\n\t\tthrow new TypeError(`Expected \\`columns\\` to be a number, got ${typeof columns}`);\n\t}\n\n\tif (columns < 1) {\n\t\treturn '';\n\t}\n\n\tif (columns === 1) {\n\t\treturn ellipsis;\n\t}\n\n\tconst length = stringWidth(text);\n\n\tif (length <= columns) {\n\t\treturn text;\n\t}\n\n\tif (position === 'start') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, true);\n\t\t\treturn ellipsis + sliceAnsi(text, nearestSpace, length).trim();\n\t\t}\n\n\t\tif (space === true) {\n\t\t\tellipsis += ' ';\n\t\t\tellipsisWidth = 2;\n\t\t}\n\n\t\treturn ellipsis + sliceAnsi(text, length - columns + ellipsisWidth, length);\n\t}\n\n\tif (position === 'middle') {\n\t\tif (space === true) {\n\t\t\tellipsis = ' ' + ellipsis + ' ';\n\t\t\tellipsisWidth = 3;\n\t\t}\n\n\t\tconst half = Math.floor(columns / 2);\n\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);\n\t\t\tconst spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);\n\t\t\treturn sliceAnsi(text, 0, spaceNearFirstBreakPoint) + ellipsis + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();\n\t\t}\n\n\t\treturn (\n\t\t\tsliceAnsi(text, 0, half) +\n\t\t\tellipsis +\n\t\t\tsliceAnsi(text, length - (columns - half) + ellipsisWidth, length)\n\t\t);\n\t}\n\n\tif (position === 'end') {\n\t\tif (preferTruncationOnSpace) {\n\t\t\tconst nearestSpace = getIndexOfNearestSpace(text, columns - 1);\n\t\t\treturn sliceAnsi(text, 0, nearestSpace) + ellipsis;\n\t\t}\n\n\t\tif (space === true) {\n\t\t\tellipsis = ' ' + ellipsis;\n\t\t\tellipsisWidth = 2;\n\t\t}\n\n\t\treturn sliceAnsi(text, 0, columns - ellipsisWidth) + ellipsis;\n\t}\n\n\tthrow new Error(`Expected \\`options.position\\` to be either \\`start\\`, \\`middle\\` or \\`end\\`, got ${position}`);\n};\n","'use strict';\nconst isFullwidthCodePoint = require('is-fullwidth-code-point');\nconst astralRegex = require('astral-regex');\nconst ansiStyles = require('ansi-styles');\n\nconst ESCAPES = [\n\t'\\u001B',\n\t'\\u009B'\n];\n\nconst wrapAnsi = code => `${ESCAPES[0]}[${code}m`;\n\nconst checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {\n\tlet output = [];\n\tansiCodes = [...ansiCodes];\n\n\tfor (let ansiCode of ansiCodes) {\n\t\tconst ansiCodeOrigin = ansiCode;\n\t\tif (ansiCode.match(';')) {\n\t\t\tansiCode = ansiCode.split(';')[0][0] + '0';\n\t\t}\n\n\t\tconst item = ansiStyles.codes.get(parseInt(ansiCode, 10));\n\t\tif (item) {\n\t\t\tconst indexEscape = ansiCodes.indexOf(item.toString());\n\t\t\tif (indexEscape >= 0) {\n\t\t\t\tansiCodes.splice(indexEscape, 1);\n\t\t\t} else {\n\t\t\t\toutput.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));\n\t\t\t}\n\t\t} else if (isEscapes) {\n\t\t\toutput.push(wrapAnsi(0));\n\t\t\tbreak;\n\t\t} else {\n\t\t\toutput.push(wrapAnsi(ansiCodeOrigin));\n\t\t}\n\t}\n\n\tif (isEscapes) {\n\t\toutput = output.filter((element, index) => output.indexOf(element) === index);\n\t\tif (endAnsiCode !== undefined) {\n\t\t\tconst fistEscapeCode = wrapAnsi(ansiStyles.codes.get(parseInt(endAnsiCode, 10)));\n\t\t\toutput = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);\n\t\t}\n\t}\n\n\treturn output.join('');\n};\n\nmodule.exports = (string, begin, end) => {\n\tconst characters = [...string.normalize()];\n\tconst ansiCodes = [];\n\n\tend = typeof end === 'number' ? end : characters.length;\n\n\tlet isInsideEscape = false;\n\tlet ansiCode;\n\tlet visible = 0;\n\tlet output = '';\n\n\tfor (const [index, character] of characters.entries()) {\n\t\tlet leftEscape = false;\n\n\t\tif (ESCAPES.includes(character)) {\n\t\t\tconst code = /\\d[^m]*/.exec(string.slice(index, index + 18));\n\t\t\tansiCode = code && code.length > 0 ? code[0] : undefined;\n\t\t\tif (visible < end) {\n\t\t\t\tisInsideEscape = true;\n\t\t\t\tif (ansiCode !== undefined) {\n\t\t\t\t\tansiCodes.push(ansiCode);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (isInsideEscape && character === 'm') {\n\t\t\tisInsideEscape = false;\n\t\t\tleftEscape = true;\n\t\t}\n\n\t\tif (!isInsideEscape && !leftEscape) {\n\t\t\t++visible;\n\t\t}\n\n\t\tif (!astralRegex({exact: true}).test(character) && isFullwidthCodePoint(character.codePointAt())) {\n\t\t\t++visible;\n\t\t}\n\n\t\tif (visible > begin && visible <= end) {\n\t\t\toutput += character;\n\t\t} else if (visible === begin && !isInsideEscape && ansiCode !== undefined) {\n\t\t\toutput = checkAnsi(ansiCodes);\n\t\t} else if (visible >= end) {\n\t\t\toutput += checkAnsi(ansiCodes, true, ansiCode);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn output;\n};\n","/* eslint-disable yoda */\n'use strict';\n\nconst isFullwidthCodePoint = codePoint => {\n\tif (Number.isNaN(codePoint)) {\n\t\treturn false;\n\t}\n\n\t// Code points are derived from:\n\t// http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt\n\tif (\n\t\tcodePoint >= 0x1100 && (\n\t\t\tcodePoint <= 0x115F || // Hangul Jamo\n\t\t\tcodePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET\n\t\t\tcodePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET\n\t\t\t// CJK Radicals Supplement .. Enclosed CJK Letters and Months\n\t\t\t(0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||\n\t\t\t// Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A\n\t\t\t(0x3250 <= codePoint && codePoint <= 0x4DBF) ||\n\t\t\t// CJK Unified Ideographs .. Yi Radicals\n\t\t\t(0x4E00 <= codePoint && codePoint <= 0xA4C6) ||\n\t\t\t// Hangul Jamo Extended-A\n\t\t\t(0xA960 <= codePoint && codePoint <= 0xA97C) ||\n\t\t\t// Hangul Syllables\n\t\t\t(0xAC00 <= codePoint && codePoint <= 0xD7A3) ||\n\t\t\t// CJK Compatibility Ideographs\n\t\t\t(0xF900 <= codePoint && codePoint <= 0xFAFF) ||\n\t\t\t// Vertical Forms\n\t\t\t(0xFE10 <= codePoint && codePoint <= 0xFE19) ||\n\t\t\t// CJK Compatibility Forms .. Small Form Variants\n\t\t\t(0xFE30 <= codePoint && codePoint <= 0xFE6B) ||\n\t\t\t// Halfwidth and Fullwidth Forms\n\t\t\t(0xFF01 <= codePoint && codePoint <= 0xFF60) ||\n\t\t\t(0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||\n\t\t\t// Kana Supplement\n\t\t\t(0x1B000 <= codePoint && codePoint <= 0x1B001) ||\n\t\t\t// Enclosed Ideographic Supplement\n\t\t\t(0x1F200 <= codePoint && codePoint <= 0x1F251) ||\n\t\t\t// CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane\n\t\t\t(0x20000 <= codePoint && codePoint <= 0x3FFFD)\n\t\t)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nmodule.exports = isFullwidthCodePoint;\nmodule.exports.default = isFullwidthCodePoint;\n","'use strict';\nconst regex = '[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]';\n\nconst astralRegex = options => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, 'g');\n\nmodule.exports = astralRegex;\n","'use strict';\n\nconst wrapAnsi16 = (fn, offset) => (...args) => {\n\tconst code = fn(...args);\n\treturn `\\u001B[${code + offset}m`;\n};\n\nconst wrapAnsi256 = (fn, offset) => (...args) => {\n\tconst code = fn(...args);\n\treturn `\\u001B[${38 + offset};5;${code}m`;\n};\n\nconst wrapAnsi16m = (fn, offset) => (...args) => {\n\tconst rgb = fn(...args);\n\treturn `\\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;\n};\n\nconst ansi2ansi = n => n;\nconst rgb2rgb = (r, g, b) => [r, g, b];\n\nconst setLazyProperty = (object, property, get) => {\n\tObject.defineProperty(object, property, {\n\t\tget: () => {\n\t\t\tconst value = get();\n\n\t\t\tObject.defineProperty(object, property, {\n\t\t\t\tvalue,\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t});\n\n\t\t\treturn value;\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t});\n};\n\n/** @type {typeof import('color-convert')} */\nlet colorConvert;\nconst makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {\n\tif (colorConvert === undefined) {\n\t\tcolorConvert = require('color-convert');\n\t}\n\n\tconst offset = isBackground ? 10 : 0;\n\tconst styles = {};\n\n\tfor (const [sourceSpace, suite] of Object.entries(colorConvert)) {\n\t\tconst name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;\n\t\tif (sourceSpace === targetSpace) {\n\t\t\tstyles[name] = wrap(identity, offset);\n\t\t} else if (typeof suite === 'object') {\n\t\t\tstyles[name] = wrap(suite[targetSpace], offset);\n\t\t}\n\t}\n\n\treturn styles;\n};\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\tconst styles = {\n\t\tmodifier: {\n\t\t\treset: [0, 0],\n\t\t\t// 21 isn't widely supported and 22 does the same thing\n\t\t\tbold: [1, 22],\n\t\t\tdim: [2, 22],\n\t\t\titalic: [3, 23],\n\t\t\tunderline: [4, 24],\n\t\t\tinverse: [7, 27],\n\t\t\thidden: [8, 28],\n\t\t\tstrikethrough: [9, 29]\n\t\t},\n\t\tcolor: {\n\t\t\tblack: [30, 39],\n\t\t\tred: [31, 39],\n\t\t\tgreen: [32, 39],\n\t\t\tyellow: [33, 39],\n\t\t\tblue: [34, 39],\n\t\t\tmagenta: [35, 39],\n\t\t\tcyan: [36, 39],\n\t\t\twhite: [37, 39],\n\n\t\t\t// Bright color\n\t\t\tblackBright: [90, 39],\n\t\t\tredBright: [91, 39],\n\t\t\tgreenBright: [92, 39],\n\t\t\tyellowBright: [93, 39],\n\t\t\tblueBright: [94, 39],\n\t\t\tmagentaBright: [95, 39],\n\t\t\tcyanBright: [96, 39],\n\t\t\twhiteBright: [97, 39]\n\t\t},\n\t\tbgColor: {\n\t\t\tbgBlack: [40, 49],\n\t\t\tbgRed: [41, 49],\n\t\t\tbgGreen: [42, 49],\n\t\t\tbgYellow: [43, 49],\n\t\t\tbgBlue: [44, 49],\n\t\t\tbgMagenta: [45, 49],\n\t\t\tbgCyan: [46, 49],\n\t\t\tbgWhite: [47, 49],\n\n\t\t\t// Bright color\n\t\t\tbgBlackBright: [100, 49],\n\t\t\tbgRedBright: [101, 49],\n\t\t\tbgGreenBright: [102, 49],\n\t\t\tbgYellowBright: [103, 49],\n\t\t\tbgBlueBright: [104, 49],\n\t\t\tbgMagentaBright: [105, 49],\n\t\t\tbgCyanBright: [106, 49],\n\t\t\tbgWhiteBright: [107, 49]\n\t\t}\n\t};\n\n\t// Alias bright black as gray (and grey)\n\tstyles.color.gray = styles.color.blackBright;\n\tstyles.bgColor.bgGray = styles.bgColor.bgBlackBright;\n\tstyles.color.grey = styles.color.blackBright;\n\tstyles.bgColor.bgGrey = styles.bgColor.bgBlackBright;\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tsetLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));\n\tsetLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));\n\tsetLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));\n\tsetLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));\n\tsetLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));\n\tsetLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));\n\n\treturn styles;\n}\n\n// Make the export immutable\nObject.defineProperty(module, 'exports', {\n\tenumerable: true,\n\tget: assembleStyles\n});\n","const conversions = require('./conversions');\nconst route = require('./route');\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(fromModel => {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\trouteModels.forEach(toModel => {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n","/* MIT license */\n/* eslint-disable no-mixed-operators */\nconst cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\nmodule.exports = convert;\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Infinity;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tlet r = rgb[0] / 255;\n\tlet g = rgb[1] / 255;\n\tlet b = rgb[2] / 255;\n\n\t// Assume sRGB\n\tr = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);\n\n\tconst x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tconst y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tconst z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t2;\n\tlet t3;\n\tlet val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// Assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (~~(args > 50) + 1) * 0.5;\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(char => {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tconst integer = parseInt(colorString, 16);\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet grayscale;\n\tlet hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));\n\n\tlet f = 0;\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1.0 - c);\n\tlet f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1.0 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tconst val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (val << 16) + (val << 8) + val;\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","const conversions = require('./conversions');\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n","'use strict';\nconst stripAnsi = require('strip-ansi');\nconst isFullwidthCodePoint = require('is-fullwidth-code-point');\nconst emojiRegex = require('emoji-regex');\n\nconst stringWidth = string => {\n\tif (typeof string !== 'string' || string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = stripAnsi(string);\n\n\tif (string.length === 0) {\n\t\treturn 0;\n\t}\n\n\tstring = string.replace(emojiRegex(), ' ');\n\n\tlet width = 0;\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\tconst code = string.codePointAt(i);\n\n\t\t// Ignore control characters\n\t\tif (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Ignore combining characters\n\t\tif (code >= 0x300 && code <= 0x36F) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Surrogates\n\t\tif (code > 0xFFFF) {\n\t\t\ti++;\n\t\t}\n\n\t\twidth += isFullwidthCodePoint(code) ? 2 : 1;\n\t}\n\n\treturn width;\n};\n\nmodule.exports = stringWidth;\n// TODO: remove this in the next major version\nmodule.exports.default = stringWidth;\n","'use strict';\nconst ansiRegex = require('ansi-regex');\n\nmodule.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;\n","'use strict';\n\nmodule.exports = ({onlyFirst = false} = {}) => {\n\tconst pattern = [\n\t\t'[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)',\n\t\t'(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-ntqry=><~]))'\n\t].join('|');\n\n\treturn new RegExp(pattern, onlyFirst ? undefined : 'g');\n};\n","\"use strict\";\n\nmodule.exports = function () {\n // https://mths.be/emoji\n return /\\uD83C\\uDFF4\\uDB40\\uDC67\\uDB40\\uDC62(?:\\uDB40\\uDC65\\uDB40\\uDC6E\\uDB40\\uDC67|\\uDB40\\uDC73\\uDB40\\uDC63\\uDB40\\uDC74|\\uDB40\\uDC77\\uDB40\\uDC6C\\uDB40\\uDC73)\\uDB40\\uDC7F|\\uD83D\\uDC68(?:\\uD83C\\uDFFC\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68\\uD83C\\uDFFB|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFE])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFE\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFD\\u200D(?:\\uD83E\\uDD1D\\u200D\\uD83D\\uDC68(?:\\uD83C[\\uDFFB\\uDFFC])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D)?\\uD83D\\uDC68|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D[\\uDC68\\uDC69])\\u200D(?:\\uD83D[\\uDC66\\uDC67])|[\\u2695\\u2696\\u2708]\\uFE0F|\\uD83D[\\uDC66\\uDC67]|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|(?:\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708])\\uFE0F|\\uD83C\\uDFFB\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C[\\uDFFB-\\uDFFF])|(?:\\uD83E\\uDDD1\\uD83C\\uDFFB\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFC\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)\\uD83C\\uDFFB|\\uD83E\\uDDD1(?:\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1(?:\\uD83C[\\uDFFB-\\uDFFF])|\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1)|(?:\\uD83E\\uDDD1\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFF\\u200D\\uD83E\\uDD1D\\u200D(?:\\uD83D[\\uDC68\\uDC69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DCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\u200D(?:\\u2764\\uFE0F\\u200D(?:\\uD83D\\uDC8B\\u200D(?:\\uD83D[\\uDC68\\uDC69])|\\uD83D[\\uDC68\\uDC69])|\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD])|\\uD83C\\uDFFF\\u200D(?:\\uD83C[\\uDF3E\\uDF73\\uDF93\\uDFA4\\uDFA8\\uDFEB\\uDFED]|\\uD83D[\\uDCBB\\uDCBC\\uDD27\\uDD2C\\uDE80\\uDE92]|\\uD83E[\\uDDAF-\\uDDB3\\uDDBC\\uDDBD]))|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67]))|(?:\\uD83E\\uDDD1\\uD83C\\uDFFD\\u200D\\uD83E\\uDD1D\\u200D\\uD83E\\uDDD1|\\uD83D\\uDC69\\uD83C\\uDFFE\\u200D\\uD83E\\uDD1D\\u200D\\uD83D\\uDC69)(?:\\uD83C[\\uDFFB-\\uDFFD])|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC69\\u200D(?:\\uD83D[\\uDC66\\uDC67])|(?:\\uD83D\\uDC41\\uFE0F\\u200D\\uD83D\\uDDE8|\\uD83D\\uDC69(?:\\uD83C\\uDFFF\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFE\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFC\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFB\\u200D[\\u2695\\u2696\\u2708]|\\uD83C\\uDFFD\\u200D[\\u2695\\u2696\\u2708]|\\u200D[\\u2695\\u2696\\u2708])|(?:(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)\\uFE0F|\\uD83D\\uDC6F|\\uD83E[\\uDD3C\\uDDDE\\uDDDF])\\u200D[\\u2640\\u2642]|(?:\\u26F9|\\uD83C[\\uDFCB\\uDFCC]|\\uD83D\\uDD75)(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|(?:\\uD83C[\\uDFC3\\uDFC4\\uDFCA]|\\uD83D[\\uDC6E\\uDC71\\uDC73\\uDC77\\uDC81\\uDC82\\uDC86\\uDC87\\uDE45-\\uDE47\\uDE4B\\uDE4D\\uDE4E\\uDEA3\\uDEB4-\\uDEB6]|\\uD83E[\\uDD26\\uDD37-\\uDD39\\uDD3D\\uDD3E\\uDDB8\\uDDB9\\uDDCD-\\uDDCF\\uDDD6-\\uDDDD])(?:(?:\\uD83C[\\uDFFB-\\uDFFF])\\u200D[\\u2640\\u2642]|\\u200D[\\u2640\\u2642])|\\uD83C\\uDFF4\\u200D\\u2620)\\uFE0F|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67\\u200D(?:\\uD83D[\\uDC66\\uDC67])|\\uD83C\\uDFF3\\uFE0F\\u200D\\uD83C\\uDF08|\\uD83D\\uDC15\\u200D\\uD83E\\uDDBA|\\uD83D\\uDC69\\u200D\\uD83D\\uDC66|\\uD83D\\uDC69\\u200D\\uD83D\\uDC67|\\uD83C\\uDDFD\\uD83C\\uDDF0|\\uD83C\\uDDF4\\uD83C\\uDDF2|\\uD83C\\uDDF6\\uD83C\\uDDE6|[#\\*0-9]\\uFE0F\\u20E3|\\uD83C\\uDDE7(?:\\uD83C[\\uDDE6\\uDDE7\\uDDE9-\\uDDEF\\uDDF1-\\uDDF4\\uDDF6-\\uDDF9\\uDDFB\\uDDFC\\uDDFE\\uDDFF])|\\uD83C\\uD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B-\\uDFFF])|(?:[\\u261D\\u270A-\\u270D]|\\uD83C[\\uDF85\\uDFC2\\uDFC7]|\\uD83D[\\uDC42\\uDC43\\uDC46-\\uDC50\\uDC66\\uDC67\\uDC6B-\\uDC6D\\uDC70\\uDC72\\uDC74-\\uDC76\\uDC78\\uDC7C\\uDC83\\uDC85\\uDCAA\\uDD74\\uDD7A\\uDD90\\uDD95\\uDD96\\uDE4C\\uDE4F\\uDEC0\\uDECC]|\\uD83E[\\uDD0F\\uDD18-\\uDD1C\\uDD1E\\uDD1F\\uDD30-\\uDD36\\uDDB5\\uDDB6\\uDDBB\\uDDD2-\\uDDD5])(?:\\uD83C[\\uDFFB-\\uDFFF])|(?:[\\u231A\\u231B\\u23E9-\\u23EC\\u23F0\\u23F3\\u25FD\\u25FE\\u2614\\u2615\\u2648-\\u2653\\u267F\\u2693\\u26A1\\u26AA\\u26AB\\u26BD\\u26BE\\u26C4\\u26C5\\u26CE\\u26D4\\u26EA\\u26F2\\u26F3\\u26F5\\u26FA\\u26FD\\u2705\\u270A\\u270B\\u2728\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2795-\\u2797\\u27B0\\u27BF\\u2B1B\\u2B1C\\u2B50\\u2B55]|\\uD83C[\\uDC04\\uDCCF\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE1A\\uDE2F\\uDE32-\\uDE36\\uDE38-\\uDE3A\\uDE50\\uDE51\\uDF00-\\uDF20\\uDF2D-\\uDF35\\uDF37-\\uDF7C\\uDF7E-\\uDF93\\uDFA0-\\uDFCA\\uDFCF-\\uDFD3\\uDFE0-\\uDFF0\\uDFF4\\uDFF8-\\uDFFF]|\\uD83D[\\uDC00-\\uDC3E\\uDC40\\uDC42-\\uDCFC\\uDCFF-\\uDD3D\\uDD4B-\\uDD4E\\uDD50-\\uDD67\\uDD7A\\uDD95\\uDD96\\uDDA4\\uDDFB-\\uDE4F\\uDE80-\\uDEC5\\uDECC\\uDED0-\\uDED2\\uDED5\\uDEEB\\uDEEC\\uDEF4-\\uDEFA\\uDFE0-\\uDFEB]|\\uD83E[\\uDD0D-\\uDD3A\\uDD3C-\\uDD45\\uDD47-\\uDD71\\uDD73-\\uDD76\\uDD7A-\\uDDA2\\uDDA5-\\uDDAA\\uDDAE-\\uDDCA\\uDDCD-\\uDDFF\\uDE70-\\uDE73\\uDE78-\\uDE7A\\uDE80-\\uDE82\\uDE90-\\uDE95])|(?:[#\\*0-9\\xA9\\xAE\\u203C\\u2049\\u2122\\u2139\\u2194-\\u2199\\u21A9\\u21AA\\u231A\\u231B\\u2328\\u23CF\\u23E9-\\u23F3\\u23F8-\\u23FA\\u24C2\\u25AA\\u25AB\\u25B6\\u25C0\\u25FB-\\u25FE\\u2600-\\u2604\\u260E\\u2611\\u2614\\u2615\\u2618\\u261D\\u2620\\u2622\\u2623\\u2626\\u262A\\u262E\\u262F\\u2638-\\u263A\\u2640\\u2642\\u2648-\\u2653\\u265F\\u2660\\u2663\\u2665\\u2666\\u2668\\u267B\\u267E\\u267F\\u2692-\\u2697\\u2699\\u269B\\u269C\\u26A0\\u26A1\\u26AA\\u26AB\\u26B0\\u26B1\\u26BD\\u26BE\\u26C4\\u26C5\\u26C8\\u26CE\\u26CF\\u26D1\\u26D3\\u26D4\\u26E9\\u26EA\\u26F0-\\u26F5\\u26F7-\\u26FA\\u26FD\\u2702\\u2705\\u2708-\\u270D\\u270F\\u2712\\u2714\\u2716\\u271D\\u2721\\u2728\\u2733\\u2734\\u2744\\u2747\\u274C\\u274E\\u2753-\\u2755\\u2757\\u2763\\u2764\\u2795-\\u2797\\u27A1\\u27B0\\u27BF\\u2934\\u2935\\u2B05-\\u2B07\\u2B1B\\u2B1C\\u2B50\\u2B55\\u3030\\u303D\\u3297\\u3299]|\\uD83C[\\uDC04\\uDCCF\\uDD70\\uDD71\\uDD7E\\uDD7F\\uDD8E\\uDD91-\\uDD9A\\uDDE6-\\uDDFF\\uDE01\\uDE02\\uDE1A\\uDE2F\\u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uDDB5\\uDDB6\\uDDB8\\uDDB9\\uDDBB\\uDDCD-\\uDDCF\\uDDD1-\\uDDDD])/g;\n};\n","'use strict';\nconst electron = require('electron');\n\nif (typeof electron === 'string') {\n\tthrow new TypeError('Not running in an Electron environment!');\n}\n\nconst isEnvSet = 'ELECTRON_IS_DEV' in process.env;\nconst getFromEnv = Number.parseInt(process.env.ELECTRON_IS_DEV, 10) === 1;\n\nmodule.exports = isEnvSet ? getFromEnv : !electron.app.isPackaged;\n","import * as fs from 'fs';\nimport * as os from 'os';\nimport * as path from 'path';\n\nimport { BrowserWindow, OpenExternalOptions, shell } from 'electron';\n\nimport * as log from '../helpers/loggingHelper';\nimport { showNavigationBlockedMessage } from './windowHelpers';\n\nexport const INJECT_DIR = path.join(__dirname, '..', 'inject');\n\n/**\n * Firefox's list of protocols for which opening an external handler is allowed without confirmation.\n * Taken from Firefox's. Location might vary in codebase, search for one of them, e.g.\n * https://searchfox.org/mozilla-central/search?q=%22xmpp%22&path=&case=false&regexp=false\n */\nconst URL_PROTOCOLS_NOCONFIRMATION_FIREFOX = [\n 'bitcoin:',\n 'ftp:',\n 'ftps:',\n 'geo:',\n 'im:',\n 'irc:',\n 'ircs:',\n 'magnet:',\n 'mailto:',\n 'matrix:',\n 'mms:',\n 'news:',\n 'nntp:',\n 'openpgp4fpr:',\n 'sftp:',\n 'sip:',\n 'sms:',\n 'smsto:',\n 'ssh:',\n 'tel:',\n 'urn:',\n 'webcal:',\n 'wtai:',\n 'xmpp:',\n];\n/**\n * Our extension to Firefox's list. If extending this list too much, we should\n * really add a confirmation modal (for now we just block), like browsers do.\n * But for now, since nobody shouts at us for bluntly blocking anything else,\n * let's keep rolling with it.\n */\nconst URL_PROTOCOLS_NOCONFIRMATION_EXTRA = ['zoommtg:'];\n/**\n * List of protocols for which opening an external handler is allowed without confirmation.\n * Note: \"without confirmation\" is currently a lie. It was implemented this way\n * as a way to know from user feedback what protocols would cause users to shout,\n * but there wasn't much shouting happening, so we currently don't have a confirmation\n * mechanism, we just bluntly block. That might need to change at some point.\n */\nconst URL_PROTOCOLS_NOCONFIRMATION = [\n 'http:',\n 'https:',\n ...URL_PROTOCOLS_NOCONFIRMATION_FIREFOX,\n ...URL_PROTOCOLS_NOCONFIRMATION_EXTRA,\n];\nconst SHELL_SAFETY_FEEDBACK_STR =\n 'If you believe this URL should open, you might be right, and our validation might be excessive.' +\n 'Please share this error & URL at https://github.com/nativefier/nativefier/issues/1459';\n\nexport function isUrlShellSafe(\n urlToGo: string,\n): { blocked: false } | { blocked: true; reason: string } {\n let url: URL;\n try {\n url = new URL(urlToGo.toLowerCase());\n } catch (err: unknown) {\n return {\n blocked: true,\n reason: `URL appears malformed. ${SHELL_SAFETY_FEEDBACK_STR}`,\n };\n }\n\n if (!URL_PROTOCOLS_NOCONFIRMATION.includes(url.protocol)) {\n return {\n blocked: true,\n reason: `URL protocol is disallowed. ${SHELL_SAFETY_FEEDBACK_STR}`,\n };\n }\n\n // https://cwe.mitre.org/data/definitions/177.html\n if (\n urlToGo.includes('%00') ||\n urlToGo.includes('%0a') ||\n urlToGo.includes('%2e') ||\n urlToGo.includes('%2f') ||\n urlToGo.includes('%5c')\n ) {\n return {\n blocked: true,\n reason: `URL might be malicious. ${SHELL_SAFETY_FEEDBACK_STR}`,\n };\n }\n\n return { blocked: false };\n}\n\n/**\n * Helper to print debug messages from the main process in the browser window\n */\nexport function debugLog(browserWindow: BrowserWindow, message: string): void {\n // Need a delay, as it takes time for the preloaded js to be loaded by the window\n setTimeout(() => {\n browserWindow.webContents.send('debug', message);\n }, 3000);\n log.debug(message);\n}\n\n/**\n * Helper to determine domain-ish equality for many cases, the trivial ones\n * and the trickier ones, e.g. `blog.foo.com` and `shop.foo.com`,\n * in a way that is \"good enough\", and doesn't need a list of SLDs.\n * See chat at https://github.com/nativefier/nativefier/pull/1171#pullrequestreview-649132523\n */\nfunction domainify(url: string): string {\n // So here's what we're doing here:\n // Get the hostname from the url\n const hostname = new URL(url).hostname;\n // Drop the first section if the domain\n const domain = hostname.split('.').slice(1).join('.');\n // Check the length, if it's too short, the hostname was probably the domain\n // Or if the domain doesn't have a . in it we went too far\n if (domain.length < 6 || domain.split('.').length === 0) {\n return hostname;\n }\n // This SHOULD be the domain, but nothing is 100% guaranteed\n return domain;\n}\n\nexport function getAppIcon(): string | undefined {\n // Prefer ICO under Windows, see\n // https://www.electronjs.org/docs/api/browser-window#new-browserwindowoptions\n // https://www.electronjs.org/docs/api/native-image#supported-formats\n if (isWindows()) {\n const ico = path.join(__dirname, '..', 'icon.ico');\n if (fs.existsSync(ico)) {\n return ico;\n }\n }\n const png = path.join(__dirname, '..', 'icon.png');\n if (fs.existsSync(png)) {\n return png;\n }\n}\n\nexport function getCounterValue(title: string): string | undefined {\n const itemCountRegex = /[([{]([\\d.,:]*)\\+?[}\\])]/;\n const match = itemCountRegex.exec(title);\n return match ? match[1] : undefined;\n}\n\nexport function getCSSToInject(): string {\n let cssToInject = '';\n const cssFiles = fs\n .readdirSync(INJECT_DIR, { withFileTypes: true })\n .filter(\n (injectFile) => injectFile.isFile() && injectFile.name.endsWith('.css'),\n )\n .map((cssFileStat) =>\n path.resolve(path.join(INJECT_DIR, cssFileStat.name)),\n );\n for (const cssFile of cssFiles) {\n log.debug('Injecting CSS file', cssFile);\n const cssFileData = fs.readFileSync(cssFile);\n cssToInject += `/* ${cssFile} */\\n\\n ${cssFileData.toString()}\\n\\n`;\n }\n return cssToInject;\n}\n\nexport function isOSX(): boolean {\n return os.platform() === 'darwin';\n}\n\nexport function isLinux(): boolean {\n return os.platform() === 'linux';\n}\n\nexport function isWindows(): boolean {\n return os.platform() === 'win32';\n}\n\nfunction isInternalLoginPage(url: string): boolean {\n // Making changes? Remember to update the tests in helpers.test.ts and in API.md\n const internalLoginPagesArray = [\n 'amazon\\\\.[a-zA-Z\\\\.]*/[a-zA-Z\\\\/]*signin', // Amazon\n `facebook\\\\.[a-zA-Z\\\\.]*\\\\/login`, // Facebook\n 'github\\\\.[a-zA-Z\\\\.]*\\\\/(?:login|session)', // GitHub\n 'accounts\\\\.google\\\\.[a-zA-Z\\\\.]*', // Google\n 'mail\\\\.google\\\\.[a-zA-Z\\\\.]*\\\\/accounts/SetOSID', // Google\n 'linkedin\\\\.[a-zA-Z\\\\.]*/uas/login', // LinkedIn\n 'login\\\\.live\\\\.[a-zA-Z\\\\.]*', // Microsoft\n 'login\\\\.microsoftonline\\\\.[a-zA-Z\\\\.]*', // Microsoft\n 'okta\\\\.[a-zA-Z\\\\.]*', // Okta\n 'twitter\\\\.[a-zA-Z\\\\.]*/oauth/authenticate', // Twitter\n 'appleid\\\\.apple\\\\.com/auth/authorize', // Apple\n '(?:id|auth)\\\\.atlassian\\\\.[a-zA-Z]+', // Atlassian\n '.*\\\\.workspaceair\\\\.com', // VMWare Workspace One SSO\n '.*\\\\.securid\\\\.com', // SecurID for VMWare Workspace One SSO\n ];\n // Making changes? Remember to update the tests in helpers.test.ts and in API.md\n const regex = RegExp(internalLoginPagesArray.join('|'));\n return regex.test(url);\n}\n\nexport function linkIsInternal(\n currentUrl: string,\n newUrl: string,\n internalUrlRegex: string | RegExp | undefined,\n isStrictInternalUrlsEnabled: boolean | undefined,\n): boolean {\n log.debug('linkIsInternal', { currentUrl, newUrl, internalUrlRegex });\n if (newUrl.split('#')[0] === 'about:blank') {\n return true;\n }\n\n if (isInternalLoginPage(newUrl)) {\n return true;\n }\n\n if (internalUrlRegex) {\n const regex = RegExp(internalUrlRegex);\n if (regex.test(newUrl)) {\n return true;\n }\n }\n\n if (isStrictInternalUrlsEnabled) {\n return currentUrl == newUrl;\n }\n\n try {\n // Consider as \"same domain-ish\", without TLD/SLD list:\n // 1. app.foo.com and foo.com\n // 2. www.foo.com and foo.com\n // 3. www.foo.com and app.foo.com\n\n // Only use the tld and the main domain for domain-ish test\n // Enables domain-ish equality for blog.foo.com and shop.foo.com\n return domainify(currentUrl) === domainify(newUrl);\n } catch (err: unknown) {\n log.error(\n 'Failed to parse domains as determining if link is internal. From:',\n currentUrl,\n 'To:',\n newUrl,\n err,\n );\n return false;\n }\n}\n\nexport function nativeTabsSupported(): boolean {\n return isOSX();\n}\n\n/**\n * Open the given external protocol URL in the desktop's default manner\n * (e.g. `mailto:` URLs in the user's default mail agent), with extra validation.\n */\nexport function openExternal(\n url: string,\n options?: OpenExternalOptions,\n): Promise<void> {\n const urlShellSafety = isUrlShellSafe(url);\n log.debug('openExternal', { url, options, urlShellSafety });\n if (urlShellSafety.blocked) {\n return new Promise((resolve) => {\n showNavigationBlockedMessage(\n `Navigation blocked to ${url}\\n\\n${urlShellSafety.reason}`,\n )\n .then(() => resolve())\n .catch((err: unknown) => {\n throw err;\n });\n });\n }\n\n return shell.openExternal(url, options);\n}\n\nexport function removeUserAgentSpecifics(\n userAgentFallback: string,\n appName: string,\n appVersion: string,\n): string {\n // Electron userAgentFallback is the user agent used if none is specified when creating a window.\n // For our purposes, it's useful because its format is similar enough to a real Chrome's user agent to not need\n // to infer the userAgent. userAgentFallback normally looks like this:\n // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) app-nativefier-804458/1.0.0 Chrome/89.0.4389.128 Electron/12.0.7 Safari/537.36\n // We just need to strip out the appName/1.0.0 and Electron/electronVersion\n return userAgentFallback\n .replace(`Electron/${process.versions.electron} `, '')\n .replace(`${appName}/${appVersion} `, '');\n}\n\n/** Removes extra spaces from a text */\nexport function cleanupPlainText(text: string): string {\n return text.trim().replace(/\\s+/g, ' ');\n}\n","module.exports = require(\"os\");","import path from 'path';\n\nimport {\n dialog,\n BrowserWindow,\n BrowserWindowConstructorOptions,\n Event,\n MessageBoxReturnValue,\n WebPreferences,\n OnResponseStartedListenerDetails,\n} from 'electron';\n\nimport { getCSSToInject, isOSX, nativeTabsSupported } from './helpers';\nimport * as log from './loggingHelper';\nimport { TrayValue, WindowOptions } from '../../../shared/src/options/model';\n\nconst ZOOM_INTERVAL = 0.1;\n\nexport function adjustWindowZoom(adjustment: number): void {\n withFocusedWindow((focusedWindow: BrowserWindow) => {\n focusedWindow.webContents.zoomFactor =\n focusedWindow.webContents.zoomFactor + adjustment;\n });\n}\n\nexport function showNavigationBlockedMessage(\n message: string,\n): Promise<MessageBoxReturnValue> {\n return new Promise((resolve, reject) => {\n withFocusedWindow((focusedWindow) => {\n dialog\n .showMessageBox(focusedWindow, {\n message,\n type: 'error',\n title: 'Navigation blocked',\n })\n .then((result) => resolve(result))\n .catch((err) => {\n reject(err);\n });\n });\n });\n}\n\nexport async function clearAppData(window: BrowserWindow): Promise<void> {\n const response = await dialog.showMessageBox(window, {\n type: 'warning',\n buttons: ['Yes', 'Cancel'],\n defaultId: 1,\n title: 'Clear cache confirmation',\n message:\n 'This will clear all data (cookies, local storage etc) from this app. Are you sure you wish to proceed?',\n });\n\n if (response.response !== 0) {\n return;\n }\n await clearCache(window);\n}\n\nexport async function clearCache(window: BrowserWindow): Promise<void> {\n const { session } = window.webContents;\n await session.clearStorageData();\n await session.clearCache();\n}\n\nexport function createAboutBlankWindow(\n options: WindowOptions,\n setupWindow: (options: WindowOptions, window: BrowserWindow) => void,\n parent?: BrowserWindow,\n): BrowserWindow {\n const window = createNewWindow(\n { ...options, show: false },\n setupWindow,\n 'about:blank',\n parent,\n );\n window.webContents.once('did-stop-loading', () => {\n if (window.webContents.getURL() === 'about:blank') {\n window.close();\n } else {\n window.show();\n }\n });\n return window;\n}\n\nexport function createNewTab(\n options: WindowOptions,\n setupWindow: (options: WindowOptions, window: BrowserWindow) => void,\n url: string,\n foreground: boolean,\n parent?: BrowserWindow,\n): BrowserWindow | undefined {\n log.debug('createNewTab', { url, foreground, parent });\n return withFocusedWindow((focusedWindow) => {\n const newTab = createNewWindow(options, setupWindow, url, parent);\n focusedWindow.addTabbedWindow(newTab);\n if (!foreground) {\n focusedWindow.focus();\n }\n return newTab;\n });\n}\n\nexport function createNewWindow(\n options: WindowOptions,\n setupWindow: (options: WindowOptions, window: BrowserWindow) => void,\n url: string,\n parent?: BrowserWindow,\n): BrowserWindow {\n log.debug('createNewWindow', { url, parent });\n const window = new BrowserWindow({\n parent,\n ...getDefaultWindowOptions(options),\n });\n setupWindow(options, window);\n window.loadURL(url).catch((err) => log.error('window.loadURL ERROR', err));\n return window;\n}\n\nexport function getCurrentURL(): string {\n return withFocusedWindow((focusedWindow) =>\n focusedWindow.webContents.getURL(),\n ) as unknown as string;\n}\n\nexport function getDefaultWindowOptions(\n options: WindowOptions,\n): BrowserWindowConstructorOptions {\n const browserwindowOptions: BrowserWindowConstructorOptions = {\n ...options.browserwindowOptions,\n };\n // We're going to remove this and merge it separately into DEFAULT_WINDOW_OPTIONS.webPreferences\n // Otherwise the browserwindowOptions.webPreferences object will completely replace the\n // webPreferences specified in the DEFAULT_WINDOW_OPTIONS with itself\n delete browserwindowOptions.webPreferences;\n\n const webPreferences: WebPreferences = {\n ...(options.browserwindowOptions?.webPreferences ?? {}),\n };\n\n const defaultOptions: BrowserWindowConstructorOptions = {\n fullscreenable: true,\n tabbingIdentifier: nativeTabsSupported() ? options.name : undefined,\n title: options.name,\n webPreferences: {\n javascript: true,\n nodeIntegration: false, // `true` is *insecure*, and cause trouble with messenger.com\n preload: path.join(__dirname, 'preload.js'),\n plugins: true,\n webSecurity: !options.insecure,\n zoomFactor: options.zoom,\n // `contextIsolation` was switched to true in Electron 12, which:\n // 1. Breaks access to global variables in `--inject`-ed scripts:\n // https://github.com/nativefier/nativefier/issues/1269\n // 2. Might break notifications under Windows, although this was refuted:\n // https://github.com/nativefier/nativefier/issues/1292\n // So, it was flipped to false in https://github.com/nativefier/nativefier/pull/1308\n //\n // If attempting to set it back to `true` (for security),\n // do test exhaustively these two areas, and more.\n contextIsolation: false,\n ...webPreferences,\n },\n ...browserwindowOptions,\n };\n\n log.debug('getDefaultWindowOptions', {\n options,\n webPreferences,\n defaultOptions,\n });\n\n return defaultOptions;\n}\n\nexport function goBack(): void {\n log.debug('onGoBack');\n withFocusedWindow((focusedWindow) => {\n focusedWindow.webContents.goBack();\n });\n}\n\nexport function goForward(): void {\n log.debug('onGoForward');\n withFocusedWindow((focusedWindow) => {\n focusedWindow.webContents.goForward();\n });\n}\n\nexport function goToURL(url: string): Promise<void> | undefined {\n return withFocusedWindow((focusedWindow) => focusedWindow.loadURL(url));\n}\n\nexport function hideWindow(\n window: BrowserWindow,\n event: Event,\n fastQuit: boolean,\n tray: TrayValue,\n): void {\n if (isOSX() && !fastQuit) {\n // this is called when exiting from clicking the cross button on the window\n event.preventDefault();\n window.hide();\n } else if (!fastQuit && tray !== 'false') {\n event.preventDefault();\n window.hide();\n }\n // will close the window on other platforms\n}\n\nexport function injectCSS(browserWindow: BrowserWindow): void {\n const cssToInject = getCSSToInject();\n\n if (!cssToInject) {\n return;\n }\n\n browserWindow.webContents.on('did-navigate', () => {\n log.debug(\n 'browserWindow.webContents.did-navigate',\n browserWindow.webContents.getURL(),\n );\n\n browserWindow.webContents\n .insertCSS(cssToInject)\n .catch((err: unknown) =>\n log.error('browserWindow.webContents.insertCSS', err),\n );\n\n // We must inject css early enough; so onResponseStarted is a good place.\n browserWindow.webContents.session.webRequest.onResponseStarted(\n { urls: [] }, // Pass an empty filter list; null will not match _any_ urls\n (details: OnResponseStartedListenerDetails): void => {\n log.debug('onResponseStarted', {\n resourceType: details.resourceType,\n url: details.url,\n });\n injectCSSIntoResponse(details, cssToInject).catch((err: unknown) => {\n log.error('injectCSSIntoResponse ERROR', err);\n });\n },\n );\n });\n}\n\nfunction injectCSSIntoResponse(\n details: OnResponseStartedListenerDetails,\n cssToInject: string,\n): Promise<string | undefined> {\n const contentType =\n details.responseHeaders && 'content-type' in details.responseHeaders\n ? details.responseHeaders['content-type'][0]\n : undefined;\n\n log.debug('injectCSSIntoResponse', { details, cssToInject, contentType });\n\n // We go with a denylist rather than a whitelist (e.g. only text/html)\n // to avoid \"whoops I didn't think this should have been CSS-injected\" cases\n const nonInjectableContentTypes = [\n /application\\/.*/,\n /font\\/.*/,\n /image\\/.*/,\n ];\n const nonInjectableResourceTypes = ['image', 'script', 'stylesheet', 'xhr'];\n\n if (\n (contentType &&\n nonInjectableContentTypes.filter((x) => {\n const matches = x.exec(contentType);\n return matches && matches?.length > 0;\n })?.length > 0) ||\n nonInjectableResourceTypes.includes(details.resourceType) ||\n !details.webContents\n ) {\n log.debug(\n `Skipping CSS injection for:\\n${details.url}\\nwith resourceType ${\n details.resourceType\n } and content-type ${contentType as string}`,\n );\n return Promise.resolve(undefined);\n }\n\n log.debug(\n `Injecting CSS for:\\n${details.url}\\nwith resourceType ${\n details.resourceType\n } and content-type ${contentType as string}`,\n );\n return details.webContents.insertCSS(cssToInject);\n}\n\nexport function sendParamsOnDidFinishLoad(\n options: WindowOptions,\n window: BrowserWindow,\n): void {\n window.webContents.on('did-finish-load', () => {\n log.debug(\n 'sendParamsOnDidFinishLoad.window.webContents.did-finish-load',\n window.webContents.getURL(),\n );\n // In children windows too: Restore pinch-to-zoom, disabled by default in recent Electron.\n // See https://github.com/nativefier/nativefier/issues/379#issuecomment-598612128\n // and https://github.com/electron/electron/pull/12679\n window.webContents\n .setVisualZoomLevelLimits(1, 3)\n .catch((err) => log.error('webContents.setVisualZoomLevelLimits', err));\n\n window.webContents.send('params', JSON.stringify(options));\n });\n}\n\nexport function setProxyRules(\n window: BrowserWindow,\n proxyRules?: string,\n): void {\n window.webContents.session\n .setProxy({\n proxyRules,\n pacScript: '',\n proxyBypassRules: '',\n })\n .catch((err) => log.error('session.setProxy ERROR', err));\n}\n\nexport function withFocusedWindow<T>(\n block: (window: BrowserWindow) => T,\n): T | undefined {\n const focusedWindow = BrowserWindow.getFocusedWindow();\n if (focusedWindow) {\n return block(focusedWindow);\n }\n\n return undefined;\n}\n\nexport function zoomOut(): void {\n log.debug('zoomOut');\n adjustWindowZoom(-ZOOM_INTERVAL);\n}\n\nexport function zoomReset(options: { zoom?: number }): void {\n log.debug('zoomReset');\n withFocusedWindow((focusedWindow) => {\n focusedWindow.webContents.zoomFactor = options.zoom ?? 1.0;\n });\n}\n\nexport function zoomIn(): void {\n log.debug('zoomIn');\n adjustWindowZoom(ZOOM_INTERVAL);\n}\n","import {\n dialog,\n BrowserWindow,\n Event,\n NewWindowWebContentsEvent,\n WebContents,\n} from 'electron';\n\nimport { linkIsInternal, nativeTabsSupported, openExternal } from './helpers';\nimport * as log from './loggingHelper';\nimport {\n createAboutBlankWindow,\n createNewTab,\n injectCSS,\n sendParamsOnDidFinishLoad,\n setProxyRules,\n showNavigationBlockedMessage,\n} from './windowHelpers';\nimport { WindowOptions } from '../../../shared/src/options/model';\n\nexport function onNewWindow(\n options: WindowOptions,\n setupWindow: (options: WindowOptions, window: BrowserWindow) => void,\n event: NewWindowWebContentsEvent,\n urlToGo: string,\n frameName: string,\n disposition:\n | 'default'\n | 'foreground-tab'\n | 'background-tab'\n | 'new-window'\n | 'save-to-disk'\n | 'other',\n parent?: BrowserWindow,\n): Promise<void> {\n log.debug('onNewWindow', {\n event,\n urlToGo,\n frameName,\n disposition,\n parent,\n });\n const preventDefault = (newGuest?: BrowserWindow): void => {\n log.debug('onNewWindow.preventDefault', { newGuest, event });\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (newGuest) {\n event.newGuest = newGuest;\n }\n };\n return onNewWindowHelper(\n options,\n setupWindow,\n urlToGo,\n disposition,\n preventDefault,\n parent,\n );\n}\n\nexport function onNewWindowHelper(\n options: WindowOptions,\n setupWindow: (options: WindowOptions, window: BrowserWindow) => void,\n urlToGo: string,\n disposition: string | undefined,\n preventDefault: (newGuest?: BrowserWindow) => void,\n parent?: BrowserWindow,\n): Promise<void> {\n log.debug('onNewWindowHelper', {\n options,\n urlToGo,\n disposition,\n preventDefault,\n parent,\n });\n try {\n if (\n !linkIsInternal(\n options.targetUrl,\n urlToGo,\n options.internalUrls,\n options.strictInternalUrls,\n )\n ) {\n preventDefault();\n if (options.blockExternalUrls) {\n return new Promise((resolve) => {\n showNavigationBlockedMessage(\n `Navigation to external URL blocked by options: ${urlToGo}`,\n )\n .then(() => resolve())\n .catch((err: unknown) => {\n throw err;\n });\n });\n } else {\n return openExternal(urlToGo);\n }\n }\n // Normally the following would be:\n // if (urlToGo.startsWith('about:blank'))...\n // But due to a bug we resolved in https://github.com/nativefier/nativefier/issues/1197\n // Some sites use about:blank#something to use as placeholder windows to fill\n // with content via JavaScript. So we'll stay specific for now...\n else if (['about:blank', 'about:blank#blocked'].includes(urlToGo)) {\n return Promise.resolve(\n preventDefault(createAboutBlankWindow(options, setupWindow, parent)),\n );\n } else if (nativeTabsSupported()) {\n return Promise.resolve(\n preventDefault(\n createNewTab(\n options,\n setupWindow,\n urlToGo,\n disposition === 'foreground-tab',\n parent,\n ),\n ),\n );\n }\n return Promise.resolve(undefined);\n } catch (err: unknown) {\n return Promise.reject(err);\n }\n}\n\nexport function onWillNavigate(\n options: WindowOptions,\n event: Event,\n urlToGo: string,\n): Promise<void> {\n log.debug('onWillNavigate', urlToGo);\n if (\n !linkIsInternal(\n options.targetUrl,\n urlToGo,\n options.internalUrls,\n options.strictInternalUrls,\n )\n ) {\n event.preventDefault();\n if (options.blockExternalUrls) {\n return new Promise((resolve) => {\n showNavigationBlockedMessage(\n `Navigation to external URL blocked by options: ${urlToGo}`,\n )\n .then(() => resolve())\n .catch((err: unknown) => {\n throw err;\n });\n });\n } else {\n return openExternal(urlToGo);\n }\n }\n return Promise.resolve(undefined);\n}\n\nexport function onWillPreventUnload(\n event: Event & { sender?: WebContents },\n): void {\n log.debug('onWillPreventUnload', event);\n\n const webContents = event.sender;\n if (!webContents) {\n return;\n }\n\n const browserWindow =\n BrowserWindow.fromWebContents(webContents) ??\n BrowserWindow.getFocusedWindow();\n if (browserWindow) {\n const choice = dialog.showMessageBoxSync(browserWindow, {\n type: 'question',\n buttons: ['Proceed', 'Stay'],\n message:\n 'You may have unsaved changes, are you sure you want to proceed?',\n title: 'Changes you made may not be saved.',\n defaultId: 0,\n cancelId: 1,\n });\n if (choice === 0) {\n event.preventDefault();\n }\n }\n}\n\nexport function setupNativefierWindow(\n options: WindowOptions,\n window: BrowserWindow,\n): void {\n if (options.proxyRules) {\n setProxyRules(window, options.proxyRules);\n }\n\n injectCSS(window);\n\n window.webContents.on('will-navigate', (event: Event, url: string) => {\n onWillNavigate(options, event, url).catch((err) => {\n log.error('window.webContents.on.will-navigate ERROR', err);\n event.preventDefault();\n });\n });\n window.webContents.on('will-prevent-unload', onWillPreventUnload);\n\n sendParamsOnDidFinishLoad(options, window);\n}\n","import { CreateOptions } from 'asar';\nimport * as electronPackager from 'electron-packager';\n\nexport type TitleBarValue =\n | 'default'\n | 'hidden'\n | 'hiddenInset'\n | 'customButtonsOnHover';\nexport type TrayValue = 'true' | 'false' | 'start-in-tray';\n\nexport interface ElectronPackagerOptions extends electronPackager.Options {\n arch: string;\n portable: boolean;\n platform?: string;\n targetUrl: string;\n upgrade: boolean;\n upgradeFrom?: string;\n}\n\nexport interface AppOptions {\n packager: ElectronPackagerOptions;\n nativefier: {\n accessibilityPrompt: boolean;\n alwaysOnTop: boolean;\n backgroundColor?: string;\n basicAuthPassword?: string;\n basicAuthUsername?: string;\n blockExternalUrls: boolean;\n bookmarksMenu?: string;\n bounce: boolean;\n browserwindowOptions?: BrowserWindowOptions;\n clearCache: boolean;\n counter: boolean;\n crashReporter?: string;\n disableContextMenu: boolean;\n disableDevTools: boolean;\n disableGpu: boolean;\n disableOldBuildWarning: boolean;\n diskCacheSize?: number;\n electronVersionUsed?: string;\n enableEs3Apis: boolean;\n fastQuit: boolean;\n fileDownloadOptions?: Record<string, unknown>;\n flashPluginDir?: string;\n fullScreen: boolean;\n globalShortcuts?: GlobalShortcut[];\n hideWindowFrame: boolean;\n ignoreCertificate: boolean;\n ignoreGpuBlacklist: boolean;\n inject?: string[];\n insecure: boolean;\n internalUrls?: string;\n lang?: string;\n maximize: boolean;\n nativefierVersion: string;\n processEnvs?: string;\n proxyRules?: string;\n quiet?: boolean;\n showMenuBar: boolean;\n singleInstance: boolean;\n strictInternalUrls: boolean;\n titleBarStyle?: TitleBarValue;\n tray: TrayValue;\n userAgent?: string;\n userAgentHonest: boolean;\n verbose: boolean;\n versionString?: string;\n width?: number;\n widevine: boolean;\n height?: number;\n minWidth?: number;\n minHeight?: number;\n maxWidth?: number;\n maxHeight?: number;\n x?: number;\n y?: number;\n zoom: number;\n };\n}\n\nexport type BrowserWindowOptions = Record<string, unknown> & {\n webPreferences?: Record<string, unknown>;\n};\n\nexport type GlobalShortcut = {\n key: string;\n inputEvents: {\n type:\n | 'mouseDown'\n | 'mouseUp'\n | 'mouseEnter'\n | 'mouseLeave'\n | 'contextMenu'\n | 'mouseWheel'\n | 'mouseMove'\n | 'keyDown'\n | 'keyUp'\n | 'char';\n keyCode: string;\n }[];\n};\n\nexport type NativefierOptions = Partial<\n AppOptions['packager'] & AppOptions['nativefier']\n>;\n\nexport type OutputOptions = NativefierOptions & {\n blockExternalUrls: boolean;\n browserwindowOptions?: BrowserWindowOptions;\n buildDate: number;\n companyName?: string;\n disableDevTools: boolean;\n fileDownloadOptions?: Record<string, unknown>;\n internalUrls: string | RegExp | undefined;\n isUpgrade: boolean;\n name: string;\n nativefierVersion: string;\n oldBuildWarningText: string;\n strictInternalUrls: boolean;\n targetUrl: string;\n userAgent?: string;\n zoom?: number;\n};\n\nexport type PackageJSON = {\n name: string;\n};\n\nexport type RawOptions = {\n accessibilityPrompt?: boolean;\n alwaysOnTop?: boolean;\n appCopyright?: string;\n appVersion?: string;\n arch?: string;\n asar?: boolean | CreateOptions;\n backgroundColor?: string;\n basicAuthPassword?: string;\n basicAuthUsername?: string;\n blockExternalUrls?: boolean;\n bookmarksMenu?: string;\n bounce?: boolean;\n browserwindowOptions?: BrowserWindowOptions;\n buildVersion?: string;\n clearCache?: boolean;\n conceal?: boolean;\n counter?: boolean;\n crashReporter?: string;\n darwinDarkModeSupport?: boolean;\n disableContextMenu?: boolean;\n disableDevTools?: boolean;\n disableGpu?: boolean;\n disableOldBuildWarning?: boolean;\n disableOldBuildWarningYesiknowitisinsecure?: boolean;\n diskCacheSize?: number;\n electronVersion?: string;\n electronVersionUsed?: string;\n enableEs3Apis?: boolean;\n fastQuit?: boolean;\n fileDownloadOptions?: Record<string, unknown>;\n flashPath?: string;\n flashPluginDir?: string;\n fullScreen?: boolean;\n globalShortcuts?: string | GlobalShortcut[];\n height?: number;\n hideWindowFrame?: boolean;\n icon?: string;\n ignoreCertificate?: boolean;\n ignoreGpuBlacklist?: boolean;\n inject?: string[];\n insecure?: boolean;\n internalUrls?: string;\n lang?: string;\n maxHeight?: number;\n maximize?: boolean;\n maxWidth?: number;\n minHeight?: number;\n minWidth?: number;\n name?: string;\n nativefierVersion?: string;\n out?: string;\n overwrite?: boolean;\n platform?: string;\n portable?: boolean;\n processEnvs?: string;\n proxyRules?: string;\n quiet?: boolean;\n showMenuBar?: boolean;\n singleInstance?: boolean;\n strictInternalUrls?: boolean;\n targetUrl?: string;\n titleBarStyle?: TitleBarValue;\n tray?: TrayValue;\n upgrade?: string | boolean;\n upgradeFrom?: string;\n userAgent?: string;\n userAgentHonest?: boolean;\n verbose?: boolean;\n versionString?: string;\n widevine?: boolean;\n width?: number;\n win32metadata?: electronPackager.Win32MetadataOptions;\n x?: number;\n y?: number;\n zoom?: number;\n};\n\nexport type WindowOptions = {\n blockExternalUrls: boolean;\n browserwindowOptions?: BrowserWindowOptions;\n insecure: boolean;\n internalUrls?: string | RegExp;\n strictInternalUrls?: boolean;\n name: string;\n proxyRules?: string;\n show?: boolean;\n targetUrl: string;\n userAgent?: string;\n zoom: number;\n};\n\nexport function outputOptionsToWindowOptions(\n options: OutputOptions,\n): WindowOptions {\n return {\n ...options,\n insecure: options.insecure ?? false,\n zoom: options.zoom ?? 1.0,\n };\n}\n","import * as fs from 'fs';\nimport path from 'path';\n\nimport {\n BrowserWindow,\n clipboard,\n Menu,\n MenuItem,\n MenuItemConstructorOptions,\n} from 'electron';\n\nimport { cleanupPlainText, isOSX, openExternal } from '../helpers/helpers';\nimport * as log from '../helpers/loggingHelper';\nimport {\n clearAppData,\n getCurrentURL,\n goBack,\n goForward,\n goToURL,\n zoomIn,\n zoomOut,\n zoomReset,\n} from '../helpers/windowHelpers';\nimport { OutputOptions } from '../../../shared/src/options/model';\n\ntype BookmarksLink = {\n type: 'link';\n title: string;\n url: string;\n shortcut?: string;\n};\n\ntype BookmarksSeparator = {\n type: 'separator';\n};\n\ntype BookmarkConfig = BookmarksLink | BookmarksSeparator;\n\ntype BookmarksMenuConfig = {\n menuLabel: string;\n bookmarks: BookmarkConfig[];\n};\n\nexport function createMenu(\n options: OutputOptions,\n mainWindow: BrowserWindow,\n): void {\n log.debug('createMenu', { options });\n const menuTemplate = generateMenu(options, mainWindow);\n\n injectBookmarks(menuTemplate);\n\n const menu = Menu.buildFromTemplate(menuTemplate);\n Menu.setApplicationMenu(menu);\n}\n\nexport function generateMenu(\n options: {\n disableDevTools: boolean;\n nativefierVersion: string;\n zoom?: number;\n },\n mainWindow: BrowserWindow,\n): MenuItemConstructorOptions[] {\n const { nativefierVersion, zoom, disableDevTools } = options;\n const zoomResetLabel =\n !zoom || zoom === 1.0\n ? 'Reset Zoom'\n : `Reset Zoom (to ${(zoom * 100).toFixed(1)}%, set at build time)`;\n\n const editMenu: MenuItemConstructorOptions = {\n label: '&Edit',\n submenu: [\n {\n label: 'Undo',\n accelerator: 'CmdOrCtrl+Z',\n role: 'undo',\n },\n {\n label: 'Redo',\n accelerator: 'Shift+CmdOrCtrl+Z',\n role: 'redo',\n },\n {\n type: 'separator',\n },\n {\n label: 'Cut',\n accelerator: 'CmdOrCtrl+X',\n role: 'cut',\n },\n {\n label: 'Copy',\n accelerator: 'CmdOrCtrl+C',\n role: 'copy',\n },\n {\n label: 'Copy as Plain Text',\n accelerator: 'CmdOrCtrl+Shift+C',\n click: (): void => {\n // We use clipboard.readText to strip down formatting\n const text = clipboard.readText('selection');\n clipboard.writeText(cleanupPlainText(text), 'clipboard');\n },\n },\n {\n label: 'Copy Current URL',\n accelerator: 'CmdOrCtrl+L',\n click: (): void => clipboard.writeText(getCurrentURL()),\n },\n {\n label: 'Paste',\n accelerator: 'CmdOrCtrl+V',\n role: 'paste',\n },\n {\n label: 'Paste and Match Style',\n // https://github.com/nativefier/nativefier/issues/404\n // Apple's HIG lists this shortcut for paste and match style\n // https://support.apple.com/en-us/HT209651\n accelerator: isOSX() ? 'Option+Shift+Cmd+V' : 'Ctrl+Shift+V',\n role: 'pasteAndMatchStyle',\n },\n {\n label: 'Select All',\n accelerator: 'CmdOrCtrl+A',\n role: 'selectAll',\n },\n {\n label: 'Clear App Data',\n click: (\n item: MenuItem,\n focusedWindow: BrowserWindow | undefined,\n ): void => {\n log.debug('Clear App Data.click', {\n item,\n focusedWindow,\n mainWindow,\n });\n if (!focusedWindow) {\n focusedWindow = mainWindow;\n }\n clearAppData(focusedWindow).catch((err) =>\n log.error('clearAppData ERROR', err),\n );\n },\n },\n ],\n };\n\n const viewMenu: MenuItemConstructorOptions = {\n label: '&View',\n submenu: [\n {\n label: 'Back',\n accelerator: isOSX() ? 'Cmd+Left' : 'Alt+Left',\n click: goBack,\n },\n {\n label: 'BackAdditionalShortcut',\n visible: false,\n acceleratorWorksWhenHidden: true,\n accelerator: 'CmdOrCtrl+[', // What old versions of Nativefier used, kept for backwards compat\n click: goBack,\n },\n {\n label: 'Forward',\n accelerator: isOSX() ? 'Cmd+Right' : 'Alt+Right',\n click: goForward,\n },\n {\n label: 'ForwardAdditionalShortcut',\n visible: false,\n acceleratorWorksWhenHidden: true,\n accelerator: 'CmdOrCtrl+]', // What old versions of Nativefier used, kept for backwards compat\n click: goForward,\n },\n {\n label: 'Reload',\n role: 'reload',\n },\n {\n type: 'separator',\n },\n {\n label: 'Toggle Full Screen',\n accelerator: isOSX() ? 'Ctrl+Cmd+F' : 'F11',\n enabled: mainWindow.isFullScreenable() || isOSX(),\n visible: mainWindow.isFullScreenable() || isOSX(),\n click: (\n item: MenuItem,\n focusedWindow: BrowserWindow | undefined,\n ): void => {\n log.debug('Toggle Full Screen.click()', {\n item,\n focusedWindow,\n isFullScreen: focusedWindow?.isFullScreen(),\n isFullScreenable: focusedWindow?.isFullScreenable(),\n });\n if (!focusedWindow) {\n focusedWindow = mainWindow;\n }\n if (focusedWindow.isFullScreenable()) {\n focusedWindow.setFullScreen(!focusedWindow.isFullScreen());\n } else if (isOSX()) {\n focusedWindow.setSimpleFullScreen(\n !focusedWindow.isSimpleFullScreen(),\n );\n }\n },\n },\n {\n label: 'Zoom In',\n accelerator: 'CmdOrCtrl+=',\n click: zoomIn,\n },\n {\n label: 'ZoomInAdditionalShortcut',\n visible: false,\n acceleratorWorksWhenHidden: true,\n accelerator: 'CmdOrCtrl+numadd',\n click: zoomIn,\n },\n {\n label: 'Zoom Out',\n accelerator: 'CmdOrCtrl+-',\n click: zoomOut,\n },\n {\n label: 'ZoomOutAdditionalShortcut',\n visible: false,\n acceleratorWorksWhenHidden: true,\n accelerator: 'CmdOrCtrl+numsub',\n click: zoomOut,\n },\n {\n label: zoomResetLabel,\n accelerator: 'CmdOrCtrl+0',\n click: (): void => zoomReset(options),\n },\n {\n label: 'ZoomResetAdditionalShortcut',\n visible: false,\n acceleratorWorksWhenHidden: true,\n accelerator: 'CmdOrCtrl+num0',\n click: (): void => zoomReset(options),\n },\n ],\n };\n\n if (!disableDevTools) {\n (viewMenu.submenu as MenuItemConstructorOptions[]).push(\n {\n type: 'separator',\n },\n {\n label: 'Toggle Developer Tools',\n accelerator: isOSX() ? 'Alt+Cmd+I' : 'Ctrl+Shift+I',\n click: (item: MenuItem, focusedWindow: BrowserWindow | undefined) => {\n log.debug('Toggle Developer Tools.click()', { item, focusedWindow });\n if (!focusedWindow) {\n focusedWindow = mainWindow;\n }\n focusedWindow.webContents.toggleDevTools();\n },\n },\n );\n }\n\n const windowMenu: MenuItemConstructorOptions = {\n label: '&Window',\n role: 'window',\n submenu: [\n {\n label: 'Minimize',\n accelerator: 'CmdOrCtrl+M',\n role: 'minimize',\n },\n {\n label: 'Close',\n accelerator: 'CmdOrCtrl+W',\n role: 'close',\n },\n ],\n };\n\n const helpMenu: MenuItemConstructorOptions = {\n label: '&Help',\n role: 'help',\n submenu: [\n {\n label: `Built with Nativefier v${nativefierVersion}`,\n click: (): void => {\n openExternal('https://github.com/nativefier/nativefier').catch(\n (err: unknown): void =>\n log.error(\n 'Built with Nativefier v${nativefierVersion}.click ERROR',\n err,\n ),\n );\n },\n },\n {\n label: 'Report an Issue',\n click: (): void => {\n openExternal('https://github.com/nativefier/nativefier/issues').catch(\n (err: unknown): void =>\n log.error('Report an Issue.click ERROR', err),\n );\n },\n },\n ],\n };\n\n let menuTemplate: MenuItemConstructorOptions[];\n\n if (isOSX()) {\n const electronMenu: MenuItemConstructorOptions = {\n label: 'E&lectron',\n submenu: [\n {\n label: 'Services',\n role: 'services',\n submenu: [],\n },\n {\n type: 'separator',\n },\n {\n label: 'Hide App',\n accelerator: 'Cmd+H',\n role: 'hide',\n },\n {\n label: 'Hide Others',\n accelerator: 'Cmd+Shift+H',\n role: 'hideOthers',\n },\n {\n label: 'Show All',\n role: 'unhide',\n },\n {\n type: 'separator',\n },\n {\n label: 'Quit',\n accelerator: 'Cmd+Q',\n role: 'quit',\n },\n ],\n };\n (windowMenu.submenu as MenuItemConstructorOptions[]).push(\n {\n type: 'separator',\n },\n {\n label: 'Bring All to Front',\n role: 'front',\n },\n );\n menuTemplate = [electronMenu, editMenu, viewMenu, windowMenu, helpMenu];\n } else {\n menuTemplate = [editMenu, viewMenu, windowMenu, helpMenu];\n }\n\n return menuTemplate;\n}\n\nfunction injectBookmarks(menuTemplate: MenuItemConstructorOptions[]): void {\n const bookmarkConfigPath = path.join(__dirname, '..', 'bookmarks.json');\n\n if (!fs.existsSync(bookmarkConfigPath)) {\n return;\n }\n\n try {\n const bookmarksMenuConfig = JSON.parse(\n fs.readFileSync(bookmarkConfigPath, 'utf-8'),\n ) as BookmarksMenuConfig;\n const submenu: MenuItemConstructorOptions[] =\n bookmarksMenuConfig.bookmarks.map((bookmark) => {\n switch (bookmark.type) {\n case 'link':\n if (!('title' in bookmark && 'url' in bookmark)) {\n throw new Error(\n 'All links in the bookmarks menu must have a title and url.',\n );\n }\n try {\n new URL(bookmark.url);\n } catch {\n throw new Error('Bookmark URL \"' + bookmark.url + '\"is invalid.');\n }\n return {\n label: bookmark.title,\n click: (): void => {\n goToURL(bookmark.url)?.catch((err: unknown): void =>\n log.error(`${bookmark.title}.click ERROR`, err),\n );\n },\n accelerator:\n 'shortcut' in bookmark ? bookmark.shortcut : undefined,\n };\n case 'separator':\n return {\n type: 'separator',\n };\n default:\n throw new Error(\n 'A bookmarks menu entry has an invalid type; type must be one of \"link\", \"separator\".',\n );\n }\n });\n const bookmarksMenu: MenuItemConstructorOptions = {\n label: bookmarksMenuConfig.menuLabel,\n submenu,\n };\n // Insert custom bookmarks menu between menus \"View\" and \"Window\"\n menuTemplate.splice(menuTemplate.length - 2, 0, bookmarksMenu);\n } catch (err: unknown) {\n log.error('Failed to load & parse bookmarks configuration JSON file.', err);\n }\n}\n","import { app, Tray, Menu, ipcMain, nativeImage, BrowserWindow } from 'electron';\n\nimport { getAppIcon, getCounterValue, isOSX } from '../helpers/helpers';\nimport * as log from '../helpers/loggingHelper';\nimport { OutputOptions } from '../../../shared/src/options/model';\n\nexport function createTrayIcon(\n nativefierOptions: OutputOptions,\n mainWindow: BrowserWindow,\n): Tray | undefined {\n const options = { ...nativefierOptions };\n\n if (options.tray && options.tray !== 'false') {\n const iconPath = getAppIcon();\n if (!iconPath) {\n throw new Error('Icon path not found found to use with tray option.');\n }\n const nimage = nativeImage.createFromPath(iconPath);\n const appIcon = new Tray(nativeImage.createEmpty());\n\n if (isOSX()) {\n //sets the icon to the height of the tray.\n appIcon.setImage(\n nimage.resize({ height: appIcon.getBounds().height - 2 }),\n );\n } else {\n appIcon.setImage(nimage);\n }\n\n const onClick = (): void => {\n log.debug('onClick');\n if (mainWindow.isVisible()) {\n mainWindow.hide();\n } else {\n mainWindow.show();\n }\n };\n\n const contextMenu = Menu.buildFromTemplate([\n {\n label: options.name,\n click: onClick,\n },\n {\n label: 'Quit',\n click: (): void => app.exit(0),\n },\n ]);\n\n appIcon.on('click', onClick);\n\n if (options.counter) {\n mainWindow.on('page-title-updated', (event, title) => {\n log.debug('mainWindow.page-title-updated', { event, title });\n const counterValue = getCounterValue(title);\n if (counterValue) {\n appIcon.setToolTip(\n `(${counterValue}) ${options.name ?? 'Nativefier'}`,\n );\n } else {\n appIcon.setToolTip(options.name ?? '');\n }\n });\n } else {\n ipcMain.on('notification', () => {\n log.debug('ipcMain.notification');\n if (mainWindow.isFocused()) {\n return;\n }\n if (options.name) {\n appIcon.setToolTip(`• ${options.name}`);\n }\n });\n\n mainWindow.on('focus', () => {\n log.debug('mainWindow.focus');\n appIcon.setToolTip(options.name ?? '');\n });\n }\n\n appIcon.setToolTip(options.name ?? '');\n appIcon.setContextMenu(contextMenu);\n\n return appIcon;\n }\n\n return undefined;\n}\n","import * as fs from 'fs';\nimport * as path from 'path';\n\nimport { isOSX, isWindows, isLinux } from './helpers';\nimport * as log from './loggingHelper';\n\ntype fsError = Error & { code: string };\n\n/**\n * Find a file or directory\n */\nfunction findSync(\n pattern: RegExp,\n basePath: string,\n limitSearchToDirectories = false,\n): string[] {\n const matches: string[] = [];\n\n (function findSyncRecurse(base): void {\n let children: string[];\n try {\n children = fs.readdirSync(base);\n } catch (err: unknown) {\n if ((err as fsError).code === 'ENOENT') {\n return;\n }\n throw err;\n }\n\n for (const child of children) {\n const childPath = path.join(base, child);\n const childIsDirectory = fs.lstatSync(childPath).isDirectory();\n const patternMatches = pattern.test(childPath);\n\n if (!patternMatches) {\n if (!childIsDirectory) {\n return;\n }\n findSyncRecurse(childPath);\n return;\n }\n\n if (!limitSearchToDirectories) {\n matches.push(childPath);\n return;\n }\n\n if (childIsDirectory) {\n matches.push(childPath);\n }\n }\n })(basePath);\n return matches;\n}\n\nfunction findFlashOnLinux(): string {\n return findSync(/libpepflashplayer\\.so/, '/opt/google/chrome')[0];\n}\n\nfunction findFlashOnWindows(): string {\n return findSync(\n /pepflashplayer\\.dll/,\n 'C:\\\\Program Files (x86)\\\\Google\\\\Chrome',\n )[0];\n}\n\nfunction findFlashOnMac(): string {\n return findSync(\n /PepperFlashPlayer.plugin/,\n '/Applications/Google Chrome.app/',\n true,\n )[0];\n}\n\nexport function inferFlashPath(): string | undefined {\n if (isOSX()) {\n return findFlashOnMac();\n }\n\n if (isWindows()) {\n return findFlashOnWindows();\n }\n\n if (isLinux()) {\n return findFlashOnLinux();\n }\n\n log.warn('Unable to determine OS to infer flash player');\n return undefined;\n}\n","var path = require('path');\nvar spawn = require('child_process').spawn;\nvar debug = require('debug')('electron-squirrel-startup');\nvar app = require('electron').app;\n\nvar run = function(args, done) {\n var updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');\n debug('Spawning `%s` with args `%s`', updateExe, args);\n spawn(updateExe, args, {\n detached: true\n }).on('close', done);\n};\n\nvar check = function() {\n if (process.platform === 'win32') {\n var cmd = process.argv[1];\n debug('processing squirrel command `%s`', cmd);\n var target = path.basename(process.execPath);\n\n if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {\n run(['--createShortcut=' + target + ''], app.quit);\n return true;\n }\n if (cmd === '--squirrel-uninstall') {\n run(['--removeShortcut=' + target + ''], app.quit);\n return true;\n }\n if (cmd === '--squirrel-obsolete') {\n app.quit();\n return true;\n }\n }\n return false;\n};\n\nmodule.exports = check();\n","module.exports = require(\"child_process\");","/**\n * Detect Electron renderer process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process !== 'undefined' && process.type === 'renderer') {\n module.exports = require('./browser.js');\n} else {\n module.exports = require('./node.js');\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","/**\n * Module dependencies.\n */\n\nvar tty = require('tty');\nvar util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(function (key) {\n return /^debug_/i.test(key);\n}).reduce(function (obj, key) {\n // camel-case\n var prop = key\n .substring(6)\n .toLowerCase()\n .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });\n\n // coerce string value into JS value\n var val = process.env[key];\n if (/^(yes|on|true|enabled)$/i.test(val)) val = true;\n else if (/^(no|off|false|disabled)$/i.test(val)) val = false;\n else if (val === 'null') val = null;\n else val = Number(val);\n\n obj[prop] = val;\n return obj;\n}, {});\n\n/**\n * The file descriptor to write the `debug()` calls to.\n * Set the `DEBUG_FD` env variable to override with another value. i.e.:\n *\n * $ DEBUG_FD=3 node script.js 3>debug.log\n */\n\nvar fd = parseInt(process.env.DEBUG_FD, 10) || 2;\n\nif (1 !== fd && 2 !== fd) {\n util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()\n}\n\nvar stream = 1 === fd ? process.stdout :\n 2 === fd ? process.stderr :\n createWritableStdioStream(fd);\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n return 'colors' in exports.inspectOpts\n ? Boolean(exports.inspectOpts.colors)\n : tty.isatty(fd);\n}\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nexports.formatters.o = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts)\n .split('\\n').map(function(str) {\n return str.trim()\n }).join(' ');\n};\n\n/**\n * Map %o to `util.inspect()`, allowing multiple lines if needed.\n */\n\nexports.formatters.O = function(v) {\n this.inspectOpts.colors = this.useColors;\n return util.inspect(v, this.inspectOpts);\n};\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var name = this.namespace;\n var useColors = this.useColors;\n\n if (useColors) {\n var c = this.color;\n var prefix = ' \\u001b[3' + c + ';1m' + name + ' ' + '\\u001b[0m';\n\n args[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n args.push('\\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\\u001b[0m');\n } else {\n args[0] = new Date().toUTCString()\n + ' ' + name + ' ' + args[0];\n }\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to `stream`.\n */\n\nfunction log() {\n return stream.write(util.format.apply(util, arguments) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n if (null == namespaces) {\n // If you set a process.env field to null or undefined, it gets cast to the\n // string 'null' or 'undefined'. Just delete instead.\n delete process.env.DEBUG;\n } else {\n process.env.DEBUG = namespaces;\n }\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n return process.env.DEBUG;\n}\n\n/**\n * Copied from `node/src/node.js`.\n *\n * XXX: It's lame that node doesn't expose this API out-of-the-box. It also\n * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.\n */\n\nfunction createWritableStdioStream (fd) {\n var stream;\n var tty_wrap = process.binding('tty_wrap');\n\n // Note stream._type is used for test-module-load-list.js\n\n switch (tty_wrap.guessHandleType(fd)) {\n case 'TTY':\n stream = new tty.WriteStream(fd);\n stream._type = 'tty';\n\n // Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n case 'FILE':\n var fs = require('fs');\n stream = new fs.SyncWriteStream(fd, { autoClose: false });\n stream._type = 'fs';\n break;\n\n case 'PIPE':\n case 'TCP':\n var net = require('net');\n stream = new net.Socket({\n fd: fd,\n readable: false,\n writable: true\n });\n\n // FIXME Should probably have an option in net.Socket to create a\n // stream from an existing fd which is writable only. But for now\n // we'll just add this hack and set the `readable` member to false.\n // Test: ./node test/fixtures/echo.js < /etc/passwd\n stream.readable = false;\n stream.read = null;\n stream._type = 'pipe';\n\n // FIXME Hack to have stream not keep the event loop alive.\n // See https://github.com/joyent/node/issues/1726\n if (stream._handle && stream._handle.unref) {\n stream._handle.unref();\n }\n break;\n\n default:\n // Probably an error on in uv_guess_handle()\n throw new Error('Implement me. Unknown stream file type!');\n }\n\n // For supporting legacy API we put the FD here.\n stream.fd = fd;\n\n stream._isStdio = true;\n\n return stream;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init (debug) {\n debug.inspectOpts = {};\n\n var keys = Object.keys(exports.inspectOpts);\n for (var i = 0; i < keys.length; i++) {\n debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n }\n}\n\n/**\n * Enable namespaces listed in `process.env.DEBUG` initially.\n */\n\nexports.enable(load());\n","module.exports = require(\"tty\");","module.exports = require(\"net\");","// 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\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(0);\n",""],"names":[],"sourceRoot":""}