{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/tinymce/themes/mobile/theme.js","webpack:///./node_modules/tinymce/themes/silver/theme.js","webpack:///./node_modules/tinymce/tinymce.min.js","webpack:///(webpack)/buildin/global.js","webpack:///./webpack/plugins/custom/tinymce/tinymce.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA,0CAA0C,QAAQ;AAClD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,KAAK,KAAK;AACxC;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,2BAA2B,iBAAiB;AAC5C;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,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sGAAsG;;AAEtG;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;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;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,eAAe;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,aAAa;AACpB,OAAO,oCAAoC;AAC3C,OAAO,eAAe;AACtB,OAAO,4CAA4C;AACnD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,8EAA8E;AAC9E;AACA,aAAa;AACb;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,oBAAoB,kCAAkC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA,iCAAiC;AACjC,wCAAwC;AACxC,oCAAoC;AACpC;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,iCAAiC,wBAAwB;AACzD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW,eAAe;AAC1B,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW,UAAU;AACrB;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,4BAA4B;AAC5B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,4BAA4B;AAC5B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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,OAAO;AACP;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;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;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,yBAAyB,kBAAkB;AAC3C;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;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,KAAK;;AAEL;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,+BAA+B,uCAAuC,uBAAuB,GAAG;AAChG;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,KAAK;;AAEL;AACA,uCAAuC,IAAI,cAAc,iBAAiB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;;AAEA;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA,oCAAoC;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,oCAAoC,WAAW,0BAA0B;AACzE,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO;AACP;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,uDAAuD;AACvD,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,kFAAkF,kCAAkC;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,UAAU,yBAAyB;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,WAAW,UAAU;AACrB,2BAA2B,aAAa;AACxC,SAAS;AACT;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,0BAA0B,iCAAiC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qBAAqB;AACrB,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qCAAqC,cAAc;AACnD;AACA,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,IAAI;AACrD;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,OAAO,kBAAkB,OAAO,sBAAsB,OAAO,sBAAsB,OAAO;AAC/H,OAAO;AACP,qCAAqC,OAAO,kBAAkB,OAAO;AACrE,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,UAAU,uBAAuB,EAAE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA,+BAA+B;AAC/B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,yBAAyB;AACzB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT,4CAA4C;AAC5C,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;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,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,mBAAmB,yBAAyB,oBAAoB,OAAO;AACnG;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0BAA0B,UAAU,uBAAuB;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO,IAAI;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO,UAAU,OAAO;AAC1D;AACA,0DAA0D,OAAO;AACjE;AACA,sCAAsC,OAAO;AAC7C,6CAA6C,OAAO;AACpD,mDAAmD,uCAAuC;AAC1F,WAAW;AACX,2DAA2D,OAAO;AAClE;AACA,sCAAsC,OAAO;AAC7C,mDAAmD,uCAAuC;AAC1F,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,eAAe;AAChE;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;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,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C,6CAA6C,OAAO;AACpD,WAAW;AACX;AACA,sCAAsC,OAAO;AAC7C,mDAAmD,uCAAuC;AAC1F,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA,6BAA6B,OAAO,kBAAkB,OAAO,mBAAmB,OAAO;AACvF;AACA,6BAA6B,OAAO,kBAAkB,OAAO,mBAAmB,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,UAAU,WAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6CAA6C,sBAAsB;AACnE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,sBAAsB;AACxE;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,iBAAiB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,kCAAkC;AAClC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,yCAAyC;AACzC,oCAAoC;AACpC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC,mCAAmC;AACnC;AACA;AACA;AACA,8BAA8B;AAC9B,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iCAAiC;AACjC,oCAAoC,iBAAiB;AACrD,oBAAoB;AACpB,WAAW,UAAU;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,0BAA0B,+CAA+C;AACzE;AACA;AACA,SAAS;AACT;AACA,4BAA4B,oBAAoB;AAChD,+BAA+B;AAC/B,yBAAyB,oBAAoB;AAC7C;AACA;AACA,OAAO;AACP;AACA,qCAAqC,OAAO,qBAAqB,OAAO,sBAAsB,OAAO;AACrG;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,mBAAmB,gFAAgF;AACnG;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,qCAAqC,OAAO,8BAA8B,OAAO;AACjF;AACA,6CAA6C,uBAAuB;AACpE,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,OAAO;AAC3C;AACA,wCAAwC,OAAO,2CAA2C,oBAAoB;AAC9G;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA,WAAW;AACX;AACA,kEAAkE,OAAO,YAAY,OAAO,iBAAiB,OAAO;AACpH,SAAS;AACT,OAAO;AACP;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,KAAK;;AAEL;;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,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,qCAAqC;AACrC,SAAS,IAAI;AACb;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA,SAAS;AACT,OAAO;AACP,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,sBAAsB;AACtB,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,oCAAoC;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,yBAAyB,mBAAmB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,gBAAgB;AAC5F;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa;AACjD;AACA;AACA;AACA,kCAAkC,aAAa;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C,4BAA4B,yCAAyC,qEAAqE,uCAAuC,qCAAqC,wBAAwB,yBAAyB,KAAK,GAAG;AAC5T;AACA;AACA,6CAA6C,QAAQ,kBAAkB,EAAE;AACzE,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,kCAAkC;AAClC;;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,mBAAmB;AACnB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mEAAmE,OAAO,0BAA0B;AACpG,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,0BAA0B,cAAc,eAAe;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA,8BAA8B;AAC9B,yBAAyB;AACzB,yBAAyB;AACzB;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,oBAAoB;AACpB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO,yDAAyD;AAChE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb,8CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,2DAA2D,aAAa;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,iBAAiB;AACjB,sBAAsB;AACtB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,kBAAkB;AAClE,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mBAAmB;AACnB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;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,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,cAAc;AACd;;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;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA,OAAO,sBAAsB;AAC7B;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;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,WAAW;AACX,SAAS;AACT;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA,gDAAgD;AAChD,wDAAwD;AACxD,0CAA0C,iBAAiB,mBAAmB,oBAAoB,qBAAqB,sBAAsB,2BAA2B;AACxK,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA,kCAAkC,OAAO;AACzC;AACA,sCAAsC,OAAO;AAC7C;AACA,0CAA0C,OAAO;AACjD;AACA;AACA;AACA,iBAAiB;AACjB,6DAA6D,iDAAiD;AAC9G,eAAe;AACf,WAAW;AACX,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,eAAe;AACjE,mDAAmD,eAAe;AAClE,6CAA6C,eAAe;AAC5D,6CAA6C,eAAe;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,0CAA0C;AACxD;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,0BAA0B,cAAc,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,0BAA0B,cAAc,kBAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA,qEAAqE,OAAO;AAC5E;AACA;AACA;AACA;AACA,eAAe;AACf,yCAAyC,2CAA2C,IAAI;AACxF,oBAAoB,oDAAoD;AACxE;AACA;AACA;AACA;AACA,kCAAkC,OAAO;AACzC,8CAA8C;AAC9C;AACA;AACA;AACA;AACA,mBAAmB;AACnB,WAAW;AACX,yBAAyB,iBAAiB;AAC1C;AACA;AACA,OAAO;AACP;AACA,cAAc,kCAAkC;AAChD;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,OAAO,kBAAkB,OAAO;AAClE;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA,0DAA0D;AAC1D,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,wBAAwB,qBAAqB;AAC7C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,cAAc;AACrB,OAAO,sBAAsB;AAC7B,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,wCAAwC;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,6DAA6D;AAC3E;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;;AAEA;AACA,kCAAkC,0CAA0C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,YAAY;AAClC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,wEAAwE,cAAc;AACtF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sBAAsB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,iEAAiE,SAAS;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,uBAAuB;AACvB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,+CAA+C;AAC/C;AACA,eAAe;AACf,gCAAgC;AAChC,aAAa;AACb,aAAa;AACb;AACA,SAAS,IAAI;AACb,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,yCAAyC;AACzC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,+CAA+C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,sCAAsC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,qDAAqD,qCAAqC;AAC1F,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,wBAAwB;AACxB,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,wBAAwB;AACxB,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,8DAA8D;AAC9D,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,gCAAgC;AAChC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;AC3yaD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uBAAuB;AAC7C;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,cAAc;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA,0CAA0C,QAAQ;AAClD,wDAAwD,QAAQ;AAChE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,SAAS;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kBAAkB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,SAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA,iCAAiC,QAAQ;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,yCAAyC,SAAS;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,eAAe;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oBAAoB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,aAAa;AACpB,OAAO,oCAAoC;AAC3C,OAAO,eAAe;AACtB,OAAO,4CAA4C;AACnD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,8EAA8E;AAC9E;AACA,aAAa;AACb;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,oBAAoB,kCAAkC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,qBAAqB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mBAAmB;AACxC;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,qBAAqB,eAAe;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sGAAsG;;AAEtG;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA,iCAAiC;AACjC,wCAAwC;AACxC,oCAAoC;AACpC;AACA,OAAO;AACP;;AAEA;AACA,uCAAuC;AACvC;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,qCAAqC;AACrC,SAAS,IAAI;AACb;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA,SAAS;AACT,OAAO;AACP,8BAA8B;AAC9B;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,sBAAsB;AACtB,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;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;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C,oCAAoC;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,gBAAgB;AAC5F;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;;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;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+CAA+C;AACpD,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,yBAAyB,kBAAkB;AAC3C;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uBAAuB;AACjD;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;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;;AAEA;AACA,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,OAAO,YAAY;AACnB,OAAO,YAAY;AACnB,OAAO,WAAW;AAClB,OAAO;AACP;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;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,0HAA0H,YAAY;AACtI;AACA;AACA,iHAAiH,SAAS;AAC1H;AACA;AACA,kHAAkH,UAAU;AAC5H;AACA;AACA,2HAA2H,WAAW;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,iCAAiC,wBAAwB;AACzD;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW,eAAe;AAC1B,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW,UAAU;AACrB;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,4BAA4B;AAC5B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,4BAA4B;AAC5B;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,yCAAyC,IAAI;AAC7C,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,OAAO,WAAW;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;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;AACA;AACA;AACA;;AAEA;AACA,OAAO,sBAAsB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;;AAEL;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,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,uCAAuC;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;;AAEpB;AACA,OAAO,sBAAsB;AAC7B;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,QAAQ;AACnD;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;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,oBAAoB;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;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,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,mBAAmB,uBAAuB;AAC1C;AACA;AACA,+BAA+B;AAC/B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B,yBAAyB;AACzB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT,4CAA4C;AAC5C,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA,oCAAoC;AACpC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,oCAAoC,WAAW,0BAA0B;AACzE,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO,qBAAqB;AAC5B,OAAO;AACP;AACA,2CAA2C,mBAAmB;AAC9D;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,uDAAuD;AACvD,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;;AAEL;AACA,kFAAkF,kCAAkC;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,UAAU,yBAAyB;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,2CAA2C;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,kCAAkC;AAClC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,uCAAuC,IAAI,cAAc,iBAAiB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;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,KAAK;;AAEL;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,aAAa;AACjD;AACA;AACA;AACA,kCAAkC,aAAa;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C,4BAA4B,yCAAyC,qEAAqE,uCAAuC,qCAAqC,wBAAwB,yBAAyB,KAAK,GAAG;AAC5T;AACA;AACA,6CAA6C,QAAQ,kBAAkB,EAAE;AACzE,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,yBAAyB,oBAAoB;AAC7C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA,kCAAkC;AAClC;;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,mBAAmB;AACnB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,mEAAmE,OAAO,0BAA0B;AACpG,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,0BAA0B,cAAc,eAAe;AACvD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA,8BAA8B;AAC9B,yBAAyB;AACzB,yBAAyB;AACzB;AACA,6BAA6B;AAC7B;AACA,yBAAyB;AACzB,oBAAoB;AACpB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,wBAAwB;AAC9D;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO,yDAAyD;AAChE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,0CAA0C,6BAA6B,gCAAgC;AACvG,sBAAsB,oBAAoB,kBAAkB;AAC5D,aAAa,UAAU,6CAA6C;AACpE,sBAAsB,oBAAoB,kBAAkB;AAC5D,aAAa,UAAU,KAAK,2BAA2B;AACvD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,0HAA0H,SAAS;AACnI;AACA;AACA,mIAAmI,YAAY;AAC/I;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,WAAW,UAAU;AACrB,2BAA2B,aAAa;AACxC,SAAS;AACT;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,0BAA0B,iCAAiC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,UAAU,WAAW;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iDAAiD;AACjD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA,iDAAiD;AACjD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,eAAe;AACf;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS,kDAAkD,IAAI,+BAA+B,EAAE;AAChG;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;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,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,qCAAqC;;AAErC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP,4BAA4B;AAC5B;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,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,mCAAmC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA,gEAAgE;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA,qDAAqD;AACrD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,mBAAmB,gFAAgF;AACnG;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,iCAAiC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,yCAAyC;AAC9C;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,UAAU,oBAAoB;AACnE,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,iBAAiB;AACjF,kEAAkE,iBAAiB;AACnF;AACA,8DAA8D,qBAAqB;AACnF,gEAAgE,qBAAqB;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,+BAA+B,qBAAqB;AACpD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;;AAEA;;AAEA;AACA;AACA,sBAAsB;AACtB,uBAAuB;AACvB,wBAAwB;AACxB,uBAAuB;AACvB,yBAAyB,QAAQ;AACjC;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,SAAS,UAAU;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,qCAAqC;AACrC;AACA;AACA,WAAW;AACX,SAAS;AACT,qCAAqC;AACrC,4CAA4C,wBAAwB,8BAA8B;AAClG,qBAAqB;AACrB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,cAAc,mCAAmC;AACjE,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA,aAAa;AACb;AACA;AACA;AACA,gEAAgE,gCAAgC;AAChG,eAAe;AACf;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,2BAA2B,wBAAwB;AACnD;AACA,OAAO;AACP;AACA;AACA;AACA,qBAAqB,aAAa;AAClC;AACA,uBAAuB,aAAa;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,aAAa;AAClC,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA,iDAAiD;AACjD,OAAO;AACP;AACA;AACA,eAAe,iCAAiC;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA,qCAAqC,EAAE,UAAU,EAAE,UAAU,EAAE;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,cAAc;AACd;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,EAAE;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,qBAAqB;AAC1C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,wCAAwC,eAAe;AACvD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,yCAAyC,cAAc;AACvD;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,uBAAuB,eAAe;AACtC,OAAO;AACP;AACA,OAAO;AACP,2CAA2C;AAC3C;AACA;AACA,OAAO;AACP;AACA;AACA,eAAe,iCAAiC;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,UAAU,iBAAiB;AAC3E,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qCAAqC;AACrC;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,cAAc;AACrB,OAAO,sBAAsB;AAC7B,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,uBAAuB;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,yCAAyC;AACzC,oCAAoC;AACpC;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAqE,wCAAwC;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C,6BAA6B,wBAAwB;AACrD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA,uCAAuC;AACvC,mCAAmC;AACnC;AACA;AACA;AACA,8BAA8B;AAC9B,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iCAAiC;AACjC,oCAAoC,iBAAiB;AACrD,oBAAoB;AACpB,WAAW,UAAU;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL,sBAAsB,YAAY;AAClC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,wEAAwE,cAAc;AACtF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,sBAAsB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,iEAAiE,SAAS;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,uBAAuB;AACvB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,+CAA+C;AAC/C;AACA,eAAe;AACf,gCAAgC;AAChC,aAAa;AACb,aAAa;AACb;AACA,SAAS,IAAI;AACb,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,OAAO,UAAU;AACjB;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;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,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc,aAAa;AAC3B,kDAAkD,mBAAmB;AACrE;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK,yCAAyC;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX,4BAA4B,+BAA+B,oBAAoB,qBAAqB,wBAAwB,kCAAkC,IAAI;AAClK;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,4BAA4B;AAC5B;AACA;AACA,wCAAwC,8BAA8B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,0BAA0B;AACnE;AACA,WAAW;AACX,oBAAoB;AACpB,WAAW,mCAAmC,2CAA2C,KAAK;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qBAAqB;AACrB,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA,aAAa,+BAA+B,2DAA2D;AACvG,WAAW;AACX,SAAS;AACT,gBAAgB;AAChB,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,4BAA4B,iDAAiD;AAC7E;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,uDAAuD,aAAa;AACpE;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,oDAAoD,eAAe;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,eAAe;AACf,+CAA+C,kBAAkB;AACjE,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA,OAAO;AACP;;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;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,OAAO,UAAU,uBAAuB,EAAE,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,eAAe;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,+CAA+C,eAAe;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,mBAAmB,yBAAyB,oBAAoB,OAAO;AACnG;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0BAA0B,UAAU,uBAAuB;AAC3D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA,qCAAqC,iBAAiB;AACtD,SAAS;AACT;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA,0CAA0C,eAAe;AACzD;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,cAAc;AAC7D,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA;AACA,qCAAqC,eAAe,oBAAoB,wBAAwB,KAAK;AACrG;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8EAA8E,iBAAiB;AAC/F;AACA;AACA;AACA;AACA,yBAAyB;AACzB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,iBAAiB;AAC1D;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,mBAAmB,8BAA8B;AACjD,uBAAuB;AACvB;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yCAAyC;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,2CAA2C,eAAe;AAC1D;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB;AAChD;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,mDAAmD;AACnD,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA,8CAA8C,EAAE,eAAe,EAAE;AACjE;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,kDAAkD,mCAAmC;AACrF;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC,OAAO,gBAAgB,EAAE;AACzD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,mBAAmB;AACnB;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,gBAAgB,SAAS,6BAA6B;AACtD,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,kBAAkB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,mBAAmB;AACnB,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,6BAA6B,uBAAuB;AACpD;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,yCAAyC;AACzC;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,OAAO;AACP,4CAA4C,WAAW,sBAAsB,EAAE;AAC/E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,uBAAuB,gBAAgB;AACvC;AACA,SAAS;AACT;AACA,2BAA2B,eAAe;AAC1C,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,gBAAgB;AAChB,OAAO,UAAU,iBAAiB,6CAA6C,KAAK;AACpF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,iCAAiC;AACjC,8BAA8B;AAC9B;AACA;AACA,SAAS;AACT;AACA,4CAA4C,WAAW,kBAAkB,EAAE;AAC3E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gBAAgB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6CAA6C,sBAAsB;AACnE;AACA;AACA;AACA,SAAS;AACT;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,OAAO;AACP;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,0DAA0D,iBAAiB;AAC3E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,OAAO;AAC5B,uBAAuB,OAAO;AAC9B;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA,yBAAyB,OAAO;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B,yBAAyB,OAAO;AAChC;AACA;AACA;AACA,4BAA4B,WAAW;AACvC,8BAA8B,WAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,iBAAiB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;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;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,4DAA4D;AAC5D;AACA;AACA,2DAA2D,0CAA0C,KAAK;AAC1G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA,wDAAwD,qBAAqB;AAC7E;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,uCAAuC,wBAAwB;AAC/D;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,gBAAgB;AAChB,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,iCAAiC;AACjC,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,+BAA+B;AAC/B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,gBAAgB,gDAAgD;AAChE;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT,0BAA0B,mBAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,iBAAiB;AACjB,sBAAsB;AACtB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,oBAAoB;AACpB,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,wCAAwC,WAAW;AACnD,kCAAkC,yBAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,wCAAwC,IAAI;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAe,cAAc,wBAAwB,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,6CAA6C,UAAU,oBAAoB;AAC3E;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,8EAA8E,kBAAkB;AAChG;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,qBAAqB;AACrB,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,eAAe;AACf;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,+BAA+B;AAC/B;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,iCAAiC;AACjC;AACA;AACA,iDAAiD,qBAAqB;AACtE,eAAe;AACf;AACA,sDAAsD,kBAAkB;AACxE,eAAe;AACf;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,kBAAkB,0BAA0B;AAC5C;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;;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;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,uBAAuB;AACnE;AACA;AACA;AACA;AACA,gDAAgD,uBAAuB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,kDAAkD,4BAA4B;AAC9E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,mDAAmD;AACnD,SAAS;AACT;AACA;AACA;AACA,mDAAmD,4BAA4B;AAC/E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,yBAAyB;AACzB,WAAW;AACX;AACA;AACA;AACA;AACA,uCAAuC,qBAAqB;AAC5D,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA,SAAS;AACT;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,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;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,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,cAAc,aAAa;AAC3B;AACA,0DAA0D;AAC1D,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,qCAAqC,aAAa;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,eAAe;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA,WAAW;AACX;AACA,kBAAkB,aAAa;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,2CAA2C,eAAe;AAC1D,OAAO;AACP;AACA,2CAA2C,eAAe;AAC1D,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,+CAA+C,eAAe;AAC9D,WAAW;AACX;AACA,+CAA+C,gBAAgB;AAC/D,WAAW;AACX;AACA,OAAO;AACP;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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,eAAe;AACf,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B;AACA,oDAAoD,kBAAkB;AACtE,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA,oBAAoB,YAAY;AAChC;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,YAAY;AAC5B;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,4BAA4B;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,kDAAkD,kBAAkB;AACpE,WAAW;AACX;AACA,kDAAkD,kBAAkB;AACpE,WAAW;AACX;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT,OAAO;AACP,yDAAyD;AACzD,gBAAgB;AAChB,OAAO;AACP,qDAAqD;AACrD,gBAAgB;AAChB,OAAO;AACP,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW,UAAU;AACrB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,uBAAuB;AACvB,qBAAqB;AACrB,mBAAmB;AACnB;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,+CAA+C,aAAa;AAC5D;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iBAAiB;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,wCAAwC;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA,kCAAkC;AAClC,gCAAgC;AAChC;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA;AACA,mBAAmB;AACnB;AACA,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA,oDAAoD,aAAa;AACjE;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,qBAAqB;AACrB,mBAAmB;AACnB,iBAAiB;AACjB;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,iCAAiC;AACjC;AACA;AACA,mDAAmD,kBAAkB;AACrE,iBAAiB;AACjB;AACA;AACA,mDAAmD,kBAAkB;AACrE;AACA,iBAAiB;AACjB;AACA,mDAAmD,kBAAkB;AACrE;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT,kBAAkB,yCAAyC;AAC3D;AACA,gBAAgB,iCAAiC;AACjD;AACA,iDAAiD;AACjD,SAAS;AACT;AACA;AACA,gDAAgD,kBAAkB;AAClE;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,sBAAsB;AACtB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB;AACzD;AACA;AACA;AACA,+CAA+C,kBAAkB;AACjE,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,iBAAiB;AACjB;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,eAAe;AACf,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,oDAAoD,kBAAkB;AACtE,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mDAAmD;AACnD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,WAAW;AACX;AACA,iCAAiC;AACjC,8BAA8B;AAC9B;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,SAAS;AACT,qCAAqC,SAAS,mCAAmC;AACjF;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA,WAAW;AACX,oCAAoC,oBAAoB;AACxD,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kCAAkC;AAC/C;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,0BAA0B,cAAc,kBAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,0CAA0C;AACxD;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,0BAA0B,cAAc,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP,kBAAkB,0BAA0B;AAC5C,kBAAkB,yBAAyB;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,cAAc,0BAA0B,EAAE;AAC5D;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA,eAAe;AACf;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA,0CAA0C,6BAA6B,qBAAqB;AAC5F,sBAAsB,oBAAoB,kBAAkB;AAC5D,aAAa,UAAU;AACvB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,iCAAiC,oCAAoC;AACrE;AACA;AACA,SAAS;AACT,oDAAoD,4CAA4C;AAChG;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qCAAqC;AACrC,kBAAkB,oDAAoD;AACtE;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,mCAAmC,6CAA6C;AAC/I;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT,0BAA0B,cAAc,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,qBAAqB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kBAAkB;AACzC;AACA,eAAe;AACf;AACA;AACA,OAAO;AACP,kBAAkB,yBAAyB;AAC3C;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,4DAA4D;AAC5D;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT,0BAA0B,cAAc,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,OAAO;AACP,gBAAgB,cAAc,eAAe;AAC7C,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT,kDAAkD;AAClD;AACA,kBAAkB,yJAAyJ;AAC3K;AACA,+BAA+B;AAC/B,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,6DAA6D;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,kBAAkB;AAClB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,4DAA4D;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,iEAAiE,iBAAiB;AAClF,SAAS;AACT;AACA,iEAAiE,iBAAiB;AAClF;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,8CAA8C;AAC9C;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA,yBAAyB;AACzB,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA,yBAAyB;AACzB,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C,6BAA6B,wBAAwB;AACrD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B;AAC5B;AACA;AACA,mBAAmB;AACnB,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,kBAAkB,oCAAoC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gDAAgD;AAChE;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX,oDAAoD,oFAAoF;AACxI;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,qEAAqE;AACrE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,oBAAoB,aAAa,UAAU,gCAAgC,EAAE;AAC7E;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,OAAO,mBAAmB;AACnE,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,oCAAoC,2BAA2B;AAC/D;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,oBAAoB,QAAQ,iBAAiB;AAC7C,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,6BAA6B;AAClC;AACA;AACA,oCAAoC,gBAAgB;AACpD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,wCAAwC,6BAA6B;AACrE;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,iEAAiE,sCAAsC,wCAAwC,8CAA8C,4CAA4C,+CAA+C,oCAAoC,0CAA0C,8BAA8B,mBAAmB,8CAA8C,wCAAwC,iDAAiD,iDAAiD,uCAAuC,uBAAuB;AAC7oB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,sBAAsB;AAC1E,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;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,aAAa;AACb;AACA,iCAAiC,qCAAqC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA,qCAAqC,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB,kBAAkB;AACjJ;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,gBAAgB;AAChB,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,8CAA8C;AACjG,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,WAAW;AACX,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,6CAA6C,uBAAuB;AACpE;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA,OAAO;AACP;AACA,6CAA6C,sCAAsC;AACnF;AACA;AACA;AACA,wCAAwC,sCAAsC;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,0CAA0C;AACxD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,wCAAwC;AACxC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,OAAO,aAAa;AACpB,OAAO,4BAA4B;AACnC,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;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,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mBAAmB,+BAA+B,qCAAqC,OAAO;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;AAC7D;AACA,sEAAsE;AACtE,SAAS;AACT;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,qBAAqB;AACrB;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B;AACA;AACA,0BAA0B,cAAc,kBAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,4CAA4C,cAAc,mBAAmB;;AAE7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,mCAAmC;AACnC,gCAAgC;AAChC;AACA,4BAA4B,oBAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA,6CAA6C,qDAAqD;AAClG,iBAAiB;AACjB;AACA,6CAA6C,wCAAwC;AACrF;AACA,eAAe;AACf,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,qCAAqC,cAAc;AACnD;AACA,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,IAAI;AACrD;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,0DAA0D;AACjF;AACA,SAAS;AACT,sBAAsB,sFAAsF;AAC5G;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA,mBAAmB;AACnB,SAAS;AACT,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA,KAAK;AACL;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,eAAe;AACf;AACA,aAAa;AACb,uBAAuB,oBAAoB;AAC3C,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,eAAe;AACzD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uBAAuB;AACzE,SAAS;AACT;AACA,OAAO;AACP,8EAA8E,uBAAuB;AACrG;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,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;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,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,yDAAyD;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,qBAAqB,QAAQ;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;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,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;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;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;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,iBAAiB,+BAA+B;AAChD;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,aAAa;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT,qCAAqC;AACrC;AACA;AACA;AACA,aAAa;AACb,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;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;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;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,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;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,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,gEAAgE,+BAA+B;;AAE/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,gEAAgE,+BAA+B;;AAE/F;AACA;AACA;AACA,gEAAgE,+BAA+B;;AAE/F;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK,iCAAiC;AACtC;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,yBAAyB,sBAAsB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B,0CAA0C;AACtE;AACA,+BAA+B;AAC/B,6BAA6B;AAC7B;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,EAAE;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,uBAAuB,EAAE;AACzB;AACA;AACA,0FAA0F,yBAAyB,uBAAuB;AAC1I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc,aAAa,EAAE;AAC3E,mCAAmC,qBAAqB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,sBAAsB,sBAAsB,aAAa,KAAK,eAAe,wBAAwB,KAAK;AACpJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA,WAAW,KAAK;AAChB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,mDAAmD,uBAAuB;AAC1E;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,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,eAAe;AACf;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,uCAAuC;AACvC;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA;AACA;AACA;AACA,2CAA2C,uBAAuB,oGAAoG;AACtK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AACA,4BAA4B;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;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;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,eAAe;AACf;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX,4BAA4B;AAC5B;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,cAAc,kBAAkB,EAAE;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,0EAA0E;AAC1E,0BAA0B,cAAc,mBAAmB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,yBAAyB;AACzB;AACA;AACA,kCAAkC;AAClC;AACA;AACA,qBAAqB;AACrB;AACA;AACA,eAAe;AACf;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,+CAA+C;AAC/C;AACA;AACA;AACA,aAAa;AACb,6DAA6D;AAC7D,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,+EAA+E;AAC/E;AACA,eAAe;AACf;AACA;AACA,4EAA4E;AAC5E;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,oBAAoB;AACpB,WAAW,UAAU,mCAAmC;AACxD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,+BAA+B;AAC/B,iBAAiB;AACjB;AACA,uCAAuC;AACvC,oCAAoC;AACpC;AACA,eAAe;AACf,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,yDAAyD;AACzD,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,0BAA0B,0EAA0E;AACpG,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,SAAS;AACT;AACA;AACA,4BAA4B;AAC5B;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,oBAAoB;AACpB,WAAW,UAAU;AACrB,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qCAAqC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,4BAA4B,sFAAsF;AAClH;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,uCAAuC;AACvC;AACA;AACA;AACA,SAAS;AACT;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,qCAAqC,UAAU,gBAAgB;AAC/D,SAAS;AACT,mCAAmC,YAAY,eAAe;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO,IAAI;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8BAA8B,qBAAqB;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,8BAA8B,qBAAqB;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb;AACA,eAAe;AACf;AACA,aAAa;AACb;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mCAAmC;AACnC;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mBAAmB;AAC7D,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,uCAAuC;AACzE;AACA;AACA,sCAAsC,+BAA+B;AACrE;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,6CAA6C,uCAAuC;AACpF;AACA;AACA,iDAAiD,+BAA+B;AAChF;AACA;AACA,OAAO;AACP;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,iBAAiB;AAC9C,SAAS;AACT,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX,4BAA4B;AAC5B;AACA;AACA,aAAa;AACb,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mBAAmB;AAC7D,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,gDAAgD,mBAAmB;AACnE;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,uCAAuC;AACvC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,wDAAwD,0DAA0D;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA,eAAe;AACf;AACA,WAAW;AACX,SAAS;AACT;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,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,WAAW,2BAA2B,IAAI,+BAA+B,EAAE;AAC3E;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA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","file":"plugins/custom/tinymce/tinymce.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./webpack/plugins/custom/tinymce/tinymce.js\");\n","/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n *\n * Version: 5.4.1 (2020-07-08)\n */\n(function (domGlobals) {\n 'use strict';\n\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === 'function')\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n\n var noop = function () {\n };\n var compose = function (fa, fb) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fa(fb.apply(null, args));\n };\n };\n var compose1 = function (fbc, fab) {\n return function (a) {\n return fbc(fab(a));\n };\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var identity = function (x) {\n return x;\n };\n function curry(fn) {\n var initialArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n initialArgs[_i - 1] = arguments[_i];\n }\n return function () {\n var restArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n restArgs[_i] = arguments[_i];\n }\n var all = initialArgs.concat(restArgs);\n return fn.apply(null, all);\n };\n }\n var not = function (f) {\n return function (t) {\n return !f(t);\n };\n };\n var die = function (msg) {\n return function () {\n throw new Error(msg);\n };\n };\n var apply = function (f) {\n return f();\n };\n var never = constant(false);\n var always = constant(true);\n\n var none = function () {\n return NONE;\n };\n var NONE = function () {\n var eq = function (o) {\n return o.isNone();\n };\n var call = function (thunk) {\n return thunk();\n };\n var id = function (n) {\n return n;\n };\n var me = {\n fold: function (n, _s) {\n return n();\n },\n is: never,\n isSome: never,\n isNone: always,\n getOr: id,\n getOrThunk: call,\n getOrDie: function (msg) {\n throw new Error(msg || 'error: getOrDie called on none.');\n },\n getOrNull: constant(null),\n getOrUndefined: constant(undefined),\n or: id,\n orThunk: call,\n map: none,\n each: noop,\n bind: none,\n exists: never,\n forall: always,\n filter: none,\n equals: eq,\n equals_: eq,\n toArray: function () {\n return [];\n },\n toString: constant('none()')\n };\n return me;\n }();\n var some = function (a) {\n var constant_a = constant(a);\n var self = function () {\n return me;\n };\n var bind = function (f) {\n return f(a);\n };\n var me = {\n fold: function (n, s) {\n return s(a);\n },\n is: function (v) {\n return a === v;\n },\n isSome: always,\n isNone: never,\n getOr: constant_a,\n getOrThunk: constant_a,\n getOrDie: constant_a,\n getOrNull: constant_a,\n getOrUndefined: constant_a,\n or: self,\n orThunk: self,\n map: function (f) {\n return some(f(a));\n },\n each: function (f) {\n f(a);\n },\n bind: bind,\n exists: bind,\n forall: bind,\n filter: function (f) {\n return f(a) ? me : NONE;\n },\n toArray: function () {\n return [a];\n },\n toString: function () {\n return 'some(' + a + ')';\n },\n equals: function (o) {\n return o.is(a);\n },\n equals_: function (o, elementEq) {\n return o.fold(never, function (b) {\n return elementEq(a, b);\n });\n }\n };\n return me;\n };\n var from = function (value) {\n return value === null || value === undefined ? NONE : some(value);\n };\n var Option = {\n some: some,\n none: none,\n from: from\n };\n\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var map = function (obj, f) {\n return tupleMap(obj, function (x, i) {\n return {\n k: i,\n v: f(x, i)\n };\n });\n };\n var tupleMap = function (obj, f) {\n var r = {};\n each(obj, function (x, i) {\n var tuple = f(x, i);\n r[tuple.k] = tuple.v;\n });\n return r;\n };\n var objAcc = function (r) {\n return function (x, i) {\n r[i] = x;\n };\n };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n var r = {};\n each(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n return r;\n };\n var filter = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var mapToArray = function (obj, f) {\n var r = [];\n each(obj, function (value, name) {\n r.push(f(value, name));\n });\n return r;\n };\n var find = function (obj, pred) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n if (pred(x, i, obj)) {\n return Option.some(x);\n }\n }\n return Option.none();\n };\n var values = function (obj) {\n return mapToArray(obj, function (v) {\n return v;\n });\n };\n var get = function (obj, key) {\n return has(obj, key) ? Option.from(obj[key]) : Option.none();\n };\n var has = function (obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n var hasNonNullableKey = function (obj, key) {\n return has(obj, key) && obj[key] !== undefined && obj[key] !== null;\n };\n\n var cached = function (f) {\n var called = false;\n var r;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (!called) {\n called = true;\n r = f.apply(null, args);\n }\n return r;\n };\n };\n\n var firstMatch = function (regexes, s) {\n for (var i = 0; i < regexes.length; i++) {\n var x = regexes[i];\n if (x.test(s)) {\n return x;\n }\n }\n return undefined;\n };\n var find$1 = function (regexes, agent) {\n var r = firstMatch(regexes, agent);\n if (!r) {\n return {\n major: 0,\n minor: 0\n };\n }\n var group = function (i) {\n return Number(agent.replace(r, '$' + i));\n };\n return nu(group(1), group(2));\n };\n var detect = function (versionRegexes, agent) {\n var cleanedAgent = String(agent).toLowerCase();\n if (versionRegexes.length === 0) {\n return unknown();\n }\n return find$1(versionRegexes, cleanedAgent);\n };\n var unknown = function () {\n return nu(0, 0);\n };\n var nu = function (major, minor) {\n return {\n major: major,\n minor: minor\n };\n };\n var Version = {\n nu: nu,\n detect: detect,\n unknown: unknown\n };\n\n var edge = 'Edge';\n var chrome = 'Chrome';\n var ie = 'IE';\n var opera = 'Opera';\n var firefox = 'Firefox';\n var safari = 'Safari';\n var unknown$1 = function () {\n return nu$1({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu$1 = function (info) {\n var current = info.current;\n var version = info.version;\n var isBrowser = function (name) {\n return function () {\n return current === name;\n };\n };\n return {\n current: current,\n version: version,\n isEdge: isBrowser(edge),\n isChrome: isBrowser(chrome),\n isIE: isBrowser(ie),\n isOpera: isBrowser(opera),\n isFirefox: isBrowser(firefox),\n isSafari: isBrowser(safari)\n };\n };\n var Browser = {\n unknown: unknown$1,\n nu: nu$1,\n edge: constant(edge),\n chrome: constant(chrome),\n ie: constant(ie),\n opera: constant(opera),\n firefox: constant(firefox),\n safari: constant(safari)\n };\n\n var windows = 'Windows';\n var ios = 'iOS';\n var android = 'Android';\n var linux = 'Linux';\n var osx = 'OSX';\n var solaris = 'Solaris';\n var freebsd = 'FreeBSD';\n var chromeos = 'ChromeOS';\n var unknown$2 = function () {\n return nu$2({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu$2 = function (info) {\n var current = info.current;\n var version = info.version;\n var isOS = function (name) {\n return function () {\n return current === name;\n };\n };\n return {\n current: current,\n version: version,\n isWindows: isOS(windows),\n isiOS: isOS(ios),\n isAndroid: isOS(android),\n isOSX: isOS(osx),\n isLinux: isOS(linux),\n isSolaris: isOS(solaris),\n isFreeBSD: isOS(freebsd),\n isChromeOS: isOS(chromeos)\n };\n };\n var OperatingSystem = {\n unknown: unknown$2,\n nu: nu$2,\n windows: constant(windows),\n ios: constant(ios),\n android: constant(android),\n linux: constant(linux),\n osx: constant(osx),\n solaris: constant(solaris),\n freebsd: constant(freebsd),\n chromeos: constant(chromeos)\n };\n\n var DeviceType = function (os, browser, userAgent, mediaMatch) {\n var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;\n var isiPhone = os.isiOS() && !isiPad;\n var isMobile = os.isiOS() || os.isAndroid();\n var isTouch = isMobile || mediaMatch('(pointer:coarse)');\n var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');\n var isPhone = isiPhone || isMobile && !isTablet;\n var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;\n var isDesktop = !isPhone && !isTablet && !iOSwebview;\n return {\n isiPad: constant(isiPad),\n isiPhone: constant(isiPhone),\n isTablet: constant(isTablet),\n isPhone: constant(isPhone),\n isTouch: constant(isTouch),\n isAndroid: os.isAndroid,\n isiOS: os.isiOS,\n isWebView: constant(iOSwebview),\n isDesktop: constant(isDesktop)\n };\n };\n\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {\n return 'array';\n } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {\n return 'string';\n } else {\n return t;\n }\n };\n var isType = function (type) {\n return function (value) {\n return typeOf(value) === type;\n };\n };\n var isSimpleType = function (type) {\n return function (value) {\n return typeof value === type;\n };\n };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isBoolean = isSimpleType('boolean');\n var isNullable = function (a) {\n return a === null || a === undefined;\n };\n var isNonNullable = function (a) {\n return !isNullable(a);\n };\n var isFunction = isSimpleType('function');\n var isNumber = isSimpleType('number');\n\n var nativeSlice = Array.prototype.slice;\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) {\n return nativeIndexOf.call(ts, t);\n };\n var contains = function (xs, x) {\n return rawIndexOf(xs, x) > -1;\n };\n var exists = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return true;\n }\n }\n return false;\n };\n var map$1 = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each$1 = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var eachr = function (xs, f) {\n for (var i = xs.length - 1; i >= 0; i--) {\n var x = xs[i];\n f(x, i);\n }\n };\n var filter$1 = function (xs, pred) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n r.push(x);\n }\n }\n return r;\n };\n var foldr = function (xs, f, acc) {\n eachr(xs, function (x) {\n acc = f(acc, x);\n });\n return acc;\n };\n var foldl = function (xs, f, acc) {\n each$1(xs, function (x) {\n acc = f(acc, x);\n });\n return acc;\n };\n var findUntil = function (xs, pred, until) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Option.some(x);\n } else if (until(x, i)) {\n break;\n }\n }\n return Option.none();\n };\n var find$2 = function (xs, pred) {\n return findUntil(xs, pred, never);\n };\n var findIndex = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Option.some(i);\n }\n }\n return Option.none();\n };\n var flatten = function (xs) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n var bind = function (xs, f) {\n return flatten(map$1(xs, f));\n };\n var forall = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; ++i) {\n var x = xs[i];\n if (pred(x, i) !== true) {\n return false;\n }\n }\n return true;\n };\n var reverse = function (xs) {\n var r = nativeSlice.call(xs, 0);\n r.reverse();\n return r;\n };\n var difference = function (a1, a2) {\n return filter$1(a1, function (x) {\n return !contains(a2, x);\n });\n };\n var pure = function (x) {\n return [x];\n };\n var sort = function (xs, comparator) {\n var copy = nativeSlice.call(xs, 0);\n copy.sort(comparator);\n return copy;\n };\n var head = function (xs) {\n return xs.length === 0 ? Option.none() : Option.some(xs[0]);\n };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Option.none();\n };\n\n var detect$1 = function (candidates, userAgent) {\n var agent = String(userAgent).toLowerCase();\n return find$2(candidates, function (candidate) {\n return candidate.search(agent);\n });\n };\n var detectBrowser = function (browsers, userAgent) {\n return detect$1(browsers, userAgent).map(function (browser) {\n var version = Version.detect(browser.versionRegexes, userAgent);\n return {\n current: browser.name,\n version: version\n };\n });\n };\n var detectOs = function (oses, userAgent) {\n return detect$1(oses, userAgent).map(function (os) {\n var version = Version.detect(os.versionRegexes, userAgent);\n return {\n current: os.name,\n version: version\n };\n });\n };\n var UaString = {\n detectBrowser: detectBrowser,\n detectOs: detectOs\n };\n\n var checkRange = function (str, substr, start) {\n return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;\n };\n var supplant = function (str, obj) {\n var isStringOrNumber = function (a) {\n var t = typeof a;\n return t === 'string' || t === 'number';\n };\n return str.replace(/\\$\\{([^{}]*)\\}/g, function (fullMatch, key) {\n var value = obj[key];\n return isStringOrNumber(value) ? value.toString() : fullMatch;\n });\n };\n var contains$1 = function (str, substr) {\n return str.indexOf(substr) !== -1;\n };\n var endsWith = function (str, suffix) {\n return checkRange(str, suffix, str.length - suffix.length);\n };\n var blank = function (r) {\n return function (s) {\n return s.replace(r, '');\n };\n };\n var trim = blank(/^\\s+|\\s+$/g);\n\n var normalVersionRegex = /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/;\n var checkContains = function (target) {\n return function (uastring) {\n return contains$1(uastring, target);\n };\n };\n var browsers = [\n {\n name: 'Edge',\n versionRegexes: [/.*?edge\\/ ?([0-9]+)\\.([0-9]+)$/],\n search: function (uastring) {\n return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');\n }\n },\n {\n name: 'Chrome',\n versionRegexes: [\n /.*?chrome\\/([0-9]+)\\.([0-9]+).*/,\n normalVersionRegex\n ],\n search: function (uastring) {\n return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');\n }\n },\n {\n name: 'IE',\n versionRegexes: [\n /.*?msie\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*?rv:([0-9]+)\\.([0-9]+).*/\n ],\n search: function (uastring) {\n return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');\n }\n },\n {\n name: 'Opera',\n versionRegexes: [\n normalVersionRegex,\n /.*?opera\\/([0-9]+)\\.([0-9]+).*/\n ],\n search: checkContains('opera')\n },\n {\n name: 'Firefox',\n versionRegexes: [/.*?firefox\\/\\ ?([0-9]+)\\.([0-9]+).*/],\n search: checkContains('firefox')\n },\n {\n name: 'Safari',\n versionRegexes: [\n normalVersionRegex,\n /.*?cpu os ([0-9]+)_([0-9]+).*/\n ],\n search: function (uastring) {\n return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');\n }\n }\n ];\n var oses = [\n {\n name: 'Windows',\n search: checkContains('win'),\n versionRegexes: [/.*?windows\\ nt\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'iOS',\n search: function (uastring) {\n return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');\n },\n versionRegexes: [\n /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*cpu os ([0-9]+)_([0-9]+).*/,\n /.*cpu iphone os ([0-9]+)_([0-9]+).*/\n ]\n },\n {\n name: 'Android',\n search: checkContains('android'),\n versionRegexes: [/.*?android\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'OSX',\n search: checkContains('mac os x'),\n versionRegexes: [/.*?mac\\ os\\ x\\ ?([0-9]+)_([0-9]+).*/]\n },\n {\n name: 'Linux',\n search: checkContains('linux'),\n versionRegexes: []\n },\n {\n name: 'Solaris',\n search: checkContains('sunos'),\n versionRegexes: []\n },\n {\n name: 'FreeBSD',\n search: checkContains('freebsd'),\n versionRegexes: []\n },\n {\n name: 'ChromeOS',\n search: checkContains('cros'),\n versionRegexes: [/.*?chrome\\/([0-9]+)\\.([0-9]+).*/]\n }\n ];\n var PlatformInfo = {\n browsers: constant(browsers),\n oses: constant(oses)\n };\n\n var detect$2 = function (userAgent, mediaMatch) {\n var browsers = PlatformInfo.browsers();\n var oses = PlatformInfo.oses();\n var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);\n var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);\n var deviceType = DeviceType(os, browser, userAgent, mediaMatch);\n return {\n browser: browser,\n os: os,\n deviceType: deviceType\n };\n };\n var PlatformDetection = { detect: detect$2 };\n\n var mediaMatch = function (query) {\n return domGlobals.window.matchMedia(query).matches;\n };\n var platform = cached(function () {\n return PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch);\n });\n var detect$3 = function () {\n return platform();\n };\n\n var touchstart = constant('touchstart');\n var touchmove = constant('touchmove');\n var touchend = constant('touchend');\n var mousedown = constant('mousedown');\n var mousemove = constant('mousemove');\n var mouseup = constant('mouseup');\n var mouseover = constant('mouseover');\n var keydown = constant('keydown');\n var keyup = constant('keyup');\n var input = constant('input');\n var change = constant('change');\n var click = constant('click');\n var transitionend = constant('transitionend');\n var selectstart = constant('selectstart');\n\n var alloy = { tap: constant('alloy.tap') };\n var focus = constant('alloy.focus');\n var postBlur = constant('alloy.blur.post');\n var postPaste = constant('alloy.paste.post');\n var receive = constant('alloy.receive');\n var execute = constant('alloy.execute');\n var focusItem = constant('alloy.focus.item');\n var tap = alloy.tap;\n var longpress = constant('alloy.longpress');\n var systemInit = constant('alloy.system.init');\n var attachedToDom = constant('alloy.system.attached');\n var detachedFromDom = constant('alloy.system.detached');\n var focusShifted = constant('alloy.focusmanager.shifted');\n var highlight = constant('alloy.highlight');\n var dehighlight = constant('alloy.dehighlight');\n\n var emit = function (component, event) {\n dispatchWith(component, component.element(), event, {});\n };\n var emitWith = function (component, event, properties) {\n dispatchWith(component, component.element(), event, properties);\n };\n var emitExecute = function (component) {\n emit(component, execute());\n };\n var dispatch = function (component, target, event) {\n dispatchWith(component, target, event, {});\n };\n var dispatchWith = function (component, target, event, properties) {\n var data = __assign({ target: target }, properties);\n component.getSystem().triggerEvent(event, target, map(data, constant));\n };\n var dispatchEvent = function (component, target, event, simulatedEvent) {\n component.getSystem().triggerEvent(event, target, simulatedEvent.event());\n };\n var dispatchFocus = function (component, target) {\n component.getSystem().triggerFocus(target, component.element());\n };\n\n var fromHtml = function (html, scope) {\n var doc = scope || domGlobals.document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n domGlobals.console.error('HTML does not have a single root node', html);\n throw new Error('HTML must have a single root node');\n }\n return fromDom(div.childNodes[0]);\n };\n var fromTag = function (tag, scope) {\n var doc = scope || domGlobals.document;\n var node = doc.createElement(tag);\n return fromDom(node);\n };\n var fromText = function (text, scope) {\n var doc = scope || domGlobals.document;\n var node = doc.createTextNode(text);\n return fromDom(node);\n };\n var fromDom = function (node) {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: constant(node) };\n };\n var fromPoint = function (docElm, x, y) {\n var doc = docElm.dom();\n return Option.from(doc.elementFromPoint(x, y)).map(fromDom);\n };\n var Element = {\n fromHtml: fromHtml,\n fromTag: fromTag,\n fromText: fromText,\n fromDom: fromDom,\n fromPoint: fromPoint\n };\n\n var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();\n\n var DOCUMENT = 9;\n var DOCUMENT_FRAGMENT = 11;\n var ELEMENT = 1;\n var TEXT = 3;\n\n var name = function (element) {\n var r = element.dom().nodeName;\n return r.toLowerCase();\n };\n var type = function (element) {\n return element.dom().nodeType;\n };\n var isType$1 = function (t) {\n return function (element) {\n return type(element) === t;\n };\n };\n var isElement = isType$1(ELEMENT);\n var isText = isType$1(TEXT);\n var isDocument = isType$1(DOCUMENT);\n var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT);\n\n var is = function (element, selector) {\n var dom = element.dom();\n if (dom.nodeType !== ELEMENT) {\n return false;\n } else {\n var elem = dom;\n if (elem.matches !== undefined) {\n return elem.matches(selector);\n } else if (elem.msMatchesSelector !== undefined) {\n return elem.msMatchesSelector(selector);\n } else if (elem.webkitMatchesSelector !== undefined) {\n return elem.webkitMatchesSelector(selector);\n } else if (elem.mozMatchesSelector !== undefined) {\n return elem.mozMatchesSelector(selector);\n } else {\n throw new Error('Browser lacks native selectors');\n }\n }\n };\n var bypassSelector = function (dom) {\n return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;\n };\n var all = function (selector, scope) {\n var base = scope === undefined ? domGlobals.document : scope.dom();\n return bypassSelector(base) ? [] : map$1(base.querySelectorAll(selector), Element.fromDom);\n };\n var one = function (selector, scope) {\n var base = scope === undefined ? domGlobals.document : scope.dom();\n return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.fromDom);\n };\n\n var eq = function (e1, e2) {\n return e1.dom() === e2.dom();\n };\n\n var owner = function (element) {\n return Element.fromDom(element.dom().ownerDocument);\n };\n var documentOrOwner = function (dos) {\n return isDocument(dos) ? dos : owner(dos);\n };\n var defaultView = function (element) {\n return Element.fromDom(element.dom().ownerDocument.defaultView);\n };\n var parent = function (element) {\n return Option.from(element.dom().parentNode).map(Element.fromDom);\n };\n var parents = function (element, isRoot) {\n var stop = isFunction(isRoot) ? isRoot : never;\n var dom = element.dom();\n var ret = [];\n while (dom.parentNode !== null && dom.parentNode !== undefined) {\n var rawParent = dom.parentNode;\n var p = Element.fromDom(rawParent);\n ret.push(p);\n if (stop(p) === true) {\n break;\n } else {\n dom = rawParent;\n }\n }\n return ret;\n };\n var siblings = function (element) {\n var filterSelf = function (elements) {\n return filter$1(elements, function (x) {\n return !eq(element, x);\n });\n };\n return parent(element).map(children).map(filterSelf).getOr([]);\n };\n var nextSibling = function (element) {\n return Option.from(element.dom().nextSibling).map(Element.fromDom);\n };\n var children = function (element) {\n return map$1(element.dom().childNodes, Element.fromDom);\n };\n var child = function (element, index) {\n var cs = element.dom().childNodes;\n return Option.from(cs[index]).map(Element.fromDom);\n };\n var firstChild = function (element) {\n return child(element, 0);\n };\n\n var isShadowRoot = function (dos) {\n return isDocumentFragment(dos);\n };\n var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);\n var isSupported = constant(supported);\n var getRootNode = supported ? function (e) {\n return Element.fromDom(e.dom().getRootNode());\n } : documentOrOwner;\n var getShadowRoot = function (e) {\n var r = getRootNode(e);\n return isShadowRoot(r) ? Option.some(r) : Option.none();\n };\n var getShadowHost = function (e) {\n return Element.fromDom(e.dom().host);\n };\n var getOriginalEventTarget = function (event) {\n if (isSupported() && isNonNullable(event.target)) {\n var el = Element.fromDom(event.target);\n if (isElement(el) && isOpenShadowHost(Element.fromDom(event.target))) {\n var eventAny = event;\n if (eventAny.composed && eventAny.composedPath) {\n var composedPath = eventAny.composedPath();\n if (composedPath) {\n return head(composedPath);\n }\n }\n }\n }\n return Option.from(event.target);\n };\n var isOpenShadowHost = function (element) {\n return isNonNullable(element.dom().shadowRoot);\n };\n\n var inBody = function (element) {\n var dom = isText(element) ? element.dom().parentNode : element.dom();\n if (dom === undefined || dom === null || dom.ownerDocument === null) {\n return false;\n }\n return getShadowRoot(Element.fromDom(dom)).fold(function () {\n return dom.ownerDocument.body.contains(dom);\n }, compose1(inBody, getShadowHost));\n };\n var body = function () {\n return getBody(Element.fromDom(domGlobals.document));\n };\n var getBody = function (doc) {\n var b = doc.dom().body;\n if (b === null || b === undefined) {\n throw new Error('Body is not available yet');\n }\n return Element.fromDom(b);\n };\n\n var before = function (marker, element) {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n v.dom().insertBefore(element.dom(), marker.dom());\n });\n };\n var after = function (marker, element) {\n var sibling = nextSibling(marker);\n sibling.fold(function () {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n append(v, element);\n });\n }, function (v) {\n before(v, element);\n });\n };\n var prepend = function (parent, element) {\n var firstChild$1 = firstChild(parent);\n firstChild$1.fold(function () {\n append(parent, element);\n }, function (v) {\n parent.dom().insertBefore(element.dom(), v.dom());\n });\n };\n var append = function (parent, element) {\n parent.dom().appendChild(element.dom());\n };\n var appendAt = function (parent, element, index) {\n child(parent, index).fold(function () {\n append(parent, element);\n }, function (v) {\n before(v, element);\n });\n };\n\n var append$1 = function (parent, elements) {\n each$1(elements, function (x) {\n append(parent, x);\n });\n };\n\n var empty = function (element) {\n element.dom().textContent = '';\n each$1(children(element), function (rogue) {\n remove(rogue);\n });\n };\n var remove = function (element) {\n var dom = element.dom();\n if (dom.parentNode !== null) {\n dom.parentNode.removeChild(dom);\n }\n };\n\n var fireDetaching = function (component) {\n emit(component, detachedFromDom());\n var children = component.components();\n each$1(children, fireDetaching);\n };\n var fireAttaching = function (component) {\n var children = component.components();\n each$1(children, fireAttaching);\n emit(component, attachedToDom());\n };\n var attach = function (parent, child) {\n append(parent.element(), child.element());\n };\n var detachChildren = function (component) {\n each$1(component.components(), function (childComp) {\n return remove(childComp.element());\n });\n empty(component.element());\n component.syncComponents();\n };\n var replaceChildren = function (component, newChildren) {\n var subs = component.components();\n detachChildren(component);\n var deleted = difference(subs, newChildren);\n each$1(deleted, function (comp) {\n fireDetaching(comp);\n component.getSystem().removeFromWorld(comp);\n });\n each$1(newChildren, function (childComp) {\n if (!childComp.getSystem().isConnected()) {\n component.getSystem().addToWorld(childComp);\n attach(component, childComp);\n if (inBody(component.element())) {\n fireAttaching(childComp);\n }\n } else {\n attach(component, childComp);\n }\n component.syncComponents();\n });\n };\n\n var attach$1 = function (parent, child) {\n attachWith(parent, child, append);\n };\n var attachWith = function (parent, child, insertion) {\n parent.getSystem().addToWorld(child);\n insertion(parent.element(), child.element());\n if (inBody(parent.element())) {\n fireAttaching(child);\n }\n parent.syncComponents();\n };\n var doDetach = function (component) {\n fireDetaching(component);\n remove(component.element());\n component.getSystem().removeFromWorld(component);\n };\n var detach = function (component) {\n var parent$1 = parent(component.element()).bind(function (p) {\n return component.getSystem().getByDom(p).toOption();\n });\n doDetach(component);\n parent$1.each(function (p) {\n p.syncComponents();\n });\n };\n var attachSystemAfter = function (element, guiSystem) {\n attachSystemWith(element, guiSystem, after);\n };\n var attachSystemWith = function (element, guiSystem, inserter) {\n inserter(element, guiSystem.element());\n var children$1 = children(guiSystem.element());\n each$1(children$1, function (child) {\n guiSystem.getByDom(child).each(fireAttaching);\n });\n };\n var detachSystem = function (guiSystem) {\n var children$1 = children(guiSystem.element());\n each$1(children$1, function (child) {\n guiSystem.getByDom(child).each(fireDetaching);\n });\n remove(guiSystem.element());\n };\n\n var value = function (o) {\n var is = function (v) {\n return o === v;\n };\n var or = function (_opt) {\n return value(o);\n };\n var orThunk = function (_f) {\n return value(o);\n };\n var map = function (f) {\n return value(f(o));\n };\n var mapError = function (_f) {\n return value(o);\n };\n var each = function (f) {\n f(o);\n };\n var bind = function (f) {\n return f(o);\n };\n var fold = function (_, onValue) {\n return onValue(o);\n };\n var exists = function (f) {\n return f(o);\n };\n var forall = function (f) {\n return f(o);\n };\n var toOption = function () {\n return Option.some(o);\n };\n return {\n is: is,\n isValue: always,\n isError: never,\n getOr: constant(o),\n getOrThunk: constant(o),\n getOrDie: constant(o),\n or: or,\n orThunk: orThunk,\n fold: fold,\n map: map,\n mapError: mapError,\n each: each,\n bind: bind,\n exists: exists,\n forall: forall,\n toOption: toOption\n };\n };\n var error = function (message) {\n var getOrThunk = function (f) {\n return f();\n };\n var getOrDie = function () {\n return die(String(message))();\n };\n var or = function (opt) {\n return opt;\n };\n var orThunk = function (f) {\n return f();\n };\n var map = function (_f) {\n return error(message);\n };\n var mapError = function (f) {\n return error(f(message));\n };\n var bind = function (_f) {\n return error(message);\n };\n var fold = function (onError, _) {\n return onError(message);\n };\n return {\n is: never,\n isValue: never,\n isError: always,\n getOr: identity,\n getOrThunk: getOrThunk,\n getOrDie: getOrDie,\n or: or,\n orThunk: orThunk,\n fold: fold,\n map: map,\n mapError: mapError,\n each: noop,\n bind: bind,\n exists: never,\n forall: always,\n toOption: Option.none\n };\n };\n var fromOption = function (opt, err) {\n return opt.fold(function () {\n return error(err);\n }, value);\n };\n var Result = {\n value: value,\n error: error,\n fromOption: fromOption\n };\n\n var SimpleResultType;\n (function (SimpleResultType) {\n SimpleResultType[SimpleResultType['Error'] = 0] = 'Error';\n SimpleResultType[SimpleResultType['Value'] = 1] = 'Value';\n }(SimpleResultType || (SimpleResultType = {})));\n var fold = function (res, onError, onValue) {\n return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue);\n };\n var partition = function (results) {\n var values = [];\n var errors = [];\n each$1(results, function (obj) {\n fold(obj, function (err) {\n return errors.push(err);\n }, function (val) {\n return values.push(val);\n });\n });\n return {\n values: values,\n errors: errors\n };\n };\n var mapError = function (res, f) {\n if (res.stype === SimpleResultType.Error) {\n return {\n stype: SimpleResultType.Error,\n serror: f(res.serror)\n };\n } else {\n return res;\n }\n };\n var map$2 = function (res, f) {\n if (res.stype === SimpleResultType.Value) {\n return {\n stype: SimpleResultType.Value,\n svalue: f(res.svalue)\n };\n } else {\n return res;\n }\n };\n var bind$1 = function (res, f) {\n if (res.stype === SimpleResultType.Value) {\n return f(res.svalue);\n } else {\n return res;\n }\n };\n var bindError = function (res, f) {\n if (res.stype === SimpleResultType.Error) {\n return f(res.serror);\n } else {\n return res;\n }\n };\n var svalue = function (v) {\n return {\n stype: SimpleResultType.Value,\n svalue: v\n };\n };\n var serror = function (e) {\n return {\n stype: SimpleResultType.Error,\n serror: e\n };\n };\n var toResult = function (res) {\n return fold(res, Result.error, Result.value);\n };\n var fromResult = function (res) {\n return res.fold(serror, svalue);\n };\n var SimpleResult = {\n fromResult: fromResult,\n toResult: toResult,\n svalue: svalue,\n partition: partition,\n serror: serror,\n bind: bind$1,\n bindError: bindError,\n map: map$2,\n mapError: mapError,\n fold: fold\n };\n\n var generate = function (cases) {\n if (!isArray(cases)) {\n throw new Error('cases must be an array');\n }\n if (cases.length === 0) {\n throw new Error('there must be at least one case');\n }\n var constructors = [];\n var adt = {};\n each$1(cases, function (acase, count) {\n var keys$1 = keys(acase);\n if (keys$1.length !== 1) {\n throw new Error('one and only one name per case');\n }\n var key = keys$1[0];\n var value = acase[key];\n if (adt[key] !== undefined) {\n throw new Error('duplicate key detected:' + key);\n } else if (key === 'cata') {\n throw new Error('cannot have a case named cata (sorry)');\n } else if (!isArray(value)) {\n throw new Error('case arguments must be an array');\n }\n constructors.push(key);\n adt[key] = function () {\n var argLength = arguments.length;\n if (argLength !== value.length) {\n throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);\n }\n var args = new Array(argLength);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n var match = function (branches) {\n var branchKeys = keys(branches);\n if (constructors.length !== branchKeys.length) {\n throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\\nActual: ' + branchKeys.join(','));\n }\n var allReqd = forall(constructors, function (reqKey) {\n return contains(branchKeys, reqKey);\n });\n if (!allReqd) {\n throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\\nRequired: ' + constructors.join(', '));\n }\n return branches[key].apply(null, args);\n };\n return {\n fold: function () {\n if (arguments.length !== cases.length) {\n throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length);\n }\n var target = arguments[count];\n return target.apply(null, args);\n },\n match: match,\n log: function (label) {\n domGlobals.console.log(label, {\n constructors: constructors,\n constructor: key,\n params: args\n });\n }\n };\n };\n });\n return adt;\n };\n var Adt = { generate: generate };\n\n var hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n var shallow = function (old, nu) {\n return nu;\n };\n var deep = function (old, nu) {\n var bothObjects = isObject(old) && isObject(nu);\n return bothObjects ? deepMerge(old, nu) : nu;\n };\n var baseMerge = function (merger) {\n return function () {\n var objects = new Array(arguments.length);\n for (var i = 0; i < objects.length; i++) {\n objects[i] = arguments[i];\n }\n if (objects.length === 0) {\n throw new Error('Can\\'t merge zero objects');\n }\n var ret = {};\n for (var j = 0; j < objects.length; j++) {\n var curObject = objects[j];\n for (var key in curObject) {\n if (hasOwnProperty$1.call(curObject, key)) {\n ret[key] = merger(ret[key], curObject[key]);\n }\n }\n }\n return ret;\n };\n };\n var deepMerge = baseMerge(deep);\n var merge = baseMerge(shallow);\n\n var adt = Adt.generate([\n { strict: [] },\n { defaultedThunk: ['fallbackThunk'] },\n { asOption: [] },\n { asDefaultedOptionThunk: ['fallbackThunk'] },\n { mergeWithThunk: ['baseThunk'] }\n ]);\n var defaulted = function (fallback) {\n return adt.defaultedThunk(constant(fallback));\n };\n var mergeWith = function (base) {\n return adt.mergeWithThunk(constant(base));\n };\n var strict = adt.strict;\n var asOption = adt.asOption;\n var defaultedThunk = adt.defaultedThunk;\n var asDefaultedOptionThunk = adt.asDefaultedOptionThunk;\n var mergeWithThunk = adt.mergeWithThunk;\n\n var exclude = function (obj, fields) {\n var r = {};\n each(obj, function (v, k) {\n if (!contains(fields, k)) {\n r[k] = v;\n }\n });\n return r;\n };\n\n var wrap = function (key, value) {\n var _a;\n return _a = {}, _a[key] = value, _a;\n };\n var wrapAll = function (keyvalues) {\n var r = {};\n each$1(keyvalues, function (kv) {\n r[kv.key] = kv.value;\n });\n return r;\n };\n\n var comparison = Adt.generate([\n {\n bothErrors: [\n 'error1',\n 'error2'\n ]\n },\n {\n firstError: [\n 'error1',\n 'value2'\n ]\n },\n {\n secondError: [\n 'value1',\n 'error2'\n ]\n },\n {\n bothValues: [\n 'value1',\n 'value2'\n ]\n }\n ]);\n var partition$1 = function (results) {\n var errors = [];\n var values = [];\n each$1(results, function (result) {\n result.fold(function (err) {\n errors.push(err);\n }, function (value) {\n values.push(value);\n });\n });\n return {\n errors: errors,\n values: values\n };\n };\n\n var exclude$1 = function (obj, fields) {\n return exclude(obj, fields);\n };\n var wrap$1 = function (key, value) {\n return wrap(key, value);\n };\n var wrapAll$1 = function (keyvalues) {\n return wrapAll(keyvalues);\n };\n var mergeValues = function (values, base) {\n return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values)));\n };\n var mergeErrors = function (errors) {\n return Result.error(flatten(errors));\n };\n var consolidate = function (objs, base) {\n var partitions = partition$1(objs);\n return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base);\n };\n\n var mergeValues$1 = function (values, base) {\n return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base);\n };\n var mergeErrors$1 = function (errors) {\n return compose(SimpleResult.serror, flatten)(errors);\n };\n var consolidateObj = function (objects, base) {\n var partition = SimpleResult.partition(objects);\n return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base);\n };\n var consolidateArr = function (objects) {\n var partitions = SimpleResult.partition(objects);\n return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values);\n };\n var ResultCombine = {\n consolidateObj: consolidateObj,\n consolidateArr: consolidateArr\n };\n\n var formatObj = function (input) {\n return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2);\n };\n var formatErrors = function (errors) {\n var es = errors.length > 10 ? errors.slice(0, 10).concat([{\n path: [],\n getErrorInfo: function () {\n return '... (only showing first ten failures)';\n }\n }]) : errors;\n return map$1(es, function (e) {\n return 'Failed path: (' + e.path.join(' > ') + ')\\n' + e.getErrorInfo();\n });\n };\n\n var nu$3 = function (path, getErrorInfo) {\n return SimpleResult.serror([{\n path: path,\n getErrorInfo: getErrorInfo\n }]);\n };\n var missingStrict = function (path, key, obj) {\n return nu$3(path, function () {\n return 'Could not find valid *strict* value for \"' + key + '\" in ' + formatObj(obj);\n });\n };\n var missingKey = function (path, key) {\n return nu$3(path, function () {\n return 'Choice schema did not contain choice key: \"' + key + '\"';\n });\n };\n var missingBranch = function (path, branches, branch) {\n return nu$3(path, function () {\n return 'The chosen schema: \"' + branch + '\" did not exist in branches: ' + formatObj(branches);\n });\n };\n var unsupportedFields = function (path, unsupported) {\n return nu$3(path, function () {\n return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified';\n });\n };\n var custom = function (path, err) {\n return nu$3(path, function () {\n return err;\n });\n };\n\n var adt$1 = Adt.generate([\n {\n field: [\n 'key',\n 'okey',\n 'presence',\n 'prop'\n ]\n },\n {\n state: [\n 'okey',\n 'instantiator'\n ]\n }\n ]);\n var strictAccess = function (path, obj, key) {\n return get(obj, key).fold(function () {\n return missingStrict(path, key, obj);\n }, SimpleResult.svalue);\n };\n var fallbackAccess = function (obj, key, fallbackThunk) {\n var v = get(obj, key).fold(function () {\n return fallbackThunk(obj);\n }, identity);\n return SimpleResult.svalue(v);\n };\n var optionAccess = function (obj, key) {\n return SimpleResult.svalue(get(obj, key));\n };\n var optionDefaultedAccess = function (obj, key, fallback) {\n var opt = get(obj, key).map(function (val) {\n return val === true ? fallback(obj) : val;\n });\n return SimpleResult.svalue(opt);\n };\n var cExtractOne = function (path, obj, field, strength) {\n return field.fold(function (key, okey, presence, prop) {\n var bundle = function (av) {\n var result = prop.extract(path.concat([key]), strength, av);\n return SimpleResult.map(result, function (res) {\n return wrap(okey, strength(res));\n });\n };\n var bundleAsOption = function (optValue) {\n return optValue.fold(function () {\n var outcome = wrap(okey, strength(Option.none()));\n return SimpleResult.svalue(outcome);\n }, function (ov) {\n var result = prop.extract(path.concat([key]), strength, ov);\n return SimpleResult.map(result, function (res) {\n return wrap(okey, strength(Option.some(res)));\n });\n });\n };\n return function () {\n return presence.fold(function () {\n return SimpleResult.bind(strictAccess(path, obj, key), bundle);\n }, function (fallbackThunk) {\n return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle);\n }, function () {\n return SimpleResult.bind(optionAccess(obj, key), bundleAsOption);\n }, function (fallbackThunk) {\n return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption);\n }, function (baseThunk) {\n var base = baseThunk(obj);\n var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) {\n return deepMerge(base, v);\n });\n return SimpleResult.bind(result, bundle);\n });\n }();\n }, function (okey, instantiator) {\n var state = instantiator(obj);\n return SimpleResult.svalue(wrap(okey, strength(state)));\n });\n };\n var cExtract = function (path, obj, fields, strength) {\n var results = map$1(fields, function (field) {\n return cExtractOne(path, obj, field, strength);\n });\n return ResultCombine.consolidateObj(results, {});\n };\n var value$1 = function (validator) {\n var extract = function (path, strength, val) {\n return SimpleResult.bindError(validator(val, strength), function (err) {\n return custom(path, err);\n });\n };\n var toString = function () {\n return 'val';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var getSetKeys = function (obj) {\n return keys(filter(obj, function (value) {\n return value !== undefined && value !== null;\n }));\n };\n var objOfOnly = function (fields) {\n var delegate = objOf(fields);\n var fieldNames = foldr(fields, function (acc, f) {\n return f.fold(function (key) {\n return deepMerge(acc, wrap$1(key, true));\n }, constant(acc));\n }, {});\n var extract = function (path, strength, o) {\n var keys = isBoolean(o) ? [] : getSetKeys(o);\n var extra = filter$1(keys, function (k) {\n return !hasNonNullableKey(fieldNames, k);\n });\n return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra);\n };\n return {\n extract: extract,\n toString: delegate.toString\n };\n };\n var objOf = function (fields) {\n var extract = function (path, strength, o) {\n return cExtract(path, o, fields, strength);\n };\n var toString = function () {\n var fieldStrings = map$1(fields, function (field) {\n return field.fold(function (key, okey, presence, prop) {\n return key + ' -> ' + prop.toString();\n }, function (okey, _instantiator) {\n return 'state(' + okey + ')';\n });\n });\n return 'obj{\\n' + fieldStrings.join('\\n') + '}';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var arrOf = function (prop) {\n var extract = function (path, strength, array) {\n var results = map$1(array, function (a, i) {\n return prop.extract(path.concat(['[' + i + ']']), strength, a);\n });\n return ResultCombine.consolidateArr(results);\n };\n var toString = function () {\n return 'array(' + prop.toString() + ')';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var setOf = function (validator, prop) {\n var validateKeys = function (path, keys) {\n return arrOf(value$1(validator)).extract(path, identity, keys);\n };\n var extract = function (path, strength, o) {\n var keys$1 = keys(o);\n var validatedKeys = validateKeys(path, keys$1);\n return SimpleResult.bind(validatedKeys, function (validKeys) {\n var schema = map$1(validKeys, function (vk) {\n return adt$1.field(vk, vk, strict(), prop);\n });\n return objOf(schema).extract(path, strength, o);\n });\n };\n var toString = function () {\n return 'setOf(' + prop.toString() + ')';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var anyValue = constant(value$1(SimpleResult.svalue));\n var state = adt$1.state;\n var field = adt$1.field;\n\n var chooseFrom = function (path, strength, input, branches, ch) {\n var fields = get(branches, ch);\n return fields.fold(function () {\n return missingBranch(path, branches, ch);\n }, function (vp) {\n return vp.extract(path.concat(['branch: ' + ch]), strength, input);\n });\n };\n var choose = function (key, branches) {\n var extract = function (path, strength, input) {\n var choice = get(input, key);\n return choice.fold(function () {\n return missingKey(path, key);\n }, function (chosen) {\n return chooseFrom(path, strength, input, branches, chosen);\n });\n };\n var toString = function () {\n return 'chooseOn(' + key + '). Possible values: ' + keys(branches);\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n\n var _anyValue = value$1(SimpleResult.svalue);\n var valueOf = function (validator) {\n return value$1(function (v) {\n return validator(v).fold(SimpleResult.serror, SimpleResult.svalue);\n });\n };\n var setOf$1 = function (validator, prop) {\n return setOf(function (v) {\n return SimpleResult.fromResult(validator(v));\n }, prop);\n };\n var extract = function (label, prop, strength, obj) {\n var res = prop.extract([label], strength, obj);\n return SimpleResult.mapError(res, function (errs) {\n return {\n input: obj,\n errors: errs\n };\n });\n };\n var asRaw = function (label, prop, obj) {\n return SimpleResult.toResult(extract(label, prop, identity, obj));\n };\n var getOrDie = function (extraction) {\n return extraction.fold(function (errInfo) {\n throw new Error(formatError(errInfo));\n }, identity);\n };\n var asRawOrDie = function (label, prop, obj) {\n return getOrDie(asRaw(label, prop, obj));\n };\n var formatError = function (errInfo) {\n return 'Errors: \\n' + formatErrors(errInfo.errors).join('\\n') + '\\n\\nInput object: ' + formatObj(errInfo.input);\n };\n var choose$1 = function (key, branches) {\n return choose(key, map(branches, objOf));\n };\n var anyValue$1 = constant(_anyValue);\n var typedValue = function (validator, expectedType) {\n return value$1(function (a) {\n var actualType = typeof a;\n return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType);\n });\n };\n var functionProcessor = typedValue(isFunction, 'function');\n\n var strict$1 = function (key) {\n return field(key, key, strict(), anyValue());\n };\n var strictOf = function (key, schema) {\n return field(key, key, strict(), schema);\n };\n var strictFunction = function (key) {\n return strictOf(key, functionProcessor);\n };\n var forbid = function (key, message) {\n return field(key, key, asOption(), value$1(function (_v) {\n return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message);\n }));\n };\n var strictObjOf = function (key, objSchema) {\n return field(key, key, strict(), objOf(objSchema));\n };\n var option = function (key) {\n return field(key, key, asOption(), anyValue());\n };\n var optionOf = function (key, schema) {\n return field(key, key, asOption(), schema);\n };\n var optionObjOf = function (key, objSchema) {\n return optionOf(key, objOf(objSchema));\n };\n var optionObjOfOnly = function (key, objSchema) {\n return optionOf(key, objOfOnly(objSchema));\n };\n var defaulted$1 = function (key, fallback) {\n return field(key, key, defaulted(fallback), anyValue());\n };\n var defaultedOf = function (key, fallback, schema) {\n return field(key, key, defaulted(fallback), schema);\n };\n var defaultedFunction = function (key, fallback) {\n return defaultedOf(key, fallback, functionProcessor);\n };\n var defaultedObjOf = function (key, fallback, objSchema) {\n return defaultedOf(key, fallback, objOf(objSchema));\n };\n var state$1 = function (okey, instantiator) {\n return state(okey, instantiator);\n };\n\n var ensureIsRoot = function (isRoot) {\n return isFunction(isRoot) ? isRoot : constant(false);\n };\n var ancestor = function (scope, transform, isRoot) {\n var element = scope.dom();\n var stop = ensureIsRoot(isRoot);\n while (element.parentNode) {\n element = element.parentNode;\n var el = Element.fromDom(element);\n var transformed = transform(el);\n if (transformed.isSome()) {\n return transformed;\n } else if (stop(el)) {\n break;\n }\n }\n return Option.none();\n };\n var closest = function (scope, transform, isRoot) {\n var current = transform(scope);\n var stop = ensureIsRoot(isRoot);\n return current.orThunk(function () {\n return stop(scope) ? Option.none() : ancestor(scope, transform, stop);\n });\n };\n\n var isSource = function (component, simulatedEvent) {\n return eq(component.element(), simulatedEvent.event().target());\n };\n\n var nu$4 = function (parts) {\n if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) {\n throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!');\n }\n return asRawOrDie('Extracting event.handler', objOfOnly([\n defaulted$1('can', constant(true)),\n defaulted$1('abort', constant(false)),\n defaulted$1('run', noop)\n ]), parts);\n };\n var all$1 = function (handlers, f) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return foldl(handlers, function (acc, handler) {\n return acc && f(handler).apply(undefined, args);\n }, true);\n };\n };\n var any = function (handlers, f) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return foldl(handlers, function (acc, handler) {\n return acc || f(handler).apply(undefined, args);\n }, false);\n };\n };\n var read = function (handler) {\n return isFunction(handler) ? {\n can: constant(true),\n abort: constant(false),\n run: handler\n } : handler;\n };\n var fuse = function (handlers) {\n var can = all$1(handlers, function (handler) {\n return handler.can;\n });\n var abort = any(handlers, function (handler) {\n return handler.abort;\n });\n var run = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n each$1(handlers, function (handler) {\n handler.run.apply(undefined, args);\n });\n };\n return nu$4({\n can: can,\n abort: abort,\n run: run\n });\n };\n\n var derive = function (configs) {\n return wrapAll$1(configs);\n };\n var abort = function (name, predicate) {\n return {\n key: name,\n value: nu$4({ abort: predicate })\n };\n };\n var can = function (name, predicate) {\n return {\n key: name,\n value: nu$4({ can: predicate })\n };\n };\n var run = function (name, handler) {\n return {\n key: name,\n value: nu$4({ run: handler })\n };\n };\n var runActionExtra = function (name, action, extra) {\n return {\n key: name,\n value: nu$4({\n run: function (component, simulatedEvent) {\n action.apply(undefined, [\n component,\n simulatedEvent\n ].concat(extra));\n }\n })\n };\n };\n var runOnName = function (name) {\n return function (handler) {\n return run(name, handler);\n };\n };\n var runOnSourceName = function (name) {\n return function (handler) {\n return {\n key: name,\n value: nu$4({\n run: function (component, simulatedEvent) {\n if (isSource(component, simulatedEvent)) {\n handler(component, simulatedEvent);\n }\n }\n })\n };\n };\n };\n var redirectToUid = function (name, uid) {\n return run(name, function (component, simulatedEvent) {\n component.getSystem().getByUid(uid).each(function (redirectee) {\n dispatchEvent(redirectee, redirectee.element(), name, simulatedEvent);\n });\n });\n };\n var redirectToPart = function (name, detail, partName) {\n var uid = detail.partUids[partName];\n return redirectToUid(name, uid);\n };\n var cutter = function (name) {\n return run(name, function (component, simulatedEvent) {\n simulatedEvent.cut();\n });\n };\n var stopper = function (name) {\n return run(name, function (component, simulatedEvent) {\n simulatedEvent.stop();\n });\n };\n var runOnSource = function (name, f) {\n return runOnSourceName(name)(f);\n };\n var runOnAttached = runOnSourceName(attachedToDom());\n var runOnDetached = runOnSourceName(detachedFromDom());\n var runOnInit = runOnSourceName(systemInit());\n var runOnExecute = runOnName(execute());\n\n var markAsBehaviourApi = function (f, apiName, apiFunction) {\n var delegate = apiFunction.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: apiName,\n parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3)))\n };\n };\n return f;\n };\n var cleanParameters = function (parameters) {\n return map$1(parameters, function (p) {\n return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p;\n });\n };\n var markAsExtraApi = function (f, extraName) {\n var delegate = f.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: extraName,\n parameters: cleanParameters(parameters)\n };\n };\n return f;\n };\n var markAsSketchApi = function (f, apiFunction) {\n var delegate = apiFunction.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: 'OVERRIDE',\n parameters: cleanParameters(parameters.slice(1))\n };\n };\n return f;\n };\n\n var nu$5 = function (s) {\n return {\n classes: s.classes !== undefined ? s.classes : [],\n attributes: s.attributes !== undefined ? s.attributes : {},\n styles: s.styles !== undefined ? s.styles : {}\n };\n };\n var merge$1 = function (defnA, mod) {\n return __assign(__assign({}, defnA), {\n attributes: __assign(__assign({}, defnA.attributes), mod.attributes),\n styles: __assign(__assign({}, defnA.styles), mod.styles),\n classes: defnA.classes.concat(mod.classes)\n });\n };\n\n var executeEvent = function (bConfig, bState, executor) {\n return runOnExecute(function (component) {\n executor(component, bConfig, bState);\n });\n };\n var loadEvent = function (bConfig, bState, f) {\n return runOnInit(function (component, _simulatedEvent) {\n f(component, bConfig, bState);\n });\n };\n var create = function (schema, name, active, apis, extra, state) {\n var configSchema = objOfOnly(schema);\n var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]);\n return doCreate(configSchema, schemaSchema, name, active, apis, extra, state);\n };\n var createModes = function (modes, name, active, apis, extra, state) {\n var configSchema = modes;\n var schemaSchema = optionObjOf(name, [optionOf('config', modes)]);\n return doCreate(configSchema, schemaSchema, name, active, apis, extra, state);\n };\n var wrapApi = function (bName, apiFunction, apiName) {\n var f = function (component) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var args = [component].concat(rest);\n return component.config({ name: constant(bName) }).fold(function () {\n throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName);\n }, function (info) {\n var rest = Array.prototype.slice.call(args, 1);\n return apiFunction.apply(undefined, [\n component,\n info.config,\n info.state\n ].concat(rest));\n });\n };\n return markAsBehaviourApi(f, apiName, apiFunction);\n };\n var revokeBehaviour = function (name) {\n return {\n key: name,\n value: undefined\n };\n };\n var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) {\n var getConfig = function (info) {\n return hasNonNullableKey(info, name) ? info[name]() : Option.none();\n };\n var wrappedApis = map(apis, function (apiF, apiName) {\n return wrapApi(name, apiF, apiName);\n });\n var wrappedExtra = map(extra, function (extraF, extraName) {\n return markAsExtraApi(extraF, extraName);\n });\n var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), {\n revoke: curry(revokeBehaviour, name),\n config: function (spec) {\n var prepared = asRawOrDie(name + '-config', configSchema, spec);\n return {\n key: name,\n value: {\n config: prepared,\n me: me,\n configAsRaw: cached(function () {\n return asRawOrDie(name + '-config', configSchema, spec);\n }),\n initialConfig: spec,\n state: state\n }\n };\n },\n schema: function () {\n return schemaSchema;\n },\n exhibit: function (info, base) {\n return getConfig(info).bind(function (behaviourInfo) {\n return get(active, 'exhibit').map(function (exhibitor) {\n return exhibitor(base, behaviourInfo.config, behaviourInfo.state);\n });\n }).getOr(nu$5({}));\n },\n name: function () {\n return name;\n },\n handlers: function (info) {\n return getConfig(info).map(function (behaviourInfo) {\n var getEvents = get(active, 'events').getOr(function () {\n return {};\n });\n return getEvents(behaviourInfo.config, behaviourInfo.state);\n }).getOr({});\n }\n });\n return me;\n };\n\n var NoState = {\n init: function () {\n return nu$6({\n readState: function () {\n return 'No State required';\n }\n });\n }\n };\n var nu$6 = function (spec) {\n return spec;\n };\n\n var derive$1 = function (capabilities) {\n return wrapAll$1(capabilities);\n };\n var simpleSchema = objOfOnly([\n strict$1('fields'),\n strict$1('name'),\n defaulted$1('active', {}),\n defaulted$1('apis', {}),\n defaulted$1('state', NoState),\n defaulted$1('extra', {})\n ]);\n var create$1 = function (data) {\n var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data);\n return create(value.fields, value.name, value.active, value.apis, value.extra, value.state);\n };\n var modeSchema = objOfOnly([\n strict$1('branchKey'),\n strict$1('branches'),\n strict$1('name'),\n defaulted$1('active', {}),\n defaulted$1('apis', {}),\n defaulted$1('state', NoState),\n defaulted$1('extra', {})\n ]);\n var createModes$1 = function (data) {\n var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data);\n return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state);\n };\n var revoke = constant(undefined);\n\n var rawSet = function (dom, key, value) {\n if (isString(value) || isBoolean(value) || isNumber(value)) {\n dom.setAttribute(key, value + '');\n } else {\n domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom);\n throw new Error('Attribute value was not simple');\n }\n };\n var set = function (element, key, value) {\n rawSet(element.dom(), key, value);\n };\n var setAll = function (element, attrs) {\n var dom = element.dom();\n each(attrs, function (v, k) {\n rawSet(dom, k, v);\n });\n };\n var get$1 = function (element, key) {\n var v = element.dom().getAttribute(key);\n return v === null ? undefined : v;\n };\n var getOpt = function (element, key) {\n return Option.from(get$1(element, key));\n };\n var has$1 = function (element, key) {\n var dom = element.dom();\n return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;\n };\n var remove$1 = function (element, key) {\n element.dom().removeAttribute(key);\n };\n\n var read$1 = function (element, attr) {\n var value = get$1(element, attr);\n return value === undefined || value === '' ? [] : value.split(' ');\n };\n var add = function (element, attr, id) {\n var old = read$1(element, attr);\n var nu = old.concat([id]);\n set(element, attr, nu.join(' '));\n return true;\n };\n var remove$2 = function (element, attr, id) {\n var nu = filter$1(read$1(element, attr), function (v) {\n return v !== id;\n });\n if (nu.length > 0) {\n set(element, attr, nu.join(' '));\n } else {\n remove$1(element, attr);\n }\n return false;\n };\n\n var supports = function (element) {\n return element.dom().classList !== undefined;\n };\n var get$2 = function (element) {\n return read$1(element, 'class');\n };\n var add$1 = function (element, clazz) {\n return add(element, 'class', clazz);\n };\n var remove$3 = function (element, clazz) {\n return remove$2(element, 'class', clazz);\n };\n\n var add$2 = function (element, clazz) {\n if (supports(element)) {\n element.dom().classList.add(clazz);\n } else {\n add$1(element, clazz);\n }\n };\n var cleanClass = function (element) {\n var classList = supports(element) ? element.dom().classList : get$2(element);\n if (classList.length === 0) {\n remove$1(element, 'class');\n }\n };\n var remove$4 = function (element, clazz) {\n if (supports(element)) {\n var classList = element.dom().classList;\n classList.remove(clazz);\n } else {\n remove$3(element, clazz);\n }\n cleanClass(element);\n };\n var has$2 = function (element, clazz) {\n return supports(element) && element.dom().classList.contains(clazz);\n };\n\n var swap = function (element, addCls, removeCls) {\n remove$4(element, removeCls);\n add$2(element, addCls);\n };\n var toAlpha = function (component, swapConfig, _swapState) {\n swap(component.element(), swapConfig.alpha, swapConfig.omega);\n };\n var toOmega = function (component, swapConfig, _swapState) {\n swap(component.element(), swapConfig.omega, swapConfig.alpha);\n };\n var clear = function (component, swapConfig, _swapState) {\n remove$4(component.element(), swapConfig.alpha);\n remove$4(component.element(), swapConfig.omega);\n };\n var isAlpha = function (component, swapConfig, _swapState) {\n return has$2(component.element(), swapConfig.alpha);\n };\n var isOmega = function (component, swapConfig, _swapState) {\n return has$2(component.element(), swapConfig.omega);\n };\n\n var SwapApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n toAlpha: toAlpha,\n toOmega: toOmega,\n isAlpha: isAlpha,\n isOmega: isOmega,\n clear: clear\n });\n\n var SwapSchema = [\n strict$1('alpha'),\n strict$1('omega')\n ];\n\n var Swapping = create$1({\n fields: SwapSchema,\n name: 'swapping',\n apis: SwapApis\n });\n\n var Cell = function (initial) {\n var value = initial;\n var get = function () {\n return value;\n };\n var set = function (v) {\n value = v;\n };\n return {\n get: get,\n set: set\n };\n };\n\n var getDocument = function () {\n return Element.fromDom(domGlobals.document);\n };\n\n var focus$1 = function (element) {\n return element.dom().focus();\n };\n var blur = function (element) {\n return element.dom().blur();\n };\n var hasFocus = function (element) {\n var root = getRootNode(element).dom();\n return element.dom() === root.activeElement;\n };\n var active = function (root) {\n if (root === void 0) {\n root = getDocument();\n }\n return Option.from(root.dom().activeElement).map(Element.fromDom);\n };\n var search = function (element) {\n return active(getRootNode(element)).filter(function (e) {\n return element.dom().contains(e.dom());\n });\n };\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.ThemeManager');\n\n var openLink = function (target) {\n var link = domGlobals.document.createElement('a');\n link.target = '_blank';\n link.href = target.href;\n link.rel = 'noreferrer noopener';\n var nuEvt = domGlobals.document.createEvent('MouseEvents');\n nuEvt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n domGlobals.document.body.appendChild(link);\n link.dispatchEvent(nuEvt);\n domGlobals.document.body.removeChild(link);\n };\n\n var DefaultStyleFormats = [\n {\n title: 'Headings',\n items: [\n {\n title: 'Heading 1',\n format: 'h1'\n },\n {\n title: 'Heading 2',\n format: 'h2'\n },\n {\n title: 'Heading 3',\n format: 'h3'\n },\n {\n title: 'Heading 4',\n format: 'h4'\n },\n {\n title: 'Heading 5',\n format: 'h5'\n },\n {\n title: 'Heading 6',\n format: 'h6'\n }\n ]\n },\n {\n title: 'Inline',\n items: [\n {\n title: 'Bold',\n icon: 'bold',\n format: 'bold'\n },\n {\n title: 'Italic',\n icon: 'italic',\n format: 'italic'\n },\n {\n title: 'Underline',\n icon: 'underline',\n format: 'underline'\n },\n {\n title: 'Strikethrough',\n icon: 'strikethrough',\n format: 'strikethrough'\n },\n {\n title: 'Superscript',\n icon: 'superscript',\n format: 'superscript'\n },\n {\n title: 'Subscript',\n icon: 'subscript',\n format: 'subscript'\n },\n {\n title: 'Code',\n icon: 'code',\n format: 'code'\n }\n ]\n },\n {\n title: 'Blocks',\n items: [\n {\n title: 'Paragraph',\n format: 'p'\n },\n {\n title: 'Blockquote',\n format: 'blockquote'\n },\n {\n title: 'Div',\n format: 'div'\n },\n {\n title: 'Pre',\n format: 'pre'\n }\n ]\n },\n {\n title: 'Alignment',\n items: [\n {\n title: 'Left',\n icon: 'alignleft',\n format: 'alignleft'\n },\n {\n title: 'Center',\n icon: 'aligncenter',\n format: 'aligncenter'\n },\n {\n title: 'Right',\n icon: 'alignright',\n format: 'alignright'\n },\n {\n title: 'Justify',\n icon: 'alignjustify',\n format: 'alignjustify'\n }\n ]\n }\n ];\n\n var defaults = [\n 'undo',\n 'bold',\n 'italic',\n 'link',\n 'image',\n 'bullist',\n 'styleselect'\n ];\n var isSkinDisabled = function (editor) {\n return editor.getParam('skin') === false;\n };\n var readOnlyOnInit = function (_editor) {\n return false;\n };\n var getToolbar = function (editor) {\n return editor.getParam('toolbar', defaults, 'array');\n };\n var getStyleFormats = function (editor) {\n return editor.getParam('style_formats', DefaultStyleFormats, 'array');\n };\n var getSkinUrl = function (editor) {\n return editor.getParam('skin_url');\n };\n\n var formatChanged = 'formatChanged';\n var orientationChanged = 'orientationChanged';\n var dropupDismissed = 'dropupDismissed';\n\n var fromHtml$1 = function (html, scope) {\n var doc = scope || domGlobals.document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n return children(Element.fromDom(div));\n };\n\n var get$3 = function (element) {\n return element.dom().innerHTML;\n };\n var set$1 = function (element, content) {\n var owner$1 = owner(element);\n var docDom = owner$1.dom();\n var fragment = Element.fromDom(docDom.createDocumentFragment());\n var contentElements = fromHtml$1(content, docDom);\n append$1(fragment, contentElements);\n empty(element);\n append(element, fragment);\n };\n var getOuter = function (element) {\n var container = Element.fromTag('div');\n var clone = Element.fromDom(element.dom().cloneNode(true));\n append(container, clone);\n return get$3(container);\n };\n\n var clone = function (original, isDeep) {\n return Element.fromDom(original.dom().cloneNode(isDeep));\n };\n var shallow$1 = function (original) {\n return clone(original, false);\n };\n\n var getHtml = function (element) {\n var clone = shallow$1(element);\n return getOuter(clone);\n };\n\n var element = function (elem) {\n return getHtml(elem);\n };\n\n var chooseChannels = function (channels, message) {\n return message.universal() ? channels : filter$1(channels, function (ch) {\n return contains(message.channels(), ch);\n });\n };\n var events = function (receiveConfig) {\n return derive([run(receive(), function (component, message) {\n var channelMap = receiveConfig.channels;\n var channels = keys(channelMap);\n var receivingData = message;\n var targetChannels = chooseChannels(channels, receivingData);\n each$1(targetChannels, function (ch) {\n var channelInfo = channelMap[ch];\n var channelSchema = channelInfo.schema;\n var data = asRawOrDie('channel[' + ch + '] data\\nReceiver: ' + element(component.element()), channelSchema, receivingData.data());\n channelInfo.onReceive(component, data);\n });\n })]);\n };\n\n var ActiveReceiving = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events\n });\n\n var unknown$3 = 'unknown';\n var EventConfiguration;\n (function (EventConfiguration) {\n EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP';\n EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL';\n EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING';\n }(EventConfiguration || (EventConfiguration = {})));\n var eventConfig = Cell({});\n var makeEventLogger = function (eventName, initialTarget) {\n var sequence = [];\n var startTime = new Date().getTime();\n return {\n logEventCut: function (_name, target, purpose) {\n sequence.push({\n outcome: 'cut',\n target: target,\n purpose: purpose\n });\n },\n logEventStopped: function (_name, target, purpose) {\n sequence.push({\n outcome: 'stopped',\n target: target,\n purpose: purpose\n });\n },\n logNoParent: function (_name, target, purpose) {\n sequence.push({\n outcome: 'no-parent',\n target: target,\n purpose: purpose\n });\n },\n logEventNoHandlers: function (_name, target) {\n sequence.push({\n outcome: 'no-handlers-left',\n target: target\n });\n },\n logEventResponse: function (_name, target, purpose) {\n sequence.push({\n outcome: 'response',\n purpose: purpose,\n target: target\n });\n },\n write: function () {\n var finishTime = new Date().getTime();\n if (contains([\n 'mousemove',\n 'mouseover',\n 'mouseout',\n systemInit()\n ], eventName)) {\n return;\n }\n domGlobals.console.log(eventName, {\n event: eventName,\n time: finishTime - startTime,\n target: initialTarget.dom(),\n sequence: map$1(sequence, function (s) {\n if (!contains([\n 'cut',\n 'stopped',\n 'response'\n ], s.outcome)) {\n return s.outcome;\n } else {\n return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')';\n }\n })\n });\n }\n };\n };\n var processEvent = function (eventName, initialTarget, f) {\n var status = get(eventConfig.get(), eventName).orThunk(function () {\n var patterns = keys(eventConfig.get());\n return findMap(patterns, function (p) {\n return eventName.indexOf(p) > -1 ? Option.some(eventConfig.get()[p]) : Option.none();\n });\n }).getOr(EventConfiguration.NORMAL);\n switch (status) {\n case EventConfiguration.NORMAL:\n return f(noLogger());\n case EventConfiguration.LOGGING: {\n var logger = makeEventLogger(eventName, initialTarget);\n var output = f(logger);\n logger.write();\n return output;\n }\n case EventConfiguration.STOP:\n return true;\n }\n };\n var path = [\n 'alloy/data/Fields',\n 'alloy/debugging/Debugging'\n ];\n var getTrace = function () {\n var err = new Error();\n if (err.stack !== undefined) {\n var lines = err.stack.split('\\n');\n return find$2(lines, function (line) {\n return line.indexOf('alloy') > 0 && !exists(path, function (p) {\n return line.indexOf(p) > -1;\n });\n }).getOr(unknown$3);\n } else {\n return unknown$3;\n }\n };\n var ignoreEvent = {\n logEventCut: noop,\n logEventStopped: noop,\n logNoParent: noop,\n logEventNoHandlers: noop,\n logEventResponse: noop,\n write: noop\n };\n var monitorEvent = function (eventName, initialTarget, f) {\n return processEvent(eventName, initialTarget, f);\n };\n var noLogger = constant(ignoreEvent);\n\n var menuFields = constant([\n strict$1('menu'),\n strict$1('selectedMenu')\n ]);\n var itemFields = constant([\n strict$1('item'),\n strict$1('selectedItem')\n ]);\n var schema = constant(objOf(itemFields().concat(menuFields())));\n var itemSchema = constant(objOf(itemFields()));\n\n var _initSize = strictObjOf('initSize', [\n strict$1('numColumns'),\n strict$1('numRows')\n ]);\n var itemMarkers = function () {\n return strictOf('markers', itemSchema());\n };\n var tieredMenuMarkers = function () {\n return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields()));\n };\n var markers = function (required) {\n return strictObjOf('markers', map$1(required, strict$1));\n };\n var onPresenceHandler = function (label, fieldName, presence) {\n var trace = getTrace();\n return field(fieldName, fieldName, presence, valueOf(function (f) {\n return Result.value(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return f.apply(undefined, args);\n });\n }));\n };\n var onHandler = function (fieldName) {\n return onPresenceHandler('onHandler', fieldName, defaulted(noop));\n };\n var onKeyboardHandler = function (fieldName) {\n return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Option.none));\n };\n var onStrictHandler = function (fieldName) {\n return onPresenceHandler('onHandler', fieldName, strict());\n };\n var onStrictKeyboardHandler = function (fieldName) {\n return onPresenceHandler('onKeyboardHandler', fieldName, strict());\n };\n var output = function (name, value) {\n return state$1(name, constant(value));\n };\n var snapshot = function (name) {\n return state$1(name, identity);\n };\n var initSize = constant(_initSize);\n\n var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([\n onStrictHandler('onReceive'),\n defaulted$1('schema', anyValue$1())\n ])))];\n\n var Receiving = create$1({\n fields: ReceivingSchema,\n name: 'receiving',\n active: ActiveReceiving\n });\n\n var updateAriaState = function (component, toggleConfig, toggleState) {\n var ariaInfo = toggleConfig.aria;\n ariaInfo.update(component, ariaInfo, toggleState.get());\n };\n var updateClass = function (component, toggleConfig, toggleState) {\n toggleConfig.toggleClass.each(function (toggleClass) {\n if (toggleState.get()) {\n add$2(component.element(), toggleClass);\n } else {\n remove$4(component.element(), toggleClass);\n }\n });\n };\n var toggle = function (component, toggleConfig, toggleState) {\n set$2(component, toggleConfig, toggleState, !toggleState.get());\n };\n var on = function (component, toggleConfig, toggleState) {\n toggleState.set(true);\n updateClass(component, toggleConfig, toggleState);\n updateAriaState(component, toggleConfig, toggleState);\n };\n var off = function (component, toggleConfig, toggleState) {\n toggleState.set(false);\n updateClass(component, toggleConfig, toggleState);\n updateAriaState(component, toggleConfig, toggleState);\n };\n var set$2 = function (component, toggleConfig, toggleState, state) {\n var action = state ? on : off;\n action(component, toggleConfig, toggleState);\n };\n var isOn = function (component, toggleConfig, toggleState) {\n return toggleState.get();\n };\n var onLoad = function (component, toggleConfig, toggleState) {\n set$2(component, toggleConfig, toggleState, toggleConfig.selected);\n };\n\n var ToggleApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n onLoad: onLoad,\n toggle: toggle,\n isOn: isOn,\n on: on,\n off: off,\n set: set$2\n });\n\n var exhibit = function () {\n return nu$5({});\n };\n var events$1 = function (toggleConfig, toggleState) {\n var execute = executeEvent(toggleConfig, toggleState, toggle);\n var load = loadEvent(toggleConfig, toggleState, onLoad);\n return derive(flatten([\n toggleConfig.toggleOnExecute ? [execute] : [],\n [load]\n ]));\n };\n\n var ActiveToggle = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit,\n events: events$1\n });\n\n var SetupBehaviourCellState = function (initialState) {\n var init = function () {\n var cell = Cell(initialState);\n var get = function () {\n return cell.get();\n };\n var set = function (newState) {\n return cell.set(newState);\n };\n var clear = function () {\n return cell.set(initialState);\n };\n var readState = function () {\n return cell.get();\n };\n return {\n get: get,\n set: set,\n clear: clear,\n readState: readState\n };\n };\n return { init: init };\n };\n\n var updatePressed = function (component, ariaInfo, status) {\n set(component.element(), 'aria-pressed', status);\n if (ariaInfo.syncWithExpanded) {\n updateExpanded(component, ariaInfo, status);\n }\n };\n var updateSelected = function (component, ariaInfo, status) {\n set(component.element(), 'aria-selected', status);\n };\n var updateChecked = function (component, ariaInfo, status) {\n set(component.element(), 'aria-checked', status);\n };\n var updateExpanded = function (component, ariaInfo, status) {\n set(component.element(), 'aria-expanded', status);\n };\n\n var ToggleSchema = [\n defaulted$1('selected', false),\n option('toggleClass'),\n defaulted$1('toggleOnExecute', true),\n defaultedOf('aria', { mode: 'none' }, choose$1('mode', {\n pressed: [\n defaulted$1('syncWithExpanded', false),\n output('update', updatePressed)\n ],\n checked: [output('update', updateChecked)],\n expanded: [output('update', updateExpanded)],\n selected: [output('update', updateSelected)],\n none: [output('update', noop)]\n }))\n ];\n\n var Toggling = create$1({\n fields: ToggleSchema,\n name: 'toggling',\n active: ActiveToggle,\n apis: ToggleApis,\n state: SetupBehaviourCellState(false)\n });\n\n var format = function (command, update) {\n return Receiving.config({\n channels: wrap$1(formatChanged, {\n onReceive: function (button, data) {\n if (data.command === command) {\n update(button, data.state);\n }\n }\n })\n });\n };\n var orientation = function (onReceive) {\n return Receiving.config({ channels: wrap$1(orientationChanged, { onReceive: onReceive }) });\n };\n var receive$1 = function (channel, onReceive) {\n return {\n key: channel,\n value: { onReceive: onReceive }\n };\n };\n\n var prefix = 'tinymce-mobile';\n var resolve = function (p) {\n return prefix + '-' + p;\n };\n\n var pointerEvents = function () {\n var onClick = function (component, simulatedEvent) {\n simulatedEvent.stop();\n emitExecute(component);\n };\n return [\n run(click(), onClick),\n run(tap(), onClick),\n cutter(touchstart()),\n cutter(mousedown())\n ];\n };\n var events$2 = function (optAction) {\n var executeHandler = function (action) {\n return runOnExecute(function (component, simulatedEvent) {\n action(component);\n simulatedEvent.stop();\n });\n };\n return derive(flatten([\n optAction.map(executeHandler).toArray(),\n pointerEvents()\n ]));\n };\n\n var focus$2 = function (component, focusConfig) {\n if (!focusConfig.ignore) {\n focus$1(component.element());\n focusConfig.onFocus(component);\n }\n };\n var blur$1 = function (component, focusConfig) {\n if (!focusConfig.ignore) {\n blur(component.element());\n }\n };\n var isFocused = function (component) {\n return hasFocus(component.element());\n };\n\n var FocusApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n focus: focus$2,\n blur: blur$1,\n isFocused: isFocused\n });\n\n var exhibit$1 = function (base, focusConfig) {\n var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } };\n return nu$5(mod);\n };\n var events$3 = function (focusConfig) {\n return derive([run(focus(), function (component, simulatedEvent) {\n focus$2(component, focusConfig);\n simulatedEvent.stop();\n })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) {\n simulatedEvent.event().prevent();\n })] : []));\n };\n\n var ActiveFocus = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$1,\n events: events$3\n });\n\n var FocusSchema = [\n onHandler('onFocus'),\n defaulted$1('stopMousedown', false),\n defaulted$1('ignore', false)\n ];\n\n var Focusing = create$1({\n fields: FocusSchema,\n name: 'focusing',\n active: ActiveFocus,\n apis: FocusApis\n });\n\n var isSupported$1 = function (dom) {\n return dom.style !== undefined && isFunction(dom.style.getPropertyValue);\n };\n\n var internalSet = function (dom, property, value) {\n if (!isString(value)) {\n domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);\n throw new Error('CSS value must be a string: ' + value);\n }\n if (isSupported$1(dom)) {\n dom.style.setProperty(property, value);\n }\n };\n var internalRemove = function (dom, property) {\n if (isSupported$1(dom)) {\n dom.style.removeProperty(property);\n }\n };\n var set$3 = function (element, property, value) {\n var dom = element.dom();\n internalSet(dom, property, value);\n };\n var setAll$1 = function (element, css) {\n var dom = element.dom();\n each(css, function (v, k) {\n internalSet(dom, k, v);\n });\n };\n var get$4 = function (element, property) {\n var dom = element.dom();\n var styles = domGlobals.window.getComputedStyle(dom);\n var r = styles.getPropertyValue(property);\n return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;\n };\n var getUnsafeProperty = function (dom, property) {\n return isSupported$1(dom) ? dom.style.getPropertyValue(property) : '';\n };\n var getRaw = function (element, property) {\n var dom = element.dom();\n var raw = getUnsafeProperty(dom, property);\n return Option.from(raw).filter(function (r) {\n return r.length > 0;\n });\n };\n var remove$5 = function (element, property) {\n var dom = element.dom();\n internalRemove(dom, property);\n if (getOpt(element, 'style').map(trim).is('')) {\n remove$1(element, 'style');\n }\n };\n var reflow = function (e) {\n return e.dom().offsetWidth;\n };\n\n function Dimension (name, getOffset) {\n var set = function (element, h) {\n if (!isNumber(h) && !h.match(/^[0-9]+$/)) {\n throw new Error(name + '.set accepts only positive integer values. Value was ' + h);\n }\n var dom = element.dom();\n if (isSupported$1(dom)) {\n dom.style[name] = h + 'px';\n }\n };\n var get = function (element) {\n var r = getOffset(element);\n if (r <= 0 || r === null) {\n var css = get$4(element, name);\n return parseFloat(css) || 0;\n }\n return r;\n };\n var getOuter = get;\n var aggregate = function (element, properties) {\n return foldl(properties, function (acc, property) {\n var val = get$4(element, property);\n var value = val === undefined ? 0 : parseInt(val, 10);\n return isNaN(value) ? acc : acc + value;\n }, 0);\n };\n var max = function (element, value, properties) {\n var cumulativeInclusions = aggregate(element, properties);\n var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0;\n return absoluteMax;\n };\n return {\n set: set,\n get: get,\n getOuter: getOuter,\n aggregate: aggregate,\n max: max\n };\n }\n\n var api = Dimension('height', function (element) {\n var dom = element.dom();\n return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight;\n });\n var get$5 = function (element) {\n return api.get(element);\n };\n\n var ancestors = function (scope, predicate, isRoot) {\n return filter$1(parents(scope, isRoot), predicate);\n };\n var siblings$1 = function (scope, predicate) {\n return filter$1(siblings(scope), predicate);\n };\n\n var all$2 = function (selector) {\n return all(selector);\n };\n var ancestors$1 = function (scope, selector, isRoot) {\n return ancestors(scope, function (e) {\n return is(e, selector);\n }, isRoot);\n };\n var siblings$2 = function (scope, selector) {\n return siblings$1(scope, function (e) {\n return is(e, selector);\n });\n };\n var descendants = function (scope, selector) {\n return all(selector, scope);\n };\n\n function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {\n return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);\n }\n\n var ancestor$1 = function (scope, predicate, isRoot) {\n var element = scope.dom();\n var stop = isFunction(isRoot) ? isRoot : constant(false);\n while (element.parentNode) {\n element = element.parentNode;\n var el = Element.fromDom(element);\n if (predicate(el)) {\n return Option.some(el);\n } else if (stop(el)) {\n break;\n }\n }\n return Option.none();\n };\n var closest$1 = function (scope, predicate, isRoot) {\n var is = function (s, test) {\n return test(s);\n };\n return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot);\n };\n var descendant = function (scope, predicate) {\n var descend = function (node) {\n for (var i = 0; i < node.childNodes.length; i++) {\n var child_1 = Element.fromDom(node.childNodes[i]);\n if (predicate(child_1)) {\n return Option.some(child_1);\n }\n var res = descend(node.childNodes[i]);\n if (res.isSome()) {\n return res;\n }\n }\n return Option.none();\n };\n return descend(scope.dom());\n };\n\n var first = function (selector) {\n return one(selector);\n };\n var ancestor$2 = function (scope, selector, isRoot) {\n return ancestor$1(scope, function (e) {\n return is(e, selector);\n }, isRoot);\n };\n var descendant$1 = function (scope, selector) {\n return one(selector, scope);\n };\n var closest$2 = function (scope, selector, isRoot) {\n var is$1 = function (element, selector) {\n return is(element, selector);\n };\n return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot);\n };\n\n var BACKSPACE = function () {\n return [8];\n };\n var TAB = function () {\n return [9];\n };\n var ENTER = function () {\n return [13];\n };\n var ESCAPE = function () {\n return [27];\n };\n var SPACE = function () {\n return [32];\n };\n var LEFT = function () {\n return [37];\n };\n var UP = function () {\n return [38];\n };\n var RIGHT = function () {\n return [39];\n };\n var DOWN = function () {\n return [40];\n };\n\n var cyclePrev = function (values, index, predicate) {\n var before = reverse(values.slice(0, index));\n var after = reverse(values.slice(index + 1));\n return find$2(before.concat(after), predicate);\n };\n var tryPrev = function (values, index, predicate) {\n var before = reverse(values.slice(0, index));\n return find$2(before, predicate);\n };\n var cycleNext = function (values, index, predicate) {\n var before = values.slice(0, index);\n var after = values.slice(index + 1);\n return find$2(after.concat(before), predicate);\n };\n var tryNext = function (values, index, predicate) {\n var after = values.slice(index + 1);\n return find$2(after, predicate);\n };\n\n var inSet = function (keys) {\n return function (event) {\n var raw = event.raw();\n return contains(keys, raw.which);\n };\n };\n var and = function (preds) {\n return function (event) {\n return forall(preds, function (pred) {\n return pred(event);\n });\n };\n };\n var isShift = function (event) {\n var raw = event.raw();\n return raw.shiftKey === true;\n };\n var isControl = function (event) {\n var raw = event.raw();\n return raw.ctrlKey === true;\n };\n var isNotShift = not(isShift);\n\n var rule = function (matches, action) {\n return {\n matches: matches,\n classification: action\n };\n };\n var choose$2 = function (transitions, event) {\n var transition = find$2(transitions, function (t) {\n return t.matches(event);\n });\n return transition.map(function (t) {\n return t.classification;\n });\n };\n\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var sequence = function (arr) {\n var r = [];\n for (var i = 0; i < arr.length; i++) {\n var x = arr[i];\n if (x.isSome()) {\n r.push(x.getOrDie());\n } else {\n return Option.none();\n }\n }\n return Option.some(r);\n };\n var someIf = function (b, a) {\n return b ? Option.some(a) : Option.none();\n };\n\n var cycleBy = function (value, delta, min, max) {\n var r = value + delta;\n return r > max ? min : r < min ? max : r;\n };\n var clamp = function (value, min, max) {\n return Math.min(Math.max(value, min), max);\n };\n\n var dehighlightAllExcept = function (component, hConfig, hState, skip) {\n var highlighted = descendants(component.element(), '.' + hConfig.highlightClass);\n each$1(highlighted, function (h) {\n if (!exists(skip, function (skipComp) {\n return skipComp.element() === h;\n })) {\n remove$4(h, hConfig.highlightClass);\n component.getSystem().getByDom(h).each(function (target) {\n hConfig.onDehighlight(component, target);\n emit(target, dehighlight());\n });\n }\n });\n };\n var dehighlightAll = function (component, hConfig, hState) {\n return dehighlightAllExcept(component, hConfig, hState, []);\n };\n var dehighlight$1 = function (component, hConfig, hState, target) {\n if (isHighlighted(component, hConfig, hState, target)) {\n remove$4(target.element(), hConfig.highlightClass);\n hConfig.onDehighlight(component, target);\n emit(target, dehighlight());\n }\n };\n var highlight$1 = function (component, hConfig, hState, target) {\n dehighlightAllExcept(component, hConfig, hState, [target]);\n if (!isHighlighted(component, hConfig, hState, target)) {\n add$2(target.element(), hConfig.highlightClass);\n hConfig.onHighlight(component, target);\n emit(target, highlight());\n }\n };\n var highlightFirst = function (component, hConfig, hState) {\n getFirst(component, hConfig).each(function (firstComp) {\n highlight$1(component, hConfig, hState, firstComp);\n });\n };\n var highlightLast = function (component, hConfig, hState) {\n getLast(component, hConfig).each(function (lastComp) {\n highlight$1(component, hConfig, hState, lastComp);\n });\n };\n var highlightAt = function (component, hConfig, hState, index) {\n getByIndex(component, hConfig, hState, index).fold(function (err) {\n throw new Error(err);\n }, function (firstComp) {\n highlight$1(component, hConfig, hState, firstComp);\n });\n };\n var highlightBy = function (component, hConfig, hState, predicate) {\n var candidates = getCandidates(component, hConfig);\n var targetComp = find$2(candidates, predicate);\n targetComp.each(function (c) {\n highlight$1(component, hConfig, hState, c);\n });\n };\n var isHighlighted = function (component, hConfig, hState, queryTarget) {\n return has$2(queryTarget.element(), hConfig.highlightClass);\n };\n var getHighlighted = function (component, hConfig, _hState) {\n return descendant$1(component.element(), '.' + hConfig.highlightClass).bind(function (e) {\n return component.getSystem().getByDom(e).toOption();\n });\n };\n var getByIndex = function (component, hConfig, hState, index) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n return Option.from(items[index]).fold(function () {\n return Result.error('No element found with index ' + index);\n }, component.getSystem().getByDom);\n };\n var getFirst = function (component, hConfig, _hState) {\n return descendant$1(component.element(), '.' + hConfig.itemClass).bind(function (e) {\n return component.getSystem().getByDom(e).toOption();\n });\n };\n var getLast = function (component, hConfig, _hState) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n var last = items.length > 0 ? Option.some(items[items.length - 1]) : Option.none();\n return last.bind(function (c) {\n return component.getSystem().getByDom(c).toOption();\n });\n };\n var getDelta = function (component, hConfig, hState, delta) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n var current = findIndex(items, function (item) {\n return has$2(item, hConfig.highlightClass);\n });\n return current.bind(function (selected) {\n var dest = cycleBy(selected, delta, 0, items.length - 1);\n return component.getSystem().getByDom(items[dest]).toOption();\n });\n };\n var getPrevious = function (component, hConfig, hState) {\n return getDelta(component, hConfig, hState, -1);\n };\n var getNext = function (component, hConfig, hState) {\n return getDelta(component, hConfig, hState, +1);\n };\n var getCandidates = function (component, hConfig, _hState) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n return cat(map$1(items, function (i) {\n return component.getSystem().getByDom(i).toOption();\n }));\n };\n\n var HighlightApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n dehighlightAll: dehighlightAll,\n dehighlight: dehighlight$1,\n highlight: highlight$1,\n highlightFirst: highlightFirst,\n highlightLast: highlightLast,\n highlightAt: highlightAt,\n highlightBy: highlightBy,\n isHighlighted: isHighlighted,\n getHighlighted: getHighlighted,\n getFirst: getFirst,\n getLast: getLast,\n getPrevious: getPrevious,\n getNext: getNext,\n getCandidates: getCandidates\n });\n\n var HighlightSchema = [\n strict$1('highlightClass'),\n strict$1('itemClass'),\n onHandler('onHighlight'),\n onHandler('onDehighlight')\n ];\n\n var Highlighting = create$1({\n fields: HighlightSchema,\n name: 'highlighting',\n apis: HighlightApis\n });\n\n var reportFocusShifting = function (component, prevFocus, newFocus) {\n var noChange = prevFocus.exists(function (p) {\n return newFocus.exists(function (n) {\n return eq(n, p);\n });\n });\n if (!noChange) {\n emitWith(component, focusShifted(), {\n prevFocus: prevFocus,\n newFocus: newFocus\n });\n }\n };\n var dom = function () {\n var get = function (component) {\n return search(component.element());\n };\n var set = function (component, focusee) {\n var prevFocus = get(component);\n component.getSystem().triggerFocus(focusee, component.element());\n var newFocus = get(component);\n reportFocusShifting(component, prevFocus, newFocus);\n };\n return {\n get: get,\n set: set\n };\n };\n var highlights = function () {\n var get = function (component) {\n return Highlighting.getHighlighted(component).map(function (item) {\n return item.element();\n });\n };\n var set = function (component, element) {\n var prevFocus = get(component);\n component.getSystem().getByDom(element).fold(noop, function (item) {\n Highlighting.highlight(component, item);\n });\n var newFocus = get(component);\n reportFocusShifting(component, prevFocus, newFocus);\n };\n return {\n get: get,\n set: set\n };\n };\n\n var FocusInsideModes;\n (function (FocusInsideModes) {\n FocusInsideModes['OnFocusMode'] = 'onFocus';\n FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace';\n FocusInsideModes['OnApiMode'] = 'onApi';\n }(FocusInsideModes || (FocusInsideModes = {})));\n\n var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) {\n var schema = function () {\n return infoSchema.concat([\n defaulted$1('focusManager', dom()),\n defaultedOf('focusInside', 'onFocus', valueOf(function (val) {\n return contains([\n 'onFocus',\n 'onEnterOrSpace',\n 'onApi'\n ], val) ? Result.value(val) : Result.error('Invalid value for focusInside');\n })),\n output('handler', me),\n output('state', stateInit),\n output('sendFocusIn', optFocusIn)\n ]);\n };\n var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) {\n var rules = getRules(component, simulatedEvent, keyingConfig, keyingState);\n return choose$2(rules, simulatedEvent.event()).bind(function (rule) {\n return rule(component, simulatedEvent, keyingConfig, keyingState);\n });\n };\n var toEvents = function (keyingConfig, keyingState) {\n var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Option.none() : optFocusIn(keyingConfig).map(function (focusIn) {\n return run(focus(), function (component, simulatedEvent) {\n focusIn(component, keyingConfig, keyingState);\n simulatedEvent.stop();\n });\n });\n var tryGoInsideComponent = function (component, simulatedEvent) {\n var isEnterOrSpace = inSet(SPACE().concat(ENTER()))(simulatedEvent.event());\n if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) {\n optFocusIn(keyingConfig).each(function (focusIn) {\n focusIn(component, keyingConfig, keyingState);\n simulatedEvent.stop();\n });\n }\n };\n var keyboardEvents = [\n run(keydown(), function (component, simulatedEvent) {\n processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () {\n tryGoInsideComponent(component, simulatedEvent);\n }, function (_) {\n simulatedEvent.stop();\n });\n }),\n run(keyup(), function (component, simulatedEvent) {\n processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) {\n simulatedEvent.stop();\n });\n })\n ];\n return derive(onFocusHandler.toArray().concat(keyboardEvents));\n };\n var me = {\n schema: schema,\n processKey: processKey,\n toEvents: toEvents\n };\n return me;\n };\n\n var create$2 = function (cyclicField) {\n var schema = [\n option('onEscape'),\n option('onEnter'),\n defaulted$1('selector', '[data-alloy-tabstop=\"true\"]:not(:disabled)'),\n defaulted$1('firstTabstop', 0),\n defaulted$1('useTabstopAt', constant(true)),\n option('visibilitySelector')\n ].concat([cyclicField]);\n var isVisible = function (tabbingConfig, element) {\n var target = tabbingConfig.visibilitySelector.bind(function (sel) {\n return closest$2(element, sel);\n }).getOr(element);\n return get$5(target) > 0;\n };\n var findInitial = function (component, tabbingConfig) {\n var tabstops = descendants(component.element(), tabbingConfig.selector);\n var visibles = filter$1(tabstops, function (elem) {\n return isVisible(tabbingConfig, elem);\n });\n return Option.from(visibles[tabbingConfig.firstTabstop]);\n };\n var findCurrent = function (component, tabbingConfig) {\n return tabbingConfig.focusManager.get(component).bind(function (elem) {\n return closest$2(elem, tabbingConfig.selector);\n });\n };\n var isTabstop = function (tabbingConfig, element) {\n return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element);\n };\n var focusIn = function (component, tabbingConfig, _tabbingState) {\n findInitial(component, tabbingConfig).each(function (target) {\n tabbingConfig.focusManager.set(component, target);\n });\n };\n var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) {\n return cycle(tabstops, stopIndex, function (elem) {\n return isTabstop(tabbingConfig, elem);\n }).fold(function () {\n return tabbingConfig.cyclic ? Option.some(true) : Option.none();\n }, function (target) {\n tabbingConfig.focusManager.set(component, target);\n return Option.some(true);\n });\n };\n var go = function (component, _simulatedEvent, tabbingConfig, cycle) {\n var tabstops = descendants(component.element(), tabbingConfig.selector);\n return findCurrent(component, tabbingConfig).bind(function (tabstop) {\n var optStopIndex = findIndex(tabstops, curry(eq, tabstop));\n return optStopIndex.bind(function (stopIndex) {\n return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle);\n });\n });\n };\n var goBackwards = function (component, simulatedEvent, tabbingConfig) {\n var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev;\n return go(component, simulatedEvent, tabbingConfig, navigate);\n };\n var goForwards = function (component, simulatedEvent, tabbingConfig) {\n var navigate = tabbingConfig.cyclic ? cycleNext : tryNext;\n return go(component, simulatedEvent, tabbingConfig, navigate);\n };\n var execute = function (component, simulatedEvent, tabbingConfig) {\n return tabbingConfig.onEnter.bind(function (f) {\n return f(component, simulatedEvent);\n });\n };\n var exit = function (component, simulatedEvent, tabbingConfig) {\n return tabbingConfig.onEscape.bind(function (f) {\n return f(component, simulatedEvent);\n });\n };\n var getKeydownRules = constant([\n rule(and([\n isShift,\n inSet(TAB())\n ]), goBackwards),\n rule(inSet(TAB()), goForwards),\n rule(inSet(ESCAPE()), exit),\n rule(and([\n isNotShift,\n inSet(ENTER())\n ]), execute)\n ]);\n var getKeyupRules = constant([]);\n return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () {\n return Option.some(focusIn);\n });\n };\n\n var AcyclicType = create$2(state$1('cyclic', constant(false)));\n\n var CyclicType = create$2(state$1('cyclic', constant(true)));\n\n var inside = function (target) {\n return name(target) === 'input' && get$1(target, 'type') !== 'radio' || name(target) === 'textarea';\n };\n\n var doDefaultExecute = function (component, _simulatedEvent, focused) {\n dispatch(component, focused, execute());\n return Option.some(true);\n };\n var defaultExecute = function (component, simulatedEvent, focused) {\n var isComplex = inside(focused) && inSet(SPACE())(simulatedEvent.event());\n return isComplex ? Option.none() : doDefaultExecute(component, simulatedEvent, focused);\n };\n var stopEventForFirefox = function (_component, _simulatedEvent) {\n return Option.some(true);\n };\n\n var schema$1 = [\n defaulted$1('execute', defaultExecute),\n defaulted$1('useSpace', false),\n defaulted$1('useEnter', true),\n defaulted$1('useControlEnter', false),\n defaulted$1('useDown', false)\n ];\n var execute$1 = function (component, simulatedEvent, executeConfig) {\n return executeConfig.execute(component, simulatedEvent, component.element());\n };\n var getKeydownRules = function (component, _simulatedEvent, executeConfig, _executeState) {\n var spaceExec = executeConfig.useSpace && !inside(component.element()) ? SPACE() : [];\n var enterExec = executeConfig.useEnter ? ENTER() : [];\n var downExec = executeConfig.useDown ? DOWN() : [];\n var execKeys = spaceExec.concat(enterExec).concat(downExec);\n return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([\n isControl,\n inSet(ENTER())\n ]), execute$1)] : []);\n };\n var getKeyupRules = function (component, _simulatedEvent, executeConfig, _executeState) {\n return executeConfig.useSpace && !inside(component.element()) ? [rule(inSet(SPACE()), stopEventForFirefox)] : [];\n };\n var ExecutionType = typical(schema$1, NoState.init, getKeydownRules, getKeyupRules, function () {\n return Option.none();\n });\n\n var flatgrid = function () {\n var dimensions = Cell(Option.none());\n var setGridSize = function (numRows, numColumns) {\n dimensions.set(Option.some({\n numRows: numRows,\n numColumns: numColumns\n }));\n };\n var getNumRows = function () {\n return dimensions.get().map(function (d) {\n return d.numRows;\n });\n };\n var getNumColumns = function () {\n return dimensions.get().map(function (d) {\n return d.numColumns;\n });\n };\n return nu$6({\n readState: function () {\n return dimensions.get().map(function (d) {\n return {\n numRows: String(d.numRows),\n numColumns: String(d.numColumns)\n };\n }).getOr({\n numRows: '?',\n numColumns: '?'\n });\n },\n setGridSize: setGridSize,\n getNumRows: getNumRows,\n getNumColumns: getNumColumns\n });\n };\n var init = function (spec) {\n return spec.state(spec);\n };\n\n var KeyingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n flatgrid: flatgrid,\n init: init\n });\n\n var onDirection = function (isLtr, isRtl) {\n return function (element) {\n return getDirection(element) === 'rtl' ? isRtl : isLtr;\n };\n };\n var getDirection = function (element) {\n return get$4(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';\n };\n\n var useH = function (movement) {\n return function (component, simulatedEvent, config, state) {\n var move = movement(component.element());\n return use(move, component, simulatedEvent, config, state);\n };\n };\n var west = function (moveLeft, moveRight) {\n var movement = onDirection(moveLeft, moveRight);\n return useH(movement);\n };\n var east = function (moveLeft, moveRight) {\n var movement = onDirection(moveRight, moveLeft);\n return useH(movement);\n };\n var useV = function (move) {\n return function (component, simulatedEvent, config, state) {\n return use(move, component, simulatedEvent, config, state);\n };\n };\n var use = function (move, component, simulatedEvent, config, state) {\n var outcome = config.focusManager.get(component).bind(function (focused) {\n return move(component.element(), focused, config, state);\n });\n return outcome.map(function (newFocus) {\n config.focusManager.set(component, newFocus);\n return true;\n });\n };\n var north = useV;\n var south = useV;\n var move = useV;\n\n var isHidden = function (dom) {\n return dom.offsetWidth <= 0 && dom.offsetHeight <= 0;\n };\n var isVisible = function (element) {\n return !isHidden(element.dom());\n };\n\n var locate = function (candidates, predicate) {\n return findIndex(candidates, predicate).map(function (index) {\n return {\n index: constant(index),\n candidates: constant(candidates)\n };\n });\n };\n\n var locateVisible = function (container, current, selector) {\n var predicate = function (x) {\n return eq(x, current);\n };\n var candidates = descendants(container, selector);\n var visible = filter$1(candidates, isVisible);\n return locate(visible, predicate);\n };\n var findIndex$1 = function (elements, target) {\n return findIndex(elements, function (elem) {\n return eq(target, elem);\n });\n };\n\n var withGrid = function (values, index, numCols, f) {\n var oldRow = Math.floor(index / numCols);\n var oldColumn = index % numCols;\n return f(oldRow, oldColumn).bind(function (address) {\n var newIndex = address.row() * numCols + address.column();\n return newIndex >= 0 && newIndex < values.length ? Option.some(values[newIndex]) : Option.none();\n });\n };\n var cycleHorizontal = function (values, index, numRows, numCols, delta) {\n return withGrid(values, index, numCols, function (oldRow, oldColumn) {\n var onLastRow = oldRow === numRows - 1;\n var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols;\n var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1);\n return Option.some({\n row: constant(oldRow),\n column: constant(newColumn)\n });\n });\n };\n var cycleVertical = function (values, index, numRows, numCols, delta) {\n return withGrid(values, index, numCols, function (oldRow, oldColumn) {\n var newRow = cycleBy(oldRow, delta, 0, numRows - 1);\n var onLastRow = newRow === numRows - 1;\n var colsInRow = onLastRow ? values.length - newRow * numCols : numCols;\n var newCol = clamp(oldColumn, 0, colsInRow - 1);\n return Option.some({\n row: constant(newRow),\n column: constant(newCol)\n });\n });\n };\n var cycleRight = function (values, index, numRows, numCols) {\n return cycleHorizontal(values, index, numRows, numCols, +1);\n };\n var cycleLeft = function (values, index, numRows, numCols) {\n return cycleHorizontal(values, index, numRows, numCols, -1);\n };\n var cycleUp = function (values, index, numRows, numCols) {\n return cycleVertical(values, index, numRows, numCols, -1);\n };\n var cycleDown = function (values, index, numRows, numCols) {\n return cycleVertical(values, index, numRows, numCols, +1);\n };\n\n var schema$2 = [\n strict$1('selector'),\n defaulted$1('execute', defaultExecute),\n onKeyboardHandler('onEscape'),\n defaulted$1('captureTab', false),\n initSize()\n ];\n var focusIn = function (component, gridConfig, _gridState) {\n descendant$1(component.element(), gridConfig.selector).each(function (first) {\n gridConfig.focusManager.set(component, first);\n });\n };\n var findCurrent = function (component, gridConfig) {\n return gridConfig.focusManager.get(component).bind(function (elem) {\n return closest$2(elem, gridConfig.selector);\n });\n };\n var execute$2 = function (component, simulatedEvent, gridConfig, _gridState) {\n return findCurrent(component, gridConfig).bind(function (focused) {\n return gridConfig.execute(component, simulatedEvent, focused);\n });\n };\n var doMove = function (cycle) {\n return function (element, focused, gridConfig, gridState) {\n return locateVisible(element, focused, gridConfig.selector).bind(function (identified) {\n return cycle(identified.candidates(), identified.index(), gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns));\n });\n };\n };\n var handleTab = function (_component, _simulatedEvent, gridConfig) {\n return gridConfig.captureTab ? Option.some(true) : Option.none();\n };\n var doEscape = function (component, simulatedEvent, gridConfig) {\n return gridConfig.onEscape(component, simulatedEvent);\n };\n var moveLeft = doMove(cycleLeft);\n var moveRight = doMove(cycleRight);\n var moveNorth = doMove(cycleUp);\n var moveSouth = doMove(cycleDown);\n var getKeydownRules$1 = constant([\n rule(inSet(LEFT()), west(moveLeft, moveRight)),\n rule(inSet(RIGHT()), east(moveLeft, moveRight)),\n rule(inSet(UP()), north(moveNorth)),\n rule(inSet(DOWN()), south(moveSouth)),\n rule(and([\n isShift,\n inSet(TAB())\n ]), handleTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), handleTab),\n rule(inSet(ESCAPE()), doEscape),\n rule(inSet(SPACE().concat(ENTER())), execute$2)\n ]);\n var getKeyupRules$1 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var FlatgridType = typical(schema$2, flatgrid, getKeydownRules$1, getKeyupRules$1, function () {\n return Option.some(focusIn);\n });\n\n var horizontal = function (container, selector, current, delta) {\n var isDisabledButton = function (candidate) {\n return name(candidate) === 'button' && get$1(candidate, 'disabled') === 'disabled';\n };\n var tryCycle = function (initial, index, candidates) {\n var newIndex = cycleBy(index, delta, 0, candidates.length - 1);\n if (newIndex === initial) {\n return Option.none();\n } else {\n return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Option.from(candidates[newIndex]);\n }\n };\n return locateVisible(container, current, selector).bind(function (identified) {\n var index = identified.index();\n var candidates = identified.candidates();\n return tryCycle(index, index, candidates);\n });\n };\n\n var schema$3 = [\n strict$1('selector'),\n defaulted$1('getInitial', Option.none),\n defaulted$1('execute', defaultExecute),\n onKeyboardHandler('onEscape'),\n defaulted$1('executeOnMove', false),\n defaulted$1('allowVertical', true)\n ];\n var findCurrent$1 = function (component, flowConfig) {\n return flowConfig.focusManager.get(component).bind(function (elem) {\n return closest$2(elem, flowConfig.selector);\n });\n };\n var execute$3 = function (component, simulatedEvent, flowConfig) {\n return findCurrent$1(component, flowConfig).bind(function (focused) {\n return flowConfig.execute(component, simulatedEvent, focused);\n });\n };\n var focusIn$1 = function (component, flowConfig, _state) {\n flowConfig.getInitial(component).orThunk(function () {\n return descendant$1(component.element(), flowConfig.selector);\n }).each(function (first) {\n flowConfig.focusManager.set(component, first);\n });\n };\n var moveLeft$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, -1);\n };\n var moveRight$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, +1);\n };\n var doMove$1 = function (movement) {\n return function (component, simulatedEvent, flowConfig, flowState) {\n return movement(component, simulatedEvent, flowConfig, flowState).bind(function () {\n return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Option.some(true);\n });\n };\n };\n var doEscape$1 = function (component, simulatedEvent, flowConfig) {\n return flowConfig.onEscape(component, simulatedEvent);\n };\n var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) {\n var westMovers = LEFT().concat(flowConfig.allowVertical ? UP() : []);\n var eastMovers = RIGHT().concat(flowConfig.allowVertical ? DOWN() : []);\n return [\n rule(inSet(westMovers), doMove$1(west(moveLeft$1, moveRight$1))),\n rule(inSet(eastMovers), doMove$1(east(moveLeft$1, moveRight$1))),\n rule(inSet(ENTER()), execute$3),\n rule(inSet(SPACE()), execute$3),\n rule(inSet(ESCAPE()), doEscape$1)\n ];\n };\n var getKeyupRules$2 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var FlowType = typical(schema$3, NoState.init, getKeydownRules$2, getKeyupRules$2, function () {\n return Option.some(focusIn$1);\n });\n\n var toCell = function (matrix, rowIndex, columnIndex) {\n return Option.from(matrix[rowIndex]).bind(function (row) {\n return Option.from(row[columnIndex]).map(function (cell) {\n return {\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n cell: cell\n };\n });\n });\n };\n var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) {\n var row = matrix[rowIndex];\n var colsInRow = row.length;\n var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1);\n return toCell(matrix, rowIndex, newColIndex);\n };\n var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) {\n var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1);\n var colsInNextRow = matrix[nextRowIndex].length;\n var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1);\n return toCell(matrix, nextRowIndex, nextColIndex);\n };\n var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) {\n var row = matrix[rowIndex];\n var colsInRow = row.length;\n var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1);\n return toCell(matrix, rowIndex, newColIndex);\n };\n var moveVertical = function (matrix, colIndex, startRow, deltaRow) {\n var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1);\n var colsInNextRow = matrix[nextRowIndex].length;\n var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1);\n return toCell(matrix, nextRowIndex, nextColIndex);\n };\n var cycleRight$1 = function (matrix, startRow, startCol) {\n return cycleHorizontal$1(matrix, startRow, startCol, +1);\n };\n var cycleLeft$1 = function (matrix, startRow, startCol) {\n return cycleHorizontal$1(matrix, startRow, startCol, -1);\n };\n var cycleUp$1 = function (matrix, startRow, startCol) {\n return cycleVertical$1(matrix, startCol, startRow, -1);\n };\n var cycleDown$1 = function (matrix, startRow, startCol) {\n return cycleVertical$1(matrix, startCol, startRow, +1);\n };\n var moveLeft$2 = function (matrix, startRow, startCol) {\n return moveHorizontal(matrix, startRow, startCol, -1);\n };\n var moveRight$2 = function (matrix, startRow, startCol) {\n return moveHorizontal(matrix, startRow, startCol, +1);\n };\n var moveUp = function (matrix, startRow, startCol) {\n return moveVertical(matrix, startCol, startRow, -1);\n };\n var moveDown = function (matrix, startRow, startCol) {\n return moveVertical(matrix, startCol, startRow, +1);\n };\n\n var schema$4 = [\n strictObjOf('selectors', [\n strict$1('row'),\n strict$1('cell')\n ]),\n defaulted$1('cycles', true),\n defaulted$1('previousSelector', Option.none),\n defaulted$1('execute', defaultExecute)\n ];\n var focusIn$2 = function (component, matrixConfig, _state) {\n var focused = matrixConfig.previousSelector(component).orThunk(function () {\n var selectors = matrixConfig.selectors;\n return descendant$1(component.element(), selectors.cell);\n });\n focused.each(function (cell) {\n matrixConfig.focusManager.set(component, cell);\n });\n };\n var execute$4 = function (component, simulatedEvent, matrixConfig) {\n return search(component.element()).bind(function (focused) {\n return matrixConfig.execute(component, simulatedEvent, focused);\n });\n };\n var toMatrix = function (rows, matrixConfig) {\n return map$1(rows, function (row) {\n return descendants(row, matrixConfig.selectors.cell);\n });\n };\n var doMove$2 = function (ifCycle, ifMove) {\n return function (element, focused, matrixConfig) {\n var move = matrixConfig.cycles ? ifCycle : ifMove;\n return closest$2(focused, matrixConfig.selectors.row).bind(function (inRow) {\n var cellsInRow = descendants(inRow, matrixConfig.selectors.cell);\n return findIndex$1(cellsInRow, focused).bind(function (colIndex) {\n var allRows = descendants(element, matrixConfig.selectors.row);\n return findIndex$1(allRows, inRow).bind(function (rowIndex) {\n var matrix = toMatrix(allRows, matrixConfig);\n return move(matrix, rowIndex, colIndex).map(function (next) {\n return next.cell;\n });\n });\n });\n });\n };\n };\n var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2);\n var moveRight$3 = doMove$2(cycleRight$1, moveRight$2);\n var moveNorth$1 = doMove$2(cycleUp$1, moveUp);\n var moveSouth$1 = doMove$2(cycleDown$1, moveDown);\n var getKeydownRules$3 = constant([\n rule(inSet(LEFT()), west(moveLeft$3, moveRight$3)),\n rule(inSet(RIGHT()), east(moveLeft$3, moveRight$3)),\n rule(inSet(UP()), north(moveNorth$1)),\n rule(inSet(DOWN()), south(moveSouth$1)),\n rule(inSet(SPACE().concat(ENTER())), execute$4)\n ]);\n var getKeyupRules$3 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var MatrixType = typical(schema$4, NoState.init, getKeydownRules$3, getKeyupRules$3, function () {\n return Option.some(focusIn$2);\n });\n\n var schema$5 = [\n strict$1('selector'),\n defaulted$1('execute', defaultExecute),\n defaulted$1('moveOnTab', false)\n ];\n var execute$5 = function (component, simulatedEvent, menuConfig) {\n return menuConfig.focusManager.get(component).bind(function (focused) {\n return menuConfig.execute(component, simulatedEvent, focused);\n });\n };\n var focusIn$3 = function (component, menuConfig, _state) {\n descendant$1(component.element(), menuConfig.selector).each(function (first) {\n menuConfig.focusManager.set(component, first);\n });\n };\n var moveUp$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, -1);\n };\n var moveDown$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, +1);\n };\n var fireShiftTab = function (component, simulatedEvent, menuConfig, menuState) {\n return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Option.none();\n };\n var fireTab = function (component, simulatedEvent, menuConfig, menuState) {\n return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Option.none();\n };\n var getKeydownRules$4 = constant([\n rule(inSet(UP()), move(moveUp$1)),\n rule(inSet(DOWN()), move(moveDown$1)),\n rule(and([\n isShift,\n inSet(TAB())\n ]), fireShiftTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), fireTab),\n rule(inSet(ENTER()), execute$5),\n rule(inSet(SPACE()), execute$5)\n ]);\n var getKeyupRules$4 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var MenuType = typical(schema$5, NoState.init, getKeydownRules$4, getKeyupRules$4, function () {\n return Option.some(focusIn$3);\n });\n\n var schema$6 = [\n onKeyboardHandler('onSpace'),\n onKeyboardHandler('onEnter'),\n onKeyboardHandler('onShiftEnter'),\n onKeyboardHandler('onLeft'),\n onKeyboardHandler('onRight'),\n onKeyboardHandler('onTab'),\n onKeyboardHandler('onShiftTab'),\n onKeyboardHandler('onUp'),\n onKeyboardHandler('onDown'),\n onKeyboardHandler('onEscape'),\n defaulted$1('stopSpaceKeyup', false),\n option('focusIn')\n ];\n var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) {\n return [\n rule(inSet(SPACE()), specialInfo.onSpace),\n rule(and([\n isNotShift,\n inSet(ENTER())\n ]), specialInfo.onEnter),\n rule(and([\n isShift,\n inSet(ENTER())\n ]), specialInfo.onShiftEnter),\n rule(and([\n isShift,\n inSet(TAB())\n ]), specialInfo.onShiftTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), specialInfo.onTab),\n rule(inSet(UP()), specialInfo.onUp),\n rule(inSet(DOWN()), specialInfo.onDown),\n rule(inSet(LEFT()), specialInfo.onLeft),\n rule(inSet(RIGHT()), specialInfo.onRight),\n rule(inSet(SPACE()), specialInfo.onSpace),\n rule(inSet(ESCAPE()), specialInfo.onEscape)\n ];\n };\n var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) {\n return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE()), stopEventForFirefox)] : [];\n };\n var SpecialType = typical(schema$6, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) {\n return specialInfo.focusIn;\n });\n\n var acyclic = AcyclicType.schema();\n var cyclic = CyclicType.schema();\n var flow = FlowType.schema();\n var flatgrid$1 = FlatgridType.schema();\n var matrix = MatrixType.schema();\n var execution = ExecutionType.schema();\n var menu = MenuType.schema();\n var special = SpecialType.schema();\n\n var KeyboardBranches = /*#__PURE__*/Object.freeze({\n __proto__: null,\n acyclic: acyclic,\n cyclic: cyclic,\n flow: flow,\n flatgrid: flatgrid$1,\n matrix: matrix,\n execution: execution,\n menu: menu,\n special: special\n });\n\n var isFlatgridState = function (keyState) {\n return hasNonNullableKey(keyState, 'setGridSize');\n };\n var Keying = createModes$1({\n branchKey: 'mode',\n branches: KeyboardBranches,\n name: 'keying',\n active: {\n events: function (keyingConfig, keyingState) {\n var handler = keyingConfig.handler;\n return handler.toEvents(keyingConfig, keyingState);\n }\n },\n apis: {\n focusIn: function (component, keyConfig, keyState) {\n keyConfig.sendFocusIn(keyConfig).fold(function () {\n component.getSystem().triggerFocus(component.element(), component.element());\n }, function (sendFocusIn) {\n sendFocusIn(component, keyConfig, keyState);\n });\n },\n setGridSize: function (component, keyConfig, keyState, numRows, numColumns) {\n if (!isFlatgridState(keyState)) {\n domGlobals.console.error('Layout does not support setGridSize');\n } else {\n keyState.setGridSize(numRows, numColumns);\n }\n }\n },\n state: KeyingState\n });\n\n var field$1 = function (name, forbidden) {\n return defaultedObjOf(name, {}, map$1(forbidden, function (f) {\n return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name);\n }).concat([state$1('dump', identity)]));\n };\n var get$6 = function (data) {\n return data.dump;\n };\n var augment = function (data, original) {\n return __assign(__assign({}, data.dump), derive$1(original));\n };\n var SketchBehaviours = {\n field: field$1,\n augment: augment,\n get: get$6\n };\n\n var _placeholder = 'placeholder';\n var adt$2 = Adt.generate([\n {\n single: [\n 'required',\n 'valueThunk'\n ]\n },\n {\n multiple: [\n 'required',\n 'valueThunks'\n ]\n }\n ]);\n var isSubstituted = function (spec) {\n return has(spec, 'uiType');\n };\n var subPlaceholder = function (owner, detail, compSpec, placeholders) {\n if (owner.exists(function (o) {\n return o !== compSpec.owner;\n })) {\n return adt$2.single(true, constant(compSpec));\n }\n return get(placeholders, compSpec.name).fold(function () {\n throw new Error('Unknown placeholder component: ' + compSpec.name + '\\nKnown: [' + keys(placeholders) + ']\\nNamespace: ' + owner.getOr('none') + '\\nSpec: ' + JSON.stringify(compSpec, null, 2));\n }, function (newSpec) {\n return newSpec.replace();\n });\n };\n var scan = function (owner, detail, compSpec, placeholders) {\n if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) {\n return subPlaceholder(owner, detail, compSpec, placeholders);\n } else {\n return adt$2.single(false, constant(compSpec));\n }\n };\n var substitute = function (owner, detail, compSpec, placeholders) {\n var base = scan(owner, detail, compSpec, placeholders);\n return base.fold(function (req, valueThunk) {\n var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail);\n var childSpecs = get(value, 'components').getOr([]);\n var substituted = bind(childSpecs, function (c) {\n return substitute(owner, detail, c, placeholders);\n });\n return [__assign(__assign({}, value), { components: substituted })];\n }, function (req, valuesThunk) {\n if (isSubstituted(compSpec)) {\n var values = valuesThunk(detail, compSpec.config, compSpec.validated);\n var preprocessor = compSpec.validated.preprocess.getOr(identity);\n return preprocessor(values);\n } else {\n return valuesThunk(detail);\n }\n });\n };\n var substituteAll = function (owner, detail, components, placeholders) {\n return bind(components, function (c) {\n return substitute(owner, detail, c, placeholders);\n });\n };\n var oneReplace = function (label, replacements) {\n var called = false;\n var used = function () {\n return called;\n };\n var replace = function () {\n if (called) {\n throw new Error('Trying to use the same placeholder more than once: ' + label);\n }\n called = true;\n return replacements;\n };\n var required = function () {\n return replacements.fold(function (req, _) {\n return req;\n }, function (req, _) {\n return req;\n });\n };\n return {\n name: constant(label),\n required: required,\n used: used,\n replace: replace\n };\n };\n var substitutePlaces = function (owner, detail, components, placeholders) {\n var ps = map(placeholders, function (ph, name) {\n return oneReplace(name, ph);\n });\n var outcome = substituteAll(owner, detail, components, ps);\n each(ps, function (p) {\n if (p.used() === false && p.required()) {\n throw new Error('Placeholder: ' + p.name() + ' was not found in components list\\nNamespace: ' + owner.getOr('none') + '\\nComponents: ' + JSON.stringify(detail.components, null, 2));\n }\n });\n return outcome;\n };\n var single = adt$2.single;\n var multiple = adt$2.multiple;\n var placeholder = constant(_placeholder);\n\n var unique = 0;\n var generate$1 = function (prefix) {\n var date = new Date();\n var time = date.getTime();\n var random = Math.floor(Math.random() * 1000000000);\n unique++;\n return prefix + '_' + random + unique + String(time);\n };\n\n var adt$3 = Adt.generate([\n { required: ['data'] },\n { external: ['data'] },\n { optional: ['data'] },\n { group: ['data'] }\n ]);\n var fFactory = defaulted$1('factory', { sketch: identity });\n var fSchema = defaulted$1('schema', []);\n var fName = strict$1('name');\n var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) {\n return '';\n }), anyValue$1());\n var fGroupSchema = state$1('schema', function () {\n return [option('preprocess')];\n });\n var fDefaults = defaulted$1('defaults', constant({}));\n var fOverrides = defaulted$1('overrides', constant({}));\n var requiredSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fPname,\n fDefaults,\n fOverrides\n ]);\n var externalSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fDefaults,\n fOverrides\n ]);\n var optionalSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fPname,\n fDefaults,\n fOverrides\n ]);\n var groupSpec = objOf([\n fFactory,\n fGroupSchema,\n fName,\n strict$1('unit'),\n fPname,\n fDefaults,\n fOverrides\n ]);\n var asNamedPart = function (part) {\n return part.fold(Option.some, Option.none, Option.some, Option.some);\n };\n var name$1 = function (part) {\n var get = function (data) {\n return data.name;\n };\n return part.fold(get, get, get, get);\n };\n var convert = function (adtConstructor, partSchema) {\n return function (spec) {\n var data = asRawOrDie('Converting part type', partSchema, spec);\n return adtConstructor(data);\n };\n };\n var required = convert(adt$3.required, requiredSpec);\n var external = convert(adt$3.external, externalSpec);\n var optional = convert(adt$3.optional, optionalSpec);\n var group = convert(adt$3.group, groupSpec);\n var original = constant('entirety');\n\n var combine = function (detail, data, partSpec, partValidated) {\n return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated));\n };\n var subs = function (owner, detail, parts) {\n var internals = {};\n var externals = {};\n each$1(parts, function (part) {\n part.fold(function (data) {\n internals[data.pname] = single(true, function (detail, partSpec, partValidated) {\n return data.factory.sketch(combine(detail, data, partSpec, partValidated));\n });\n }, function (data) {\n var partSpec = detail.parts[data.name];\n externals[data.name] = constant(data.factory.sketch(combine(detail, data, partSpec[original()]), partSpec));\n }, function (data) {\n internals[data.pname] = single(false, function (detail, partSpec, partValidated) {\n return data.factory.sketch(combine(detail, data, partSpec, partValidated));\n });\n }, function (data) {\n internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) {\n var units = detail[data.name];\n return map$1(units, function (u) {\n return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u)));\n });\n });\n });\n });\n return {\n internals: constant(internals),\n externals: constant(externals)\n };\n };\n\n var generate$2 = function (owner, parts) {\n var r = {};\n each$1(parts, function (part) {\n asNamedPart(part).each(function (np) {\n var g = doGenerateOne(owner, np.pname);\n r[np.name] = function (config) {\n var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config);\n return __assign(__assign({}, g), {\n config: config,\n validated: validated\n });\n };\n });\n });\n return r;\n };\n var doGenerateOne = function (owner, pname) {\n return {\n uiType: placeholder(),\n owner: owner,\n name: pname\n };\n };\n var generateOne = function (owner, pname, config) {\n return {\n uiType: placeholder(),\n owner: owner,\n name: pname,\n config: config,\n validated: {}\n };\n };\n var schemas = function (parts) {\n return bind(parts, function (part) {\n return part.fold(Option.none, Option.some, Option.none, Option.none).map(function (data) {\n return strictObjOf(data.name, data.schema.concat([snapshot(original())]));\n }).toArray();\n });\n };\n var names = function (parts) {\n return map$1(parts, name$1);\n };\n var substitutes = function (owner, detail, parts) {\n return subs(owner, detail, parts);\n };\n var components = function (owner, detail, internals) {\n return substitutePlaces(Option.some(owner), detail, detail.components, internals);\n };\n var getPart = function (component, detail, partKey) {\n var uid = detail.partUids[partKey];\n return component.getSystem().getByUid(uid).toOption();\n };\n var getPartOrDie = function (component, detail, partKey) {\n return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey);\n };\n var getAllParts = function (component, detail) {\n var system = component.getSystem();\n return map(detail.partUids, function (pUid, _k) {\n return constant(system.getByUid(pUid));\n });\n };\n var defaultUids = function (baseUid, partTypes) {\n var partNames = names(partTypes);\n return wrapAll$1(map$1(partNames, function (pn) {\n return {\n key: pn,\n value: baseUid + '-' + pn\n };\n }));\n };\n var defaultUidsSchema = function (partTypes) {\n return field('partUids', 'partUids', mergeWithThunk(function (spec) {\n return defaultUids(spec.uid, partTypes);\n }), anyValue$1());\n };\n\n var premadeTag = generate$1('alloy-premade');\n var premade = function (comp) {\n return wrap$1(premadeTag, comp);\n };\n var getPremade = function (spec) {\n return get(spec, premadeTag);\n };\n var makeApi = function (f) {\n return markAsSketchApi(function (component) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n return f.apply(void 0, __spreadArrays([\n component.getApis(),\n component\n ], rest));\n }, f);\n };\n\n var prefix$1 = constant('alloy-id-');\n var idAttr = constant('data-alloy-id');\n\n var prefix$2 = prefix$1();\n var idAttr$1 = idAttr();\n var write = function (label, elem) {\n var id = generate$1(prefix$2 + label);\n writeOnly(elem, id);\n return id;\n };\n var writeOnly = function (elem, uid) {\n Object.defineProperty(elem.dom(), idAttr$1, {\n value: uid,\n writable: true\n });\n };\n var read$2 = function (elem) {\n var id = isElement(elem) ? elem.dom()[idAttr$1] : null;\n return Option.from(id);\n };\n var generate$3 = function (prefix) {\n return generate$1(prefix);\n };\n\n var base = function (partSchemas, partUidsSchemas) {\n var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : [];\n return ps.concat([\n strict$1('uid'),\n defaulted$1('dom', {}),\n defaulted$1('components', []),\n snapshot('originalSpec'),\n defaulted$1('debug.sketcher', {})\n ]).concat(partUidsSchemas);\n };\n var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) {\n var baseS = base(partSchemas, partUidsSchemas);\n return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec);\n };\n\n var single$1 = function (owner, schema, factory, spec) {\n var specWithUid = supplyUid(spec);\n var detail = asRawOrDie$1(owner, schema, specWithUid, [], []);\n return factory(detail, specWithUid);\n };\n var composite = function (owner, schema, partTypes, factory, spec) {\n var specWithUid = supplyUid(spec);\n var partSchemas = schemas(partTypes);\n var partUidsSchema = defaultUidsSchema(partTypes);\n var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]);\n var subs = substitutes(owner, detail, partTypes);\n var components$1 = components(owner, detail, subs.internals());\n return factory(detail, components$1, specWithUid, subs.externals());\n };\n var hasUid = function (spec) {\n return has(spec, 'uid');\n };\n var supplyUid = function (spec) {\n return hasUid(spec) ? spec : __assign(__assign({}, spec), { uid: generate$3('uid') });\n };\n\n function isSketchSpec(spec) {\n return spec.uid !== undefined;\n }\n var singleSchema = objOfOnly([\n strict$1('name'),\n strict$1('factory'),\n strict$1('configFields'),\n defaulted$1('apis', {}),\n defaulted$1('extraApis', {})\n ]);\n var compositeSchema = objOfOnly([\n strict$1('name'),\n strict$1('factory'),\n strict$1('configFields'),\n strict$1('partFields'),\n defaulted$1('apis', {}),\n defaulted$1('extraApis', {})\n ]);\n var single$2 = function (rawConfig) {\n var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig);\n var sketch = function (spec) {\n return single$1(config.name, config.configFields, config.factory, spec);\n };\n var apis = map(config.apis, makeApi);\n var extraApis = map(config.extraApis, function (f, k) {\n return markAsExtraApi(f, k);\n });\n return __assign(__assign({\n name: constant(config.name),\n configFields: constant(config.configFields),\n sketch: sketch\n }, apis), extraApis);\n };\n var composite$1 = function (rawConfig) {\n var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig);\n var sketch = function (spec) {\n return composite(config.name, config.configFields, config.partFields, config.factory, spec);\n };\n var parts = generate$2(config.name, config.partFields);\n var apis = map(config.apis, makeApi);\n var extraApis = map(config.extraApis, function (f, k) {\n return markAsExtraApi(f, k);\n });\n return __assign(__assign({\n name: constant(config.name),\n partFields: constant(config.partFields),\n configFields: constant(config.configFields),\n sketch: sketch,\n parts: constant(parts)\n }, apis), extraApis);\n };\n\n var factory = function (detail) {\n var events = events$2(detail.action);\n var tag = detail.dom.tag;\n var lookupAttr = function (attr) {\n return get(detail.dom, 'attributes').bind(function (attrs) {\n return get(attrs, attr);\n });\n };\n var getModAttributes = function () {\n if (tag === 'button') {\n var type = lookupAttr('type').getOr('button');\n var roleAttrs = lookupAttr('role').map(function (role) {\n return { role: role };\n }).getOr({});\n return __assign({ type: type }, roleAttrs);\n } else {\n var role = lookupAttr('role').getOr('button');\n return { role: role };\n }\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: detail.components,\n events: events,\n behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [\n Focusing.config({}),\n Keying.config({\n mode: 'execution',\n useSpace: true,\n useEnter: true\n })\n ]),\n domModification: { attributes: getModAttributes() },\n eventOrder: detail.eventOrder\n };\n };\n var Button = single$2({\n name: 'Button',\n factory: factory,\n configFields: [\n defaulted$1('uid', undefined),\n strict$1('dom'),\n defaulted$1('components', []),\n SketchBehaviours.field('buttonBehaviours', [\n Focusing,\n Keying\n ]),\n option('action'),\n option('role'),\n defaulted$1('eventOrder', {})\n ]\n });\n\n var exhibit$2 = function () {\n return nu$5({\n styles: {\n '-webkit-user-select': 'none',\n 'user-select': 'none',\n '-ms-user-select': 'none',\n '-moz-user-select': '-moz-none'\n },\n attributes: { unselectable: 'on' }\n });\n };\n var events$4 = function () {\n return derive([abort(selectstart(), constant(true))]);\n };\n\n var ActiveUnselecting = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$4,\n exhibit: exhibit$2\n });\n\n var Unselecting = create$1({\n fields: [],\n name: 'unselecting',\n active: ActiveUnselecting\n });\n\n var getAttrs = function (elem) {\n var attributes = elem.dom().attributes !== undefined ? elem.dom().attributes : [];\n return foldl(attributes, function (b, attr) {\n var _a;\n if (attr.name === 'class') {\n return b;\n } else {\n return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a));\n }\n }, {});\n };\n var getClasses = function (elem) {\n return Array.prototype.slice.call(elem.dom().classList, 0);\n };\n var fromHtml$2 = function (html) {\n var elem = Element.fromHtml(html);\n var children$1 = children(elem);\n var attrs = getAttrs(elem);\n var classes = getClasses(elem);\n var contents = children$1.length === 0 ? {} : { innerHtml: get$3(elem) };\n return __assign({\n tag: name(elem),\n classes: classes,\n attributes: attrs\n }, contents);\n };\n\n var dom$1 = function (rawHtml) {\n var html = supplant(rawHtml, { prefix: prefix });\n return fromHtml$2(html);\n };\n var spec = function (rawHtml) {\n return { dom: dom$1(rawHtml) };\n };\n\n var forToolbarCommand = function (editor, command) {\n return forToolbar(command, function () {\n editor.execCommand(command);\n }, {}, editor);\n };\n var getToggleBehaviours = function (command) {\n return derive$1([\n Toggling.config({\n toggleClass: resolve('toolbar-button-selected'),\n toggleOnExecute: false,\n aria: { mode: 'pressed' }\n }),\n format(command, function (button, status) {\n var toggle = status ? Toggling.on : Toggling.off;\n toggle(button);\n })\n ]);\n };\n var forToolbarStateCommand = function (editor, command) {\n var extraBehaviours = getToggleBehaviours(command);\n return forToolbar(command, function () {\n editor.execCommand(command);\n }, extraBehaviours, editor);\n };\n var forToolbarStateAction = function (editor, clazz, command, action) {\n var extraBehaviours = getToggleBehaviours(command);\n return forToolbar(clazz, action, extraBehaviours, editor);\n };\n var getToolbarIconButton = function (clazz, editor) {\n var icons = editor.ui.registry.getAll().icons;\n var optOxideIcon = Option.from(icons[clazz]);\n return optOxideIcon.fold(function () {\n return dom$1('');\n }, function (icon) {\n return dom$1('' + icon + '');\n });\n };\n var forToolbar = function (clazz, action, extraBehaviours, editor) {\n return Button.sketch({\n dom: getToolbarIconButton(clazz, editor),\n action: action,\n buttonBehaviours: deepMerge(derive$1([Unselecting.config({})]), extraBehaviours)\n });\n };\n\n var labelPart = optional({\n schema: [strict$1('dom')],\n name: 'label'\n });\n var edgePart = function (name) {\n return optional({\n name: '' + name + '-edge',\n overrides: function (detail) {\n var action = detail.model.manager.edgeActions[name];\n return action.fold(function () {\n return {};\n }, function (a) {\n return {\n events: derive([\n runActionExtra(touchstart(), function (comp, se, d) {\n return a(comp, d);\n }, [detail]),\n runActionExtra(mousedown(), function (comp, se, d) {\n return a(comp, d);\n }, [detail]),\n runActionExtra(mousemove(), function (comp, se, det) {\n if (det.mouseIsDown.get()) {\n a(comp, det);\n }\n }, [detail])\n ])\n };\n });\n }\n });\n };\n var tlEdgePart = edgePart('top-left');\n var tedgePart = edgePart('top');\n var trEdgePart = edgePart('top-right');\n var redgePart = edgePart('right');\n var brEdgePart = edgePart('bottom-right');\n var bedgePart = edgePart('bottom');\n var blEdgePart = edgePart('bottom-left');\n var ledgePart = edgePart('left');\n var thumbPart = required({\n name: 'thumb',\n defaults: constant({ dom: { styles: { position: 'absolute' } } }),\n overrides: function (detail) {\n return {\n events: derive([\n redirectToPart(touchstart(), detail, 'spectrum'),\n redirectToPart(touchmove(), detail, 'spectrum'),\n redirectToPart(touchend(), detail, 'spectrum'),\n redirectToPart(mousedown(), detail, 'spectrum'),\n redirectToPart(mousemove(), detail, 'spectrum'),\n redirectToPart(mouseup(), detail, 'spectrum')\n ])\n };\n }\n });\n var spectrumPart = required({\n schema: [state$1('mouseIsDown', function () {\n return Cell(false);\n })],\n name: 'spectrum',\n overrides: function (detail) {\n var modelDetail = detail.model;\n var model = modelDetail.manager;\n var setValueFrom = function (component, simulatedEvent) {\n return model.getValueFromEvent(simulatedEvent).map(function (value) {\n return model.setValueFrom(component, detail, value);\n });\n };\n return {\n behaviours: derive$1([\n Keying.config({\n mode: 'special',\n onLeft: function (spectrum) {\n return model.onLeft(spectrum, detail);\n },\n onRight: function (spectrum) {\n return model.onRight(spectrum, detail);\n },\n onUp: function (spectrum) {\n return model.onUp(spectrum, detail);\n },\n onDown: function (spectrum) {\n return model.onDown(spectrum, detail);\n }\n }),\n Focusing.config({})\n ]),\n events: derive([\n run(touchstart(), setValueFrom),\n run(touchmove(), setValueFrom),\n run(mousedown(), setValueFrom),\n run(mousemove(), function (spectrum, se) {\n if (detail.mouseIsDown.get()) {\n setValueFrom(spectrum, se);\n }\n })\n ])\n };\n }\n });\n var SliderParts = [\n labelPart,\n ledgePart,\n redgePart,\n tedgePart,\n bedgePart,\n tlEdgePart,\n trEdgePart,\n blEdgePart,\n brEdgePart,\n thumbPart,\n spectrumPart\n ];\n\n var onLoad$1 = function (component, repConfig, repState) {\n repConfig.store.manager.onLoad(component, repConfig, repState);\n };\n var onUnload = function (component, repConfig, repState) {\n repConfig.store.manager.onUnload(component, repConfig, repState);\n };\n var setValue = function (component, repConfig, repState, data) {\n repConfig.store.manager.setValue(component, repConfig, repState, data);\n };\n var getValue = function (component, repConfig, repState) {\n return repConfig.store.manager.getValue(component, repConfig, repState);\n };\n var getState = function (component, repConfig, repState) {\n return repState;\n };\n\n var RepresentApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n onLoad: onLoad$1,\n onUnload: onUnload,\n setValue: setValue,\n getValue: getValue,\n getState: getState\n });\n\n var events$5 = function (repConfig, repState) {\n var es = repConfig.resetOnDom ? [\n runOnAttached(function (comp, _se) {\n onLoad$1(comp, repConfig, repState);\n }),\n runOnDetached(function (comp, _se) {\n onUnload(comp, repConfig, repState);\n })\n ] : [loadEvent(repConfig, repState, onLoad$1)];\n return derive(es);\n };\n\n var ActiveRepresenting = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$5\n });\n\n var memory = function () {\n var data = Cell(null);\n var readState = function () {\n return {\n mode: 'memory',\n value: data.get()\n };\n };\n var isNotSet = function () {\n return data.get() === null;\n };\n var clear = function () {\n data.set(null);\n };\n return nu$6({\n set: data.set,\n get: data.get,\n isNotSet: isNotSet,\n clear: clear,\n readState: readState\n });\n };\n var manual = function () {\n var readState = function () {\n };\n return nu$6({ readState: readState });\n };\n var dataset = function () {\n var dataByValue = Cell({});\n var dataByText = Cell({});\n var readState = function () {\n return {\n mode: 'dataset',\n dataByValue: dataByValue.get(),\n dataByText: dataByText.get()\n };\n };\n var clear = function () {\n dataByValue.set({});\n dataByText.set({});\n };\n var lookup = function (itemString) {\n return get(dataByValue.get(), itemString).orThunk(function () {\n return get(dataByText.get(), itemString);\n });\n };\n var update = function (items) {\n var currentDataByValue = dataByValue.get();\n var currentDataByText = dataByText.get();\n var newDataByValue = {};\n var newDataByText = {};\n each$1(items, function (item) {\n newDataByValue[item.value] = item;\n get(item, 'meta').each(function (meta) {\n get(meta, 'text').each(function (text) {\n newDataByText[text] = item;\n });\n });\n });\n dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue));\n dataByText.set(__assign(__assign({}, currentDataByText), newDataByText));\n };\n return nu$6({\n readState: readState,\n lookup: lookup,\n update: update,\n clear: clear\n });\n };\n var init$1 = function (spec) {\n return spec.store.manager.state(spec);\n };\n\n var RepresentState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n memory: memory,\n dataset: dataset,\n manual: manual,\n init: init$1\n });\n\n var setValue$1 = function (component, repConfig, repState, data) {\n var store = repConfig.store;\n repState.update([data]);\n store.setValue(component, data);\n repConfig.onSetValue(component, data);\n };\n var getValue$1 = function (component, repConfig, repState) {\n var store = repConfig.store;\n var key = store.getDataKey(component);\n return repState.lookup(key).fold(function () {\n return store.getFallbackEntry(key);\n }, function (data) {\n return data;\n });\n };\n var onLoad$2 = function (component, repConfig, repState) {\n var store = repConfig.store;\n store.initialValue.each(function (data) {\n setValue$1(component, repConfig, repState, data);\n });\n };\n var onUnload$1 = function (component, repConfig, repState) {\n repState.clear();\n };\n var DatasetStore = [\n option('initialValue'),\n strict$1('getFallbackEntry'),\n strict$1('getDataKey'),\n strict$1('setValue'),\n output('manager', {\n setValue: setValue$1,\n getValue: getValue$1,\n onLoad: onLoad$2,\n onUnload: onUnload$1,\n state: dataset\n })\n ];\n\n var getValue$2 = function (component, repConfig, _repState) {\n return repConfig.store.getValue(component);\n };\n var setValue$2 = function (component, repConfig, _repState, data) {\n repConfig.store.setValue(component, data);\n repConfig.onSetValue(component, data);\n };\n var onLoad$3 = function (component, repConfig, _repState) {\n repConfig.store.initialValue.each(function (data) {\n repConfig.store.setValue(component, data);\n });\n };\n var ManualStore = [\n strict$1('getValue'),\n defaulted$1('setValue', noop),\n option('initialValue'),\n output('manager', {\n setValue: setValue$2,\n getValue: getValue$2,\n onLoad: onLoad$3,\n onUnload: noop,\n state: NoState.init\n })\n ];\n\n var setValue$3 = function (component, repConfig, repState, data) {\n repState.set(data);\n repConfig.onSetValue(component, data);\n };\n var getValue$3 = function (component, repConfig, repState) {\n return repState.get();\n };\n var onLoad$4 = function (component, repConfig, repState) {\n repConfig.store.initialValue.each(function (initVal) {\n if (repState.isNotSet()) {\n repState.set(initVal);\n }\n });\n };\n var onUnload$2 = function (component, repConfig, repState) {\n repState.clear();\n };\n var MemoryStore = [\n option('initialValue'),\n output('manager', {\n setValue: setValue$3,\n getValue: getValue$3,\n onLoad: onLoad$4,\n onUnload: onUnload$2,\n state: memory\n })\n ];\n\n var RepresentSchema = [\n defaultedOf('store', { mode: 'memory' }, choose$1('mode', {\n memory: MemoryStore,\n manual: ManualStore,\n dataset: DatasetStore\n })),\n onHandler('onSetValue'),\n defaulted$1('resetOnDom', false)\n ];\n\n var Representing = create$1({\n fields: RepresentSchema,\n name: 'representing',\n active: ActiveRepresenting,\n apis: RepresentApis,\n extra: {\n setValueFrom: function (component, source) {\n var value = Representing.getValue(source);\n Representing.setValue(component, value);\n }\n },\n state: RepresentState\n });\n\n var api$1 = Dimension('width', function (element) {\n return element.dom().offsetWidth;\n });\n var set$4 = function (element, h) {\n return api$1.set(element, h);\n };\n var get$7 = function (element) {\n return api$1.get(element);\n };\n\n var r = function (left, top) {\n var translate = function (x, y) {\n return r(left + x, top + y);\n };\n return {\n left: constant(left),\n top: constant(top),\n translate: translate\n };\n };\n var Position = r;\n\n var _sliderChangeEvent = 'slider.change.value';\n var sliderChangeEvent = constant(_sliderChangeEvent);\n var isTouchEvent = function (evt) {\n return evt.type.indexOf('touch') !== -1;\n };\n var getEventSource = function (simulatedEvent) {\n var evt = simulatedEvent.event().raw();\n if (isTouchEvent(evt)) {\n var touchEvent = evt;\n return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Option.some(touchEvent.touches[0]).map(function (t) {\n return Position(t.clientX, t.clientY);\n }) : Option.none();\n } else {\n var mouseEvent = evt;\n return mouseEvent.clientX !== undefined ? Option.some(mouseEvent).map(function (me) {\n return Position(me.clientX, me.clientY);\n }) : Option.none();\n }\n };\n\n var t = 'top', r$1 = 'right', b = 'bottom', l = 'left';\n var minX = function (detail) {\n return detail.model.minX;\n };\n var minY = function (detail) {\n return detail.model.minY;\n };\n var min1X = function (detail) {\n return detail.model.minX - 1;\n };\n var min1Y = function (detail) {\n return detail.model.minY - 1;\n };\n var maxX = function (detail) {\n return detail.model.maxX;\n };\n var maxY = function (detail) {\n return detail.model.maxY;\n };\n var max1X = function (detail) {\n return detail.model.maxX + 1;\n };\n var max1Y = function (detail) {\n return detail.model.maxY + 1;\n };\n var range = function (detail, max, min) {\n return max(detail) - min(detail);\n };\n var xRange = function (detail) {\n return range(detail, maxX, minX);\n };\n var yRange = function (detail) {\n return range(detail, maxY, minY);\n };\n var halfX = function (detail) {\n return xRange(detail) / 2;\n };\n var halfY = function (detail) {\n return yRange(detail) / 2;\n };\n var step = function (detail) {\n return detail.stepSize;\n };\n var snap = function (detail) {\n return detail.snapToGrid;\n };\n var snapStart = function (detail) {\n return detail.snapStart;\n };\n var rounded = function (detail) {\n return detail.rounded;\n };\n var hasEdge = function (detail, edgeName) {\n return detail[edgeName + '-edge'] !== undefined;\n };\n var hasLEdge = function (detail) {\n return hasEdge(detail, l);\n };\n var hasREdge = function (detail) {\n return hasEdge(detail, r$1);\n };\n var hasTEdge = function (detail) {\n return hasEdge(detail, t);\n };\n var hasBEdge = function (detail) {\n return hasEdge(detail, b);\n };\n var currentValue = function (detail) {\n return detail.model.value.get();\n };\n\n var xValue = function (x) {\n return { x: constant(x) };\n };\n var yValue = function (y) {\n return { y: constant(y) };\n };\n var xyValue = function (x, y) {\n return {\n x: constant(x),\n y: constant(y)\n };\n };\n var fireSliderChange = function (component, value) {\n emitWith(component, sliderChangeEvent(), { value: value });\n };\n var setToTLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail)));\n };\n var setToTEdge = function (edge, detail) {\n fireSliderChange(edge, yValue(min1Y(detail)));\n };\n var setToTEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail)));\n };\n var setToTREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail)));\n };\n var setToREdge = function (edge, detail) {\n fireSliderChange(edge, xValue(max1X(detail)));\n };\n var setToREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), halfY(detail)));\n };\n var setToBREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail)));\n };\n var setToBEdge = function (edge, detail) {\n fireSliderChange(edge, yValue(max1Y(detail)));\n };\n var setToBEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail)));\n };\n var setToBLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail)));\n };\n var setToLEdge = function (edge, detail) {\n fireSliderChange(edge, xValue(min1X(detail)));\n };\n var setToLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), halfY(detail)));\n };\n\n var reduceBy = function (value, min, max, step) {\n if (value < min) {\n return value;\n } else if (value > max) {\n return max;\n } else if (value === min) {\n return min - 1;\n } else {\n return Math.max(min, value - step);\n }\n };\n var increaseBy = function (value, min, max, step) {\n if (value > max) {\n return value;\n } else if (value < min) {\n return min;\n } else if (value === max) {\n return max + 1;\n } else {\n return Math.min(max, value + step);\n }\n };\n var capValue = function (value, min, max) {\n return Math.max(min, Math.min(max, value));\n };\n var snapValueOf = function (value, min, max, step, snapStart) {\n return snapStart.fold(function () {\n var initValue = value - min;\n var extraValue = Math.round(initValue / step) * step;\n return capValue(min + extraValue, min - 1, max + 1);\n }, function (start) {\n var remainder = (value - start) % step;\n var adjustment = Math.round(remainder / step);\n var rawSteps = Math.floor((value - start) / step);\n var maxSteps = Math.floor((max - start) / step);\n var numSteps = Math.min(maxSteps, rawSteps + adjustment);\n var r = start + numSteps * step;\n return Math.max(start, r);\n });\n };\n var findOffsetOf = function (value, min, max) {\n return Math.min(max, Math.max(value, min)) - min;\n };\n var findValueOf = function (args) {\n var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange;\n var capMin = hasMinEdge ? min - 1 : min;\n var capMax = hasMaxEdge ? max + 1 : max;\n if (value < minBound) {\n return capMin;\n } else if (value > maxBound) {\n return capMax;\n } else {\n var offset = findOffsetOf(value, minBound, maxBound);\n var newValue = capValue(offset / screenRange * range + min, capMin, capMax);\n if (snap && newValue >= min && newValue <= max) {\n return snapValueOf(newValue, min, max, step, snapStart);\n } else if (rounded) {\n return Math.round(newValue);\n } else {\n return newValue;\n }\n }\n };\n var findOffsetOfValue = function (args) {\n var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge;\n if (value < min) {\n return hasMinEdge ? 0 : centerMinEdge;\n } else if (value > max) {\n return hasMaxEdge ? maxBound : centerMaxEdge;\n } else {\n return (value - min) / range * maxOffset;\n }\n };\n\n var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height';\n var getBounds = function (component) {\n return component.element().dom().getBoundingClientRect();\n };\n var getBoundsProperty = function (bounds, property) {\n return bounds[property];\n };\n var getMinXBounds = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, left);\n };\n var getMaxXBounds = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, right);\n };\n var getMinYBounds = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, top);\n };\n var getMaxYBounds = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, bottom);\n };\n var getXScreenRange = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, width);\n };\n var getYScreenRange = function (component) {\n var bounds = getBounds(component);\n return getBoundsProperty(bounds, height);\n };\n var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) {\n return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge;\n };\n var getXCenterOffSetOf = function (component, spectrum) {\n var componentBounds = getBounds(component);\n var spectrumBounds = getBounds(spectrum);\n var componentMinEdge = getBoundsProperty(componentBounds, left);\n var componentMaxEdge = getBoundsProperty(componentBounds, right);\n var spectrumMinEdge = getBoundsProperty(spectrumBounds, left);\n return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);\n };\n var getYCenterOffSetOf = function (component, spectrum) {\n var componentBounds = getBounds(component);\n var spectrumBounds = getBounds(spectrum);\n var componentMinEdge = getBoundsProperty(componentBounds, top);\n var componentMaxEdge = getBoundsProperty(componentBounds, bottom);\n var spectrumMinEdge = getBoundsProperty(spectrumBounds, top);\n return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);\n };\n\n var fireSliderChange$1 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue = function (x) {\n return { x: constant(x) };\n };\n var findValueOfOffset = function (spectrum, detail, left) {\n var args = {\n min: minX(detail),\n max: maxX(detail),\n range: xRange(detail),\n value: left,\n step: step(detail),\n snap: snap(detail),\n snapStart: snapStart(detail),\n rounded: rounded(detail),\n hasMinEdge: hasLEdge(detail),\n hasMaxEdge: hasREdge(detail),\n minBound: getMinXBounds(spectrum),\n maxBound: getMaxXBounds(spectrum),\n screenRange: getXScreenRange(spectrum)\n };\n return findValueOf(args);\n };\n var setValueFrom = function (spectrum, detail, value) {\n var xValue = findValueOfOffset(spectrum, detail, value);\n var sliderVal = sliderValue(xValue);\n fireSliderChange$1(spectrum, sliderVal);\n return xValue;\n };\n var setToMin = function (spectrum, detail) {\n var min = minX(detail);\n fireSliderChange$1(spectrum, sliderValue(min));\n };\n var setToMax = function (spectrum, detail) {\n var max = maxX(detail);\n fireSliderChange$1(spectrum, sliderValue(max));\n };\n var moveBy = function (direction, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var xValue = f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail));\n fireSliderChange$1(spectrum, sliderValue(xValue));\n return Option.some(xValue);\n };\n var handleMovement = function (direction) {\n return function (spectrum, detail) {\n return moveBy(direction, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var getValueFromEvent = function (simulatedEvent) {\n var pos = getEventSource(simulatedEvent);\n return pos.map(function (p) {\n return p.left();\n });\n };\n var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) {\n var minOffset = 0;\n var maxOffset = getXScreenRange(spectrum);\n var centerMinEdge = minEdge.bind(function (edge) {\n return Option.some(getXCenterOffSetOf(edge, spectrum));\n }).getOr(minOffset);\n var centerMaxEdge = maxEdge.bind(function (edge) {\n return Option.some(getXCenterOffSetOf(edge, spectrum));\n }).getOr(maxOffset);\n var args = {\n min: minX(detail),\n max: maxX(detail),\n range: xRange(detail),\n value: value,\n hasMinEdge: hasLEdge(detail),\n hasMaxEdge: hasREdge(detail),\n minBound: getMinXBounds(spectrum),\n minOffset: minOffset,\n maxBound: getMaxXBounds(spectrum),\n maxOffset: maxOffset,\n centerMinEdge: centerMinEdge,\n centerMaxEdge: centerMaxEdge\n };\n return findOffsetOfValue(args);\n };\n var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) {\n var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge);\n return getMinXBounds(spectrum) - getMinXBounds(slider) + offset;\n };\n var setPositionFromValue = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail);\n var thumbRadius = get$7(thumb.element()) / 2;\n set$3(thumb.element(), 'left', pos - thumbRadius + 'px');\n };\n var onLeft = handleMovement(-1);\n var onRight = handleMovement(1);\n var onUp = Option.none;\n var onDown = Option.none;\n var edgeActions = {\n 'top-left': Option.none(),\n 'top': Option.none(),\n 'top-right': Option.none(),\n 'right': Option.some(setToREdge),\n 'bottom-right': Option.none(),\n 'bottom': Option.none(),\n 'bottom-left': Option.none(),\n 'left': Option.some(setToLEdge)\n };\n\n var HorizontalModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom,\n setToMin: setToMin,\n setToMax: setToMax,\n findValueOfOffset: findValueOfOffset,\n getValueFromEvent: getValueFromEvent,\n findPositionOfValue: findPositionOfValue,\n setPositionFromValue: setPositionFromValue,\n onLeft: onLeft,\n onRight: onRight,\n onUp: onUp,\n onDown: onDown,\n edgeActions: edgeActions\n });\n\n var fireSliderChange$2 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue$1 = function (y) {\n return { y: constant(y) };\n };\n var findValueOfOffset$1 = function (spectrum, detail, top) {\n var args = {\n min: minY(detail),\n max: maxY(detail),\n range: yRange(detail),\n value: top,\n step: step(detail),\n snap: snap(detail),\n snapStart: snapStart(detail),\n rounded: rounded(detail),\n hasMinEdge: hasTEdge(detail),\n hasMaxEdge: hasBEdge(detail),\n minBound: getMinYBounds(spectrum),\n maxBound: getMaxYBounds(spectrum),\n screenRange: getYScreenRange(spectrum)\n };\n return findValueOf(args);\n };\n var setValueFrom$1 = function (spectrum, detail, value) {\n var yValue = findValueOfOffset$1(spectrum, detail, value);\n var sliderVal = sliderValue$1(yValue);\n fireSliderChange$2(spectrum, sliderVal);\n return yValue;\n };\n var setToMin$1 = function (spectrum, detail) {\n var min = minY(detail);\n fireSliderChange$2(spectrum, sliderValue$1(min));\n };\n var setToMax$1 = function (spectrum, detail) {\n var max = maxY(detail);\n fireSliderChange$2(spectrum, sliderValue$1(max));\n };\n var moveBy$1 = function (direction, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var yValue = f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail));\n fireSliderChange$2(spectrum, sliderValue$1(yValue));\n return Option.some(yValue);\n };\n var handleMovement$1 = function (direction) {\n return function (spectrum, detail) {\n return moveBy$1(direction, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var getValueFromEvent$1 = function (simulatedEvent) {\n var pos = getEventSource(simulatedEvent);\n return pos.map(function (p) {\n return p.top();\n });\n };\n var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) {\n var minOffset = 0;\n var maxOffset = getYScreenRange(spectrum);\n var centerMinEdge = minEdge.bind(function (edge) {\n return Option.some(getYCenterOffSetOf(edge, spectrum));\n }).getOr(minOffset);\n var centerMaxEdge = maxEdge.bind(function (edge) {\n return Option.some(getYCenterOffSetOf(edge, spectrum));\n }).getOr(maxOffset);\n var args = {\n min: minY(detail),\n max: maxY(detail),\n range: yRange(detail),\n value: value,\n hasMinEdge: hasTEdge(detail),\n hasMaxEdge: hasBEdge(detail),\n minBound: getMinYBounds(spectrum),\n minOffset: minOffset,\n maxBound: getMaxYBounds(spectrum),\n maxOffset: maxOffset,\n centerMinEdge: centerMinEdge,\n centerMaxEdge: centerMaxEdge\n };\n return findOffsetOfValue(args);\n };\n var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) {\n var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge);\n return getMinYBounds(spectrum) - getMinYBounds(slider) + offset;\n };\n var setPositionFromValue$1 = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail);\n var thumbRadius = get$5(thumb.element()) / 2;\n set$3(thumb.element(), 'top', pos - thumbRadius + 'px');\n };\n var onLeft$1 = Option.none;\n var onRight$1 = Option.none;\n var onUp$1 = handleMovement$1(-1);\n var onDown$1 = handleMovement$1(1);\n var edgeActions$1 = {\n 'top-left': Option.none(),\n 'top': Option.some(setToTEdge),\n 'top-right': Option.none(),\n 'right': Option.none(),\n 'bottom-right': Option.none(),\n 'bottom': Option.some(setToBEdge),\n 'bottom-left': Option.none(),\n 'left': Option.none()\n };\n\n var VerticalModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom$1,\n setToMin: setToMin$1,\n setToMax: setToMax$1,\n findValueOfOffset: findValueOfOffset$1,\n getValueFromEvent: getValueFromEvent$1,\n findPositionOfValue: findPositionOfValue$1,\n setPositionFromValue: setPositionFromValue$1,\n onLeft: onLeft$1,\n onRight: onRight$1,\n onUp: onUp$1,\n onDown: onDown$1,\n edgeActions: edgeActions$1\n });\n\n var fireSliderChange$3 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue$2 = function (x, y) {\n return {\n x: constant(x),\n y: constant(y)\n };\n };\n var setValueFrom$2 = function (spectrum, detail, value) {\n var xValue = findValueOfOffset(spectrum, detail, value.left());\n var yValue = findValueOfOffset$1(spectrum, detail, value.top());\n var val = sliderValue$2(xValue, yValue);\n fireSliderChange$3(spectrum, val);\n return val;\n };\n var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var xValue = isVerticalMovement ? currentValue(detail).x() : f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail));\n var yValue = !isVerticalMovement ? currentValue(detail).y() : f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail));\n fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue));\n return Option.some(xValue);\n };\n var handleMovement$2 = function (direction, isVerticalMovement) {\n return function (spectrum, detail) {\n return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var setToMin$2 = function (spectrum, detail) {\n var mX = minX(detail);\n var mY = minY(detail);\n fireSliderChange$3(spectrum, sliderValue$2(mX, mY));\n };\n var setToMax$2 = function (spectrum, detail) {\n var mX = maxX(detail);\n var mY = maxY(detail);\n fireSliderChange$3(spectrum, sliderValue$2(mX, mY));\n };\n var getValueFromEvent$2 = function (simulatedEvent) {\n return getEventSource(simulatedEvent);\n };\n var setPositionFromValue$2 = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail);\n var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail);\n var thumbXRadius = get$7(thumb.element()) / 2;\n var thumbYRadius = get$5(thumb.element()) / 2;\n set$3(thumb.element(), 'left', xPos - thumbXRadius + 'px');\n set$3(thumb.element(), 'top', yPos - thumbYRadius + 'px');\n };\n var onLeft$2 = handleMovement$2(-1, false);\n var onRight$2 = handleMovement$2(1, false);\n var onUp$2 = handleMovement$2(-1, true);\n var onDown$2 = handleMovement$2(1, true);\n var edgeActions$2 = {\n 'top-left': Option.some(setToTLEdgeXY),\n 'top': Option.some(setToTEdgeXY),\n 'top-right': Option.some(setToTREdgeXY),\n 'right': Option.some(setToREdgeXY),\n 'bottom-right': Option.some(setToBREdgeXY),\n 'bottom': Option.some(setToBEdgeXY),\n 'bottom-left': Option.some(setToBLEdgeXY),\n 'left': Option.some(setToLEdgeXY)\n };\n\n var TwoDModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom$2,\n setToMin: setToMin$2,\n setToMax: setToMax$2,\n getValueFromEvent: getValueFromEvent$2,\n setPositionFromValue: setPositionFromValue$2,\n onLeft: onLeft$2,\n onRight: onRight$2,\n onUp: onUp$2,\n onDown: onDown$2,\n edgeActions: edgeActions$2\n });\n\n var SliderSchema = [\n defaulted$1('stepSize', 1),\n defaulted$1('onChange', noop),\n defaulted$1('onChoose', noop),\n defaulted$1('onInit', noop),\n defaulted$1('onDragStart', noop),\n defaulted$1('onDragEnd', noop),\n defaulted$1('snapToGrid', false),\n defaulted$1('rounded', true),\n option('snapStart'),\n strictOf('model', choose$1('mode', {\n x: [\n defaulted$1('minX', 0),\n defaulted$1('maxX', 100),\n state$1('value', function (spec) {\n return Cell(spec.mode.minX);\n }),\n strict$1('getInitialValue'),\n output('manager', HorizontalModel)\n ],\n y: [\n defaulted$1('minY', 0),\n defaulted$1('maxY', 100),\n state$1('value', function (spec) {\n return Cell(spec.mode.minY);\n }),\n strict$1('getInitialValue'),\n output('manager', VerticalModel)\n ],\n xy: [\n defaulted$1('minX', 0),\n defaulted$1('maxX', 100),\n defaulted$1('minY', 0),\n defaulted$1('maxY', 100),\n state$1('value', function (spec) {\n return Cell({\n x: constant(spec.mode.minX),\n y: constant(spec.mode.minY)\n });\n }),\n strict$1('getInitialValue'),\n output('manager', TwoDModel)\n ]\n })),\n field$1('sliderBehaviours', [\n Keying,\n Representing\n ]),\n state$1('mouseIsDown', function () {\n return Cell(false);\n })\n ];\n\n var mouseReleased = constant('mouse.released');\n\n var sketch = function (detail, components, _spec, _externals) {\n var _a;\n var getThumb = function (component) {\n return getPartOrDie(component, detail, 'thumb');\n };\n var getSpectrum = function (component) {\n return getPartOrDie(component, detail, 'spectrum');\n };\n var getLeftEdge = function (component) {\n return getPart(component, detail, 'left-edge');\n };\n var getRightEdge = function (component) {\n return getPart(component, detail, 'right-edge');\n };\n var getTopEdge = function (component) {\n return getPart(component, detail, 'top-edge');\n };\n var getBottomEdge = function (component) {\n return getPart(component, detail, 'bottom-edge');\n };\n var modelDetail = detail.model;\n var model = modelDetail.manager;\n var refresh = function (slider, thumb) {\n model.setPositionFromValue(slider, thumb, detail, {\n getLeftEdge: getLeftEdge,\n getRightEdge: getRightEdge,\n getTopEdge: getTopEdge,\n getBottomEdge: getBottomEdge,\n getSpectrum: getSpectrum\n });\n };\n var changeValue = function (slider, newValue) {\n modelDetail.value.set(newValue);\n var thumb = getThumb(slider);\n refresh(slider, thumb);\n detail.onChange(slider, thumb, newValue);\n return Option.some(true);\n };\n var resetToMin = function (slider) {\n model.setToMin(slider, detail);\n };\n var resetToMax = function (slider) {\n model.setToMax(slider, detail);\n };\n var choose = function (slider) {\n var fireOnChoose = function () {\n getPart(slider, detail, 'thumb').each(function (thumb) {\n var value = modelDetail.value.get();\n detail.onChoose(slider, thumb, value);\n });\n };\n var wasDown = detail.mouseIsDown.get();\n detail.mouseIsDown.set(false);\n if (wasDown) {\n fireOnChoose();\n }\n };\n var onDragStart = function (slider, simulatedEvent) {\n simulatedEvent.stop();\n detail.mouseIsDown.set(true);\n detail.onDragStart(slider, getThumb(slider));\n };\n var onDragEnd = function (slider, simulatedEvent) {\n simulatedEvent.stop();\n detail.onDragEnd(slider, getThumb(slider));\n choose(slider);\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.sliderBehaviours, [\n Keying.config({\n mode: 'special',\n focusIn: function (slider) {\n return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(constant(true));\n }\n }),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (_) {\n return modelDetail.value.get();\n }\n }\n }),\n Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) })\n ]),\n events: derive([\n run(sliderChangeEvent(), function (slider, simulatedEvent) {\n changeValue(slider, simulatedEvent.event().value());\n }),\n runOnAttached(function (slider, _simulatedEvent) {\n var getInitial = modelDetail.getInitialValue();\n modelDetail.value.set(getInitial);\n var thumb = getThumb(slider);\n refresh(slider, thumb);\n var spectrum = getSpectrum(slider);\n detail.onInit(slider, thumb, spectrum, modelDetail.value.get());\n }),\n run(touchstart(), onDragStart),\n run(touchend(), onDragEnd),\n run(mousedown(), onDragStart),\n run(mouseup(), onDragEnd)\n ]),\n apis: {\n resetToMin: resetToMin,\n resetToMax: resetToMax,\n changeValue: changeValue,\n refresh: refresh\n },\n domModification: { styles: { position: 'relative' } }\n };\n };\n\n var Slider = composite$1({\n name: 'Slider',\n configFields: SliderSchema,\n partFields: SliderParts,\n factory: sketch,\n apis: {\n resetToMin: function (apis, slider) {\n apis.resetToMin(slider);\n },\n resetToMax: function (apis, slider) {\n apis.resetToMax(slider);\n },\n refresh: function (apis, slider) {\n apis.refresh(slider);\n }\n }\n });\n\n var button = function (realm, clazz, makeItems, editor) {\n return forToolbar(clazz, function () {\n var items = makeItems();\n realm.setContextToolbar([{\n label: clazz + ' group',\n items: items\n }]);\n }, {}, editor);\n };\n\n var BLACK = -1;\n var makeSlider = function (spec$1) {\n var getColor = function (hue) {\n if (hue < 0) {\n return 'black';\n } else if (hue > 360) {\n return 'white';\n } else {\n return 'hsl(' + hue + ', 100%, 50%)';\n }\n };\n var onInit = function (slider, thumb, spectrum, value) {\n var color = getColor(value.x());\n set$3(thumb.element(), 'background-color', color);\n };\n var onChange = function (slider, thumb, value) {\n var color = getColor(value.x());\n set$3(thumb.element(), 'background-color', color);\n spec$1.onChange(slider, thumb, color);\n };\n return Slider.sketch({\n dom: dom$1('
'),\n components: [\n Slider.parts()['left-edge'](spec('
')),\n Slider.parts().spectrum({\n dom: dom$1('
'),\n components: [spec('
')],\n behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })])\n }),\n Slider.parts()['right-edge'](spec('
')),\n Slider.parts().thumb({\n dom: dom$1('
'),\n behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })])\n })\n ],\n onChange: onChange,\n onDragStart: function (slider, thumb) {\n Toggling.on(thumb);\n },\n onDragEnd: function (slider, thumb) {\n Toggling.off(thumb);\n },\n onInit: onInit,\n stepSize: 10,\n model: {\n mode: 'x',\n minX: 0,\n maxX: 360,\n getInitialValue: function () {\n return {\n x: function () {\n return spec$1.getInitialValue();\n }\n };\n }\n },\n sliderBehaviours: derive$1([orientation(Slider.refresh)])\n });\n };\n var makeItems = function (spec) {\n return [makeSlider(spec)];\n };\n var sketch$1 = function (realm, editor) {\n var spec = {\n onChange: function (slider, thumb, color) {\n editor.undoManager.transact(function () {\n editor.formatter.apply('forecolor', { value: color });\n editor.nodeChanged();\n });\n },\n getInitialValue: function () {\n return BLACK;\n }\n };\n return button(realm, 'color-levels', function () {\n return makeItems(spec);\n }, editor);\n };\n\n var schema$7 = objOfOnly([\n strict$1('getInitialValue'),\n strict$1('onChange'),\n strict$1('category'),\n strict$1('sizes')\n ]);\n var sketch$2 = function (rawSpec) {\n var spec$1 = asRawOrDie('SizeSlider', schema$7, rawSpec);\n var isValidValue = function (valueIndex) {\n return valueIndex >= 0 && valueIndex < spec$1.sizes.length;\n };\n var onChange = function (slider, thumb, valueIndex) {\n var index = valueIndex.x();\n if (isValidValue(index)) {\n spec$1.onChange(index);\n }\n };\n return Slider.sketch({\n dom: {\n tag: 'div',\n classes: [\n resolve('slider-' + spec$1.category + '-size-container'),\n resolve('slider'),\n resolve('slider-size-container')\n ]\n },\n onChange: onChange,\n onDragStart: function (slider, thumb) {\n Toggling.on(thumb);\n },\n onDragEnd: function (slider, thumb) {\n Toggling.off(thumb);\n },\n model: {\n mode: 'x',\n minX: 0,\n maxX: spec$1.sizes.length - 1,\n getInitialValue: function () {\n return {\n x: function () {\n return spec$1.getInitialValue();\n }\n };\n }\n },\n stepSize: 1,\n snapToGrid: true,\n sliderBehaviours: derive$1([orientation(Slider.refresh)]),\n components: [\n Slider.parts().spectrum({\n dom: dom$1('
'),\n components: [spec('
')]\n }),\n Slider.parts().thumb({\n dom: dom$1('
'),\n behaviours: derive$1([Toggling.config({ toggleClass: resolve('thumb-active') })])\n })\n ]\n });\n };\n\n var candidatesArray = [\n '9px',\n '10px',\n '11px',\n '12px',\n '14px',\n '16px',\n '18px',\n '20px',\n '24px',\n '32px',\n '36px'\n ];\n var defaultSize = 'medium';\n var defaultIndex = 2;\n var indexToSize = function (index) {\n return Option.from(candidatesArray[index]);\n };\n var sizeToIndex = function (size) {\n return findIndex(candidatesArray, function (v) {\n return v === size;\n });\n };\n var getRawOrComputed = function (isRoot, rawStart) {\n var optStart = isElement(rawStart) ? Option.some(rawStart) : parent(rawStart).filter(isElement);\n return optStart.map(function (start) {\n var inline = closest$1(start, function (elem) {\n return getRaw(elem, 'font-size').isSome();\n }, isRoot).bind(function (elem) {\n return getRaw(elem, 'font-size');\n });\n return inline.getOrThunk(function () {\n return get$4(start, 'font-size');\n });\n }).getOr('');\n };\n var getSize = function (editor) {\n var node = editor.selection.getStart();\n var elem = Element.fromDom(node);\n var root = Element.fromDom(editor.getBody());\n var isRoot = function (e) {\n return eq(root, e);\n };\n var elemSize = getRawOrComputed(isRoot, elem);\n return find$2(candidatesArray, function (size) {\n return elemSize === size;\n }).getOr(defaultSize);\n };\n var applySize = function (editor, value) {\n var currentValue = getSize(editor);\n if (currentValue !== value) {\n editor.execCommand('fontSize', false, value);\n }\n };\n var get$8 = function (editor) {\n var size = getSize(editor);\n return sizeToIndex(size).getOr(defaultIndex);\n };\n var apply$1 = function (editor, index) {\n indexToSize(index).each(function (size) {\n applySize(editor, size);\n });\n };\n var candidates = constant(candidatesArray);\n\n var sizes = candidates();\n var makeSlider$1 = function (spec) {\n return sketch$2({\n onChange: spec.onChange,\n sizes: sizes,\n category: 'font',\n getInitialValue: spec.getInitialValue\n });\n };\n var makeItems$1 = function (spec$1) {\n return [\n spec(''),\n makeSlider$1(spec$1),\n spec('')\n ];\n };\n var sketch$3 = function (realm, editor) {\n var spec = {\n onChange: function (value) {\n apply$1(editor, value);\n },\n getInitialValue: function () {\n return get$8(editor);\n }\n };\n return button(realm, 'font-size', function () {\n return makeItems$1(spec);\n }, editor);\n };\n\n var record = function (spec) {\n var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$3('memento');\n var get = function (anyInSystem) {\n return anyInSystem.getSystem().getByUid(uid).getOrDie();\n };\n var getOpt = function (anyInSystem) {\n return anyInSystem.getSystem().getByUid(uid).toOption();\n };\n var asSpec = function () {\n return __assign(__assign({}, spec), { uid: uid });\n };\n return {\n get: get,\n getOpt: getOpt,\n asSpec: asSpec\n };\n };\n\n var promise = function () {\n var Promise = function (fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n if (typeof fn !== 'function') {\n throw new TypeError('not a function');\n }\n this._state = null;\n this._value = null;\n this._deferreds = [];\n doResolve(fn, bind(resolve, this), bind(reject, this));\n };\n var asap = Promise.immediateFn || typeof window.setImmediate === 'function' && window.setImmediate || function (fn) {\n domGlobals.setTimeout(fn, 1);\n };\n function bind(fn, thisArg) {\n return function () {\n return fn.apply(thisArg, arguments);\n };\n }\n var isArray = Array.isArray || function (value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n };\n function handle(deferred) {\n var me = this;\n if (this._state === null) {\n this._deferreds.push(deferred);\n return;\n }\n asap(function () {\n var cb = me._state ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (me._state ? deferred.resolve : deferred.reject)(me._value);\n return;\n }\n var ret;\n try {\n ret = cb(me._value);\n } catch (e) {\n deferred.reject(e);\n return;\n }\n deferred.resolve(ret);\n });\n }\n function resolve(newValue) {\n try {\n if (newValue === this) {\n throw new TypeError('A promise cannot be resolved with itself.');\n }\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n var then = newValue.then;\n if (typeof then === 'function') {\n doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));\n return;\n }\n }\n this._state = true;\n this._value = newValue;\n finale.call(this);\n } catch (e) {\n reject.call(this, e);\n }\n }\n function reject(newValue) {\n this._state = false;\n this._value = newValue;\n finale.call(this);\n }\n function finale() {\n for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) {\n var deferred = _a[_i];\n handle.call(this, deferred);\n }\n this._deferreds = [];\n }\n function Handler(onFulfilled, onRejected, resolve, reject) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.resolve = resolve;\n this.reject = reject;\n }\n function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) {\n return;\n }\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) {\n return;\n }\n done = true;\n onRejected(reason);\n });\n } catch (ex) {\n if (done) {\n return;\n }\n done = true;\n onRejected(ex);\n }\n }\n Promise.prototype.catch = function (onRejected) {\n return this.then(null, onRejected);\n };\n Promise.prototype.then = function (onFulfilled, onRejected) {\n var me = this;\n return new Promise(function (resolve, reject) {\n handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));\n });\n };\n Promise.all = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);\n return new Promise(function (resolve, reject) {\n if (args.length === 0) {\n return resolve([]);\n }\n var remaining = args.length;\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n };\n Promise.resolve = function (value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n return new Promise(function (resolve) {\n resolve(value);\n });\n };\n Promise.reject = function (reason) {\n return new Promise(function (resolve, reject) {\n reject(reason);\n });\n };\n Promise.race = function (values) {\n return new Promise(function (resolve, reject) {\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var value = values_1[_i];\n value.then(resolve, reject);\n }\n });\n };\n return Promise;\n };\n var Promise = window.Promise ? window.Promise : promise();\n\n function blobToDataUri(blob) {\n return new Promise(function (resolve) {\n var reader = new domGlobals.FileReader();\n reader.onloadend = function () {\n resolve(reader.result);\n };\n reader.readAsDataURL(blob);\n });\n }\n function blobToBase64(blob) {\n return blobToDataUri(blob).then(function (dataUri) {\n return dataUri.split(',')[1];\n });\n }\n\n var blobToBase64$1 = function (blob) {\n return blobToBase64(blob);\n };\n\n var addImage = function (editor, blob) {\n blobToBase64$1(blob).then(function (base64) {\n editor.undoManager.transact(function () {\n var cache = editor.editorUpload.blobCache;\n var info = cache.create(generate$1('mceu'), blob, base64);\n cache.add(info);\n var img = editor.dom.createHTML('img', { src: info.blobUri() });\n editor.insertContent(img);\n });\n });\n };\n var extractBlob = function (simulatedEvent) {\n var event = simulatedEvent.event();\n var files = event.raw().target.files || event.raw().dataTransfer.files;\n return Option.from(files[0]);\n };\n var sketch$4 = function (editor) {\n var pickerDom = {\n tag: 'input',\n attributes: {\n accept: 'image/*',\n type: 'file',\n title: ''\n },\n styles: {\n visibility: 'hidden',\n position: 'absolute'\n }\n };\n var memPicker = record({\n dom: pickerDom,\n events: derive([\n cutter(click()),\n run(change(), function (picker, simulatedEvent) {\n extractBlob(simulatedEvent).each(function (blob) {\n addImage(editor, blob);\n });\n })\n ])\n });\n return Button.sketch({\n dom: getToolbarIconButton('image', editor),\n components: [memPicker.asSpec()],\n action: function (button) {\n var picker = memPicker.get(button);\n picker.element().dom().click();\n }\n });\n };\n\n var get$9 = function (element) {\n return element.dom().textContent;\n };\n var set$5 = function (element, value) {\n return element.dom().textContent = value;\n };\n\n var isNotEmpty = function (val) {\n return val.length > 0;\n };\n var defaultToEmpty = function (str) {\n return str === undefined || str === null ? '' : str;\n };\n var noLink = function (editor) {\n var text = editor.selection.getContent({ format: 'text' });\n return {\n url: '',\n text: text,\n title: '',\n target: '',\n link: Option.none()\n };\n };\n var fromLink = function (link) {\n var text = get$9(link);\n var url = get$1(link, 'href');\n var title = get$1(link, 'title');\n var target = get$1(link, 'target');\n return {\n url: defaultToEmpty(url),\n text: text !== url ? defaultToEmpty(text) : '',\n title: defaultToEmpty(title),\n target: defaultToEmpty(target),\n link: Option.some(link)\n };\n };\n var getInfo = function (editor) {\n return query(editor).fold(function () {\n return noLink(editor);\n }, function (link) {\n return fromLink(link);\n });\n };\n var wasSimple = function (link) {\n var prevHref = get$1(link, 'href');\n var prevText = get$9(link);\n return prevHref === prevText;\n };\n var getTextToApply = function (link, url, info) {\n return info.text.toOption().filter(isNotEmpty).fold(function () {\n return wasSimple(link) ? Option.some(url) : Option.none();\n }, Option.some);\n };\n var unlinkIfRequired = function (editor, info) {\n var activeLink = info.link.bind(identity);\n activeLink.each(function (_link) {\n editor.execCommand('unlink');\n });\n };\n var getAttrs$1 = function (url, info) {\n var attrs = {};\n attrs.href = url;\n info.title.toOption().filter(isNotEmpty).each(function (title) {\n attrs.title = title;\n });\n info.target.toOption().filter(isNotEmpty).each(function (target) {\n attrs.target = target;\n });\n return attrs;\n };\n var applyInfo = function (editor, info) {\n info.url.toOption().filter(isNotEmpty).fold(function () {\n unlinkIfRequired(editor, info);\n }, function (url) {\n var attrs = getAttrs$1(url, info);\n var activeLink = info.link.bind(identity);\n activeLink.fold(function () {\n var text = info.text.toOption().filter(isNotEmpty).getOr(url);\n editor.insertContent(editor.dom.createHTML('a', attrs, editor.dom.encode(text)));\n }, function (link) {\n var text = getTextToApply(link, url, info);\n setAll(link, attrs);\n text.each(function (newText) {\n set$5(link, newText);\n });\n });\n });\n };\n var query = function (editor) {\n var start = Element.fromDom(editor.selection.getStart());\n return closest$2(start, 'a');\n };\n\n var platform$1 = detect$3();\n var preserve = function (f, editor) {\n var rng = editor.selection.getRng();\n f();\n editor.selection.setRng(rng);\n };\n var forAndroid = function (editor, f) {\n var wrapper = platform$1.os.isAndroid() ? preserve : apply;\n wrapper(f, editor);\n };\n\n var events$6 = function (name, eventHandlers) {\n var events = derive(eventHandlers);\n return create$1({\n fields: [strict$1('enabled')],\n name: name,\n active: { events: constant(events) }\n });\n };\n var config = function (name, eventHandlers) {\n var me = events$6(name, eventHandlers);\n return {\n key: name,\n value: {\n config: {},\n me: me,\n configAsRaw: constant({}),\n initialConfig: {},\n state: NoState\n }\n };\n };\n\n var getCurrent = function (component, composeConfig, _composeState) {\n return composeConfig.find(component);\n };\n\n var ComposeApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getCurrent: getCurrent\n });\n\n var ComposeSchema = [strict$1('find')];\n\n var Composing = create$1({\n fields: ComposeSchema,\n name: 'composing',\n apis: ComposeApis\n });\n\n var factory$1 = function (detail) {\n var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']);\n return {\n uid: detail.uid,\n dom: __assign({\n tag: 'div',\n attributes: __assign({ role: 'presentation' }, attributes)\n }, domWithoutAttributes),\n components: detail.components,\n behaviours: get$6(detail.containerBehaviours),\n events: detail.events,\n domModification: detail.domModification,\n eventOrder: detail.eventOrder\n };\n };\n var Container = single$2({\n name: 'Container',\n factory: factory$1,\n configFields: [\n defaulted$1('components', []),\n field$1('containerBehaviours', []),\n defaulted$1('events', {}),\n defaulted$1('domModification', {}),\n defaulted$1('eventOrder', {})\n ]\n });\n\n var factory$2 = function (detail) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n behaviours: SketchBehaviours.augment(detail.dataBehaviours, [\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.getInitialValue()\n }\n }),\n Composing.config({ find: Option.some })\n ]),\n events: derive([runOnAttached(function (component, _simulatedEvent) {\n Representing.setValue(component, detail.getInitialValue());\n })])\n };\n };\n var DataField = single$2({\n name: 'DataField',\n factory: factory$2,\n configFields: [\n strict$1('uid'),\n strict$1('dom'),\n strict$1('getInitialValue'),\n SketchBehaviours.field('dataBehaviours', [\n Representing,\n Composing\n ])\n ]\n });\n\n var get$a = function (element) {\n return element.dom().value;\n };\n var set$6 = function (element, value) {\n if (value === undefined) {\n throw new Error('Value.set was undefined');\n }\n element.dom().value = value;\n };\n\n var schema$8 = constant([\n option('data'),\n defaulted$1('inputAttributes', {}),\n defaulted$1('inputStyles', {}),\n defaulted$1('tag', 'input'),\n defaulted$1('inputClasses', []),\n onHandler('onSetValue'),\n defaulted$1('styles', {}),\n defaulted$1('eventOrder', {}),\n field$1('inputBehaviours', [\n Representing,\n Focusing\n ]),\n defaulted$1('selectOnFocus', true)\n ]);\n var focusBehaviours = function (detail) {\n return derive$1([Focusing.config({\n onFocus: !detail.selectOnFocus ? noop : function (component) {\n var input = component.element();\n var value = get$a(input);\n input.dom().setSelectionRange(0, value.length);\n }\n })]);\n };\n var behaviours = function (detail) {\n return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({\n store: __assign(__assign({ mode: 'manual' }, detail.data.map(function (data) {\n return { initialValue: data };\n }).getOr({})), {\n getValue: function (input) {\n return get$a(input.element());\n },\n setValue: function (input, data) {\n var current = get$a(input.element());\n if (current !== data) {\n set$6(input.element(), data);\n }\n }\n }),\n onSetValue: detail.onSetValue\n })]));\n };\n var dom$2 = function (detail) {\n return {\n tag: detail.tag,\n attributes: __assign({ type: 'text' }, detail.inputAttributes),\n styles: detail.inputStyles,\n classes: detail.inputClasses\n };\n };\n\n var factory$3 = function (detail, _spec) {\n return {\n uid: detail.uid,\n dom: dom$2(detail),\n components: [],\n behaviours: behaviours(detail),\n eventOrder: detail.eventOrder\n };\n };\n var Input = single$2({\n name: 'Input',\n configFields: schema$8(),\n factory: factory$3\n });\n\n var exhibit$3 = function (base, tabConfig) {\n return nu$5({\n attributes: wrapAll$1([{\n key: tabConfig.tabAttr,\n value: 'true'\n }])\n });\n };\n\n var ActiveTabstopping = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$3\n });\n\n var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')];\n\n var Tabstopping = create$1({\n fields: TabstopSchema,\n name: 'tabstopping',\n active: ActiveTabstopping\n });\n\n var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n');\n\n var clearInputBehaviour = 'input-clearing';\n var field$2 = function (name, placeholder) {\n var inputSpec = record(Input.sketch({\n inputAttributes: { placeholder: global$3.translate(placeholder) },\n onSetValue: function (input$1, _data) {\n emit(input$1, input());\n },\n inputBehaviours: derive$1([\n Composing.config({ find: Option.some }),\n Tabstopping.config({}),\n Keying.config({ mode: 'execution' })\n ]),\n selectOnFocus: false\n }));\n var buttonSpec = record(Button.sketch({\n dom: dom$1(''),\n action: function (button) {\n var input = inputSpec.get(button);\n Representing.setValue(input, '');\n }\n }));\n return {\n name: name,\n spec: Container.sketch({\n dom: dom$1('
'),\n components: [\n inputSpec.asSpec(),\n buttonSpec.asSpec()\n ],\n containerBehaviours: derive$1([\n Toggling.config({ toggleClass: resolve('input-container-empty') }),\n Composing.config({\n find: function (comp) {\n return Option.some(inputSpec.get(comp));\n }\n }),\n config(clearInputBehaviour, [run(input(), function (iContainer) {\n var input = inputSpec.get(iContainer);\n var val = Representing.getValue(input);\n var f = val.length > 0 ? Toggling.off : Toggling.on;\n f(iContainer);\n })])\n ])\n })\n };\n };\n var hidden = function (name) {\n return {\n name: name,\n spec: DataField.sketch({\n dom: {\n tag: 'span',\n styles: { display: 'none' }\n },\n getInitialValue: function () {\n return Option.none();\n }\n })\n };\n };\n\n var nativeDisabled = [\n 'input',\n 'button',\n 'textarea',\n 'select'\n ];\n var onLoad$5 = function (component, disableConfig, disableState) {\n var f = disableConfig.disabled() ? disable : enable;\n f(component, disableConfig, disableState);\n };\n var hasNative = function (component, config) {\n return config.useNative === true && contains(nativeDisabled, name(component.element()));\n };\n var nativeIsDisabled = function (component) {\n return has$1(component.element(), 'disabled');\n };\n var nativeDisable = function (component) {\n set(component.element(), 'disabled', 'disabled');\n };\n var nativeEnable = function (component) {\n remove$1(component.element(), 'disabled');\n };\n var ariaIsDisabled = function (component) {\n return get$1(component.element(), 'aria-disabled') === 'true';\n };\n var ariaDisable = function (component) {\n set(component.element(), 'aria-disabled', 'true');\n };\n var ariaEnable = function (component) {\n set(component.element(), 'aria-disabled', 'false');\n };\n var disable = function (component, disableConfig, _disableState) {\n disableConfig.disableClass.each(function (disableClass) {\n add$2(component.element(), disableClass);\n });\n var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable;\n f(component);\n disableConfig.onDisabled(component);\n };\n var enable = function (component, disableConfig, _disableState) {\n disableConfig.disableClass.each(function (disableClass) {\n remove$4(component.element(), disableClass);\n });\n var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable;\n f(component);\n disableConfig.onEnabled(component);\n };\n var isDisabled = function (component, disableConfig) {\n return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component);\n };\n var set$7 = function (component, disableConfig, disableState, disabled) {\n var f = disabled ? disable : enable;\n f(component, disableConfig, disableState);\n };\n\n var DisableApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n enable: enable,\n disable: disable,\n isDisabled: isDisabled,\n onLoad: onLoad$5,\n set: set$7\n });\n\n var exhibit$4 = function (base, disableConfig) {\n return nu$5({ classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : [] });\n };\n var events$7 = function (disableConfig, disableState) {\n return derive([\n abort(execute(), function (component, _simulatedEvent) {\n return isDisabled(component, disableConfig);\n }),\n loadEvent(disableConfig, disableState, onLoad$5)\n ]);\n };\n\n var ActiveDisable = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$4,\n events: events$7\n });\n\n var DisableSchema = [\n defaultedFunction('disabled', never),\n defaulted$1('useNative', true),\n option('disableClass'),\n onHandler('onDisabled'),\n onHandler('onEnabled')\n ];\n\n var Disabling = create$1({\n fields: DisableSchema,\n name: 'disabling',\n active: ActiveDisable,\n apis: DisableApis\n });\n\n var owner$1 = 'form';\n var schema$9 = [field$1('formBehaviours', [Representing])];\n var getPartName = function (name) {\n return '';\n };\n var sketch$5 = function (fSpec) {\n var parts = function () {\n var record = [];\n var field = function (name, config) {\n record.push(name);\n return generateOne(owner$1, getPartName(name), config);\n };\n return {\n field: field,\n record: function () {\n return record;\n }\n };\n }();\n var spec = fSpec(parts);\n var partNames = parts.record();\n var fieldParts = map$1(partNames, function (n) {\n return required({\n name: n,\n pname: getPartName(n)\n });\n });\n return composite(owner$1, schema$9, fieldParts, make, spec);\n };\n var toResult$1 = function (o, e) {\n return o.fold(function () {\n return Result.error(e);\n }, Result.value);\n };\n var make = function (detail, components) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.formBehaviours, [Representing.config({\n store: {\n mode: 'manual',\n getValue: function (form) {\n var resPs = getAllParts(form, detail);\n return map(resPs, function (resPThunk, pName) {\n return resPThunk().bind(function (v) {\n var opt = Composing.getCurrent(v);\n return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \\'' + pName + '\\': ' + element(v.element())));\n }).map(Representing.getValue);\n });\n },\n setValue: function (form, values) {\n each(values, function (newValue, key) {\n getPart(form, detail, key).each(function (wrapper) {\n Composing.getCurrent(wrapper).each(function (field) {\n Representing.setValue(field, newValue);\n });\n });\n });\n }\n }\n })]),\n apis: {\n getField: function (form, key) {\n return getPart(form, detail, key).bind(Composing.getCurrent);\n }\n }\n };\n };\n var Form = {\n getField: makeApi(function (apis, component, key) {\n return apis.getField(component, key);\n }),\n sketch: sketch$5\n };\n\n var api$2 = function () {\n var subject = Cell(Option.none());\n var revoke = function () {\n subject.get().each(function (s) {\n s.destroy();\n });\n };\n var clear = function () {\n revoke();\n subject.set(Option.none());\n };\n var set = function (s) {\n revoke();\n subject.set(Option.some(s));\n };\n var run = function (f) {\n subject.get().each(f);\n };\n var isSet = function () {\n return subject.get().isSome();\n };\n return {\n clear: clear,\n isSet: isSet,\n set: set,\n run: run\n };\n };\n var value$2 = function () {\n var subject = Cell(Option.none());\n var clear = function () {\n subject.set(Option.none());\n };\n var set = function (s) {\n subject.set(Option.some(s));\n };\n var on = function (f) {\n subject.get().each(f);\n };\n var isSet = function () {\n return subject.get().isSome();\n };\n return {\n clear: clear,\n set: set,\n isSet: isSet,\n on: on\n };\n };\n\n var SWIPING_LEFT = 1;\n var SWIPING_RIGHT = -1;\n var SWIPING_NONE = 0;\n var init$2 = function (xValue) {\n return {\n xValue: xValue,\n points: []\n };\n };\n var move$1 = function (model, xValue) {\n if (xValue === model.xValue) {\n return model;\n }\n var currentDirection = xValue - model.xValue > 0 ? SWIPING_LEFT : SWIPING_RIGHT;\n var newPoint = {\n direction: currentDirection,\n xValue: xValue\n };\n var priorPoints = function () {\n if (model.points.length === 0) {\n return [];\n } else {\n var prev = model.points[model.points.length - 1];\n return prev.direction === currentDirection ? model.points.slice(0, model.points.length - 1) : model.points;\n }\n }();\n return {\n xValue: xValue,\n points: priorPoints.concat([newPoint])\n };\n };\n var complete = function (model) {\n if (model.points.length === 0) {\n return SWIPING_NONE;\n } else {\n var firstDirection = model.points[0].direction;\n var lastDirection = model.points[model.points.length - 1].direction;\n return firstDirection === SWIPING_RIGHT && lastDirection === SWIPING_RIGHT ? SWIPING_RIGHT : firstDirection === SWIPING_LEFT && lastDirection === SWIPING_LEFT ? SWIPING_LEFT : SWIPING_NONE;\n }\n };\n\n var sketch$6 = function (rawSpec) {\n var navigateEvent = 'navigateEvent';\n var wrapperAdhocEvents = 'serializer-wrapper-events';\n var formAdhocEvents = 'form-events';\n var schema = objOf([\n strict$1('fields'),\n defaulted$1('maxFieldIndex', rawSpec.fields.length - 1),\n strict$1('onExecute'),\n strict$1('getInitialValue'),\n state$1('state', function () {\n return {\n dialogSwipeState: value$2(),\n currentScreen: Cell(0)\n };\n })\n ]);\n var spec$1 = asRawOrDie('SerialisedDialog', schema, rawSpec);\n var navigationButton = function (direction, directionName, enabled) {\n return Button.sketch({\n dom: dom$1(''),\n action: function (button) {\n emitWith(button, navigateEvent, { direction: direction });\n },\n buttonBehaviours: derive$1([Disabling.config({\n disableClass: resolve('toolbar-navigation-disabled'),\n disabled: function () {\n return !enabled;\n }\n })])\n });\n };\n var reposition = function (dialog, message) {\n descendant$1(dialog.element(), '.' + resolve('serialised-dialog-chain')).each(function (parent) {\n set$3(parent, 'left', -spec$1.state.currentScreen.get() * message.width + 'px');\n });\n };\n var navigate = function (dialog, direction) {\n var screens = descendants(dialog.element(), '.' + resolve('serialised-dialog-screen'));\n descendant$1(dialog.element(), '.' + resolve('serialised-dialog-chain')).each(function (parent) {\n if (spec$1.state.currentScreen.get() + direction >= 0 && spec$1.state.currentScreen.get() + direction < screens.length) {\n getRaw(parent, 'left').each(function (left) {\n var currentLeft = parseInt(left, 10);\n var w = get$7(screens[0]);\n set$3(parent, 'left', currentLeft - direction * w + 'px');\n });\n spec$1.state.currentScreen.set(spec$1.state.currentScreen.get() + direction);\n }\n });\n };\n var focusInput = function (dialog) {\n var inputs = descendants(dialog.element(), 'input');\n var optInput = Option.from(inputs[spec$1.state.currentScreen.get()]);\n optInput.each(function (input) {\n dialog.getSystem().getByDom(input).each(function (inputComp) {\n dispatchFocus(dialog, inputComp.element());\n });\n });\n var dotitems = memDots.get(dialog);\n Highlighting.highlightAt(dotitems, spec$1.state.currentScreen.get());\n };\n var resetState = function () {\n spec$1.state.currentScreen.set(0);\n spec$1.state.dialogSwipeState.clear();\n };\n var memForm = record(Form.sketch(function (parts) {\n return {\n dom: dom$1('
'),\n components: [Container.sketch({\n dom: dom$1('
'),\n components: map$1(spec$1.fields, function (field, i) {\n return i <= spec$1.maxFieldIndex ? Container.sketch({\n dom: dom$1('
'),\n components: [\n navigationButton(-1, 'previous', i > 0),\n parts.field(field.name, field.spec),\n navigationButton(+1, 'next', i < spec$1.maxFieldIndex)\n ]\n }) : parts.field(field.name, field.spec);\n })\n })],\n formBehaviours: derive$1([\n orientation(function (dialog, message) {\n reposition(dialog, message);\n }),\n Keying.config({\n mode: 'special',\n focusIn: function (dialog, _specialInfo) {\n focusInput(dialog);\n },\n onTab: function (dialog, _specialInfo) {\n navigate(dialog, +1);\n return Option.some(true);\n },\n onShiftTab: function (dialog, _specialInfo) {\n navigate(dialog, -1);\n return Option.some(true);\n }\n }),\n config(formAdhocEvents, [\n runOnAttached(function (dialog, _simulatedEvent) {\n resetState();\n var dotitems = memDots.get(dialog);\n Highlighting.highlightFirst(dotitems);\n spec$1.getInitialValue(dialog).each(function (v) {\n Representing.setValue(dialog, v);\n });\n }),\n runOnExecute(spec$1.onExecute),\n run(transitionend(), function (dialog, simulatedEvent) {\n var event = simulatedEvent.event();\n if (event.raw().propertyName === 'left') {\n focusInput(dialog);\n }\n }),\n run(navigateEvent, function (dialog, simulatedEvent) {\n var event = simulatedEvent.event();\n var direction = event.direction();\n navigate(dialog, direction);\n })\n ])\n ])\n };\n }));\n var memDots = record({\n dom: dom$1('
'),\n behaviours: derive$1([Highlighting.config({\n highlightClass: resolve('dot-active'),\n itemClass: resolve('dot-item')\n })]),\n components: bind(spec$1.fields, function (_f, i) {\n return i <= spec$1.maxFieldIndex ? [spec('
')] : [];\n })\n });\n return {\n dom: dom$1('
'),\n components: [\n memForm.asSpec(),\n memDots.asSpec()\n ],\n behaviours: derive$1([\n Keying.config({\n mode: 'special',\n focusIn: function (wrapper) {\n var form = memForm.get(wrapper);\n Keying.focusIn(form);\n }\n }),\n config(wrapperAdhocEvents, [\n run(touchstart(), function (_wrapper, simulatedEvent) {\n var event = simulatedEvent.event();\n spec$1.state.dialogSwipeState.set(init$2(event.raw().touches[0].clientX));\n }),\n run(touchmove(), function (_wrapper, simulatedEvent) {\n var event = simulatedEvent.event();\n spec$1.state.dialogSwipeState.on(function (state) {\n simulatedEvent.event().prevent();\n spec$1.state.dialogSwipeState.set(move$1(state, event.raw().touches[0].clientX));\n });\n }),\n run(touchend(), function (wrapper, _simulatedEvent) {\n spec$1.state.dialogSwipeState.on(function (state) {\n var dialog = memForm.get(wrapper);\n var direction = -1 * complete(state);\n navigate(dialog, direction);\n });\n })\n ])\n ])\n };\n };\n\n var getGroups = cached(function (realm, editor) {\n return [{\n label: 'the link group',\n items: [sketch$6({\n fields: [\n field$2('url', 'Type or paste URL'),\n field$2('text', 'Link text'),\n field$2('title', 'Link title'),\n field$2('target', 'Link target'),\n hidden('link')\n ],\n maxFieldIndex: [\n 'url',\n 'text',\n 'title',\n 'target'\n ].length - 1,\n getInitialValue: function () {\n return Option.some(getInfo(editor));\n },\n onExecute: function (dialog, _simulatedEvent) {\n var info = Representing.getValue(dialog);\n applyInfo(editor, info);\n realm.restoreToolbar();\n editor.focus();\n }\n })]\n }];\n });\n var sketch$7 = function (realm, editor) {\n return forToolbarStateAction(editor, 'link', 'link', function () {\n var groups = getGroups(realm, editor);\n realm.setContextToolbar(groups);\n forAndroid(editor, function () {\n realm.focusToolbar();\n });\n query(editor).each(function (link) {\n editor.selection.select(link.dom());\n });\n });\n };\n\n var isRecursive = function (component, originator, target) {\n return eq(originator, component.element()) && !eq(originator, target);\n };\n var events$8 = derive([can(focus(), function (component, simulatedEvent) {\n var originator = simulatedEvent.event().originator();\n var target = simulatedEvent.event().target();\n if (isRecursive(component, originator, target)) {\n domGlobals.console.warn(focus() + ' did not get interpreted by the desired target. ' + '\\nOriginator: ' + element(originator) + '\\nTarget: ' + element(target) + '\\nCheck the ' + focus() + ' event handlers');\n return false;\n } else {\n return true;\n }\n })]);\n\n var DefaultEvents = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$8\n });\n\n var make$1 = identity;\n\n var NoContextApi = function (getComp) {\n var fail = function (event) {\n return function () {\n throw new Error('The component must be in a context to send: ' + event + (getComp ? '\\n' + element(getComp().element()) + ' is not in context.' : ''));\n };\n };\n return {\n debugInfo: constant('fake'),\n triggerEvent: fail('triggerEvent'),\n triggerFocus: fail('triggerFocus'),\n triggerEscape: fail('triggerEscape'),\n build: fail('build'),\n addToWorld: fail('addToWorld'),\n removeFromWorld: fail('removeFromWorld'),\n addToGui: fail('addToGui'),\n removeFromGui: fail('removeFromGui'),\n getByUid: fail('getByUid'),\n getByDom: fail('getByDom'),\n broadcast: fail('broadcast'),\n broadcastOn: fail('broadcastOn'),\n broadcastEvent: fail('broadcastEvent'),\n isConnected: constant(false)\n };\n };\n var singleton = NoContextApi();\n\n var generateFrom = function (spec, all) {\n var schema = map$1(all, function (a) {\n return optionObjOf(a.name(), [\n strict$1('config'),\n defaulted$1('state', NoState)\n ]);\n });\n var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) {\n throw new Error(formatError(errInfo) + '\\nComplete spec:\\n' + JSON.stringify(spec, null, 2));\n }, function (v) {\n return v;\n });\n return {\n list: all,\n data: map(validated, function (optBlobThunk) {\n var output = optBlobThunk.map(function (blob) {\n return {\n config: blob.config,\n state: blob.state.init(blob.config)\n };\n });\n return function () {\n return output;\n };\n })\n };\n };\n var getBehaviours = function (bData) {\n return bData.list;\n };\n var getData = function (bData) {\n return bData.data;\n };\n\n var byInnerKey = function (data, tuple) {\n var r = {};\n each(data, function (detail, key) {\n each(detail, function (value, indexKey) {\n var chain = get(r, indexKey).getOr([]);\n r[indexKey] = chain.concat([tuple(key, value)]);\n });\n });\n return r;\n };\n\n var combine$1 = function (info, baseMod, behaviours, base) {\n var modsByBehaviour = __assign({}, baseMod);\n each$1(behaviours, function (behaviour) {\n modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base);\n });\n var byAspect = byInnerKey(modsByBehaviour, function (name, modification) {\n return {\n name: name,\n modification: modification\n };\n });\n var combineObjects = function (objects) {\n return foldr(objects, function (b, a) {\n return __assign(__assign({}, a.modification), b);\n }, {});\n };\n var combinedClasses = foldr(byAspect.classes, function (b, a) {\n return a.modification.concat(b);\n }, []);\n var combinedAttributes = combineObjects(byAspect.attributes);\n var combinedStyles = combineObjects(byAspect.styles);\n return nu$5({\n classes: combinedClasses,\n attributes: combinedAttributes,\n styles: combinedStyles\n });\n };\n\n var sortKeys = function (label, keyName, array, order) {\n try {\n var sorted = sort(array, function (a, b) {\n var aKey = a[keyName]();\n var bKey = b[keyName]();\n var aIndex = order.indexOf(aKey);\n var bIndex = order.indexOf(bKey);\n if (aIndex === -1) {\n throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\\nOrder specified: ' + JSON.stringify(order, null, 2));\n }\n if (bIndex === -1) {\n throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\\nOrder specified: ' + JSON.stringify(order, null, 2));\n }\n if (aIndex < bIndex) {\n return -1;\n } else if (bIndex < aIndex) {\n return 1;\n } else {\n return 0;\n }\n });\n return Result.value(sorted);\n } catch (err) {\n return Result.error([err]);\n }\n };\n\n var uncurried = function (handler, purpose) {\n return {\n handler: handler,\n purpose: constant(purpose)\n };\n };\n var curried = function (handler, purpose) {\n return {\n cHandler: handler,\n purpose: constant(purpose)\n };\n };\n var curryArgs = function (descHandler, extraArgs) {\n return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose());\n };\n var getCurried = function (descHandler) {\n return descHandler.cHandler;\n };\n\n var behaviourTuple = function (name, handler) {\n return {\n name: constant(name),\n handler: constant(handler)\n };\n };\n var nameToHandlers = function (behaviours, info) {\n var r = {};\n each$1(behaviours, function (behaviour) {\n r[behaviour.name()] = behaviour.handlers(info);\n });\n return r;\n };\n var groupByEvents = function (info, behaviours, base) {\n var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info));\n return byInnerKey(behaviourEvents, behaviourTuple);\n };\n var combine$2 = function (info, eventOrder, behaviours, base) {\n var byEventName = groupByEvents(info, behaviours, base);\n return combineGroups(byEventName, eventOrder);\n };\n var assemble = function (rawHandler) {\n var handler = read(rawHandler);\n return function (component, simulatedEvent) {\n var rest = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n rest[_i - 2] = arguments[_i];\n }\n var args = [\n component,\n simulatedEvent\n ].concat(rest);\n if (handler.abort.apply(undefined, args)) {\n simulatedEvent.stop();\n } else if (handler.can.apply(undefined, args)) {\n handler.run.apply(undefined, args);\n }\n };\n };\n var missingOrderError = function (eventName, tuples) {\n return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ \"listing\", \"toggling\" ]).\\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map$1(tuples, function (c) {\n return c.name();\n }), null, 2)]);\n };\n var fuse$1 = function (tuples, eventOrder, eventName) {\n var order = eventOrder[eventName];\n if (!order) {\n return missingOrderError(eventName, tuples);\n } else {\n return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) {\n var handlers = map$1(sortedTuples, function (tuple) {\n return tuple.handler();\n });\n return fuse(handlers);\n });\n }\n };\n var combineGroups = function (byEventName, eventOrder) {\n var r = mapToArray(byEventName, function (tuples, eventName) {\n var combined = tuples.length === 1 ? Result.value(tuples[0].handler()) : fuse$1(tuples, eventOrder, eventName);\n return combined.map(function (handler) {\n var assembled = assemble(handler);\n var purpose = tuples.length > 1 ? filter$1(eventOrder[eventName], function (o) {\n return exists(tuples, function (t) {\n return t.name() === o;\n });\n }).join(' > ') : tuples[0].name();\n return wrap$1(eventName, uncurried(assembled, purpose));\n });\n });\n return consolidate(r, {});\n };\n\n var toInfo = function (spec) {\n return asRaw('custom.definition', objOf([\n field('dom', 'dom', strict(), objOf([\n strict$1('tag'),\n defaulted$1('styles', {}),\n defaulted$1('classes', []),\n defaulted$1('attributes', {}),\n option('value'),\n option('innerHtml')\n ])),\n strict$1('components'),\n strict$1('uid'),\n defaulted$1('events', {}),\n defaulted$1('apis', {}),\n field('eventOrder', 'eventOrder', mergeWith({\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'toggling',\n 'typeaheadevents'\n ],\n 'alloy.focus': [\n 'alloy.base.behaviour',\n 'focusing',\n 'keying'\n ],\n 'alloy.system.init': [\n 'alloy.base.behaviour',\n 'disabling',\n 'toggling',\n 'representing'\n ],\n 'input': [\n 'alloy.base.behaviour',\n 'representing',\n 'streaming',\n 'invalidating'\n ],\n 'alloy.system.detached': [\n 'alloy.base.behaviour',\n 'representing',\n 'item-events',\n 'tooltipping'\n ],\n 'mousedown': [\n 'focusing',\n 'alloy.base.behaviour',\n 'item-type-events'\n ],\n 'touchstart': [\n 'focusing',\n 'alloy.base.behaviour',\n 'item-type-events'\n ],\n 'mouseover': [\n 'item-type-events',\n 'tooltipping'\n ],\n 'alloy.receive': [\n 'receiving',\n 'reflecting',\n 'tooltipping'\n ]\n }), anyValue$1()),\n option('domModification')\n ]), spec);\n };\n var toDefinition = function (detail) {\n return __assign(__assign({}, detail.dom), {\n uid: detail.uid,\n domChildren: map$1(detail.components, function (comp) {\n return comp.element();\n })\n });\n };\n var toModification = function (detail) {\n return detail.domModification.fold(function () {\n return nu$5({});\n }, nu$5);\n };\n var toEvents = function (info) {\n return info.events;\n };\n\n var add$3 = function (element, classes) {\n each$1(classes, function (x) {\n add$2(element, x);\n });\n };\n var remove$6 = function (element, classes) {\n each$1(classes, function (x) {\n remove$4(element, x);\n });\n };\n\n var renderToDom = function (definition) {\n var subject = Element.fromTag(definition.tag);\n setAll(subject, definition.attributes);\n add$3(subject, definition.classes);\n setAll$1(subject, definition.styles);\n definition.innerHtml.each(function (html) {\n return set$1(subject, html);\n });\n var children = definition.domChildren;\n append$1(subject, children);\n definition.value.each(function (value) {\n set$6(subject, value);\n });\n if (!definition.uid) {\n debugger;\n }\n writeOnly(subject, definition.uid);\n return subject;\n };\n\n var getBehaviours$1 = function (spec) {\n var behaviours = get(spec, 'behaviours').getOr({});\n var keys$1 = filter$1(keys(behaviours), function (k) {\n return behaviours[k] !== undefined;\n });\n return map$1(keys$1, function (k) {\n return behaviours[k].me;\n });\n };\n var generateFrom$1 = function (spec, all) {\n return generateFrom(spec, all);\n };\n var generate$4 = function (spec) {\n var all = getBehaviours$1(spec);\n return generateFrom$1(spec, all);\n };\n\n var getDomDefinition = function (info, bList, bData) {\n var definition = toDefinition(info);\n var infoModification = toModification(info);\n var baseModification = { 'alloy.base.modification': infoModification };\n var modification = bList.length > 0 ? combine$1(bData, baseModification, bList, definition) : infoModification;\n return merge$1(definition, modification);\n };\n var getEvents = function (info, bList, bData) {\n var baseEvents = { 'alloy.base.behaviour': toEvents(info) };\n return combine$2(bData, info.eventOrder, bList, baseEvents).getOrDie();\n };\n var build = function (spec) {\n var getMe = function () {\n return me;\n };\n var systemApi = Cell(singleton);\n var info = getOrDie(toInfo(spec));\n var bBlob = generate$4(spec);\n var bList = getBehaviours(bBlob);\n var bData = getData(bBlob);\n var modDefinition = getDomDefinition(info, bList, bData);\n var item = renderToDom(modDefinition);\n var events = getEvents(info, bList, bData);\n var subcomponents = Cell(info.components);\n var connect = function (newApi) {\n systemApi.set(newApi);\n };\n var disconnect = function () {\n systemApi.set(NoContextApi(getMe));\n };\n var syncComponents = function () {\n var children$1 = children(item);\n var subs = bind(children$1, function (child) {\n return systemApi.get().getByDom(child).fold(function () {\n return [];\n }, function (c) {\n return [c];\n });\n });\n subcomponents.set(subs);\n };\n var config = function (behaviour) {\n var b = bData;\n var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () {\n throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2));\n };\n return f();\n };\n var hasConfigured = function (behaviour) {\n return isFunction(bData[behaviour.name()]);\n };\n var getApis = function () {\n return info.apis;\n };\n var readState = function (behaviourName) {\n return bData[behaviourName]().map(function (b) {\n return b.state.readState();\n }).getOr('not enabled');\n };\n var me = {\n getSystem: systemApi.get,\n config: config,\n hasConfigured: hasConfigured,\n spec: constant(spec),\n readState: readState,\n getApis: getApis,\n connect: connect,\n disconnect: disconnect,\n element: constant(item),\n syncComponents: syncComponents,\n components: subcomponents.get,\n events: constant(events)\n };\n return me;\n };\n\n var buildSubcomponents = function (spec) {\n var components = get(spec, 'components').getOr([]);\n return map$1(components, build$1);\n };\n var buildFromSpec = function (userSpec) {\n var _a = make$1(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']);\n var components = buildSubcomponents(spec);\n var completeSpec = __assign(__assign({}, spec), {\n events: __assign(__assign({}, DefaultEvents), specEvents),\n components: components\n });\n return Result.value(build(completeSpec));\n };\n var text = function (textContent) {\n var element = Element.fromText(textContent);\n return external$1({ element: element });\n };\n var external$1 = function (spec) {\n var extSpec = asRawOrDie('external.component', objOfOnly([\n strict$1('element'),\n option('uid')\n ]), spec);\n var systemApi = Cell(NoContextApi());\n var connect = function (newApi) {\n systemApi.set(newApi);\n };\n var disconnect = function () {\n systemApi.set(NoContextApi(function () {\n return me;\n }));\n };\n extSpec.uid.each(function (uid) {\n writeOnly(extSpec.element, uid);\n });\n var me = {\n getSystem: systemApi.get,\n config: Option.none,\n hasConfigured: constant(false),\n connect: connect,\n disconnect: disconnect,\n getApis: function () {\n return {};\n },\n element: constant(extSpec.element),\n spec: constant(spec),\n readState: constant('No state'),\n syncComponents: noop,\n components: constant([]),\n events: constant({})\n };\n return premade(me);\n };\n var uids = generate$3;\n var build$1 = function (spec) {\n return getPremade(spec).fold(function () {\n var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec);\n return buildFromSpec(userSpecWithUid).getOrDie();\n }, function (prebuilt) {\n return prebuilt;\n });\n };\n var premade$1 = premade;\n\n var hoverEvent = 'alloy.item-hover';\n var focusEvent = 'alloy.item-focus';\n var onHover = function (item) {\n if (search(item.element()).isNone() || Focusing.isFocused(item)) {\n if (!Focusing.isFocused(item)) {\n Focusing.focus(item);\n }\n emitWith(item, hoverEvent, { item: item });\n }\n };\n var onFocus = function (item) {\n emitWith(item, focusEvent, { item: item });\n };\n var hover = constant(hoverEvent);\n var focus$3 = constant(focusEvent);\n\n var builder = function (detail) {\n return {\n dom: detail.dom,\n domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }),\n behaviours: SketchBehaviours.augment(detail.itemBehaviours, [\n detail.toggling.fold(Toggling.revoke, function (tConfig) {\n return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig));\n }),\n Focusing.config({\n ignore: detail.ignoreFocus,\n stopMousedown: detail.ignoreFocus,\n onFocus: function (component) {\n onFocus(component);\n }\n }),\n Keying.config({ mode: 'execution' }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.data\n }\n }),\n config('item-type-events', __spreadArrays(pointerEvents(), [\n run(mouseover(), onHover),\n run(focusItem(), Focusing.focus)\n ]))\n ]),\n components: detail.components,\n eventOrder: detail.eventOrder\n };\n };\n var schema$a = [\n strict$1('data'),\n strict$1('components'),\n strict$1('dom'),\n defaulted$1('hasSubmenu', false),\n option('toggling'),\n SketchBehaviours.field('itemBehaviours', [\n Toggling,\n Focusing,\n Keying,\n Representing\n ]),\n defaulted$1('ignoreFocus', false),\n defaulted$1('domModification', {}),\n output('builder', builder),\n defaulted$1('eventOrder', {})\n ];\n\n var builder$1 = function (detail) {\n return {\n dom: detail.dom,\n components: detail.components,\n events: derive([stopper(focusItem())])\n };\n };\n var schema$b = [\n strict$1('dom'),\n strict$1('components'),\n output('builder', builder$1)\n ];\n\n var owner$2 = function () {\n return 'item-widget';\n };\n var parts = constant([required({\n name: 'widget',\n overrides: function (detail) {\n return {\n behaviours: derive$1([Representing.config({\n store: {\n mode: 'manual',\n getValue: function (_component) {\n return detail.data;\n },\n setValue: function () {\n }\n }\n })])\n };\n }\n })]);\n\n var builder$2 = function (detail) {\n var subs = substitutes(owner$2(), detail, parts());\n var components$1 = components(owner$2(), detail, subs.internals());\n var focusWidget = function (component) {\n return getPart(component, detail, 'widget').map(function (widget) {\n Keying.focusIn(widget);\n return widget;\n });\n };\n var onHorizontalArrow = function (component, simulatedEvent) {\n return inside(simulatedEvent.event().target()) ? Option.none() : function () {\n if (detail.autofocus) {\n simulatedEvent.setSource(component.element());\n return Option.none();\n } else {\n return Option.none();\n }\n }();\n };\n return {\n dom: detail.dom,\n components: components$1,\n domModification: detail.domModification,\n events: derive([\n runOnExecute(function (component, simulatedEvent) {\n focusWidget(component).each(function (_widget) {\n simulatedEvent.stop();\n });\n }),\n run(mouseover(), onHover),\n run(focusItem(), function (component, _simulatedEvent) {\n if (detail.autofocus) {\n focusWidget(component);\n } else {\n Focusing.focus(component);\n }\n })\n ]),\n behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.data\n }\n }),\n Focusing.config({\n ignore: detail.ignoreFocus,\n onFocus: function (component) {\n onFocus(component);\n }\n }),\n Keying.config({\n mode: 'special',\n focusIn: detail.autofocus ? function (component) {\n focusWidget(component);\n } : revoke(),\n onLeft: onHorizontalArrow,\n onRight: onHorizontalArrow,\n onEscape: function (component, simulatedEvent) {\n if (!Focusing.isFocused(component) && !detail.autofocus) {\n Focusing.focus(component);\n return Option.some(true);\n } else if (detail.autofocus) {\n simulatedEvent.setSource(component.element());\n return Option.none();\n } else {\n return Option.none();\n }\n }\n })\n ])\n };\n };\n var schema$c = [\n strict$1('uid'),\n strict$1('data'),\n strict$1('components'),\n strict$1('dom'),\n defaulted$1('autofocus', false),\n defaulted$1('ignoreFocus', false),\n SketchBehaviours.field('widgetBehaviours', [\n Representing,\n Focusing,\n Keying\n ]),\n defaulted$1('domModification', {}),\n defaultUidsSchema(parts()),\n output('builder', builder$2)\n ];\n\n var itemSchema$1 = choose$1('type', {\n widget: schema$c,\n item: schema$a,\n separator: schema$b\n });\n var configureGrid = function (detail, movementInfo) {\n return {\n mode: 'flatgrid',\n selector: '.' + detail.markers.item,\n initSize: {\n numColumns: movementInfo.initSize.numColumns,\n numRows: movementInfo.initSize.numRows\n },\n focusManager: detail.focusManager\n };\n };\n var configureMatrix = function (detail, movementInfo) {\n return {\n mode: 'matrix',\n selectors: {\n row: movementInfo.rowSelector,\n cell: '.' + detail.markers.item\n },\n focusManager: detail.focusManager\n };\n };\n var configureMenu = function (detail, movementInfo) {\n return {\n mode: 'menu',\n selector: '.' + detail.markers.item,\n moveOnTab: movementInfo.moveOnTab,\n focusManager: detail.focusManager\n };\n };\n var parts$1 = constant([group({\n factory: {\n sketch: function (spec) {\n var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec);\n return itemInfo.builder(itemInfo);\n }\n },\n name: 'items',\n unit: 'item',\n defaults: function (detail, u) {\n return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$3('item') });\n },\n overrides: function (detail, u) {\n return {\n type: u.type,\n ignoreFocus: detail.fakeFocus,\n domModification: { classes: [detail.markers.item] }\n };\n }\n })]);\n var schema$d = constant([\n strict$1('value'),\n strict$1('items'),\n strict$1('dom'),\n strict$1('components'),\n defaulted$1('eventOrder', {}),\n field$1('menuBehaviours', [\n Highlighting,\n Representing,\n Composing,\n Keying\n ]),\n defaultedOf('movement', {\n mode: 'menu',\n moveOnTab: true\n }, choose$1('mode', {\n grid: [\n initSize(),\n output('config', configureGrid)\n ],\n matrix: [\n output('config', configureMatrix),\n strict$1('rowSelector')\n ],\n menu: [\n defaulted$1('moveOnTab', true),\n output('config', configureMenu)\n ]\n })),\n itemMarkers(),\n defaulted$1('fakeFocus', false),\n defaulted$1('focusManager', dom()),\n onHandler('onHighlight')\n ]);\n\n var focus$4 = constant('alloy.menu-focus');\n\n var make$2 = function (detail, components, _spec, _externals) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n markers: detail.markers,\n behaviours: augment(detail.menuBehaviours, [\n Highlighting.config({\n highlightClass: detail.markers.selectedItem,\n itemClass: detail.markers.item,\n onHighlight: detail.onHighlight\n }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.value\n }\n }),\n Composing.config({ find: Option.some }),\n Keying.config(detail.movement.config(detail, detail.movement))\n ]),\n events: derive([\n run(focus$3(), function (menu, simulatedEvent) {\n var event = simulatedEvent.event();\n menu.getSystem().getByDom(event.target()).each(function (item) {\n Highlighting.highlight(menu, item);\n simulatedEvent.stop();\n emitWith(menu, focus$4(), {\n menu: menu,\n item: item\n });\n });\n }),\n run(hover(), function (menu, simulatedEvent) {\n var item = simulatedEvent.event().item();\n Highlighting.highlight(menu, item);\n })\n ]),\n components: components,\n eventOrder: detail.eventOrder,\n domModification: { attributes: { role: 'menu' } }\n };\n };\n\n var Menu = composite$1({\n name: 'Menu',\n configFields: schema$d(),\n partFields: parts$1(),\n factory: make$2\n });\n\n var preserve$1 = function (f, container) {\n var ownerDoc = owner(container);\n var refocus = active(ownerDoc).bind(function (focused) {\n var hasFocus = function (elem) {\n return eq(focused, elem);\n };\n return hasFocus(container) ? Option.some(container) : descendant(container, hasFocus);\n });\n var result = f(container);\n refocus.each(function (oldFocus) {\n active(ownerDoc).filter(function (newFocus) {\n return eq(newFocus, oldFocus);\n }).fold(function () {\n focus$1(oldFocus);\n }, noop);\n });\n return result;\n };\n\n var set$8 = function (component, replaceConfig, replaceState, data) {\n preserve$1(function () {\n var newChildren = map$1(data, component.getSystem().build);\n replaceChildren(component, newChildren);\n }, component.element());\n };\n var insert = function (component, replaceConfig, insertion, childSpec) {\n var child = component.getSystem().build(childSpec);\n attachWith(component, child, insertion);\n };\n var append$2 = function (component, replaceConfig, replaceState, appendee) {\n insert(component, replaceConfig, append, appendee);\n };\n var prepend$1 = function (component, replaceConfig, replaceState, prependee) {\n insert(component, replaceConfig, prepend, prependee);\n };\n var remove$7 = function (component, replaceConfig, replaceState, removee) {\n var children = contents(component);\n var foundChild = find$2(children, function (child) {\n return eq(removee.element(), child.element());\n });\n foundChild.each(detach);\n };\n var contents = function (component, _replaceConfig) {\n return component.components();\n };\n var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) {\n var children = contents(component);\n return Option.from(children[replaceeIndex]).map(function (replacee) {\n remove$7(component, replaceConfig, replaceState, replacee);\n replacer.each(function (r) {\n insert(component, replaceConfig, function (p, c) {\n appendAt(p, c, replaceeIndex);\n }, r);\n });\n return replacee;\n });\n };\n var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) {\n var children = contents(component);\n return findIndex(children, replaceePred).bind(function (replaceeIndex) {\n return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer);\n });\n };\n\n var ReplaceApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n append: append$2,\n prepend: prepend$1,\n remove: remove$7,\n replaceAt: replaceAt,\n replaceBy: replaceBy,\n set: set$8,\n contents: contents\n });\n\n var Replacing = create$1({\n fields: [],\n name: 'replacing',\n apis: ReplaceApis\n });\n\n var transpose = function (obj) {\n return tupleMap(obj, function (v, k) {\n return {\n k: v,\n v: k\n };\n });\n };\n var trace = function (items, byItem, byMenu, finish) {\n return get(byMenu, finish).bind(function (triggerItem) {\n return get(items, triggerItem).bind(function (triggerMenu) {\n var rest = trace(items, byItem, byMenu, triggerMenu);\n return Option.some([triggerMenu].concat(rest));\n });\n }).getOr([]);\n };\n var generate$5 = function (menus, expansions) {\n var items = {};\n each(menus, function (menuItems, menu) {\n each$1(menuItems, function (item) {\n items[item] = menu;\n });\n });\n var byItem = expansions;\n var byMenu = transpose(expansions);\n var menuPaths = map(byMenu, function (_triggerItem, submenu) {\n return [submenu].concat(trace(items, byItem, byMenu, submenu));\n });\n return map(items, function (menu) {\n return get(menuPaths, menu).getOr([menu]);\n });\n };\n\n var init$3 = function () {\n var expansions = Cell({});\n var menus = Cell({});\n var paths = Cell({});\n var primary = Cell(Option.none());\n var directory = Cell({});\n var clear = function () {\n expansions.set({});\n menus.set({});\n paths.set({});\n primary.set(Option.none());\n };\n var isClear = function () {\n return primary.get().isNone();\n };\n var setMenuBuilt = function (menuName, built) {\n var _a;\n menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = {\n type: 'prepared',\n menu: built\n }, _a)));\n };\n var setContents = function (sPrimary, sMenus, sExpansions, dir) {\n primary.set(Option.some(sPrimary));\n expansions.set(sExpansions);\n menus.set(sMenus);\n directory.set(dir);\n var sPaths = generate$5(dir, sExpansions);\n paths.set(sPaths);\n };\n var getTriggeringItem = function (menuValue) {\n return find(expansions.get(), function (v, _k) {\n return v === menuValue;\n });\n };\n var getTriggerData = function (menuValue, getItemByValue, path) {\n return getPreparedMenu(menuValue).bind(function (menu) {\n return getTriggeringItem(menuValue).bind(function (triggeringItemValue) {\n return getItemByValue(triggeringItemValue).map(function (triggeredItem) {\n return {\n triggeredMenu: menu,\n triggeringItem: triggeredItem,\n triggeringPath: path\n };\n });\n });\n });\n };\n var getTriggeringPath = function (itemValue, getItemByValue) {\n var extraPath = filter$1(lookupItem(itemValue).toArray(), function (menuValue) {\n return getPreparedMenu(menuValue).isSome();\n });\n return get(paths.get(), itemValue).bind(function (path) {\n var revPath = reverse(extraPath.concat(path));\n var triggers = bind(revPath, function (menuValue, menuIndex) {\n return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () {\n return primary.get().is(menuValue) ? [] : [Option.none()];\n }, function (data) {\n return [Option.some(data)];\n });\n });\n return sequence(triggers);\n });\n };\n var expand = function (itemValue) {\n return get(expansions.get(), itemValue).map(function (menu) {\n var current = get(paths.get(), itemValue).getOr([]);\n return [menu].concat(current);\n });\n };\n var collapse = function (itemValue) {\n return get(paths.get(), itemValue).bind(function (path) {\n return path.length > 1 ? Option.some(path.slice(1)) : Option.none();\n });\n };\n var refresh = function (itemValue) {\n return get(paths.get(), itemValue);\n };\n var getPreparedMenu = function (menuValue) {\n return lookupMenu(menuValue).bind(extractPreparedMenu);\n };\n var lookupMenu = function (menuValue) {\n return get(menus.get(), menuValue);\n };\n var lookupItem = function (itemValue) {\n return get(expansions.get(), itemValue);\n };\n var otherMenus = function (path) {\n var menuValues = directory.get();\n return difference(keys(menuValues), path);\n };\n var getPrimary = function () {\n return primary.get().bind(getPreparedMenu);\n };\n var getMenus = function () {\n return menus.get();\n };\n return {\n setMenuBuilt: setMenuBuilt,\n setContents: setContents,\n expand: expand,\n refresh: refresh,\n collapse: collapse,\n lookupMenu: lookupMenu,\n lookupItem: lookupItem,\n otherMenus: otherMenus,\n getPrimary: getPrimary,\n getMenus: getMenus,\n clear: clear,\n isClear: isClear,\n getTriggeringPath: getTriggeringPath\n };\n };\n var extractPreparedMenu = function (prep) {\n return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none();\n };\n var LayeredState = {\n init: init$3,\n extractPreparedMenu: extractPreparedMenu\n };\n\n var make$3 = function (detail, _rawUiSpec) {\n var submenuParentItems = Cell(Option.none());\n var buildMenus = function (container, primaryName, menus) {\n return map(menus, function (spec, name) {\n var makeSketch = function () {\n return Menu.sketch(__assign(__assign({}, spec), {\n value: name,\n markers: detail.markers,\n fakeFocus: detail.fakeFocus,\n onHighlight: detail.onHighlight,\n focusManager: detail.fakeFocus ? highlights() : dom()\n }));\n };\n return name === primaryName ? {\n type: 'prepared',\n menu: container.getSystem().build(makeSketch())\n } : {\n type: 'notbuilt',\n nbMenu: makeSketch\n };\n });\n };\n var layeredState = LayeredState.init();\n var setup = function (container) {\n var componentMap = buildMenus(container, detail.data.primary, detail.data.menus);\n var directory = toDirectory();\n layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory);\n return layeredState.getPrimary();\n };\n var getItemValue = function (item) {\n return Representing.getValue(item).value;\n };\n var getItemByValue = function (_container, menus, itemValue) {\n return findMap(menus, function (menu) {\n if (!menu.getSystem().isConnected()) {\n return Option.none();\n }\n var candidates = Highlighting.getCandidates(menu);\n return find$2(candidates, function (c) {\n return getItemValue(c) === itemValue;\n });\n });\n };\n var toDirectory = function (_container) {\n return map(detail.data.menus, function (data, _menuName) {\n return bind(data.items, function (item) {\n return item.type === 'separator' ? [] : [item.data.value];\n });\n });\n };\n var setActiveMenu = function (container, menu) {\n Highlighting.highlight(container, menu);\n Highlighting.getHighlighted(menu).orThunk(function () {\n return Highlighting.getFirst(menu);\n }).each(function (item) {\n dispatch(container, item.element(), focusItem());\n });\n };\n var getMenus = function (state, menuValues) {\n return cat(map$1(menuValues, function (mv) {\n return state.lookupMenu(mv).bind(function (prep) {\n return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none();\n });\n }));\n };\n var closeOthers = function (container, state, path) {\n var others = getMenus(state, state.otherMenus(path));\n each$1(others, function (o) {\n remove$6(o.element(), [detail.markers.backgroundMenu]);\n if (!detail.stayInDom) {\n Replacing.remove(container, o);\n }\n });\n };\n var getSubmenuParents = function (container) {\n return submenuParentItems.get().getOrThunk(function () {\n var r = {};\n var items = descendants(container.element(), '.' + detail.markers.item);\n var parentItems = filter$1(items, function (i) {\n return get$1(i, 'aria-haspopup') === 'true';\n });\n each$1(parentItems, function (i) {\n container.getSystem().getByDom(i).each(function (itemComp) {\n var key = getItemValue(itemComp);\n r[key] = itemComp;\n });\n });\n submenuParentItems.set(Option.some(r));\n return r;\n });\n };\n var updateAriaExpansions = function (container, path) {\n var parentItems = getSubmenuParents(container);\n each(parentItems, function (v, k) {\n var expanded = contains(path, k);\n set(v.element(), 'aria-expanded', expanded);\n });\n };\n var updateMenuPath = function (container, state, path) {\n return Option.from(path[0]).bind(function (latestMenuName) {\n return state.lookupMenu(latestMenuName).bind(function (menuPrep) {\n if (menuPrep.type === 'notbuilt') {\n return Option.none();\n } else {\n var activeMenu = menuPrep.menu;\n var rest = getMenus(state, path.slice(1));\n each$1(rest, function (r) {\n add$2(r.element(), detail.markers.backgroundMenu);\n });\n if (!inBody(activeMenu.element())) {\n Replacing.append(container, premade$1(activeMenu));\n }\n remove$6(activeMenu.element(), [detail.markers.backgroundMenu]);\n setActiveMenu(container, activeMenu);\n closeOthers(container, state, path);\n return Option.some(activeMenu);\n }\n });\n });\n };\n var ExpandHighlightDecision;\n (function (ExpandHighlightDecision) {\n ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu';\n ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent';\n }(ExpandHighlightDecision || (ExpandHighlightDecision = {})));\n var buildIfRequired = function (container, menuName, menuPrep) {\n if (menuPrep.type === 'notbuilt') {\n var menu = container.getSystem().build(menuPrep.nbMenu());\n layeredState.setMenuBuilt(menuName, menu);\n return menu;\n } else {\n return menuPrep.menu;\n }\n };\n var expandRight = function (container, item, decision) {\n if (decision === void 0) {\n decision = ExpandHighlightDecision.HighlightSubmenu;\n }\n var value = getItemValue(item);\n return layeredState.expand(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return Option.from(path[0]).bind(function (menuName) {\n return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) {\n var activeMenu = buildIfRequired(container, menuName, activeMenuPrep);\n if (!inBody(activeMenu.element())) {\n Replacing.append(container, premade$1(activeMenu));\n }\n detail.onOpenSubmenu(container, item, activeMenu, reverse(path));\n if (decision === ExpandHighlightDecision.HighlightSubmenu) {\n Highlighting.highlightFirst(activeMenu);\n return updateMenuPath(container, layeredState, path);\n } else {\n Highlighting.dehighlightAll(activeMenu);\n return Option.some(item);\n }\n });\n });\n });\n };\n var collapseLeft = function (container, item) {\n var value = getItemValue(item);\n return layeredState.collapse(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return updateMenuPath(container, layeredState, path).map(function (activeMenu) {\n detail.onCollapseMenu(container, item, activeMenu);\n return activeMenu;\n });\n });\n };\n var updateView = function (container, item) {\n var value = getItemValue(item);\n return layeredState.refresh(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return updateMenuPath(container, layeredState, path);\n });\n };\n var onRight = function (container, item) {\n return inside(item.element()) ? Option.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu);\n };\n var onLeft = function (container, item) {\n return inside(item.element()) ? Option.none() : collapseLeft(container, item);\n };\n var onEscape = function (container, item) {\n return collapseLeft(container, item).orThunk(function () {\n return detail.onEscape(container, item).map(function () {\n return container;\n });\n });\n };\n var keyOnItem = function (f) {\n return function (container, simulatedEvent) {\n return closest$2(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) {\n return container.getSystem().getByDom(target).toOption().bind(function (item) {\n return f(container, item).map(function () {\n return true;\n });\n });\n });\n };\n };\n var events = derive([\n run(focus$4(), function (sandbox, simulatedEvent) {\n var item = simulatedEvent.event().item();\n layeredState.lookupItem(getItemValue(item)).each(function () {\n var menu = simulatedEvent.event().menu();\n Highlighting.highlight(sandbox, menu);\n var value = getItemValue(simulatedEvent.event().item());\n layeredState.refresh(value).each(function (path) {\n return closeOthers(sandbox, layeredState, path);\n });\n });\n }),\n runOnExecute(function (component, simulatedEvent) {\n var target = simulatedEvent.event().target();\n component.getSystem().getByDom(target).each(function (item) {\n var itemValue = getItemValue(item);\n if (itemValue.indexOf('collapse-item') === 0) {\n collapseLeft(component, item);\n }\n expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () {\n detail.onExecute(component, item);\n }, function () {\n });\n });\n }),\n runOnAttached(function (container, _simulatedEvent) {\n setup(container).each(function (primary) {\n Replacing.append(container, premade$1(primary));\n detail.onOpenMenu(container, primary);\n if (detail.highlightImmediately) {\n setActiveMenu(container, primary);\n }\n });\n })\n ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) {\n var item = simulatedEvent.event().item();\n updateView(sandbox, item);\n expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent);\n detail.onHover(sandbox, item);\n })] : []));\n var getActiveItem = function (container) {\n return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted);\n };\n var collapseMenuApi = function (container) {\n getActiveItem(container).each(function (currentItem) {\n collapseLeft(container, currentItem);\n });\n };\n var highlightPrimary = function (container) {\n layeredState.getPrimary().each(function (primary) {\n setActiveMenu(container, primary);\n });\n };\n var extractMenuFromContainer = function (container) {\n return Option.from(container.components()[0]).filter(function (comp) {\n return get$1(comp.element(), 'role') === 'menu';\n });\n };\n var repositionMenus = function (container) {\n var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) {\n return getActiveItem(container).bind(function (currentItem) {\n var itemValue = getItemValue(currentItem);\n var allMenus = values(layeredState.getMenus());\n var preparedMenus = cat(map$1(allMenus, LayeredState.extractPreparedMenu));\n return layeredState.getTriggeringPath(itemValue, function (v) {\n return getItemByValue(container, preparedMenus, v);\n });\n }).map(function (triggeringPath) {\n return {\n primary: primary,\n triggeringPath: triggeringPath\n };\n });\n });\n maybeActivePrimary.fold(function () {\n extractMenuFromContainer(container).each(function (primaryMenu) {\n detail.onRepositionMenu(container, primaryMenu, []);\n });\n }, function (_a) {\n var primary = _a.primary, triggeringPath = _a.triggeringPath;\n detail.onRepositionMenu(container, primary, triggeringPath);\n });\n };\n var apis = {\n collapseMenu: collapseMenuApi,\n highlightPrimary: highlightPrimary,\n repositionMenus: repositionMenus\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n markers: detail.markers,\n behaviours: augment(detail.tmenuBehaviours, [\n Keying.config({\n mode: 'special',\n onRight: keyOnItem(onRight),\n onLeft: keyOnItem(onLeft),\n onEscape: keyOnItem(onEscape),\n focusIn: function (container, _keyInfo) {\n layeredState.getPrimary().each(function (primary) {\n dispatch(container, primary.element(), focusItem());\n });\n }\n }),\n Highlighting.config({\n highlightClass: detail.markers.selectedMenu,\n itemClass: detail.markers.menu\n }),\n Composing.config({\n find: function (container) {\n return Highlighting.getHighlighted(container);\n }\n }),\n Replacing.config({})\n ]),\n eventOrder: detail.eventOrder,\n apis: apis,\n events: events\n };\n };\n var collapseItem = constant('collapse-item');\n\n var tieredData = function (primary, menus, expansions) {\n return {\n primary: primary,\n menus: menus,\n expansions: expansions\n };\n };\n var singleData = function (name, menu) {\n return {\n primary: name,\n menus: wrap$1(name, menu),\n expansions: {}\n };\n };\n var collapseItem$1 = function (text) {\n return {\n value: generate$1(collapseItem()),\n meta: { text: text }\n };\n };\n var tieredMenu = single$2({\n name: 'TieredMenu',\n configFields: [\n onStrictKeyboardHandler('onExecute'),\n onStrictKeyboardHandler('onEscape'),\n onStrictHandler('onOpenMenu'),\n onStrictHandler('onOpenSubmenu'),\n onHandler('onRepositionMenu'),\n onHandler('onCollapseMenu'),\n defaulted$1('highlightImmediately', true),\n strictObjOf('data', [\n strict$1('primary'),\n strict$1('menus'),\n strict$1('expansions')\n ]),\n defaulted$1('fakeFocus', false),\n onHandler('onHighlight'),\n onHandler('onHover'),\n tieredMenuMarkers(),\n strict$1('dom'),\n defaulted$1('navigateOnHover', true),\n defaulted$1('stayInDom', false),\n field$1('tmenuBehaviours', [\n Keying,\n Highlighting,\n Composing,\n Replacing\n ]),\n defaulted$1('eventOrder', {})\n ],\n apis: {\n collapseMenu: function (apis, tmenu) {\n apis.collapseMenu(tmenu);\n },\n highlightPrimary: function (apis, tmenu) {\n apis.highlightPrimary(tmenu);\n },\n repositionMenus: function (apis, tmenu) {\n apis.repositionMenus(tmenu);\n }\n },\n factory: make$3,\n extraApis: {\n tieredData: tieredData,\n singleData: singleData,\n collapseItem: collapseItem$1\n }\n });\n\n var findRoute = function (component, transConfig, transState, route) {\n return get(transConfig.routes, route.start).bind(function (sConfig) {\n return get(sConfig, route.destination);\n });\n };\n var getTransition = function (comp, transConfig, transState) {\n var route = getCurrentRoute(comp, transConfig);\n return route.bind(function (r) {\n return getTransitionOf(comp, transConfig, transState, r);\n });\n };\n var getTransitionOf = function (comp, transConfig, transState, route) {\n return findRoute(comp, transConfig, transState, route).bind(function (r) {\n return r.transition.map(function (t) {\n return {\n transition: t,\n route: r\n };\n });\n });\n };\n var disableTransition = function (comp, transConfig, transState) {\n getTransition(comp, transConfig, transState).each(function (routeTransition) {\n var t = routeTransition.transition;\n remove$4(comp.element(), t.transitionClass);\n remove$1(comp.element(), transConfig.destinationAttr);\n });\n };\n var getNewRoute = function (comp, transConfig, transState, destination) {\n return {\n start: get$1(comp.element(), transConfig.stateAttr),\n destination: destination\n };\n };\n var getCurrentRoute = function (comp, transConfig, _transState) {\n var el = comp.element();\n return getOpt(el, transConfig.destinationAttr).map(function (destination) {\n return {\n start: get$1(comp.element(), transConfig.stateAttr),\n destination: destination\n };\n });\n };\n var jumpTo = function (comp, transConfig, transState, destination) {\n disableTransition(comp, transConfig, transState);\n if (has$1(comp.element(), transConfig.stateAttr) && get$1(comp.element(), transConfig.stateAttr) !== destination) {\n transConfig.onFinish(comp, destination);\n }\n set(comp.element(), transConfig.stateAttr, destination);\n };\n var fasttrack = function (comp, transConfig, _transState, _destination) {\n if (has$1(comp.element(), transConfig.destinationAttr)) {\n getOpt(comp.element(), transConfig.destinationAttr).each(function (destination) {\n set(comp.element(), transConfig.stateAttr, destination);\n });\n remove$1(comp.element(), transConfig.destinationAttr);\n }\n };\n var progressTo = function (comp, transConfig, transState, destination) {\n fasttrack(comp, transConfig);\n var route = getNewRoute(comp, transConfig, transState, destination);\n getTransitionOf(comp, transConfig, transState, route).fold(function () {\n jumpTo(comp, transConfig, transState, destination);\n }, function (routeTransition) {\n disableTransition(comp, transConfig, transState);\n var t = routeTransition.transition;\n add$2(comp.element(), t.transitionClass);\n set(comp.element(), transConfig.destinationAttr, destination);\n });\n };\n var getState$1 = function (comp, transConfig, _transState) {\n return getOpt(comp.element(), transConfig.stateAttr);\n };\n\n var TransitionApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n findRoute: findRoute,\n disableTransition: disableTransition,\n getCurrentRoute: getCurrentRoute,\n jumpTo: jumpTo,\n progressTo: progressTo,\n getState: getState$1\n });\n\n var events$9 = function (transConfig, transState) {\n return derive([\n run(transitionend(), function (component, simulatedEvent) {\n var raw = simulatedEvent.event().raw();\n getCurrentRoute(component, transConfig).each(function (route) {\n findRoute(component, transConfig, transState, route).each(function (rInfo) {\n rInfo.transition.each(function (rTransition) {\n if (raw.propertyName === rTransition.property) {\n jumpTo(component, transConfig, transState, route.destination);\n transConfig.onTransition(component, route);\n }\n });\n });\n });\n }),\n runOnAttached(function (comp, _se) {\n jumpTo(comp, transConfig, transState, transConfig.initialState);\n })\n ]);\n };\n\n var ActiveTransitioning = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$9\n });\n\n var TransitionSchema = [\n defaulted$1('destinationAttr', 'data-transitioning-destination'),\n defaulted$1('stateAttr', 'data-transitioning-state'),\n strict$1('initialState'),\n onHandler('onTransition'),\n onHandler('onFinish'),\n strictOf('routes', setOf$1(Result.value, setOf$1(Result.value, objOfOnly([optionObjOfOnly('transition', [\n strict$1('property'),\n strict$1('transitionClass')\n ])]))))\n ];\n\n var createRoutes = function (routes) {\n var r = {};\n each(routes, function (v, k) {\n var waypoints = k.split('<->');\n r[waypoints[0]] = wrap$1(waypoints[1], v);\n r[waypoints[1]] = wrap$1(waypoints[0], v);\n });\n return r;\n };\n var createBistate = function (first, second, transitions) {\n return wrapAll$1([\n {\n key: first,\n value: wrap$1(second, transitions)\n },\n {\n key: second,\n value: wrap$1(first, transitions)\n }\n ]);\n };\n var createTristate = function (first, second, third, transitions) {\n return wrapAll$1([\n {\n key: first,\n value: wrapAll$1([\n {\n key: second,\n value: transitions\n },\n {\n key: third,\n value: transitions\n }\n ])\n },\n {\n key: second,\n value: wrapAll$1([\n {\n key: first,\n value: transitions\n },\n {\n key: third,\n value: transitions\n }\n ])\n },\n {\n key: third,\n value: wrapAll$1([\n {\n key: first,\n value: transitions\n },\n {\n key: second,\n value: transitions\n }\n ])\n }\n ]);\n };\n var Transitioning = create$1({\n fields: TransitionSchema,\n name: 'transitioning',\n active: ActiveTransitioning,\n apis: TransitionApis,\n extra: {\n createRoutes: createRoutes,\n createBistate: createBistate,\n createTristate: createTristate\n }\n });\n\n var scrollableStyle = resolve('scrollable');\n var register = function (element) {\n add$2(element, scrollableStyle);\n };\n var deregister = function (element) {\n remove$4(element, scrollableStyle);\n };\n var scrollable = scrollableStyle;\n\n var getValue$4 = function (item) {\n return get(item, 'format').getOr(item.title);\n };\n var convert$1 = function (formats, memMenuThunk) {\n var mainMenu = makeMenu('Styles', [].concat(map$1(formats.items, function (k) {\n return makeItem(getValue$4(k), k.title, k.isSelected(), k.getPreview(), hasNonNullableKey(formats.expansions, getValue$4(k)));\n })), memMenuThunk, false);\n var submenus = map(formats.menus, function (menuItems, menuName) {\n var items = map$1(menuItems, function (item) {\n return makeItem(getValue$4(item), item.title, item.isSelected !== undefined ? item.isSelected() : false, item.getPreview !== undefined ? item.getPreview() : '', hasNonNullableKey(formats.expansions, getValue$4(item)));\n });\n return makeMenu(menuName, items, memMenuThunk, true);\n });\n var menus = deepMerge(submenus, wrap$1('styles', mainMenu));\n var tmenu = tieredMenu.tieredData('styles', menus, formats.expansions);\n return { tmenu: tmenu };\n };\n var makeItem = function (value, text, selected, preview, isMenu) {\n return {\n data: {\n value: value,\n text: text\n },\n type: 'item',\n dom: {\n tag: 'div',\n classes: isMenu ? [resolve('styles-item-is-menu')] : []\n },\n toggling: {\n toggleOnExecute: false,\n toggleClass: resolve('format-matches'),\n selected: selected\n },\n itemBehaviours: derive$1(isMenu ? [] : [format(value, function (comp, status) {\n var toggle = status ? Toggling.on : Toggling.off;\n toggle(comp);\n })]),\n components: [{\n dom: {\n tag: 'div',\n attributes: { style: preview },\n innerHtml: text\n }\n }]\n };\n };\n var makeMenu = function (value, items, memMenuThunk, collapsable) {\n return {\n value: value,\n dom: { tag: 'div' },\n components: [\n Button.sketch({\n dom: {\n tag: 'div',\n classes: [resolve('styles-collapser')]\n },\n components: collapsable ? [\n {\n dom: {\n tag: 'span',\n classes: [resolve('styles-collapse-icon')]\n }\n },\n text(value)\n ] : [text(value)],\n action: function (item) {\n if (collapsable) {\n var comp = memMenuThunk().get(item);\n tieredMenu.collapseMenu(comp);\n }\n }\n }),\n {\n dom: {\n tag: 'div',\n classes: [resolve('styles-menu-items-container')]\n },\n components: [Menu.parts().items({})],\n behaviours: derive$1([config('adhoc-scrollable-menu', [\n runOnAttached(function (component, _simulatedEvent) {\n set$3(component.element(), 'overflow-y', 'auto');\n set$3(component.element(), '-webkit-overflow-scrolling', 'touch');\n register(component.element());\n }),\n runOnDetached(function (component) {\n remove$5(component.element(), 'overflow-y');\n remove$5(component.element(), '-webkit-overflow-scrolling');\n deregister(component.element());\n })\n ])])\n }\n ],\n items: items,\n menuBehaviours: derive$1([Transitioning.config({\n initialState: 'after',\n routes: Transitioning.createTristate('before', 'current', 'after', {\n transition: {\n property: 'transform',\n transitionClass: 'transitioning'\n }\n })\n })])\n };\n };\n var sketch$8 = function (settings) {\n var dataset = convert$1(settings.formats, function () {\n return memMenu;\n });\n var memMenu = record(tieredMenu.sketch({\n dom: {\n tag: 'div',\n classes: [resolve('styles-menu')]\n },\n components: [],\n fakeFocus: true,\n stayInDom: true,\n onExecute: function (_tmenu, item) {\n var v = Representing.getValue(item);\n settings.handle(item, v.value);\n return Option.none();\n },\n onEscape: function () {\n return Option.none();\n },\n onOpenMenu: function (container, menu) {\n var w = get$7(container.element());\n set$4(menu.element(), w);\n Transitioning.jumpTo(menu, 'current');\n },\n onOpenSubmenu: function (container, item, submenu) {\n var w = get$7(container.element());\n var menu = ancestor$2(item.element(), '[role=\"menu\"]').getOrDie('hacky');\n var menuComp = container.getSystem().getByDom(menu).getOrDie();\n set$4(submenu.element(), w);\n Transitioning.progressTo(menuComp, 'before');\n Transitioning.jumpTo(submenu, 'after');\n Transitioning.progressTo(submenu, 'current');\n },\n onCollapseMenu: function (container, item, menu) {\n var submenu = ancestor$2(item.element(), '[role=\"menu\"]').getOrDie('hacky');\n var submenuComp = container.getSystem().getByDom(submenu).getOrDie();\n Transitioning.progressTo(submenuComp, 'after');\n Transitioning.progressTo(menu, 'current');\n },\n navigateOnHover: false,\n highlightImmediately: true,\n data: dataset.tmenu,\n markers: {\n backgroundMenu: resolve('styles-background-menu'),\n menu: resolve('styles-menu'),\n selectedMenu: resolve('styles-selected-menu'),\n item: resolve('styles-item'),\n selectedItem: resolve('styles-selected-item')\n }\n }));\n return memMenu.asSpec();\n };\n\n var getFromExpandingItem = function (item) {\n var newItem = deepMerge(exclude$1(item, ['items']), { menu: true });\n var rest = expand(item.items);\n var newMenus = deepMerge(rest.menus, wrap$1(item.title, rest.items));\n var newExpansions = deepMerge(rest.expansions, wrap$1(item.title, item.title));\n return {\n item: newItem,\n menus: newMenus,\n expansions: newExpansions\n };\n };\n var getFromItem = function (item) {\n return hasNonNullableKey(item, 'items') ? getFromExpandingItem(item) : {\n item: item,\n menus: {},\n expansions: {}\n };\n };\n var expand = function (items) {\n return foldr(items, function (acc, item) {\n var newData = getFromItem(item);\n return {\n menus: deepMerge(acc.menus, newData.menus),\n items: [newData.item].concat(acc.items),\n expansions: deepMerge(acc.expansions, newData.expansions)\n };\n }, {\n menus: {},\n expansions: {},\n items: []\n });\n };\n\n var register$1 = function (editor) {\n var isSelectedFor = function (format) {\n return function () {\n return editor.formatter.match(format);\n };\n };\n var getPreview = function (format) {\n return function () {\n return editor.formatter.getCssText(format);\n };\n };\n var enrichSupported = function (item) {\n return deepMerge(item, {\n isSelected: isSelectedFor(item.format),\n getPreview: getPreview(item.format)\n });\n };\n var enrichMenu = function (item) {\n return deepMerge(item, {\n isSelected: constant(false),\n getPreview: constant('')\n });\n };\n var enrichCustom = function (item) {\n var formatName = generate$1(item.title);\n var newItem = deepMerge(item, {\n format: formatName,\n isSelected: isSelectedFor(formatName),\n getPreview: getPreview(formatName)\n });\n editor.formatter.register(formatName, newItem);\n return newItem;\n };\n var doEnrich = function (items) {\n return map$1(items, function (item) {\n if (hasNonNullableKey(item, 'items')) {\n var newItems = doEnrich(item.items);\n return deepMerge(enrichMenu(item), { items: newItems });\n } else if (hasNonNullableKey(item, 'format')) {\n return enrichSupported(item);\n } else {\n return enrichCustom(item);\n }\n });\n };\n return doEnrich(getStyleFormats(editor));\n };\n var prune = function (editor, formats) {\n var doPrune = function (items) {\n return bind(items, function (item) {\n if (item.items !== undefined) {\n var newItems = doPrune(item.items);\n return newItems.length > 0 ? [item] : [];\n } else {\n var keep = hasNonNullableKey(item, 'format') ? editor.formatter.canApply(item.format) : true;\n return keep ? [item] : [];\n }\n });\n };\n var prunedItems = doPrune(formats);\n return expand(prunedItems);\n };\n var ui = function (editor, formats, onDone) {\n var pruned = prune(editor, formats);\n return sketch$8({\n formats: pruned,\n handle: function (item, value) {\n editor.undoManager.transact(function () {\n if (Toggling.isOn(item)) {\n editor.formatter.remove(value);\n } else {\n editor.formatter.apply(value);\n }\n });\n onDone();\n }\n });\n };\n\n var extract$1 = function (rawToolbar) {\n var toolbar = rawToolbar.replace(/\\|/g, ' ').trim();\n return toolbar.length > 0 ? toolbar.split(/\\s+/) : [];\n };\n var identifyFromArray = function (toolbar) {\n return bind(toolbar, function (item) {\n return isArray(item) ? identifyFromArray(item) : extract$1(item);\n });\n };\n var identify = function (editor) {\n var toolbar = getToolbar(editor);\n return isArray(toolbar) ? identifyFromArray(toolbar) : extract$1(toolbar);\n };\n var setup = function (realm, editor) {\n var commandSketch = function (name) {\n return function () {\n return forToolbarCommand(editor, name);\n };\n };\n var stateCommandSketch = function (name) {\n return function () {\n return forToolbarStateCommand(editor, name);\n };\n };\n var actionSketch = function (name, query, action) {\n return function () {\n return forToolbarStateAction(editor, name, query, action);\n };\n };\n var undo = commandSketch('undo');\n var redo = commandSketch('redo');\n var bold = stateCommandSketch('bold');\n var italic = stateCommandSketch('italic');\n var underline = stateCommandSketch('underline');\n var removeformat = commandSketch('removeformat');\n var link = function () {\n return sketch$7(realm, editor);\n };\n var unlink = actionSketch('unlink', 'link', function () {\n editor.execCommand('unlink', null, false);\n });\n var image = function () {\n return sketch$4(editor);\n };\n var bullist = actionSketch('unordered-list', 'ul', function () {\n editor.execCommand('InsertUnorderedList', null, false);\n });\n var numlist = actionSketch('ordered-list', 'ol', function () {\n editor.execCommand('InsertOrderedList', null, false);\n });\n var fontsizeselect = function () {\n return sketch$3(realm, editor);\n };\n var forecolor = function () {\n return sketch$1(realm, editor);\n };\n var styleFormats = register$1(editor);\n var styleFormatsMenu = function () {\n return ui(editor, styleFormats, function () {\n editor.fire('scrollIntoView');\n });\n };\n var styleselect = function () {\n return forToolbar('style-formats', function (button) {\n editor.fire('toReading');\n realm.dropup().appear(styleFormatsMenu, Toggling.on, button);\n }, derive$1([\n Toggling.config({\n toggleClass: resolve('toolbar-button-selected'),\n toggleOnExecute: false,\n aria: { mode: 'pressed' }\n }),\n Receiving.config({\n channels: wrapAll$1([\n receive$1(orientationChanged, Toggling.off),\n receive$1(dropupDismissed, Toggling.off)\n ])\n })\n ]), editor);\n };\n var feature = function (prereq, sketch) {\n return {\n isSupported: function () {\n var buttons = editor.ui.registry.getAll().buttons;\n return prereq.forall(function (p) {\n return hasNonNullableKey(buttons, p);\n });\n },\n sketch: sketch\n };\n };\n return {\n undo: feature(Option.none(), undo),\n redo: feature(Option.none(), redo),\n bold: feature(Option.none(), bold),\n italic: feature(Option.none(), italic),\n underline: feature(Option.none(), underline),\n removeformat: feature(Option.none(), removeformat),\n link: feature(Option.none(), link),\n unlink: feature(Option.none(), unlink),\n image: feature(Option.none(), image),\n bullist: feature(Option.some('bullist'), bullist),\n numlist: feature(Option.some('numlist'), numlist),\n fontsizeselect: feature(Option.none(), fontsizeselect),\n forecolor: feature(Option.none(), forecolor),\n styleselect: feature(Option.none(), styleselect)\n };\n };\n var detect$4 = function (editor, features) {\n var itemNames = identify(editor);\n var present = {};\n return bind(itemNames, function (iName) {\n var r = !hasNonNullableKey(present, iName) && hasNonNullableKey(features, iName) && features[iName].isSupported() ? [features[iName].sketch()] : [];\n present[iName] = true;\n return r;\n });\n };\n\n var mkEvent = function (target, x, y, stop, prevent, kill, raw) {\n return {\n target: constant(target),\n x: constant(x),\n y: constant(y),\n stop: stop,\n prevent: prevent,\n kill: kill,\n raw: constant(raw)\n };\n };\n var fromRawEvent = function (rawEvent) {\n var target = Element.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target));\n var stop = function () {\n return rawEvent.stopPropagation();\n };\n var prevent = function () {\n return rawEvent.preventDefault();\n };\n var kill = compose(prevent, stop);\n return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);\n };\n var handle = function (filter, handler) {\n return function (rawEvent) {\n if (filter(rawEvent)) {\n handler(fromRawEvent(rawEvent));\n }\n };\n };\n var binder = function (element, event, filter, handler, useCapture) {\n var wrapped = handle(filter, handler);\n element.dom().addEventListener(event, wrapped, useCapture);\n return { unbind: curry(unbind, element, event, wrapped, useCapture) };\n };\n var bind$2 = function (element, event, filter, handler) {\n return binder(element, event, filter, handler, false);\n };\n var capture = function (element, event, filter, handler) {\n return binder(element, event, filter, handler, true);\n };\n var unbind = function (element, event, handler, useCapture) {\n element.dom().removeEventListener(event, handler, useCapture);\n };\n\n var filter$2 = constant(true);\n var bind$3 = function (element, event, handler) {\n return bind$2(element, event, filter$2, handler);\n };\n var capture$1 = function (element, event, handler) {\n return capture(element, event, filter$2, handler);\n };\n\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n\n var INTERVAL = 50;\n var INSURANCE = 1000 / INTERVAL;\n var get$b = function (outerWindow) {\n var isPortrait = outerWindow.matchMedia('(orientation: portrait)').matches;\n return { isPortrait: constant(isPortrait) };\n };\n var getActualWidth = function (outerWindow) {\n var isIos = detect$3().os.isiOS();\n var isPortrait = get$b(outerWindow).isPortrait();\n return isIos && !isPortrait ? outerWindow.screen.height : outerWindow.screen.width;\n };\n var onChange = function (outerWindow, listeners) {\n var win = Element.fromDom(outerWindow);\n var poller = null;\n var change = function () {\n global$4.clearInterval(poller);\n var orientation = get$b(outerWindow);\n listeners.onChange(orientation);\n onAdjustment(function () {\n listeners.onReady(orientation);\n });\n };\n var orientationHandle = bind$3(win, 'orientationchange', change);\n var onAdjustment = function (f) {\n global$4.clearInterval(poller);\n var flag = outerWindow.innerHeight;\n var insurance = 0;\n poller = global$4.setInterval(function () {\n if (flag !== outerWindow.innerHeight) {\n global$4.clearInterval(poller);\n f(Option.some(outerWindow.innerHeight));\n } else if (insurance > INSURANCE) {\n global$4.clearInterval(poller);\n f(Option.none());\n }\n insurance++;\n }, INTERVAL);\n };\n var destroy = function () {\n orientationHandle.unbind();\n };\n return {\n onAdjustment: onAdjustment,\n destroy: destroy\n };\n };\n\n function DelayedFunction (fun, delay) {\n var ref = null;\n var schedule = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n ref = domGlobals.setTimeout(function () {\n fun.apply(null, args);\n ref = null;\n }, delay);\n };\n var cancel = function () {\n if (ref !== null) {\n domGlobals.clearTimeout(ref);\n ref = null;\n }\n };\n return {\n cancel: cancel,\n schedule: schedule\n };\n }\n\n var SIGNIFICANT_MOVE = 5;\n var LONGPRESS_DELAY = 400;\n var getTouch = function (event) {\n var raw = event.raw();\n if (raw.touches === undefined || raw.touches.length !== 1) {\n return Option.none();\n }\n return Option.some(raw.touches[0]);\n };\n var isFarEnough = function (touch, data) {\n var distX = Math.abs(touch.clientX - data.x);\n var distY = Math.abs(touch.clientY - data.y);\n return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE;\n };\n var monitor = function (settings) {\n var startData = Cell(Option.none());\n var longpressFired = Cell(false);\n var longpress$1 = DelayedFunction(function (event) {\n settings.triggerEvent(longpress(), event);\n longpressFired.set(true);\n }, LONGPRESS_DELAY);\n var handleTouchstart = function (event) {\n getTouch(event).each(function (touch) {\n longpress$1.cancel();\n var data = {\n x: touch.clientX,\n y: touch.clientY,\n target: event.target()\n };\n longpress$1.schedule(event);\n longpressFired.set(false);\n startData.set(Option.some(data));\n });\n return Option.none();\n };\n var handleTouchmove = function (event) {\n longpress$1.cancel();\n getTouch(event).each(function (touch) {\n startData.get().each(function (data) {\n if (isFarEnough(touch, data)) {\n startData.set(Option.none());\n }\n });\n });\n return Option.none();\n };\n var handleTouchend = function (event) {\n longpress$1.cancel();\n var isSame = function (data) {\n return eq(data.target, event.target());\n };\n return startData.get().filter(isSame).map(function (_data) {\n if (longpressFired.get()) {\n event.prevent();\n return false;\n } else {\n return settings.triggerEvent(tap(), event);\n }\n });\n };\n var handlers = wrapAll$1([\n {\n key: touchstart(),\n value: handleTouchstart\n },\n {\n key: touchmove(),\n value: handleTouchmove\n },\n {\n key: touchend(),\n value: handleTouchend\n }\n ]);\n var fireIfReady = function (event, type) {\n return get(handlers, type).bind(function (handler) {\n return handler(event);\n });\n };\n return { fireIfReady: fireIfReady };\n };\n\n var monitor$1 = function (editorApi) {\n var tapEvent = monitor({\n triggerEvent: function (type, evt) {\n editorApi.onTapContent(evt);\n }\n });\n var onTouchend = function () {\n return bind$3(editorApi.body(), 'touchend', function (evt) {\n tapEvent.fireIfReady(evt, 'touchend');\n });\n };\n var onTouchmove = function () {\n return bind$3(editorApi.body(), 'touchmove', function (evt) {\n tapEvent.fireIfReady(evt, 'touchmove');\n });\n };\n var fireTouchstart = function (evt) {\n tapEvent.fireIfReady(evt, 'touchstart');\n };\n return {\n fireTouchstart: fireTouchstart,\n onTouchend: onTouchend,\n onTouchmove: onTouchmove\n };\n };\n\n var isAndroid6 = detect$3().os.version.major >= 6;\n var initEvents = function (editorApi, toolstrip, alloy) {\n var tapping = monitor$1(editorApi);\n var outerDoc = owner(toolstrip);\n var isRanged = function (sel) {\n return !eq(sel.start(), sel.finish()) || sel.soffset() !== sel.foffset();\n };\n var hasRangeInUi = function () {\n return active(outerDoc).filter(function (input) {\n return name(input) === 'input';\n }).exists(function (input) {\n return input.dom().selectionStart !== input.dom().selectionEnd;\n });\n };\n var updateMargin = function () {\n var rangeInContent = editorApi.doc().dom().hasFocus() && editorApi.getSelection().exists(isRanged);\n alloy.getByDom(toolstrip).each((rangeInContent || hasRangeInUi()) === true ? Toggling.on : Toggling.off);\n };\n var listeners = [\n bind$3(editorApi.body(), 'touchstart', function (evt) {\n editorApi.onTouchContent();\n tapping.fireTouchstart(evt);\n }),\n tapping.onTouchmove(),\n tapping.onTouchend(),\n bind$3(toolstrip, 'touchstart', function (_evt) {\n editorApi.onTouchToolstrip();\n }),\n editorApi.onToReading(function () {\n blur(editorApi.body());\n }),\n editorApi.onToEditing(noop),\n editorApi.onScrollToCursor(function (tinyEvent) {\n tinyEvent.preventDefault();\n editorApi.getCursorBox().each(function (bounds) {\n var cWin = editorApi.win();\n var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight;\n var cScrollBy = isOutside ? bounds.bottom() - cWin.innerHeight + 50 : 0;\n if (cScrollBy !== 0) {\n cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy);\n }\n });\n })\n ].concat(isAndroid6 === true ? [] : [\n bind$3(Element.fromDom(editorApi.win()), 'blur', function () {\n alloy.getByDom(toolstrip).each(Toggling.off);\n }),\n bind$3(outerDoc, 'select', updateMargin),\n bind$3(editorApi.doc(), 'selectionchange', updateMargin)\n ]);\n var destroy = function () {\n each$1(listeners, function (l) {\n l.unbind();\n });\n };\n return { destroy: destroy };\n };\n\n var safeParse = function (element, attribute) {\n var parsed = parseInt(get$1(element, attribute), 10);\n return isNaN(parsed) ? 0 : parsed;\n };\n\n function NodeValue (is, name) {\n var get = function (element) {\n if (!is(element)) {\n throw new Error('Can only get ' + name + ' value of a ' + name + ' node');\n }\n return getOption(element).getOr('');\n };\n var getOption = function (element) {\n return is(element) ? Option.from(element.dom().nodeValue) : Option.none();\n };\n var set = function (element, value) {\n if (!is(element)) {\n throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');\n }\n element.dom().nodeValue = value;\n };\n return {\n get: get,\n getOption: getOption,\n set: set\n };\n }\n\n var api$3 = NodeValue(isText, 'text');\n var getOption = function (element) {\n return api$3.getOption(element);\n };\n\n var getEnd = function (element) {\n return name(element) === 'img' ? 1 : getOption(element).fold(function () {\n return children(element).length;\n }, function (v) {\n return v.length;\n });\n };\n\n var create$3 = function (start, soffset, finish, foffset) {\n return {\n start: constant(start),\n soffset: constant(soffset),\n finish: constant(finish),\n foffset: constant(foffset)\n };\n };\n var SimRange = { create: create$3 };\n\n var adt$4 = Adt.generate([\n { before: ['element'] },\n {\n on: [\n 'element',\n 'offset'\n ]\n },\n { after: ['element'] }\n ]);\n var cata = function (subject, onBefore, onOn, onAfter) {\n return subject.fold(onBefore, onOn, onAfter);\n };\n var getStart = function (situ) {\n return situ.fold(identity, identity, identity);\n };\n var before$1 = adt$4.before;\n var on$1 = adt$4.on;\n var after$1 = adt$4.after;\n var Situ = {\n before: before$1,\n on: on$1,\n after: after$1,\n cata: cata,\n getStart: getStart\n };\n\n var adt$5 = Adt.generate([\n { domRange: ['rng'] },\n {\n relative: [\n 'startSitu',\n 'finishSitu'\n ]\n },\n {\n exact: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var exactFromRange = function (simRange) {\n return adt$5.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset());\n };\n var getStart$1 = function (selection) {\n return selection.match({\n domRange: function (rng) {\n return Element.fromDom(rng.startContainer);\n },\n relative: function (startSitu, _finishSitu) {\n return Situ.getStart(startSitu);\n },\n exact: function (start, _soffset, _finish, _foffset) {\n return start;\n }\n });\n };\n var domRange = adt$5.domRange;\n var relative = adt$5.relative;\n var exact = adt$5.exact;\n var getWin = function (selection) {\n var start = getStart$1(selection);\n return defaultView(start);\n };\n var range$1 = SimRange.create;\n var Selection = {\n domRange: domRange,\n relative: relative,\n exact: exact,\n exactFromRange: exactFromRange,\n getWin: getWin,\n range: range$1\n };\n\n var setStart = function (rng, situ) {\n situ.fold(function (e) {\n rng.setStartBefore(e.dom());\n }, function (e, o) {\n rng.setStart(e.dom(), o);\n }, function (e) {\n rng.setStartAfter(e.dom());\n });\n };\n var setFinish = function (rng, situ) {\n situ.fold(function (e) {\n rng.setEndBefore(e.dom());\n }, function (e, o) {\n rng.setEnd(e.dom(), o);\n }, function (e) {\n rng.setEndAfter(e.dom());\n });\n };\n var relativeToNative = function (win, startSitu, finishSitu) {\n var range = win.document.createRange();\n setStart(range, startSitu);\n setFinish(range, finishSitu);\n return range;\n };\n var exactToNative = function (win, start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n };\n var toRect = function (rect) {\n return {\n left: constant(rect.left),\n top: constant(rect.top),\n right: constant(rect.right),\n bottom: constant(rect.bottom),\n width: constant(rect.width),\n height: constant(rect.height)\n };\n };\n var getFirstRect = function (rng) {\n var rects = rng.getClientRects();\n var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect();\n return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect) : Option.none();\n };\n\n var adt$6 = Adt.generate([\n {\n ltr: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n },\n {\n rtl: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var fromRange = function (win, type, range) {\n return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset);\n };\n var getRanges = function (win, selection) {\n return selection.match({\n domRange: function (rng) {\n return {\n ltr: constant(rng),\n rtl: Option.none\n };\n },\n relative: function (startSitu, finishSitu) {\n return {\n ltr: cached(function () {\n return relativeToNative(win, startSitu, finishSitu);\n }),\n rtl: cached(function () {\n return Option.some(relativeToNative(win, finishSitu, startSitu));\n })\n };\n },\n exact: function (start, soffset, finish, foffset) {\n return {\n ltr: cached(function () {\n return exactToNative(win, start, soffset, finish, foffset);\n }),\n rtl: cached(function () {\n return Option.some(exactToNative(win, finish, foffset, start, soffset));\n })\n };\n }\n });\n };\n var doDiagnose = function (win, ranges) {\n var rng = ranges.ltr();\n if (rng.collapsed) {\n var reversed = ranges.rtl().filter(function (rev) {\n return rev.collapsed === false;\n });\n return reversed.map(function (rev) {\n return adt$6.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset);\n }).getOrThunk(function () {\n return fromRange(win, adt$6.ltr, rng);\n });\n } else {\n return fromRange(win, adt$6.ltr, rng);\n }\n };\n var diagnose = function (win, selection) {\n var ranges = getRanges(win, selection);\n return doDiagnose(win, ranges);\n };\n var asLtrRange = function (win, selection) {\n var diagnosis = diagnose(win, selection);\n return diagnosis.match({\n ltr: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n },\n rtl: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(finish.dom(), foffset);\n rng.setEnd(start.dom(), soffset);\n return rng;\n }\n });\n };\n var ltr = adt$6.ltr;\n var rtl = adt$6.rtl;\n\n var beforeSpecial = function (element, offset) {\n var name$1 = name(element);\n if ('input' === name$1) {\n return Situ.after(element);\n } else if (!contains([\n 'br',\n 'img'\n ], name$1)) {\n return Situ.on(element, offset);\n } else {\n return offset === 0 ? Situ.before(element) : Situ.after(element);\n }\n };\n var preprocessExact = function (start, soffset, finish, foffset) {\n var startSitu = beforeSpecial(start, soffset);\n var finishSitu = beforeSpecial(finish, foffset);\n return Selection.relative(startSitu, finishSitu);\n };\n\n var makeRange = function (start, soffset, finish, foffset) {\n var doc = owner(start);\n var rng = doc.dom().createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n };\n var after$2 = function (start, soffset, finish, foffset) {\n var r = makeRange(start, soffset, finish, foffset);\n var same = eq(start, finish) && soffset === foffset;\n return r.collapsed && !same;\n };\n\n var doSetNativeRange = function (win, rng) {\n Option.from(win.getSelection()).each(function (selection) {\n selection.removeAllRanges();\n selection.addRange(rng);\n });\n };\n var doSetRange = function (win, start, soffset, finish, foffset) {\n var rng = exactToNative(win, start, soffset, finish, foffset);\n doSetNativeRange(win, rng);\n };\n var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) {\n selection.collapse(start.dom(), soffset);\n selection.extend(finish.dom(), foffset);\n };\n var setRangeFromRelative = function (win, relative) {\n return diagnose(win, relative).match({\n ltr: function (start, soffset, finish, foffset) {\n doSetRange(win, start, soffset, finish, foffset);\n },\n rtl: function (start, soffset, finish, foffset) {\n var selection = win.getSelection();\n if (selection.setBaseAndExtent) {\n selection.setBaseAndExtent(start.dom(), soffset, finish.dom(), foffset);\n } else if (selection.extend) {\n try {\n setLegacyRtlRange(win, selection, start, soffset, finish, foffset);\n } catch (e) {\n doSetRange(win, finish, foffset, start, soffset);\n }\n } else {\n doSetRange(win, finish, foffset, start, soffset);\n }\n }\n });\n };\n var setExact = function (win, start, soffset, finish, foffset) {\n var relative = preprocessExact(start, soffset, finish, foffset);\n setRangeFromRelative(win, relative);\n };\n var readRange = function (selection) {\n if (selection.rangeCount > 0) {\n var firstRng = selection.getRangeAt(0);\n var lastRng = selection.getRangeAt(selection.rangeCount - 1);\n return Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset));\n } else {\n return Option.none();\n }\n };\n var doGetExact = function (selection) {\n var anchor = Element.fromDom(selection.anchorNode);\n var focus = Element.fromDom(selection.focusNode);\n return after$2(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection);\n };\n var getExact = function (win) {\n return Option.from(win.getSelection()).filter(function (sel) {\n return sel.rangeCount > 0;\n }).bind(doGetExact);\n };\n var get$c = function (win) {\n return getExact(win).map(function (range) {\n return Selection.exact(range.start(), range.soffset(), range.finish(), range.foffset());\n });\n };\n var getFirstRect$1 = function (win, selection) {\n var rng = asLtrRange(win, selection);\n return getFirstRect(rng);\n };\n var clear$1 = function (win) {\n var selection = win.getSelection();\n selection.removeAllRanges();\n };\n\n var COLLAPSED_WIDTH = 2;\n var collapsedRect = function (rect) {\n return {\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n width: constant(COLLAPSED_WIDTH),\n height: rect.height\n };\n };\n var toRect$1 = function (rawRect) {\n return {\n left: constant(rawRect.left),\n top: constant(rawRect.top),\n right: constant(rawRect.right),\n bottom: constant(rawRect.bottom),\n width: constant(rawRect.width),\n height: constant(rawRect.height)\n };\n };\n var getRectsFromRange = function (range) {\n if (!range.collapsed) {\n return map$1(range.getClientRects(), toRect$1);\n } else {\n var start_1 = Element.fromDom(range.startContainer);\n return parent(start_1).bind(function (parent) {\n var selection = Selection.exact(start_1, range.startOffset, parent, getEnd(parent));\n var optRect = getFirstRect$1(range.startContainer.ownerDocument.defaultView, selection);\n return optRect.map(collapsedRect).map(pure);\n }).getOr([]);\n }\n };\n var getRectangles = function (cWin) {\n var sel = cWin.getSelection();\n return sel !== undefined && sel.rangeCount > 0 ? getRectsFromRange(sel.getRangeAt(0)) : [];\n };\n\n var autocompleteHack = function () {\n return function (f) {\n global$4.setTimeout(function () {\n f();\n }, 0);\n };\n };\n var resume = function (cWin) {\n cWin.focus();\n var iBody = Element.fromDom(cWin.document.body);\n var inInput = active().exists(function (elem) {\n return contains([\n 'input',\n 'textarea'\n ], name(elem));\n });\n var transaction = inInput ? autocompleteHack() : apply;\n transaction(function () {\n active().each(blur);\n focus$1(iBody);\n });\n };\n\n var EXTRA_SPACING = 50;\n var data = 'data-' + resolve('last-outer-height');\n var setLastHeight = function (cBody, value) {\n set(cBody, data, value);\n };\n var getLastHeight = function (cBody) {\n return safeParse(cBody, data);\n };\n var getBoundsFrom = function (rect) {\n return {\n top: constant(rect.top()),\n bottom: constant(rect.top() + rect.height())\n };\n };\n var getBounds$1 = function (cWin) {\n var rects = getRectangles(cWin);\n return rects.length > 0 ? Option.some(rects[0]).map(getBoundsFrom) : Option.none();\n };\n var findDelta = function (outerWindow, cBody) {\n var last = getLastHeight(cBody);\n var current = outerWindow.innerHeight;\n return last > current ? Option.some(last - current) : Option.none();\n };\n var calculate = function (cWin, bounds, delta) {\n var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight;\n return isOutside ? Math.min(delta, bounds.bottom() - cWin.innerHeight + EXTRA_SPACING) : 0;\n };\n var setup$1 = function (outerWindow, cWin) {\n var cBody = Element.fromDom(cWin.document.body);\n var toEditing = function () {\n resume(cWin);\n };\n var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () {\n findDelta(outerWindow, cBody).each(function (delta) {\n getBounds$1(cWin).each(function (bounds) {\n var cScrollBy = calculate(cWin, bounds, delta);\n if (cScrollBy !== 0) {\n cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy);\n }\n });\n });\n setLastHeight(cBody, outerWindow.innerHeight);\n });\n setLastHeight(cBody, outerWindow.innerHeight);\n var destroy = function () {\n onResize.unbind();\n };\n return {\n toEditing: toEditing,\n destroy: destroy\n };\n };\n\n var getBodyFromFrame = function (frame) {\n return Option.some(Element.fromDom(frame.dom().contentWindow.document.body));\n };\n var getDocFromFrame = function (frame) {\n return Option.some(Element.fromDom(frame.dom().contentWindow.document));\n };\n var getWinFromFrame = function (frame) {\n return Option.from(frame.dom().contentWindow);\n };\n var getSelectionFromFrame = function (frame) {\n var optWin = getWinFromFrame(frame);\n return optWin.bind(getExact);\n };\n var getFrame = function (editor) {\n return editor.getFrame();\n };\n var getOrDerive = function (name, f) {\n return function (editor) {\n var g = editor[name].getOrThunk(function () {\n var frame = getFrame(editor);\n return function () {\n return f(frame);\n };\n });\n return g();\n };\n };\n var getOrListen = function (editor, doc, name, type) {\n return editor[name].getOrThunk(function () {\n return function (handler) {\n return bind$3(doc, type, handler);\n };\n });\n };\n var toRect$2 = function (rect) {\n return {\n left: constant(rect.left),\n top: constant(rect.top),\n right: constant(rect.right),\n bottom: constant(rect.bottom),\n width: constant(rect.width),\n height: constant(rect.height)\n };\n };\n var getActiveApi = function (editor) {\n var frame = getFrame(editor);\n var tryFallbackBox = function (win) {\n var isCollapsed = function (sel) {\n return eq(sel.start(), sel.finish()) && sel.soffset() === sel.foffset();\n };\n var toStartRect = function (sel) {\n var rect = sel.start().dom().getBoundingClientRect();\n return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect$2) : Option.none();\n };\n return getExact(win).filter(isCollapsed).bind(toStartRect);\n };\n return getBodyFromFrame(frame).bind(function (body) {\n return getDocFromFrame(frame).bind(function (doc) {\n return getWinFromFrame(frame).map(function (win) {\n var html = Element.fromDom(doc.dom().documentElement);\n var getCursorBox = editor.getCursorBox.getOrThunk(function () {\n return function () {\n return get$c(win).bind(function (sel) {\n return getFirstRect$1(win, sel).orThunk(function () {\n return tryFallbackBox(win);\n });\n });\n };\n });\n var setSelection = editor.setSelection.getOrThunk(function () {\n return function (start, soffset, finish, foffset) {\n setExact(win, start, soffset, finish, foffset);\n };\n });\n var clearSelection = editor.clearSelection.getOrThunk(function () {\n return function () {\n clear$1(win);\n };\n });\n return {\n body: constant(body),\n doc: constant(doc),\n win: constant(win),\n html: constant(html),\n getSelection: curry(getSelectionFromFrame, frame),\n setSelection: setSelection,\n clearSelection: clearSelection,\n frame: constant(frame),\n onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'),\n onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'SelectionChange'),\n onDomChanged: editor.onDomChanged,\n onScrollToCursor: editor.onScrollToCursor,\n onScrollToElement: editor.onScrollToElement,\n onToReading: editor.onToReading,\n onToEditing: editor.onToEditing,\n onToolbarScrollStart: editor.onToolbarScrollStart,\n onTouchContent: editor.onTouchContent,\n onTapContent: editor.onTapContent,\n onTouchToolstrip: editor.onTouchToolstrip,\n getCursorBox: getCursorBox\n };\n });\n });\n });\n };\n var getWin$1 = getOrDerive('getWin', getWinFromFrame);\n\n var attr = 'data-ephox-mobile-fullscreen-style';\n var siblingStyles = 'display:none!important;';\n var ancestorPosition = 'position:absolute!important;';\n var ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;';\n var bgFallback = 'background-color:rgb(255,255,255)!important;';\n var isAndroid = detect$3().os.isAndroid();\n var matchColor = function (editorBody) {\n var color = get$4(editorBody, 'background-color');\n return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback;\n };\n var clobberStyles = function (container, editorBody) {\n var gatherSibilings = function (element) {\n return siblings$2(element, '*');\n };\n var clobber = function (clobberStyle) {\n return function (element) {\n var styles = get$1(element, 'style');\n var backup = styles === undefined ? 'no-styles' : styles.trim();\n if (backup === clobberStyle) {\n return;\n } else {\n set(element, attr, backup);\n set(element, 'style', clobberStyle);\n }\n };\n };\n var ancestors = ancestors$1(container, '*');\n var siblings = bind(ancestors, gatherSibilings);\n var bgColor = matchColor(editorBody);\n each$1(siblings, clobber(siblingStyles));\n each$1(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor));\n var containerStyles = isAndroid === true ? '' : ancestorPosition;\n clobber(containerStyles + ancestorStyles + bgColor)(container);\n };\n var restoreStyles = function () {\n var clobberedEls = all$2('[' + attr + ']');\n each$1(clobberedEls, function (element) {\n var restore = get$1(element, attr);\n if (restore !== 'no-styles') {\n set(element, 'style', restore);\n } else {\n remove$1(element, 'style');\n }\n remove$1(element, attr);\n });\n };\n\n var tag = function () {\n var head = first('head').getOrDie();\n var nu = function () {\n var meta = Element.fromTag('meta');\n set(meta, 'name', 'viewport');\n append(head, meta);\n return meta;\n };\n var element = first('meta[name=\"viewport\"]').getOrThunk(nu);\n var backup = get$1(element, 'content');\n var maximize = function () {\n set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0');\n };\n var restore = function () {\n if (backup !== undefined && backup !== null && backup.length > 0) {\n set(element, 'content', backup);\n } else {\n set(element, 'content', 'user-scalable=yes');\n }\n };\n return {\n maximize: maximize,\n restore: restore\n };\n };\n\n var create$4 = function (platform, mask) {\n var meta = tag();\n var androidApi = api$2();\n var androidEvents = api$2();\n var enter = function () {\n mask.hide();\n add$2(platform.container, resolve('fullscreen-maximized'));\n add$2(platform.container, resolve('android-maximized'));\n meta.maximize();\n add$2(platform.body, resolve('android-scroll-reload'));\n androidApi.set(setup$1(platform.win, getWin$1(platform.editor).getOrDie('no')));\n getActiveApi(platform.editor).each(function (editorApi) {\n clobberStyles(platform.container, editorApi.body());\n androidEvents.set(initEvents(editorApi, platform.toolstrip, platform.alloy));\n });\n };\n var exit = function () {\n meta.restore();\n mask.show();\n remove$4(platform.container, resolve('fullscreen-maximized'));\n remove$4(platform.container, resolve('android-maximized'));\n restoreStyles();\n remove$4(platform.body, resolve('android-scroll-reload'));\n androidEvents.clear();\n androidApi.clear();\n };\n return {\n enter: enter,\n exit: exit\n };\n };\n\n var first$1 = function (fn, rate) {\n var timer = null;\n var cancel = function () {\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n timer = null;\n }\n };\n var throttle = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timer === null) {\n timer = domGlobals.setTimeout(function () {\n fn.apply(null, args);\n timer = null;\n }, rate);\n }\n };\n return {\n cancel: cancel,\n throttle: throttle\n };\n };\n var last = function (fn, rate) {\n var timer = null;\n var cancel = function () {\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n timer = null;\n }\n };\n var throttle = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n }\n timer = domGlobals.setTimeout(function () {\n fn.apply(null, args);\n timer = null;\n }, rate);\n };\n return {\n cancel: cancel,\n throttle: throttle\n };\n };\n\n var sketch$9 = function (onView, _translate) {\n var memIcon = record(Container.sketch({\n dom: dom$1('
'),\n containerBehaviours: derive$1([Toggling.config({\n toggleClass: resolve('mask-tap-icon-selected'),\n toggleOnExecute: false\n })])\n }));\n var onViewThrottle = first$1(onView, 200);\n return Container.sketch({\n dom: dom$1('
'),\n components: [Container.sketch({\n dom: dom$1('
'),\n components: [Button.sketch({\n dom: dom$1('
'),\n components: [memIcon.asSpec()],\n action: function (_button) {\n onViewThrottle.throttle();\n },\n buttonBehaviours: derive$1([Toggling.config({ toggleClass: resolve('mask-tap-icon-selected') })])\n })]\n })]\n });\n };\n\n var MobileSchema = objOf([\n strictObjOf('editor', [\n strict$1('getFrame'),\n option('getBody'),\n option('getDoc'),\n option('getWin'),\n option('getSelection'),\n option('setSelection'),\n option('clearSelection'),\n option('cursorSaver'),\n option('onKeyup'),\n option('onNodeChanged'),\n option('getCursorBox'),\n strict$1('onDomChanged'),\n defaulted$1('onTouchContent', noop),\n defaulted$1('onTapContent', noop),\n defaulted$1('onTouchToolstrip', noop),\n defaulted$1('onScrollToCursor', constant({ unbind: noop })),\n defaulted$1('onScrollToElement', constant({ unbind: noop })),\n defaulted$1('onToEditing', constant({ unbind: noop })),\n defaulted$1('onToReading', constant({ unbind: noop })),\n defaulted$1('onToolbarScrollStart', identity)\n ]),\n strict$1('socket'),\n strict$1('toolstrip'),\n strict$1('dropup'),\n strict$1('toolbar'),\n strict$1('container'),\n strict$1('alloy'),\n state$1('win', function (spec) {\n return owner(spec.socket).dom().defaultView;\n }),\n state$1('body', function (spec) {\n return Element.fromDom(spec.socket.dom().ownerDocument.body);\n }),\n defaulted$1('translate', identity),\n defaulted$1('setReadOnly', noop),\n defaulted$1('readOnlyOnInit', constant(true))\n ]);\n\n var produce = function (raw) {\n var mobile = asRawOrDie('Getting AndroidWebapp schema', MobileSchema, raw);\n set$3(mobile.toolstrip, 'width', '100%');\n var onTap = function () {\n mobile.setReadOnly(mobile.readOnlyOnInit());\n mode.enter();\n };\n var mask = build$1(sketch$9(onTap, mobile.translate));\n mobile.alloy.add(mask);\n var maskApi = {\n show: function () {\n mobile.alloy.add(mask);\n },\n hide: function () {\n mobile.alloy.remove(mask);\n }\n };\n append(mobile.container, mask.element());\n var mode = create$4(mobile, maskApi);\n return {\n setReadOnly: mobile.setReadOnly,\n refreshStructure: noop,\n enter: mode.enter,\n exit: mode.exit,\n destroy: noop\n };\n };\n\n var schema$e = constant([\n strict$1('dom'),\n defaulted$1('shell', true),\n field$1('toolbarBehaviours', [Replacing])\n ]);\n var enhanceGroups = function () {\n return { behaviours: derive$1([Replacing.config({})]) };\n };\n var parts$2 = constant([optional({\n name: 'groups',\n overrides: enhanceGroups\n })]);\n\n var factory$4 = function (detail, components, _spec, _externals) {\n var setGroups = function (toolbar, groups) {\n getGroupContainer(toolbar).fold(function () {\n domGlobals.console.error('Toolbar was defined to not be a shell, but no groups container was specified in components');\n throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components');\n }, function (container) {\n Replacing.set(container, groups);\n });\n };\n var getGroupContainer = function (component) {\n return detail.shell ? Option.some(component) : getPart(component, detail, 'groups');\n };\n var extra = detail.shell ? {\n behaviours: [Replacing.config({})],\n components: []\n } : {\n behaviours: [],\n components: components\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: extra.components,\n behaviours: augment(detail.toolbarBehaviours, extra.behaviours),\n apis: { setGroups: setGroups },\n domModification: { attributes: { role: 'group' } }\n };\n };\n var Toolbar = composite$1({\n name: 'Toolbar',\n configFields: schema$e(),\n partFields: parts$2(),\n factory: factory$4,\n apis: {\n setGroups: function (apis, toolbar, groups) {\n apis.setGroups(toolbar, groups);\n }\n }\n });\n\n var schema$f = constant([\n strict$1('items'),\n markers(['itemSelector']),\n field$1('tgroupBehaviours', [Keying])\n ]);\n var parts$3 = constant([group({\n name: 'items',\n unit: 'item'\n })]);\n\n var factory$5 = function (detail, components, _spec, _externals) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.tgroupBehaviours, [Keying.config({\n mode: 'flow',\n selector: detail.markers.itemSelector\n })]),\n domModification: { attributes: { role: 'toolbar' } }\n };\n };\n var ToolbarGroup = composite$1({\n name: 'ToolbarGroup',\n configFields: schema$f(),\n partFields: parts$3(),\n factory: factory$5\n });\n\n var dataHorizontal = 'data-' + resolve('horizontal-scroll');\n var canScrollVertically = function (container) {\n container.dom().scrollTop = 1;\n var result = container.dom().scrollTop !== 0;\n container.dom().scrollTop = 0;\n return result;\n };\n var canScrollHorizontally = function (container) {\n container.dom().scrollLeft = 1;\n var result = container.dom().scrollLeft !== 0;\n container.dom().scrollLeft = 0;\n return result;\n };\n var hasVerticalScroll = function (container) {\n return container.dom().scrollTop > 0 || canScrollVertically(container);\n };\n var hasHorizontalScroll = function (container) {\n return container.dom().scrollLeft > 0 || canScrollHorizontally(container);\n };\n var markAsHorizontal = function (container) {\n set(container, dataHorizontal, 'true');\n };\n var hasScroll = function (container) {\n return get$1(container, dataHorizontal) === 'true' ? hasHorizontalScroll(container) : hasVerticalScroll(container);\n };\n var exclusive = function (scope, selector) {\n return bind$3(scope, 'touchmove', function (event) {\n closest$2(event.target(), selector).filter(hasScroll).fold(function () {\n event.raw().preventDefault();\n }, noop);\n });\n };\n\n function ScrollingToolbar () {\n var makeGroup = function (gSpec) {\n var scrollClass = gSpec.scrollable === true ? '${prefix}-toolbar-scrollable-group' : '';\n return {\n dom: dom$1('
'),\n tgroupBehaviours: derive$1([config('adhoc-scrollable-toolbar', gSpec.scrollable === true ? [runOnInit(function (component, _simulatedEvent) {\n set$3(component.element(), 'overflow-x', 'auto');\n markAsHorizontal(component.element());\n register(component.element());\n })] : [])]),\n components: [Container.sketch({ components: [ToolbarGroup.parts().items({})] })],\n markers: { itemSelector: '.' + resolve('toolbar-group-item') },\n items: gSpec.items\n };\n };\n var toolbar = build$1(Toolbar.sketch({\n dom: dom$1('
'),\n components: [Toolbar.parts().groups({})],\n toolbarBehaviours: derive$1([\n Toggling.config({\n toggleClass: resolve('context-toolbar'),\n toggleOnExecute: false,\n aria: { mode: 'none' }\n }),\n Keying.config({ mode: 'cyclic' })\n ]),\n shell: true\n }));\n var wrapper = build$1(Container.sketch({\n dom: { classes: [resolve('toolstrip')] },\n components: [premade$1(toolbar)],\n containerBehaviours: derive$1([Toggling.config({\n toggleClass: resolve('android-selection-context-toolbar'),\n toggleOnExecute: false\n })])\n }));\n var resetGroups = function () {\n Toolbar.setGroups(toolbar, initGroups.get());\n Toggling.off(toolbar);\n };\n var initGroups = Cell([]);\n var setGroups = function (gs) {\n initGroups.set(gs);\n resetGroups();\n };\n var createGroups = function (gs) {\n return map$1(gs, compose(ToolbarGroup.sketch, makeGroup));\n };\n var refresh = function () {\n };\n var setContextToolbar = function (gs) {\n Toggling.on(toolbar);\n Toolbar.setGroups(toolbar, gs);\n };\n var restoreToolbar = function () {\n if (Toggling.isOn(toolbar)) {\n resetGroups();\n }\n };\n var focus = function () {\n Keying.focusIn(toolbar);\n };\n return {\n wrapper: constant(wrapper),\n toolbar: constant(toolbar),\n createGroups: createGroups,\n setGroups: setGroups,\n setContextToolbar: setContextToolbar,\n restoreToolbar: restoreToolbar,\n refresh: refresh,\n focus: focus\n };\n }\n\n var makeEditSwitch = function (webapp) {\n return build$1(Button.sketch({\n dom: dom$1('
'),\n action: function () {\n webapp.run(function (w) {\n w.setReadOnly(false);\n });\n }\n }));\n };\n var makeSocket = function () {\n return build$1(Container.sketch({\n dom: dom$1('
'),\n components: [],\n containerBehaviours: derive$1([Replacing.config({})])\n }));\n };\n var showEdit = function (socket, switchToEdit) {\n Replacing.append(socket, premade$1(switchToEdit));\n };\n var hideEdit = function (socket, switchToEdit) {\n Replacing.remove(socket, switchToEdit);\n };\n var updateMode = function (socket, switchToEdit, readOnly, root) {\n var swap = readOnly === true ? Swapping.toAlpha : Swapping.toOmega;\n swap(root);\n var f = readOnly ? showEdit : hideEdit;\n f(socket, switchToEdit);\n };\n\n var getAnimationRoot = function (component, slideConfig) {\n return slideConfig.getAnimationRoot.fold(function () {\n return component.element();\n }, function (get) {\n return get(component);\n });\n };\n\n var getDimensionProperty = function (slideConfig) {\n return slideConfig.dimension.property;\n };\n var getDimension = function (slideConfig, elem) {\n return slideConfig.dimension.getDimension(elem);\n };\n var disableTransitions = function (component, slideConfig) {\n var root = getAnimationRoot(component, slideConfig);\n remove$6(root, [\n slideConfig.shrinkingClass,\n slideConfig.growingClass\n ]);\n };\n var setShrunk = function (component, slideConfig) {\n remove$4(component.element(), slideConfig.openClass);\n add$2(component.element(), slideConfig.closedClass);\n set$3(component.element(), getDimensionProperty(slideConfig), '0px');\n reflow(component.element());\n };\n var setGrown = function (component, slideConfig) {\n remove$4(component.element(), slideConfig.closedClass);\n add$2(component.element(), slideConfig.openClass);\n remove$5(component.element(), getDimensionProperty(slideConfig));\n };\n var doImmediateShrink = function (component, slideConfig, slideState, _calculatedSize) {\n slideState.setCollapsed();\n set$3(component.element(), getDimensionProperty(slideConfig), getDimension(slideConfig, component.element()));\n reflow(component.element());\n disableTransitions(component, slideConfig);\n setShrunk(component, slideConfig);\n slideConfig.onStartShrink(component);\n slideConfig.onShrunk(component);\n };\n var doStartShrink = function (component, slideConfig, slideState, calculatedSize) {\n var size = calculatedSize.getOrThunk(function () {\n return getDimension(slideConfig, component.element());\n });\n slideState.setCollapsed();\n set$3(component.element(), getDimensionProperty(slideConfig), size);\n reflow(component.element());\n var root = getAnimationRoot(component, slideConfig);\n remove$4(root, slideConfig.growingClass);\n add$2(root, slideConfig.shrinkingClass);\n setShrunk(component, slideConfig);\n slideConfig.onStartShrink(component);\n };\n var doStartSmartShrink = function (component, slideConfig, slideState) {\n var size = getDimension(slideConfig, component.element());\n var shrinker = size === '0px' ? doImmediateShrink : doStartShrink;\n shrinker(component, slideConfig, slideState, Option.some(size));\n };\n var doStartGrow = function (component, slideConfig, slideState) {\n var root = getAnimationRoot(component, slideConfig);\n var wasShrinking = has$2(root, slideConfig.shrinkingClass);\n var beforeSize = getDimension(slideConfig, component.element());\n setGrown(component, slideConfig);\n var fullSize = getDimension(slideConfig, component.element());\n var startPartialGrow = function () {\n set$3(component.element(), getDimensionProperty(slideConfig), beforeSize);\n reflow(component.element());\n };\n var startCompleteGrow = function () {\n setShrunk(component, slideConfig);\n };\n var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow;\n setStartSize();\n remove$4(root, slideConfig.shrinkingClass);\n add$2(root, slideConfig.growingClass);\n setGrown(component, slideConfig);\n set$3(component.element(), getDimensionProperty(slideConfig), fullSize);\n slideState.setExpanded();\n slideConfig.onStartGrow(component);\n };\n var refresh = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n remove$5(component.element(), getDimensionProperty(slideConfig));\n var fullSize = getDimension(slideConfig, component.element());\n set$3(component.element(), getDimensionProperty(slideConfig), fullSize);\n }\n };\n var grow = function (component, slideConfig, slideState) {\n if (!slideState.isExpanded()) {\n doStartGrow(component, slideConfig, slideState);\n }\n };\n var shrink = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n doStartSmartShrink(component, slideConfig, slideState);\n }\n };\n var immediateShrink = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n doImmediateShrink(component, slideConfig, slideState, Option.none());\n }\n };\n var hasGrown = function (component, slideConfig, slideState) {\n return slideState.isExpanded();\n };\n var hasShrunk = function (component, slideConfig, slideState) {\n return slideState.isCollapsed();\n };\n var isGrowing = function (component, slideConfig, _slideState) {\n var root = getAnimationRoot(component, slideConfig);\n return has$2(root, slideConfig.growingClass) === true;\n };\n var isShrinking = function (component, slideConfig, _slideState) {\n var root = getAnimationRoot(component, slideConfig);\n return has$2(root, slideConfig.shrinkingClass) === true;\n };\n var isTransitioning = function (component, slideConfig, slideState) {\n return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true;\n };\n var toggleGrow = function (component, slideConfig, slideState) {\n var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow;\n f(component, slideConfig, slideState);\n };\n\n var SlidingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n refresh: refresh,\n grow: grow,\n shrink: shrink,\n immediateShrink: immediateShrink,\n hasGrown: hasGrown,\n hasShrunk: hasShrunk,\n isGrowing: isGrowing,\n isShrinking: isShrinking,\n isTransitioning: isTransitioning,\n toggleGrow: toggleGrow,\n disableTransitions: disableTransitions\n });\n\n var exhibit$5 = function (base, slideConfig, _slideState) {\n var expanded = slideConfig.expanded;\n return expanded ? nu$5({\n classes: [slideConfig.openClass],\n styles: {}\n }) : nu$5({\n classes: [slideConfig.closedClass],\n styles: wrap$1(slideConfig.dimension.property, '0px')\n });\n };\n var events$a = function (slideConfig, slideState) {\n return derive([runOnSource(transitionend(), function (component, simulatedEvent) {\n var raw = simulatedEvent.event().raw();\n if (raw.propertyName === slideConfig.dimension.property) {\n disableTransitions(component, slideConfig);\n if (slideState.isExpanded()) {\n remove$5(component.element(), slideConfig.dimension.property);\n }\n var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk;\n notify(component);\n }\n })]);\n };\n\n var ActiveSliding = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$5,\n events: events$a\n });\n\n var SlidingSchema = [\n strict$1('closedClass'),\n strict$1('openClass'),\n strict$1('shrinkingClass'),\n strict$1('growingClass'),\n option('getAnimationRoot'),\n onHandler('onShrunk'),\n onHandler('onStartShrink'),\n onHandler('onGrown'),\n onHandler('onStartGrow'),\n defaulted$1('expanded', false),\n strictOf('dimension', choose$1('property', {\n width: [\n output('property', 'width'),\n output('getDimension', function (elem) {\n return get$7(elem) + 'px';\n })\n ],\n height: [\n output('property', 'height'),\n output('getDimension', function (elem) {\n return get$5(elem) + 'px';\n })\n ]\n }))\n ];\n\n var init$4 = function (spec) {\n var state = Cell(spec.expanded);\n var readState = function () {\n return 'expanded: ' + state.get();\n };\n return nu$6({\n isExpanded: function () {\n return state.get() === true;\n },\n isCollapsed: function () {\n return state.get() === false;\n },\n setCollapsed: curry(state.set, false),\n setExpanded: curry(state.set, true),\n readState: readState\n });\n };\n\n var SlidingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$4\n });\n\n var Sliding = create$1({\n fields: SlidingSchema,\n name: 'sliding',\n active: ActiveSliding,\n apis: SlidingApis,\n state: SlidingState\n });\n\n var build$2 = function (refresh, scrollIntoView) {\n var dropup = build$1(Container.sketch({\n dom: {\n tag: 'div',\n classes: [resolve('dropup')]\n },\n components: [],\n containerBehaviours: derive$1([\n Replacing.config({}),\n Sliding.config({\n closedClass: resolve('dropup-closed'),\n openClass: resolve('dropup-open'),\n shrinkingClass: resolve('dropup-shrinking'),\n growingClass: resolve('dropup-growing'),\n dimension: { property: 'height' },\n onShrunk: function (component) {\n refresh();\n scrollIntoView();\n Replacing.set(component, []);\n },\n onGrown: function (_component) {\n refresh();\n scrollIntoView();\n }\n }),\n orientation(function (_component, _data) {\n disappear(noop);\n })\n ])\n }));\n var appear = function (menu, update, component) {\n if (Sliding.hasShrunk(dropup) === true && Sliding.isTransitioning(dropup) === false) {\n domGlobals.window.requestAnimationFrame(function () {\n update(component);\n Replacing.set(dropup, [menu()]);\n Sliding.grow(dropup);\n });\n }\n };\n var disappear = function (onReadyToShrink) {\n domGlobals.window.requestAnimationFrame(function () {\n onReadyToShrink();\n Sliding.shrink(dropup);\n });\n };\n return {\n appear: appear,\n disappear: disappear,\n component: constant(dropup),\n element: dropup.element\n };\n };\n\n var closest$3 = function (scope, selector, isRoot) {\n return closest$2(scope, selector, isRoot).isSome();\n };\n\n var isDangerous = function (event) {\n var keyEv = event.raw();\n return keyEv.which === BACKSPACE()[0] && !contains([\n 'input',\n 'textarea'\n ], name(event.target())) && !closest$3(event.target(), '[contenteditable=\"true\"]');\n };\n var isFirefox = function () {\n return detect$3().browser.isFirefox();\n };\n var settingsSchema = objOfOnly([\n strictFunction('triggerEvent'),\n defaulted$1('stopBackspace', true)\n ]);\n var bindFocus = function (container, handler) {\n if (isFirefox()) {\n return capture$1(container, 'focus', handler);\n } else {\n return bind$3(container, 'focusin', handler);\n }\n };\n var bindBlur = function (container, handler) {\n if (isFirefox()) {\n return capture$1(container, 'blur', handler);\n } else {\n return bind$3(container, 'focusout', handler);\n }\n };\n var setup$2 = function (container, rawSettings) {\n var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings);\n var pointerEvents = [\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n 'gesturestart',\n 'mousedown',\n 'mouseup',\n 'mouseover',\n 'mousemove',\n 'mouseout',\n 'click'\n ];\n var tapEvent = monitor(settings);\n var simpleEvents = map$1(pointerEvents.concat([\n 'selectstart',\n 'input',\n 'contextmenu',\n 'change',\n 'transitionend',\n 'drag',\n 'dragstart',\n 'dragend',\n 'dragenter',\n 'dragleave',\n 'dragover',\n 'drop',\n 'keyup'\n ]), function (type) {\n return bind$3(container, type, function (event) {\n tapEvent.fireIfReady(event, type).each(function (tapStopped) {\n if (tapStopped) {\n event.kill();\n }\n });\n var stopped = settings.triggerEvent(type, event);\n if (stopped) {\n event.kill();\n }\n });\n });\n var pasteTimeout = Cell(Option.none());\n var onPaste = bind$3(container, 'paste', function (event) {\n tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) {\n if (tapStopped) {\n event.kill();\n }\n });\n var stopped = settings.triggerEvent('paste', event);\n if (stopped) {\n event.kill();\n }\n pasteTimeout.set(Option.some(domGlobals.setTimeout(function () {\n settings.triggerEvent(postPaste(), event);\n }, 0)));\n });\n var onKeydown = bind$3(container, 'keydown', function (event) {\n var stopped = settings.triggerEvent('keydown', event);\n if (stopped) {\n event.kill();\n } else if (settings.stopBackspace === true && isDangerous(event)) {\n event.prevent();\n }\n });\n var onFocusIn = bindFocus(container, function (event) {\n var stopped = settings.triggerEvent('focusin', event);\n if (stopped) {\n event.kill();\n }\n });\n var focusoutTimeout = Cell(Option.none());\n var onFocusOut = bindBlur(container, function (event) {\n var stopped = settings.triggerEvent('focusout', event);\n if (stopped) {\n event.kill();\n }\n focusoutTimeout.set(Option.some(domGlobals.setTimeout(function () {\n settings.triggerEvent(postBlur(), event);\n }, 0)));\n });\n var unbind = function () {\n each$1(simpleEvents, function (e) {\n e.unbind();\n });\n onKeydown.unbind();\n onFocusIn.unbind();\n onFocusOut.unbind();\n onPaste.unbind();\n pasteTimeout.get().each(domGlobals.clearTimeout);\n focusoutTimeout.get().each(domGlobals.clearTimeout);\n };\n return { unbind: unbind };\n };\n\n var derive$2 = function (rawEvent, rawTarget) {\n var source = get(rawEvent, 'target').map(function (getTarget) {\n return getTarget();\n }).getOr(rawTarget);\n return Cell(source);\n };\n\n var fromSource = function (event, source) {\n var stopper = Cell(false);\n var cutter = Cell(false);\n var stop = function () {\n stopper.set(true);\n };\n var cut = function () {\n cutter.set(true);\n };\n return {\n stop: stop,\n cut: cut,\n isStopped: stopper.get,\n isCut: cutter.get,\n event: constant(event),\n setSource: source.set,\n getSource: source.get\n };\n };\n var fromExternal = function (event) {\n var stopper = Cell(false);\n var stop = function () {\n stopper.set(true);\n };\n return {\n stop: stop,\n cut: noop,\n isStopped: stopper.get,\n isCut: constant(false),\n event: constant(event),\n setSource: die('Cannot set source of a broadcasted event'),\n getSource: die('Cannot get source of a broadcasted event')\n };\n };\n\n var adt$7 = Adt.generate([\n { stopped: [] },\n { resume: ['element'] },\n { complete: [] }\n ]);\n var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) {\n var handler = lookup(eventType, target);\n var simulatedEvent = fromSource(rawEvent, source);\n return handler.fold(function () {\n logger.logEventNoHandlers(eventType, target);\n return adt$7.complete();\n }, function (handlerInfo) {\n var descHandler = handlerInfo.descHandler;\n var eventHandler = getCurried(descHandler);\n eventHandler(simulatedEvent);\n if (simulatedEvent.isStopped()) {\n logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose());\n return adt$7.stopped();\n } else if (simulatedEvent.isCut()) {\n logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose());\n return adt$7.complete();\n } else {\n return parent(handlerInfo.element).fold(function () {\n logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose());\n return adt$7.complete();\n }, function (parent) {\n logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose());\n return adt$7.resume(parent);\n });\n }\n });\n };\n var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) {\n return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () {\n return true;\n }, function (parent) {\n return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger);\n }, function () {\n return false;\n });\n };\n var triggerHandler = function (lookup, eventType, rawEvent, target, logger) {\n var source = derive$2(rawEvent, target);\n return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger);\n };\n var broadcast = function (listeners, rawEvent, _logger) {\n var simulatedEvent = fromExternal(rawEvent);\n each$1(listeners, function (listener) {\n var descHandler = listener.descHandler();\n var handler = getCurried(descHandler);\n handler(simulatedEvent);\n });\n return simulatedEvent.isStopped();\n };\n var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) {\n var rawTarget = rawEvent.target();\n return triggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, logger);\n };\n var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) {\n var source = derive$2(rawEvent, rawTarget);\n return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger);\n };\n\n var eventHandler = function (element, descHandler) {\n return {\n element: element,\n descHandler: descHandler\n };\n };\n var broadcastHandler = function (id, handler) {\n return {\n id: constant(id),\n descHandler: constant(handler)\n };\n };\n function EventRegistry () {\n var registry = {};\n var registerId = function (extraArgs, id, events) {\n each(events, function (v, k) {\n var handlers = registry[k] !== undefined ? registry[k] : {};\n handlers[id] = curryArgs(v, extraArgs);\n registry[k] = handlers;\n });\n };\n var findHandler = function (handlers, elem) {\n return read$2(elem).fold(function () {\n return Option.none();\n }, function (id) {\n return handlers.bind(function (h) {\n return get(h, id);\n }).map(function (descHandler) {\n return eventHandler(elem, descHandler);\n });\n });\n };\n var filterByType = function (type) {\n return get(registry, type).map(function (handlers) {\n return mapToArray(handlers, function (f, id) {\n return broadcastHandler(id, f);\n });\n }).getOr([]);\n };\n var find = function (isAboveRoot, type, target) {\n var handlers = get(registry, type);\n return closest(target, function (elem) {\n return findHandler(handlers, elem);\n }, isAboveRoot);\n };\n var unregisterId = function (id) {\n each(registry, function (handlersById, _eventName) {\n if (handlersById.hasOwnProperty(id)) {\n delete handlersById[id];\n }\n });\n };\n return {\n registerId: registerId,\n unregisterId: unregisterId,\n filterByType: filterByType,\n find: find\n };\n }\n\n function Registry () {\n var events = EventRegistry();\n var components = {};\n var readOrTag = function (component) {\n var elem = component.element();\n return read$2(elem).fold(function () {\n return write('uid-', component.element());\n }, function (uid) {\n return uid;\n });\n };\n var failOnDuplicate = function (component, tagId) {\n var conflict = components[tagId];\n if (conflict === component) {\n unregister(component);\n } else {\n throw new Error('The tagId \"' + tagId + '\" is already used by: ' + element(conflict.element()) + '\\nCannot use it for: ' + element(component.element()) + '\\n' + 'The conflicting element is' + (inBody(conflict.element()) ? ' ' : ' not ') + 'already in the DOM');\n }\n };\n var register = function (component) {\n var tagId = readOrTag(component);\n if (hasNonNullableKey(components, tagId)) {\n failOnDuplicate(component, tagId);\n }\n var extraArgs = [component];\n events.registerId(extraArgs, tagId, component.events());\n components[tagId] = component;\n };\n var unregister = function (component) {\n read$2(component.element()).each(function (tagId) {\n delete components[tagId];\n events.unregisterId(tagId);\n });\n };\n var filter = function (type) {\n return events.filterByType(type);\n };\n var find = function (isAboveRoot, type, target) {\n return events.find(isAboveRoot, type, target);\n };\n var getById = function (id) {\n return get(components, id);\n };\n return {\n find: find,\n filter: filter,\n register: register,\n unregister: unregister,\n getById: getById\n };\n }\n\n var takeover = function (root) {\n var isAboveRoot = function (el) {\n return parent(root.element()).fold(function () {\n return true;\n }, function (parent) {\n return eq(el, parent);\n });\n };\n var registry = Registry();\n var lookup = function (eventName, target) {\n return registry.find(isAboveRoot, eventName, target);\n };\n var domEvents = setup$2(root.element(), {\n triggerEvent: function (eventName, event) {\n return monitorEvent(eventName, event.target(), function (logger) {\n return triggerUntilStopped(lookup, eventName, event, logger);\n });\n }\n });\n var systemApi = {\n debugInfo: constant('real'),\n triggerEvent: function (eventName, target, data) {\n monitorEvent(eventName, target, function (logger) {\n return triggerOnUntilStopped(lookup, eventName, data, target, logger);\n });\n },\n triggerFocus: function (target, originator) {\n read$2(target).fold(function () {\n focus$1(target);\n }, function (_alloyId) {\n monitorEvent(focus(), target, function (logger) {\n triggerHandler(lookup, focus(), {\n originator: constant(originator),\n kill: noop,\n prevent: noop,\n target: constant(target)\n }, target, logger);\n return false;\n });\n });\n },\n triggerEscape: function (comp, simulatedEvent) {\n systemApi.triggerEvent('keydown', comp.element(), simulatedEvent.event());\n },\n getByUid: function (uid) {\n return getByUid(uid);\n },\n getByDom: function (elem) {\n return getByDom(elem);\n },\n build: build$1,\n addToGui: function (c) {\n add(c);\n },\n removeFromGui: function (c) {\n remove$1(c);\n },\n addToWorld: function (c) {\n addToWorld(c);\n },\n removeFromWorld: function (c) {\n removeFromWorld(c);\n },\n broadcast: function (message) {\n broadcast$1(message);\n },\n broadcastOn: function (channels, message) {\n broadcastOn(channels, message);\n },\n broadcastEvent: function (eventName, event) {\n broadcastEvent(eventName, event);\n },\n isConnected: constant(true)\n };\n var addToWorld = function (component) {\n component.connect(systemApi);\n if (!isText(component.element())) {\n registry.register(component);\n each$1(component.components(), addToWorld);\n systemApi.triggerEvent(systemInit(), component.element(), { target: constant(component.element()) });\n }\n };\n var removeFromWorld = function (component) {\n if (!isText(component.element())) {\n each$1(component.components(), removeFromWorld);\n registry.unregister(component);\n }\n component.disconnect();\n };\n var add = function (component) {\n attach$1(root, component);\n };\n var remove$1 = function (component) {\n detach(component);\n };\n var destroy = function () {\n domEvents.unbind();\n remove(root.element());\n };\n var broadcastData = function (data) {\n var receivers = registry.filter(receive());\n each$1(receivers, function (receiver) {\n var descHandler = receiver.descHandler();\n var handler = getCurried(descHandler);\n handler(data);\n });\n };\n var broadcast$1 = function (message) {\n broadcastData({\n universal: constant(true),\n data: constant(message)\n });\n };\n var broadcastOn = function (channels, message) {\n broadcastData({\n universal: constant(false),\n channels: constant(channels),\n data: constant(message)\n });\n };\n var broadcastEvent = function (eventName, event) {\n var listeners = registry.filter(eventName);\n return broadcast(listeners, event);\n };\n var getByUid = function (uid) {\n return registry.getById(uid).fold(function () {\n return Result.error(new Error('Could not find component with uid: \"' + uid + '\" in system.'));\n }, Result.value);\n };\n var getByDom = function (elem) {\n var uid = read$2(elem).getOr('not found');\n return getByUid(uid);\n };\n addToWorld(root);\n return {\n root: constant(root),\n element: root.element,\n destroy: destroy,\n add: add,\n remove: remove$1,\n getByUid: getByUid,\n getByDom: getByDom,\n addToWorld: addToWorld,\n removeFromWorld: removeFromWorld,\n broadcast: broadcast$1,\n broadcastOn: broadcastOn,\n broadcastEvent: broadcastEvent\n };\n };\n\n var READ_ONLY_MODE_CLASS = resolve('readonly-mode');\n var EDIT_MODE_CLASS = resolve('edit-mode');\n function OuterContainer (spec) {\n var root = build$1(Container.sketch({\n dom: { classes: [resolve('outer-container')].concat(spec.classes) },\n containerBehaviours: derive$1([Swapping.config({\n alpha: READ_ONLY_MODE_CLASS,\n omega: EDIT_MODE_CLASS\n })])\n }));\n return takeover(root);\n }\n\n function AndroidRealm (scrollIntoView) {\n var alloy = OuterContainer({ classes: [resolve('android-container')] });\n var toolbar = ScrollingToolbar();\n var webapp = api$2();\n var switchToEdit = makeEditSwitch(webapp);\n var socket = makeSocket();\n var dropup = build$2(noop, scrollIntoView);\n alloy.add(toolbar.wrapper());\n alloy.add(socket);\n alloy.add(dropup.component());\n var setToolbarGroups = function (rawGroups) {\n var groups = toolbar.createGroups(rawGroups);\n toolbar.setGroups(groups);\n };\n var setContextToolbar = function (rawGroups) {\n var groups = toolbar.createGroups(rawGroups);\n toolbar.setContextToolbar(groups);\n };\n var focusToolbar = function () {\n toolbar.focus();\n };\n var restoreToolbar = function () {\n toolbar.restoreToolbar();\n };\n var init = function (spec) {\n webapp.set(produce(spec));\n };\n var exit = function () {\n webapp.run(function (w) {\n w.exit();\n Replacing.remove(socket, switchToEdit);\n });\n };\n var updateMode$1 = function (readOnly) {\n updateMode(socket, switchToEdit, readOnly, alloy.root());\n };\n return {\n system: constant(alloy),\n element: alloy.element,\n init: init,\n exit: exit,\n setToolbarGroups: setToolbarGroups,\n setContextToolbar: setContextToolbar,\n focusToolbar: focusToolbar,\n restoreToolbar: restoreToolbar,\n updateMode: updateMode$1,\n socket: constant(socket),\n dropup: constant(dropup)\n };\n }\n\n var input$1 = function (parent, operation) {\n var input = Element.fromTag('input');\n setAll$1(input, {\n opacity: '0',\n position: 'absolute',\n top: '-1000px',\n left: '-1000px'\n });\n append(parent, input);\n focus$1(input);\n operation(input);\n remove(input);\n };\n\n var refresh$1 = function (winScope) {\n var sel = winScope.getSelection();\n if (sel.rangeCount > 0) {\n var br = sel.getRangeAt(0);\n var r = winScope.document.createRange();\n r.setStart(br.startContainer, br.startOffset);\n r.setEnd(br.endContainer, br.endOffset);\n sel.removeAllRanges();\n sel.addRange(r);\n }\n };\n\n var resume$1 = function (cWin, frame) {\n active().each(function (active) {\n if (!eq(active, frame)) {\n blur(active);\n }\n });\n cWin.focus();\n focus$1(Element.fromDom(cWin.document.body));\n refresh$1(cWin);\n };\n\n var stubborn = function (outerBody, cWin, page, frame) {\n var toEditing = function () {\n resume$1(cWin, frame);\n };\n var toReading = function () {\n input$1(outerBody, blur);\n };\n var captureInput = bind$3(page, 'keydown', function (evt) {\n if (!contains([\n 'input',\n 'textarea'\n ], name(evt.target()))) {\n toEditing();\n }\n });\n var onToolbarTouch = function () {\n };\n var destroy = function () {\n captureInput.unbind();\n };\n return {\n toReading: toReading,\n toEditing: toEditing,\n onToolbarTouch: onToolbarTouch,\n destroy: destroy\n };\n };\n\n var initEvents$1 = function (editorApi, iosApi, toolstrip, socket, _dropup) {\n var saveSelectionFirst = function () {\n iosApi.run(function (api) {\n api.highlightSelection();\n });\n };\n var refreshIosSelection = function () {\n iosApi.run(function (api) {\n api.refreshSelection();\n });\n };\n var scrollToY = function (yTop, height) {\n var y = yTop - socket.dom().scrollTop;\n iosApi.run(function (api) {\n api.scrollIntoView(y, y + height);\n });\n };\n var scrollToElement = function (_target) {\n scrollToY(iosApi, socket);\n };\n var scrollToCursor = function () {\n editorApi.getCursorBox().each(function (box) {\n scrollToY(box.top(), box.height());\n });\n };\n var clearSelection = function () {\n iosApi.run(function (api) {\n api.clearSelection();\n });\n };\n var clearAndRefresh = function () {\n clearSelection();\n refreshThrottle.throttle();\n };\n var refreshView = function () {\n scrollToCursor();\n iosApi.run(function (api) {\n api.syncHeight();\n });\n };\n var reposition = function () {\n var toolbarHeight = get$5(toolstrip);\n iosApi.run(function (api) {\n api.setViewportOffset(toolbarHeight);\n });\n refreshIosSelection();\n refreshView();\n };\n var toEditing = function () {\n iosApi.run(function (api) {\n api.toEditing();\n });\n };\n var toReading = function () {\n iosApi.run(function (api) {\n api.toReading();\n });\n };\n var onToolbarTouch = function (event) {\n iosApi.run(function (api) {\n api.onToolbarTouch(event);\n });\n };\n var tapping = monitor$1(editorApi);\n var refreshThrottle = last(refreshView, 300);\n var listeners = [\n editorApi.onKeyup(clearAndRefresh),\n editorApi.onNodeChanged(refreshIosSelection),\n editorApi.onDomChanged(refreshThrottle.throttle),\n editorApi.onDomChanged(refreshIosSelection),\n editorApi.onScrollToCursor(function (tinyEvent) {\n tinyEvent.preventDefault();\n refreshThrottle.throttle();\n }),\n editorApi.onScrollToElement(function (event) {\n scrollToElement(event.element());\n }),\n editorApi.onToEditing(toEditing),\n editorApi.onToReading(toReading),\n bind$3(editorApi.doc(), 'touchend', function (touchEvent) {\n if (eq(editorApi.html(), touchEvent.target()) || eq(editorApi.body(), touchEvent.target())) ;\n }),\n bind$3(toolstrip, 'transitionend', function (transitionEvent) {\n if (transitionEvent.raw().propertyName === 'height') {\n reposition();\n }\n }),\n capture$1(toolstrip, 'touchstart', function (touchEvent) {\n saveSelectionFirst();\n onToolbarTouch(touchEvent);\n editorApi.onTouchToolstrip();\n }),\n bind$3(editorApi.body(), 'touchstart', function (evt) {\n clearSelection();\n editorApi.onTouchContent();\n tapping.fireTouchstart(evt);\n }),\n tapping.onTouchmove(),\n tapping.onTouchend(),\n bind$3(editorApi.body(), 'click', function (event) {\n event.kill();\n }),\n bind$3(toolstrip, 'touchmove', function () {\n editorApi.onToolbarScrollStart();\n })\n ];\n var destroy = function () {\n each$1(listeners, function (l) {\n l.unbind();\n });\n };\n return { destroy: destroy };\n };\n\n function FakeSelection (win, frame) {\n var doc = win.document;\n var container = Element.fromTag('div');\n add$2(container, resolve('unfocused-selections'));\n append(Element.fromDom(doc.documentElement), container);\n var onTouch = bind$3(container, 'touchstart', function (event) {\n event.prevent();\n resume$1(win, frame);\n clear();\n });\n var make = function (rectangle) {\n var span = Element.fromTag('span');\n add$3(span, [\n resolve('layer-editor'),\n resolve('unfocused-selection')\n ]);\n setAll$1(span, {\n left: rectangle.left() + 'px',\n top: rectangle.top() + 'px',\n width: rectangle.width() + 'px',\n height: rectangle.height() + 'px'\n });\n return span;\n };\n var update = function () {\n clear();\n var rectangles = getRectangles(win);\n var spans = map$1(rectangles, make);\n append$1(container, spans);\n };\n var clear = function () {\n empty(container);\n };\n var destroy = function () {\n onTouch.unbind();\n remove(container);\n };\n var isActive = function () {\n return children(container).length > 0;\n };\n return {\n update: update,\n isActive: isActive,\n destroy: destroy,\n clear: clear\n };\n }\n\n var exports$1 = {}, module = { exports: exports$1 };\n (function (define, exports, module, require) {\n (function (f) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n module.exports = f();\n } else if (typeof define === 'function' && define.amd) {\n define([], f);\n } else {\n var g;\n if (typeof window !== 'undefined') {\n g = window;\n } else if (typeof global !== 'undefined') {\n g = global;\n } else if (typeof self !== 'undefined') {\n g = self;\n } else {\n g = this;\n }\n g.EphoxContactWrapper = f();\n }\n }(function () {\n return function () {\n function r(e, n, t) {\n function o(i, f) {\n if (!n[i]) {\n if (!e[i]) {\n var c = 'function' == typeof require && require;\n if (!f && c)\n return c(i, !0);\n if (u)\n return u(i, !0);\n var a = new Error('Cannot find module \\'' + i + '\\'');\n throw a.code = 'MODULE_NOT_FOUND', a;\n }\n var p = n[i] = { exports: {} };\n e[i][0].call(p.exports, function (r) {\n var n = e[i][1][r];\n return o(n || r);\n }, p, p.exports, r, e, n, t);\n }\n return n[i].exports;\n }\n for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)\n o(t[i]);\n return o;\n }\n return r;\n }()({\n 1: [\n function (require, module, exports) {\n var process = module.exports = {};\n var cachedSetTimeout;\n var cachedClearTimeout;\n function defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n }\n function defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n }\n (function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n }());\n function runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n return setTimeout(fun, 0);\n }\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n }\n function runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n return clearTimeout(marker);\n }\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n return cachedClearTimeout.call(this, marker);\n }\n }\n }\n var queue = [];\n var draining = false;\n var currentQueue;\n var queueIndex = -1;\n function cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n }\n function drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n while (len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n }\n process.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n };\n function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }\n Item.prototype.run = function () {\n this.fun.apply(null, this.array);\n };\n process.title = 'browser';\n process.browser = true;\n process.env = {};\n process.argv = [];\n process.version = '';\n process.versions = {};\n function noop() {\n }\n process.on = noop;\n process.addListener = noop;\n process.once = noop;\n process.off = noop;\n process.removeListener = noop;\n process.removeAllListeners = noop;\n process.emit = noop;\n process.prependListener = noop;\n process.prependOnceListener = noop;\n process.listeners = function (name) {\n return [];\n };\n process.binding = function (name) {\n throw new Error('process.binding is not supported');\n };\n process.cwd = function () {\n return '/';\n };\n process.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n };\n process.umask = function () {\n return 0;\n };\n },\n {}\n ],\n 2: [\n function (require, module, exports) {\n (function (setImmediate) {\n (function (root) {\n var setTimeoutFunc = setTimeout;\n function noop() {\n }\n function bind(fn, thisArg) {\n return function () {\n fn.apply(thisArg, arguments);\n };\n }\n function Promise(fn) {\n if (typeof this !== 'object')\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function')\n throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n doResolve(fn, this);\n }\n function handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function () {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n }\n function resolve(self, newValue) {\n try {\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n }\n function reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n }\n function finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function () {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n }\n function Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n }\n function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done)\n return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done)\n return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done)\n return;\n done = true;\n reject(self, ex);\n }\n }\n Promise.prototype['catch'] = function (onRejected) {\n return this.then(null, onRejected);\n };\n Promise.prototype.then = function (onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n };\n Promise.all = function (arr) {\n var args = Array.prototype.slice.call(arr);\n return new Promise(function (resolve, reject) {\n if (args.length === 0)\n return resolve([]);\n var remaining = args.length;\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n };\n Promise.resolve = function (value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n return new Promise(function (resolve) {\n resolve(value);\n });\n };\n Promise.reject = function (value) {\n return new Promise(function (resolve, reject) {\n reject(value);\n });\n };\n Promise.race = function (values) {\n return new Promise(function (resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n };\n Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {\n setImmediate(fn);\n } : function (fn) {\n setTimeoutFunc(fn, 0);\n };\n Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err);\n }\n };\n Promise._setImmediateFn = function _setImmediateFn(fn) {\n Promise._immediateFn = fn;\n };\n Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {\n Promise._unhandledRejectionFn = fn;\n };\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Promise;\n } else if (!root.Promise) {\n root.Promise = Promise;\n }\n }(this));\n }.call(this, require('timers').setImmediate));\n },\n { 'timers': 3 }\n ],\n 3: [\n function (require, module, exports) {\n (function (setImmediate, clearImmediate) {\n var nextTick = require('process/browser.js').nextTick;\n var apply = Function.prototype.apply;\n var slice = Array.prototype.slice;\n var immediateIds = {};\n var nextImmediateId = 0;\n exports.setTimeout = function () {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n };\n exports.setInterval = function () {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n };\n exports.clearTimeout = exports.clearInterval = function (timeout) {\n timeout.close();\n };\n function Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n }\n Timeout.prototype.unref = Timeout.prototype.ref = function () {\n };\n Timeout.prototype.close = function () {\n this._clearFn.call(window, this._id);\n };\n exports.enroll = function (item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n };\n exports.unenroll = function (item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n };\n exports._unrefActive = exports.active = function (item) {\n clearTimeout(item._idleTimeoutId);\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n };\n exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n immediateIds[id] = true;\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n exports.clearImmediate(id);\n }\n });\n return id;\n };\n exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {\n delete immediateIds[id];\n };\n }.call(this, require('timers').setImmediate, require('timers').clearImmediate));\n },\n {\n 'process/browser.js': 1,\n 'timers': 3\n }\n ],\n 4: [\n function (require, module, exports) {\n var promisePolyfill = require('promise-polyfill');\n var Global = function () {\n if (typeof window !== 'undefined') {\n return window;\n } else {\n return Function('return this;')();\n }\n }();\n module.exports = { boltExport: Global.Promise || promisePolyfill };\n },\n { 'promise-polyfill': 2 }\n ]\n }, {}, [4])(4);\n }));\n }(undefined, exports$1, module, undefined));\n var Promise$1 = module.exports.boltExport;\n\n var nu$7 = function (baseFn) {\n var data = Option.none();\n var callbacks = [];\n var map = function (f) {\n return nu$7(function (nCallback) {\n get(function (data) {\n nCallback(f(data));\n });\n });\n };\n var get = function (nCallback) {\n if (isReady()) {\n call(nCallback);\n } else {\n callbacks.push(nCallback);\n }\n };\n var set = function (x) {\n if (!isReady()) {\n data = Option.some(x);\n run(callbacks);\n callbacks = [];\n }\n };\n var isReady = function () {\n return data.isSome();\n };\n var run = function (cbs) {\n each$1(cbs, call);\n };\n var call = function (cb) {\n data.each(function (x) {\n domGlobals.setTimeout(function () {\n cb(x);\n }, 0);\n });\n };\n baseFn(set);\n return {\n get: get,\n map: map,\n isReady: isReady\n };\n };\n var pure$1 = function (a) {\n return nu$7(function (callback) {\n callback(a);\n });\n };\n var LazyValue = {\n nu: nu$7,\n pure: pure$1\n };\n\n var errorReporter = function (err) {\n domGlobals.setTimeout(function () {\n throw err;\n }, 0);\n };\n var make$4 = function (run) {\n var get = function (callback) {\n run().then(callback, errorReporter);\n };\n var map = function (fab) {\n return make$4(function () {\n return run().then(fab);\n });\n };\n var bind = function (aFutureB) {\n return make$4(function () {\n return run().then(function (v) {\n return aFutureB(v).toPromise();\n });\n });\n };\n var anonBind = function (futureB) {\n return make$4(function () {\n return run().then(function () {\n return futureB.toPromise();\n });\n });\n };\n var toLazy = function () {\n return LazyValue.nu(get);\n };\n var toCached = function () {\n var cache = null;\n return make$4(function () {\n if (cache === null) {\n cache = run();\n }\n return cache;\n });\n };\n var toPromise = run;\n return {\n map: map,\n bind: bind,\n anonBind: anonBind,\n toLazy: toLazy,\n toCached: toCached,\n toPromise: toPromise,\n get: get\n };\n };\n var nu$8 = function (baseFn) {\n return make$4(function () {\n return new Promise$1(baseFn);\n });\n };\n var pure$2 = function (a) {\n return make$4(function () {\n return Promise$1.resolve(a);\n });\n };\n var Future = {\n nu: nu$8,\n pure: pure$2\n };\n\n var adjust = function (value, destination, amount) {\n if (Math.abs(value - destination) <= amount) {\n return Option.none();\n } else if (value < destination) {\n return Option.some(value + amount);\n } else {\n return Option.some(value - amount);\n }\n };\n var create$5 = function () {\n var interval = null;\n var animate = function (getCurrent, destination, amount, increment, doFinish, rate) {\n var finished = false;\n var finish = function (v) {\n finished = true;\n doFinish(v);\n };\n global$4.clearInterval(interval);\n var abort = function (v) {\n global$4.clearInterval(interval);\n finish(v);\n };\n interval = global$4.setInterval(function () {\n var value = getCurrent();\n adjust(value, destination, amount).fold(function () {\n global$4.clearInterval(interval);\n finish(destination);\n }, function (s) {\n increment(s, abort);\n if (!finished) {\n var newValue = getCurrent();\n if (newValue !== s || Math.abs(newValue - destination) > Math.abs(value - destination)) {\n global$4.clearInterval(interval);\n finish(destination);\n }\n }\n });\n }, rate);\n };\n return { animate: animate };\n };\n\n var findDevice = function (deviceWidth, deviceHeight) {\n var devices = [\n {\n width: 320,\n height: 480,\n keyboard: {\n portrait: 300,\n landscape: 240\n }\n },\n {\n width: 320,\n height: 568,\n keyboard: {\n portrait: 300,\n landscape: 240\n }\n },\n {\n width: 375,\n height: 667,\n keyboard: {\n portrait: 305,\n landscape: 240\n }\n },\n {\n width: 414,\n height: 736,\n keyboard: {\n portrait: 320,\n landscape: 240\n }\n },\n {\n width: 768,\n height: 1024,\n keyboard: {\n portrait: 320,\n landscape: 400\n }\n },\n {\n width: 1024,\n height: 1366,\n keyboard: {\n portrait: 380,\n landscape: 460\n }\n }\n ];\n return findMap(devices, function (device) {\n return someIf(deviceWidth <= device.width && deviceHeight <= device.height, device.keyboard);\n }).getOr({\n portrait: deviceHeight / 5,\n landscape: deviceWidth / 4\n });\n };\n\n var softKeyboardLimits = function (outerWindow) {\n return findDevice(outerWindow.screen.width, outerWindow.screen.height);\n };\n var accountableKeyboardHeight = function (outerWindow) {\n var portrait = get$b(outerWindow).isPortrait();\n var limits = softKeyboardLimits(outerWindow);\n var keyboard = portrait ? limits.portrait : limits.landscape;\n var visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width;\n return visualScreenHeight - outerWindow.innerHeight > keyboard ? 0 : keyboard;\n };\n var getGreenzone = function (socket, dropup) {\n var outerWindow = owner(socket).dom().defaultView;\n var viewportHeight = get$5(socket) + get$5(dropup);\n var acc = accountableKeyboardHeight(outerWindow);\n return viewportHeight - acc;\n };\n var updatePadding = function (contentBody, socket, dropup) {\n var greenzoneHeight = getGreenzone(socket, dropup);\n var deltaHeight = get$5(socket) + get$5(dropup) - greenzoneHeight;\n set$3(contentBody, 'padding-bottom', deltaHeight + 'px');\n };\n\n var fixture = Adt.generate([\n {\n fixed: [\n 'element',\n 'property',\n 'offsetY'\n ]\n },\n {\n scroller: [\n 'element',\n 'offsetY'\n ]\n }\n ]);\n var yFixedData = 'data-' + resolve('position-y-fixed');\n var yFixedProperty = 'data-' + resolve('y-property');\n var yScrollingData = 'data-' + resolve('scrolling');\n var windowSizeData = 'data-' + resolve('last-window-height');\n var getYFixedData = function (element) {\n return safeParse(element, yFixedData);\n };\n var getYFixedProperty = function (element) {\n return get$1(element, yFixedProperty);\n };\n var getLastWindowSize = function (element) {\n return safeParse(element, windowSizeData);\n };\n var classifyFixed = function (element, offsetY) {\n var prop = getYFixedProperty(element);\n return fixture.fixed(element, prop, offsetY);\n };\n var classifyScrolling = function (element, offsetY) {\n return fixture.scroller(element, offsetY);\n };\n var classify = function (element) {\n var offsetY = getYFixedData(element);\n var classifier = get$1(element, yScrollingData) === 'true' ? classifyScrolling : classifyFixed;\n return classifier(element, offsetY);\n };\n var findFixtures = function (container) {\n var candidates = descendants(container, '[' + yFixedData + ']');\n return map$1(candidates, classify);\n };\n var takeoverToolbar = function (toolbar) {\n var oldToolbarStyle = get$1(toolbar, 'style');\n setAll$1(toolbar, {\n position: 'absolute',\n top: '0px'\n });\n set(toolbar, yFixedData, '0px');\n set(toolbar, yFixedProperty, 'top');\n var restore = function () {\n set(toolbar, 'style', oldToolbarStyle || '');\n remove$1(toolbar, yFixedData);\n remove$1(toolbar, yFixedProperty);\n };\n return { restore: restore };\n };\n var takeoverViewport = function (toolbarHeight, height, viewport) {\n var oldViewportStyle = get$1(viewport, 'style');\n register(viewport);\n setAll$1(viewport, {\n position: 'absolute',\n height: height + 'px',\n width: '100%',\n top: toolbarHeight + 'px'\n });\n set(viewport, yFixedData, toolbarHeight + 'px');\n set(viewport, yScrollingData, 'true');\n set(viewport, yFixedProperty, 'top');\n var restore = function () {\n deregister(viewport);\n set(viewport, 'style', oldViewportStyle || '');\n remove$1(viewport, yFixedData);\n remove$1(viewport, yScrollingData);\n remove$1(viewport, yFixedProperty);\n };\n return { restore: restore };\n };\n var takeoverDropup = function (dropup) {\n var oldDropupStyle = get$1(dropup, 'style');\n setAll$1(dropup, {\n position: 'absolute',\n bottom: '0px'\n });\n set(dropup, yFixedData, '0px');\n set(dropup, yFixedProperty, 'bottom');\n var restore = function () {\n set(dropup, 'style', oldDropupStyle || '');\n remove$1(dropup, yFixedData);\n remove$1(dropup, yFixedProperty);\n };\n return { restore: restore };\n };\n var deriveViewportHeight = function (viewport, toolbarHeight, dropupHeight) {\n var outerWindow = owner(viewport).dom().defaultView;\n var winH = outerWindow.innerHeight;\n set(viewport, windowSizeData, winH + 'px');\n return winH - toolbarHeight - dropupHeight;\n };\n var takeover$1 = function (viewport, contentBody, toolbar, dropup) {\n var outerWindow = owner(viewport).dom().defaultView;\n var toolbarSetup = takeoverToolbar(toolbar);\n var toolbarHeight = get$5(toolbar);\n var dropupHeight = get$5(dropup);\n var viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight);\n var viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport);\n var dropupSetup = takeoverDropup(dropup);\n var isActive = true;\n var restore = function () {\n isActive = false;\n toolbarSetup.restore();\n viewportSetup.restore();\n dropupSetup.restore();\n };\n var isExpanding = function () {\n var currentWinHeight = outerWindow.innerHeight;\n var lastWinHeight = getLastWindowSize(viewport);\n return currentWinHeight > lastWinHeight;\n };\n var refresh = function () {\n if (isActive) {\n var newToolbarHeight = get$5(toolbar);\n var dropupHeight_1 = get$5(dropup);\n var newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight_1);\n set(viewport, yFixedData, newToolbarHeight + 'px');\n set$3(viewport, 'height', newHeight + 'px');\n updatePadding(contentBody, viewport, dropup);\n }\n };\n var setViewportOffset = function (newYOffset) {\n var offsetPx = newYOffset + 'px';\n set(viewport, yFixedData, offsetPx);\n refresh();\n };\n updatePadding(contentBody, viewport, dropup);\n return {\n setViewportOffset: setViewportOffset,\n isExpanding: isExpanding,\n isShrinking: not(isExpanding),\n refresh: refresh,\n restore: restore\n };\n };\n\n var animator = create$5();\n var ANIMATION_STEP = 15;\n var NUM_TOP_ANIMATION_FRAMES = 10;\n var ANIMATION_RATE = 10;\n var lastScroll = 'data-' + resolve('last-scroll-top');\n var getTop = function (element) {\n var raw = getRaw(element, 'top').getOr('0');\n return parseInt(raw, 10);\n };\n var getScrollTop = function (element) {\n return parseInt(element.dom().scrollTop, 10);\n };\n var moveScrollAndTop = function (element, destination, finalTop) {\n return Future.nu(function (callback) {\n var getCurrent = curry(getScrollTop, element);\n var update = function (newScroll) {\n element.dom().scrollTop = newScroll;\n set$3(element, 'top', getTop(element) + ANIMATION_STEP + 'px');\n };\n var finish = function () {\n element.dom().scrollTop = destination;\n set$3(element, 'top', finalTop + 'px');\n callback(destination);\n };\n animator.animate(getCurrent, destination, ANIMATION_STEP, update, finish, ANIMATION_RATE);\n });\n };\n var moveOnlyScroll = function (element, destination) {\n return Future.nu(function (callback) {\n var getCurrent = curry(getScrollTop, element);\n set(element, lastScroll, getCurrent());\n var update = function (newScroll, abort) {\n var previous = safeParse(element, lastScroll);\n if (previous !== element.dom().scrollTop) {\n abort(element.dom().scrollTop);\n } else {\n element.dom().scrollTop = newScroll;\n set(element, lastScroll, newScroll);\n }\n };\n var finish = function () {\n element.dom().scrollTop = destination;\n set(element, lastScroll, destination);\n callback(destination);\n };\n var distance = Math.abs(destination - getCurrent());\n var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES);\n animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE);\n });\n };\n var moveOnlyTop = function (element, destination) {\n return Future.nu(function (callback) {\n var getCurrent = curry(getTop, element);\n var update = function (newTop) {\n set$3(element, 'top', newTop + 'px');\n };\n var finish = function () {\n update(destination);\n callback(destination);\n };\n var distance = Math.abs(destination - getCurrent());\n var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES);\n animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE);\n });\n };\n var updateTop = function (element, amount) {\n var newTop = amount + getYFixedData(element) + 'px';\n set$3(element, 'top', newTop);\n };\n var moveWindowScroll = function (toolbar, viewport, destY) {\n var outerWindow = owner(toolbar).dom().defaultView;\n return Future.nu(function (callback) {\n updateTop(toolbar, destY);\n updateTop(viewport, destY);\n outerWindow.scrollTo(0, destY);\n callback(destY);\n });\n };\n\n function BackgroundActivity (doAction) {\n var action = Cell(LazyValue.pure({}));\n var start = function (value) {\n var future = LazyValue.nu(function (callback) {\n return doAction(value).get(callback);\n });\n action.set(future);\n };\n var idle = function (g) {\n action.get().get(function () {\n g();\n });\n };\n return {\n start: start,\n idle: idle\n };\n }\n\n var scrollIntoView = function (cWin, socket, dropup, top, bottom) {\n var greenzone = getGreenzone(socket, dropup);\n var refreshCursor = curry(refresh$1, cWin);\n if (top > greenzone || bottom > greenzone) {\n moveOnlyScroll(socket, socket.dom().scrollTop - greenzone + bottom).get(refreshCursor);\n } else if (top < 0) {\n moveOnlyScroll(socket, socket.dom().scrollTop + top).get(refreshCursor);\n }\n };\n\n var par = function (asyncValues, nu) {\n return nu(function (callback) {\n var r = [];\n var count = 0;\n var cb = function (i) {\n return function (value) {\n r[i] = value;\n count++;\n if (count >= asyncValues.length) {\n callback(r);\n }\n };\n };\n if (asyncValues.length === 0) {\n callback([]);\n } else {\n each$1(asyncValues, function (asyncValue, i) {\n asyncValue.get(cb(i));\n });\n }\n });\n };\n\n var par$1 = function (futures) {\n return par(futures, Future.nu);\n };\n\n var updateFixed = function (element, property, winY, offsetY) {\n var destination = winY + offsetY;\n set$3(element, property, destination + 'px');\n return Future.pure(offsetY);\n };\n var updateScrollingFixed = function (element, winY, offsetY) {\n var destTop = winY + offsetY;\n var oldProp = getRaw(element, 'top').getOr(offsetY);\n var delta = destTop - parseInt(oldProp, 10);\n var destScroll = element.dom().scrollTop + delta;\n return moveScrollAndTop(element, destScroll, destTop);\n };\n var updateFixture = function (fixture, winY) {\n return fixture.fold(function (element, property, offsetY) {\n return updateFixed(element, property, winY, offsetY);\n }, function (element, offsetY) {\n return updateScrollingFixed(element, winY, offsetY);\n });\n };\n var updatePositions = function (container, winY) {\n var fixtures = findFixtures(container);\n var updates = map$1(fixtures, function (fixture) {\n return updateFixture(fixture, winY);\n });\n return par$1(updates);\n };\n\n var VIEW_MARGIN = 5;\n var register$2 = function (toolstrip, socket, container, outerWindow, structure, cWin) {\n var scroller = BackgroundActivity(function (y) {\n return moveWindowScroll(toolstrip, socket, y);\n });\n var scrollBounds = function () {\n var rects = getRectangles(cWin);\n return Option.from(rects[0]).bind(function (rect) {\n var viewTop = rect.top() - socket.dom().scrollTop;\n var outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN;\n return outside ? Option.some({\n top: constant(viewTop),\n bottom: constant(viewTop + rect.height())\n }) : Option.none();\n });\n };\n var scrollThrottle = last(function () {\n scroller.idle(function () {\n updatePositions(container, outerWindow.pageYOffset).get(function () {\n var extraScroll = scrollBounds();\n extraScroll.each(function (extra) {\n socket.dom().scrollTop = socket.dom().scrollTop + extra.top();\n });\n scroller.start(0);\n structure.refresh();\n });\n });\n }, 1000);\n var onScroll = bind$3(Element.fromDom(outerWindow), 'scroll', function () {\n if (outerWindow.pageYOffset < 0) {\n return;\n }\n scrollThrottle.throttle();\n });\n updatePositions(container, outerWindow.pageYOffset).get(identity);\n return { unbind: onScroll.unbind };\n };\n var setup$3 = function (bag) {\n var cWin = bag.cWin;\n var ceBody = bag.ceBody;\n var socket = bag.socket;\n var toolstrip = bag.toolstrip;\n var contentElement = bag.contentElement;\n var keyboardType = bag.keyboardType;\n var outerWindow = bag.outerWindow;\n var dropup = bag.dropup;\n var outerBody = bag.outerBody;\n var structure = takeover$1(socket, ceBody, toolstrip, dropup);\n var keyboardModel = keyboardType(outerBody, cWin, body(), contentElement);\n var toEditing = function () {\n keyboardModel.toEditing();\n clearSelection();\n };\n var toReading = function () {\n keyboardModel.toReading();\n };\n var onToolbarTouch = function (_event) {\n keyboardModel.onToolbarTouch();\n };\n var onOrientation = onChange(outerWindow, {\n onChange: noop,\n onReady: structure.refresh\n });\n onOrientation.onAdjustment(function () {\n structure.refresh();\n });\n var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () {\n if (structure.isExpanding()) {\n structure.refresh();\n }\n });\n var onScroll = register$2(toolstrip, socket, outerBody, outerWindow, structure, cWin);\n var unfocusedSelection = FakeSelection(cWin, contentElement);\n var refreshSelection = function () {\n if (unfocusedSelection.isActive()) {\n unfocusedSelection.update();\n }\n };\n var highlightSelection = function () {\n unfocusedSelection.update();\n };\n var clearSelection = function () {\n unfocusedSelection.clear();\n };\n var scrollIntoView$1 = function (top, bottom) {\n scrollIntoView(cWin, socket, dropup, top, bottom);\n };\n var syncHeight = function () {\n set$3(contentElement, 'height', contentElement.dom().contentWindow.document.body.scrollHeight + 'px');\n };\n var setViewportOffset = function (newYOffset) {\n structure.setViewportOffset(newYOffset);\n moveOnlyTop(socket, newYOffset).get(identity);\n };\n var destroy = function () {\n structure.restore();\n onOrientation.destroy();\n onScroll.unbind();\n onResize.unbind();\n keyboardModel.destroy();\n unfocusedSelection.destroy();\n input$1(body(), blur);\n };\n return {\n toEditing: toEditing,\n toReading: toReading,\n onToolbarTouch: onToolbarTouch,\n refreshSelection: refreshSelection,\n clearSelection: clearSelection,\n highlightSelection: highlightSelection,\n scrollIntoView: scrollIntoView$1,\n updateToolbarPadding: noop,\n setViewportOffset: setViewportOffset,\n syncHeight: syncHeight,\n refreshStructure: structure.refresh,\n destroy: destroy\n };\n };\n\n var create$6 = function (platform, mask) {\n var meta = tag();\n var priorState = value$2();\n var scrollEvents = value$2();\n var iosApi = api$2();\n var iosEvents = api$2();\n var enter = function () {\n mask.hide();\n var doc = Element.fromDom(domGlobals.document);\n getActiveApi(platform.editor).each(function (editorApi) {\n priorState.set({\n socketHeight: getRaw(platform.socket, 'height'),\n iframeHeight: getRaw(editorApi.frame(), 'height'),\n outerScroll: domGlobals.document.body.scrollTop\n });\n scrollEvents.set({ exclusives: exclusive(doc, '.' + scrollable) });\n add$2(platform.container, resolve('fullscreen-maximized'));\n clobberStyles(platform.container, editorApi.body());\n meta.maximize();\n set$3(platform.socket, 'overflow', 'scroll');\n set$3(platform.socket, '-webkit-overflow-scrolling', 'touch');\n focus$1(editorApi.body());\n iosApi.set(setup$3({\n cWin: editorApi.win(),\n ceBody: editorApi.body(),\n socket: platform.socket,\n toolstrip: platform.toolstrip,\n dropup: platform.dropup.element(),\n contentElement: editorApi.frame(),\n outerBody: platform.body,\n outerWindow: platform.win,\n keyboardType: stubborn\n }));\n iosApi.run(function (api) {\n api.syncHeight();\n });\n iosEvents.set(initEvents$1(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup));\n });\n };\n var exit = function () {\n meta.restore();\n iosEvents.clear();\n iosApi.clear();\n mask.show();\n priorState.on(function (s) {\n s.socketHeight.each(function (h) {\n set$3(platform.socket, 'height', h);\n });\n s.iframeHeight.each(function (h) {\n set$3(platform.editor.getFrame(), 'height', h);\n });\n domGlobals.document.body.scrollTop = s.scrollTop;\n });\n priorState.clear();\n scrollEvents.on(function (s) {\n s.exclusives.unbind();\n });\n scrollEvents.clear();\n remove$4(platform.container, resolve('fullscreen-maximized'));\n restoreStyles();\n deregister(platform.toolbar);\n remove$5(platform.socket, 'overflow');\n remove$5(platform.socket, '-webkit-overflow-scrolling');\n blur(platform.editor.getFrame());\n getActiveApi(platform.editor).each(function (editorApi) {\n editorApi.clearSelection();\n });\n };\n var refreshStructure = function () {\n iosApi.run(function (api) {\n api.refreshStructure();\n });\n };\n return {\n enter: enter,\n refreshStructure: refreshStructure,\n exit: exit\n };\n };\n\n var produce$1 = function (raw) {\n var mobile = asRawOrDie('Getting IosWebapp schema', MobileSchema, raw);\n set$3(mobile.toolstrip, 'width', '100%');\n set$3(mobile.container, 'position', 'relative');\n var onView = function () {\n mobile.setReadOnly(mobile.readOnlyOnInit());\n mode.enter();\n };\n var mask = build$1(sketch$9(onView, mobile.translate));\n mobile.alloy.add(mask);\n var maskApi = {\n show: function () {\n mobile.alloy.add(mask);\n },\n hide: function () {\n mobile.alloy.remove(mask);\n }\n };\n var mode = create$6(mobile, maskApi);\n return {\n setReadOnly: mobile.setReadOnly,\n refreshStructure: mode.refreshStructure,\n enter: mode.enter,\n exit: mode.exit,\n destroy: noop\n };\n };\n\n function IosRealm (scrollIntoView) {\n var alloy = OuterContainer({ classes: [resolve('ios-container')] });\n var toolbar = ScrollingToolbar();\n var webapp = api$2();\n var switchToEdit = makeEditSwitch(webapp);\n var socket = makeSocket();\n var dropup = build$2(function () {\n webapp.run(function (w) {\n w.refreshStructure();\n });\n }, scrollIntoView);\n alloy.add(toolbar.wrapper());\n alloy.add(socket);\n alloy.add(dropup.component());\n var setToolbarGroups = function (rawGroups) {\n var groups = toolbar.createGroups(rawGroups);\n toolbar.setGroups(groups);\n };\n var setContextToolbar = function (rawGroups) {\n var groups = toolbar.createGroups(rawGroups);\n toolbar.setContextToolbar(groups);\n };\n var focusToolbar = function () {\n toolbar.focus();\n };\n var restoreToolbar = function () {\n toolbar.restoreToolbar();\n };\n var init = function (spec) {\n webapp.set(produce$1(spec));\n };\n var exit = function () {\n webapp.run(function (w) {\n Replacing.remove(socket, switchToEdit);\n w.exit();\n });\n };\n var updateMode$1 = function (readOnly) {\n updateMode(socket, switchToEdit, readOnly, alloy.root());\n };\n return {\n system: constant(alloy),\n element: alloy.element,\n init: init,\n exit: exit,\n setToolbarGroups: setToolbarGroups,\n setContextToolbar: setContextToolbar,\n focusToolbar: focusToolbar,\n restoreToolbar: restoreToolbar,\n updateMode: updateMode$1,\n socket: constant(socket),\n dropup: constant(dropup)\n };\n }\n\n var global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager');\n\n var derive$3 = function (editor) {\n var base = Option.from(getSkinUrl(editor)).fold(function () {\n return global$5.baseURL + '/skins/ui/oxide';\n }, function (url) {\n return url;\n });\n return {\n content: base + '/content.mobile.min.css',\n ui: base + '/skin.mobile.min.css'\n };\n };\n\n var fireChange = function (realm, command, state) {\n realm.system().broadcastOn([formatChanged], {\n command: command,\n state: state\n });\n };\n var init$5 = function (realm, editor) {\n var allFormats = keys(editor.formatter.get());\n each$1(allFormats, function (command) {\n editor.formatter.formatChanged(command, function (state) {\n fireChange(realm, command, state);\n });\n });\n each$1([\n 'ul',\n 'ol'\n ], function (command) {\n editor.selection.selectorChanged(command, function (state, _data) {\n fireChange(realm, command, state);\n });\n });\n };\n\n var fireSkinLoaded = function (editor) {\n return function () {\n var done = function () {\n editor._skinLoaded = true;\n editor.fire('SkinLoaded');\n };\n if (editor.initialized) {\n done();\n } else {\n editor.on('init', done);\n }\n };\n };\n\n var READING = 'toReading';\n var EDITING = 'toEditing';\n var renderMobileTheme = function (editor) {\n var renderUI = function () {\n var targetNode = editor.getElement();\n var cssUrls = derive$3(editor);\n if (isSkinDisabled(editor) === false) {\n editor.contentCSS.push(cssUrls.content);\n global$1.DOM.styleSheetLoader.load(cssUrls.ui, fireSkinLoaded(editor));\n } else {\n fireSkinLoaded(editor)();\n }\n var doScrollIntoView = function () {\n editor.fire('ScrollIntoView');\n };\n var realm = detect$3().os.isAndroid() ? AndroidRealm(doScrollIntoView) : IosRealm(doScrollIntoView);\n var original = Element.fromDom(targetNode);\n attachSystemAfter(original, realm.system());\n var findFocusIn = function (elem) {\n return search(elem).bind(function (focused) {\n return realm.system().getByDom(focused).toOption();\n });\n };\n var outerWindow = targetNode.ownerDocument.defaultView;\n var orientation = onChange(outerWindow, {\n onChange: function () {\n var alloy = realm.system();\n alloy.broadcastOn([orientationChanged], { width: getActualWidth(outerWindow) });\n },\n onReady: noop\n });\n var setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) {\n if (ro === false) {\n editor.selection.collapse();\n }\n var toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups);\n realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main);\n editor.setMode(ro === true ? 'readonly' : 'design');\n editor.fire(ro === true ? READING : EDITING);\n realm.updateMode(ro);\n };\n var configureToolbar = function (dynamicGroup, readOnlyGroups, mainGroups) {\n var dynamic = dynamicGroup.get();\n var toolbars = {\n readOnly: dynamic.backToMask.concat(readOnlyGroups.get()),\n main: dynamic.backToMask.concat(mainGroups.get())\n };\n return toolbars;\n };\n var bindHandler = function (label, handler) {\n editor.on(label, handler);\n return {\n unbind: function () {\n editor.off(label);\n }\n };\n };\n editor.on('init', function () {\n realm.init({\n editor: {\n getFrame: function () {\n return Element.fromDom(editor.contentAreaContainer.querySelector('iframe'));\n },\n onDomChanged: function () {\n return { unbind: noop };\n },\n onToReading: function (handler) {\n return bindHandler(READING, handler);\n },\n onToEditing: function (handler) {\n return bindHandler(EDITING, handler);\n },\n onScrollToCursor: function (handler) {\n editor.on('ScrollIntoView', function (tinyEvent) {\n handler(tinyEvent);\n });\n var unbind = function () {\n editor.off('ScrollIntoView');\n orientation.destroy();\n };\n return { unbind: unbind };\n },\n onTouchToolstrip: function () {\n hideDropup();\n },\n onTouchContent: function () {\n var toolbar = Element.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar')));\n findFocusIn(toolbar).each(emitExecute);\n realm.restoreToolbar();\n hideDropup();\n },\n onTapContent: function (evt) {\n var target = evt.target();\n if (name(target) === 'img') {\n editor.selection.select(target.dom());\n evt.kill();\n } else if (name(target) === 'a') {\n var component = realm.system().getByDom(Element.fromDom(editor.editorContainer));\n component.each(function (container) {\n if (Swapping.isAlpha(container)) {\n openLink(target.dom());\n }\n });\n }\n }\n },\n container: Element.fromDom(editor.editorContainer),\n socket: Element.fromDom(editor.contentAreaContainer),\n toolstrip: Element.fromDom(editor.editorContainer.querySelector('.' + resolve('toolstrip'))),\n toolbar: Element.fromDom(editor.editorContainer.querySelector('.' + resolve('toolbar'))),\n dropup: realm.dropup(),\n alloy: realm.system(),\n translate: noop,\n setReadOnly: function (ro) {\n setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro);\n },\n readOnlyOnInit: function () {\n return readOnlyOnInit();\n }\n });\n var hideDropup = function () {\n realm.dropup().disappear(function () {\n realm.system().broadcastOn([dropupDismissed], {});\n });\n };\n var backToMaskGroup = {\n label: 'The first group',\n scrollable: false,\n items: [forToolbar('back', function () {\n editor.selection.collapse();\n realm.exit();\n }, {}, editor)]\n };\n var backToReadOnlyGroup = {\n label: 'Back to read only',\n scrollable: false,\n items: [forToolbar('readonly-back', function () {\n setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, true);\n }, {}, editor)]\n };\n var readOnlyGroup = {\n label: 'The read only mode group',\n scrollable: true,\n items: []\n };\n var features = setup(realm, editor);\n var items = detect$4(editor, features);\n var actionGroup = {\n label: 'the action group',\n scrollable: true,\n items: items\n };\n var extraGroup = {\n label: 'The extra group',\n scrollable: false,\n items: []\n };\n var mainGroups = Cell([\n actionGroup,\n extraGroup\n ]);\n var readOnlyGroups = Cell([\n readOnlyGroup,\n extraGroup\n ]);\n var dynamicGroup = Cell({\n backToMask: [backToMaskGroup],\n backToReadOnly: [backToReadOnlyGroup]\n });\n init$5(realm, editor);\n });\n editor.on('remove', function () {\n realm.exit();\n });\n editor.on('detach', function () {\n detachSystem(realm.system());\n realm.system().destroy();\n });\n return {\n iframeContainer: realm.socket().element().dom(),\n editorContainer: realm.element().dom()\n };\n };\n return {\n getNotificationManagerImpl: function () {\n return {\n open: constant({\n progressBar: { value: noop },\n close: noop,\n text: noop,\n getEl: constant(null),\n moveTo: noop,\n moveRel: noop,\n settings: {}\n }),\n close: noop,\n reposition: noop,\n getArgs: constant({})\n };\n },\n renderUI: renderUI\n };\n };\n function Theme () {\n global$2.add('mobile', renderMobileTheme);\n }\n\n Theme();\n\n}(window));\n","/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n *\n * Version: 5.4.1 (2020-07-08)\n */\n(function (domGlobals) {\n 'use strict';\n\n var noop = function () {\n };\n var noarg = function (f) {\n return function () {\n return f();\n };\n };\n var compose = function (fa, fb) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fa(fb.apply(null, args));\n };\n };\n var compose1 = function (fbc, fab) {\n return function (a) {\n return fbc(fab(a));\n };\n };\n var constant = function (value) {\n return function () {\n return value;\n };\n };\n var identity = function (x) {\n return x;\n };\n function curry(fn) {\n var initialArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n initialArgs[_i - 1] = arguments[_i];\n }\n return function () {\n var restArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n restArgs[_i] = arguments[_i];\n }\n var all = initialArgs.concat(restArgs);\n return fn.apply(null, all);\n };\n }\n var not = function (f) {\n return function (t) {\n return !f(t);\n };\n };\n var die = function (msg) {\n return function () {\n throw new Error(msg);\n };\n };\n var never = constant(false);\n var always = constant(true);\n\n var global$1 = tinymce.util.Tools.resolve('tinymce.ThemeManager');\n\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === 'function')\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n\n var none = function () {\n return NONE;\n };\n var NONE = function () {\n var eq = function (o) {\n return o.isNone();\n };\n var call = function (thunk) {\n return thunk();\n };\n var id = function (n) {\n return n;\n };\n var me = {\n fold: function (n, _s) {\n return n();\n },\n is: never,\n isSome: never,\n isNone: always,\n getOr: id,\n getOrThunk: call,\n getOrDie: function (msg) {\n throw new Error(msg || 'error: getOrDie called on none.');\n },\n getOrNull: constant(null),\n getOrUndefined: constant(undefined),\n or: id,\n orThunk: call,\n map: none,\n each: noop,\n bind: none,\n exists: never,\n forall: always,\n filter: none,\n equals: eq,\n equals_: eq,\n toArray: function () {\n return [];\n },\n toString: constant('none()')\n };\n return me;\n }();\n var some = function (a) {\n var constant_a = constant(a);\n var self = function () {\n return me;\n };\n var bind = function (f) {\n return f(a);\n };\n var me = {\n fold: function (n, s) {\n return s(a);\n },\n is: function (v) {\n return a === v;\n },\n isSome: always,\n isNone: never,\n getOr: constant_a,\n getOrThunk: constant_a,\n getOrDie: constant_a,\n getOrNull: constant_a,\n getOrUndefined: constant_a,\n or: self,\n orThunk: self,\n map: function (f) {\n return some(f(a));\n },\n each: function (f) {\n f(a);\n },\n bind: bind,\n exists: bind,\n forall: bind,\n filter: function (f) {\n return f(a) ? me : NONE;\n },\n toArray: function () {\n return [a];\n },\n toString: function () {\n return 'some(' + a + ')';\n },\n equals: function (o) {\n return o.is(a);\n },\n equals_: function (o, elementEq) {\n return o.fold(never, function (b) {\n return elementEq(a, b);\n });\n }\n };\n return me;\n };\n var from = function (value) {\n return value === null || value === undefined ? NONE : some(value);\n };\n var Option = {\n some: some,\n none: none,\n from: from\n };\n\n var typeOf = function (x) {\n var t = typeof x;\n if (x === null) {\n return 'null';\n } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {\n return 'array';\n } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {\n return 'string';\n } else {\n return t;\n }\n };\n var isType = function (type) {\n return function (value) {\n return typeOf(value) === type;\n };\n };\n var isSimpleType = function (type) {\n return function (value) {\n return typeof value === type;\n };\n };\n var eq = function (t) {\n return function (a) {\n return t === a;\n };\n };\n var isString = isType('string');\n var isObject = isType('object');\n var isArray = isType('array');\n var isBoolean = isSimpleType('boolean');\n var isUndefined = eq(undefined);\n var isNullable = function (a) {\n return a === null || a === undefined;\n };\n var isNonNullable = function (a) {\n return !isNullable(a);\n };\n var isFunction = isSimpleType('function');\n var isNumber = isSimpleType('number');\n var isArrayOf = function (value, pred) {\n if (isArray(value)) {\n for (var i = 0, len = value.length; i < len; ++i) {\n if (!pred(value[i])) {\n return false;\n }\n }\n return true;\n }\n return false;\n };\n\n var nativeSlice = Array.prototype.slice;\n var nativeIndexOf = Array.prototype.indexOf;\n var nativePush = Array.prototype.push;\n var rawIndexOf = function (ts, t) {\n return nativeIndexOf.call(ts, t);\n };\n var indexOf = function (xs, x) {\n var r = rawIndexOf(xs, x);\n return r === -1 ? Option.none() : Option.some(r);\n };\n var contains = function (xs, x) {\n return rawIndexOf(xs, x) > -1;\n };\n var exists = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return true;\n }\n }\n return false;\n };\n var range = function (num, f) {\n var r = [];\n for (var i = 0; i < num; i++) {\n r.push(f(i));\n }\n return r;\n };\n var chunk = function (array, size) {\n var r = [];\n for (var i = 0; i < array.length; i += size) {\n var s = nativeSlice.call(array, i, i + size);\n r.push(s);\n }\n return r;\n };\n var map = function (xs, f) {\n var len = xs.length;\n var r = new Array(len);\n for (var i = 0; i < len; i++) {\n var x = xs[i];\n r[i] = f(x, i);\n }\n return r;\n };\n var each = function (xs, f) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n f(x, i);\n }\n };\n var eachr = function (xs, f) {\n for (var i = xs.length - 1; i >= 0; i--) {\n var x = xs[i];\n f(x, i);\n }\n };\n var partition = function (xs, pred) {\n var pass = [];\n var fail = [];\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n var arr = pred(x, i) ? pass : fail;\n arr.push(x);\n }\n return {\n pass: pass,\n fail: fail\n };\n };\n var filter = function (xs, pred) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n r.push(x);\n }\n }\n return r;\n };\n var foldr = function (xs, f, acc) {\n eachr(xs, function (x) {\n acc = f(acc, x);\n });\n return acc;\n };\n var foldl = function (xs, f, acc) {\n each(xs, function (x) {\n acc = f(acc, x);\n });\n return acc;\n };\n var findUntil = function (xs, pred, until) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Option.some(x);\n } else if (until(x, i)) {\n break;\n }\n }\n return Option.none();\n };\n var find = function (xs, pred) {\n return findUntil(xs, pred, never);\n };\n var findIndex = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n if (pred(x, i)) {\n return Option.some(i);\n }\n }\n return Option.none();\n };\n var flatten = function (xs) {\n var r = [];\n for (var i = 0, len = xs.length; i < len; ++i) {\n if (!isArray(xs[i])) {\n throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);\n }\n nativePush.apply(r, xs[i]);\n }\n return r;\n };\n var bind = function (xs, f) {\n return flatten(map(xs, f));\n };\n var forall = function (xs, pred) {\n for (var i = 0, len = xs.length; i < len; ++i) {\n var x = xs[i];\n if (pred(x, i) !== true) {\n return false;\n }\n }\n return true;\n };\n var reverse = function (xs) {\n var r = nativeSlice.call(xs, 0);\n r.reverse();\n return r;\n };\n var difference = function (a1, a2) {\n return filter(a1, function (x) {\n return !contains(a2, x);\n });\n };\n var mapToObject = function (xs, f) {\n var r = {};\n for (var i = 0, len = xs.length; i < len; i++) {\n var x = xs[i];\n r[String(x)] = f(x, i);\n }\n return r;\n };\n var sort = function (xs, comparator) {\n var copy = nativeSlice.call(xs, 0);\n copy.sort(comparator);\n return copy;\n };\n var head = function (xs) {\n return xs.length === 0 ? Option.none() : Option.some(xs[0]);\n };\n var last = function (xs) {\n return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);\n };\n var from$1 = isFunction(Array.from) ? Array.from : function (x) {\n return nativeSlice.call(x);\n };\n var findMap = function (arr, f) {\n for (var i = 0; i < arr.length; i++) {\n var r = f(arr[i], i);\n if (r.isSome()) {\n return r;\n }\n }\n return Option.none();\n };\n\n var value = function (o) {\n var is = function (v) {\n return o === v;\n };\n var or = function (_opt) {\n return value(o);\n };\n var orThunk = function (_f) {\n return value(o);\n };\n var map = function (f) {\n return value(f(o));\n };\n var mapError = function (_f) {\n return value(o);\n };\n var each = function (f) {\n f(o);\n };\n var bind = function (f) {\n return f(o);\n };\n var fold = function (_, onValue) {\n return onValue(o);\n };\n var exists = function (f) {\n return f(o);\n };\n var forall = function (f) {\n return f(o);\n };\n var toOption = function () {\n return Option.some(o);\n };\n return {\n is: is,\n isValue: always,\n isError: never,\n getOr: constant(o),\n getOrThunk: constant(o),\n getOrDie: constant(o),\n or: or,\n orThunk: orThunk,\n fold: fold,\n map: map,\n mapError: mapError,\n each: each,\n bind: bind,\n exists: exists,\n forall: forall,\n toOption: toOption\n };\n };\n var error = function (message) {\n var getOrThunk = function (f) {\n return f();\n };\n var getOrDie = function () {\n return die(String(message))();\n };\n var or = function (opt) {\n return opt;\n };\n var orThunk = function (f) {\n return f();\n };\n var map = function (_f) {\n return error(message);\n };\n var mapError = function (f) {\n return error(f(message));\n };\n var bind = function (_f) {\n return error(message);\n };\n var fold = function (onError, _) {\n return onError(message);\n };\n return {\n is: never,\n isValue: never,\n isError: always,\n getOr: identity,\n getOrThunk: getOrThunk,\n getOrDie: getOrDie,\n or: or,\n orThunk: orThunk,\n fold: fold,\n map: map,\n mapError: mapError,\n each: noop,\n bind: bind,\n exists: never,\n forall: always,\n toOption: Option.none\n };\n };\n var fromOption = function (opt, err) {\n return opt.fold(function () {\n return error(err);\n }, value);\n };\n var Result = {\n value: value,\n error: error,\n fromOption: fromOption\n };\n\n var SimpleResultType;\n (function (SimpleResultType) {\n SimpleResultType[SimpleResultType['Error'] = 0] = 'Error';\n SimpleResultType[SimpleResultType['Value'] = 1] = 'Value';\n }(SimpleResultType || (SimpleResultType = {})));\n var fold = function (res, onError, onValue) {\n return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue);\n };\n var partition$1 = function (results) {\n var values = [];\n var errors = [];\n each(results, function (obj) {\n fold(obj, function (err) {\n return errors.push(err);\n }, function (val) {\n return values.push(val);\n });\n });\n return {\n values: values,\n errors: errors\n };\n };\n var mapError = function (res, f) {\n if (res.stype === SimpleResultType.Error) {\n return {\n stype: SimpleResultType.Error,\n serror: f(res.serror)\n };\n } else {\n return res;\n }\n };\n var map$1 = function (res, f) {\n if (res.stype === SimpleResultType.Value) {\n return {\n stype: SimpleResultType.Value,\n svalue: f(res.svalue)\n };\n } else {\n return res;\n }\n };\n var bind$1 = function (res, f) {\n if (res.stype === SimpleResultType.Value) {\n return f(res.svalue);\n } else {\n return res;\n }\n };\n var bindError = function (res, f) {\n if (res.stype === SimpleResultType.Error) {\n return f(res.serror);\n } else {\n return res;\n }\n };\n var svalue = function (v) {\n return {\n stype: SimpleResultType.Value,\n svalue: v\n };\n };\n var serror = function (e) {\n return {\n stype: SimpleResultType.Error,\n serror: e\n };\n };\n var toResult = function (res) {\n return fold(res, Result.error, Result.value);\n };\n var fromResult = function (res) {\n return res.fold(serror, svalue);\n };\n var SimpleResult = {\n fromResult: fromResult,\n toResult: toResult,\n svalue: svalue,\n partition: partition$1,\n serror: serror,\n bind: bind$1,\n bindError: bindError,\n map: map$1,\n mapError: mapError,\n fold: fold\n };\n\n var keys = Object.keys;\n var hasOwnProperty = Object.hasOwnProperty;\n var each$1 = function (obj, f) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n f(x, i);\n }\n };\n var map$2 = function (obj, f) {\n return tupleMap(obj, function (x, i) {\n return {\n k: i,\n v: f(x, i)\n };\n });\n };\n var tupleMap = function (obj, f) {\n var r = {};\n each$1(obj, function (x, i) {\n var tuple = f(x, i);\n r[tuple.k] = tuple.v;\n });\n return r;\n };\n var objAcc = function (r) {\n return function (x, i) {\n r[i] = x;\n };\n };\n var internalFilter = function (obj, pred, onTrue, onFalse) {\n var r = {};\n each$1(obj, function (x, i) {\n (pred(x, i) ? onTrue : onFalse)(x, i);\n });\n return r;\n };\n var filter$1 = function (obj, pred) {\n var t = {};\n internalFilter(obj, pred, objAcc(t), noop);\n return t;\n };\n var mapToArray = function (obj, f) {\n var r = [];\n each$1(obj, function (value, name) {\n r.push(f(value, name));\n });\n return r;\n };\n var find$1 = function (obj, pred) {\n var props = keys(obj);\n for (var k = 0, len = props.length; k < len; k++) {\n var i = props[k];\n var x = obj[i];\n if (pred(x, i, obj)) {\n return Option.some(x);\n }\n }\n return Option.none();\n };\n var values = function (obj) {\n return mapToArray(obj, function (v) {\n return v;\n });\n };\n var get = function (obj, key) {\n return has(obj, key) ? Option.from(obj[key]) : Option.none();\n };\n var has = function (obj, key) {\n return hasOwnProperty.call(obj, key);\n };\n var hasNonNullableKey = function (obj, key) {\n return has(obj, key) && obj[key] !== undefined && obj[key] !== null;\n };\n\n var generate = function (cases) {\n if (!isArray(cases)) {\n throw new Error('cases must be an array');\n }\n if (cases.length === 0) {\n throw new Error('there must be at least one case');\n }\n var constructors = [];\n var adt = {};\n each(cases, function (acase, count) {\n var keys$1 = keys(acase);\n if (keys$1.length !== 1) {\n throw new Error('one and only one name per case');\n }\n var key = keys$1[0];\n var value = acase[key];\n if (adt[key] !== undefined) {\n throw new Error('duplicate key detected:' + key);\n } else if (key === 'cata') {\n throw new Error('cannot have a case named cata (sorry)');\n } else if (!isArray(value)) {\n throw new Error('case arguments must be an array');\n }\n constructors.push(key);\n adt[key] = function () {\n var argLength = arguments.length;\n if (argLength !== value.length) {\n throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);\n }\n var args = new Array(argLength);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n var match = function (branches) {\n var branchKeys = keys(branches);\n if (constructors.length !== branchKeys.length) {\n throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\\nActual: ' + branchKeys.join(','));\n }\n var allReqd = forall(constructors, function (reqKey) {\n return contains(branchKeys, reqKey);\n });\n if (!allReqd) {\n throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\\nRequired: ' + constructors.join(', '));\n }\n return branches[key].apply(null, args);\n };\n return {\n fold: function () {\n if (arguments.length !== cases.length) {\n throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length);\n }\n var target = arguments[count];\n return target.apply(null, args);\n },\n match: match,\n log: function (label) {\n domGlobals.console.log(label, {\n constructors: constructors,\n constructor: key,\n params: args\n });\n }\n };\n };\n });\n return adt;\n };\n var Adt = { generate: generate };\n\n var hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n var shallow = function (old, nu) {\n return nu;\n };\n var deep = function (old, nu) {\n var bothObjects = isObject(old) && isObject(nu);\n return bothObjects ? deepMerge(old, nu) : nu;\n };\n var baseMerge = function (merger) {\n return function () {\n var objects = new Array(arguments.length);\n for (var i = 0; i < objects.length; i++) {\n objects[i] = arguments[i];\n }\n if (objects.length === 0) {\n throw new Error('Can\\'t merge zero objects');\n }\n var ret = {};\n for (var j = 0; j < objects.length; j++) {\n var curObject = objects[j];\n for (var key in curObject) {\n if (hasOwnProperty$1.call(curObject, key)) {\n ret[key] = merger(ret[key], curObject[key]);\n }\n }\n }\n return ret;\n };\n };\n var deepMerge = baseMerge(deep);\n var merge = baseMerge(shallow);\n\n var cached = function (f) {\n var called = false;\n var r;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (!called) {\n called = true;\n r = f.apply(null, args);\n }\n return r;\n };\n };\n\n var adt = Adt.generate([\n { strict: [] },\n { defaultedThunk: ['fallbackThunk'] },\n { asOption: [] },\n { asDefaultedOptionThunk: ['fallbackThunk'] },\n { mergeWithThunk: ['baseThunk'] }\n ]);\n var defaulted = function (fallback) {\n return adt.defaultedThunk(constant(fallback));\n };\n var mergeWith = function (base) {\n return adt.mergeWithThunk(constant(base));\n };\n var strict = adt.strict;\n var asOption = adt.asOption;\n var defaultedThunk = adt.defaultedThunk;\n var asDefaultedOptionThunk = adt.asDefaultedOptionThunk;\n var mergeWithThunk = adt.mergeWithThunk;\n\n var exclude = function (obj, fields) {\n var r = {};\n each$1(obj, function (v, k) {\n if (!contains(fields, k)) {\n r[k] = v;\n }\n });\n return r;\n };\n\n var wrap = function (key, value) {\n var _a;\n return _a = {}, _a[key] = value, _a;\n };\n var wrapAll = function (keyvalues) {\n var r = {};\n each(keyvalues, function (kv) {\n r[kv.key] = kv.value;\n });\n return r;\n };\n\n var comparison = Adt.generate([\n {\n bothErrors: [\n 'error1',\n 'error2'\n ]\n },\n {\n firstError: [\n 'error1',\n 'value2'\n ]\n },\n {\n secondError: [\n 'value1',\n 'error2'\n ]\n },\n {\n bothValues: [\n 'value1',\n 'value2'\n ]\n }\n ]);\n var partition$2 = function (results) {\n var errors = [];\n var values = [];\n each(results, function (result) {\n result.fold(function (err) {\n errors.push(err);\n }, function (value) {\n values.push(value);\n });\n });\n return {\n errors: errors,\n values: values\n };\n };\n\n var exclude$1 = function (obj, fields) {\n return exclude(obj, fields);\n };\n var wrap$1 = function (key, value) {\n return wrap(key, value);\n };\n var wrapAll$1 = function (keyvalues) {\n return wrapAll(keyvalues);\n };\n var mergeValues = function (values, base) {\n return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values)));\n };\n var mergeErrors = function (errors) {\n return Result.error(flatten(errors));\n };\n var consolidate = function (objs, base) {\n var partitions = partition$2(objs);\n return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base);\n };\n\n var mergeValues$1 = function (values, base) {\n return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base);\n };\n var mergeErrors$1 = function (errors) {\n return compose(SimpleResult.serror, flatten)(errors);\n };\n var consolidateObj = function (objects, base) {\n var partition = SimpleResult.partition(objects);\n return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base);\n };\n var consolidateArr = function (objects) {\n var partitions = SimpleResult.partition(objects);\n return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values);\n };\n var ResultCombine = {\n consolidateObj: consolidateObj,\n consolidateArr: consolidateArr\n };\n\n var formatObj = function (input) {\n return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2);\n };\n var formatErrors = function (errors) {\n var es = errors.length > 10 ? errors.slice(0, 10).concat([{\n path: [],\n getErrorInfo: function () {\n return '... (only showing first ten failures)';\n }\n }]) : errors;\n return map(es, function (e) {\n return 'Failed path: (' + e.path.join(' > ') + ')\\n' + e.getErrorInfo();\n });\n };\n\n var nu = function (path, getErrorInfo) {\n return SimpleResult.serror([{\n path: path,\n getErrorInfo: getErrorInfo\n }]);\n };\n var missingStrict = function (path, key, obj) {\n return nu(path, function () {\n return 'Could not find valid *strict* value for \"' + key + '\" in ' + formatObj(obj);\n });\n };\n var missingKey = function (path, key) {\n return nu(path, function () {\n return 'Choice schema did not contain choice key: \"' + key + '\"';\n });\n };\n var missingBranch = function (path, branches, branch) {\n return nu(path, function () {\n return 'The chosen schema: \"' + branch + '\" did not exist in branches: ' + formatObj(branches);\n });\n };\n var unsupportedFields = function (path, unsupported) {\n return nu(path, function () {\n return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified';\n });\n };\n var custom = function (path, err) {\n return nu(path, function () {\n return err;\n });\n };\n\n var adt$1 = Adt.generate([\n {\n field: [\n 'key',\n 'okey',\n 'presence',\n 'prop'\n ]\n },\n {\n state: [\n 'okey',\n 'instantiator'\n ]\n }\n ]);\n var strictAccess = function (path, obj, key) {\n return get(obj, key).fold(function () {\n return missingStrict(path, key, obj);\n }, SimpleResult.svalue);\n };\n var fallbackAccess = function (obj, key, fallbackThunk) {\n var v = get(obj, key).fold(function () {\n return fallbackThunk(obj);\n }, identity);\n return SimpleResult.svalue(v);\n };\n var optionAccess = function (obj, key) {\n return SimpleResult.svalue(get(obj, key));\n };\n var optionDefaultedAccess = function (obj, key, fallback) {\n var opt = get(obj, key).map(function (val) {\n return val === true ? fallback(obj) : val;\n });\n return SimpleResult.svalue(opt);\n };\n var cExtractOne = function (path, obj, field, strength) {\n return field.fold(function (key, okey, presence, prop) {\n var bundle = function (av) {\n var result = prop.extract(path.concat([key]), strength, av);\n return SimpleResult.map(result, function (res) {\n return wrap(okey, strength(res));\n });\n };\n var bundleAsOption = function (optValue) {\n return optValue.fold(function () {\n var outcome = wrap(okey, strength(Option.none()));\n return SimpleResult.svalue(outcome);\n }, function (ov) {\n var result = prop.extract(path.concat([key]), strength, ov);\n return SimpleResult.map(result, function (res) {\n return wrap(okey, strength(Option.some(res)));\n });\n });\n };\n return function () {\n return presence.fold(function () {\n return SimpleResult.bind(strictAccess(path, obj, key), bundle);\n }, function (fallbackThunk) {\n return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle);\n }, function () {\n return SimpleResult.bind(optionAccess(obj, key), bundleAsOption);\n }, function (fallbackThunk) {\n return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption);\n }, function (baseThunk) {\n var base = baseThunk(obj);\n var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) {\n return deepMerge(base, v);\n });\n return SimpleResult.bind(result, bundle);\n });\n }();\n }, function (okey, instantiator) {\n var state = instantiator(obj);\n return SimpleResult.svalue(wrap(okey, strength(state)));\n });\n };\n var cExtract = function (path, obj, fields, strength) {\n var results = map(fields, function (field) {\n return cExtractOne(path, obj, field, strength);\n });\n return ResultCombine.consolidateObj(results, {});\n };\n var valueThunk = function (getDelegate) {\n var extract = function (path, strength, val) {\n return getDelegate().extract(path, strength, val);\n };\n var toString = function () {\n return getDelegate().toString();\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var value$1 = function (validator) {\n var extract = function (path, strength, val) {\n return SimpleResult.bindError(validator(val, strength), function (err) {\n return custom(path, err);\n });\n };\n var toString = function () {\n return 'val';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var getSetKeys = function (obj) {\n return keys(filter$1(obj, function (value) {\n return value !== undefined && value !== null;\n }));\n };\n var objOfOnly = function (fields) {\n var delegate = objOf(fields);\n var fieldNames = foldr(fields, function (acc, f) {\n return f.fold(function (key) {\n return deepMerge(acc, wrap$1(key, true));\n }, constant(acc));\n }, {});\n var extract = function (path, strength, o) {\n var keys = isBoolean(o) ? [] : getSetKeys(o);\n var extra = filter(keys, function (k) {\n return !hasNonNullableKey(fieldNames, k);\n });\n return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra);\n };\n return {\n extract: extract,\n toString: delegate.toString\n };\n };\n var objOf = function (fields) {\n var extract = function (path, strength, o) {\n return cExtract(path, o, fields, strength);\n };\n var toString = function () {\n var fieldStrings = map(fields, function (field) {\n return field.fold(function (key, okey, presence, prop) {\n return key + ' -> ' + prop.toString();\n }, function (okey, _instantiator) {\n return 'state(' + okey + ')';\n });\n });\n return 'obj{\\n' + fieldStrings.join('\\n') + '}';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var arrOf = function (prop) {\n var extract = function (path, strength, array) {\n var results = map(array, function (a, i) {\n return prop.extract(path.concat(['[' + i + ']']), strength, a);\n });\n return ResultCombine.consolidateArr(results);\n };\n var toString = function () {\n return 'array(' + prop.toString() + ')';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var oneOf = function (props) {\n var extract = function (path, strength, val) {\n var errors = [];\n for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {\n var prop = props_1[_i];\n var res = prop.extract(path, strength, val);\n if (res.stype === SimpleResultType.Value) {\n return res;\n }\n errors.push(res);\n }\n return ResultCombine.consolidateArr(errors);\n };\n var toString = function () {\n return 'oneOf(' + map(props, function (prop) {\n return prop.toString();\n }).join(', ') + ')';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var setOf = function (validator, prop) {\n var validateKeys = function (path, keys) {\n return arrOf(value$1(validator)).extract(path, identity, keys);\n };\n var extract = function (path, strength, o) {\n var keys$1 = keys(o);\n var validatedKeys = validateKeys(path, keys$1);\n return SimpleResult.bind(validatedKeys, function (validKeys) {\n var schema = map(validKeys, function (vk) {\n return adt$1.field(vk, vk, strict(), prop);\n });\n return objOf(schema).extract(path, strength, o);\n });\n };\n var toString = function () {\n return 'setOf(' + prop.toString() + ')';\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n var anyValue = constant(value$1(SimpleResult.svalue));\n var arrOfObj = compose(arrOf, objOf);\n var state = adt$1.state;\n var field = adt$1.field;\n\n var chooseFrom = function (path, strength, input, branches, ch) {\n var fields = get(branches, ch);\n return fields.fold(function () {\n return missingBranch(path, branches, ch);\n }, function (vp) {\n return vp.extract(path.concat(['branch: ' + ch]), strength, input);\n });\n };\n var choose = function (key, branches) {\n var extract = function (path, strength, input) {\n var choice = get(input, key);\n return choice.fold(function () {\n return missingKey(path, key);\n }, function (chosen) {\n return chooseFrom(path, strength, input, branches, chosen);\n });\n };\n var toString = function () {\n return 'chooseOn(' + key + '). Possible values: ' + keys(branches);\n };\n return {\n extract: extract,\n toString: toString\n };\n };\n\n var _anyValue = value$1(SimpleResult.svalue);\n var arrOfObj$1 = function (objFields) {\n return arrOfObj(objFields);\n };\n var arrOfVal = function () {\n return arrOf(_anyValue);\n };\n var valueThunkOf = valueThunk;\n var valueOf = function (validator) {\n return value$1(function (v) {\n return validator(v).fold(SimpleResult.serror, SimpleResult.svalue);\n });\n };\n var setOf$1 = function (validator, prop) {\n return setOf(function (v) {\n return SimpleResult.fromResult(validator(v));\n }, prop);\n };\n var extract = function (label, prop, strength, obj) {\n var res = prop.extract([label], strength, obj);\n return SimpleResult.mapError(res, function (errs) {\n return {\n input: obj,\n errors: errs\n };\n });\n };\n var asRaw = function (label, prop, obj) {\n return SimpleResult.toResult(extract(label, prop, identity, obj));\n };\n var getOrDie = function (extraction) {\n return extraction.fold(function (errInfo) {\n throw new Error(formatError(errInfo));\n }, identity);\n };\n var asRawOrDie = function (label, prop, obj) {\n return getOrDie(asRaw(label, prop, obj));\n };\n var formatError = function (errInfo) {\n return 'Errors: \\n' + formatErrors(errInfo.errors).join('\\n') + '\\n\\nInput object: ' + formatObj(errInfo.input);\n };\n var chooseProcessor = function (key, branches) {\n return choose(key, branches);\n };\n var choose$1 = function (key, branches) {\n return choose(key, map$2(branches, objOf));\n };\n var anyValue$1 = constant(_anyValue);\n var typedValue = function (validator, expectedType) {\n return value$1(function (a) {\n var actualType = typeof a;\n return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType);\n });\n };\n var number = typedValue(isNumber, 'number');\n var string = typedValue(isString, 'string');\n var boolean = typedValue(isBoolean, 'boolean');\n var functionProcessor = typedValue(isFunction, 'function');\n var isPostMessageable = function (val) {\n var every = function (iter, callbackFn) {\n var result = iter.next();\n while (!result.done) {\n if (!callbackFn(result.value)) {\n return false;\n }\n result = iter.next();\n }\n return true;\n };\n if (Object(val) !== val) {\n return true;\n }\n switch ({}.toString.call(val).slice(8, -1)) {\n case 'Boolean':\n case 'Number':\n case 'String':\n case 'Date':\n case 'RegExp':\n case 'Blob':\n case 'FileList':\n case 'ImageData':\n case 'ImageBitmap':\n case 'ArrayBuffer':\n return true;\n case 'Array':\n case 'Object':\n return Object.keys(val).every(function (prop) {\n return isPostMessageable(val[prop]);\n });\n case 'Map':\n return every(val.keys(), isPostMessageable) && every(val.values(), isPostMessageable);\n case 'Set':\n return every(val.keys(), isPostMessageable);\n default:\n return false;\n }\n };\n var postMessageable = value$1(function (a) {\n return isPostMessageable(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected value to be acceptable for sending via postMessage');\n });\n\n var validateEnum = function (values) {\n return valueOf(function (value) {\n return contains(values, value) ? Result.value(value) : Result.error('Unsupported value: \"' + value + '\", choose one of \"' + values.join(', ') + '\".');\n });\n };\n var strict$1 = function (key) {\n return field(key, key, strict(), anyValue());\n };\n var strictOf = function (key, schema) {\n return field(key, key, strict(), schema);\n };\n var strictNumber = function (key) {\n return strictOf(key, number);\n };\n var strictString = function (key) {\n return strictOf(key, string);\n };\n var strictStringEnum = function (key, values) {\n return field(key, key, strict(), validateEnum(values));\n };\n var strictBoolean = function (key) {\n return strictOf(key, boolean);\n };\n var strictFunction = function (key) {\n return strictOf(key, functionProcessor);\n };\n var forbid = function (key, message) {\n return field(key, key, asOption(), value$1(function (_v) {\n return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message);\n }));\n };\n var strictObjOf = function (key, objSchema) {\n return field(key, key, strict(), objOf(objSchema));\n };\n var strictArrayOfObj = function (key, objFields) {\n return field(key, key, strict(), arrOfObj(objFields));\n };\n var strictArrayOf = function (key, schema) {\n return field(key, key, strict(), arrOf(schema));\n };\n var option = function (key) {\n return field(key, key, asOption(), anyValue());\n };\n var optionOf = function (key, schema) {\n return field(key, key, asOption(), schema);\n };\n var optionNumber = function (key) {\n return optionOf(key, number);\n };\n var optionString = function (key) {\n return optionOf(key, string);\n };\n var optionFunction = function (key) {\n return optionOf(key, functionProcessor);\n };\n var optionArrayOf = function (key, schema) {\n return optionOf(key, arrOf(schema));\n };\n var optionObjOf = function (key, objSchema) {\n return optionOf(key, objOf(objSchema));\n };\n var optionObjOfOnly = function (key, objSchema) {\n return optionOf(key, objOfOnly(objSchema));\n };\n var defaulted$1 = function (key, fallback) {\n return field(key, key, defaulted(fallback), anyValue());\n };\n var defaultedOf = function (key, fallback, schema) {\n return field(key, key, defaulted(fallback), schema);\n };\n var defaultedNumber = function (key, fallback) {\n return defaultedOf(key, fallback, number);\n };\n var defaultedString = function (key, fallback) {\n return defaultedOf(key, fallback, string);\n };\n var defaultedStringEnum = function (key, fallback, values) {\n return defaultedOf(key, fallback, validateEnum(values));\n };\n var defaultedBoolean = function (key, fallback) {\n return defaultedOf(key, fallback, boolean);\n };\n var defaultedFunction = function (key, fallback) {\n return defaultedOf(key, fallback, functionProcessor);\n };\n var defaultedPostMsg = function (key, fallback) {\n return defaultedOf(key, fallback, postMessageable);\n };\n var defaultedArrayOf = function (key, fallback, schema) {\n return defaultedOf(key, fallback, arrOf(schema));\n };\n var defaultedObjOf = function (key, fallback, objSchema) {\n return defaultedOf(key, fallback, objOf(objSchema));\n };\n var state$1 = function (okey, instantiator) {\n return state(okey, instantiator);\n };\n\n var Cell = function (initial) {\n var value = initial;\n var get = function () {\n return value;\n };\n var set = function (v) {\n value = v;\n };\n return {\n get: get,\n set: set\n };\n };\n\n var fromHtml = function (html, scope) {\n var doc = scope || domGlobals.document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n if (!div.hasChildNodes() || div.childNodes.length > 1) {\n domGlobals.console.error('HTML does not have a single root node', html);\n throw new Error('HTML must have a single root node');\n }\n return fromDom(div.childNodes[0]);\n };\n var fromTag = function (tag, scope) {\n var doc = scope || domGlobals.document;\n var node = doc.createElement(tag);\n return fromDom(node);\n };\n var fromText = function (text, scope) {\n var doc = scope || domGlobals.document;\n var node = doc.createTextNode(text);\n return fromDom(node);\n };\n var fromDom = function (node) {\n if (node === null || node === undefined) {\n throw new Error('Node cannot be null or undefined');\n }\n return { dom: constant(node) };\n };\n var fromPoint = function (docElm, x, y) {\n var doc = docElm.dom();\n return Option.from(doc.elementFromPoint(x, y)).map(fromDom);\n };\n var Element = {\n fromHtml: fromHtml,\n fromTag: fromTag,\n fromText: fromText,\n fromDom: fromDom,\n fromPoint: fromPoint\n };\n\n var compareDocumentPosition = function (a, b, match) {\n return (a.compareDocumentPosition(b) & match) !== 0;\n };\n var documentPositionContainedBy = function (a, b) {\n return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY);\n };\n\n var firstMatch = function (regexes, s) {\n for (var i = 0; i < regexes.length; i++) {\n var x = regexes[i];\n if (x.test(s)) {\n return x;\n }\n }\n return undefined;\n };\n var find$2 = function (regexes, agent) {\n var r = firstMatch(regexes, agent);\n if (!r) {\n return {\n major: 0,\n minor: 0\n };\n }\n var group = function (i) {\n return Number(agent.replace(r, '$' + i));\n };\n return nu$1(group(1), group(2));\n };\n var detect = function (versionRegexes, agent) {\n var cleanedAgent = String(agent).toLowerCase();\n if (versionRegexes.length === 0) {\n return unknown();\n }\n return find$2(versionRegexes, cleanedAgent);\n };\n var unknown = function () {\n return nu$1(0, 0);\n };\n var nu$1 = function (major, minor) {\n return {\n major: major,\n minor: minor\n };\n };\n var Version = {\n nu: nu$1,\n detect: detect,\n unknown: unknown\n };\n\n var edge = 'Edge';\n var chrome = 'Chrome';\n var ie = 'IE';\n var opera = 'Opera';\n var firefox = 'Firefox';\n var safari = 'Safari';\n var unknown$1 = function () {\n return nu$2({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu$2 = function (info) {\n var current = info.current;\n var version = info.version;\n var isBrowser = function (name) {\n return function () {\n return current === name;\n };\n };\n return {\n current: current,\n version: version,\n isEdge: isBrowser(edge),\n isChrome: isBrowser(chrome),\n isIE: isBrowser(ie),\n isOpera: isBrowser(opera),\n isFirefox: isBrowser(firefox),\n isSafari: isBrowser(safari)\n };\n };\n var Browser = {\n unknown: unknown$1,\n nu: nu$2,\n edge: constant(edge),\n chrome: constant(chrome),\n ie: constant(ie),\n opera: constant(opera),\n firefox: constant(firefox),\n safari: constant(safari)\n };\n\n var windows = 'Windows';\n var ios = 'iOS';\n var android = 'Android';\n var linux = 'Linux';\n var osx = 'OSX';\n var solaris = 'Solaris';\n var freebsd = 'FreeBSD';\n var chromeos = 'ChromeOS';\n var unknown$2 = function () {\n return nu$3({\n current: undefined,\n version: Version.unknown()\n });\n };\n var nu$3 = function (info) {\n var current = info.current;\n var version = info.version;\n var isOS = function (name) {\n return function () {\n return current === name;\n };\n };\n return {\n current: current,\n version: version,\n isWindows: isOS(windows),\n isiOS: isOS(ios),\n isAndroid: isOS(android),\n isOSX: isOS(osx),\n isLinux: isOS(linux),\n isSolaris: isOS(solaris),\n isFreeBSD: isOS(freebsd),\n isChromeOS: isOS(chromeos)\n };\n };\n var OperatingSystem = {\n unknown: unknown$2,\n nu: nu$3,\n windows: constant(windows),\n ios: constant(ios),\n android: constant(android),\n linux: constant(linux),\n osx: constant(osx),\n solaris: constant(solaris),\n freebsd: constant(freebsd),\n chromeos: constant(chromeos)\n };\n\n var DeviceType = function (os, browser, userAgent, mediaMatch) {\n var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;\n var isiPhone = os.isiOS() && !isiPad;\n var isMobile = os.isiOS() || os.isAndroid();\n var isTouch = isMobile || mediaMatch('(pointer:coarse)');\n var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');\n var isPhone = isiPhone || isMobile && !isTablet;\n var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;\n var isDesktop = !isPhone && !isTablet && !iOSwebview;\n return {\n isiPad: constant(isiPad),\n isiPhone: constant(isiPhone),\n isTablet: constant(isTablet),\n isPhone: constant(isPhone),\n isTouch: constant(isTouch),\n isAndroid: os.isAndroid,\n isiOS: os.isiOS,\n isWebView: constant(iOSwebview),\n isDesktop: constant(isDesktop)\n };\n };\n\n var detect$1 = function (candidates, userAgent) {\n var agent = String(userAgent).toLowerCase();\n return find(candidates, function (candidate) {\n return candidate.search(agent);\n });\n };\n var detectBrowser = function (browsers, userAgent) {\n return detect$1(browsers, userAgent).map(function (browser) {\n var version = Version.detect(browser.versionRegexes, userAgent);\n return {\n current: browser.name,\n version: version\n };\n });\n };\n var detectOs = function (oses, userAgent) {\n return detect$1(oses, userAgent).map(function (os) {\n var version = Version.detect(os.versionRegexes, userAgent);\n return {\n current: os.name,\n version: version\n };\n });\n };\n var UaString = {\n detectBrowser: detectBrowser,\n detectOs: detectOs\n };\n\n var checkRange = function (str, substr, start) {\n return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;\n };\n var contains$1 = function (str, substr) {\n return str.indexOf(substr) !== -1;\n };\n var endsWith = function (str, suffix) {\n return checkRange(str, suffix, str.length - suffix.length);\n };\n var blank = function (r) {\n return function (s) {\n return s.replace(r, '');\n };\n };\n var trim = blank(/^\\s+|\\s+$/g);\n\n var normalVersionRegex = /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/;\n var checkContains = function (target) {\n return function (uastring) {\n return contains$1(uastring, target);\n };\n };\n var browsers = [\n {\n name: 'Edge',\n versionRegexes: [/.*?edge\\/ ?([0-9]+)\\.([0-9]+)$/],\n search: function (uastring) {\n return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');\n }\n },\n {\n name: 'Chrome',\n versionRegexes: [\n /.*?chrome\\/([0-9]+)\\.([0-9]+).*/,\n normalVersionRegex\n ],\n search: function (uastring) {\n return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');\n }\n },\n {\n name: 'IE',\n versionRegexes: [\n /.*?msie\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*?rv:([0-9]+)\\.([0-9]+).*/\n ],\n search: function (uastring) {\n return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');\n }\n },\n {\n name: 'Opera',\n versionRegexes: [\n normalVersionRegex,\n /.*?opera\\/([0-9]+)\\.([0-9]+).*/\n ],\n search: checkContains('opera')\n },\n {\n name: 'Firefox',\n versionRegexes: [/.*?firefox\\/\\ ?([0-9]+)\\.([0-9]+).*/],\n search: checkContains('firefox')\n },\n {\n name: 'Safari',\n versionRegexes: [\n normalVersionRegex,\n /.*?cpu os ([0-9]+)_([0-9]+).*/\n ],\n search: function (uastring) {\n return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');\n }\n }\n ];\n var oses = [\n {\n name: 'Windows',\n search: checkContains('win'),\n versionRegexes: [/.*?windows\\ nt\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'iOS',\n search: function (uastring) {\n return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');\n },\n versionRegexes: [\n /.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/,\n /.*cpu os ([0-9]+)_([0-9]+).*/,\n /.*cpu iphone os ([0-9]+)_([0-9]+).*/\n ]\n },\n {\n name: 'Android',\n search: checkContains('android'),\n versionRegexes: [/.*?android\\ ?([0-9]+)\\.([0-9]+).*/]\n },\n {\n name: 'OSX',\n search: checkContains('mac os x'),\n versionRegexes: [/.*?mac\\ os\\ x\\ ?([0-9]+)_([0-9]+).*/]\n },\n {\n name: 'Linux',\n search: checkContains('linux'),\n versionRegexes: []\n },\n {\n name: 'Solaris',\n search: checkContains('sunos'),\n versionRegexes: []\n },\n {\n name: 'FreeBSD',\n search: checkContains('freebsd'),\n versionRegexes: []\n },\n {\n name: 'ChromeOS',\n search: checkContains('cros'),\n versionRegexes: [/.*?chrome\\/([0-9]+)\\.([0-9]+).*/]\n }\n ];\n var PlatformInfo = {\n browsers: constant(browsers),\n oses: constant(oses)\n };\n\n var detect$2 = function (userAgent, mediaMatch) {\n var browsers = PlatformInfo.browsers();\n var oses = PlatformInfo.oses();\n var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);\n var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);\n var deviceType = DeviceType(os, browser, userAgent, mediaMatch);\n return {\n browser: browser,\n os: os,\n deviceType: deviceType\n };\n };\n var PlatformDetection = { detect: detect$2 };\n\n var mediaMatch = function (query) {\n return domGlobals.window.matchMedia(query).matches;\n };\n var platform = cached(function () {\n return PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch);\n });\n var detect$3 = function () {\n return platform();\n };\n\n var DOCUMENT = 9;\n var DOCUMENT_FRAGMENT = 11;\n var ELEMENT = 1;\n var TEXT = 3;\n\n var is = function (element, selector) {\n var dom = element.dom();\n if (dom.nodeType !== ELEMENT) {\n return false;\n } else {\n var elem = dom;\n if (elem.matches !== undefined) {\n return elem.matches(selector);\n } else if (elem.msMatchesSelector !== undefined) {\n return elem.msMatchesSelector(selector);\n } else if (elem.webkitMatchesSelector !== undefined) {\n return elem.webkitMatchesSelector(selector);\n } else if (elem.mozMatchesSelector !== undefined) {\n return elem.mozMatchesSelector(selector);\n } else {\n throw new Error('Browser lacks native selectors');\n }\n }\n };\n var bypassSelector = function (dom) {\n return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;\n };\n var all = function (selector, scope) {\n var base = scope === undefined ? domGlobals.document : scope.dom();\n return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom);\n };\n var one = function (selector, scope) {\n var base = scope === undefined ? domGlobals.document : scope.dom();\n return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.fromDom);\n };\n\n var eq$1 = function (e1, e2) {\n return e1.dom() === e2.dom();\n };\n var regularContains = function (e1, e2) {\n var d1 = e1.dom();\n var d2 = e2.dom();\n return d1 === d2 ? false : d1.contains(d2);\n };\n var ieContains = function (e1, e2) {\n return documentPositionContainedBy(e1.dom(), e2.dom());\n };\n var contains$2 = function (e1, e2) {\n return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2);\n };\n\n var ensureIsRoot = function (isRoot) {\n return isFunction(isRoot) ? isRoot : constant(false);\n };\n var ancestor = function (scope, transform, isRoot) {\n var element = scope.dom();\n var stop = ensureIsRoot(isRoot);\n while (element.parentNode) {\n element = element.parentNode;\n var el = Element.fromDom(element);\n var transformed = transform(el);\n if (transformed.isSome()) {\n return transformed;\n } else if (stop(el)) {\n break;\n }\n }\n return Option.none();\n };\n var closest = function (scope, transform, isRoot) {\n var current = transform(scope);\n var stop = ensureIsRoot(isRoot);\n return current.orThunk(function () {\n return stop(scope) ? Option.none() : ancestor(scope, transform, stop);\n });\n };\n\n var isSource = function (component, simulatedEvent) {\n return eq$1(component.element(), simulatedEvent.event().target());\n };\n\n var nu$4 = function (parts) {\n if (!hasNonNullableKey(parts, 'can') && !hasNonNullableKey(parts, 'abort') && !hasNonNullableKey(parts, 'run')) {\n throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!');\n }\n return asRawOrDie('Extracting event.handler', objOfOnly([\n defaulted$1('can', constant(true)),\n defaulted$1('abort', constant(false)),\n defaulted$1('run', noop)\n ]), parts);\n };\n var all$1 = function (handlers, f) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return foldl(handlers, function (acc, handler) {\n return acc && f(handler).apply(undefined, args);\n }, true);\n };\n };\n var any = function (handlers, f) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return foldl(handlers, function (acc, handler) {\n return acc || f(handler).apply(undefined, args);\n }, false);\n };\n };\n var read = function (handler) {\n return isFunction(handler) ? {\n can: constant(true),\n abort: constant(false),\n run: handler\n } : handler;\n };\n var fuse = function (handlers) {\n var can = all$1(handlers, function (handler) {\n return handler.can;\n });\n var abort = any(handlers, function (handler) {\n return handler.abort;\n });\n var run = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n each(handlers, function (handler) {\n handler.run.apply(undefined, args);\n });\n };\n return nu$4({\n can: can,\n abort: abort,\n run: run\n });\n };\n\n var touchstart = constant('touchstart');\n var touchmove = constant('touchmove');\n var touchend = constant('touchend');\n var touchcancel = constant('touchcancel');\n var mousedown = constant('mousedown');\n var mousemove = constant('mousemove');\n var mouseout = constant('mouseout');\n var mouseup = constant('mouseup');\n var mouseover = constant('mouseover');\n var focusin = constant('focusin');\n var focusout = constant('focusout');\n var keydown = constant('keydown');\n var keyup = constant('keyup');\n var input = constant('input');\n var change = constant('change');\n var click = constant('click');\n var transitionend = constant('transitionend');\n var selectstart = constant('selectstart');\n\n var alloy = { tap: constant('alloy.tap') };\n var focus = constant('alloy.focus');\n var postBlur = constant('alloy.blur.post');\n var postPaste = constant('alloy.paste.post');\n var receive = constant('alloy.receive');\n var execute = constant('alloy.execute');\n var focusItem = constant('alloy.focus.item');\n var tap = alloy.tap;\n var longpress = constant('alloy.longpress');\n var sandboxClose = constant('alloy.sandbox.close');\n var typeaheadCancel = constant('alloy.typeahead.cancel');\n var systemInit = constant('alloy.system.init');\n var documentTouchmove = constant('alloy.system.touchmove');\n var documentTouchend = constant('alloy.system.touchend');\n var windowScroll = constant('alloy.system.scroll');\n var windowResize = constant('alloy.system.resize');\n var attachedToDom = constant('alloy.system.attached');\n var detachedFromDom = constant('alloy.system.detached');\n var dismissRequested = constant('alloy.system.dismissRequested');\n var repositionRequested = constant('alloy.system.repositionRequested');\n var focusShifted = constant('alloy.focusmanager.shifted');\n var slotVisibility = constant('alloy.slotcontainer.visibility');\n var changeTab = constant('alloy.change.tab');\n var dismissTab = constant('alloy.dismiss.tab');\n var highlight = constant('alloy.highlight');\n var dehighlight = constant('alloy.dehighlight');\n\n var emit = function (component, event) {\n dispatchWith(component, component.element(), event, {});\n };\n var emitWith = function (component, event, properties) {\n dispatchWith(component, component.element(), event, properties);\n };\n var emitExecute = function (component) {\n emit(component, execute());\n };\n var dispatch = function (component, target, event) {\n dispatchWith(component, target, event, {});\n };\n var dispatchWith = function (component, target, event, properties) {\n var data = __assign({ target: target }, properties);\n component.getSystem().triggerEvent(event, target, map$2(data, constant));\n };\n var dispatchEvent = function (component, target, event, simulatedEvent) {\n component.getSystem().triggerEvent(event, target, simulatedEvent.event());\n };\n\n var derive = function (configs) {\n return wrapAll$1(configs);\n };\n var abort = function (name, predicate) {\n return {\n key: name,\n value: nu$4({ abort: predicate })\n };\n };\n var can = function (name, predicate) {\n return {\n key: name,\n value: nu$4({ can: predicate })\n };\n };\n var preventDefault = function (name) {\n return {\n key: name,\n value: nu$4({\n run: function (component, simulatedEvent) {\n simulatedEvent.event().prevent();\n }\n })\n };\n };\n var run = function (name, handler) {\n return {\n key: name,\n value: nu$4({ run: handler })\n };\n };\n var runActionExtra = function (name, action, extra) {\n return {\n key: name,\n value: nu$4({\n run: function (component, simulatedEvent) {\n action.apply(undefined, [\n component,\n simulatedEvent\n ].concat(extra));\n }\n })\n };\n };\n var runOnName = function (name) {\n return function (handler) {\n return run(name, handler);\n };\n };\n var runOnSourceName = function (name) {\n return function (handler) {\n return {\n key: name,\n value: nu$4({\n run: function (component, simulatedEvent) {\n if (isSource(component, simulatedEvent)) {\n handler(component, simulatedEvent);\n }\n }\n })\n };\n };\n };\n var redirectToUid = function (name, uid) {\n return run(name, function (component, simulatedEvent) {\n component.getSystem().getByUid(uid).each(function (redirectee) {\n dispatchEvent(redirectee, redirectee.element(), name, simulatedEvent);\n });\n });\n };\n var redirectToPart = function (name, detail, partName) {\n var uid = detail.partUids[partName];\n return redirectToUid(name, uid);\n };\n var runWithTarget = function (name, f) {\n return run(name, function (component, simulatedEvent) {\n var ev = simulatedEvent.event();\n var target = component.getSystem().getByDom(ev.target()).fold(function () {\n var closest$1 = closest(ev.target(), function (el) {\n return component.getSystem().getByDom(el).toOption();\n }, constant(false));\n return closest$1.getOr(component);\n }, function (c) {\n return c;\n });\n f(component, target, simulatedEvent);\n });\n };\n var cutter = function (name) {\n return run(name, function (component, simulatedEvent) {\n simulatedEvent.cut();\n });\n };\n var stopper = function (name) {\n return run(name, function (component, simulatedEvent) {\n simulatedEvent.stop();\n });\n };\n var runOnSource = function (name, f) {\n return runOnSourceName(name)(f);\n };\n var runOnAttached = runOnSourceName(attachedToDom());\n var runOnDetached = runOnSourceName(detachedFromDom());\n var runOnInit = runOnSourceName(systemInit());\n var runOnExecute = runOnName(execute());\n\n var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')();\n\n var name = function (element) {\n var r = element.dom().nodeName;\n return r.toLowerCase();\n };\n var type = function (element) {\n return element.dom().nodeType;\n };\n var isType$1 = function (t) {\n return function (element) {\n return type(element) === t;\n };\n };\n var isElement = isType$1(ELEMENT);\n var isText = isType$1(TEXT);\n var isDocument = isType$1(DOCUMENT);\n var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT);\n\n var owner = function (element) {\n return Element.fromDom(element.dom().ownerDocument);\n };\n var documentOrOwner = function (dos) {\n return isDocument(dos) ? dos : owner(dos);\n };\n var documentElement = function (element) {\n return Element.fromDom(element.dom().ownerDocument.documentElement);\n };\n var defaultView = function (element) {\n return Element.fromDom(element.dom().ownerDocument.defaultView);\n };\n var parent = function (element) {\n return Option.from(element.dom().parentNode).map(Element.fromDom);\n };\n var offsetParent = function (element) {\n return Option.from(element.dom().offsetParent).map(Element.fromDom);\n };\n var nextSibling = function (element) {\n return Option.from(element.dom().nextSibling).map(Element.fromDom);\n };\n var children = function (element) {\n return map(element.dom().childNodes, Element.fromDom);\n };\n var child = function (element, index) {\n var cs = element.dom().childNodes;\n return Option.from(cs[index]).map(Element.fromDom);\n };\n var firstChild = function (element) {\n return child(element, 0);\n };\n\n var before = function (marker, element) {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n v.dom().insertBefore(element.dom(), marker.dom());\n });\n };\n var after = function (marker, element) {\n var sibling = nextSibling(marker);\n sibling.fold(function () {\n var parent$1 = parent(marker);\n parent$1.each(function (v) {\n append(v, element);\n });\n }, function (v) {\n before(v, element);\n });\n };\n var prepend = function (parent, element) {\n var firstChild$1 = firstChild(parent);\n firstChild$1.fold(function () {\n append(parent, element);\n }, function (v) {\n parent.dom().insertBefore(element.dom(), v.dom());\n });\n };\n var append = function (parent, element) {\n parent.dom().appendChild(element.dom());\n };\n var appendAt = function (parent, element, index) {\n child(parent, index).fold(function () {\n append(parent, element);\n }, function (v) {\n before(v, element);\n });\n };\n\n var before$1 = function (marker, elements) {\n each(elements, function (x) {\n before(marker, x);\n });\n };\n var append$1 = function (parent, elements) {\n each(elements, function (x) {\n append(parent, x);\n });\n };\n\n var empty = function (element) {\n element.dom().textContent = '';\n each(children(element), function (rogue) {\n remove(rogue);\n });\n };\n var remove = function (element) {\n var dom = element.dom();\n if (dom.parentNode !== null) {\n dom.parentNode.removeChild(dom);\n }\n };\n var unwrap = function (wrapper) {\n var children$1 = children(wrapper);\n if (children$1.length > 0) {\n before$1(wrapper, children$1);\n }\n remove(wrapper);\n };\n\n var fromHtml$1 = function (html, scope) {\n var doc = scope || domGlobals.document;\n var div = doc.createElement('div');\n div.innerHTML = html;\n return children(Element.fromDom(div));\n };\n\n var get$1 = function (element) {\n return element.dom().innerHTML;\n };\n var set = function (element, content) {\n var owner$1 = owner(element);\n var docDom = owner$1.dom();\n var fragment = Element.fromDom(docDom.createDocumentFragment());\n var contentElements = fromHtml$1(content, docDom);\n append$1(fragment, contentElements);\n empty(element);\n append(element, fragment);\n };\n var getOuter = function (element) {\n var container = Element.fromTag('div');\n var clone = Element.fromDom(element.dom().cloneNode(true));\n append(container, clone);\n return get$1(container);\n };\n\n var rawSet = function (dom, key, value) {\n if (isString(value) || isBoolean(value) || isNumber(value)) {\n dom.setAttribute(key, value + '');\n } else {\n domGlobals.console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom);\n throw new Error('Attribute value was not simple');\n }\n };\n var set$1 = function (element, key, value) {\n rawSet(element.dom(), key, value);\n };\n var setAll = function (element, attrs) {\n var dom = element.dom();\n each$1(attrs, function (v, k) {\n rawSet(dom, k, v);\n });\n };\n var get$2 = function (element, key) {\n var v = element.dom().getAttribute(key);\n return v === null ? undefined : v;\n };\n var getOpt = function (element, key) {\n return Option.from(get$2(element, key));\n };\n var has$1 = function (element, key) {\n var dom = element.dom();\n return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;\n };\n var remove$1 = function (element, key) {\n element.dom().removeAttribute(key);\n };\n\n var clone = function (original, isDeep) {\n return Element.fromDom(original.dom().cloneNode(isDeep));\n };\n var shallow$1 = function (original) {\n return clone(original, false);\n };\n\n var getHtml = function (element) {\n var clone = shallow$1(element);\n return getOuter(clone);\n };\n\n var element = function (elem) {\n return getHtml(elem);\n };\n\n var isRecursive = function (component, originator, target) {\n return eq$1(originator, component.element()) && !eq$1(originator, target);\n };\n var events = derive([can(focus(), function (component, simulatedEvent) {\n var originator = simulatedEvent.event().originator();\n var target = simulatedEvent.event().target();\n if (isRecursive(component, originator, target)) {\n domGlobals.console.warn(focus() + ' did not get interpreted by the desired target. ' + '\\nOriginator: ' + element(originator) + '\\nTarget: ' + element(target) + '\\nCheck the ' + focus() + ' event handlers');\n return false;\n } else {\n return true;\n }\n })]);\n\n var DefaultEvents = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events\n });\n\n var unique = 0;\n var generate$1 = function (prefix) {\n var date = new Date();\n var time = date.getTime();\n var random = Math.floor(Math.random() * 1000000000);\n unique++;\n return prefix + '_' + random + unique + String(time);\n };\n\n var prefix = constant('alloy-id-');\n var idAttr = constant('data-alloy-id');\n\n var prefix$1 = prefix();\n var idAttr$1 = idAttr();\n var write = function (label, elem) {\n var id = generate$1(prefix$1 + label);\n writeOnly(elem, id);\n return id;\n };\n var writeOnly = function (elem, uid) {\n Object.defineProperty(elem.dom(), idAttr$1, {\n value: uid,\n writable: true\n });\n };\n var read$1 = function (elem) {\n var id = isElement(elem) ? elem.dom()[idAttr$1] : null;\n return Option.from(id);\n };\n var generate$2 = function (prefix) {\n return generate$1(prefix);\n };\n\n var make = identity;\n\n var NoContextApi = function (getComp) {\n var fail = function (event) {\n return function () {\n throw new Error('The component must be in a context to send: ' + event + (getComp ? '\\n' + element(getComp().element()) + ' is not in context.' : ''));\n };\n };\n return {\n debugInfo: constant('fake'),\n triggerEvent: fail('triggerEvent'),\n triggerFocus: fail('triggerFocus'),\n triggerEscape: fail('triggerEscape'),\n build: fail('build'),\n addToWorld: fail('addToWorld'),\n removeFromWorld: fail('removeFromWorld'),\n addToGui: fail('addToGui'),\n removeFromGui: fail('removeFromGui'),\n getByUid: fail('getByUid'),\n getByDom: fail('getByDom'),\n broadcast: fail('broadcast'),\n broadcastOn: fail('broadcastOn'),\n broadcastEvent: fail('broadcastEvent'),\n isConnected: constant(false)\n };\n };\n var singleton = NoContextApi();\n\n var markAsBehaviourApi = function (f, apiName, apiFunction) {\n var delegate = apiFunction.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: apiName,\n parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3)))\n };\n };\n return f;\n };\n var cleanParameters = function (parameters) {\n return map(parameters, function (p) {\n return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p;\n });\n };\n var markAsExtraApi = function (f, extraName) {\n var delegate = f.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: extraName,\n parameters: cleanParameters(parameters)\n };\n };\n return f;\n };\n var markAsSketchApi = function (f, apiFunction) {\n var delegate = apiFunction.toString();\n var endIndex = delegate.indexOf(')') + 1;\n var openBracketIndex = delegate.indexOf('(');\n var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\\s*/);\n f.toFunctionAnnotation = function () {\n return {\n name: 'OVERRIDE',\n parameters: cleanParameters(parameters.slice(1))\n };\n };\n return f;\n };\n\n var premadeTag = generate$1('alloy-premade');\n var premade = function (comp) {\n return wrap$1(premadeTag, comp);\n };\n var getPremade = function (spec) {\n return get(spec, premadeTag);\n };\n var makeApi = function (f) {\n return markAsSketchApi(function (component) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n return f.apply(void 0, __spreadArrays([\n component.getApis(),\n component\n ], rest));\n }, f);\n };\n\n var NoState = {\n init: function () {\n return nu$5({\n readState: function () {\n return 'No State required';\n }\n });\n }\n };\n var nu$5 = function (spec) {\n return spec;\n };\n\n var generateFrom = function (spec, all) {\n var schema = map(all, function (a) {\n return optionObjOf(a.name(), [\n strict$1('config'),\n defaulted$1('state', NoState)\n ]);\n });\n var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) {\n throw new Error(formatError(errInfo) + '\\nComplete spec:\\n' + JSON.stringify(spec, null, 2));\n }, function (v) {\n return v;\n });\n return {\n list: all,\n data: map$2(validated, function (optBlobThunk) {\n var output = optBlobThunk.map(function (blob) {\n return {\n config: blob.config,\n state: blob.state.init(blob.config)\n };\n });\n return function () {\n return output;\n };\n })\n };\n };\n var getBehaviours = function (bData) {\n return bData.list;\n };\n var getData = function (bData) {\n return bData.data;\n };\n\n var byInnerKey = function (data, tuple) {\n var r = {};\n each$1(data, function (detail, key) {\n each$1(detail, function (value, indexKey) {\n var chain = get(r, indexKey).getOr([]);\n r[indexKey] = chain.concat([tuple(key, value)]);\n });\n });\n return r;\n };\n\n var nu$6 = function (s) {\n return {\n classes: s.classes !== undefined ? s.classes : [],\n attributes: s.attributes !== undefined ? s.attributes : {},\n styles: s.styles !== undefined ? s.styles : {}\n };\n };\n var merge$1 = function (defnA, mod) {\n return __assign(__assign({}, defnA), {\n attributes: __assign(__assign({}, defnA.attributes), mod.attributes),\n styles: __assign(__assign({}, defnA.styles), mod.styles),\n classes: defnA.classes.concat(mod.classes)\n });\n };\n\n var combine = function (info, baseMod, behaviours, base) {\n var modsByBehaviour = __assign({}, baseMod);\n each(behaviours, function (behaviour) {\n modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base);\n });\n var byAspect = byInnerKey(modsByBehaviour, function (name, modification) {\n return {\n name: name,\n modification: modification\n };\n });\n var combineObjects = function (objects) {\n return foldr(objects, function (b, a) {\n return __assign(__assign({}, a.modification), b);\n }, {});\n };\n var combinedClasses = foldr(byAspect.classes, function (b, a) {\n return a.modification.concat(b);\n }, []);\n var combinedAttributes = combineObjects(byAspect.attributes);\n var combinedStyles = combineObjects(byAspect.styles);\n return nu$6({\n classes: combinedClasses,\n attributes: combinedAttributes,\n styles: combinedStyles\n });\n };\n\n var sortKeys = function (label, keyName, array, order) {\n try {\n var sorted = sort(array, function (a, b) {\n var aKey = a[keyName]();\n var bKey = b[keyName]();\n var aIndex = order.indexOf(aKey);\n var bIndex = order.indexOf(bKey);\n if (aIndex === -1) {\n throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\\nOrder specified: ' + JSON.stringify(order, null, 2));\n }\n if (bIndex === -1) {\n throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\\nOrder specified: ' + JSON.stringify(order, null, 2));\n }\n if (aIndex < bIndex) {\n return -1;\n } else if (bIndex < aIndex) {\n return 1;\n } else {\n return 0;\n }\n });\n return Result.value(sorted);\n } catch (err) {\n return Result.error([err]);\n }\n };\n\n var uncurried = function (handler, purpose) {\n return {\n handler: handler,\n purpose: constant(purpose)\n };\n };\n var curried = function (handler, purpose) {\n return {\n cHandler: handler,\n purpose: constant(purpose)\n };\n };\n var curryArgs = function (descHandler, extraArgs) {\n return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose());\n };\n var getCurried = function (descHandler) {\n return descHandler.cHandler;\n };\n\n var behaviourTuple = function (name, handler) {\n return {\n name: constant(name),\n handler: constant(handler)\n };\n };\n var nameToHandlers = function (behaviours, info) {\n var r = {};\n each(behaviours, function (behaviour) {\n r[behaviour.name()] = behaviour.handlers(info);\n });\n return r;\n };\n var groupByEvents = function (info, behaviours, base) {\n var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info));\n return byInnerKey(behaviourEvents, behaviourTuple);\n };\n var combine$1 = function (info, eventOrder, behaviours, base) {\n var byEventName = groupByEvents(info, behaviours, base);\n return combineGroups(byEventName, eventOrder);\n };\n var assemble = function (rawHandler) {\n var handler = read(rawHandler);\n return function (component, simulatedEvent) {\n var rest = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n rest[_i - 2] = arguments[_i];\n }\n var args = [\n component,\n simulatedEvent\n ].concat(rest);\n if (handler.abort.apply(undefined, args)) {\n simulatedEvent.stop();\n } else if (handler.can.apply(undefined, args)) {\n handler.run.apply(undefined, args);\n }\n };\n };\n var missingOrderError = function (eventName, tuples) {\n return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ \"listing\", \"toggling\" ]).\\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map(tuples, function (c) {\n return c.name();\n }), null, 2)]);\n };\n var fuse$1 = function (tuples, eventOrder, eventName) {\n var order = eventOrder[eventName];\n if (!order) {\n return missingOrderError(eventName, tuples);\n } else {\n return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) {\n var handlers = map(sortedTuples, function (tuple) {\n return tuple.handler();\n });\n return fuse(handlers);\n });\n }\n };\n var combineGroups = function (byEventName, eventOrder) {\n var r = mapToArray(byEventName, function (tuples, eventName) {\n var combined = tuples.length === 1 ? Result.value(tuples[0].handler()) : fuse$1(tuples, eventOrder, eventName);\n return combined.map(function (handler) {\n var assembled = assemble(handler);\n var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) {\n return exists(tuples, function (t) {\n return t.name() === o;\n });\n }).join(' > ') : tuples[0].name();\n return wrap$1(eventName, uncurried(assembled, purpose));\n });\n });\n return consolidate(r, {});\n };\n\n var toInfo = function (spec) {\n return asRaw('custom.definition', objOf([\n field('dom', 'dom', strict(), objOf([\n strict$1('tag'),\n defaulted$1('styles', {}),\n defaulted$1('classes', []),\n defaulted$1('attributes', {}),\n option('value'),\n option('innerHtml')\n ])),\n strict$1('components'),\n strict$1('uid'),\n defaulted$1('events', {}),\n defaulted$1('apis', {}),\n field('eventOrder', 'eventOrder', mergeWith({\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'toggling',\n 'typeaheadevents'\n ],\n 'alloy.focus': [\n 'alloy.base.behaviour',\n 'focusing',\n 'keying'\n ],\n 'alloy.system.init': [\n 'alloy.base.behaviour',\n 'disabling',\n 'toggling',\n 'representing'\n ],\n 'input': [\n 'alloy.base.behaviour',\n 'representing',\n 'streaming',\n 'invalidating'\n ],\n 'alloy.system.detached': [\n 'alloy.base.behaviour',\n 'representing',\n 'item-events',\n 'tooltipping'\n ],\n 'mousedown': [\n 'focusing',\n 'alloy.base.behaviour',\n 'item-type-events'\n ],\n 'touchstart': [\n 'focusing',\n 'alloy.base.behaviour',\n 'item-type-events'\n ],\n 'mouseover': [\n 'item-type-events',\n 'tooltipping'\n ],\n 'alloy.receive': [\n 'receiving',\n 'reflecting',\n 'tooltipping'\n ]\n }), anyValue$1()),\n option('domModification')\n ]), spec);\n };\n var toDefinition = function (detail) {\n return __assign(__assign({}, detail.dom), {\n uid: detail.uid,\n domChildren: map(detail.components, function (comp) {\n return comp.element();\n })\n });\n };\n var toModification = function (detail) {\n return detail.domModification.fold(function () {\n return nu$6({});\n }, nu$6);\n };\n var toEvents = function (info) {\n return info.events;\n };\n\n var read$2 = function (element, attr) {\n var value = get$2(element, attr);\n return value === undefined || value === '' ? [] : value.split(' ');\n };\n var add = function (element, attr, id) {\n var old = read$2(element, attr);\n var nu = old.concat([id]);\n set$1(element, attr, nu.join(' '));\n return true;\n };\n var remove$2 = function (element, attr, id) {\n var nu = filter(read$2(element, attr), function (v) {\n return v !== id;\n });\n if (nu.length > 0) {\n set$1(element, attr, nu.join(' '));\n } else {\n remove$1(element, attr);\n }\n return false;\n };\n\n var supports = function (element) {\n return element.dom().classList !== undefined;\n };\n var get$3 = function (element) {\n return read$2(element, 'class');\n };\n var add$1 = function (element, clazz) {\n return add(element, 'class', clazz);\n };\n var remove$3 = function (element, clazz) {\n return remove$2(element, 'class', clazz);\n };\n\n var add$2 = function (element, clazz) {\n if (supports(element)) {\n element.dom().classList.add(clazz);\n } else {\n add$1(element, clazz);\n }\n };\n var cleanClass = function (element) {\n var classList = supports(element) ? element.dom().classList : get$3(element);\n if (classList.length === 0) {\n remove$1(element, 'class');\n }\n };\n var remove$4 = function (element, clazz) {\n if (supports(element)) {\n var classList = element.dom().classList;\n classList.remove(clazz);\n } else {\n remove$3(element, clazz);\n }\n cleanClass(element);\n };\n var has$2 = function (element, clazz) {\n return supports(element) && element.dom().classList.contains(clazz);\n };\n\n var add$3 = function (element, classes) {\n each(classes, function (x) {\n add$2(element, x);\n });\n };\n var remove$5 = function (element, classes) {\n each(classes, function (x) {\n remove$4(element, x);\n });\n };\n\n var isSupported = function (dom) {\n return dom.style !== undefined && isFunction(dom.style.getPropertyValue);\n };\n\n var isShadowRoot = function (dos) {\n return isDocumentFragment(dos);\n };\n var supported = isFunction(domGlobals.Element.prototype.attachShadow) && isFunction(domGlobals.Node.prototype.getRootNode);\n var isSupported$1 = constant(supported);\n var getRootNode = supported ? function (e) {\n return Element.fromDom(e.dom().getRootNode());\n } : documentOrOwner;\n var getContentContainer = function (dos) {\n return isShadowRoot(dos) ? dos : Element.fromDom(documentOrOwner(dos).dom().body);\n };\n var getShadowRoot = function (e) {\n var r = getRootNode(e);\n return isShadowRoot(r) ? Option.some(r) : Option.none();\n };\n var getShadowHost = function (e) {\n return Element.fromDom(e.dom().host);\n };\n var getOriginalEventTarget = function (event) {\n if (isSupported$1() && isNonNullable(event.target)) {\n var el = Element.fromDom(event.target);\n if (isElement(el) && isOpenShadowHost(Element.fromDom(event.target))) {\n var eventAny = event;\n if (eventAny.composed && eventAny.composedPath) {\n var composedPath = eventAny.composedPath();\n if (composedPath) {\n return head(composedPath);\n }\n }\n }\n }\n return Option.from(event.target);\n };\n var isOpenShadowHost = function (element) {\n return isNonNullable(element.dom().shadowRoot);\n };\n\n var inBody = function (element) {\n var dom = isText(element) ? element.dom().parentNode : element.dom();\n if (dom === undefined || dom === null || dom.ownerDocument === null) {\n return false;\n }\n return getShadowRoot(Element.fromDom(dom)).fold(function () {\n return dom.ownerDocument.body.contains(dom);\n }, compose1(inBody, getShadowHost));\n };\n var body = function () {\n return getBody(Element.fromDom(domGlobals.document));\n };\n var getBody = function (doc) {\n var b = doc.dom().body;\n if (b === null || b === undefined) {\n throw new Error('Body is not available yet');\n }\n return Element.fromDom(b);\n };\n\n var internalSet = function (dom, property, value) {\n if (!isString(value)) {\n domGlobals.console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);\n throw new Error('CSS value must be a string: ' + value);\n }\n if (isSupported(dom)) {\n dom.style.setProperty(property, value);\n }\n };\n var internalRemove = function (dom, property) {\n if (isSupported(dom)) {\n dom.style.removeProperty(property);\n }\n };\n var set$2 = function (element, property, value) {\n var dom = element.dom();\n internalSet(dom, property, value);\n };\n var setAll$1 = function (element, css) {\n var dom = element.dom();\n each$1(css, function (v, k) {\n internalSet(dom, k, v);\n });\n };\n var setOptions = function (element, css) {\n var dom = element.dom();\n each$1(css, function (v, k) {\n v.fold(function () {\n internalRemove(dom, k);\n }, function (value) {\n internalSet(dom, k, value);\n });\n });\n };\n var get$4 = function (element, property) {\n var dom = element.dom();\n var styles = domGlobals.window.getComputedStyle(dom);\n var r = styles.getPropertyValue(property);\n return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;\n };\n var getUnsafeProperty = function (dom, property) {\n return isSupported(dom) ? dom.style.getPropertyValue(property) : '';\n };\n var getRaw = function (element, property) {\n var dom = element.dom();\n var raw = getUnsafeProperty(dom, property);\n return Option.from(raw).filter(function (r) {\n return r.length > 0;\n });\n };\n var getAllRaw = function (element) {\n var css = {};\n var dom = element.dom();\n if (isSupported(dom)) {\n for (var i = 0; i < dom.style.length; i++) {\n var ruleName = dom.style.item(i);\n css[ruleName] = dom.style[ruleName];\n }\n }\n return css;\n };\n var isValidValue = function (tag, property, value) {\n var element = Element.fromTag(tag);\n set$2(element, property, value);\n var style = getRaw(element, property);\n return style.isSome();\n };\n var remove$6 = function (element, property) {\n var dom = element.dom();\n internalRemove(dom, property);\n if (getOpt(element, 'style').map(trim).is('')) {\n remove$1(element, 'style');\n }\n };\n var reflow = function (e) {\n return e.dom().offsetWidth;\n };\n\n var get$5 = function (element) {\n return element.dom().value;\n };\n var set$3 = function (element, value) {\n if (value === undefined) {\n throw new Error('Value.set was undefined');\n }\n element.dom().value = value;\n };\n\n var renderToDom = function (definition) {\n var subject = Element.fromTag(definition.tag);\n setAll(subject, definition.attributes);\n add$3(subject, definition.classes);\n setAll$1(subject, definition.styles);\n definition.innerHtml.each(function (html) {\n return set(subject, html);\n });\n var children = definition.domChildren;\n append$1(subject, children);\n definition.value.each(function (value) {\n set$3(subject, value);\n });\n if (!definition.uid) {\n debugger;\n }\n writeOnly(subject, definition.uid);\n return subject;\n };\n\n var getBehaviours$1 = function (spec) {\n var behaviours = get(spec, 'behaviours').getOr({});\n var keys$1 = filter(keys(behaviours), function (k) {\n return behaviours[k] !== undefined;\n });\n return map(keys$1, function (k) {\n return behaviours[k].me;\n });\n };\n var generateFrom$1 = function (spec, all) {\n return generateFrom(spec, all);\n };\n var generate$3 = function (spec) {\n var all = getBehaviours$1(spec);\n return generateFrom$1(spec, all);\n };\n\n var getDomDefinition = function (info, bList, bData) {\n var definition = toDefinition(info);\n var infoModification = toModification(info);\n var baseModification = { 'alloy.base.modification': infoModification };\n var modification = bList.length > 0 ? combine(bData, baseModification, bList, definition) : infoModification;\n return merge$1(definition, modification);\n };\n var getEvents = function (info, bList, bData) {\n var baseEvents = { 'alloy.base.behaviour': toEvents(info) };\n return combine$1(bData, info.eventOrder, bList, baseEvents).getOrDie();\n };\n var build = function (spec) {\n var getMe = function () {\n return me;\n };\n var systemApi = Cell(singleton);\n var info = getOrDie(toInfo(spec));\n var bBlob = generate$3(spec);\n var bList = getBehaviours(bBlob);\n var bData = getData(bBlob);\n var modDefinition = getDomDefinition(info, bList, bData);\n var item = renderToDom(modDefinition);\n var events = getEvents(info, bList, bData);\n var subcomponents = Cell(info.components);\n var connect = function (newApi) {\n systemApi.set(newApi);\n };\n var disconnect = function () {\n systemApi.set(NoContextApi(getMe));\n };\n var syncComponents = function () {\n var children$1 = children(item);\n var subs = bind(children$1, function (child) {\n return systemApi.get().getByDom(child).fold(function () {\n return [];\n }, function (c) {\n return [c];\n });\n });\n subcomponents.set(subs);\n };\n var config = function (behaviour) {\n var b = bData;\n var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () {\n throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2));\n };\n return f();\n };\n var hasConfigured = function (behaviour) {\n return isFunction(bData[behaviour.name()]);\n };\n var getApis = function () {\n return info.apis;\n };\n var readState = function (behaviourName) {\n return bData[behaviourName]().map(function (b) {\n return b.state.readState();\n }).getOr('not enabled');\n };\n var me = {\n getSystem: systemApi.get,\n config: config,\n hasConfigured: hasConfigured,\n spec: constant(spec),\n readState: readState,\n getApis: getApis,\n connect: connect,\n disconnect: disconnect,\n element: constant(item),\n syncComponents: syncComponents,\n components: subcomponents.get,\n events: constant(events)\n };\n return me;\n };\n\n var buildSubcomponents = function (spec) {\n var components = get(spec, 'components').getOr([]);\n return map(components, build$1);\n };\n var buildFromSpec = function (userSpec) {\n var _a = make(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']);\n var components = buildSubcomponents(spec);\n var completeSpec = __assign(__assign({}, spec), {\n events: __assign(__assign({}, DefaultEvents), specEvents),\n components: components\n });\n return Result.value(build(completeSpec));\n };\n var text = function (textContent) {\n var element = Element.fromText(textContent);\n return external({ element: element });\n };\n var external = function (spec) {\n var extSpec = asRawOrDie('external.component', objOfOnly([\n strict$1('element'),\n option('uid')\n ]), spec);\n var systemApi = Cell(NoContextApi());\n var connect = function (newApi) {\n systemApi.set(newApi);\n };\n var disconnect = function () {\n systemApi.set(NoContextApi(function () {\n return me;\n }));\n };\n extSpec.uid.each(function (uid) {\n writeOnly(extSpec.element, uid);\n });\n var me = {\n getSystem: systemApi.get,\n config: Option.none,\n hasConfigured: constant(false),\n connect: connect,\n disconnect: disconnect,\n getApis: function () {\n return {};\n },\n element: constant(extSpec.element),\n spec: constant(spec),\n readState: constant('No state'),\n syncComponents: noop,\n components: constant([]),\n events: constant({})\n };\n return premade(me);\n };\n var uids = generate$2;\n var build$1 = function (spec) {\n return getPremade(spec).fold(function () {\n var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec);\n return buildFromSpec(userSpecWithUid).getOrDie();\n }, function (prebuilt) {\n return prebuilt;\n });\n };\n var premade$1 = premade;\n\n function Dimension (name, getOffset) {\n var set = function (element, h) {\n if (!isNumber(h) && !h.match(/^[0-9]+$/)) {\n throw new Error(name + '.set accepts only positive integer values. Value was ' + h);\n }\n var dom = element.dom();\n if (isSupported(dom)) {\n dom.style[name] = h + 'px';\n }\n };\n var get = function (element) {\n var r = getOffset(element);\n if (r <= 0 || r === null) {\n var css = get$4(element, name);\n return parseFloat(css) || 0;\n }\n return r;\n };\n var getOuter = get;\n var aggregate = function (element, properties) {\n return foldl(properties, function (acc, property) {\n var val = get$4(element, property);\n var value = val === undefined ? 0 : parseInt(val, 10);\n return isNaN(value) ? acc : acc + value;\n }, 0);\n };\n var max = function (element, value, properties) {\n var cumulativeInclusions = aggregate(element, properties);\n var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0;\n return absoluteMax;\n };\n return {\n set: set,\n get: get,\n getOuter: getOuter,\n aggregate: aggregate,\n max: max\n };\n }\n\n var api = Dimension('height', function (element) {\n var dom = element.dom();\n return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight;\n });\n var get$6 = function (element) {\n return api.get(element);\n };\n var getOuter$1 = function (element) {\n return api.getOuter(element);\n };\n var setMax = function (element, value) {\n var inclusions = [\n 'margin-top',\n 'border-top-width',\n 'padding-top',\n 'padding-bottom',\n 'border-bottom-width',\n 'margin-bottom'\n ];\n var absMax = api.max(element, value, inclusions);\n set$2(element, 'max-height', absMax + 'px');\n };\n\n var r = function (left, top) {\n var translate = function (x, y) {\n return r(left + x, top + y);\n };\n return {\n left: constant(left),\n top: constant(top),\n translate: translate\n };\n };\n var Position = r;\n\n var boxPosition = function (dom) {\n var box = dom.getBoundingClientRect();\n return Position(box.left, box.top);\n };\n var firstDefinedOrZero = function (a, b) {\n if (a !== undefined) {\n return a;\n } else {\n return b !== undefined ? b : 0;\n }\n };\n var absolute = function (element) {\n var doc = element.dom().ownerDocument;\n var body = doc.body;\n var win = doc.defaultView;\n var html = doc.documentElement;\n if (body === element.dom()) {\n return Position(body.offsetLeft, body.offsetTop);\n }\n var scrollTop = firstDefinedOrZero(win.pageYOffset, html.scrollTop);\n var scrollLeft = firstDefinedOrZero(win.pageXOffset, html.scrollLeft);\n var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop);\n var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft);\n return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop);\n };\n var viewport = function (element) {\n var dom = element.dom();\n var doc = dom.ownerDocument;\n var body = doc.body;\n if (body === dom) {\n return Position(body.offsetLeft, body.offsetTop);\n }\n if (!inBody(element)) {\n return Position(0, 0);\n }\n return boxPosition(dom);\n };\n\n var api$1 = Dimension('width', function (element) {\n return element.dom().offsetWidth;\n });\n var set$4 = function (element, h) {\n return api$1.set(element, h);\n };\n var get$7 = function (element) {\n return api$1.get(element);\n };\n var getOuter$2 = function (element) {\n return api$1.getOuter(element);\n };\n var setMax$1 = function (element, value) {\n var inclusions = [\n 'margin-left',\n 'border-left-width',\n 'padding-left',\n 'padding-right',\n 'border-right-width',\n 'margin-right'\n ];\n var absMax = api$1.max(element, value, inclusions);\n set$2(element, 'max-width', absMax + 'px');\n };\n\n var mkEvent = function (target, x, y, stop, prevent, kill, raw) {\n return {\n target: constant(target),\n x: constant(x),\n y: constant(y),\n stop: stop,\n prevent: prevent,\n kill: kill,\n raw: constant(raw)\n };\n };\n var fromRawEvent = function (rawEvent) {\n var target = Element.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target));\n var stop = function () {\n return rawEvent.stopPropagation();\n };\n var prevent = function () {\n return rawEvent.preventDefault();\n };\n var kill = compose(prevent, stop);\n return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent);\n };\n var handle = function (filter, handler) {\n return function (rawEvent) {\n if (filter(rawEvent)) {\n handler(fromRawEvent(rawEvent));\n }\n };\n };\n var binder = function (element, event, filter, handler, useCapture) {\n var wrapped = handle(filter, handler);\n element.dom().addEventListener(event, wrapped, useCapture);\n return { unbind: curry(unbind, element, event, wrapped, useCapture) };\n };\n var bind$2 = function (element, event, filter, handler) {\n return binder(element, event, filter, handler, false);\n };\n var capture = function (element, event, filter, handler) {\n return binder(element, event, filter, handler, true);\n };\n var unbind = function (element, event, handler, useCapture) {\n element.dom().removeEventListener(event, handler, useCapture);\n };\n\n var get$8 = function (_DOC) {\n var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document;\n var x = doc.body.scrollLeft || doc.documentElement.scrollLeft;\n var y = doc.body.scrollTop || doc.documentElement.scrollTop;\n return Position(x, y);\n };\n var to = function (x, y, _DOC) {\n var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document;\n var win = doc.defaultView;\n win.scrollTo(x, y);\n };\n\n var get$9 = function (_win) {\n var win = _win === undefined ? domGlobals.window : _win;\n return Option.from(win['visualViewport']);\n };\n var bounds = function (x, y, width, height) {\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n right: x + width,\n bottom: y + height\n };\n };\n var getBounds = function (_win) {\n var win = _win === undefined ? domGlobals.window : _win;\n var doc = win.document;\n var scroll = get$8(Element.fromDom(doc));\n return get$9(win).fold(function () {\n var html = win.document.documentElement;\n var width = html.clientWidth;\n var height = html.clientHeight;\n return bounds(scroll.left(), scroll.top(), width, height);\n }, function (visualViewport) {\n return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height);\n });\n };\n\n var walkUp = function (navigation, doc) {\n var frame = navigation.view(doc);\n return frame.fold(constant([]), function (f) {\n var parent = navigation.owner(f);\n var rest = walkUp(navigation, parent);\n return [f].concat(rest);\n });\n };\n var pathTo = function (element, navigation) {\n var d = navigation.owner(element);\n var paths = walkUp(navigation, d);\n return Option.some(paths);\n };\n\n var view = function (doc) {\n var element = doc.dom() === domGlobals.document ? Option.none() : Option.from(doc.dom().defaultView.frameElement);\n return element.map(Element.fromDom);\n };\n var owner$1 = function (element) {\n return owner(element);\n };\n\n var Navigation = /*#__PURE__*/Object.freeze({\n __proto__: null,\n view: view,\n owner: owner$1\n });\n\n var find$3 = function (element) {\n var doc = Element.fromDom(domGlobals.document);\n var scroll = get$8(doc);\n var path = pathTo(element, Navigation);\n return path.fold(curry(absolute, element), function (frames) {\n var offset = viewport(element);\n var r = foldr(frames, function (b, a) {\n var loc = viewport(a);\n return {\n left: b.left + loc.left(),\n top: b.top + loc.top()\n };\n }, {\n left: 0,\n top: 0\n });\n return Position(r.left + offset.left() + scroll.left(), r.top + offset.top() + scroll.top());\n });\n };\n\n var pointed = function (point, width, height) {\n return {\n point: point,\n width: width,\n height: height\n };\n };\n var rect = function (x, y, width, height) {\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n };\n var bounds$1 = function (x, y, width, height) {\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n right: x + width,\n bottom: y + height\n };\n };\n var box = function (element) {\n var xy = absolute(element);\n var w = getOuter$2(element);\n var h = getOuter$1(element);\n return bounds$1(xy.left(), xy.top(), w, h);\n };\n var absolute$1 = function (element) {\n var position = find$3(element);\n var width = getOuter$2(element);\n var height = getOuter$1(element);\n return bounds$1(position.left(), position.top(), width, height);\n };\n var win = function () {\n return getBounds(domGlobals.window);\n };\n\n function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {\n return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);\n }\n\n var ancestor$1 = function (scope, predicate, isRoot) {\n var element = scope.dom();\n var stop = isFunction(isRoot) ? isRoot : constant(false);\n while (element.parentNode) {\n element = element.parentNode;\n var el = Element.fromDom(element);\n if (predicate(el)) {\n return Option.some(el);\n } else if (stop(el)) {\n break;\n }\n }\n return Option.none();\n };\n var closest$1 = function (scope, predicate, isRoot) {\n var is = function (s, test) {\n return test(s);\n };\n return ClosestOrAncestor(is, ancestor$1, scope, predicate, isRoot);\n };\n var descendant = function (scope, predicate) {\n var descend = function (node) {\n for (var i = 0; i < node.childNodes.length; i++) {\n var child_1 = Element.fromDom(node.childNodes[i]);\n if (predicate(child_1)) {\n return Option.some(child_1);\n }\n var res = descend(node.childNodes[i]);\n if (res.isSome()) {\n return res;\n }\n }\n return Option.none();\n };\n return descend(scope.dom());\n };\n\n var closest$2 = function (scope, predicate, isRoot) {\n return closest$1(scope, predicate, isRoot).isSome();\n };\n\n var ancestor$2 = function (scope, selector, isRoot) {\n return ancestor$1(scope, function (e) {\n return is(e, selector);\n }, isRoot);\n };\n var descendant$1 = function (scope, selector) {\n return one(selector, scope);\n };\n var closest$3 = function (scope, selector, isRoot) {\n var is$1 = function (element, selector) {\n return is(element, selector);\n };\n return ClosestOrAncestor(is$1, ancestor$2, scope, selector, isRoot);\n };\n\n var find$4 = function (queryElem) {\n var dependent = closest$1(queryElem, function (elem) {\n if (!isElement(elem)) {\n return false;\n }\n var id = get$2(elem, 'id');\n return id !== undefined && id.indexOf('aria-owns') > -1;\n });\n return dependent.bind(function (dep) {\n var id = get$2(dep, 'id');\n var doc = owner(dep);\n return descendant$1(doc, '[aria-owns=\"' + id + '\"]');\n });\n };\n var manager = function () {\n var ariaId = generate$1('aria-owns');\n var link = function (elem) {\n set$1(elem, 'aria-owns', ariaId);\n };\n var unlink = function (elem) {\n remove$1(elem, 'aria-owns');\n };\n return {\n id: ariaId,\n link: link,\n unlink: unlink\n };\n };\n\n var isAriaPartOf = function (component, queryElem) {\n return find$4(queryElem).exists(function (owner) {\n return isPartOf(component, owner);\n });\n };\n var isPartOf = function (component, queryElem) {\n return closest$2(queryElem, function (el) {\n return eq$1(el, component.element());\n }, constant(false)) || isAriaPartOf(component, queryElem);\n };\n\n var unknown$3 = 'unknown';\n var EventConfiguration;\n (function (EventConfiguration) {\n EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP';\n EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL';\n EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING';\n }(EventConfiguration || (EventConfiguration = {})));\n var eventConfig = Cell({});\n var makeEventLogger = function (eventName, initialTarget) {\n var sequence = [];\n var startTime = new Date().getTime();\n return {\n logEventCut: function (_name, target, purpose) {\n sequence.push({\n outcome: 'cut',\n target: target,\n purpose: purpose\n });\n },\n logEventStopped: function (_name, target, purpose) {\n sequence.push({\n outcome: 'stopped',\n target: target,\n purpose: purpose\n });\n },\n logNoParent: function (_name, target, purpose) {\n sequence.push({\n outcome: 'no-parent',\n target: target,\n purpose: purpose\n });\n },\n logEventNoHandlers: function (_name, target) {\n sequence.push({\n outcome: 'no-handlers-left',\n target: target\n });\n },\n logEventResponse: function (_name, target, purpose) {\n sequence.push({\n outcome: 'response',\n purpose: purpose,\n target: target\n });\n },\n write: function () {\n var finishTime = new Date().getTime();\n if (contains([\n 'mousemove',\n 'mouseover',\n 'mouseout',\n systemInit()\n ], eventName)) {\n return;\n }\n domGlobals.console.log(eventName, {\n event: eventName,\n time: finishTime - startTime,\n target: initialTarget.dom(),\n sequence: map(sequence, function (s) {\n if (!contains([\n 'cut',\n 'stopped',\n 'response'\n ], s.outcome)) {\n return s.outcome;\n } else {\n return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')';\n }\n })\n });\n }\n };\n };\n var processEvent = function (eventName, initialTarget, f) {\n var status = get(eventConfig.get(), eventName).orThunk(function () {\n var patterns = keys(eventConfig.get());\n return findMap(patterns, function (p) {\n return eventName.indexOf(p) > -1 ? Option.some(eventConfig.get()[p]) : Option.none();\n });\n }).getOr(EventConfiguration.NORMAL);\n switch (status) {\n case EventConfiguration.NORMAL:\n return f(noLogger());\n case EventConfiguration.LOGGING: {\n var logger = makeEventLogger(eventName, initialTarget);\n var output = f(logger);\n logger.write();\n return output;\n }\n case EventConfiguration.STOP:\n return true;\n }\n };\n var path = [\n 'alloy/data/Fields',\n 'alloy/debugging/Debugging'\n ];\n var getTrace = function () {\n var err = new Error();\n if (err.stack !== undefined) {\n var lines = err.stack.split('\\n');\n return find(lines, function (line) {\n return line.indexOf('alloy') > 0 && !exists(path, function (p) {\n return line.indexOf(p) > -1;\n });\n }).getOr(unknown$3);\n } else {\n return unknown$3;\n }\n };\n var ignoreEvent = {\n logEventCut: noop,\n logEventStopped: noop,\n logNoParent: noop,\n logEventNoHandlers: noop,\n logEventResponse: noop,\n write: noop\n };\n var monitorEvent = function (eventName, initialTarget, f) {\n return processEvent(eventName, initialTarget, f);\n };\n var noLogger = constant(ignoreEvent);\n\n var menuFields = constant([\n strict$1('menu'),\n strict$1('selectedMenu')\n ]);\n var itemFields = constant([\n strict$1('item'),\n strict$1('selectedItem')\n ]);\n var schema = constant(objOf(itemFields().concat(menuFields())));\n var itemSchema = constant(objOf(itemFields()));\n\n var _initSize = strictObjOf('initSize', [\n strict$1('numColumns'),\n strict$1('numRows')\n ]);\n var itemMarkers = function () {\n return strictOf('markers', itemSchema());\n };\n var tieredMenuMarkers = function () {\n return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields()));\n };\n var markers = function (required) {\n return strictObjOf('markers', map(required, strict$1));\n };\n var onPresenceHandler = function (label, fieldName, presence) {\n var trace = getTrace();\n return field(fieldName, fieldName, presence, valueOf(function (f) {\n return Result.value(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return f.apply(undefined, args);\n });\n }));\n };\n var onHandler = function (fieldName) {\n return onPresenceHandler('onHandler', fieldName, defaulted(noop));\n };\n var onKeyboardHandler = function (fieldName) {\n return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Option.none));\n };\n var onStrictHandler = function (fieldName) {\n return onPresenceHandler('onHandler', fieldName, strict());\n };\n var onStrictKeyboardHandler = function (fieldName) {\n return onPresenceHandler('onKeyboardHandler', fieldName, strict());\n };\n var output = function (name, value) {\n return state$1(name, constant(value));\n };\n var snapshot = function (name) {\n return state$1(name, identity);\n };\n var initSize = constant(_initSize);\n\n var nu$7 = function (x, y, bubble, direction, boundsRestriction, label) {\n return {\n x: constant(x),\n y: constant(y),\n bubble: constant(bubble),\n direction: constant(direction),\n boundsRestriction: constant(boundsRestriction),\n label: constant(label)\n };\n };\n\n var adt$2 = Adt.generate([\n { southeast: [] },\n { southwest: [] },\n { northeast: [] },\n { northwest: [] },\n { south: [] },\n { north: [] },\n { east: [] },\n { west: [] }\n ]);\n var cata = function (subject, southeast, southwest, northeast, northwest, south, north, east, west) {\n return subject.fold(southeast, southwest, northeast, northwest, south, north, east, west);\n };\n var cataVertical = function (subject, south, middle, north) {\n return subject.fold(south, south, north, north, south, north, middle, middle);\n };\n var cataHorizontal = function (subject, east, middle, west) {\n return subject.fold(east, west, east, west, middle, middle, east, west);\n };\n var southeast = adt$2.southeast;\n var southwest = adt$2.southwest;\n var northeast = adt$2.northeast;\n var northwest = adt$2.northwest;\n var south = adt$2.south;\n var north = adt$2.north;\n var east = adt$2.east;\n var west = adt$2.west;\n\n var getRestriction = function (anchor, restriction) {\n switch (restriction) {\n case 1:\n return anchor.x;\n case 0:\n return anchor.x + anchor.width;\n case 2:\n return anchor.y;\n case 3:\n return anchor.y + anchor.height;\n }\n };\n var boundsRestriction = function (anchor, restrictions) {\n return mapToObject([\n 'left',\n 'right',\n 'top',\n 'bottom'\n ], function (dir) {\n return get(restrictions, dir).map(function (restriction) {\n return getRestriction(anchor, restriction);\n });\n });\n };\n var adjustBounds = function (bounds, boundsRestrictions, bubbleOffsets) {\n var applyRestriction = function (dir, current) {\n var bubbleOffset = dir === 'top' || dir === 'bottom' ? bubbleOffsets.top() : bubbleOffsets.left();\n return get(boundsRestrictions, dir).bind(identity).bind(function (restriction) {\n if (dir === 'left' || dir === 'top') {\n return restriction >= current ? Option.some(restriction) : Option.none();\n } else {\n return restriction <= current ? Option.some(restriction) : Option.none();\n }\n }).map(function (restriction) {\n return restriction + bubbleOffset;\n }).getOr(current);\n };\n var adjustedLeft = applyRestriction('left', bounds.x);\n var adjustedTop = applyRestriction('top', bounds.y);\n var adjustedRight = applyRestriction('right', bounds.right);\n var adjustedBottom = applyRestriction('bottom', bounds.bottom);\n return bounds$1(adjustedLeft, adjustedTop, adjustedRight - adjustedLeft, adjustedBottom - adjustedTop);\n };\n\n var eastX = function (anchor) {\n return anchor.x;\n };\n var middleX = function (anchor, element) {\n return anchor.x + anchor.width / 2 - element.width / 2;\n };\n var westX = function (anchor, element) {\n return anchor.x + anchor.width - element.width;\n };\n var northY = function (anchor, element) {\n return anchor.y - element.height;\n };\n var southY = function (anchor) {\n return anchor.y + anchor.height;\n };\n var centreY = function (anchor, element) {\n return anchor.y + anchor.height / 2 - element.height / 2;\n };\n var eastEdgeX = function (anchor) {\n return anchor.x + anchor.width;\n };\n var westEdgeX = function (anchor, element) {\n return anchor.x - element.width;\n };\n var southeast$1 = function (anchor, element, bubbles) {\n return nu$7(eastX(anchor), southY(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, {\n left: 1,\n top: 3\n }), 'layout-se');\n };\n var southwest$1 = function (anchor, element, bubbles) {\n return nu$7(westX(anchor, element), southY(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, {\n right: 0,\n top: 3\n }), 'layout-sw');\n };\n var northeast$1 = function (anchor, element, bubbles) {\n return nu$7(eastX(anchor), northY(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, {\n left: 1,\n bottom: 2\n }), 'layout-ne');\n };\n var northwest$1 = function (anchor, element, bubbles) {\n return nu$7(westX(anchor, element), northY(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, {\n right: 0,\n bottom: 2\n }), 'layout-nw');\n };\n var north$1 = function (anchor, element, bubbles) {\n return nu$7(middleX(anchor, element), northY(anchor, element), bubbles.north(), north(), boundsRestriction(anchor, { bottom: 2 }), 'layout-n');\n };\n var south$1 = function (anchor, element, bubbles) {\n return nu$7(middleX(anchor, element), southY(anchor), bubbles.south(), south(), boundsRestriction(anchor, { top: 3 }), 'layout-s');\n };\n var east$1 = function (anchor, element, bubbles) {\n return nu$7(eastEdgeX(anchor), centreY(anchor, element), bubbles.east(), east(), boundsRestriction(anchor, { left: 0 }), 'layout-e');\n };\n var west$1 = function (anchor, element, bubbles) {\n return nu$7(westEdgeX(anchor, element), centreY(anchor, element), bubbles.west(), west(), boundsRestriction(anchor, { right: 1 }), 'layout-w');\n };\n var all$2 = function () {\n return [\n southeast$1,\n southwest$1,\n northeast$1,\n northwest$1,\n south$1,\n north$1,\n east$1,\n west$1\n ];\n };\n var allRtl = function () {\n return [\n southwest$1,\n southeast$1,\n northwest$1,\n northeast$1,\n south$1,\n north$1,\n east$1,\n west$1\n ];\n };\n var aboveOrBelow = function () {\n return [\n northeast$1,\n northwest$1,\n southeast$1,\n southwest$1,\n north$1,\n south$1\n ];\n };\n var aboveOrBelowRtl = function () {\n return [\n northwest$1,\n northeast$1,\n southwest$1,\n southeast$1,\n north$1,\n south$1\n ];\n };\n var belowOrAbove = function () {\n return [\n southeast$1,\n southwest$1,\n northeast$1,\n northwest$1,\n south$1,\n north$1\n ];\n };\n var belowOrAboveRtl = function () {\n return [\n southwest$1,\n southeast$1,\n northwest$1,\n northeast$1,\n south$1,\n north$1\n ];\n };\n\n var executeEvent = function (bConfig, bState, executor) {\n return runOnExecute(function (component) {\n executor(component, bConfig, bState);\n });\n };\n var loadEvent = function (bConfig, bState, f) {\n return runOnInit(function (component, _simulatedEvent) {\n f(component, bConfig, bState);\n });\n };\n var create = function (schema, name, active, apis, extra, state) {\n var configSchema = objOfOnly(schema);\n var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]);\n return doCreate(configSchema, schemaSchema, name, active, apis, extra, state);\n };\n var createModes = function (modes, name, active, apis, extra, state) {\n var configSchema = modes;\n var schemaSchema = optionObjOf(name, [optionOf('config', modes)]);\n return doCreate(configSchema, schemaSchema, name, active, apis, extra, state);\n };\n var wrapApi = function (bName, apiFunction, apiName) {\n var f = function (component) {\n var rest = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n rest[_i - 1] = arguments[_i];\n }\n var args = [component].concat(rest);\n return component.config({ name: constant(bName) }).fold(function () {\n throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName);\n }, function (info) {\n var rest = Array.prototype.slice.call(args, 1);\n return apiFunction.apply(undefined, [\n component,\n info.config,\n info.state\n ].concat(rest));\n });\n };\n return markAsBehaviourApi(f, apiName, apiFunction);\n };\n var revokeBehaviour = function (name) {\n return {\n key: name,\n value: undefined\n };\n };\n var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) {\n var getConfig = function (info) {\n return hasNonNullableKey(info, name) ? info[name]() : Option.none();\n };\n var wrappedApis = map$2(apis, function (apiF, apiName) {\n return wrapApi(name, apiF, apiName);\n });\n var wrappedExtra = map$2(extra, function (extraF, extraName) {\n return markAsExtraApi(extraF, extraName);\n });\n var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), {\n revoke: curry(revokeBehaviour, name),\n config: function (spec) {\n var prepared = asRawOrDie(name + '-config', configSchema, spec);\n return {\n key: name,\n value: {\n config: prepared,\n me: me,\n configAsRaw: cached(function () {\n return asRawOrDie(name + '-config', configSchema, spec);\n }),\n initialConfig: spec,\n state: state\n }\n };\n },\n schema: function () {\n return schemaSchema;\n },\n exhibit: function (info, base) {\n return getConfig(info).bind(function (behaviourInfo) {\n return get(active, 'exhibit').map(function (exhibitor) {\n return exhibitor(base, behaviourInfo.config, behaviourInfo.state);\n });\n }).getOr(nu$6({}));\n },\n name: function () {\n return name;\n },\n handlers: function (info) {\n return getConfig(info).map(function (behaviourInfo) {\n var getEvents = get(active, 'events').getOr(function () {\n return {};\n });\n return getEvents(behaviourInfo.config, behaviourInfo.state);\n }).getOr({});\n }\n });\n return me;\n };\n\n var derive$1 = function (capabilities) {\n return wrapAll$1(capabilities);\n };\n var simpleSchema = objOfOnly([\n strict$1('fields'),\n strict$1('name'),\n defaulted$1('active', {}),\n defaulted$1('apis', {}),\n defaulted$1('state', NoState),\n defaulted$1('extra', {})\n ]);\n var create$1 = function (data) {\n var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data);\n return create(value.fields, value.name, value.active, value.apis, value.extra, value.state);\n };\n var modeSchema = objOfOnly([\n strict$1('branchKey'),\n strict$1('branches'),\n strict$1('name'),\n defaulted$1('active', {}),\n defaulted$1('apis', {}),\n defaulted$1('state', NoState),\n defaulted$1('extra', {})\n ]);\n var createModes$1 = function (data) {\n var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data);\n return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state);\n };\n var revoke = constant(undefined);\n\n var chooseChannels = function (channels, message) {\n return message.universal() ? channels : filter(channels, function (ch) {\n return contains(message.channels(), ch);\n });\n };\n var events$1 = function (receiveConfig) {\n return derive([run(receive(), function (component, message) {\n var channelMap = receiveConfig.channels;\n var channels = keys(channelMap);\n var receivingData = message;\n var targetChannels = chooseChannels(channels, receivingData);\n each(targetChannels, function (ch) {\n var channelInfo = channelMap[ch];\n var channelSchema = channelInfo.schema;\n var data = asRawOrDie('channel[' + ch + '] data\\nReceiver: ' + element(component.element()), channelSchema, receivingData.data());\n channelInfo.onReceive(component, data);\n });\n })]);\n };\n\n var ActiveReceiving = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$1\n });\n\n var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([\n onStrictHandler('onReceive'),\n defaulted$1('schema', anyValue$1())\n ])))];\n\n var Receiving = create$1({\n fields: ReceivingSchema,\n name: 'receiving',\n active: ActiveReceiving\n });\n\n var exhibit = function (base, posConfig) {\n return nu$6({\n classes: [],\n styles: posConfig.useFixed() ? {} : { position: 'relative' }\n });\n };\n\n var ActivePosition = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit\n });\n\n var getDocument = function () {\n return Element.fromDom(domGlobals.document);\n };\n\n var focus$1 = function (element) {\n return element.dom().focus();\n };\n var blur = function (element) {\n return element.dom().blur();\n };\n var hasFocus = function (element) {\n var root = getRootNode(element).dom();\n return element.dom() === root.activeElement;\n };\n var active = function (root) {\n if (root === void 0) {\n root = getDocument();\n }\n return Option.from(root.dom().activeElement).map(Element.fromDom);\n };\n var search = function (element) {\n return active(getRootNode(element)).filter(function (e) {\n return element.dom().contains(e.dom());\n });\n };\n\n var preserve = function (f, container) {\n var ownerDoc = owner(container);\n var refocus = active(ownerDoc).bind(function (focused) {\n var hasFocus = function (elem) {\n return eq$1(focused, elem);\n };\n return hasFocus(container) ? Option.some(container) : descendant(container, hasFocus);\n });\n var result = f(container);\n refocus.each(function (oldFocus) {\n active(ownerDoc).filter(function (newFocus) {\n return eq$1(newFocus, oldFocus);\n }).fold(function () {\n focus$1(oldFocus);\n }, noop);\n });\n return result;\n };\n\n var NuPositionCss = function (position, left, top, right, bottom) {\n return {\n position: constant(position),\n left: constant(left),\n top: constant(top),\n right: constant(right),\n bottom: constant(bottom)\n };\n };\n var applyPositionCss = function (element, position) {\n var addPx = function (num) {\n return num + 'px';\n };\n setOptions(element, {\n position: Option.some(position.position()),\n left: position.left().map(addPx),\n top: position.top().map(addPx),\n right: position.right().map(addPx),\n bottom: position.bottom().map(addPx)\n });\n };\n\n var adt$3 = Adt.generate([\n { none: [] },\n {\n relative: [\n 'x',\n 'y',\n 'width',\n 'height'\n ]\n },\n {\n fixed: [\n 'x',\n 'y',\n 'width',\n 'height'\n ]\n }\n ]);\n var positionWithDirection = function (posName, decision, x, y, width, height) {\n var decisionX = decision.x - x;\n var decisionY = decision.y - y;\n var decisionWidth = decision.width;\n var decisionHeight = decision.height;\n var decisionRight = width - (decisionX + decisionWidth);\n var decisionBottom = height - (decisionY + decisionHeight);\n var left = Option.some(decisionX);\n var top = Option.some(decisionY);\n var right = Option.some(decisionRight);\n var bottom = Option.some(decisionBottom);\n var none = Option.none();\n return cata(decision.direction, function () {\n return NuPositionCss(posName, left, top, none, none);\n }, function () {\n return NuPositionCss(posName, none, top, right, none);\n }, function () {\n return NuPositionCss(posName, left, none, none, bottom);\n }, function () {\n return NuPositionCss(posName, none, none, right, bottom);\n }, function () {\n return NuPositionCss(posName, left, top, none, none);\n }, function () {\n return NuPositionCss(posName, left, none, none, bottom);\n }, function () {\n return NuPositionCss(posName, left, top, none, none);\n }, function () {\n return NuPositionCss(posName, none, top, right, none);\n });\n };\n var reposition = function (origin, decision) {\n return origin.fold(function () {\n return NuPositionCss('absolute', Option.some(decision.x), Option.some(decision.y), Option.none(), Option.none());\n }, function (x, y, width, height) {\n return positionWithDirection('absolute', decision, x, y, width, height);\n }, function (x, y, width, height) {\n return positionWithDirection('fixed', decision, x, y, width, height);\n });\n };\n var toBox = function (origin, element) {\n var rel = curry(find$3, element);\n var position = origin.fold(rel, rel, function () {\n var scroll = get$8();\n return find$3(element).translate(-scroll.left(), -scroll.top());\n });\n var width = getOuter$2(element);\n var height = getOuter$1(element);\n return bounds$1(position.left(), position.top(), width, height);\n };\n var viewport$1 = function (origin, getBounds) {\n return getBounds.fold(function () {\n return origin.fold(win, win, bounds$1);\n }, function (b) {\n return origin.fold(b, b, function () {\n var bounds = b();\n var pos = translate(origin, bounds.x, bounds.y);\n return bounds$1(pos.left(), pos.top(), bounds.width, bounds.height);\n });\n });\n };\n var translate = function (origin, x, y) {\n var pos = Position(x, y);\n var removeScroll = function () {\n var outerScroll = get$8();\n return pos.translate(-outerScroll.left(), -outerScroll.top());\n };\n return origin.fold(constant(pos), constant(pos), removeScroll);\n };\n var cata$1 = function (subject, onNone, onRelative, onFixed) {\n return subject.fold(onNone, onRelative, onFixed);\n };\n var none$1 = adt$3.none;\n var relative = adt$3.relative;\n var fixed = adt$3.fixed;\n\n var anchor = function (anchorBox, origin) {\n return {\n anchorBox: constant(anchorBox),\n origin: constant(origin)\n };\n };\n var box$1 = function (anchorBox, origin) {\n return anchor(anchorBox, origin);\n };\n\n var cycleBy = function (value, delta, min, max) {\n var r = value + delta;\n return r > max ? min : r < min ? max : r;\n };\n var clamp = function (value, min, max) {\n return Math.min(Math.max(value, min), max);\n };\n\n var adt$4 = Adt.generate([\n { fit: ['reposition'] },\n {\n nofit: [\n 'reposition',\n 'deltaW',\n 'deltaH'\n ]\n }\n ]);\n var calcReposition = function (newX, newY, width, height, bounds) {\n var boundsX = bounds.x;\n var boundsY = bounds.y;\n var boundsWidth = bounds.width;\n var boundsHeight = bounds.height;\n var xInBounds = newX >= boundsX;\n var yInBounds = newY >= boundsY;\n var originInBounds = xInBounds && yInBounds;\n var xFit = newX + width <= boundsX + boundsWidth;\n var yFit = newY + height <= boundsY + boundsHeight;\n var sizeInBounds = xFit && yFit;\n var deltaW = Math.abs(Math.min(width, xInBounds ? boundsX + boundsWidth - newX : boundsX - (newX + width)));\n var deltaH = Math.abs(Math.min(height, yInBounds ? boundsY + boundsHeight - newY : boundsY - (newY + height)));\n var maxX = Math.max(bounds.x, bounds.right - width);\n var maxY = Math.max(bounds.y, bounds.bottom - height);\n var limitX = clamp(newX, bounds.x, maxX);\n var limitY = clamp(newY, bounds.y, maxY);\n return {\n originInBounds: originInBounds,\n sizeInBounds: sizeInBounds,\n limitX: limitX,\n limitY: limitY,\n deltaW: deltaW,\n deltaH: deltaH\n };\n };\n var attempt = function (candidate, width, height, bounds) {\n var candidateX = candidate.x();\n var candidateY = candidate.y();\n var bubbleOffsets = candidate.bubble().offset();\n var bubbleLeft = bubbleOffsets.left();\n var bubbleTop = bubbleOffsets.top();\n var adjustedBounds = adjustBounds(bounds, candidate.boundsRestriction(), bubbleOffsets);\n var boundsY = adjustedBounds.y;\n var boundsBottom = adjustedBounds.bottom;\n var boundsX = adjustedBounds.x;\n var boundsRight = adjustedBounds.right;\n var newX = candidateX + bubbleLeft;\n var newY = candidateY + bubbleTop;\n var _a = calcReposition(newX, newY, width, height, adjustedBounds), originInBounds = _a.originInBounds, sizeInBounds = _a.sizeInBounds, limitX = _a.limitX, limitY = _a.limitY, deltaW = _a.deltaW, deltaH = _a.deltaH;\n var upAvailable = constant(limitY + deltaH - boundsY);\n var downAvailable = constant(boundsBottom - limitY);\n var maxHeight = cataVertical(candidate.direction(), downAvailable, downAvailable, upAvailable);\n var westAvailable = constant(limitX + deltaW - boundsX);\n var eastAvailable = constant(boundsRight - limitX);\n var maxWidth = cataHorizontal(candidate.direction(), eastAvailable, eastAvailable, westAvailable);\n var reposition = {\n x: limitX,\n y: limitY,\n width: deltaW,\n height: deltaH,\n maxHeight: maxHeight,\n maxWidth: maxWidth,\n direction: candidate.direction(),\n classes: {\n on: candidate.bubble().classesOn(),\n off: candidate.bubble().classesOff()\n },\n label: candidate.label(),\n candidateYforTest: newY\n };\n return originInBounds && sizeInBounds ? adt$4.fit(reposition) : adt$4.nofit(reposition, deltaW, deltaH);\n };\n var attempts = function (candidates, anchorBox, elementBox, bubbles, bounds) {\n var panelWidth = elementBox.width;\n var panelHeight = elementBox.height;\n var attemptBestFit = function (layout, reposition, deltaW, deltaH) {\n var next = layout(anchorBox, elementBox, bubbles);\n var attemptLayout = attempt(next, panelWidth, panelHeight, bounds);\n return attemptLayout.fold(adt$4.fit, function (newReposition, newDeltaW, newDeltaH) {\n var improved = newDeltaH > deltaH || newDeltaW > deltaW;\n return improved ? adt$4.nofit(newReposition, newDeltaW, newDeltaH) : adt$4.nofit(reposition, deltaW, deltaH);\n });\n };\n var abc = foldl(candidates, function (b, a) {\n var bestNext = curry(attemptBestFit, a);\n return b.fold(adt$4.fit, bestNext);\n }, adt$4.nofit({\n x: anchorBox.x,\n y: anchorBox.y,\n width: elementBox.width,\n height: elementBox.height,\n maxHeight: elementBox.height,\n maxWidth: elementBox.width,\n direction: southeast(),\n classes: {\n on: [],\n off: []\n },\n label: 'none',\n candidateYforTest: anchorBox.y\n }, -1, -1));\n return abc.fold(identity, identity);\n };\n\n var elementSize = function (p) {\n return {\n width: getOuter$2(p),\n height: getOuter$1(p)\n };\n };\n var layout = function (anchorBox, element, bubbles, options) {\n remove$6(element, 'max-height');\n remove$6(element, 'max-width');\n var elementBox = elementSize(element);\n return attempts(options.preference, anchorBox, elementBox, bubbles, options.bounds);\n };\n var setClasses = function (element, decision) {\n var classInfo = decision.classes;\n remove$5(element, classInfo.off);\n add$3(element, classInfo.on);\n };\n var setHeight = function (element, decision, options) {\n var maxHeightFunction = options.maxHeightFunction;\n maxHeightFunction(element, decision.maxHeight);\n };\n var setWidth = function (element, decision, options) {\n var maxWidthFunction = options.maxWidthFunction;\n maxWidthFunction(element, decision.maxWidth);\n };\n var position = function (element, decision, options) {\n applyPositionCss(element, reposition(options.origin, decision));\n };\n\n var setMaxHeight = function (element, maxHeight) {\n setMax(element, Math.floor(maxHeight));\n };\n var anchored = constant(function (element, available) {\n setMaxHeight(element, available);\n setAll$1(element, {\n 'overflow-x': 'hidden',\n 'overflow-y': 'auto'\n });\n });\n var expandable = constant(function (element, available) {\n setMaxHeight(element, available);\n });\n\n var defaultOr = function (options, key, dephault) {\n return options[key] === undefined ? dephault : options[key];\n };\n var simple = function (anchor, element, bubble, layouts, getBounds, overrideOptions) {\n var maxHeightFunction = defaultOr(overrideOptions, 'maxHeightFunction', anchored());\n var maxWidthFunction = defaultOr(overrideOptions, 'maxWidthFunction', noop);\n var anchorBox = anchor.anchorBox();\n var origin = anchor.origin();\n var options = {\n bounds: viewport$1(origin, getBounds),\n origin: origin,\n preference: layouts,\n maxHeightFunction: maxHeightFunction,\n maxWidthFunction: maxWidthFunction\n };\n go(anchorBox, element, bubble, options);\n };\n var go = function (anchorBox, element, bubble, options) {\n var decision = layout(anchorBox, element, bubble, options);\n position(element, decision, options);\n setClasses(element, decision);\n setHeight(element, decision, options);\n setWidth(element, decision, options);\n };\n\n var allAlignments = [\n 'valignCentre',\n 'alignLeft',\n 'alignRight',\n 'alignCentre',\n 'top',\n 'bottom',\n 'left',\n 'right'\n ];\n var nu$8 = function (width, yoffset, classes) {\n var getClasses = function (prop) {\n return get(classes, prop).getOr([]);\n };\n var make = function (xDelta, yDelta, alignmentsOn) {\n var alignmentsOff = difference(allAlignments, alignmentsOn);\n return {\n offset: function () {\n return Position(xDelta, yDelta);\n },\n classesOn: function () {\n return bind(alignmentsOn, getClasses);\n },\n classesOff: function () {\n return bind(alignmentsOff, getClasses);\n }\n };\n };\n return {\n southeast: function () {\n return make(-width, yoffset, [\n 'top',\n 'alignLeft'\n ]);\n },\n southwest: function () {\n return make(width, yoffset, [\n 'top',\n 'alignRight'\n ]);\n },\n south: function () {\n return make(-width / 2, yoffset, [\n 'top',\n 'alignCentre'\n ]);\n },\n northeast: function () {\n return make(-width, -yoffset, [\n 'bottom',\n 'alignLeft'\n ]);\n },\n northwest: function () {\n return make(width, -yoffset, [\n 'bottom',\n 'alignRight'\n ]);\n },\n north: function () {\n return make(-width / 2, -yoffset, [\n 'bottom',\n 'alignCentre'\n ]);\n },\n east: function () {\n return make(width, -yoffset / 2, [\n 'valignCentre',\n 'left'\n ]);\n },\n west: function () {\n return make(-width, -yoffset / 2, [\n 'valignCentre',\n 'right'\n ]);\n },\n innerNorthwest: function () {\n return make(-width, yoffset, [\n 'top',\n 'alignRight'\n ]);\n },\n innerNortheast: function () {\n return make(width, yoffset, [\n 'top',\n 'alignLeft'\n ]);\n },\n innerNorth: function () {\n return make(-width / 2, yoffset, [\n 'top',\n 'alignCentre'\n ]);\n },\n innerSouthwest: function () {\n return make(-width, -yoffset, [\n 'bottom',\n 'alignRight'\n ]);\n },\n innerSoutheast: function () {\n return make(width, -yoffset, [\n 'bottom',\n 'alignLeft'\n ]);\n },\n innerSouth: function () {\n return make(-width / 2, -yoffset, [\n 'bottom',\n 'alignCentre'\n ]);\n },\n innerWest: function () {\n return make(width, -yoffset / 2, [\n 'valignCentre',\n 'right'\n ]);\n },\n innerEast: function () {\n return make(-width, -yoffset / 2, [\n 'valignCentre',\n 'left'\n ]);\n }\n };\n };\n var fallback = function () {\n return nu$8(0, 0, {});\n };\n\n var nu$9 = function (x) {\n return x;\n };\n\n var onDirection = function (isLtr, isRtl) {\n return function (element) {\n return getDirection(element) === 'rtl' ? isRtl : isLtr;\n };\n };\n var getDirection = function (element) {\n return get$4(element, 'direction') === 'rtl' ? 'rtl' : 'ltr';\n };\n\n var AttributeValue;\n (function (AttributeValue) {\n AttributeValue['TopToBottom'] = 'toptobottom';\n AttributeValue['BottomToTop'] = 'bottomtotop';\n }(AttributeValue || (AttributeValue = {})));\n var Attribute = 'data-alloy-vertical-dir';\n var isBottomToTopDir = function (el) {\n return closest$2(el, function (current) {\n return isElement(current) && get$2(current, Attribute) === AttributeValue.BottomToTop;\n });\n };\n\n var schema$1 = function () {\n return optionObjOf('layouts', [\n strict$1('onLtr'),\n strict$1('onRtl'),\n option('onBottomLtr'),\n option('onBottomRtl')\n ]);\n };\n var get$a = function (elem, info, defaultLtr, defaultRtl, defaultBottomLtr, defaultBottomRtl, dirElement) {\n var isBottomToTop = dirElement.map(isBottomToTopDir).getOr(false);\n var customLtr = info.layouts.map(function (ls) {\n return ls.onLtr(elem);\n });\n var customRtl = info.layouts.map(function (ls) {\n return ls.onRtl(elem);\n });\n var ltr = isBottomToTop ? info.layouts.bind(function (ls) {\n return ls.onBottomLtr.map(function (f) {\n return f(elem);\n });\n }).or(customLtr).getOr(defaultBottomLtr) : customLtr.getOr(defaultLtr);\n var rtl = isBottomToTop ? info.layouts.bind(function (ls) {\n return ls.onBottomRtl.map(function (f) {\n return f(elem);\n });\n }).or(customRtl).getOr(defaultBottomRtl) : customRtl.getOr(defaultRtl);\n var f = onDirection(ltr, rtl);\n return f(elem);\n };\n\n var placement = function (component, anchorInfo, origin) {\n var hotspot = anchorInfo.hotspot;\n var anchorBox = toBox(origin, hotspot.element());\n var layouts = get$a(component.element(), anchorInfo, belowOrAbove(), belowOrAboveRtl(), aboveOrBelow(), aboveOrBelowRtl(), Option.some(anchorInfo.hotspot.element()));\n return Option.some(nu$9({\n anchorBox: anchorBox,\n bubble: anchorInfo.bubble.getOr(fallback()),\n overrides: anchorInfo.overrides,\n layouts: layouts,\n placer: Option.none()\n }));\n };\n var HotspotAnchor = [\n strict$1('hotspot'),\n option('bubble'),\n defaulted$1('overrides', {}),\n schema$1(),\n output('placement', placement)\n ];\n\n var placement$1 = function (component, anchorInfo, origin) {\n var pos = translate(origin, anchorInfo.x, anchorInfo.y);\n var anchorBox = bounds$1(pos.left(), pos.top(), anchorInfo.width, anchorInfo.height);\n var layouts = get$a(component.element(), anchorInfo, all$2(), allRtl(), all$2(), allRtl(), Option.none());\n return Option.some(nu$9({\n anchorBox: anchorBox,\n bubble: anchorInfo.bubble,\n overrides: anchorInfo.overrides,\n layouts: layouts,\n placer: Option.none()\n }));\n };\n var MakeshiftAnchor = [\n strict$1('x'),\n strict$1('y'),\n defaulted$1('height', 0),\n defaulted$1('width', 0),\n defaulted$1('bubble', fallback()),\n defaulted$1('overrides', {}),\n schema$1(),\n output('placement', placement$1)\n ];\n\n var zeroWidth = '\\uFEFF';\n var nbsp = '\\xA0';\n\n var create$2 = function (start, soffset, finish, foffset) {\n return {\n start: constant(start),\n soffset: constant(soffset),\n finish: constant(finish),\n foffset: constant(foffset)\n };\n };\n var SimRange = { create: create$2 };\n\n var adt$5 = Adt.generate([\n { before: ['element'] },\n {\n on: [\n 'element',\n 'offset'\n ]\n },\n { after: ['element'] }\n ]);\n var cata$2 = function (subject, onBefore, onOn, onAfter) {\n return subject.fold(onBefore, onOn, onAfter);\n };\n var getStart = function (situ) {\n return situ.fold(identity, identity, identity);\n };\n var before$2 = adt$5.before;\n var on = adt$5.on;\n var after$1 = adt$5.after;\n var Situ = {\n before: before$2,\n on: on,\n after: after$1,\n cata: cata$2,\n getStart: getStart\n };\n\n var adt$6 = Adt.generate([\n { domRange: ['rng'] },\n {\n relative: [\n 'startSitu',\n 'finishSitu'\n ]\n },\n {\n exact: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var exactFromRange = function (simRange) {\n return adt$6.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset());\n };\n var getStart$1 = function (selection) {\n return selection.match({\n domRange: function (rng) {\n return Element.fromDom(rng.startContainer);\n },\n relative: function (startSitu, _finishSitu) {\n return Situ.getStart(startSitu);\n },\n exact: function (start, _soffset, _finish, _foffset) {\n return start;\n }\n });\n };\n var domRange = adt$6.domRange;\n var relative$1 = adt$6.relative;\n var exact = adt$6.exact;\n var getWin = function (selection) {\n var start = getStart$1(selection);\n return defaultView(start);\n };\n var range$1 = SimRange.create;\n var Selection = {\n domRange: domRange,\n relative: relative$1,\n exact: exact,\n exactFromRange: exactFromRange,\n getWin: getWin,\n range: range$1\n };\n\n var setStart = function (rng, situ) {\n situ.fold(function (e) {\n rng.setStartBefore(e.dom());\n }, function (e, o) {\n rng.setStart(e.dom(), o);\n }, function (e) {\n rng.setStartAfter(e.dom());\n });\n };\n var setFinish = function (rng, situ) {\n situ.fold(function (e) {\n rng.setEndBefore(e.dom());\n }, function (e, o) {\n rng.setEnd(e.dom(), o);\n }, function (e) {\n rng.setEndAfter(e.dom());\n });\n };\n var relativeToNative = function (win, startSitu, finishSitu) {\n var range = win.document.createRange();\n setStart(range, startSitu);\n setFinish(range, finishSitu);\n return range;\n };\n var exactToNative = function (win, start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n };\n var toRect = function (rect) {\n return {\n left: constant(rect.left),\n top: constant(rect.top),\n right: constant(rect.right),\n bottom: constant(rect.bottom),\n width: constant(rect.width),\n height: constant(rect.height)\n };\n };\n var getFirstRect = function (rng) {\n var rects = rng.getClientRects();\n var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect();\n return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect) : Option.none();\n };\n\n var adt$7 = Adt.generate([\n {\n ltr: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n },\n {\n rtl: [\n 'start',\n 'soffset',\n 'finish',\n 'foffset'\n ]\n }\n ]);\n var fromRange = function (win, type, range) {\n return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset);\n };\n var getRanges = function (win, selection) {\n return selection.match({\n domRange: function (rng) {\n return {\n ltr: constant(rng),\n rtl: Option.none\n };\n },\n relative: function (startSitu, finishSitu) {\n return {\n ltr: cached(function () {\n return relativeToNative(win, startSitu, finishSitu);\n }),\n rtl: cached(function () {\n return Option.some(relativeToNative(win, finishSitu, startSitu));\n })\n };\n },\n exact: function (start, soffset, finish, foffset) {\n return {\n ltr: cached(function () {\n return exactToNative(win, start, soffset, finish, foffset);\n }),\n rtl: cached(function () {\n return Option.some(exactToNative(win, finish, foffset, start, soffset));\n })\n };\n }\n });\n };\n var doDiagnose = function (win, ranges) {\n var rng = ranges.ltr();\n if (rng.collapsed) {\n var reversed = ranges.rtl().filter(function (rev) {\n return rev.collapsed === false;\n });\n return reversed.map(function (rev) {\n return adt$7.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset);\n }).getOrThunk(function () {\n return fromRange(win, adt$7.ltr, rng);\n });\n } else {\n return fromRange(win, adt$7.ltr, rng);\n }\n };\n var diagnose = function (win, selection) {\n var ranges = getRanges(win, selection);\n return doDiagnose(win, ranges);\n };\n var asLtrRange = function (win, selection) {\n var diagnosis = diagnose(win, selection);\n return diagnosis.match({\n ltr: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n },\n rtl: function (start, soffset, finish, foffset) {\n var rng = win.document.createRange();\n rng.setStart(finish.dom(), foffset);\n rng.setEnd(start.dom(), soffset);\n return rng;\n }\n });\n };\n var ltr = adt$7.ltr;\n var rtl = adt$7.rtl;\n\n function NodeValue (is, name) {\n var get = function (element) {\n if (!is(element)) {\n throw new Error('Can only get ' + name + ' value of a ' + name + ' node');\n }\n return getOption(element).getOr('');\n };\n var getOption = function (element) {\n return is(element) ? Option.from(element.dom().nodeValue) : Option.none();\n };\n var set = function (element, value) {\n if (!is(element)) {\n throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');\n }\n element.dom().nodeValue = value;\n };\n return {\n get: get,\n getOption: getOption,\n set: set\n };\n }\n\n var api$2 = NodeValue(isText, 'text');\n var get$b = function (element) {\n return api$2.get(element);\n };\n var getOption = function (element) {\n return api$2.getOption(element);\n };\n\n var getEnd = function (element) {\n return name(element) === 'img' ? 1 : getOption(element).fold(function () {\n return children(element).length;\n }, function (v) {\n return v.length;\n });\n };\n var isTextNodeWithCursorPosition = function (el) {\n return getOption(el).filter(function (text) {\n return text.trim().length !== 0 || text.indexOf(nbsp) > -1;\n }).isSome();\n };\n var elementsWithCursorPosition = [\n 'img',\n 'br'\n ];\n var isCursorPosition = function (elem) {\n var hasCursorPosition = isTextNodeWithCursorPosition(elem);\n return hasCursorPosition || contains(elementsWithCursorPosition, name(elem));\n };\n\n var last$1 = function (element) {\n return descendantRtl(element, isCursorPosition);\n };\n var descendantRtl = function (scope, predicate) {\n var descend = function (element) {\n var children$1 = children(element);\n for (var i = children$1.length - 1; i >= 0; i--) {\n var child = children$1[i];\n if (predicate(child)) {\n return Option.some(child);\n }\n var res = descend(child);\n if (res.isSome()) {\n return res;\n }\n }\n return Option.none();\n };\n return descend(scope);\n };\n\n var descendants = function (scope, selector) {\n return all(selector, scope);\n };\n\n var makeRange = function (start, soffset, finish, foffset) {\n var doc = owner(start);\n var rng = doc.dom().createRange();\n rng.setStart(start.dom(), soffset);\n rng.setEnd(finish.dom(), foffset);\n return rng;\n };\n var after$2 = function (start, soffset, finish, foffset) {\n var r = makeRange(start, soffset, finish, foffset);\n var same = eq$1(start, finish) && soffset === foffset;\n return r.collapsed && !same;\n };\n\n var readRange = function (selection) {\n if (selection.rangeCount > 0) {\n var firstRng = selection.getRangeAt(0);\n var lastRng = selection.getRangeAt(selection.rangeCount - 1);\n return Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset));\n } else {\n return Option.none();\n }\n };\n var doGetExact = function (selection) {\n var anchor = Element.fromDom(selection.anchorNode);\n var focus = Element.fromDom(selection.focusNode);\n return after$2(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection);\n };\n var getExact = function (win) {\n return Option.from(win.getSelection()).filter(function (sel) {\n return sel.rangeCount > 0;\n }).bind(doGetExact);\n };\n var getFirstRect$1 = function (win, selection) {\n var rng = asLtrRange(win, selection);\n return getFirstRect(rng);\n };\n\n var point = function (element, offset) {\n return {\n element: element,\n offset: offset\n };\n };\n var descendOnce = function (element, offset) {\n var children$1 = children(element);\n if (children$1.length === 0) {\n return point(element, offset);\n } else if (offset < children$1.length) {\n return point(children$1[offset], 0);\n } else {\n var last = children$1[children$1.length - 1];\n var len = isText(last) ? get$b(last).length : children(last).length;\n return point(last, len);\n }\n };\n\n var adt$8 = Adt.generate([\n { screen: ['point'] },\n {\n absolute: [\n 'point',\n 'scrollLeft',\n 'scrollTop'\n ]\n }\n ]);\n var toFixed = function (pos) {\n return pos.fold(identity, function (point, scrollLeft, scrollTop) {\n return point.translate(-scrollLeft, -scrollTop);\n });\n };\n var toAbsolute = function (pos) {\n return pos.fold(identity, identity);\n };\n var sum = function (points) {\n return foldl(points, function (b, a) {\n return b.translate(a.left(), a.top());\n }, Position(0, 0));\n };\n var sumAsFixed = function (positions) {\n var points = map(positions, toFixed);\n return sum(points);\n };\n var sumAsAbsolute = function (positions) {\n var points = map(positions, toAbsolute);\n return sum(points);\n };\n var screen = adt$8.screen;\n var absolute$2 = adt$8.absolute;\n\n var getOffset = function (component, origin, anchorInfo) {\n var win = defaultView(anchorInfo.root).dom();\n var hasSameOwner = function (frame) {\n var frameOwner = owner(frame);\n var compOwner = owner(component.element());\n return eq$1(frameOwner, compOwner);\n };\n return Option.from(win.frameElement).map(Element.fromDom).filter(hasSameOwner).map(absolute);\n };\n var getRootPoint = function (component, origin, anchorInfo) {\n var doc = owner(component.element());\n var outerScroll = get$8(doc);\n var offset = getOffset(component, origin, anchorInfo).getOr(outerScroll);\n return absolute$2(offset, outerScroll.left(), outerScroll.top());\n };\n\n var capRect = function (left, top, width, height) {\n var newLeft = left, newTop = top, newWidth = width, newHeight = height;\n if (left < 0) {\n newLeft = 0;\n newWidth = width + left;\n }\n if (top < 0) {\n newTop = 0;\n newHeight = height + top;\n }\n var point = screen(Position(newLeft, newTop));\n return Option.some(pointed(point, newWidth, newHeight));\n };\n var calcNewAnchor = function (optBox, rootPoint, anchorInfo, origin, elem) {\n return optBox.map(function (box) {\n var points = [\n rootPoint,\n box.point\n ];\n var topLeft = cata$1(origin, function () {\n return sumAsAbsolute(points);\n }, function () {\n return sumAsAbsolute(points);\n }, function () {\n return sumAsFixed(points);\n });\n var anchorBox = rect(topLeft.left(), topLeft.top(), box.width, box.height);\n var layoutsLtr = anchorInfo.showAbove ? aboveOrBelow() : belowOrAbove();\n var layoutsRtl = anchorInfo.showAbove ? belowOrAboveRtl() : belowOrAboveRtl();\n var layouts = get$a(elem, anchorInfo, layoutsLtr, layoutsRtl, layoutsLtr, layoutsRtl, Option.none());\n return nu$9({\n anchorBox: anchorBox,\n bubble: anchorInfo.bubble.getOr(fallback()),\n overrides: anchorInfo.overrides,\n layouts: layouts,\n placer: Option.none()\n });\n });\n };\n\n var point$1 = function (element, offset) {\n return {\n element: element,\n offset: offset\n };\n };\n var descendOnce$1 = function (element, offset) {\n return isText(element) ? point$1(element, offset) : descendOnce(element, offset);\n };\n var getAnchorSelection = function (win, anchorInfo) {\n var getSelection = anchorInfo.getSelection.getOrThunk(function () {\n return function () {\n return getExact(win);\n };\n });\n return getSelection().map(function (sel) {\n var modStart = descendOnce$1(sel.start(), sel.soffset());\n var modFinish = descendOnce$1(sel.finish(), sel.foffset());\n return Selection.range(modStart.element, modStart.offset, modFinish.element, modFinish.offset);\n });\n };\n var placement$2 = function (component, anchorInfo, origin) {\n var win = defaultView(anchorInfo.root).dom();\n var rootPoint = getRootPoint(component, origin, anchorInfo);\n var selectionBox = getAnchorSelection(win, anchorInfo).bind(function (sel) {\n var optRect = getFirstRect$1(win, Selection.exactFromRange(sel)).orThunk(function () {\n var x = Element.fromText(zeroWidth);\n before(sel.start(), x);\n return getFirstRect$1(win, Selection.exact(x, 0, x, 1)).map(function (rect) {\n remove(x);\n return rect;\n });\n });\n return optRect.bind(function (rawRect) {\n return capRect(rawRect.left(), rawRect.top(), rawRect.width(), rawRect.height());\n });\n });\n var targetElement = getAnchorSelection(win, anchorInfo).bind(function (sel) {\n return isElement(sel.start()) ? Option.some(sel.start()) : parent(sel.start());\n });\n var elem = targetElement.getOr(component.element());\n return calcNewAnchor(selectionBox, rootPoint, anchorInfo, origin, elem);\n };\n var SelectionAnchor = [\n option('getSelection'),\n strict$1('root'),\n option('bubble'),\n schema$1(),\n defaulted$1('overrides', {}),\n defaulted$1('showAbove', false),\n output('placement', placement$2)\n ];\n\n var placement$3 = function (component, anchorInfo, origin) {\n var rootPoint = getRootPoint(component, origin, anchorInfo);\n return anchorInfo.node.bind(function (target) {\n var rect = target.dom().getBoundingClientRect();\n var nodeBox = capRect(rect.left, rect.top, rect.width, rect.height);\n var elem = anchorInfo.node.getOr(component.element());\n return calcNewAnchor(nodeBox, rootPoint, anchorInfo, origin, elem);\n });\n };\n var NodeAnchor = [\n strict$1('node'),\n strict$1('root'),\n option('bubble'),\n schema$1(),\n defaulted$1('overrides', {}),\n defaulted$1('showAbove', false),\n output('placement', placement$3)\n ];\n\n var eastX$1 = function (anchor) {\n return anchor.x + anchor.width;\n };\n var westX$1 = function (anchor, element) {\n return anchor.x - element.width;\n };\n var northY$1 = function (anchor, element) {\n return anchor.y - element.height + anchor.height;\n };\n var southY$1 = function (anchor) {\n return anchor.y;\n };\n var southeast$2 = function (anchor, element, bubbles) {\n return nu$7(eastX$1(anchor), southY$1(anchor), bubbles.southeast(), southeast(), boundsRestriction(anchor, {\n left: 0,\n top: 2\n }), 'link-layout-se');\n };\n var southwest$2 = function (anchor, element, bubbles) {\n return nu$7(westX$1(anchor, element), southY$1(anchor), bubbles.southwest(), southwest(), boundsRestriction(anchor, {\n right: 1,\n top: 2\n }), 'link-layout-sw');\n };\n var northeast$2 = function (anchor, element, bubbles) {\n return nu$7(eastX$1(anchor), northY$1(anchor, element), bubbles.northeast(), northeast(), boundsRestriction(anchor, {\n left: 0,\n bottom: 3\n }), 'link-layout-ne');\n };\n var northwest$2 = function (anchor, element, bubbles) {\n return nu$7(westX$1(anchor, element), northY$1(anchor, element), bubbles.northwest(), northwest(), boundsRestriction(anchor, {\n right: 1,\n bottom: 3\n }), 'link-layout-nw');\n };\n var all$3 = function () {\n return [\n southeast$2,\n southwest$2,\n northeast$2,\n northwest$2\n ];\n };\n var allRtl$1 = function () {\n return [\n southwest$2,\n southeast$2,\n northwest$2,\n northeast$2\n ];\n };\n\n var placement$4 = function (component, submenuInfo, origin) {\n var anchorBox = toBox(origin, submenuInfo.item.element());\n var layouts = get$a(component.element(), submenuInfo, all$3(), allRtl$1(), all$3(), allRtl$1(), Option.none());\n return Option.some(nu$9({\n anchorBox: anchorBox,\n bubble: fallback(),\n overrides: submenuInfo.overrides,\n layouts: layouts,\n placer: Option.none()\n }));\n };\n var SubmenuAnchor = [\n strict$1('item'),\n schema$1(),\n defaulted$1('overrides', {}),\n output('placement', placement$4)\n ];\n\n var AnchorSchema = choose$1('anchor', {\n selection: SelectionAnchor,\n node: NodeAnchor,\n hotspot: HotspotAnchor,\n submenu: SubmenuAnchor,\n makeshift: MakeshiftAnchor\n });\n\n var getFixedOrigin = function () {\n var html = domGlobals.document.documentElement;\n return fixed(0, 0, html.clientWidth, html.clientHeight);\n };\n var getRelativeOrigin = function (component) {\n var position = absolute(component.element());\n var bounds = component.element().dom().getBoundingClientRect();\n return relative(position.left(), position.top(), bounds.width, bounds.height);\n };\n var place = function (component, origin, anchoring, getBounds, placee) {\n var anchor = box$1(anchoring.anchorBox, origin);\n simple(anchor, placee.element(), anchoring.bubble, anchoring.layouts, getBounds, anchoring.overrides);\n };\n var position$1 = function (component, posConfig, posState, anchor, placee) {\n positionWithin(component, posConfig, posState, anchor, placee, Option.none());\n };\n var positionWithin = function (component, posConfig, posState, anchor, placee, boxElement) {\n var boundsBox = boxElement.map(box);\n return positionWithinBounds(component, posConfig, posState, anchor, placee, boundsBox);\n };\n var positionWithinBounds = function (component, posConfig, posState, anchor, placee, bounds) {\n var anchorage = asRawOrDie('positioning anchor.info', AnchorSchema, anchor);\n preserve(function () {\n set$2(placee.element(), 'position', 'fixed');\n var oldVisibility = getRaw(placee.element(), 'visibility');\n set$2(placee.element(), 'visibility', 'hidden');\n var origin = posConfig.useFixed() ? getFixedOrigin() : getRelativeOrigin(component);\n var placer = anchorage.placement;\n var getBounds = bounds.map(constant).or(posConfig.getBounds);\n placer(component, anchorage, origin).each(function (anchoring) {\n var doPlace = anchoring.placer.getOr(place);\n doPlace(component, origin, anchoring, getBounds, placee);\n });\n oldVisibility.fold(function () {\n remove$6(placee.element(), 'visibility');\n }, function (vis) {\n set$2(placee.element(), 'visibility', vis);\n });\n if (getRaw(placee.element(), 'left').isNone() && getRaw(placee.element(), 'top').isNone() && getRaw(placee.element(), 'right').isNone() && getRaw(placee.element(), 'bottom').isNone() && getRaw(placee.element(), 'position').is('fixed')) {\n remove$6(placee.element(), 'position');\n }\n }, placee.element());\n };\n var getMode = function (component, pConfig, _pState) {\n return pConfig.useFixed() ? 'fixed' : 'absolute';\n };\n\n var PositionApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n position: position$1,\n positionWithin: positionWithin,\n positionWithinBounds: positionWithinBounds,\n getMode: getMode\n });\n\n var PositionSchema = [\n defaulted$1('useFixed', never),\n option('getBounds')\n ];\n\n var Positioning = create$1({\n fields: PositionSchema,\n name: 'positioning',\n active: ActivePosition,\n apis: PositionApis\n });\n\n var fireDetaching = function (component) {\n emit(component, detachedFromDom());\n var children = component.components();\n each(children, fireDetaching);\n };\n var fireAttaching = function (component) {\n var children = component.components();\n each(children, fireAttaching);\n emit(component, attachedToDom());\n };\n var attach = function (parent, child) {\n append(parent.element(), child.element());\n };\n var detachChildren = function (component) {\n each(component.components(), function (childComp) {\n return remove(childComp.element());\n });\n empty(component.element());\n component.syncComponents();\n };\n var replaceChildren = function (component, newChildren) {\n var subs = component.components();\n detachChildren(component);\n var deleted = difference(subs, newChildren);\n each(deleted, function (comp) {\n fireDetaching(comp);\n component.getSystem().removeFromWorld(comp);\n });\n each(newChildren, function (childComp) {\n if (!childComp.getSystem().isConnected()) {\n component.getSystem().addToWorld(childComp);\n attach(component, childComp);\n if (inBody(component.element())) {\n fireAttaching(childComp);\n }\n } else {\n attach(component, childComp);\n }\n component.syncComponents();\n });\n };\n\n var attach$1 = function (parent, child) {\n attachWith(parent, child, append);\n };\n var attachWith = function (parent, child, insertion) {\n parent.getSystem().addToWorld(child);\n insertion(parent.element(), child.element());\n if (inBody(parent.element())) {\n fireAttaching(child);\n }\n parent.syncComponents();\n };\n var doDetach = function (component) {\n fireDetaching(component);\n remove(component.element());\n component.getSystem().removeFromWorld(component);\n };\n var detach = function (component) {\n var parent$1 = parent(component.element()).bind(function (p) {\n return component.getSystem().getByDom(p).toOption();\n });\n doDetach(component);\n parent$1.each(function (p) {\n p.syncComponents();\n });\n };\n var detachChildren$1 = function (component) {\n var subs = component.components();\n each(subs, doDetach);\n empty(component.element());\n component.syncComponents();\n };\n var attachSystem = function (element, guiSystem) {\n attachSystemWith(element, guiSystem, append);\n };\n var attachSystemAfter = function (element, guiSystem) {\n attachSystemWith(element, guiSystem, after);\n };\n var attachSystemWith = function (element, guiSystem, inserter) {\n inserter(element, guiSystem.element());\n var children$1 = children(guiSystem.element());\n each(children$1, function (child) {\n guiSystem.getByDom(child).each(fireAttaching);\n });\n };\n var detachSystem = function (guiSystem) {\n var children$1 = children(guiSystem.element());\n each(children$1, function (child) {\n guiSystem.getByDom(child).each(fireDetaching);\n });\n remove(guiSystem.element());\n };\n\n var rebuild = function (sandbox, sConfig, sState, data) {\n sState.get().each(function (_data) {\n detachChildren$1(sandbox);\n });\n var point = sConfig.getAttachPoint(sandbox);\n attach$1(point, sandbox);\n var built = sandbox.getSystem().build(data);\n attach$1(sandbox, built);\n sState.set(built);\n return built;\n };\n var open = function (sandbox, sConfig, sState, data) {\n var newState = rebuild(sandbox, sConfig, sState, data);\n sConfig.onOpen(sandbox, newState);\n return newState;\n };\n var setContent = function (sandbox, sConfig, sState, data) {\n return sState.get().map(function () {\n return rebuild(sandbox, sConfig, sState, data);\n });\n };\n var openWhileCloaked = function (sandbox, sConfig, sState, data, transaction) {\n cloak(sandbox, sConfig);\n open(sandbox, sConfig, sState, data);\n transaction();\n decloak(sandbox, sConfig);\n };\n var close = function (sandbox, sConfig, sState) {\n sState.get().each(function (data) {\n detachChildren$1(sandbox);\n detach(sandbox);\n sConfig.onClose(sandbox, data);\n sState.clear();\n });\n };\n var isOpen = function (_sandbox, _sConfig, sState) {\n return sState.isOpen();\n };\n var isPartOf$1 = function (sandbox, sConfig, sState, queryElem) {\n return isOpen(sandbox, sConfig, sState) && sState.get().exists(function (data) {\n return sConfig.isPartOf(sandbox, data, queryElem);\n });\n };\n var getState = function (_sandbox, _sConfig, sState) {\n return sState.get();\n };\n var store = function (sandbox, cssKey, attr, newValue) {\n getRaw(sandbox.element(), cssKey).fold(function () {\n remove$1(sandbox.element(), attr);\n }, function (v) {\n set$1(sandbox.element(), attr, v);\n });\n set$2(sandbox.element(), cssKey, newValue);\n };\n var restore = function (sandbox, cssKey, attr) {\n getOpt(sandbox.element(), attr).fold(function () {\n return remove$6(sandbox.element(), cssKey);\n }, function (oldValue) {\n return set$2(sandbox.element(), cssKey, oldValue);\n });\n };\n var cloak = function (sandbox, sConfig, _sState) {\n var sink = sConfig.getAttachPoint(sandbox);\n set$2(sandbox.element(), 'position', Positioning.getMode(sink));\n store(sandbox, 'visibility', sConfig.cloakVisibilityAttr, 'hidden');\n };\n var hasPosition = function (element) {\n return exists([\n 'top',\n 'left',\n 'right',\n 'bottom'\n ], function (pos) {\n return getRaw(element, pos).isSome();\n });\n };\n var decloak = function (sandbox, sConfig, _sState) {\n if (!hasPosition(sandbox.element())) {\n remove$6(sandbox.element(), 'position');\n }\n restore(sandbox, 'visibility', sConfig.cloakVisibilityAttr);\n };\n\n var SandboxApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n cloak: cloak,\n decloak: decloak,\n open: open,\n openWhileCloaked: openWhileCloaked,\n close: close,\n isOpen: isOpen,\n isPartOf: isPartOf$1,\n getState: getState,\n setContent: setContent\n });\n\n var events$2 = function (sandboxConfig, sandboxState) {\n return derive([run(sandboxClose(), function (sandbox, _simulatedEvent) {\n close(sandbox, sandboxConfig, sandboxState);\n })]);\n };\n\n var ActiveSandbox = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$2\n });\n\n var SandboxSchema = [\n onHandler('onOpen'),\n onHandler('onClose'),\n strict$1('isPartOf'),\n strict$1('getAttachPoint'),\n defaulted$1('cloakVisibilityAttr', 'data-precloak-visibility')\n ];\n\n var init = function () {\n var contents = Cell(Option.none());\n var readState = constant('not-implemented');\n var isOpen = function () {\n return contents.get().isSome();\n };\n var set = function (comp) {\n contents.set(Option.some(comp));\n };\n var get = function () {\n return contents.get();\n };\n var clear = function () {\n contents.set(Option.none());\n };\n return nu$5({\n readState: readState,\n isOpen: isOpen,\n clear: clear,\n set: set,\n get: get\n });\n };\n\n var SandboxState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init\n });\n\n var Sandboxing = create$1({\n fields: SandboxSchema,\n name: 'sandboxing',\n active: ActiveSandbox,\n apis: SandboxApis,\n state: SandboxState\n });\n\n var dismissPopups = constant('dismiss.popups');\n var repositionPopups = constant('reposition.popups');\n var mouseReleased = constant('mouse.released');\n\n var schema$2 = objOfOnly([\n defaulted$1('isExtraPart', constant(false)),\n optionObjOf('fireEventInstead', [defaulted$1('event', dismissRequested())])\n ]);\n var receivingChannel = function (rawSpec) {\n var _a;\n var detail = asRawOrDie('Dismissal', schema$2, rawSpec);\n return _a = {}, _a[dismissPopups()] = {\n schema: objOfOnly([strict$1('target')]),\n onReceive: function (sandbox, data) {\n if (Sandboxing.isOpen(sandbox)) {\n var isPart = Sandboxing.isPartOf(sandbox, data.target) || detail.isExtraPart(sandbox, data.target);\n if (!isPart) {\n detail.fireEventInstead.fold(function () {\n return Sandboxing.close(sandbox);\n }, function (fe) {\n return emit(sandbox, fe.event);\n });\n }\n }\n }\n }, _a;\n };\n\n var schema$3 = objOfOnly([\n optionObjOf('fireEventInstead', [defaulted$1('event', repositionRequested())]),\n strictFunction('doReposition')\n ]);\n var receivingChannel$1 = function (rawSpec) {\n var _a;\n var detail = asRawOrDie('Reposition', schema$3, rawSpec);\n return _a = {}, _a[repositionPopups()] = {\n onReceive: function (sandbox) {\n if (Sandboxing.isOpen(sandbox)) {\n detail.fireEventInstead.fold(function () {\n return detail.doReposition(sandbox);\n }, function (fe) {\n return emit(sandbox, fe.event);\n });\n }\n }\n }, _a;\n };\n\n var onLoad = function (component, repConfig, repState) {\n repConfig.store.manager.onLoad(component, repConfig, repState);\n };\n var onUnload = function (component, repConfig, repState) {\n repConfig.store.manager.onUnload(component, repConfig, repState);\n };\n var setValue = function (component, repConfig, repState, data) {\n repConfig.store.manager.setValue(component, repConfig, repState, data);\n };\n var getValue = function (component, repConfig, repState) {\n return repConfig.store.manager.getValue(component, repConfig, repState);\n };\n var getState$1 = function (component, repConfig, repState) {\n return repState;\n };\n\n var RepresentApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n onLoad: onLoad,\n onUnload: onUnload,\n setValue: setValue,\n getValue: getValue,\n getState: getState$1\n });\n\n var events$3 = function (repConfig, repState) {\n var es = repConfig.resetOnDom ? [\n runOnAttached(function (comp, _se) {\n onLoad(comp, repConfig, repState);\n }),\n runOnDetached(function (comp, _se) {\n onUnload(comp, repConfig, repState);\n })\n ] : [loadEvent(repConfig, repState, onLoad)];\n return derive(es);\n };\n\n var ActiveRepresenting = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$3\n });\n\n var memory = function () {\n var data = Cell(null);\n var readState = function () {\n return {\n mode: 'memory',\n value: data.get()\n };\n };\n var isNotSet = function () {\n return data.get() === null;\n };\n var clear = function () {\n data.set(null);\n };\n return nu$5({\n set: data.set,\n get: data.get,\n isNotSet: isNotSet,\n clear: clear,\n readState: readState\n });\n };\n var manual = function () {\n var readState = function () {\n };\n return nu$5({ readState: readState });\n };\n var dataset = function () {\n var dataByValue = Cell({});\n var dataByText = Cell({});\n var readState = function () {\n return {\n mode: 'dataset',\n dataByValue: dataByValue.get(),\n dataByText: dataByText.get()\n };\n };\n var clear = function () {\n dataByValue.set({});\n dataByText.set({});\n };\n var lookup = function (itemString) {\n return get(dataByValue.get(), itemString).orThunk(function () {\n return get(dataByText.get(), itemString);\n });\n };\n var update = function (items) {\n var currentDataByValue = dataByValue.get();\n var currentDataByText = dataByText.get();\n var newDataByValue = {};\n var newDataByText = {};\n each(items, function (item) {\n newDataByValue[item.value] = item;\n get(item, 'meta').each(function (meta) {\n get(meta, 'text').each(function (text) {\n newDataByText[text] = item;\n });\n });\n });\n dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue));\n dataByText.set(__assign(__assign({}, currentDataByText), newDataByText));\n };\n return nu$5({\n readState: readState,\n lookup: lookup,\n update: update,\n clear: clear\n });\n };\n var init$1 = function (spec) {\n return spec.store.manager.state(spec);\n };\n\n var RepresentState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n memory: memory,\n dataset: dataset,\n manual: manual,\n init: init$1\n });\n\n var setValue$1 = function (component, repConfig, repState, data) {\n var store = repConfig.store;\n repState.update([data]);\n store.setValue(component, data);\n repConfig.onSetValue(component, data);\n };\n var getValue$1 = function (component, repConfig, repState) {\n var store = repConfig.store;\n var key = store.getDataKey(component);\n return repState.lookup(key).fold(function () {\n return store.getFallbackEntry(key);\n }, function (data) {\n return data;\n });\n };\n var onLoad$1 = function (component, repConfig, repState) {\n var store = repConfig.store;\n store.initialValue.each(function (data) {\n setValue$1(component, repConfig, repState, data);\n });\n };\n var onUnload$1 = function (component, repConfig, repState) {\n repState.clear();\n };\n var DatasetStore = [\n option('initialValue'),\n strict$1('getFallbackEntry'),\n strict$1('getDataKey'),\n strict$1('setValue'),\n output('manager', {\n setValue: setValue$1,\n getValue: getValue$1,\n onLoad: onLoad$1,\n onUnload: onUnload$1,\n state: dataset\n })\n ];\n\n var getValue$2 = function (component, repConfig, _repState) {\n return repConfig.store.getValue(component);\n };\n var setValue$2 = function (component, repConfig, _repState, data) {\n repConfig.store.setValue(component, data);\n repConfig.onSetValue(component, data);\n };\n var onLoad$2 = function (component, repConfig, _repState) {\n repConfig.store.initialValue.each(function (data) {\n repConfig.store.setValue(component, data);\n });\n };\n var ManualStore = [\n strict$1('getValue'),\n defaulted$1('setValue', noop),\n option('initialValue'),\n output('manager', {\n setValue: setValue$2,\n getValue: getValue$2,\n onLoad: onLoad$2,\n onUnload: noop,\n state: NoState.init\n })\n ];\n\n var setValue$3 = function (component, repConfig, repState, data) {\n repState.set(data);\n repConfig.onSetValue(component, data);\n };\n var getValue$3 = function (component, repConfig, repState) {\n return repState.get();\n };\n var onLoad$3 = function (component, repConfig, repState) {\n repConfig.store.initialValue.each(function (initVal) {\n if (repState.isNotSet()) {\n repState.set(initVal);\n }\n });\n };\n var onUnload$2 = function (component, repConfig, repState) {\n repState.clear();\n };\n var MemoryStore = [\n option('initialValue'),\n output('manager', {\n setValue: setValue$3,\n getValue: getValue$3,\n onLoad: onLoad$3,\n onUnload: onUnload$2,\n state: memory\n })\n ];\n\n var RepresentSchema = [\n defaultedOf('store', { mode: 'memory' }, choose$1('mode', {\n memory: MemoryStore,\n manual: ManualStore,\n dataset: DatasetStore\n })),\n onHandler('onSetValue'),\n defaulted$1('resetOnDom', false)\n ];\n\n var Representing = create$1({\n fields: RepresentSchema,\n name: 'representing',\n active: ActiveRepresenting,\n apis: RepresentApis,\n extra: {\n setValueFrom: function (component, source) {\n var value = Representing.getValue(source);\n Representing.setValue(component, value);\n }\n },\n state: RepresentState\n });\n\n var field$1 = function (name, forbidden) {\n return defaultedObjOf(name, {}, map(forbidden, function (f) {\n return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name);\n }).concat([state$1('dump', identity)]));\n };\n var get$c = function (data) {\n return data.dump;\n };\n var augment = function (data, original) {\n return __assign(__assign({}, data.dump), derive$1(original));\n };\n var SketchBehaviours = {\n field: field$1,\n augment: augment,\n get: get$c\n };\n\n var _placeholder = 'placeholder';\n var adt$9 = Adt.generate([\n {\n single: [\n 'required',\n 'valueThunk'\n ]\n },\n {\n multiple: [\n 'required',\n 'valueThunks'\n ]\n }\n ]);\n var isSubstituted = function (spec) {\n return has(spec, 'uiType');\n };\n var subPlaceholder = function (owner, detail, compSpec, placeholders) {\n if (owner.exists(function (o) {\n return o !== compSpec.owner;\n })) {\n return adt$9.single(true, constant(compSpec));\n }\n return get(placeholders, compSpec.name).fold(function () {\n throw new Error('Unknown placeholder component: ' + compSpec.name + '\\nKnown: [' + keys(placeholders) + ']\\nNamespace: ' + owner.getOr('none') + '\\nSpec: ' + JSON.stringify(compSpec, null, 2));\n }, function (newSpec) {\n return newSpec.replace();\n });\n };\n var scan = function (owner, detail, compSpec, placeholders) {\n if (isSubstituted(compSpec) && compSpec.uiType === _placeholder) {\n return subPlaceholder(owner, detail, compSpec, placeholders);\n } else {\n return adt$9.single(false, constant(compSpec));\n }\n };\n var substitute = function (owner, detail, compSpec, placeholders) {\n var base = scan(owner, detail, compSpec, placeholders);\n return base.fold(function (req, valueThunk) {\n var value = isSubstituted(compSpec) ? valueThunk(detail, compSpec.config, compSpec.validated) : valueThunk(detail);\n var childSpecs = get(value, 'components').getOr([]);\n var substituted = bind(childSpecs, function (c) {\n return substitute(owner, detail, c, placeholders);\n });\n return [__assign(__assign({}, value), { components: substituted })];\n }, function (req, valuesThunk) {\n if (isSubstituted(compSpec)) {\n var values = valuesThunk(detail, compSpec.config, compSpec.validated);\n var preprocessor = compSpec.validated.preprocess.getOr(identity);\n return preprocessor(values);\n } else {\n return valuesThunk(detail);\n }\n });\n };\n var substituteAll = function (owner, detail, components, placeholders) {\n return bind(components, function (c) {\n return substitute(owner, detail, c, placeholders);\n });\n };\n var oneReplace = function (label, replacements) {\n var called = false;\n var used = function () {\n return called;\n };\n var replace = function () {\n if (called) {\n throw new Error('Trying to use the same placeholder more than once: ' + label);\n }\n called = true;\n return replacements;\n };\n var required = function () {\n return replacements.fold(function (req, _) {\n return req;\n }, function (req, _) {\n return req;\n });\n };\n return {\n name: constant(label),\n required: required,\n used: used,\n replace: replace\n };\n };\n var substitutePlaces = function (owner, detail, components, placeholders) {\n var ps = map$2(placeholders, function (ph, name) {\n return oneReplace(name, ph);\n });\n var outcome = substituteAll(owner, detail, components, ps);\n each$1(ps, function (p) {\n if (p.used() === false && p.required()) {\n throw new Error('Placeholder: ' + p.name() + ' was not found in components list\\nNamespace: ' + owner.getOr('none') + '\\nComponents: ' + JSON.stringify(detail.components, null, 2));\n }\n });\n return outcome;\n };\n var single = adt$9.single;\n var multiple = adt$9.multiple;\n var placeholder = constant(_placeholder);\n\n var adt$a = Adt.generate([\n { required: ['data'] },\n { external: ['data'] },\n { optional: ['data'] },\n { group: ['data'] }\n ]);\n var fFactory = defaulted$1('factory', { sketch: identity });\n var fSchema = defaulted$1('schema', []);\n var fName = strict$1('name');\n var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) {\n return '';\n }), anyValue$1());\n var fGroupSchema = state$1('schema', function () {\n return [option('preprocess')];\n });\n var fDefaults = defaulted$1('defaults', constant({}));\n var fOverrides = defaulted$1('overrides', constant({}));\n var requiredSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fPname,\n fDefaults,\n fOverrides\n ]);\n var externalSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fDefaults,\n fOverrides\n ]);\n var optionalSpec = objOf([\n fFactory,\n fSchema,\n fName,\n fPname,\n fDefaults,\n fOverrides\n ]);\n var groupSpec = objOf([\n fFactory,\n fGroupSchema,\n fName,\n strict$1('unit'),\n fPname,\n fDefaults,\n fOverrides\n ]);\n var asNamedPart = function (part) {\n return part.fold(Option.some, Option.none, Option.some, Option.some);\n };\n var name$1 = function (part) {\n var get = function (data) {\n return data.name;\n };\n return part.fold(get, get, get, get);\n };\n var asCommon = function (part) {\n return part.fold(identity, identity, identity, identity);\n };\n var convert = function (adtConstructor, partSchema) {\n return function (spec) {\n var data = asRawOrDie('Converting part type', partSchema, spec);\n return adtConstructor(data);\n };\n };\n var required = convert(adt$a.required, requiredSpec);\n var external$1 = convert(adt$a.external, externalSpec);\n var optional = convert(adt$a.optional, optionalSpec);\n var group = convert(adt$a.group, groupSpec);\n var original = constant('entirety');\n\n var PartType = /*#__PURE__*/Object.freeze({\n __proto__: null,\n required: required,\n external: external$1,\n optional: optional,\n group: group,\n asNamedPart: asNamedPart,\n name: name$1,\n asCommon: asCommon,\n original: original\n });\n\n var combine$2 = function (detail, data, partSpec, partValidated) {\n return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated));\n };\n var subs = function (owner, detail, parts) {\n var internals = {};\n var externals = {};\n each(parts, function (part) {\n part.fold(function (data) {\n internals[data.pname] = single(true, function (detail, partSpec, partValidated) {\n return data.factory.sketch(combine$2(detail, data, partSpec, partValidated));\n });\n }, function (data) {\n var partSpec = detail.parts[data.name];\n externals[data.name] = constant(data.factory.sketch(combine$2(detail, data, partSpec[original()]), partSpec));\n }, function (data) {\n internals[data.pname] = single(false, function (detail, partSpec, partValidated) {\n return data.factory.sketch(combine$2(detail, data, partSpec, partValidated));\n });\n }, function (data) {\n internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) {\n var units = detail[data.name];\n return map(units, function (u) {\n return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u)));\n });\n });\n });\n });\n return {\n internals: constant(internals),\n externals: constant(externals)\n };\n };\n\n var generate$4 = function (owner, parts) {\n var r = {};\n each(parts, function (part) {\n asNamedPart(part).each(function (np) {\n var g = doGenerateOne(owner, np.pname);\n r[np.name] = function (config) {\n var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config);\n return __assign(__assign({}, g), {\n config: config,\n validated: validated\n });\n };\n });\n });\n return r;\n };\n var doGenerateOne = function (owner, pname) {\n return {\n uiType: placeholder(),\n owner: owner,\n name: pname\n };\n };\n var generateOne = function (owner, pname, config) {\n return {\n uiType: placeholder(),\n owner: owner,\n name: pname,\n config: config,\n validated: {}\n };\n };\n var schemas = function (parts) {\n return bind(parts, function (part) {\n return part.fold(Option.none, Option.some, Option.none, Option.none).map(function (data) {\n return strictObjOf(data.name, data.schema.concat([snapshot(original())]));\n }).toArray();\n });\n };\n var names = function (parts) {\n return map(parts, name$1);\n };\n var substitutes = function (owner, detail, parts) {\n return subs(owner, detail, parts);\n };\n var components = function (owner, detail, internals) {\n return substitutePlaces(Option.some(owner), detail, detail.components, internals);\n };\n var getPart = function (component, detail, partKey) {\n var uid = detail.partUids[partKey];\n return component.getSystem().getByUid(uid).toOption();\n };\n var getPartOrDie = function (component, detail, partKey) {\n return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey);\n };\n var getParts = function (component, detail, partKeys) {\n var r = {};\n var uids = detail.partUids;\n var system = component.getSystem();\n each(partKeys, function (pk) {\n r[pk] = constant(system.getByUid(uids[pk]));\n });\n return r;\n };\n var getAllParts = function (component, detail) {\n var system = component.getSystem();\n return map$2(detail.partUids, function (pUid, _k) {\n return constant(system.getByUid(pUid));\n });\n };\n var getAllPartNames = function (detail) {\n return keys(detail.partUids);\n };\n var getPartsOrDie = function (component, detail, partKeys) {\n var r = {};\n var uids = detail.partUids;\n var system = component.getSystem();\n each(partKeys, function (pk) {\n r[pk] = constant(system.getByUid(uids[pk]).getOrDie());\n });\n return r;\n };\n var defaultUids = function (baseUid, partTypes) {\n var partNames = names(partTypes);\n return wrapAll$1(map(partNames, function (pn) {\n return {\n key: pn,\n value: baseUid + '-' + pn\n };\n }));\n };\n var defaultUidsSchema = function (partTypes) {\n return field('partUids', 'partUids', mergeWithThunk(function (spec) {\n return defaultUids(spec.uid, partTypes);\n }), anyValue$1());\n };\n\n var AlloyParts = /*#__PURE__*/Object.freeze({\n __proto__: null,\n generate: generate$4,\n generateOne: generateOne,\n schemas: schemas,\n names: names,\n substitutes: substitutes,\n components: components,\n defaultUids: defaultUids,\n defaultUidsSchema: defaultUidsSchema,\n getAllParts: getAllParts,\n getAllPartNames: getAllPartNames,\n getPart: getPart,\n getPartOrDie: getPartOrDie,\n getParts: getParts,\n getPartsOrDie: getPartsOrDie\n });\n\n var base = function (partSchemas, partUidsSchemas) {\n var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : [];\n return ps.concat([\n strict$1('uid'),\n defaulted$1('dom', {}),\n defaulted$1('components', []),\n snapshot('originalSpec'),\n defaulted$1('debug.sketcher', {})\n ]).concat(partUidsSchemas);\n };\n var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) {\n var baseS = base(partSchemas, partUidsSchemas);\n return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec);\n };\n\n var single$1 = function (owner, schema, factory, spec) {\n var specWithUid = supplyUid(spec);\n var detail = asRawOrDie$1(owner, schema, specWithUid, [], []);\n return factory(detail, specWithUid);\n };\n var composite = function (owner, schema, partTypes, factory, spec) {\n var specWithUid = supplyUid(spec);\n var partSchemas = schemas(partTypes);\n var partUidsSchema = defaultUidsSchema(partTypes);\n var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]);\n var subs = substitutes(owner, detail, partTypes);\n var components$1 = components(owner, detail, subs.internals());\n return factory(detail, components$1, specWithUid, subs.externals());\n };\n var hasUid = function (spec) {\n return has(spec, 'uid');\n };\n var supplyUid = function (spec) {\n return hasUid(spec) ? spec : __assign(__assign({}, spec), { uid: generate$2('uid') });\n };\n\n function isSketchSpec(spec) {\n return spec.uid !== undefined;\n }\n var singleSchema = objOfOnly([\n strict$1('name'),\n strict$1('factory'),\n strict$1('configFields'),\n defaulted$1('apis', {}),\n defaulted$1('extraApis', {})\n ]);\n var compositeSchema = objOfOnly([\n strict$1('name'),\n strict$1('factory'),\n strict$1('configFields'),\n strict$1('partFields'),\n defaulted$1('apis', {}),\n defaulted$1('extraApis', {})\n ]);\n var single$2 = function (rawConfig) {\n var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig);\n var sketch = function (spec) {\n return single$1(config.name, config.configFields, config.factory, spec);\n };\n var apis = map$2(config.apis, makeApi);\n var extraApis = map$2(config.extraApis, function (f, k) {\n return markAsExtraApi(f, k);\n });\n return __assign(__assign({\n name: constant(config.name),\n configFields: constant(config.configFields),\n sketch: sketch\n }, apis), extraApis);\n };\n var composite$1 = function (rawConfig) {\n var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig);\n var sketch = function (spec) {\n return composite(config.name, config.configFields, config.partFields, config.factory, spec);\n };\n var parts = generate$4(config.name, config.partFields);\n var apis = map$2(config.apis, makeApi);\n var extraApis = map$2(config.extraApis, function (f, k) {\n return markAsExtraApi(f, k);\n });\n return __assign(__assign({\n name: constant(config.name),\n partFields: constant(config.partFields),\n configFields: constant(config.configFields),\n sketch: sketch,\n parts: constant(parts)\n }, apis), extraApis);\n };\n\n var cat = function (arr) {\n var r = [];\n var push = function (x) {\n r.push(x);\n };\n for (var i = 0; i < arr.length; i++) {\n arr[i].each(push);\n }\n return r;\n };\n var sequence = function (arr) {\n var r = [];\n for (var i = 0; i < arr.length; i++) {\n var x = arr[i];\n if (x.isSome()) {\n r.push(x.getOrDie());\n } else {\n return Option.none();\n }\n }\n return Option.some(r);\n };\n var lift2 = function (oa, ob, f) {\n return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none();\n };\n var lift3 = function (oa, ob, oc, f) {\n return oa.isSome() && ob.isSome() && oc.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Option.none();\n };\n\n var inside = function (target) {\n return name(target) === 'input' && get$2(target, 'type') !== 'radio' || name(target) === 'textarea';\n };\n\n var getCurrent = function (component, composeConfig, _composeState) {\n return composeConfig.find(component);\n };\n\n var ComposeApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getCurrent: getCurrent\n });\n\n var ComposeSchema = [strict$1('find')];\n\n var Composing = create$1({\n fields: ComposeSchema,\n name: 'composing',\n apis: ComposeApis\n });\n\n var dehighlightAllExcept = function (component, hConfig, hState, skip) {\n var highlighted = descendants(component.element(), '.' + hConfig.highlightClass);\n each(highlighted, function (h) {\n if (!exists(skip, function (skipComp) {\n return skipComp.element() === h;\n })) {\n remove$4(h, hConfig.highlightClass);\n component.getSystem().getByDom(h).each(function (target) {\n hConfig.onDehighlight(component, target);\n emit(target, dehighlight());\n });\n }\n });\n };\n var dehighlightAll = function (component, hConfig, hState) {\n return dehighlightAllExcept(component, hConfig, hState, []);\n };\n var dehighlight$1 = function (component, hConfig, hState, target) {\n if (isHighlighted(component, hConfig, hState, target)) {\n remove$4(target.element(), hConfig.highlightClass);\n hConfig.onDehighlight(component, target);\n emit(target, dehighlight());\n }\n };\n var highlight$1 = function (component, hConfig, hState, target) {\n dehighlightAllExcept(component, hConfig, hState, [target]);\n if (!isHighlighted(component, hConfig, hState, target)) {\n add$2(target.element(), hConfig.highlightClass);\n hConfig.onHighlight(component, target);\n emit(target, highlight());\n }\n };\n var highlightFirst = function (component, hConfig, hState) {\n getFirst(component, hConfig).each(function (firstComp) {\n highlight$1(component, hConfig, hState, firstComp);\n });\n };\n var highlightLast = function (component, hConfig, hState) {\n getLast(component, hConfig).each(function (lastComp) {\n highlight$1(component, hConfig, hState, lastComp);\n });\n };\n var highlightAt = function (component, hConfig, hState, index) {\n getByIndex(component, hConfig, hState, index).fold(function (err) {\n throw new Error(err);\n }, function (firstComp) {\n highlight$1(component, hConfig, hState, firstComp);\n });\n };\n var highlightBy = function (component, hConfig, hState, predicate) {\n var candidates = getCandidates(component, hConfig);\n var targetComp = find(candidates, predicate);\n targetComp.each(function (c) {\n highlight$1(component, hConfig, hState, c);\n });\n };\n var isHighlighted = function (component, hConfig, hState, queryTarget) {\n return has$2(queryTarget.element(), hConfig.highlightClass);\n };\n var getHighlighted = function (component, hConfig, _hState) {\n return descendant$1(component.element(), '.' + hConfig.highlightClass).bind(function (e) {\n return component.getSystem().getByDom(e).toOption();\n });\n };\n var getByIndex = function (component, hConfig, hState, index) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n return Option.from(items[index]).fold(function () {\n return Result.error('No element found with index ' + index);\n }, component.getSystem().getByDom);\n };\n var getFirst = function (component, hConfig, _hState) {\n return descendant$1(component.element(), '.' + hConfig.itemClass).bind(function (e) {\n return component.getSystem().getByDom(e).toOption();\n });\n };\n var getLast = function (component, hConfig, _hState) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n var last = items.length > 0 ? Option.some(items[items.length - 1]) : Option.none();\n return last.bind(function (c) {\n return component.getSystem().getByDom(c).toOption();\n });\n };\n var getDelta = function (component, hConfig, hState, delta) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n var current = findIndex(items, function (item) {\n return has$2(item, hConfig.highlightClass);\n });\n return current.bind(function (selected) {\n var dest = cycleBy(selected, delta, 0, items.length - 1);\n return component.getSystem().getByDom(items[dest]).toOption();\n });\n };\n var getPrevious = function (component, hConfig, hState) {\n return getDelta(component, hConfig, hState, -1);\n };\n var getNext = function (component, hConfig, hState) {\n return getDelta(component, hConfig, hState, +1);\n };\n var getCandidates = function (component, hConfig, _hState) {\n var items = descendants(component.element(), '.' + hConfig.itemClass);\n return cat(map(items, function (i) {\n return component.getSystem().getByDom(i).toOption();\n }));\n };\n\n var HighlightApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n dehighlightAll: dehighlightAll,\n dehighlight: dehighlight$1,\n highlight: highlight$1,\n highlightFirst: highlightFirst,\n highlightLast: highlightLast,\n highlightAt: highlightAt,\n highlightBy: highlightBy,\n isHighlighted: isHighlighted,\n getHighlighted: getHighlighted,\n getFirst: getFirst,\n getLast: getLast,\n getPrevious: getPrevious,\n getNext: getNext,\n getCandidates: getCandidates\n });\n\n var HighlightSchema = [\n strict$1('highlightClass'),\n strict$1('itemClass'),\n onHandler('onHighlight'),\n onHandler('onDehighlight')\n ];\n\n var Highlighting = create$1({\n fields: HighlightSchema,\n name: 'highlighting',\n apis: HighlightApis\n });\n\n var BACKSPACE = function () {\n return [8];\n };\n var TAB = function () {\n return [9];\n };\n var ENTER = function () {\n return [13];\n };\n var ESCAPE = function () {\n return [27];\n };\n var SPACE = function () {\n return [32];\n };\n var LEFT = function () {\n return [37];\n };\n var UP = function () {\n return [38];\n };\n var RIGHT = function () {\n return [39];\n };\n var DOWN = function () {\n return [40];\n };\n\n var cyclePrev = function (values, index, predicate) {\n var before = reverse(values.slice(0, index));\n var after = reverse(values.slice(index + 1));\n return find(before.concat(after), predicate);\n };\n var tryPrev = function (values, index, predicate) {\n var before = reverse(values.slice(0, index));\n return find(before, predicate);\n };\n var cycleNext = function (values, index, predicate) {\n var before = values.slice(0, index);\n var after = values.slice(index + 1);\n return find(after.concat(before), predicate);\n };\n var tryNext = function (values, index, predicate) {\n var after = values.slice(index + 1);\n return find(after, predicate);\n };\n\n var inSet = function (keys) {\n return function (event) {\n var raw = event.raw();\n return contains(keys, raw.which);\n };\n };\n var and = function (preds) {\n return function (event) {\n return forall(preds, function (pred) {\n return pred(event);\n });\n };\n };\n var isShift = function (event) {\n var raw = event.raw();\n return raw.shiftKey === true;\n };\n var isControl = function (event) {\n var raw = event.raw();\n return raw.ctrlKey === true;\n };\n var isNotShift = not(isShift);\n\n var rule = function (matches, action) {\n return {\n matches: matches,\n classification: action\n };\n };\n var choose$2 = function (transitions, event) {\n var transition = find(transitions, function (t) {\n return t.matches(event);\n });\n return transition.map(function (t) {\n return t.classification;\n });\n };\n\n var reportFocusShifting = function (component, prevFocus, newFocus) {\n var noChange = prevFocus.exists(function (p) {\n return newFocus.exists(function (n) {\n return eq$1(n, p);\n });\n });\n if (!noChange) {\n emitWith(component, focusShifted(), {\n prevFocus: prevFocus,\n newFocus: newFocus\n });\n }\n };\n var dom = function () {\n var get = function (component) {\n return search(component.element());\n };\n var set = function (component, focusee) {\n var prevFocus = get(component);\n component.getSystem().triggerFocus(focusee, component.element());\n var newFocus = get(component);\n reportFocusShifting(component, prevFocus, newFocus);\n };\n return {\n get: get,\n set: set\n };\n };\n var highlights = function () {\n var get = function (component) {\n return Highlighting.getHighlighted(component).map(function (item) {\n return item.element();\n });\n };\n var set = function (component, element) {\n var prevFocus = get(component);\n component.getSystem().getByDom(element).fold(noop, function (item) {\n Highlighting.highlight(component, item);\n });\n var newFocus = get(component);\n reportFocusShifting(component, prevFocus, newFocus);\n };\n return {\n get: get,\n set: set\n };\n };\n\n var FocusInsideModes;\n (function (FocusInsideModes) {\n FocusInsideModes['OnFocusMode'] = 'onFocus';\n FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace';\n FocusInsideModes['OnApiMode'] = 'onApi';\n }(FocusInsideModes || (FocusInsideModes = {})));\n\n var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) {\n var schema = function () {\n return infoSchema.concat([\n defaulted$1('focusManager', dom()),\n defaultedOf('focusInside', 'onFocus', valueOf(function (val) {\n return contains([\n 'onFocus',\n 'onEnterOrSpace',\n 'onApi'\n ], val) ? Result.value(val) : Result.error('Invalid value for focusInside');\n })),\n output('handler', me),\n output('state', stateInit),\n output('sendFocusIn', optFocusIn)\n ]);\n };\n var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) {\n var rules = getRules(component, simulatedEvent, keyingConfig, keyingState);\n return choose$2(rules, simulatedEvent.event()).bind(function (rule) {\n return rule(component, simulatedEvent, keyingConfig, keyingState);\n });\n };\n var toEvents = function (keyingConfig, keyingState) {\n var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Option.none() : optFocusIn(keyingConfig).map(function (focusIn) {\n return run(focus(), function (component, simulatedEvent) {\n focusIn(component, keyingConfig, keyingState);\n simulatedEvent.stop();\n });\n });\n var tryGoInsideComponent = function (component, simulatedEvent) {\n var isEnterOrSpace = inSet(SPACE().concat(ENTER()))(simulatedEvent.event());\n if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) {\n optFocusIn(keyingConfig).each(function (focusIn) {\n focusIn(component, keyingConfig, keyingState);\n simulatedEvent.stop();\n });\n }\n };\n var keyboardEvents = [\n run(keydown(), function (component, simulatedEvent) {\n processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () {\n tryGoInsideComponent(component, simulatedEvent);\n }, function (_) {\n simulatedEvent.stop();\n });\n }),\n run(keyup(), function (component, simulatedEvent) {\n processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) {\n simulatedEvent.stop();\n });\n })\n ];\n return derive(onFocusHandler.toArray().concat(keyboardEvents));\n };\n var me = {\n schema: schema,\n processKey: processKey,\n toEvents: toEvents\n };\n return me;\n };\n\n var create$3 = function (cyclicField) {\n var schema = [\n option('onEscape'),\n option('onEnter'),\n defaulted$1('selector', '[data-alloy-tabstop=\"true\"]:not(:disabled)'),\n defaulted$1('firstTabstop', 0),\n defaulted$1('useTabstopAt', constant(true)),\n option('visibilitySelector')\n ].concat([cyclicField]);\n var isVisible = function (tabbingConfig, element) {\n var target = tabbingConfig.visibilitySelector.bind(function (sel) {\n return closest$3(element, sel);\n }).getOr(element);\n return get$6(target) > 0;\n };\n var findInitial = function (component, tabbingConfig) {\n var tabstops = descendants(component.element(), tabbingConfig.selector);\n var visibles = filter(tabstops, function (elem) {\n return isVisible(tabbingConfig, elem);\n });\n return Option.from(visibles[tabbingConfig.firstTabstop]);\n };\n var findCurrent = function (component, tabbingConfig) {\n return tabbingConfig.focusManager.get(component).bind(function (elem) {\n return closest$3(elem, tabbingConfig.selector);\n });\n };\n var isTabstop = function (tabbingConfig, element) {\n return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element);\n };\n var focusIn = function (component, tabbingConfig, _tabbingState) {\n findInitial(component, tabbingConfig).each(function (target) {\n tabbingConfig.focusManager.set(component, target);\n });\n };\n var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) {\n return cycle(tabstops, stopIndex, function (elem) {\n return isTabstop(tabbingConfig, elem);\n }).fold(function () {\n return tabbingConfig.cyclic ? Option.some(true) : Option.none();\n }, function (target) {\n tabbingConfig.focusManager.set(component, target);\n return Option.some(true);\n });\n };\n var go = function (component, _simulatedEvent, tabbingConfig, cycle) {\n var tabstops = descendants(component.element(), tabbingConfig.selector);\n return findCurrent(component, tabbingConfig).bind(function (tabstop) {\n var optStopIndex = findIndex(tabstops, curry(eq$1, tabstop));\n return optStopIndex.bind(function (stopIndex) {\n return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle);\n });\n });\n };\n var goBackwards = function (component, simulatedEvent, tabbingConfig) {\n var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev;\n return go(component, simulatedEvent, tabbingConfig, navigate);\n };\n var goForwards = function (component, simulatedEvent, tabbingConfig) {\n var navigate = tabbingConfig.cyclic ? cycleNext : tryNext;\n return go(component, simulatedEvent, tabbingConfig, navigate);\n };\n var execute = function (component, simulatedEvent, tabbingConfig) {\n return tabbingConfig.onEnter.bind(function (f) {\n return f(component, simulatedEvent);\n });\n };\n var exit = function (component, simulatedEvent, tabbingConfig) {\n return tabbingConfig.onEscape.bind(function (f) {\n return f(component, simulatedEvent);\n });\n };\n var getKeydownRules = constant([\n rule(and([\n isShift,\n inSet(TAB())\n ]), goBackwards),\n rule(inSet(TAB()), goForwards),\n rule(inSet(ESCAPE()), exit),\n rule(and([\n isNotShift,\n inSet(ENTER())\n ]), execute)\n ]);\n var getKeyupRules = constant([]);\n return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () {\n return Option.some(focusIn);\n });\n };\n\n var AcyclicType = create$3(state$1('cyclic', constant(false)));\n\n var CyclicType = create$3(state$1('cyclic', constant(true)));\n\n var doDefaultExecute = function (component, _simulatedEvent, focused) {\n dispatch(component, focused, execute());\n return Option.some(true);\n };\n var defaultExecute = function (component, simulatedEvent, focused) {\n var isComplex = inside(focused) && inSet(SPACE())(simulatedEvent.event());\n return isComplex ? Option.none() : doDefaultExecute(component, simulatedEvent, focused);\n };\n var stopEventForFirefox = function (_component, _simulatedEvent) {\n return Option.some(true);\n };\n\n var schema$4 = [\n defaulted$1('execute', defaultExecute),\n defaulted$1('useSpace', false),\n defaulted$1('useEnter', true),\n defaulted$1('useControlEnter', false),\n defaulted$1('useDown', false)\n ];\n var execute$1 = function (component, simulatedEvent, executeConfig) {\n return executeConfig.execute(component, simulatedEvent, component.element());\n };\n var getKeydownRules = function (component, _simulatedEvent, executeConfig, _executeState) {\n var spaceExec = executeConfig.useSpace && !inside(component.element()) ? SPACE() : [];\n var enterExec = executeConfig.useEnter ? ENTER() : [];\n var downExec = executeConfig.useDown ? DOWN() : [];\n var execKeys = spaceExec.concat(enterExec).concat(downExec);\n return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([\n isControl,\n inSet(ENTER())\n ]), execute$1)] : []);\n };\n var getKeyupRules = function (component, _simulatedEvent, executeConfig, _executeState) {\n return executeConfig.useSpace && !inside(component.element()) ? [rule(inSet(SPACE()), stopEventForFirefox)] : [];\n };\n var ExecutionType = typical(schema$4, NoState.init, getKeydownRules, getKeyupRules, function () {\n return Option.none();\n });\n\n var flatgrid = function () {\n var dimensions = Cell(Option.none());\n var setGridSize = function (numRows, numColumns) {\n dimensions.set(Option.some({\n numRows: numRows,\n numColumns: numColumns\n }));\n };\n var getNumRows = function () {\n return dimensions.get().map(function (d) {\n return d.numRows;\n });\n };\n var getNumColumns = function () {\n return dimensions.get().map(function (d) {\n return d.numColumns;\n });\n };\n return nu$5({\n readState: function () {\n return dimensions.get().map(function (d) {\n return {\n numRows: String(d.numRows),\n numColumns: String(d.numColumns)\n };\n }).getOr({\n numRows: '?',\n numColumns: '?'\n });\n },\n setGridSize: setGridSize,\n getNumRows: getNumRows,\n getNumColumns: getNumColumns\n });\n };\n var init$2 = function (spec) {\n return spec.state(spec);\n };\n\n var KeyingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n flatgrid: flatgrid,\n init: init$2\n });\n\n var useH = function (movement) {\n return function (component, simulatedEvent, config, state) {\n var move = movement(component.element());\n return use(move, component, simulatedEvent, config, state);\n };\n };\n var west$2 = function (moveLeft, moveRight) {\n var movement = onDirection(moveLeft, moveRight);\n return useH(movement);\n };\n var east$2 = function (moveLeft, moveRight) {\n var movement = onDirection(moveRight, moveLeft);\n return useH(movement);\n };\n var useV = function (move) {\n return function (component, simulatedEvent, config, state) {\n return use(move, component, simulatedEvent, config, state);\n };\n };\n var use = function (move, component, simulatedEvent, config, state) {\n var outcome = config.focusManager.get(component).bind(function (focused) {\n return move(component.element(), focused, config, state);\n });\n return outcome.map(function (newFocus) {\n config.focusManager.set(component, newFocus);\n return true;\n });\n };\n var north$2 = useV;\n var south$2 = useV;\n var move = useV;\n\n var isHidden = function (dom) {\n return dom.offsetWidth <= 0 && dom.offsetHeight <= 0;\n };\n var isVisible = function (element) {\n return !isHidden(element.dom());\n };\n\n var locate = function (candidates, predicate) {\n return findIndex(candidates, predicate).map(function (index) {\n return {\n index: constant(index),\n candidates: constant(candidates)\n };\n });\n };\n\n var locateVisible = function (container, current, selector) {\n var predicate = function (x) {\n return eq$1(x, current);\n };\n var candidates = descendants(container, selector);\n var visible = filter(candidates, isVisible);\n return locate(visible, predicate);\n };\n var findIndex$1 = function (elements, target) {\n return findIndex(elements, function (elem) {\n return eq$1(target, elem);\n });\n };\n\n var withGrid = function (values, index, numCols, f) {\n var oldRow = Math.floor(index / numCols);\n var oldColumn = index % numCols;\n return f(oldRow, oldColumn).bind(function (address) {\n var newIndex = address.row() * numCols + address.column();\n return newIndex >= 0 && newIndex < values.length ? Option.some(values[newIndex]) : Option.none();\n });\n };\n var cycleHorizontal = function (values, index, numRows, numCols, delta) {\n return withGrid(values, index, numCols, function (oldRow, oldColumn) {\n var onLastRow = oldRow === numRows - 1;\n var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols;\n var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1);\n return Option.some({\n row: constant(oldRow),\n column: constant(newColumn)\n });\n });\n };\n var cycleVertical = function (values, index, numRows, numCols, delta) {\n return withGrid(values, index, numCols, function (oldRow, oldColumn) {\n var newRow = cycleBy(oldRow, delta, 0, numRows - 1);\n var onLastRow = newRow === numRows - 1;\n var colsInRow = onLastRow ? values.length - newRow * numCols : numCols;\n var newCol = clamp(oldColumn, 0, colsInRow - 1);\n return Option.some({\n row: constant(newRow),\n column: constant(newCol)\n });\n });\n };\n var cycleRight = function (values, index, numRows, numCols) {\n return cycleHorizontal(values, index, numRows, numCols, +1);\n };\n var cycleLeft = function (values, index, numRows, numCols) {\n return cycleHorizontal(values, index, numRows, numCols, -1);\n };\n var cycleUp = function (values, index, numRows, numCols) {\n return cycleVertical(values, index, numRows, numCols, -1);\n };\n var cycleDown = function (values, index, numRows, numCols) {\n return cycleVertical(values, index, numRows, numCols, +1);\n };\n\n var schema$5 = [\n strict$1('selector'),\n defaulted$1('execute', defaultExecute),\n onKeyboardHandler('onEscape'),\n defaulted$1('captureTab', false),\n initSize()\n ];\n var focusIn = function (component, gridConfig, _gridState) {\n descendant$1(component.element(), gridConfig.selector).each(function (first) {\n gridConfig.focusManager.set(component, first);\n });\n };\n var findCurrent = function (component, gridConfig) {\n return gridConfig.focusManager.get(component).bind(function (elem) {\n return closest$3(elem, gridConfig.selector);\n });\n };\n var execute$2 = function (component, simulatedEvent, gridConfig, _gridState) {\n return findCurrent(component, gridConfig).bind(function (focused) {\n return gridConfig.execute(component, simulatedEvent, focused);\n });\n };\n var doMove = function (cycle) {\n return function (element, focused, gridConfig, gridState) {\n return locateVisible(element, focused, gridConfig.selector).bind(function (identified) {\n return cycle(identified.candidates(), identified.index(), gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns));\n });\n };\n };\n var handleTab = function (_component, _simulatedEvent, gridConfig) {\n return gridConfig.captureTab ? Option.some(true) : Option.none();\n };\n var doEscape = function (component, simulatedEvent, gridConfig) {\n return gridConfig.onEscape(component, simulatedEvent);\n };\n var moveLeft = doMove(cycleLeft);\n var moveRight = doMove(cycleRight);\n var moveNorth = doMove(cycleUp);\n var moveSouth = doMove(cycleDown);\n var getKeydownRules$1 = constant([\n rule(inSet(LEFT()), west$2(moveLeft, moveRight)),\n rule(inSet(RIGHT()), east$2(moveLeft, moveRight)),\n rule(inSet(UP()), north$2(moveNorth)),\n rule(inSet(DOWN()), south$2(moveSouth)),\n rule(and([\n isShift,\n inSet(TAB())\n ]), handleTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), handleTab),\n rule(inSet(ESCAPE()), doEscape),\n rule(inSet(SPACE().concat(ENTER())), execute$2)\n ]);\n var getKeyupRules$1 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var FlatgridType = typical(schema$5, flatgrid, getKeydownRules$1, getKeyupRules$1, function () {\n return Option.some(focusIn);\n });\n\n var horizontal = function (container, selector, current, delta) {\n var isDisabledButton = function (candidate) {\n return name(candidate) === 'button' && get$2(candidate, 'disabled') === 'disabled';\n };\n var tryCycle = function (initial, index, candidates) {\n var newIndex = cycleBy(index, delta, 0, candidates.length - 1);\n if (newIndex === initial) {\n return Option.none();\n } else {\n return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Option.from(candidates[newIndex]);\n }\n };\n return locateVisible(container, current, selector).bind(function (identified) {\n var index = identified.index();\n var candidates = identified.candidates();\n return tryCycle(index, index, candidates);\n });\n };\n\n var schema$6 = [\n strict$1('selector'),\n defaulted$1('getInitial', Option.none),\n defaulted$1('execute', defaultExecute),\n onKeyboardHandler('onEscape'),\n defaulted$1('executeOnMove', false),\n defaulted$1('allowVertical', true)\n ];\n var findCurrent$1 = function (component, flowConfig) {\n return flowConfig.focusManager.get(component).bind(function (elem) {\n return closest$3(elem, flowConfig.selector);\n });\n };\n var execute$3 = function (component, simulatedEvent, flowConfig) {\n return findCurrent$1(component, flowConfig).bind(function (focused) {\n return flowConfig.execute(component, simulatedEvent, focused);\n });\n };\n var focusIn$1 = function (component, flowConfig, _state) {\n flowConfig.getInitial(component).orThunk(function () {\n return descendant$1(component.element(), flowConfig.selector);\n }).each(function (first) {\n flowConfig.focusManager.set(component, first);\n });\n };\n var moveLeft$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, -1);\n };\n var moveRight$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, +1);\n };\n var doMove$1 = function (movement) {\n return function (component, simulatedEvent, flowConfig, flowState) {\n return movement(component, simulatedEvent, flowConfig, flowState).bind(function () {\n return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Option.some(true);\n });\n };\n };\n var doEscape$1 = function (component, simulatedEvent, flowConfig) {\n return flowConfig.onEscape(component, simulatedEvent);\n };\n var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) {\n var westMovers = LEFT().concat(flowConfig.allowVertical ? UP() : []);\n var eastMovers = RIGHT().concat(flowConfig.allowVertical ? DOWN() : []);\n return [\n rule(inSet(westMovers), doMove$1(west$2(moveLeft$1, moveRight$1))),\n rule(inSet(eastMovers), doMove$1(east$2(moveLeft$1, moveRight$1))),\n rule(inSet(ENTER()), execute$3),\n rule(inSet(SPACE()), execute$3),\n rule(inSet(ESCAPE()), doEscape$1)\n ];\n };\n var getKeyupRules$2 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var FlowType = typical(schema$6, NoState.init, getKeydownRules$2, getKeyupRules$2, function () {\n return Option.some(focusIn$1);\n });\n\n var toCell = function (matrix, rowIndex, columnIndex) {\n return Option.from(matrix[rowIndex]).bind(function (row) {\n return Option.from(row[columnIndex]).map(function (cell) {\n return {\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n cell: cell\n };\n });\n });\n };\n var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) {\n var row = matrix[rowIndex];\n var colsInRow = row.length;\n var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1);\n return toCell(matrix, rowIndex, newColIndex);\n };\n var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) {\n var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1);\n var colsInNextRow = matrix[nextRowIndex].length;\n var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1);\n return toCell(matrix, nextRowIndex, nextColIndex);\n };\n var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) {\n var row = matrix[rowIndex];\n var colsInRow = row.length;\n var newColIndex = clamp(startCol + deltaCol, 0, colsInRow - 1);\n return toCell(matrix, rowIndex, newColIndex);\n };\n var moveVertical = function (matrix, colIndex, startRow, deltaRow) {\n var nextRowIndex = clamp(startRow + deltaRow, 0, matrix.length - 1);\n var colsInNextRow = matrix[nextRowIndex].length;\n var nextColIndex = clamp(colIndex, 0, colsInNextRow - 1);\n return toCell(matrix, nextRowIndex, nextColIndex);\n };\n var cycleRight$1 = function (matrix, startRow, startCol) {\n return cycleHorizontal$1(matrix, startRow, startCol, +1);\n };\n var cycleLeft$1 = function (matrix, startRow, startCol) {\n return cycleHorizontal$1(matrix, startRow, startCol, -1);\n };\n var cycleUp$1 = function (matrix, startRow, startCol) {\n return cycleVertical$1(matrix, startCol, startRow, -1);\n };\n var cycleDown$1 = function (matrix, startRow, startCol) {\n return cycleVertical$1(matrix, startCol, startRow, +1);\n };\n var moveLeft$2 = function (matrix, startRow, startCol) {\n return moveHorizontal(matrix, startRow, startCol, -1);\n };\n var moveRight$2 = function (matrix, startRow, startCol) {\n return moveHorizontal(matrix, startRow, startCol, +1);\n };\n var moveUp = function (matrix, startRow, startCol) {\n return moveVertical(matrix, startCol, startRow, -1);\n };\n var moveDown = function (matrix, startRow, startCol) {\n return moveVertical(matrix, startCol, startRow, +1);\n };\n\n var schema$7 = [\n strictObjOf('selectors', [\n strict$1('row'),\n strict$1('cell')\n ]),\n defaulted$1('cycles', true),\n defaulted$1('previousSelector', Option.none),\n defaulted$1('execute', defaultExecute)\n ];\n var focusIn$2 = function (component, matrixConfig, _state) {\n var focused = matrixConfig.previousSelector(component).orThunk(function () {\n var selectors = matrixConfig.selectors;\n return descendant$1(component.element(), selectors.cell);\n });\n focused.each(function (cell) {\n matrixConfig.focusManager.set(component, cell);\n });\n };\n var execute$4 = function (component, simulatedEvent, matrixConfig) {\n return search(component.element()).bind(function (focused) {\n return matrixConfig.execute(component, simulatedEvent, focused);\n });\n };\n var toMatrix = function (rows, matrixConfig) {\n return map(rows, function (row) {\n return descendants(row, matrixConfig.selectors.cell);\n });\n };\n var doMove$2 = function (ifCycle, ifMove) {\n return function (element, focused, matrixConfig) {\n var move = matrixConfig.cycles ? ifCycle : ifMove;\n return closest$3(focused, matrixConfig.selectors.row).bind(function (inRow) {\n var cellsInRow = descendants(inRow, matrixConfig.selectors.cell);\n return findIndex$1(cellsInRow, focused).bind(function (colIndex) {\n var allRows = descendants(element, matrixConfig.selectors.row);\n return findIndex$1(allRows, inRow).bind(function (rowIndex) {\n var matrix = toMatrix(allRows, matrixConfig);\n return move(matrix, rowIndex, colIndex).map(function (next) {\n return next.cell;\n });\n });\n });\n });\n };\n };\n var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2);\n var moveRight$3 = doMove$2(cycleRight$1, moveRight$2);\n var moveNorth$1 = doMove$2(cycleUp$1, moveUp);\n var moveSouth$1 = doMove$2(cycleDown$1, moveDown);\n var getKeydownRules$3 = constant([\n rule(inSet(LEFT()), west$2(moveLeft$3, moveRight$3)),\n rule(inSet(RIGHT()), east$2(moveLeft$3, moveRight$3)),\n rule(inSet(UP()), north$2(moveNorth$1)),\n rule(inSet(DOWN()), south$2(moveSouth$1)),\n rule(inSet(SPACE().concat(ENTER())), execute$4)\n ]);\n var getKeyupRules$3 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var MatrixType = typical(schema$7, NoState.init, getKeydownRules$3, getKeyupRules$3, function () {\n return Option.some(focusIn$2);\n });\n\n var schema$8 = [\n strict$1('selector'),\n defaulted$1('execute', defaultExecute),\n defaulted$1('moveOnTab', false)\n ];\n var execute$5 = function (component, simulatedEvent, menuConfig) {\n return menuConfig.focusManager.get(component).bind(function (focused) {\n return menuConfig.execute(component, simulatedEvent, focused);\n });\n };\n var focusIn$3 = function (component, menuConfig, _state) {\n descendant$1(component.element(), menuConfig.selector).each(function (first) {\n menuConfig.focusManager.set(component, first);\n });\n };\n var moveUp$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, -1);\n };\n var moveDown$1 = function (element, focused, info) {\n return horizontal(element, info.selector, focused, +1);\n };\n var fireShiftTab = function (component, simulatedEvent, menuConfig, menuState) {\n return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig, menuState) : Option.none();\n };\n var fireTab = function (component, simulatedEvent, menuConfig, menuState) {\n return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig, menuState) : Option.none();\n };\n var getKeydownRules$4 = constant([\n rule(inSet(UP()), move(moveUp$1)),\n rule(inSet(DOWN()), move(moveDown$1)),\n rule(and([\n isShift,\n inSet(TAB())\n ]), fireShiftTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), fireTab),\n rule(inSet(ENTER()), execute$5),\n rule(inSet(SPACE()), execute$5)\n ]);\n var getKeyupRules$4 = constant([rule(inSet(SPACE()), stopEventForFirefox)]);\n var MenuType = typical(schema$8, NoState.init, getKeydownRules$4, getKeyupRules$4, function () {\n return Option.some(focusIn$3);\n });\n\n var schema$9 = [\n onKeyboardHandler('onSpace'),\n onKeyboardHandler('onEnter'),\n onKeyboardHandler('onShiftEnter'),\n onKeyboardHandler('onLeft'),\n onKeyboardHandler('onRight'),\n onKeyboardHandler('onTab'),\n onKeyboardHandler('onShiftTab'),\n onKeyboardHandler('onUp'),\n onKeyboardHandler('onDown'),\n onKeyboardHandler('onEscape'),\n defaulted$1('stopSpaceKeyup', false),\n option('focusIn')\n ];\n var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) {\n return [\n rule(inSet(SPACE()), specialInfo.onSpace),\n rule(and([\n isNotShift,\n inSet(ENTER())\n ]), specialInfo.onEnter),\n rule(and([\n isShift,\n inSet(ENTER())\n ]), specialInfo.onShiftEnter),\n rule(and([\n isShift,\n inSet(TAB())\n ]), specialInfo.onShiftTab),\n rule(and([\n isNotShift,\n inSet(TAB())\n ]), specialInfo.onTab),\n rule(inSet(UP()), specialInfo.onUp),\n rule(inSet(DOWN()), specialInfo.onDown),\n rule(inSet(LEFT()), specialInfo.onLeft),\n rule(inSet(RIGHT()), specialInfo.onRight),\n rule(inSet(SPACE()), specialInfo.onSpace),\n rule(inSet(ESCAPE()), specialInfo.onEscape)\n ];\n };\n var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) {\n return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE()), stopEventForFirefox)] : [];\n };\n var SpecialType = typical(schema$9, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) {\n return specialInfo.focusIn;\n });\n\n var acyclic = AcyclicType.schema();\n var cyclic = CyclicType.schema();\n var flow = FlowType.schema();\n var flatgrid$1 = FlatgridType.schema();\n var matrix = MatrixType.schema();\n var execution = ExecutionType.schema();\n var menu = MenuType.schema();\n var special = SpecialType.schema();\n\n var KeyboardBranches = /*#__PURE__*/Object.freeze({\n __proto__: null,\n acyclic: acyclic,\n cyclic: cyclic,\n flow: flow,\n flatgrid: flatgrid$1,\n matrix: matrix,\n execution: execution,\n menu: menu,\n special: special\n });\n\n var isFlatgridState = function (keyState) {\n return hasNonNullableKey(keyState, 'setGridSize');\n };\n var Keying = createModes$1({\n branchKey: 'mode',\n branches: KeyboardBranches,\n name: 'keying',\n active: {\n events: function (keyingConfig, keyingState) {\n var handler = keyingConfig.handler;\n return handler.toEvents(keyingConfig, keyingState);\n }\n },\n apis: {\n focusIn: function (component, keyConfig, keyState) {\n keyConfig.sendFocusIn(keyConfig).fold(function () {\n component.getSystem().triggerFocus(component.element(), component.element());\n }, function (sendFocusIn) {\n sendFocusIn(component, keyConfig, keyState);\n });\n },\n setGridSize: function (component, keyConfig, keyState, numRows, numColumns) {\n if (!isFlatgridState(keyState)) {\n domGlobals.console.error('Layout does not support setGridSize');\n } else {\n keyState.setGridSize(numRows, numColumns);\n }\n }\n },\n state: KeyingState\n });\n\n var set$5 = function (component, replaceConfig, replaceState, data) {\n preserve(function () {\n var newChildren = map(data, component.getSystem().build);\n replaceChildren(component, newChildren);\n }, component.element());\n };\n var insert = function (component, replaceConfig, insertion, childSpec) {\n var child = component.getSystem().build(childSpec);\n attachWith(component, child, insertion);\n };\n var append$2 = function (component, replaceConfig, replaceState, appendee) {\n insert(component, replaceConfig, append, appendee);\n };\n var prepend$1 = function (component, replaceConfig, replaceState, prependee) {\n insert(component, replaceConfig, prepend, prependee);\n };\n var remove$7 = function (component, replaceConfig, replaceState, removee) {\n var children = contents(component);\n var foundChild = find(children, function (child) {\n return eq$1(removee.element(), child.element());\n });\n foundChild.each(detach);\n };\n var contents = function (component, _replaceConfig) {\n return component.components();\n };\n var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) {\n var children = contents(component);\n return Option.from(children[replaceeIndex]).map(function (replacee) {\n remove$7(component, replaceConfig, replaceState, replacee);\n replacer.each(function (r) {\n insert(component, replaceConfig, function (p, c) {\n appendAt(p, c, replaceeIndex);\n }, r);\n });\n return replacee;\n });\n };\n var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) {\n var children = contents(component);\n return findIndex(children, replaceePred).bind(function (replaceeIndex) {\n return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer);\n });\n };\n\n var ReplaceApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n append: append$2,\n prepend: prepend$1,\n remove: remove$7,\n replaceAt: replaceAt,\n replaceBy: replaceBy,\n set: set$5,\n contents: contents\n });\n\n var Replacing = create$1({\n fields: [],\n name: 'replacing',\n apis: ReplaceApis\n });\n\n var events$4 = function (name, eventHandlers) {\n var events = derive(eventHandlers);\n return create$1({\n fields: [strict$1('enabled')],\n name: name,\n active: { events: constant(events) }\n });\n };\n var config = function (name, eventHandlers) {\n var me = events$4(name, eventHandlers);\n return {\n key: name,\n value: {\n config: {},\n me: me,\n configAsRaw: constant({}),\n initialConfig: {},\n state: NoState\n }\n };\n };\n\n var focus$2 = function (component, focusConfig) {\n if (!focusConfig.ignore) {\n focus$1(component.element());\n focusConfig.onFocus(component);\n }\n };\n var blur$1 = function (component, focusConfig) {\n if (!focusConfig.ignore) {\n blur(component.element());\n }\n };\n var isFocused = function (component) {\n return hasFocus(component.element());\n };\n\n var FocusApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n focus: focus$2,\n blur: blur$1,\n isFocused: isFocused\n });\n\n var exhibit$1 = function (base, focusConfig) {\n var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } };\n return nu$6(mod);\n };\n var events$5 = function (focusConfig) {\n return derive([run(focus(), function (component, simulatedEvent) {\n focus$2(component, focusConfig);\n simulatedEvent.stop();\n })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) {\n simulatedEvent.event().prevent();\n })] : []));\n };\n\n var ActiveFocus = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$1,\n events: events$5\n });\n\n var FocusSchema = [\n onHandler('onFocus'),\n defaulted$1('stopMousedown', false),\n defaulted$1('ignore', false)\n ];\n\n var Focusing = create$1({\n fields: FocusSchema,\n name: 'focusing',\n active: ActiveFocus,\n apis: FocusApis\n });\n\n var updateAriaState = function (component, toggleConfig, toggleState) {\n var ariaInfo = toggleConfig.aria;\n ariaInfo.update(component, ariaInfo, toggleState.get());\n };\n var updateClass = function (component, toggleConfig, toggleState) {\n toggleConfig.toggleClass.each(function (toggleClass) {\n if (toggleState.get()) {\n add$2(component.element(), toggleClass);\n } else {\n remove$4(component.element(), toggleClass);\n }\n });\n };\n var toggle = function (component, toggleConfig, toggleState) {\n set$6(component, toggleConfig, toggleState, !toggleState.get());\n };\n var on$1 = function (component, toggleConfig, toggleState) {\n toggleState.set(true);\n updateClass(component, toggleConfig, toggleState);\n updateAriaState(component, toggleConfig, toggleState);\n };\n var off = function (component, toggleConfig, toggleState) {\n toggleState.set(false);\n updateClass(component, toggleConfig, toggleState);\n updateAriaState(component, toggleConfig, toggleState);\n };\n var set$6 = function (component, toggleConfig, toggleState, state) {\n var action = state ? on$1 : off;\n action(component, toggleConfig, toggleState);\n };\n var isOn = function (component, toggleConfig, toggleState) {\n return toggleState.get();\n };\n var onLoad$4 = function (component, toggleConfig, toggleState) {\n set$6(component, toggleConfig, toggleState, toggleConfig.selected);\n };\n\n var ToggleApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n onLoad: onLoad$4,\n toggle: toggle,\n isOn: isOn,\n on: on$1,\n off: off,\n set: set$6\n });\n\n var exhibit$2 = function () {\n return nu$6({});\n };\n var events$6 = function (toggleConfig, toggleState) {\n var execute = executeEvent(toggleConfig, toggleState, toggle);\n var load = loadEvent(toggleConfig, toggleState, onLoad$4);\n return derive(flatten([\n toggleConfig.toggleOnExecute ? [execute] : [],\n [load]\n ]));\n };\n\n var ActiveToggle = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$2,\n events: events$6\n });\n\n var SetupBehaviourCellState = function (initialState) {\n var init = function () {\n var cell = Cell(initialState);\n var get = function () {\n return cell.get();\n };\n var set = function (newState) {\n return cell.set(newState);\n };\n var clear = function () {\n return cell.set(initialState);\n };\n var readState = function () {\n return cell.get();\n };\n return {\n get: get,\n set: set,\n clear: clear,\n readState: readState\n };\n };\n return { init: init };\n };\n\n var updatePressed = function (component, ariaInfo, status) {\n set$1(component.element(), 'aria-pressed', status);\n if (ariaInfo.syncWithExpanded) {\n updateExpanded(component, ariaInfo, status);\n }\n };\n var updateSelected = function (component, ariaInfo, status) {\n set$1(component.element(), 'aria-selected', status);\n };\n var updateChecked = function (component, ariaInfo, status) {\n set$1(component.element(), 'aria-checked', status);\n };\n var updateExpanded = function (component, ariaInfo, status) {\n set$1(component.element(), 'aria-expanded', status);\n };\n\n var ToggleSchema = [\n defaulted$1('selected', false),\n option('toggleClass'),\n defaulted$1('toggleOnExecute', true),\n defaultedOf('aria', { mode: 'none' }, choose$1('mode', {\n pressed: [\n defaulted$1('syncWithExpanded', false),\n output('update', updatePressed)\n ],\n checked: [output('update', updateChecked)],\n expanded: [output('update', updateExpanded)],\n selected: [output('update', updateSelected)],\n none: [output('update', noop)]\n }))\n ];\n\n var Toggling = create$1({\n fields: ToggleSchema,\n name: 'toggling',\n active: ActiveToggle,\n apis: ToggleApis,\n state: SetupBehaviourCellState(false)\n });\n\n var pointerEvents = function () {\n var onClick = function (component, simulatedEvent) {\n simulatedEvent.stop();\n emitExecute(component);\n };\n return [\n run(click(), onClick),\n run(tap(), onClick),\n cutter(touchstart()),\n cutter(mousedown())\n ];\n };\n var events$7 = function (optAction) {\n var executeHandler = function (action) {\n return runOnExecute(function (component, simulatedEvent) {\n action(component);\n simulatedEvent.stop();\n });\n };\n return derive(flatten([\n optAction.map(executeHandler).toArray(),\n pointerEvents()\n ]));\n };\n\n var hoverEvent = 'alloy.item-hover';\n var focusEvent = 'alloy.item-focus';\n var onHover = function (item) {\n if (search(item.element()).isNone() || Focusing.isFocused(item)) {\n if (!Focusing.isFocused(item)) {\n Focusing.focus(item);\n }\n emitWith(item, hoverEvent, { item: item });\n }\n };\n var onFocus = function (item) {\n emitWith(item, focusEvent, { item: item });\n };\n var hover = constant(hoverEvent);\n var focus$3 = constant(focusEvent);\n\n var builder = function (detail) {\n return {\n dom: detail.dom,\n domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }),\n behaviours: SketchBehaviours.augment(detail.itemBehaviours, [\n detail.toggling.fold(Toggling.revoke, function (tConfig) {\n return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig));\n }),\n Focusing.config({\n ignore: detail.ignoreFocus,\n stopMousedown: detail.ignoreFocus,\n onFocus: function (component) {\n onFocus(component);\n }\n }),\n Keying.config({ mode: 'execution' }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.data\n }\n }),\n config('item-type-events', __spreadArrays(pointerEvents(), [\n run(mouseover(), onHover),\n run(focusItem(), Focusing.focus)\n ]))\n ]),\n components: detail.components,\n eventOrder: detail.eventOrder\n };\n };\n var schema$a = [\n strict$1('data'),\n strict$1('components'),\n strict$1('dom'),\n defaulted$1('hasSubmenu', false),\n option('toggling'),\n SketchBehaviours.field('itemBehaviours', [\n Toggling,\n Focusing,\n Keying,\n Representing\n ]),\n defaulted$1('ignoreFocus', false),\n defaulted$1('domModification', {}),\n output('builder', builder),\n defaulted$1('eventOrder', {})\n ];\n\n var builder$1 = function (detail) {\n return {\n dom: detail.dom,\n components: detail.components,\n events: derive([stopper(focusItem())])\n };\n };\n var schema$b = [\n strict$1('dom'),\n strict$1('components'),\n output('builder', builder$1)\n ];\n\n var owner$2 = function () {\n return 'item-widget';\n };\n var parts = constant([required({\n name: 'widget',\n overrides: function (detail) {\n return {\n behaviours: derive$1([Representing.config({\n store: {\n mode: 'manual',\n getValue: function (_component) {\n return detail.data;\n },\n setValue: function () {\n }\n }\n })])\n };\n }\n })]);\n\n var builder$2 = function (detail) {\n var subs = substitutes(owner$2(), detail, parts());\n var components$1 = components(owner$2(), detail, subs.internals());\n var focusWidget = function (component) {\n return getPart(component, detail, 'widget').map(function (widget) {\n Keying.focusIn(widget);\n return widget;\n });\n };\n var onHorizontalArrow = function (component, simulatedEvent) {\n return inside(simulatedEvent.event().target()) ? Option.none() : function () {\n if (detail.autofocus) {\n simulatedEvent.setSource(component.element());\n return Option.none();\n } else {\n return Option.none();\n }\n }();\n };\n return {\n dom: detail.dom,\n components: components$1,\n domModification: detail.domModification,\n events: derive([\n runOnExecute(function (component, simulatedEvent) {\n focusWidget(component).each(function (_widget) {\n simulatedEvent.stop();\n });\n }),\n run(mouseover(), onHover),\n run(focusItem(), function (component, _simulatedEvent) {\n if (detail.autofocus) {\n focusWidget(component);\n } else {\n Focusing.focus(component);\n }\n })\n ]),\n behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.data\n }\n }),\n Focusing.config({\n ignore: detail.ignoreFocus,\n onFocus: function (component) {\n onFocus(component);\n }\n }),\n Keying.config({\n mode: 'special',\n focusIn: detail.autofocus ? function (component) {\n focusWidget(component);\n } : revoke(),\n onLeft: onHorizontalArrow,\n onRight: onHorizontalArrow,\n onEscape: function (component, simulatedEvent) {\n if (!Focusing.isFocused(component) && !detail.autofocus) {\n Focusing.focus(component);\n return Option.some(true);\n } else if (detail.autofocus) {\n simulatedEvent.setSource(component.element());\n return Option.none();\n } else {\n return Option.none();\n }\n }\n })\n ])\n };\n };\n var schema$c = [\n strict$1('uid'),\n strict$1('data'),\n strict$1('components'),\n strict$1('dom'),\n defaulted$1('autofocus', false),\n defaulted$1('ignoreFocus', false),\n SketchBehaviours.field('widgetBehaviours', [\n Representing,\n Focusing,\n Keying\n ]),\n defaulted$1('domModification', {}),\n defaultUidsSchema(parts()),\n output('builder', builder$2)\n ];\n\n var itemSchema$1 = choose$1('type', {\n widget: schema$c,\n item: schema$a,\n separator: schema$b\n });\n var configureGrid = function (detail, movementInfo) {\n return {\n mode: 'flatgrid',\n selector: '.' + detail.markers.item,\n initSize: {\n numColumns: movementInfo.initSize.numColumns,\n numRows: movementInfo.initSize.numRows\n },\n focusManager: detail.focusManager\n };\n };\n var configureMatrix = function (detail, movementInfo) {\n return {\n mode: 'matrix',\n selectors: {\n row: movementInfo.rowSelector,\n cell: '.' + detail.markers.item\n },\n focusManager: detail.focusManager\n };\n };\n var configureMenu = function (detail, movementInfo) {\n return {\n mode: 'menu',\n selector: '.' + detail.markers.item,\n moveOnTab: movementInfo.moveOnTab,\n focusManager: detail.focusManager\n };\n };\n var parts$1 = constant([group({\n factory: {\n sketch: function (spec) {\n var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec);\n return itemInfo.builder(itemInfo);\n }\n },\n name: 'items',\n unit: 'item',\n defaults: function (detail, u) {\n return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$2('item') });\n },\n overrides: function (detail, u) {\n return {\n type: u.type,\n ignoreFocus: detail.fakeFocus,\n domModification: { classes: [detail.markers.item] }\n };\n }\n })]);\n var schema$d = constant([\n strict$1('value'),\n strict$1('items'),\n strict$1('dom'),\n strict$1('components'),\n defaulted$1('eventOrder', {}),\n field$1('menuBehaviours', [\n Highlighting,\n Representing,\n Composing,\n Keying\n ]),\n defaultedOf('movement', {\n mode: 'menu',\n moveOnTab: true\n }, choose$1('mode', {\n grid: [\n initSize(),\n output('config', configureGrid)\n ],\n matrix: [\n output('config', configureMatrix),\n strict$1('rowSelector')\n ],\n menu: [\n defaulted$1('moveOnTab', true),\n output('config', configureMenu)\n ]\n })),\n itemMarkers(),\n defaulted$1('fakeFocus', false),\n defaulted$1('focusManager', dom()),\n onHandler('onHighlight')\n ]);\n\n var focus$4 = constant('alloy.menu-focus');\n\n var make$1 = function (detail, components, _spec, _externals) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n markers: detail.markers,\n behaviours: augment(detail.menuBehaviours, [\n Highlighting.config({\n highlightClass: detail.markers.selectedItem,\n itemClass: detail.markers.item,\n onHighlight: detail.onHighlight\n }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.value\n }\n }),\n Composing.config({ find: Option.some }),\n Keying.config(detail.movement.config(detail, detail.movement))\n ]),\n events: derive([\n run(focus$3(), function (menu, simulatedEvent) {\n var event = simulatedEvent.event();\n menu.getSystem().getByDom(event.target()).each(function (item) {\n Highlighting.highlight(menu, item);\n simulatedEvent.stop();\n emitWith(menu, focus$4(), {\n menu: menu,\n item: item\n });\n });\n }),\n run(hover(), function (menu, simulatedEvent) {\n var item = simulatedEvent.event().item();\n Highlighting.highlight(menu, item);\n })\n ]),\n components: components,\n eventOrder: detail.eventOrder,\n domModification: { attributes: { role: 'menu' } }\n };\n };\n\n var Menu = composite$1({\n name: 'Menu',\n configFields: schema$d(),\n partFields: parts$1(),\n factory: make$1\n });\n\n var transpose = function (obj) {\n return tupleMap(obj, function (v, k) {\n return {\n k: v,\n v: k\n };\n });\n };\n var trace = function (items, byItem, byMenu, finish) {\n return get(byMenu, finish).bind(function (triggerItem) {\n return get(items, triggerItem).bind(function (triggerMenu) {\n var rest = trace(items, byItem, byMenu, triggerMenu);\n return Option.some([triggerMenu].concat(rest));\n });\n }).getOr([]);\n };\n var generate$5 = function (menus, expansions) {\n var items = {};\n each$1(menus, function (menuItems, menu) {\n each(menuItems, function (item) {\n items[item] = menu;\n });\n });\n var byItem = expansions;\n var byMenu = transpose(expansions);\n var menuPaths = map$2(byMenu, function (_triggerItem, submenu) {\n return [submenu].concat(trace(items, byItem, byMenu, submenu));\n });\n return map$2(items, function (menu) {\n return get(menuPaths, menu).getOr([menu]);\n });\n };\n\n var init$3 = function () {\n var expansions = Cell({});\n var menus = Cell({});\n var paths = Cell({});\n var primary = Cell(Option.none());\n var directory = Cell({});\n var clear = function () {\n expansions.set({});\n menus.set({});\n paths.set({});\n primary.set(Option.none());\n };\n var isClear = function () {\n return primary.get().isNone();\n };\n var setMenuBuilt = function (menuName, built) {\n var _a;\n menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = {\n type: 'prepared',\n menu: built\n }, _a)));\n };\n var setContents = function (sPrimary, sMenus, sExpansions, dir) {\n primary.set(Option.some(sPrimary));\n expansions.set(sExpansions);\n menus.set(sMenus);\n directory.set(dir);\n var sPaths = generate$5(dir, sExpansions);\n paths.set(sPaths);\n };\n var getTriggeringItem = function (menuValue) {\n return find$1(expansions.get(), function (v, _k) {\n return v === menuValue;\n });\n };\n var getTriggerData = function (menuValue, getItemByValue, path) {\n return getPreparedMenu(menuValue).bind(function (menu) {\n return getTriggeringItem(menuValue).bind(function (triggeringItemValue) {\n return getItemByValue(triggeringItemValue).map(function (triggeredItem) {\n return {\n triggeredMenu: menu,\n triggeringItem: triggeredItem,\n triggeringPath: path\n };\n });\n });\n });\n };\n var getTriggeringPath = function (itemValue, getItemByValue) {\n var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) {\n return getPreparedMenu(menuValue).isSome();\n });\n return get(paths.get(), itemValue).bind(function (path) {\n var revPath = reverse(extraPath.concat(path));\n var triggers = bind(revPath, function (menuValue, menuIndex) {\n return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () {\n return primary.get().is(menuValue) ? [] : [Option.none()];\n }, function (data) {\n return [Option.some(data)];\n });\n });\n return sequence(triggers);\n });\n };\n var expand = function (itemValue) {\n return get(expansions.get(), itemValue).map(function (menu) {\n var current = get(paths.get(), itemValue).getOr([]);\n return [menu].concat(current);\n });\n };\n var collapse = function (itemValue) {\n return get(paths.get(), itemValue).bind(function (path) {\n return path.length > 1 ? Option.some(path.slice(1)) : Option.none();\n });\n };\n var refresh = function (itemValue) {\n return get(paths.get(), itemValue);\n };\n var getPreparedMenu = function (menuValue) {\n return lookupMenu(menuValue).bind(extractPreparedMenu);\n };\n var lookupMenu = function (menuValue) {\n return get(menus.get(), menuValue);\n };\n var lookupItem = function (itemValue) {\n return get(expansions.get(), itemValue);\n };\n var otherMenus = function (path) {\n var menuValues = directory.get();\n return difference(keys(menuValues), path);\n };\n var getPrimary = function () {\n return primary.get().bind(getPreparedMenu);\n };\n var getMenus = function () {\n return menus.get();\n };\n return {\n setMenuBuilt: setMenuBuilt,\n setContents: setContents,\n expand: expand,\n refresh: refresh,\n collapse: collapse,\n lookupMenu: lookupMenu,\n lookupItem: lookupItem,\n otherMenus: otherMenus,\n getPrimary: getPrimary,\n getMenus: getMenus,\n clear: clear,\n isClear: isClear,\n getTriggeringPath: getTriggeringPath\n };\n };\n var extractPreparedMenu = function (prep) {\n return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none();\n };\n var LayeredState = {\n init: init$3,\n extractPreparedMenu: extractPreparedMenu\n };\n\n var make$2 = function (detail, _rawUiSpec) {\n var submenuParentItems = Cell(Option.none());\n var buildMenus = function (container, primaryName, menus) {\n return map$2(menus, function (spec, name) {\n var makeSketch = function () {\n return Menu.sketch(__assign(__assign({}, spec), {\n value: name,\n markers: detail.markers,\n fakeFocus: detail.fakeFocus,\n onHighlight: detail.onHighlight,\n focusManager: detail.fakeFocus ? highlights() : dom()\n }));\n };\n return name === primaryName ? {\n type: 'prepared',\n menu: container.getSystem().build(makeSketch())\n } : {\n type: 'notbuilt',\n nbMenu: makeSketch\n };\n });\n };\n var layeredState = LayeredState.init();\n var setup = function (container) {\n var componentMap = buildMenus(container, detail.data.primary, detail.data.menus);\n var directory = toDirectory();\n layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory);\n return layeredState.getPrimary();\n };\n var getItemValue = function (item) {\n return Representing.getValue(item).value;\n };\n var getItemByValue = function (_container, menus, itemValue) {\n return findMap(menus, function (menu) {\n if (!menu.getSystem().isConnected()) {\n return Option.none();\n }\n var candidates = Highlighting.getCandidates(menu);\n return find(candidates, function (c) {\n return getItemValue(c) === itemValue;\n });\n });\n };\n var toDirectory = function (_container) {\n return map$2(detail.data.menus, function (data, _menuName) {\n return bind(data.items, function (item) {\n return item.type === 'separator' ? [] : [item.data.value];\n });\n });\n };\n var setActiveMenu = function (container, menu) {\n Highlighting.highlight(container, menu);\n Highlighting.getHighlighted(menu).orThunk(function () {\n return Highlighting.getFirst(menu);\n }).each(function (item) {\n dispatch(container, item.element(), focusItem());\n });\n };\n var getMenus = function (state, menuValues) {\n return cat(map(menuValues, function (mv) {\n return state.lookupMenu(mv).bind(function (prep) {\n return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none();\n });\n }));\n };\n var closeOthers = function (container, state, path) {\n var others = getMenus(state, state.otherMenus(path));\n each(others, function (o) {\n remove$5(o.element(), [detail.markers.backgroundMenu]);\n if (!detail.stayInDom) {\n Replacing.remove(container, o);\n }\n });\n };\n var getSubmenuParents = function (container) {\n return submenuParentItems.get().getOrThunk(function () {\n var r = {};\n var items = descendants(container.element(), '.' + detail.markers.item);\n var parentItems = filter(items, function (i) {\n return get$2(i, 'aria-haspopup') === 'true';\n });\n each(parentItems, function (i) {\n container.getSystem().getByDom(i).each(function (itemComp) {\n var key = getItemValue(itemComp);\n r[key] = itemComp;\n });\n });\n submenuParentItems.set(Option.some(r));\n return r;\n });\n };\n var updateAriaExpansions = function (container, path) {\n var parentItems = getSubmenuParents(container);\n each$1(parentItems, function (v, k) {\n var expanded = contains(path, k);\n set$1(v.element(), 'aria-expanded', expanded);\n });\n };\n var updateMenuPath = function (container, state, path) {\n return Option.from(path[0]).bind(function (latestMenuName) {\n return state.lookupMenu(latestMenuName).bind(function (menuPrep) {\n if (menuPrep.type === 'notbuilt') {\n return Option.none();\n } else {\n var activeMenu = menuPrep.menu;\n var rest = getMenus(state, path.slice(1));\n each(rest, function (r) {\n add$2(r.element(), detail.markers.backgroundMenu);\n });\n if (!inBody(activeMenu.element())) {\n Replacing.append(container, premade$1(activeMenu));\n }\n remove$5(activeMenu.element(), [detail.markers.backgroundMenu]);\n setActiveMenu(container, activeMenu);\n closeOthers(container, state, path);\n return Option.some(activeMenu);\n }\n });\n });\n };\n var ExpandHighlightDecision;\n (function (ExpandHighlightDecision) {\n ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu';\n ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent';\n }(ExpandHighlightDecision || (ExpandHighlightDecision = {})));\n var buildIfRequired = function (container, menuName, menuPrep) {\n if (menuPrep.type === 'notbuilt') {\n var menu = container.getSystem().build(menuPrep.nbMenu());\n layeredState.setMenuBuilt(menuName, menu);\n return menu;\n } else {\n return menuPrep.menu;\n }\n };\n var expandRight = function (container, item, decision) {\n if (decision === void 0) {\n decision = ExpandHighlightDecision.HighlightSubmenu;\n }\n var value = getItemValue(item);\n return layeredState.expand(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return Option.from(path[0]).bind(function (menuName) {\n return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) {\n var activeMenu = buildIfRequired(container, menuName, activeMenuPrep);\n if (!inBody(activeMenu.element())) {\n Replacing.append(container, premade$1(activeMenu));\n }\n detail.onOpenSubmenu(container, item, activeMenu, reverse(path));\n if (decision === ExpandHighlightDecision.HighlightSubmenu) {\n Highlighting.highlightFirst(activeMenu);\n return updateMenuPath(container, layeredState, path);\n } else {\n Highlighting.dehighlightAll(activeMenu);\n return Option.some(item);\n }\n });\n });\n });\n };\n var collapseLeft = function (container, item) {\n var value = getItemValue(item);\n return layeredState.collapse(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return updateMenuPath(container, layeredState, path).map(function (activeMenu) {\n detail.onCollapseMenu(container, item, activeMenu);\n return activeMenu;\n });\n });\n };\n var updateView = function (container, item) {\n var value = getItemValue(item);\n return layeredState.refresh(value).bind(function (path) {\n updateAriaExpansions(container, path);\n return updateMenuPath(container, layeredState, path);\n });\n };\n var onRight = function (container, item) {\n return inside(item.element()) ? Option.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu);\n };\n var onLeft = function (container, item) {\n return inside(item.element()) ? Option.none() : collapseLeft(container, item);\n };\n var onEscape = function (container, item) {\n return collapseLeft(container, item).orThunk(function () {\n return detail.onEscape(container, item).map(function () {\n return container;\n });\n });\n };\n var keyOnItem = function (f) {\n return function (container, simulatedEvent) {\n return closest$3(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) {\n return container.getSystem().getByDom(target).toOption().bind(function (item) {\n return f(container, item).map(function () {\n return true;\n });\n });\n });\n };\n };\n var events = derive([\n run(focus$4(), function (sandbox, simulatedEvent) {\n var item = simulatedEvent.event().item();\n layeredState.lookupItem(getItemValue(item)).each(function () {\n var menu = simulatedEvent.event().menu();\n Highlighting.highlight(sandbox, menu);\n var value = getItemValue(simulatedEvent.event().item());\n layeredState.refresh(value).each(function (path) {\n return closeOthers(sandbox, layeredState, path);\n });\n });\n }),\n runOnExecute(function (component, simulatedEvent) {\n var target = simulatedEvent.event().target();\n component.getSystem().getByDom(target).each(function (item) {\n var itemValue = getItemValue(item);\n if (itemValue.indexOf('collapse-item') === 0) {\n collapseLeft(component, item);\n }\n expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () {\n detail.onExecute(component, item);\n }, function () {\n });\n });\n }),\n runOnAttached(function (container, _simulatedEvent) {\n setup(container).each(function (primary) {\n Replacing.append(container, premade$1(primary));\n detail.onOpenMenu(container, primary);\n if (detail.highlightImmediately) {\n setActiveMenu(container, primary);\n }\n });\n })\n ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) {\n var item = simulatedEvent.event().item();\n updateView(sandbox, item);\n expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent);\n detail.onHover(sandbox, item);\n })] : []));\n var getActiveItem = function (container) {\n return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted);\n };\n var collapseMenuApi = function (container) {\n getActiveItem(container).each(function (currentItem) {\n collapseLeft(container, currentItem);\n });\n };\n var highlightPrimary = function (container) {\n layeredState.getPrimary().each(function (primary) {\n setActiveMenu(container, primary);\n });\n };\n var extractMenuFromContainer = function (container) {\n return Option.from(container.components()[0]).filter(function (comp) {\n return get$2(comp.element(), 'role') === 'menu';\n });\n };\n var repositionMenus = function (container) {\n var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) {\n return getActiveItem(container).bind(function (currentItem) {\n var itemValue = getItemValue(currentItem);\n var allMenus = values(layeredState.getMenus());\n var preparedMenus = cat(map(allMenus, LayeredState.extractPreparedMenu));\n return layeredState.getTriggeringPath(itemValue, function (v) {\n return getItemByValue(container, preparedMenus, v);\n });\n }).map(function (triggeringPath) {\n return {\n primary: primary,\n triggeringPath: triggeringPath\n };\n });\n });\n maybeActivePrimary.fold(function () {\n extractMenuFromContainer(container).each(function (primaryMenu) {\n detail.onRepositionMenu(container, primaryMenu, []);\n });\n }, function (_a) {\n var primary = _a.primary, triggeringPath = _a.triggeringPath;\n detail.onRepositionMenu(container, primary, triggeringPath);\n });\n };\n var apis = {\n collapseMenu: collapseMenuApi,\n highlightPrimary: highlightPrimary,\n repositionMenus: repositionMenus\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n markers: detail.markers,\n behaviours: augment(detail.tmenuBehaviours, [\n Keying.config({\n mode: 'special',\n onRight: keyOnItem(onRight),\n onLeft: keyOnItem(onLeft),\n onEscape: keyOnItem(onEscape),\n focusIn: function (container, _keyInfo) {\n layeredState.getPrimary().each(function (primary) {\n dispatch(container, primary.element(), focusItem());\n });\n }\n }),\n Highlighting.config({\n highlightClass: detail.markers.selectedMenu,\n itemClass: detail.markers.menu\n }),\n Composing.config({\n find: function (container) {\n return Highlighting.getHighlighted(container);\n }\n }),\n Replacing.config({})\n ]),\n eventOrder: detail.eventOrder,\n apis: apis,\n events: events\n };\n };\n var collapseItem = constant('collapse-item');\n\n var tieredData = function (primary, menus, expansions) {\n return {\n primary: primary,\n menus: menus,\n expansions: expansions\n };\n };\n var singleData = function (name, menu) {\n return {\n primary: name,\n menus: wrap$1(name, menu),\n expansions: {}\n };\n };\n var collapseItem$1 = function (text) {\n return {\n value: generate$1(collapseItem()),\n meta: { text: text }\n };\n };\n var tieredMenu = single$2({\n name: 'TieredMenu',\n configFields: [\n onStrictKeyboardHandler('onExecute'),\n onStrictKeyboardHandler('onEscape'),\n onStrictHandler('onOpenMenu'),\n onStrictHandler('onOpenSubmenu'),\n onHandler('onRepositionMenu'),\n onHandler('onCollapseMenu'),\n defaulted$1('highlightImmediately', true),\n strictObjOf('data', [\n strict$1('primary'),\n strict$1('menus'),\n strict$1('expansions')\n ]),\n defaulted$1('fakeFocus', false),\n onHandler('onHighlight'),\n onHandler('onHover'),\n tieredMenuMarkers(),\n strict$1('dom'),\n defaulted$1('navigateOnHover', true),\n defaulted$1('stayInDom', false),\n field$1('tmenuBehaviours', [\n Keying,\n Highlighting,\n Composing,\n Replacing\n ]),\n defaulted$1('eventOrder', {})\n ],\n apis: {\n collapseMenu: function (apis, tmenu) {\n apis.collapseMenu(tmenu);\n },\n highlightPrimary: function (apis, tmenu) {\n apis.highlightPrimary(tmenu);\n },\n repositionMenus: function (apis, tmenu) {\n apis.repositionMenus(tmenu);\n }\n },\n factory: make$2,\n extraApis: {\n tieredData: tieredData,\n singleData: singleData,\n collapseItem: collapseItem$1\n }\n });\n\n var makeMenu = function (detail, menuSandbox, anchor, menuSpec, getBounds) {\n var lazySink = function () {\n return detail.lazySink(menuSandbox);\n };\n var layouts = menuSpec.type === 'horizontal' ? {\n layouts: {\n onLtr: function () {\n return belowOrAbove();\n },\n onRtl: function () {\n return belowOrAboveRtl();\n }\n }\n } : {};\n var isFirstTierSubmenu = function (triggeringPaths) {\n return triggeringPaths.length === 2;\n };\n var getSubmenuLayouts = function (triggeringPaths) {\n return isFirstTierSubmenu(triggeringPaths) ? layouts : {};\n };\n return tieredMenu.sketch({\n dom: { tag: 'div' },\n data: menuSpec.data,\n markers: menuSpec.menu.markers,\n highlightImmediately: menuSpec.menu.highlightImmediately,\n onEscape: function () {\n Sandboxing.close(menuSandbox);\n detail.onEscape.map(function (handler) {\n return handler(menuSandbox);\n });\n return Option.some(true);\n },\n onExecute: function () {\n return Option.some(true);\n },\n onOpenMenu: function (tmenu, menu) {\n Positioning.positionWithinBounds(lazySink().getOrDie(), anchor, menu, getBounds());\n },\n onOpenSubmenu: function (tmenu, item, submenu, triggeringPaths) {\n var sink = lazySink().getOrDie();\n Positioning.position(sink, __assign({\n anchor: 'submenu',\n item: item\n }, getSubmenuLayouts(triggeringPaths)), submenu);\n },\n onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) {\n var sink = lazySink().getOrDie();\n Positioning.positionWithinBounds(sink, anchor, primaryMenu, getBounds());\n each(submenuTriggers, function (st) {\n var submenuLayouts = getSubmenuLayouts(st.triggeringPath);\n Positioning.position(sink, __assign({\n anchor: 'submenu',\n item: st.triggeringItem\n }, submenuLayouts), st.triggeredMenu);\n });\n }\n });\n };\n var factory = function (detail, spec) {\n var isPartOfRelated = function (sandbox, queryElem) {\n var related = detail.getRelated(sandbox);\n return related.exists(function (rel) {\n return isPartOf(rel, queryElem);\n });\n };\n var setContent = function (sandbox, thing) {\n Sandboxing.setContent(sandbox, thing);\n };\n var showAt = function (sandbox, anchor, thing) {\n showWithin(sandbox, anchor, thing, Option.none());\n };\n var showWithin = function (sandbox, anchor, thing, boxElement) {\n showWithinBounds(sandbox, anchor, thing, function () {\n return boxElement.map(function (elem) {\n return box(elem);\n });\n });\n };\n var showWithinBounds = function (sandbox, anchor, thing, getBounds) {\n var sink = detail.lazySink(sandbox).getOrDie();\n Sandboxing.openWhileCloaked(sandbox, thing, function () {\n return Positioning.positionWithinBounds(sink, anchor, sandbox, getBounds());\n });\n Representing.setValue(sandbox, Option.some({\n mode: 'position',\n anchor: anchor,\n getBounds: getBounds\n }));\n };\n var showMenuAt = function (sandbox, anchor, menuSpec) {\n showMenuWithinBounds(sandbox, anchor, menuSpec, function () {\n return Option.none();\n });\n };\n var showMenuWithinBounds = function (sandbox, anchor, menuSpec, getBounds) {\n var menu = makeMenu(detail, sandbox, anchor, menuSpec, getBounds);\n Sandboxing.open(sandbox, menu);\n Representing.setValue(sandbox, Option.some({\n mode: 'menu',\n menu: menu\n }));\n };\n var hide = function (sandbox) {\n if (Sandboxing.isOpen(sandbox)) {\n Representing.setValue(sandbox, Option.none());\n Sandboxing.close(sandbox);\n }\n };\n var getContent = function (sandbox) {\n return Sandboxing.getState(sandbox);\n };\n var reposition = function (sandbox) {\n if (Sandboxing.isOpen(sandbox)) {\n Representing.getValue(sandbox).each(function (state) {\n switch (state.mode) {\n case 'menu':\n Sandboxing.getState(sandbox).each(function (tmenu) {\n tieredMenu.repositionMenus(tmenu);\n });\n break;\n case 'position':\n var sink = detail.lazySink(sandbox).getOrDie();\n Positioning.positionWithinBounds(sink, state.anchor, sandbox, state.getBounds());\n break;\n }\n });\n }\n };\n var apis = {\n setContent: setContent,\n showAt: showAt,\n showWithin: showWithin,\n showWithinBounds: showWithinBounds,\n showMenuAt: showMenuAt,\n showMenuWithinBounds: showMenuWithinBounds,\n hide: hide,\n getContent: getContent,\n reposition: reposition,\n isOpen: Sandboxing.isOpen\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n behaviours: augment(detail.inlineBehaviours, [\n Sandboxing.config({\n isPartOf: function (sandbox, data, queryElem) {\n return isPartOf(data, queryElem) || isPartOfRelated(sandbox, queryElem);\n },\n getAttachPoint: function (sandbox) {\n return detail.lazySink(sandbox).getOrDie();\n },\n onOpen: function (sandbox) {\n detail.onShow(sandbox);\n },\n onClose: function (sandbox) {\n detail.onHide(sandbox);\n }\n }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: Option.none()\n }\n }),\n Receiving.config({\n channels: __assign(__assign({}, receivingChannel(__assign({ isExtraPart: spec.isExtraPart }, detail.fireDismissalEventInstead.map(function (fe) {\n return { fireEventInstead: { event: fe.event } };\n }).getOr({})))), receivingChannel$1(__assign(__assign({}, detail.fireRepositionEventInstead.map(function (fe) {\n return { fireEventInstead: { event: fe.event } };\n }).getOr({})), { doReposition: reposition })))\n })\n ]),\n eventOrder: detail.eventOrder,\n apis: apis\n };\n };\n var InlineView = single$2({\n name: 'InlineView',\n configFields: [\n strict$1('lazySink'),\n onHandler('onShow'),\n onHandler('onHide'),\n optionFunction('onEscape'),\n field$1('inlineBehaviours', [\n Sandboxing,\n Representing,\n Receiving\n ]),\n optionObjOf('fireDismissalEventInstead', [defaulted$1('event', dismissRequested())]),\n optionObjOf('fireRepositionEventInstead', [defaulted$1('event', repositionRequested())]),\n defaulted$1('getRelated', Option.none),\n defaulted$1('isExtraPart', never),\n defaulted$1('eventOrder', Option.none)\n ],\n factory: factory,\n apis: {\n showAt: function (apis, component, anchor, thing) {\n apis.showAt(component, anchor, thing);\n },\n showWithin: function (apis, component, anchor, thing, boxElement) {\n apis.showWithin(component, anchor, thing, boxElement);\n },\n showWithinBounds: function (apis, component, anchor, thing, bounds) {\n apis.showWithinBounds(component, anchor, thing, bounds);\n },\n showMenuAt: function (apis, component, anchor, menuSpec) {\n apis.showMenuAt(component, anchor, menuSpec);\n },\n showMenuWithinBounds: function (apis, component, anchor, menuSpec, bounds) {\n apis.showMenuWithinBounds(component, anchor, menuSpec, bounds);\n },\n hide: function (apis, component) {\n apis.hide(component);\n },\n isOpen: function (apis, component) {\n return apis.isOpen(component);\n },\n getContent: function (apis, component) {\n return apis.getContent(component);\n },\n setContent: function (apis, component, thing) {\n apis.setContent(component, thing);\n },\n reposition: function (apis, component) {\n apis.reposition(component);\n }\n }\n });\n\n var westEdgeX$1 = function (anchor) {\n return anchor.x;\n };\n var middleX$1 = function (anchor, element) {\n return anchor.x + anchor.width / 2 - element.width / 2;\n };\n var eastEdgeX$1 = function (anchor, element) {\n return anchor.x + anchor.width - element.width;\n };\n var northY$2 = function (anchor) {\n return anchor.y;\n };\n var southY$2 = function (anchor, element) {\n return anchor.y + anchor.height - element.height;\n };\n var southeast$3 = function (anchor, element, bubbles) {\n return nu$7(eastEdgeX$1(anchor, element), southY$2(anchor, element), bubbles.innerSoutheast(), northwest(), boundsRestriction(anchor, {\n right: 0,\n bottom: 3\n }), 'layout-inner-se');\n };\n var southwest$3 = function (anchor, element, bubbles) {\n return nu$7(westEdgeX$1(anchor), southY$2(anchor, element), bubbles.innerSouthwest(), northeast(), boundsRestriction(anchor, {\n left: 1,\n bottom: 3\n }), 'layout-inner-sw');\n };\n var northeast$3 = function (anchor, element, bubbles) {\n return nu$7(eastEdgeX$1(anchor, element), northY$2(anchor), bubbles.innerNortheast(), southwest(), boundsRestriction(anchor, {\n right: 0,\n top: 2\n }), 'layout-inner-ne');\n };\n var northwest$3 = function (anchor, element, bubbles) {\n return nu$7(westEdgeX$1(anchor), northY$2(anchor), bubbles.innerNorthwest(), southeast(), boundsRestriction(anchor, {\n left: 1,\n top: 2\n }), 'layout-inner-nw');\n };\n var north$3 = function (anchor, element, bubbles) {\n return nu$7(middleX$1(anchor, element), northY$2(anchor), bubbles.innerNorth(), south(), boundsRestriction(anchor, { top: 2 }), 'layout-inner-n');\n };\n var south$3 = function (anchor, element, bubbles) {\n return nu$7(middleX$1(anchor, element), southY$2(anchor, element), bubbles.innerSouth(), north(), boundsRestriction(anchor, { bottom: 3 }), 'layout-inner-s');\n };\n\n var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');\n\n var factory$1 = function (detail) {\n var events = events$7(detail.action);\n var tag = detail.dom.tag;\n var lookupAttr = function (attr) {\n return get(detail.dom, 'attributes').bind(function (attrs) {\n return get(attrs, attr);\n });\n };\n var getModAttributes = function () {\n if (tag === 'button') {\n var type = lookupAttr('type').getOr('button');\n var roleAttrs = lookupAttr('role').map(function (role) {\n return { role: role };\n }).getOr({});\n return __assign({ type: type }, roleAttrs);\n } else {\n var role = lookupAttr('role').getOr('button');\n return { role: role };\n }\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: detail.components,\n events: events,\n behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [\n Focusing.config({}),\n Keying.config({\n mode: 'execution',\n useSpace: true,\n useEnter: true\n })\n ]),\n domModification: { attributes: getModAttributes() },\n eventOrder: detail.eventOrder\n };\n };\n var Button = single$2({\n name: 'Button',\n factory: factory$1,\n configFields: [\n defaulted$1('uid', undefined),\n strict$1('dom'),\n defaulted$1('components', []),\n SketchBehaviours.field('buttonBehaviours', [\n Focusing,\n Keying\n ]),\n option('action'),\n option('role'),\n defaulted$1('eventOrder', {})\n ]\n });\n\n var record = function (spec) {\n var uid = isSketchSpec(spec) && hasNonNullableKey(spec, 'uid') ? spec.uid : generate$2('memento');\n var get = function (anyInSystem) {\n return anyInSystem.getSystem().getByUid(uid).getOrDie();\n };\n var getOpt = function (anyInSystem) {\n return anyInSystem.getSystem().getByUid(uid).toOption();\n };\n var asSpec = function () {\n return __assign(__assign({}, spec), { uid: uid });\n };\n return {\n get: get,\n getOpt: getOpt,\n asSpec: asSpec\n };\n };\n\n var defaultIcon = function (icons) {\n return Option.from(icons()['temporary-placeholder']).getOr('!not found!');\n };\n var get$d = function (name, icons) {\n return Option.from(icons()[name.toLowerCase()]).getOrThunk(function () {\n return defaultIcon(icons);\n });\n };\n var getOr = function (name, icons, fallback) {\n return Option.from(icons()[name.toLowerCase()]).or(fallback).getOrThunk(function () {\n return defaultIcon(icons);\n });\n };\n var getFirst$1 = function (names, icons) {\n return findMap(names, function (name) {\n return Option.from(icons()[name.toLowerCase()]);\n }).getOrThunk(function () {\n return defaultIcon(icons);\n });\n };\n\n var notificationIconMap = {\n success: 'checkmark',\n error: 'warning',\n err: 'error',\n warning: 'warning',\n warn: 'warning',\n info: 'info'\n };\n var factory$2 = function (detail) {\n var memBannerText = record({\n dom: {\n tag: 'p',\n innerHtml: detail.translationProvider(detail.text)\n },\n behaviours: derive$1([Replacing.config({})])\n });\n var renderPercentBar = function (percent) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-bar'],\n attributes: { style: 'width: ' + percent + '%' }\n }\n };\n };\n var renderPercentText = function (percent) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-text'],\n innerHtml: percent + '%'\n }\n };\n };\n var memBannerProgress = record({\n dom: {\n tag: 'div',\n classes: detail.progress ? [\n 'tox-progress-bar',\n 'tox-progress-indicator'\n ] : ['tox-progress-bar']\n },\n components: [\n {\n dom: {\n tag: 'div',\n classes: ['tox-bar-container']\n },\n components: [renderPercentBar(0)]\n },\n renderPercentText(0)\n ],\n behaviours: derive$1([Replacing.config({})])\n });\n var updateProgress = function (comp, percent) {\n if (comp.getSystem().isConnected()) {\n memBannerProgress.getOpt(comp).each(function (progress) {\n Replacing.set(progress, [\n {\n dom: {\n tag: 'div',\n classes: ['tox-bar-container']\n },\n components: [renderPercentBar(percent)]\n },\n renderPercentText(percent)\n ]);\n });\n }\n };\n var updateText = function (comp, text$1) {\n if (comp.getSystem().isConnected()) {\n var banner = memBannerText.get(comp);\n Replacing.set(banner, [text(text$1)]);\n }\n };\n var apis = {\n updateProgress: updateProgress,\n updateText: updateText\n };\n var iconChoices = flatten([\n detail.icon.toArray(),\n detail.level.toArray(),\n detail.level.bind(function (level) {\n return Option.from(notificationIconMap[level]);\n }).toArray()\n ]);\n return {\n uid: detail.uid,\n dom: {\n tag: 'div',\n attributes: { role: 'alert' },\n classes: detail.level.map(function (level) {\n return [\n 'tox-notification',\n 'tox-notification--in',\n 'tox-notification--' + level\n ];\n }).getOr([\n 'tox-notification',\n 'tox-notification--in'\n ])\n },\n components: [\n {\n dom: {\n tag: 'div',\n classes: ['tox-notification__icon'],\n innerHtml: getFirst$1(iconChoices, detail.iconProvider)\n }\n },\n {\n dom: {\n tag: 'div',\n classes: ['tox-notification__body']\n },\n components: [memBannerText.asSpec()],\n behaviours: derive$1([Replacing.config({})])\n }\n ].concat(detail.progress ? [memBannerProgress.asSpec()] : []).concat(!detail.closeButton ? [] : [Button.sketch({\n dom: {\n tag: 'button',\n classes: [\n 'tox-notification__dismiss',\n 'tox-button',\n 'tox-button--naked',\n 'tox-button--icon'\n ]\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-icon'],\n innerHtml: get$d('close', detail.iconProvider),\n attributes: { 'aria-label': detail.translationProvider('Close') }\n }\n }],\n action: function (comp) {\n detail.onAction(comp);\n }\n })]),\n apis: apis\n };\n };\n var Notification = single$2({\n name: 'Notification',\n factory: factory$2,\n configFields: [\n option('level'),\n strict$1('progress'),\n strict$1('icon'),\n strict$1('onAction'),\n strict$1('text'),\n strict$1('iconProvider'),\n strict$1('translationProvider'),\n defaultedBoolean('closeButton', true)\n ],\n apis: {\n updateProgress: function (apis, comp, percent) {\n apis.updateProgress(comp, percent);\n },\n updateText: function (apis, comp, text) {\n apis.updateText(comp, text);\n }\n }\n });\n\n function NotificationManagerImpl (editor, extras, uiMothership) {\n var backstage = extras.backstage;\n var getLayoutDirection = function (rel) {\n switch (rel) {\n case 'bc-bc':\n return south$3;\n case 'tc-tc':\n return north$3;\n case 'tc-bc':\n return north$1;\n case 'bc-tc':\n default:\n return south$1;\n }\n };\n var prePositionNotifications = function (notifications) {\n each(notifications, function (notification) {\n return notification.moveTo(0, 0);\n });\n };\n var positionNotifications = function (notifications) {\n if (notifications.length > 0) {\n head(notifications).each(function (firstItem) {\n return firstItem.moveRel(null, 'banner');\n });\n each(notifications, function (notification, index) {\n if (index > 0) {\n notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');\n }\n });\n }\n };\n var reposition = function (notifications) {\n prePositionNotifications(notifications);\n positionNotifications(notifications);\n };\n var open = function (settings, closeCallback) {\n var hideCloseButton = !settings.closeButton && settings.timeout && (settings.timeout > 0 || settings.timeout < 0);\n var close = function () {\n closeCallback();\n InlineView.hide(notificationWrapper);\n };\n var notification = build$1(Notification.sketch({\n text: settings.text,\n level: contains([\n 'success',\n 'error',\n 'warning',\n 'warn',\n 'info'\n ], settings.type) ? settings.type : undefined,\n progress: settings.progressBar === true,\n icon: Option.from(settings.icon),\n closeButton: !hideCloseButton,\n onAction: close,\n iconProvider: backstage.shared.providers.icons,\n translationProvider: backstage.shared.providers.translate\n }));\n var notificationWrapper = build$1(InlineView.sketch(__assign({\n dom: {\n tag: 'div',\n classes: ['tox-notifications-container']\n },\n lazySink: extras.backstage.shared.getSink,\n fireDismissalEventInstead: {}\n }, backstage.shared.header.isPositionedAtTop() ? {} : { fireRepositionEventInstead: {} })));\n uiMothership.add(notificationWrapper);\n if (settings.timeout > 0) {\n global$2.setTimeout(function () {\n close();\n }, settings.timeout);\n }\n return {\n close: close,\n moveTo: function (x, y) {\n InlineView.showAt(notificationWrapper, {\n anchor: 'makeshift',\n x: x,\n y: y\n }, premade$1(notification));\n },\n moveRel: function (element, rel) {\n if (rel !== 'banner') {\n var layoutDirection_1 = getLayoutDirection(rel);\n var nodeAnchor = {\n anchor: 'node',\n root: body(),\n node: Option.some(Element.fromDom(element)),\n layouts: {\n onRtl: function () {\n return [layoutDirection_1];\n },\n onLtr: function () {\n return [layoutDirection_1];\n }\n }\n };\n InlineView.showAt(notificationWrapper, nodeAnchor, premade$1(notification));\n } else {\n InlineView.showAt(notificationWrapper, extras.backstage.shared.anchors.banner(), premade$1(notification));\n }\n },\n text: function (nuText) {\n Notification.updateText(notification, nuText);\n },\n settings: settings,\n getEl: function () {\n return notification.element().dom();\n },\n progressBar: {\n value: function (percent) {\n Notification.updateProgress(notification, percent);\n }\n }\n };\n };\n var close = function (notification) {\n notification.close();\n };\n var getArgs = function (notification) {\n return notification.settings;\n };\n return {\n open: open,\n close: close,\n reposition: reposition,\n getArgs: getArgs\n };\n }\n\n var first = function (fn, rate) {\n var timer = null;\n var cancel = function () {\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n timer = null;\n }\n };\n var throttle = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timer === null) {\n timer = domGlobals.setTimeout(function () {\n fn.apply(null, args);\n timer = null;\n }, rate);\n }\n };\n return {\n cancel: cancel,\n throttle: throttle\n };\n };\n var last$2 = function (fn, rate) {\n var timer = null;\n var cancel = function () {\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n timer = null;\n }\n };\n var throttle = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (timer !== null) {\n domGlobals.clearTimeout(timer);\n }\n timer = domGlobals.setTimeout(function () {\n fn.apply(null, args);\n timer = null;\n }, rate);\n };\n return {\n cancel: cancel,\n throttle: throttle\n };\n };\n\n var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TextSeeker');\n\n var isBoundary = function (dom, node) {\n return dom.isBlock(node) || contains([\n 'BR',\n 'IMG',\n 'HR',\n 'INPUT'\n ], node.nodeName) || dom.getContentEditable(node) === 'false';\n };\n var repeatLeft = function (dom, node, offset, process, rootNode) {\n var search = global$3(dom, function (node) {\n return isBoundary(dom, node);\n });\n return Option.from(search.backwards(node, offset, process, rootNode));\n };\n\n var autocompleteSelector = '[data-mce-autocompleter]';\n var create$4 = function (editor, range) {\n return detect$4(Element.fromDom(editor.selection.getNode())).getOrThunk(function () {\n var wrapper = Element.fromHtml('', editor.getDoc());\n append(wrapper, Element.fromDom(range.extractContents()));\n range.insertNode(wrapper.dom());\n parent(wrapper).each(function (elm) {\n return elm.dom().normalize();\n });\n last$1(wrapper).map(function (last) {\n editor.selection.setCursorLocation(last.dom(), getEnd(last));\n });\n return wrapper;\n });\n };\n var detect$4 = function (elm) {\n return closest$3(elm, autocompleteSelector);\n };\n\n var isValidTextRange = function (rng) {\n return rng.collapsed && rng.startContainer.nodeType === 3;\n };\n var getText = function (rng) {\n return rng.toString().replace(/\\u00A0/g, ' ').replace(/\\uFEFF/g, '');\n };\n var isWhitespace = function (chr) {\n return chr !== '' && ' \\xA0\\f\\n\\r\\t\\x0B'.indexOf(chr) !== -1;\n };\n\n var stripTriggerChar = function (text, triggerCh) {\n return text.substring(triggerCh.length);\n };\n var findChar = function (text, index, ch) {\n var i;\n for (i = index - 1; i >= 0; i--) {\n var char = text.charAt(i);\n if (isWhitespace(char)) {\n return Option.none();\n }\n if (char === ch) {\n break;\n }\n }\n return Option.some(i);\n };\n var findStart = function (dom, initRange, ch, minChars) {\n if (minChars === void 0) {\n minChars = 0;\n }\n if (!isValidTextRange(initRange)) {\n return Option.none();\n }\n var findTriggerChIndex = function (element, offset, text) {\n return findChar(text, offset, ch).getOr(offset);\n };\n var root = dom.getParent(initRange.startContainer, dom.isBlock) || dom.getRoot();\n return repeatLeft(dom, initRange.startContainer, initRange.startOffset, findTriggerChIndex, root).bind(function (spot) {\n var range = initRange.cloneRange();\n range.setStart(spot.container, spot.offset);\n range.setEnd(initRange.endContainer, initRange.endOffset);\n if (range.collapsed) {\n return Option.none();\n }\n var text = getText(range);\n var triggerCharIndex = text.lastIndexOf(ch);\n if (triggerCharIndex !== 0 || stripTriggerChar(text, ch).length < minChars) {\n return Option.none();\n } else {\n return Option.some({\n text: stripTriggerChar(text, ch),\n range: range,\n triggerChar: ch\n });\n }\n });\n };\n var getContext = function (dom, initRange, ch, minChars) {\n if (minChars === void 0) {\n minChars = 0;\n }\n return detect$4(Element.fromDom(initRange.startContainer)).fold(function () {\n return findStart(dom, initRange, ch, minChars);\n }, function (elm) {\n var range = dom.createRng();\n range.selectNode(elm.dom());\n var text = getText(range);\n return Option.some({\n range: range,\n text: stripTriggerChar(text, ch),\n triggerChar: ch\n });\n });\n };\n\n var setup = function (api, editor) {\n editor.on('keypress compositionend', api.onKeypress.throttle);\n editor.on('remove', api.onKeypress.cancel);\n var redirectKeyToItem = function (item, e) {\n emitWith(item, keydown(), { raw: e });\n };\n editor.on('keydown', function (e) {\n var getItem = function () {\n return api.getView().bind(Highlighting.getHighlighted);\n };\n if (e.which === 8) {\n api.onKeypress.throttle(e);\n }\n if (api.isActive()) {\n if (e.which === 27) {\n api.cancelIfNecessary();\n }\n if (api.isMenuOpen()) {\n if (e.which === 13) {\n getItem().each(emitExecute);\n e.preventDefault();\n } else if (e.which === 40) {\n getItem().fold(function () {\n api.getView().each(Highlighting.highlightFirst);\n }, function (item) {\n redirectKeyToItem(item, e);\n });\n e.preventDefault();\n e.stopImmediatePropagation();\n } else if (e.which === 37 || e.which === 38 || e.which === 39) {\n getItem().each(function (item) {\n redirectKeyToItem(item, e);\n e.preventDefault();\n e.stopImmediatePropagation();\n });\n }\n } else {\n if (e.which === 13 || e.which === 38 || e.which === 40) {\n api.cancelIfNecessary();\n }\n }\n }\n });\n editor.on('NodeChange', function (e) {\n if (api.isActive() && !api.isProcessingAction() && detect$4(Element.fromDom(e.element)).isNone()) {\n api.cancelIfNecessary();\n }\n });\n };\n var AutocompleterEditorEvents = { setup: setup };\n\n var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise');\n\n var point$2 = function (container, offset) {\n return {\n container: container,\n offset: offset\n };\n };\n\n var isText$1 = function (node) {\n return node.nodeType === domGlobals.Node.TEXT_NODE;\n };\n var isElement$1 = function (node) {\n return node.nodeType === domGlobals.Node.ELEMENT_NODE;\n };\n var toLast = function (node) {\n if (isText$1(node)) {\n return point$2(node, node.data.length);\n } else {\n var children = node.childNodes;\n return children.length > 0 ? toLast(children[children.length - 1]) : point$2(node, children.length);\n }\n };\n var toLeaf = function (node, offset) {\n var children = node.childNodes;\n if (children.length > 0 && offset < children.length) {\n return toLeaf(children[offset], 0);\n } else if (children.length > 0 && isElement$1(node) && children.length === offset) {\n return toLast(children[children.length - 1]);\n } else {\n return point$2(node, offset);\n }\n };\n\n var isPreviousCharContent = function (dom, leaf) {\n return repeatLeft(dom, leaf.container, leaf.offset, function (element, offset) {\n return offset === 0 ? -1 : offset;\n }, dom.getRoot()).filter(function (spot) {\n var char = spot.container.data.charAt(spot.offset - 1);\n return !isWhitespace(char);\n }).isSome();\n };\n var isStartOfWord = function (dom) {\n return function (rng) {\n var leaf = toLeaf(rng.startContainer, rng.startOffset);\n return !isPreviousCharContent(dom, leaf);\n };\n };\n var getTriggerContext = function (dom, initRange, database) {\n return findMap(database.triggerChars, function (ch) {\n return getContext(dom, initRange, ch);\n });\n };\n var lookup = function (editor, getDatabase) {\n var database = getDatabase();\n var rng = editor.selection.getRng();\n return getTriggerContext(editor.dom, rng, database).bind(function (context) {\n return lookupWithContext(editor, getDatabase, context);\n });\n };\n var lookupWithContext = function (editor, getDatabase, context, fetchOptions) {\n if (fetchOptions === void 0) {\n fetchOptions = {};\n }\n var database = getDatabase();\n var rng = editor.selection.getRng();\n var startText = rng.startContainer.nodeValue;\n var autocompleters = filter(database.lookupByChar(context.triggerChar), function (autocompleter) {\n return context.text.length >= autocompleter.minChars && autocompleter.matches.getOrThunk(function () {\n return isStartOfWord(editor.dom);\n })(context.range, startText, context.text);\n });\n if (autocompleters.length === 0) {\n return Option.none();\n }\n var lookupData = global$4.all(map(autocompleters, function (ac) {\n var fetchResult = ac.fetch(context.text, ac.maxResults, fetchOptions);\n return fetchResult.then(function (results) {\n return {\n matchText: context.text,\n items: results,\n columns: ac.columns,\n onAction: ac.onAction\n };\n });\n }));\n return Option.some({\n lookupData: lookupData,\n context: context\n });\n };\n\n var separatorMenuItemSchema = objOf([\n strictString('type'),\n optionString('text')\n ]);\n var createSeparatorMenuItem = function (spec) {\n return asRaw('separatormenuitem', separatorMenuItemSchema, spec);\n };\n\n var autocompleterItemSchema = objOf([\n state$1('type', function () {\n return 'autocompleteitem';\n }),\n state$1('active', function () {\n return false;\n }),\n state$1('disabled', function () {\n return false;\n }),\n defaulted$1('meta', {}),\n strictString('value'),\n optionString('text'),\n optionString('icon')\n ]);\n var autocompleterSchema = objOf([\n strictString('type'),\n strictString('ch'),\n defaultedNumber('minChars', 1),\n defaulted$1('columns', 1),\n defaultedNumber('maxResults', 10),\n optionFunction('matches'),\n strictFunction('fetch'),\n strictFunction('onAction')\n ]);\n var createSeparatorItem = function (spec) {\n return asRaw('Autocompleter.Separator', separatorMenuItemSchema, spec);\n };\n var createAutocompleterItem = function (spec) {\n return asRaw('Autocompleter.Item', autocompleterItemSchema, spec);\n };\n var createAutocompleter = function (spec) {\n return asRaw('Autocompleter', autocompleterSchema, spec);\n };\n\n var stringArray = function (a) {\n var all = {};\n each(a, function (key) {\n all[key] = {};\n });\n return keys(all);\n };\n\n var register = function (editor) {\n var popups = editor.ui.registry.getAll().popups;\n var dataset = map$2(popups, function (popup) {\n return createAutocompleter(popup).fold(function (err) {\n throw new Error(formatError(err));\n }, function (x) {\n return x;\n });\n });\n var triggerChars = stringArray(mapToArray(dataset, function (v) {\n return v.ch;\n }));\n var datasetValues = values(dataset);\n var lookupByChar = function (ch) {\n return filter(datasetValues, function (dv) {\n return dv.ch === ch;\n });\n };\n return {\n dataset: dataset,\n triggerChars: triggerChars,\n lookupByChar: lookupByChar\n };\n };\n\n var ItemResponse;\n (function (ItemResponse) {\n ItemResponse[ItemResponse['CLOSE_ON_EXECUTE'] = 0] = 'CLOSE_ON_EXECUTE';\n ItemResponse[ItemResponse['BUBBLE_TO_SANDBOX'] = 1] = 'BUBBLE_TO_SANDBOX';\n }(ItemResponse || (ItemResponse = {})));\n var ItemResponse$1 = ItemResponse;\n\n var navClass = 'tox-menu-nav__js';\n var selectableClass = 'tox-collection__item';\n var colorClass = 'tox-swatch';\n var presetClasses = {\n normal: navClass,\n color: colorClass\n };\n var tickedClass = 'tox-collection__item--enabled';\n var groupHeadingClass = 'tox-collection__group-heading';\n var iconClass = 'tox-collection__item-icon';\n var textClass = 'tox-collection__item-label';\n var accessoryClass = 'tox-collection__item-accessory';\n var caretClass = 'tox-collection__item-caret';\n var checkmarkClass = 'tox-collection__item-checkmark';\n var activeClass = 'tox-collection__item--active';\n var iconClassRtl = 'tox-collection__item-icon-rtl';\n var classForPreset = function (presets) {\n return get(presetClasses, presets).getOr(navClass);\n };\n\n var forMenu = function (presets) {\n if (presets === 'color') {\n return 'tox-swatches';\n } else {\n return 'tox-menu';\n }\n };\n var classes = function (presets) {\n return {\n backgroundMenu: 'tox-background-menu',\n selectedMenu: 'tox-selected-menu',\n selectedItem: 'tox-collection__item--active',\n hasIcons: 'tox-menu--has-icons',\n menu: forMenu(presets),\n tieredMenu: 'tox-tiered-menu'\n };\n };\n\n var markers$1 = function (presets) {\n var menuClasses = classes(presets);\n return {\n backgroundMenu: menuClasses.backgroundMenu,\n selectedMenu: menuClasses.selectedMenu,\n menu: menuClasses.menu,\n selectedItem: menuClasses.selectedItem,\n item: classForPreset(presets)\n };\n };\n var dom$1 = function (hasIcons, columns, presets) {\n var menuClasses = classes(presets);\n return {\n tag: 'div',\n classes: flatten([\n [\n menuClasses.menu,\n 'tox-menu-' + columns + '-column'\n ],\n hasIcons ? [menuClasses.hasIcons] : []\n ])\n };\n };\n var components$1 = [Menu.parts().items({})];\n var part = function (hasIcons, columns, presets) {\n var menuClasses = classes(presets);\n var d = {\n tag: 'div',\n classes: flatten([[menuClasses.tieredMenu]])\n };\n return {\n dom: d,\n markers: markers$1(presets)\n };\n };\n\n var chunk$1 = function (rowDom, numColumns) {\n return function (items) {\n var chunks = chunk(items, numColumns);\n return map(chunks, function (c) {\n return {\n dom: rowDom,\n components: c\n };\n });\n };\n };\n var forSwatch = function (columns) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-menu',\n 'tox-swatches-menu'\n ]\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-swatches']\n },\n components: [Menu.parts().items({\n preprocess: columns !== 'auto' ? chunk$1({\n tag: 'div',\n classes: ['tox-swatches__row']\n }, columns) : identity\n })]\n }]\n };\n };\n var forToolbar = function (columns) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-menu',\n 'tox-collection',\n 'tox-collection--toolbar',\n 'tox-collection--toolbar-lg'\n ]\n },\n components: [Menu.parts().items({\n preprocess: chunk$1({\n tag: 'div',\n classes: ['tox-collection__group']\n }, columns)\n })]\n };\n };\n var preprocessCollection = function (items, isSeparator) {\n var allSplits = [];\n var currentSplit = [];\n each(items, function (item, i) {\n if (isSeparator(item, i)) {\n if (currentSplit.length > 0) {\n allSplits.push(currentSplit);\n }\n currentSplit = [];\n if (has(item.dom, 'innerHtml')) {\n currentSplit.push(item);\n }\n } else {\n currentSplit.push(item);\n }\n });\n if (currentSplit.length > 0) {\n allSplits.push(currentSplit);\n }\n return map(allSplits, function (s) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-collection__group']\n },\n components: s\n };\n });\n };\n var forCollection = function (columns, initItems, _hasIcons) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-menu',\n 'tox-collection'\n ].concat(columns === 1 ? ['tox-collection--list'] : ['tox-collection--grid'])\n },\n components: [Menu.parts().items({\n preprocess: function (items) {\n if (columns !== 'auto' && columns > 1) {\n return chunk$1({\n tag: 'div',\n classes: ['tox-collection__group']\n }, columns)(items);\n } else {\n return preprocessCollection(items, function (_item, i) {\n return initItems[i].type === 'separator';\n });\n }\n }\n })]\n };\n };\n var forHorizontalCollection = function (initItems, _hasIcons) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-collection',\n 'tox-collection--horizontal'\n ]\n },\n components: [Menu.parts().items({\n preprocess: function (items) {\n return preprocessCollection(items, function (_item, i) {\n return initItems[i].type === 'separator';\n });\n }\n })]\n };\n };\n\n var menuHasIcons = function (xs) {\n return exists(xs, function (item) {\n return 'icon' in item && item.icon !== undefined;\n });\n };\n var handleError = function (error) {\n domGlobals.console.error(formatError(error));\n domGlobals.console.log(error);\n return Option.none();\n };\n var createHorizontalPartialMenuWithAlloyItems = function (value, _hasIcons, items, _columns, _presets) {\n var structure = forHorizontalCollection(items);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n };\n var createPartialMenuWithAlloyItems = function (value, hasIcons, items, columns, presets) {\n if (presets === 'color') {\n var structure = forSwatch(columns);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n }\n if (presets === 'normal' && columns === 'auto') {\n var structure = forCollection(columns, items);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n }\n if (presets === 'normal' && columns === 1) {\n var structure = forCollection(1, items);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n }\n if (presets === 'normal') {\n var structure = forCollection(columns, items);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n }\n if (presets === 'listpreview' && columns !== 'auto') {\n var structure = forToolbar(columns);\n return {\n value: value,\n dom: structure.dom,\n components: structure.components,\n items: items\n };\n }\n return {\n value: value,\n dom: dom$1(hasIcons, columns, presets),\n components: components$1,\n items: items\n };\n };\n\n var commonMenuItemFields = [\n defaultedBoolean('disabled', false),\n optionString('text'),\n optionString('shortcut'),\n field('value', 'value', defaultedThunk(function () {\n return generate$1('menuitem-value');\n }), anyValue$1()),\n defaulted$1('meta', {})\n ];\n\n var choiceMenuItemSchema = objOf([\n strictString('type'),\n defaultedBoolean('active', false),\n optionString('icon')\n ].concat(commonMenuItemFields));\n var createChoiceMenuItem = function (spec) {\n return asRaw('choicemenuitem', choiceMenuItemSchema, spec);\n };\n\n var fancyTypes = [\n 'inserttable',\n 'colorswatch'\n ];\n var fancyMenuItemSchema = objOf([\n strictString('type'),\n strictStringEnum('fancytype', fancyTypes),\n defaultedFunction('onAction', noop)\n ]);\n var createFancyMenuItem = function (spec) {\n return asRaw('fancymenuitem', fancyMenuItemSchema, spec);\n };\n\n var menuItemSchema = objOf([\n strictString('type'),\n defaultedFunction('onSetup', function () {\n return noop;\n }),\n defaultedFunction('onAction', noop),\n optionString('icon')\n ].concat(commonMenuItemFields));\n var createMenuItem = function (spec) {\n return asRaw('menuitem', menuItemSchema, spec);\n };\n\n var nestedMenuItemSchema = objOf([\n strictString('type'),\n strictFunction('getSubmenuItems'),\n defaultedFunction('onSetup', function () {\n return noop;\n }),\n optionString('icon')\n ].concat(commonMenuItemFields));\n var createNestedMenuItem = function (spec) {\n return asRaw('nestedmenuitem', nestedMenuItemSchema, spec);\n };\n\n var toggleMenuItemSchema = objOf([\n strictString('type'),\n optionString('icon'),\n defaultedBoolean('active', false),\n defaultedFunction('onSetup', function () {\n return noop;\n }),\n strictFunction('onAction')\n ].concat(commonMenuItemFields));\n var createToggleMenuItem = function (spec) {\n return asRaw('togglemenuitem', toggleMenuItemSchema, spec);\n };\n\n var detectSize = function (comp, margin, selectorClass) {\n var descendants$1 = descendants(comp.element(), '.' + selectorClass);\n if (descendants$1.length > 0) {\n var columnLength = findIndex(descendants$1, function (c) {\n var thisTop = c.dom().getBoundingClientRect().top;\n var cTop = descendants$1[0].dom().getBoundingClientRect().top;\n return Math.abs(thisTop - cTop) > margin;\n }).getOr(descendants$1.length);\n return Option.some({\n numColumns: columnLength,\n numRows: Math.ceil(descendants$1.length / columnLength)\n });\n } else {\n return Option.none();\n }\n };\n\n var namedEvents = function (name, handlers) {\n return derive$1([config(name, handlers)]);\n };\n var unnamedEvents = function (handlers) {\n return namedEvents(generate$1('unnamed-events'), handlers);\n };\n var SimpleBehaviours = {\n namedEvents: namedEvents,\n unnamedEvents: unnamedEvents\n };\n\n var TooltippingSchema = [\n strict$1('lazySink'),\n strict$1('tooltipDom'),\n defaulted$1('exclusive', true),\n defaulted$1('tooltipComponents', []),\n defaulted$1('delay', 300),\n defaultedStringEnum('mode', 'normal', [\n 'normal',\n 'follow-highlight'\n ]),\n defaulted$1('anchor', function (comp) {\n return {\n anchor: 'hotspot',\n hotspot: comp,\n layouts: {\n onLtr: constant([\n south$1,\n north$1,\n southeast$1,\n northeast$1,\n southwest$1,\n northwest$1\n ]),\n onRtl: constant([\n south$1,\n north$1,\n southeast$1,\n northeast$1,\n southwest$1,\n northwest$1\n ])\n }\n };\n }),\n onHandler('onHide'),\n onHandler('onShow')\n ];\n\n var init$4 = function () {\n var timer = Cell(Option.none());\n var popup = Cell(Option.none());\n var getTooltip = function () {\n return popup.get();\n };\n var setTooltip = function (comp) {\n popup.set(Option.some(comp));\n };\n var clearTooltip = function () {\n popup.set(Option.none());\n };\n var clearTimer = function () {\n timer.get().each(function (t) {\n domGlobals.clearTimeout(t);\n });\n };\n var resetTimer = function (f, delay) {\n clearTimer();\n timer.set(Option.some(domGlobals.setTimeout(function () {\n f();\n }, delay)));\n };\n var isShowing = function () {\n return popup.get().isSome();\n };\n var readState = constant('not-implemented');\n return nu$5({\n getTooltip: getTooltip,\n isShowing: isShowing,\n setTooltip: setTooltip,\n clearTooltip: clearTooltip,\n clearTimer: clearTimer,\n resetTimer: resetTimer,\n readState: readState\n });\n };\n\n var TooltippingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$4\n });\n\n var ExclusivityChannel = generate$1('tooltip.exclusive');\n var ShowTooltipEvent = generate$1('tooltip.show');\n var HideTooltipEvent = generate$1('tooltip.hide');\n\n var hideAllExclusive = function (component, _tConfig, _tState) {\n component.getSystem().broadcastOn([ExclusivityChannel], {});\n };\n var setComponents = function (component, tConfig, tState, specs) {\n tState.getTooltip().each(function (tooltip) {\n if (tooltip.getSystem().isConnected()) {\n Replacing.set(tooltip, specs);\n }\n });\n };\n\n var TooltippingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n hideAllExclusive: hideAllExclusive,\n setComponents: setComponents\n });\n\n var events$8 = function (tooltipConfig, state) {\n var hide = function (comp) {\n state.getTooltip().each(function (p) {\n detach(p);\n tooltipConfig.onHide(comp, p);\n state.clearTooltip();\n });\n state.clearTimer();\n };\n var show = function (comp) {\n if (!state.isShowing()) {\n hideAllExclusive(comp);\n var sink = tooltipConfig.lazySink(comp).getOrDie();\n var popup = comp.getSystem().build({\n dom: tooltipConfig.tooltipDom,\n components: tooltipConfig.tooltipComponents,\n events: derive(tooltipConfig.mode === 'normal' ? [\n run(mouseover(), function (_) {\n emit(comp, ShowTooltipEvent);\n }),\n run(mouseout(), function (_) {\n emit(comp, HideTooltipEvent);\n })\n ] : []),\n behaviours: derive$1([Replacing.config({})])\n });\n state.setTooltip(popup);\n attach$1(sink, popup);\n tooltipConfig.onShow(comp, popup);\n Positioning.position(sink, tooltipConfig.anchor(comp), popup);\n }\n };\n return derive(flatten([\n [\n run(ShowTooltipEvent, function (comp) {\n state.resetTimer(function () {\n show(comp);\n }, tooltipConfig.delay);\n }),\n run(HideTooltipEvent, function (comp) {\n state.resetTimer(function () {\n hide(comp);\n }, tooltipConfig.delay);\n }),\n run(receive(), function (comp, message) {\n var receivingData = message;\n if (contains(receivingData.channels(), ExclusivityChannel)) {\n hide(comp);\n }\n }),\n runOnDetached(function (comp) {\n hide(comp);\n })\n ],\n tooltipConfig.mode === 'normal' ? [\n run(focusin(), function (comp) {\n emit(comp, ShowTooltipEvent);\n }),\n run(postBlur(), function (comp) {\n emit(comp, HideTooltipEvent);\n }),\n run(mouseover(), function (comp) {\n emit(comp, ShowTooltipEvent);\n }),\n run(mouseout(), function (comp) {\n emit(comp, HideTooltipEvent);\n })\n ] : [\n run(highlight(), function (comp, _se) {\n emit(comp, ShowTooltipEvent);\n }),\n run(dehighlight(), function (comp) {\n emit(comp, HideTooltipEvent);\n })\n ]\n ]));\n };\n\n var ActiveTooltipping = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$8\n });\n\n var Tooltipping = create$1({\n fields: TooltippingSchema,\n name: 'tooltipping',\n active: ActiveTooltipping,\n state: TooltippingState,\n apis: TooltippingApis\n });\n\n var global$5 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');\n\n var global$6 = tinymce.util.Tools.resolve('tinymce.util.I18n');\n\n var nativeDisabled = [\n 'input',\n 'button',\n 'textarea',\n 'select'\n ];\n var onLoad$5 = function (component, disableConfig, disableState) {\n var f = disableConfig.disabled() ? disable : enable;\n f(component, disableConfig, disableState);\n };\n var hasNative = function (component, config) {\n return config.useNative === true && contains(nativeDisabled, name(component.element()));\n };\n var nativeIsDisabled = function (component) {\n return has$1(component.element(), 'disabled');\n };\n var nativeDisable = function (component) {\n set$1(component.element(), 'disabled', 'disabled');\n };\n var nativeEnable = function (component) {\n remove$1(component.element(), 'disabled');\n };\n var ariaIsDisabled = function (component) {\n return get$2(component.element(), 'aria-disabled') === 'true';\n };\n var ariaDisable = function (component) {\n set$1(component.element(), 'aria-disabled', 'true');\n };\n var ariaEnable = function (component) {\n set$1(component.element(), 'aria-disabled', 'false');\n };\n var disable = function (component, disableConfig, _disableState) {\n disableConfig.disableClass.each(function (disableClass) {\n add$2(component.element(), disableClass);\n });\n var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable;\n f(component);\n disableConfig.onDisabled(component);\n };\n var enable = function (component, disableConfig, _disableState) {\n disableConfig.disableClass.each(function (disableClass) {\n remove$4(component.element(), disableClass);\n });\n var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable;\n f(component);\n disableConfig.onEnabled(component);\n };\n var isDisabled = function (component, disableConfig) {\n return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component);\n };\n var set$7 = function (component, disableConfig, disableState, disabled) {\n var f = disabled ? disable : enable;\n f(component, disableConfig, disableState);\n };\n\n var DisableApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n enable: enable,\n disable: disable,\n isDisabled: isDisabled,\n onLoad: onLoad$5,\n set: set$7\n });\n\n var exhibit$3 = function (base, disableConfig) {\n return nu$6({ classes: disableConfig.disabled() ? disableConfig.disableClass.toArray() : [] });\n };\n var events$9 = function (disableConfig, disableState) {\n return derive([\n abort(execute(), function (component, _simulatedEvent) {\n return isDisabled(component, disableConfig);\n }),\n loadEvent(disableConfig, disableState, onLoad$5)\n ]);\n };\n\n var ActiveDisable = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$3,\n events: events$9\n });\n\n var DisableSchema = [\n defaultedFunction('disabled', never),\n defaulted$1('useNative', true),\n option('disableClass'),\n onHandler('onDisabled'),\n onHandler('onEnabled')\n ];\n\n var Disabling = create$1({\n fields: DisableSchema,\n name: 'disabling',\n active: ActiveDisable,\n apis: DisableApis\n });\n\n var global$7 = tinymce.util.Tools.resolve('tinymce.EditorManager');\n\n var getSkinUrl = function (editor) {\n var skin = editor.getParam('skin');\n var skinUrl = editor.getParam('skin_url');\n if (skin !== false) {\n var skinName = skin ? skin : 'oxide';\n if (skinUrl) {\n skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);\n } else {\n skinUrl = global$7.baseURL + '/skins/ui/' + skinName;\n }\n }\n return skinUrl;\n };\n var isReadOnly = function (editor) {\n return editor.getParam('readonly', false, 'boolean');\n };\n var isSkinDisabled = function (editor) {\n return editor.getParam('skin') === false;\n };\n var getHeightSetting = function (editor) {\n return editor.getParam('height', Math.max(editor.getElement().offsetHeight, 200));\n };\n var getWidthSetting = function (editor) {\n return editor.getParam('width', global$5.DOM.getStyle(editor.getElement(), 'width'));\n };\n var getMinWidthSetting = function (editor) {\n return Option.from(editor.getParam('min_width')).filter(isNumber);\n };\n var getMinHeightSetting = function (editor) {\n return Option.from(editor.getParam('min_height')).filter(isNumber);\n };\n var getMaxWidthSetting = function (editor) {\n return Option.from(editor.getParam('max_width')).filter(isNumber);\n };\n var getMaxHeightSetting = function (editor) {\n return Option.from(editor.getParam('max_height')).filter(isNumber);\n };\n var getUserStyleFormats = function (editor) {\n return Option.from(editor.getParam('style_formats')).filter(isArray);\n };\n var isMergeStyleFormats = function (editor) {\n return editor.getParam('style_formats_merge', false, 'boolean');\n };\n var getRemovedMenuItems = function (editor) {\n return editor.getParam('removed_menuitems', '');\n };\n var isMenubarEnabled = function (editor) {\n return editor.getParam('menubar', true, 'boolean') !== false;\n };\n var isToolbarEnabled = function (editor) {\n var toolbar = editor.getParam('toolbar', true);\n var isToolbarTrue = toolbar === true;\n var isToolbarString = isString(toolbar);\n var isToolbarObjectArray = isArray(toolbar) && toolbar.length > 0;\n return !isMultipleToolbars(editor) && (isToolbarObjectArray || isToolbarString || isToolbarTrue);\n };\n var getMultipleToolbarsSetting = function (editor) {\n var toolbars = range(9, function (num) {\n return editor.getParam('toolbar' + (num + 1), false, 'string');\n });\n var toolbarArray = filter(toolbars, function (toolbar) {\n return typeof toolbar === 'string';\n });\n return toolbarArray.length > 0 ? Option.some(toolbarArray) : Option.none();\n };\n var isMultipleToolbars = function (editor) {\n return getMultipleToolbarsSetting(editor).fold(function () {\n var toolbar = editor.getParam('toolbar', [], 'string[]');\n return toolbar.length > 0;\n }, function () {\n return true;\n });\n };\n var ToolbarMode;\n (function (ToolbarMode) {\n ToolbarMode['default'] = 'wrap';\n ToolbarMode['floating'] = 'floating';\n ToolbarMode['sliding'] = 'sliding';\n ToolbarMode['scrolling'] = 'scrolling';\n }(ToolbarMode || (ToolbarMode = {})));\n var getToolbarMode = function (editor) {\n return editor.getParam('toolbar_mode', '', 'string');\n };\n var ToolbarLocation;\n (function (ToolbarLocation) {\n ToolbarLocation['auto'] = 'auto';\n ToolbarLocation['top'] = 'top';\n ToolbarLocation['bottom'] = 'bottom';\n }(ToolbarLocation || (ToolbarLocation = {})));\n var getToolbarGroups = function (editor) {\n return editor.getParam('toolbar_groups', {}, 'object');\n };\n var getToolbarLocation = function (editor) {\n return editor.getParam('toolbar_location', ToolbarLocation.auto, 'string');\n };\n var isToolbarLocationBottom = function (editor) {\n return getToolbarLocation(editor) === ToolbarLocation.bottom;\n };\n var fixedContainerSelector = function (editor) {\n return editor.getParam('fixed_toolbar_container', '', 'string');\n };\n var fixedContainerElement = function (editor) {\n var selector = fixedContainerSelector(editor);\n return selector.length > 0 && editor.inline ? descendant$1(body(), selector) : Option.none();\n };\n var useFixedContainer = function (editor) {\n return editor.inline && fixedContainerElement(editor).isSome();\n };\n var getUiContainer = function (editor) {\n var fixedContainer = fixedContainerElement(editor);\n return fixedContainer.getOr(body());\n };\n var isDistractionFree = function (editor) {\n return editor.inline && !isMenubarEnabled(editor) && !isToolbarEnabled(editor) && !isMultipleToolbars(editor);\n };\n var isStickyToolbar = function (editor) {\n var isStickyToolbar = editor.getParam('toolbar_sticky', false, 'boolean');\n return (isStickyToolbar || editor.inline) && !useFixedContainer(editor) && !isDistractionFree(editor);\n };\n var isDraggableModal = function (editor) {\n return editor.getParam('draggable_modal', false, 'boolean');\n };\n var getMenus = function (editor) {\n var menu = editor.getParam('menu');\n if (menu) {\n return map$2(menu, function (menu) {\n return __assign(__assign({}, menu), { items: menu.items });\n });\n } else {\n return {};\n }\n };\n var getMenubar = function (editor) {\n return editor.getParam('menubar');\n };\n var getToolbar = function (editor) {\n return editor.getParam('toolbar', true);\n };\n var getFilePickerCallback = function (editor) {\n return editor.getParam('file_picker_callback');\n };\n var getFilePickerTypes = function (editor) {\n return editor.getParam('file_picker_types');\n };\n var getFileBrowserCallbackTypes = function (editor) {\n return editor.getParam('file_browser_callback_types');\n };\n var noTypeaheadUrls = function (editor) {\n return editor.getParam('typeahead_urls') === false;\n };\n var getAnchorTop = function (editor) {\n return editor.getParam('anchor_top', '#top', 'string');\n };\n var getAnchorBottom = function (editor) {\n return editor.getParam('anchor_bottom', '#bottom', 'string');\n };\n var getFilePickerValidatorHandler = function (editor) {\n var handler = editor.getParam('file_picker_validator_handler', undefined, 'function');\n if (handler === undefined) {\n return editor.getParam('filepicker_validator_handler', undefined, 'function');\n } else {\n return handler;\n }\n };\n\n var ReadOnlyChannel = 'silver.readonly';\n var ReadOnlyDataSchema = objOf([strictBoolean('readonly')]);\n var broadcastReadonly = function (uiComponents, readonly) {\n var outerContainer = uiComponents.outerContainer;\n var target = outerContainer.element();\n if (readonly) {\n uiComponents.mothership.broadcastOn([dismissPopups()], { target: target });\n uiComponents.uiMothership.broadcastOn([dismissPopups()], { target: target });\n }\n uiComponents.mothership.broadcastOn([ReadOnlyChannel], { readonly: readonly });\n uiComponents.uiMothership.broadcastOn([ReadOnlyChannel], { readonly: readonly });\n };\n var setupReadonlyModeSwitch = function (editor, uiComponents) {\n editor.on('init', function () {\n if (editor.mode.isReadOnly()) {\n broadcastReadonly(uiComponents, true);\n }\n });\n editor.on('SwitchMode', function () {\n return broadcastReadonly(uiComponents, editor.mode.isReadOnly());\n });\n if (isReadOnly(editor)) {\n editor.setMode('readonly');\n }\n };\n var receivingConfig = function () {\n var _a;\n return Receiving.config({\n channels: (_a = {}, _a[ReadOnlyChannel] = {\n schema: ReadOnlyDataSchema,\n onReceive: function (comp, data) {\n Disabling.set(comp, data.readonly);\n }\n }, _a)\n });\n };\n\n var item = function (disabled) {\n return Disabling.config({\n disabled: disabled,\n disableClass: 'tox-collection__item--state-disabled'\n });\n };\n var button = function (disabled) {\n return Disabling.config({ disabled: disabled });\n };\n var splitButton = function (disabled) {\n return Disabling.config({\n disabled: disabled,\n disableClass: 'tox-tbtn--disabled'\n });\n };\n var toolbarButton = function (disabled) {\n return Disabling.config({\n disabled: disabled,\n disableClass: 'tox-tbtn--disabled',\n useNative: false\n });\n };\n var DisablingConfigs = {\n item: item,\n button: button,\n splitButton: splitButton,\n toolbarButton: toolbarButton\n };\n\n var runWithApi = function (info, comp) {\n var api = info.getApi(comp);\n return function (f) {\n f(api);\n };\n };\n var onControlAttached = function (info, editorOffCell) {\n return runOnAttached(function (comp) {\n var run = runWithApi(info, comp);\n run(function (api) {\n var onDestroy = info.onSetup(api);\n if (onDestroy !== null && onDestroy !== undefined) {\n editorOffCell.set(onDestroy);\n }\n });\n });\n };\n var onControlDetached = function (getApi, editorOffCell) {\n return runOnDetached(function (comp) {\n return runWithApi(getApi, comp)(editorOffCell.get());\n });\n };\n\n var onMenuItemExecute = function (info, itemResponse) {\n return runOnExecute(function (comp, simulatedEvent) {\n runWithApi(info, comp)(info.onAction);\n if (!info.triggersSubmenu && itemResponse === ItemResponse$1.CLOSE_ON_EXECUTE) {\n emit(comp, sandboxClose());\n simulatedEvent.stop();\n }\n });\n };\n var menuItemEventOrder = {\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'toggling',\n 'item-events'\n ]\n };\n\n var componentRenderPipeline = function (xs) {\n return bind(xs, function (o) {\n return o.toArray();\n });\n };\n var renderCommonItem = function (spec, structure, itemResponse, providersbackstage) {\n var editorOffCell = Cell(noop);\n return {\n type: 'item',\n dom: structure.dom,\n components: componentRenderPipeline(structure.optComponents),\n data: spec.data,\n eventOrder: menuItemEventOrder,\n hasSubmenu: spec.triggersSubmenu,\n itemBehaviours: derive$1([\n config('item-events', [\n onMenuItemExecute(spec, itemResponse),\n onControlAttached(spec, editorOffCell),\n onControlDetached(spec, editorOffCell)\n ]),\n DisablingConfigs.item(function () {\n return spec.disabled || providersbackstage.isReadOnly();\n }),\n receivingConfig(),\n Replacing.config({})\n ].concat(spec.itemBehaviours))\n };\n };\n var buildData = function (source) {\n return {\n value: source.value,\n meta: __assign({ text: source.text.getOr('') }, source.meta)\n };\n };\n\n var global$8 = tinymce.util.Tools.resolve('tinymce.Env');\n\n var convertText = function (source) {\n var mac = {\n alt: '⌥',\n ctrl: '⌃',\n shift: '⇧',\n meta: '⌘',\n access: '⌃⌥'\n };\n var other = {\n meta: 'Ctrl',\n access: 'Shift+Alt'\n };\n var replace = global$8.mac ? mac : other;\n var shortcut = source.split('+');\n var updated = map(shortcut, function (segment) {\n var search = segment.toLowerCase().trim();\n return has(replace, search) ? replace[search] : segment;\n });\n return global$8.mac ? updated.join('') : updated.join('+');\n };\n\n var renderIcon = function (iconHtml) {\n return {\n dom: {\n tag: 'div',\n classes: [iconClass],\n innerHtml: iconHtml\n }\n };\n };\n var renderText = function (text$1) {\n return {\n dom: {\n tag: 'div',\n classes: [textClass]\n },\n components: [text(global$6.translate(text$1))]\n };\n };\n var renderHtml = function (html) {\n return {\n dom: {\n tag: 'div',\n classes: [textClass],\n innerHtml: html\n }\n };\n };\n var renderStyledText = function (style, text$1) {\n return {\n dom: {\n tag: 'div',\n classes: [textClass]\n },\n components: [{\n dom: {\n tag: style.tag,\n styles: style.styles\n },\n components: [text(global$6.translate(text$1))]\n }]\n };\n };\n var renderShortcut = function (shortcut) {\n return {\n dom: {\n tag: 'div',\n classes: [accessoryClass],\n innerHtml: convertText(shortcut)\n }\n };\n };\n var renderCheckmark = function (icons) {\n return {\n dom: {\n tag: 'div',\n classes: [checkmarkClass],\n innerHtml: get$d('checkmark', icons)\n }\n };\n };\n var renderSubmenuCaret = function (icons) {\n return {\n dom: {\n tag: 'div',\n classes: [caretClass],\n innerHtml: get$d('chevron-right', icons)\n }\n };\n };\n var renderDownwardsCaret = function (icons) {\n return {\n dom: {\n tag: 'div',\n classes: [caretClass],\n innerHtml: get$d('chevron-down', icons)\n }\n };\n };\n\n var renderColorStructure = function (itemText, itemValue, iconSvg, providerBackstage) {\n var colorPickerCommand = 'custom';\n var removeColorCommand = 'remove';\n var getDom = function () {\n var common = colorClass;\n var icon = iconSvg.getOr('');\n var attributes = itemText.map(function (text) {\n return { title: providerBackstage.translate(text) };\n }).getOr({});\n var baseDom = {\n tag: 'div',\n attributes: attributes,\n classes: [common]\n };\n if (itemValue === colorPickerCommand) {\n return __assign(__assign({}, baseDom), {\n tag: 'button',\n classes: __spreadArrays(baseDom.classes, ['tox-swatches__picker-btn']),\n innerHtml: icon\n });\n } else if (itemValue === removeColorCommand) {\n return __assign(__assign({}, baseDom), {\n classes: __spreadArrays(baseDom.classes, ['tox-swatch--remove']),\n innerHtml: icon\n });\n } else {\n return __assign(__assign({}, baseDom), {\n attributes: __assign(__assign({}, baseDom.attributes), { 'data-mce-color': itemValue }),\n styles: { 'background-color': itemValue }\n });\n }\n };\n return {\n dom: getDom(),\n optComponents: []\n };\n };\n var renderNormalItemStructure = function (info, icon, renderIcons, textRender, rtlClass) {\n var leftIcon = renderIcons ? icon.or(Option.some('')).map(renderIcon) : Option.none();\n var checkmark = info.checkMark;\n var domTitle = info.ariaLabel.map(function (label) {\n return { attributes: { title: global$6.translate(label) } };\n }).getOr({});\n var dom = __assign({\n tag: 'div',\n classes: [\n navClass,\n selectableClass\n ].concat(rtlClass ? [iconClassRtl] : [])\n }, domTitle);\n var content = info.htmlContent.fold(function () {\n return info.textContent.map(textRender);\n }, function (html) {\n return Option.some(renderHtml(html));\n });\n var menuItem = {\n dom: dom,\n optComponents: [\n leftIcon,\n content,\n info.shortcutContent.map(renderShortcut),\n checkmark,\n info.caret\n ]\n };\n return menuItem;\n };\n var rtlIcon = [\n 'list-num-default',\n 'list-num-lower-alpha',\n 'list-num-lower-greek',\n 'list-num-lower-roman',\n 'list-num-upper-alpha',\n 'list-num-upper-roman'\n ];\n var rtlTransform = [\n 'list-bull-circle',\n 'list-bull-default',\n 'list-bull-square'\n ];\n var renderItemStructure = function (info, providersBackstage, renderIcons, fallbackIcon) {\n if (fallbackIcon === void 0) {\n fallbackIcon = Option.none();\n }\n var getIconName = function (iconName) {\n return iconName.map(function (name) {\n return global$6.isRtl() && contains(rtlIcon, name) ? name + '-rtl' : name;\n });\n };\n var needRtlClass = global$6.isRtl() && info.iconContent.exists(function (name) {\n return contains(rtlTransform, name);\n });\n var icon = getIconName(info.iconContent).map(function (iconName) {\n return getOr(iconName, providersBackstage.icons, fallbackIcon);\n });\n var textRender = Option.from(info.meta).fold(function () {\n return renderText;\n }, function (meta) {\n return has(meta, 'style') ? curry(renderStyledText, meta.style) : renderText;\n });\n if (info.presets === 'color') {\n return renderColorStructure(info.ariaLabel, info.value, icon, providersBackstage);\n } else {\n return renderNormalItemStructure(info, icon, renderIcons, textRender, needRtlClass);\n }\n };\n\n var tooltipBehaviour = function (meta, sharedBackstage) {\n return get(meta, 'tooltipWorker').map(function (tooltipWorker) {\n return [Tooltipping.config({\n lazySink: sharedBackstage.getSink,\n tooltipDom: {\n tag: 'div',\n classes: ['tox-tooltip-worker-container']\n },\n tooltipComponents: [],\n anchor: function (comp) {\n return {\n anchor: 'submenu',\n item: comp,\n overrides: { maxHeightFunction: expandable }\n };\n },\n mode: 'follow-highlight',\n onShow: function (component, _tooltip) {\n tooltipWorker(function (elm) {\n Tooltipping.setComponents(component, [external({ element: Element.fromDom(elm) })]);\n });\n }\n })];\n }).getOr([]);\n };\n var escapeRegExp = function (text) {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n };\n var encodeText = function (text) {\n return global$5.DOM.encode(text);\n };\n var replaceText = function (text, matchText) {\n var translated = global$6.translate(text);\n var encoded = encodeText(translated);\n if (matchText.length > 0) {\n var escapedMatchRegex = new RegExp(escapeRegExp(matchText), 'gi');\n return encoded.replace(escapedMatchRegex, function (match) {\n return '' + match + '';\n });\n } else {\n return encoded;\n }\n };\n var renderAutocompleteItem = function (spec, matchText, useText, presets, onItemValueHandler, itemResponse, sharedBackstage, renderIcons) {\n if (renderIcons === void 0) {\n renderIcons = true;\n }\n var structure = renderItemStructure({\n presets: presets,\n textContent: Option.none(),\n htmlContent: useText ? spec.text.map(function (text) {\n return replaceText(text, matchText);\n }) : Option.none(),\n ariaLabel: spec.text,\n iconContent: spec.icon,\n shortcutContent: Option.none(),\n checkMark: Option.none(),\n caret: Option.none(),\n value: spec.value\n }, sharedBackstage.providers, renderIcons, spec.icon);\n return renderCommonItem({\n data: buildData(spec),\n disabled: spec.disabled,\n getApi: function () {\n return {};\n },\n onAction: function (_api) {\n return onItemValueHandler(spec.value, spec.meta);\n },\n onSetup: function () {\n return function () {\n };\n },\n triggersSubmenu: false,\n itemBehaviours: tooltipBehaviour(spec.meta, sharedBackstage)\n }, structure, itemResponse, sharedBackstage.providers);\n };\n\n var renderChoiceItem = function (spec, useText, presets, onItemValueHandler, isSelected, itemResponse, providersBackstage, renderIcons) {\n if (renderIcons === void 0) {\n renderIcons = true;\n }\n var getApi = function (component) {\n return {\n setActive: function (state) {\n Toggling.set(component, state);\n },\n isActive: function () {\n return Toggling.isOn(component);\n },\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var structure = renderItemStructure({\n presets: presets,\n textContent: useText ? spec.text : Option.none(),\n htmlContent: Option.none(),\n ariaLabel: spec.text,\n iconContent: spec.icon,\n shortcutContent: useText ? spec.shortcut : Option.none(),\n checkMark: useText ? Option.some(renderCheckmark(providersBackstage.icons)) : Option.none(),\n caret: Option.none(),\n value: spec.value\n }, providersBackstage, renderIcons);\n return deepMerge(renderCommonItem({\n data: buildData(spec),\n disabled: spec.disabled,\n getApi: getApi,\n onAction: function (_api) {\n return onItemValueHandler(spec.value);\n },\n onSetup: function (api) {\n api.setActive(isSelected);\n return function () {\n };\n },\n triggersSubmenu: false,\n itemBehaviours: []\n }, structure, itemResponse, providersBackstage), {\n toggling: {\n toggleClass: tickedClass,\n toggleOnExecute: false,\n selected: spec.active\n }\n });\n };\n\n var parts$2 = constant(generate$4(owner$2(), parts()));\n\n var cellOverEvent = generate$1('cell-over');\n var cellExecuteEvent = generate$1('cell-execute');\n var makeCell = function (row, col, labelId) {\n var _a;\n var emitCellOver = function (c) {\n return emitWith(c, cellOverEvent, {\n row: row,\n col: col\n });\n };\n var emitExecute = function (c) {\n return emitWith(c, cellExecuteEvent, {\n row: row,\n col: col\n });\n };\n var onClick = function (c, se) {\n se.stop();\n emitExecute(c);\n };\n return build$1({\n dom: {\n tag: 'div',\n attributes: (_a = { role: 'button' }, _a['aria-labelledby'] = labelId, _a)\n },\n behaviours: derive$1([\n config('insert-table-picker-cell', [\n run(mouseover(), Focusing.focus),\n run(execute(), emitExecute),\n run(click(), onClick),\n run(tap(), onClick)\n ]),\n Toggling.config({\n toggleClass: 'tox-insert-table-picker__selected',\n toggleOnExecute: false\n }),\n Focusing.config({ onFocus: emitCellOver })\n ])\n });\n };\n var makeCells = function (labelId, numRows, numCols) {\n var cells = [];\n for (var i = 0; i < numRows; i++) {\n var row = [];\n for (var j = 0; j < numCols; j++) {\n row.push(makeCell(i, j, labelId));\n }\n cells.push(row);\n }\n return cells;\n };\n var selectCells = function (cells, selectedRow, selectedColumn, numRows, numColumns) {\n for (var i = 0; i < numRows; i++) {\n for (var j = 0; j < numColumns; j++) {\n Toggling.set(cells[i][j], i <= selectedRow && j <= selectedColumn);\n }\n }\n };\n var makeComponents = function (cells) {\n return bind(cells, function (cellRow) {\n return map(cellRow, premade$1);\n });\n };\n var makeLabelText = function (row, col) {\n return text(col + 1 + 'x' + (row + 1));\n };\n var renderInsertTableMenuItem = function (spec) {\n var numRows = 10;\n var numColumns = 10;\n var sizeLabelId = generate$1('size-label');\n var cells = makeCells(sizeLabelId, numRows, numColumns);\n var memLabel = record({\n dom: {\n tag: 'span',\n classes: ['tox-insert-table-picker__label'],\n attributes: { id: sizeLabelId }\n },\n components: [text('0x0')],\n behaviours: derive$1([Replacing.config({})])\n });\n return {\n type: 'widget',\n data: { value: generate$1('widget-id') },\n dom: {\n tag: 'div',\n classes: ['tox-fancymenuitem']\n },\n autofocus: true,\n components: [parts$2().widget({\n dom: {\n tag: 'div',\n classes: ['tox-insert-table-picker']\n },\n components: makeComponents(cells).concat(memLabel.asSpec()),\n behaviours: derive$1([\n config('insert-table-picker', [\n runWithTarget(cellOverEvent, function (c, t, e) {\n var row = e.event().row();\n var col = e.event().col();\n selectCells(cells, row, col, numRows, numColumns);\n Replacing.set(memLabel.get(c), [makeLabelText(row, col)]);\n }),\n runWithTarget(cellExecuteEvent, function (c, _, e) {\n spec.onAction({\n numRows: e.event().row() + 1,\n numColumns: e.event().col() + 1\n });\n emit(c, sandboxClose());\n })\n ]),\n Keying.config({\n initSize: {\n numRows: numRows,\n numColumns: numColumns\n },\n mode: 'flatgrid',\n selector: '[role=\"button\"]'\n })\n ])\n })]\n };\n };\n\n var hexColour = function (value) {\n return { value: value };\n };\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n var longformRegex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\n var isHexString = function (hex) {\n return shorthandRegex.test(hex) || longformRegex.test(hex);\n };\n var getLongForm = function (hex) {\n var hexString = hex.value.replace(shorthandRegex, function (m, r, g, b) {\n return r + r + g + g + b + b;\n });\n return { value: hexString };\n };\n var extractValues = function (hex) {\n var longForm = getLongForm(hex);\n var splitForm = longformRegex.exec(longForm.value);\n return splitForm === null ? [\n 'FFFFFF',\n 'FF',\n 'FF',\n 'FF'\n ] : splitForm;\n };\n var toHex = function (component) {\n var hex = component.toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n };\n var fromRgba = function (rgbaColour) {\n var value = toHex(rgbaColour.red) + toHex(rgbaColour.green) + toHex(rgbaColour.blue);\n return hexColour(value);\n };\n\n var min = Math.min;\n var max = Math.max;\n var round = Math.round;\n var rgbRegex = /^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)/;\n var rgbaRegex = /^rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d?(?:\\.\\d+)?)\\)/;\n var rgbaColour = function (red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha\n };\n };\n var isRgbaComponent = function (value) {\n var num = parseInt(value, 10);\n return num.toString() === value && num >= 0 && num <= 255;\n };\n var fromHsv = function (hsv) {\n var r;\n var g;\n var b;\n var hue = (hsv.hue || 0) % 360;\n var saturation = hsv.saturation / 100;\n var brightness = hsv.value / 100;\n saturation = max(0, min(saturation, 1));\n brightness = max(0, min(brightness, 1));\n if (saturation === 0) {\n r = g = b = round(255 * brightness);\n return rgbaColour(r, g, b, 1);\n }\n var side = hue / 60;\n var chroma = brightness * saturation;\n var x = chroma * (1 - Math.abs(side % 2 - 1));\n var match = brightness - chroma;\n switch (Math.floor(side)) {\n case 0:\n r = chroma;\n g = x;\n b = 0;\n break;\n case 1:\n r = x;\n g = chroma;\n b = 0;\n break;\n case 2:\n r = 0;\n g = chroma;\n b = x;\n break;\n case 3:\n r = 0;\n g = x;\n b = chroma;\n break;\n case 4:\n r = x;\n g = 0;\n b = chroma;\n break;\n case 5:\n r = chroma;\n g = 0;\n b = x;\n break;\n default:\n r = g = b = 0;\n }\n r = round(255 * (r + match));\n g = round(255 * (g + match));\n b = round(255 * (b + match));\n return rgbaColour(r, g, b, 1);\n };\n var fromHex = function (hexColour) {\n var result = extractValues(hexColour);\n var red = parseInt(result[1], 16);\n var green = parseInt(result[2], 16);\n var blue = parseInt(result[3], 16);\n return rgbaColour(red, green, blue, 1);\n };\n var fromStringValues = function (red, green, blue, alpha) {\n var r = parseInt(red, 10);\n var g = parseInt(green, 10);\n var b = parseInt(blue, 10);\n var a = parseFloat(alpha);\n return rgbaColour(r, g, b, a);\n };\n var fromString = function (rgbaString) {\n if (rgbaString === 'transparent') {\n return Option.some(rgbaColour(0, 0, 0, 0));\n }\n var rgbMatch = rgbRegex.exec(rgbaString);\n if (rgbMatch !== null) {\n return Option.some(fromStringValues(rgbMatch[1], rgbMatch[2], rgbMatch[3], '1'));\n }\n var rgbaMatch = rgbaRegex.exec(rgbaString);\n if (rgbaMatch !== null) {\n return Option.some(fromStringValues(rgbaMatch[1], rgbaMatch[2], rgbaMatch[3], rgbaMatch[4]));\n }\n return Option.none();\n };\n var toString = function (rgba) {\n return 'rgba(' + rgba.red + ',' + rgba.green + ',' + rgba.blue + ',' + rgba.alpha + ')';\n };\n var red = rgbaColour(255, 0, 0, 1);\n\n var fireSkinLoaded = function (editor) {\n return editor.fire('SkinLoaded');\n };\n var fireSkinLoadError = function (editor, error) {\n return editor.fire('SkinLoadError', error);\n };\n var fireResizeEditor = function (editor) {\n return editor.fire('ResizeEditor');\n };\n var fireResizeContent = function (editor, e) {\n return editor.fire('ResizeContent', e);\n };\n var fireScrollContent = function (editor, e) {\n return editor.fire('ScrollContent', e);\n };\n var fireTextColorChange = function (editor, data) {\n return editor.fire('TextColorChange', data);\n };\n\n var global$9 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');\n\n var storageName = 'tinymce-custom-colors';\n function ColorCache (max) {\n if (max === void 0) {\n max = 10;\n }\n var storageString = global$9.getItem(storageName);\n var localstorage = isString(storageString) ? JSON.parse(storageString) : [];\n var prune = function (list) {\n var diff = max - list.length;\n return diff < 0 ? list.slice(0, max) : list;\n };\n var cache = prune(localstorage);\n var add = function (key) {\n indexOf(cache, key).each(remove);\n cache.unshift(key);\n if (cache.length > max) {\n cache.pop();\n }\n global$9.setItem(storageName, JSON.stringify(cache));\n };\n var remove = function (idx) {\n cache.splice(idx, 1);\n };\n var state = function () {\n return cache.slice(0);\n };\n return {\n add: add,\n state: state\n };\n }\n\n var choiceItem = 'choiceitem';\n var defaultColors = [\n {\n type: choiceItem,\n text: 'Light Green',\n value: '#BFEDD2'\n },\n {\n type: choiceItem,\n text: 'Light Yellow',\n value: '#FBEEB8'\n },\n {\n type: choiceItem,\n text: 'Light Red',\n value: '#F8CAC6'\n },\n {\n type: choiceItem,\n text: 'Light Purple',\n value: '#ECCAFA'\n },\n {\n type: choiceItem,\n text: 'Light Blue',\n value: '#C2E0F4'\n },\n {\n type: choiceItem,\n text: 'Green',\n value: '#2DC26B'\n },\n {\n type: choiceItem,\n text: 'Yellow',\n value: '#F1C40F'\n },\n {\n type: choiceItem,\n text: 'Red',\n value: '#E03E2D'\n },\n {\n type: choiceItem,\n text: 'Purple',\n value: '#B96AD9'\n },\n {\n type: choiceItem,\n text: 'Blue',\n value: '#3598DB'\n },\n {\n type: choiceItem,\n text: 'Dark Turquoise',\n value: '#169179'\n },\n {\n type: choiceItem,\n text: 'Orange',\n value: '#E67E23'\n },\n {\n type: choiceItem,\n text: 'Dark Red',\n value: '#BA372A'\n },\n {\n type: choiceItem,\n text: 'Dark Purple',\n value: '#843FA1'\n },\n {\n type: choiceItem,\n text: 'Dark Blue',\n value: '#236FA1'\n },\n {\n type: choiceItem,\n text: 'Light Gray',\n value: '#ECF0F1'\n },\n {\n type: choiceItem,\n text: 'Medium Gray',\n value: '#CED4D9'\n },\n {\n type: choiceItem,\n text: 'Gray',\n value: '#95A5A6'\n },\n {\n type: choiceItem,\n text: 'Dark Gray',\n value: '#7E8C8D'\n },\n {\n type: choiceItem,\n text: 'Navy Blue',\n value: '#34495E'\n },\n {\n type: choiceItem,\n text: 'Black',\n value: '#000000'\n },\n {\n type: choiceItem,\n text: 'White',\n value: '#ffffff'\n }\n ];\n var colorCache = ColorCache(10);\n var mapColors = function (colorMap) {\n var colors = [];\n var canvas = domGlobals.document.createElement('canvas');\n canvas.height = 1;\n canvas.width = 1;\n var ctx = canvas.getContext('2d');\n var byteAsHex = function (colorByte, alphaByte) {\n var bg = 255;\n var alpha = alphaByte / 255;\n var colorByteWithWhiteBg = Math.round(colorByte * alpha + bg * (1 - alpha));\n return ('0' + colorByteWithWhiteBg.toString(16)).slice(-2).toUpperCase();\n };\n var asHexColor = function (color) {\n if (/^[0-9A-Fa-f]{6}$/.test(color)) {\n return '#' + color.toUpperCase();\n }\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = '#FFFFFF';\n ctx.fillStyle = color;\n ctx.fillRect(0, 0, 1, 1);\n var rgba = ctx.getImageData(0, 0, 1, 1).data;\n var r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3];\n return '#' + byteAsHex(r, a) + byteAsHex(g, a) + byteAsHex(b, a);\n };\n for (var i = 0; i < colorMap.length; i += 2) {\n colors.push({\n text: colorMap[i + 1],\n value: asHexColor(colorMap[i]),\n type: 'choiceitem'\n });\n }\n return colors;\n };\n var getColorCols = function (editor, defaultCols) {\n return editor.getParam('color_cols', defaultCols, 'number');\n };\n var hasCustomColors = function (editor) {\n return editor.getParam('custom_colors') !== false;\n };\n var getColorMap = function (editor) {\n return editor.getParam('color_map');\n };\n var getColors = function (editor) {\n var unmapped = getColorMap(editor);\n return unmapped !== undefined ? mapColors(unmapped) : defaultColors;\n };\n var getCurrentColors = function () {\n return map(colorCache.state(), function (color) {\n return {\n type: choiceItem,\n text: color,\n value: color\n };\n });\n };\n var addColor = function (color) {\n colorCache.add(color);\n };\n\n var getCurrentColor = function (editor, format) {\n var color;\n editor.dom.getParents(editor.selection.getStart(), function (elm) {\n var value;\n if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) {\n color = color ? color : value;\n }\n });\n return color;\n };\n var applyFormat = function (editor, format, value) {\n editor.undoManager.transact(function () {\n editor.focus();\n editor.formatter.apply(format, { value: value });\n editor.nodeChanged();\n });\n };\n var removeFormat = function (editor, format) {\n editor.undoManager.transact(function () {\n editor.focus();\n editor.formatter.remove(format, { value: null }, null, true);\n editor.nodeChanged();\n });\n };\n var registerCommands = function (editor) {\n editor.addCommand('mceApplyTextcolor', function (format, value) {\n applyFormat(editor, format, value);\n });\n editor.addCommand('mceRemoveTextcolor', function (format) {\n removeFormat(editor, format);\n });\n };\n var calcCols = function (colors) {\n return Math.max(5, Math.ceil(Math.sqrt(colors)));\n };\n var getColorCols$1 = function (editor) {\n var colors = getColors(editor);\n var defaultCols = calcCols(colors.length);\n return getColorCols(editor, defaultCols);\n };\n var getAdditionalColors = function (hasCustom) {\n var type = 'choiceitem';\n var remove = {\n type: type,\n text: 'Remove color',\n icon: 'color-swatch-remove-color',\n value: 'remove'\n };\n var custom = {\n type: type,\n text: 'Custom color',\n icon: 'color-picker',\n value: 'custom'\n };\n return hasCustom ? [\n remove,\n custom\n ] : [remove];\n };\n var applyColor = function (editor, format, value, onChoice) {\n if (value === 'custom') {\n var dialog = colorPickerDialog(editor);\n dialog(function (colorOpt) {\n colorOpt.each(function (color) {\n addColor(color);\n editor.execCommand('mceApplyTextcolor', format, color);\n onChoice(color);\n });\n }, '#000000');\n } else if (value === 'remove') {\n onChoice('');\n editor.execCommand('mceRemoveTextcolor', format);\n } else {\n onChoice(value);\n editor.execCommand('mceApplyTextcolor', format, value);\n }\n };\n var getColors$1 = function (colors, hasCustom) {\n return colors.concat(getCurrentColors().concat(getAdditionalColors(hasCustom)));\n };\n var getFetch = function (colors, hasCustom) {\n return function (callback) {\n callback(getColors$1(colors, hasCustom));\n };\n };\n var setIconColor = function (splitButtonApi, name, newColor) {\n var setIconFillAndStroke = function (pathId, color) {\n splitButtonApi.setIconFill(pathId, color);\n splitButtonApi.setIconStroke(pathId, color);\n };\n var id = name === 'forecolor' ? 'tox-icon-text-color__color' : 'tox-icon-highlight-bg-color__color';\n setIconFillAndStroke(id, newColor);\n };\n var registerTextColorButton = function (editor, name, format, tooltip, lastColor) {\n editor.ui.registry.addSplitButton(name, {\n tooltip: tooltip,\n presets: 'color',\n icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color',\n select: function (value) {\n var optCurrentRgb = Option.from(getCurrentColor(editor, format));\n return optCurrentRgb.bind(function (currentRgb) {\n return fromString(currentRgb).map(function (rgba) {\n var currentHex = fromRgba(rgba).value;\n return contains$1(value.toLowerCase(), currentHex);\n });\n }).getOr(false);\n },\n columns: getColorCols$1(editor),\n fetch: getFetch(getColors(editor), hasCustomColors(editor)),\n onAction: function (_splitButtonApi) {\n if (lastColor.get() !== null) {\n applyColor(editor, format, lastColor.get(), function () {\n });\n }\n },\n onItemAction: function (_splitButtonApi, value) {\n applyColor(editor, format, value, function (newColor) {\n lastColor.set(newColor);\n fireTextColorChange(editor, {\n name: name,\n color: newColor\n });\n });\n },\n onSetup: function (splitButtonApi) {\n if (lastColor.get() !== null) {\n setIconColor(splitButtonApi, name, lastColor.get());\n }\n var handler = function (e) {\n if (e.name === name) {\n setIconColor(splitButtonApi, e.name, e.color);\n }\n };\n editor.on('TextColorChange', handler);\n return function () {\n editor.off('TextColorChange', handler);\n };\n }\n });\n };\n var registerTextColorMenuItem = function (editor, name, format, text) {\n editor.ui.registry.addNestedMenuItem(name, {\n text: text,\n icon: name === 'forecolor' ? 'text-color' : 'highlight-bg-color',\n getSubmenuItems: function () {\n return [{\n type: 'fancymenuitem',\n fancytype: 'colorswatch',\n onAction: function (data) {\n applyColor(editor, format, data.value, noop);\n }\n }];\n }\n });\n };\n var colorPickerDialog = function (editor) {\n return function (callback, value) {\n var getOnSubmit = function (callback) {\n return function (api) {\n var data = api.getData();\n callback(Option.from(data.colorpicker));\n api.close();\n };\n };\n var onAction = function (api, details) {\n if (details.name === 'hex-valid') {\n if (details.value) {\n api.enable('ok');\n } else {\n api.disable('ok');\n }\n }\n };\n var initialData = { colorpicker: value };\n var submit = getOnSubmit(callback);\n editor.windowManager.open({\n title: 'Color Picker',\n size: 'normal',\n body: {\n type: 'panel',\n items: [{\n type: 'colorpicker',\n name: 'colorpicker',\n label: 'Color'\n }]\n },\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: initialData,\n onAction: onAction,\n onSubmit: submit,\n onClose: function () {\n },\n onCancel: function () {\n callback(Option.none());\n }\n });\n };\n };\n var register$1 = function (editor) {\n registerCommands(editor);\n var lastForeColor = Cell(null);\n var lastBackColor = Cell(null);\n registerTextColorButton(editor, 'forecolor', 'forecolor', 'Text color', lastForeColor);\n registerTextColorButton(editor, 'backcolor', 'hilitecolor', 'Background color', lastBackColor);\n registerTextColorMenuItem(editor, 'forecolor', 'forecolor', 'Text color');\n registerTextColorMenuItem(editor, 'backcolor', 'hilitecolor', 'Background color');\n };\n\n var createPartialChoiceMenu = function (value, items, onItemValueHandler, columns, presets, itemResponse, select, providersBackstage) {\n var hasIcons = menuHasIcons(items);\n var presetItemTypes = presets !== 'color' ? 'normal' : 'color';\n var alloyItems = createChoiceItems(items, onItemValueHandler, columns, presetItemTypes, itemResponse, select, providersBackstage);\n return createPartialMenuWithAlloyItems(value, hasIcons, alloyItems, columns, presets);\n };\n var createChoiceItems = function (items, onItemValueHandler, columns, itemPresets, itemResponse, select, providersBackstage) {\n return cat(map(items, function (item) {\n if (item.type === 'choiceitem') {\n return createChoiceMenuItem(item).fold(handleError, function (d) {\n return Option.some(renderChoiceItem(d, columns === 1, itemPresets, onItemValueHandler, select(item.value), itemResponse, providersBackstage, menuHasIcons(items)));\n });\n } else {\n return Option.none();\n }\n }));\n };\n\n var deriveMenuMovement = function (columns, presets) {\n var menuMarkers = markers$1(presets);\n if (columns === 1) {\n return {\n mode: 'menu',\n moveOnTab: true\n };\n } else if (columns === 'auto') {\n return {\n mode: 'grid',\n selector: '.' + menuMarkers.item,\n initSize: {\n numColumns: 1,\n numRows: 1\n }\n };\n } else {\n var rowClass = presets === 'color' ? 'tox-swatches__row' : 'tox-collection__group';\n return {\n mode: 'matrix',\n rowSelector: '.' + rowClass\n };\n }\n };\n var deriveCollectionMovement = function (columns, presets) {\n if (columns === 1) {\n return {\n mode: 'menu',\n moveOnTab: false,\n selector: '.tox-collection__item'\n };\n } else if (columns === 'auto') {\n return {\n mode: 'flatgrid',\n selector: '.' + 'tox-collection__item',\n initSize: {\n numColumns: 1,\n numRows: 1\n }\n };\n } else {\n return {\n mode: 'matrix',\n selectors: {\n row: presets === 'color' ? '.tox-swatches__row' : '.tox-collection__group',\n cell: presets === 'color' ? '.' + colorClass : '.' + selectableClass\n }\n };\n }\n };\n\n function renderColorSwatchItem(spec, backstage) {\n var items = getColors$1(backstage.colorinput.getColors(), backstage.colorinput.hasCustomColors());\n var columns = backstage.colorinput.getColorCols();\n var presets = 'color';\n var menuSpec = createPartialChoiceMenu(generate$1('menu-value'), items, function (value) {\n spec.onAction({ value: value });\n }, columns, presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () {\n return false;\n }, backstage.shared.providers);\n var widgetSpec = __assign(__assign({}, menuSpec), {\n markers: markers$1(presets),\n movement: deriveMenuMovement(columns, presets)\n });\n return {\n type: 'widget',\n data: { value: generate$1('widget-id') },\n dom: {\n tag: 'div',\n classes: ['tox-fancymenuitem']\n },\n autofocus: true,\n components: [parts$2().widget(Menu.sketch(widgetSpec))]\n };\n }\n\n var fancyMenuItems = {\n inserttable: renderInsertTableMenuItem,\n colorswatch: renderColorSwatchItem\n };\n var valueOpt = function (obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key) ? Option.some(obj[key]) : Option.none();\n };\n var renderFancyMenuItem = function (spec, backstage) {\n return valueOpt(fancyMenuItems, spec.fancytype).map(function (render) {\n return render(spec, backstage);\n });\n };\n\n var renderNormalItem = function (spec, itemResponse, providersBackstage, renderIcons) {\n if (renderIcons === void 0) {\n renderIcons = true;\n }\n var getApi = function (component) {\n return {\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var structure = renderItemStructure({\n presets: 'normal',\n iconContent: spec.icon,\n textContent: spec.text,\n htmlContent: Option.none(),\n ariaLabel: spec.text,\n caret: Option.none(),\n checkMark: Option.none(),\n shortcutContent: spec.shortcut\n }, providersBackstage, renderIcons);\n return renderCommonItem({\n data: buildData(spec),\n getApi: getApi,\n disabled: spec.disabled,\n onAction: spec.onAction,\n onSetup: spec.onSetup,\n triggersSubmenu: false,\n itemBehaviours: []\n }, structure, itemResponse, providersBackstage);\n };\n\n var renderNestedItem = function (spec, itemResponse, providersBackstage, renderIcons, downwardsCaret) {\n if (renderIcons === void 0) {\n renderIcons = true;\n }\n if (downwardsCaret === void 0) {\n downwardsCaret = false;\n }\n var caret = downwardsCaret ? renderDownwardsCaret(providersBackstage.icons) : renderSubmenuCaret(providersBackstage.icons);\n var getApi = function (component) {\n return {\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var structure = renderItemStructure({\n presets: 'normal',\n iconContent: spec.icon,\n textContent: spec.text,\n htmlContent: Option.none(),\n ariaLabel: spec.text,\n caret: Option.some(caret),\n checkMark: Option.none(),\n shortcutContent: spec.shortcut\n }, providersBackstage, renderIcons);\n return renderCommonItem({\n data: buildData(spec),\n getApi: getApi,\n disabled: spec.disabled,\n onAction: noop,\n onSetup: spec.onSetup,\n triggersSubmenu: true,\n itemBehaviours: []\n }, structure, itemResponse, providersBackstage);\n };\n\n var renderSeparatorItem = function (spec) {\n var innerHtml = spec.text.fold(function () {\n return {};\n }, function (text) {\n return { innerHtml: text };\n });\n return {\n type: 'separator',\n dom: __assign({\n tag: 'div',\n classes: [\n selectableClass,\n groupHeadingClass\n ]\n }, innerHtml),\n components: []\n };\n };\n\n var renderToggleMenuItem = function (spec, itemResponse, providersBackstage, renderIcons) {\n if (renderIcons === void 0) {\n renderIcons = true;\n }\n var getApi = function (component) {\n return {\n setActive: function (state) {\n Toggling.set(component, state);\n },\n isActive: function () {\n return Toggling.isOn(component);\n },\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var structure = renderItemStructure({\n iconContent: spec.icon,\n textContent: spec.text,\n htmlContent: Option.none(),\n ariaLabel: spec.text,\n checkMark: Option.some(renderCheckmark(providersBackstage.icons)),\n caret: Option.none(),\n shortcutContent: spec.shortcut,\n presets: 'normal',\n meta: spec.meta\n }, providersBackstage, renderIcons);\n return deepMerge(renderCommonItem({\n data: buildData(spec),\n disabled: spec.disabled,\n getApi: getApi,\n onAction: spec.onAction,\n onSetup: spec.onSetup,\n triggersSubmenu: false,\n itemBehaviours: []\n }, structure, itemResponse, providersBackstage), {\n toggling: {\n toggleClass: tickedClass,\n toggleOnExecute: false,\n selected: spec.active\n }\n });\n };\n\n var autocomplete = renderAutocompleteItem;\n var separator = renderSeparatorItem;\n var normal = renderNormalItem;\n var nested = renderNestedItem;\n var toggle$1 = renderToggleMenuItem;\n var fancy = renderFancyMenuItem;\n\n var FocusMode;\n (function (FocusMode) {\n FocusMode[FocusMode['ContentFocus'] = 0] = 'ContentFocus';\n FocusMode[FocusMode['UiFocus'] = 1] = 'UiFocus';\n }(FocusMode || (FocusMode = {})));\n var createMenuItemFromBridge = function (item, itemResponse, backstage, menuHasIcons, isHorizontalMenu) {\n var providersBackstage = backstage.shared.providers;\n var parseForHorizontalMenu = function (menuitem) {\n return !isHorizontalMenu ? menuitem : __assign(__assign({}, menuitem), {\n shortcut: Option.none(),\n icon: menuitem.text.isSome() ? Option.none() : menuitem.icon\n });\n };\n switch (item.type) {\n case 'menuitem':\n return createMenuItem(item).fold(handleError, function (d) {\n return Option.some(normal(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons));\n });\n case 'nestedmenuitem':\n return createNestedMenuItem(item).fold(handleError, function (d) {\n return Option.some(nested(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons, isHorizontalMenu));\n });\n case 'togglemenuitem':\n return createToggleMenuItem(item).fold(handleError, function (d) {\n return Option.some(toggle$1(parseForHorizontalMenu(d), itemResponse, providersBackstage, menuHasIcons));\n });\n case 'separator':\n return createSeparatorMenuItem(item).fold(handleError, function (d) {\n return Option.some(separator(d));\n });\n case 'fancymenuitem':\n return createFancyMenuItem(item).fold(handleError, function (d) {\n return fancy(parseForHorizontalMenu(d), backstage);\n });\n default: {\n domGlobals.console.error('Unknown item in general menu', item);\n return Option.none();\n }\n }\n };\n var createAutocompleteItems = function (items, matchText, onItemValueHandler, columns, itemResponse, sharedBackstage) {\n var renderText = columns === 1;\n var renderIcons = !renderText || menuHasIcons(items);\n return cat(map(items, function (item) {\n if (item.type === 'separator') {\n return createSeparatorItem(item).fold(handleError, function (d) {\n return Option.some(separator(d));\n });\n } else {\n return createAutocompleterItem(item).fold(handleError, function (d) {\n return Option.some(autocomplete(d, matchText, renderText, 'normal', onItemValueHandler, itemResponse, sharedBackstage, renderIcons));\n });\n }\n }));\n };\n var createPartialMenu = function (value, items, itemResponse, backstage, isHorizontalMenu) {\n var hasIcons = menuHasIcons(items);\n var alloyItems = cat(map(items, function (item) {\n var itemHasIcon = function (i) {\n return isHorizontalMenu ? !i.hasOwnProperty('text') : hasIcons;\n };\n var createItem = function (i) {\n return createMenuItemFromBridge(i, itemResponse, backstage, itemHasIcon(i), isHorizontalMenu);\n };\n if (item.type === 'nestedmenuitem' && item.getSubmenuItems().length <= 0) {\n return createItem(__assign(__assign({}, item), { disabled: true }));\n } else {\n return createItem(item);\n }\n }));\n var createPartial = isHorizontalMenu ? createHorizontalPartialMenuWithAlloyItems : createPartialMenuWithAlloyItems;\n return createPartial(value, hasIcons, alloyItems, 1, 'normal');\n };\n var createTieredDataFrom = function (partialMenu) {\n return tieredMenu.singleData(partialMenu.value, partialMenu);\n };\n var createMenuFrom = function (partialMenu, columns, focusMode, presets) {\n var focusManager = focusMode === FocusMode.ContentFocus ? highlights() : dom();\n var movement = deriveMenuMovement(columns, presets);\n var menuMarkers = markers$1(presets);\n return {\n dom: partialMenu.dom,\n components: partialMenu.components,\n items: partialMenu.items,\n value: partialMenu.value,\n markers: {\n selectedItem: menuMarkers.selectedItem,\n item: menuMarkers.item\n },\n movement: movement,\n fakeFocus: focusMode === FocusMode.ContentFocus,\n focusManager: focusManager,\n menuBehaviours: SimpleBehaviours.unnamedEvents(columns !== 'auto' ? [] : [runOnAttached(function (comp, _se) {\n detectSize(comp, 4, menuMarkers.item).each(function (_a) {\n var numColumns = _a.numColumns, numRows = _a.numRows;\n Keying.setGridSize(comp, numRows, numColumns);\n });\n })])\n };\n };\n\n var register$2 = function (editor, sharedBackstage) {\n var activeAutocompleter = Cell(Option.none());\n var processingAction = Cell(false);\n var autocompleter = build$1(InlineView.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-autocompleter']\n },\n components: [],\n fireDismissalEventInstead: {},\n inlineBehaviours: derive$1([config('dismissAutocompleter', [run(dismissRequested(), function () {\n return cancelIfNecessary();\n })])]),\n lazySink: sharedBackstage.getSink\n }));\n var isMenuOpen = function () {\n return InlineView.isOpen(autocompleter);\n };\n var isActive = function () {\n return activeAutocompleter.get().isSome();\n };\n var hideIfNecessary = function () {\n if (isActive()) {\n InlineView.hide(autocompleter);\n }\n };\n var cancelIfNecessary = function () {\n if (isActive()) {\n var lastElement = activeAutocompleter.get().map(function (ac) {\n return ac.element;\n });\n detect$4(lastElement.getOr(Element.fromDom(editor.selection.getNode()))).each(unwrap);\n hideIfNecessary();\n activeAutocompleter.set(Option.none());\n processingAction.set(false);\n }\n };\n var getAutocompleters = cached(function () {\n return register(editor);\n });\n var getCombinedItems = function (triggerChar, matches) {\n var columns = findMap(matches, function (m) {\n return Option.from(m.columns);\n }).getOr(1);\n return bind(matches, function (match) {\n var choices = match.items;\n return createAutocompleteItems(choices, match.matchText, function (itemValue, itemMeta) {\n var nr = editor.selection.getRng();\n getContext(editor.dom, nr, triggerChar).fold(function () {\n return domGlobals.console.error('Lost context. Cursor probably moved');\n }, function (_a) {\n var range = _a.range;\n var autocompleterApi = {\n hide: function () {\n cancelIfNecessary();\n },\n reload: function (fetchOptions) {\n hideIfNecessary();\n load(fetchOptions);\n }\n };\n processingAction.set(true);\n match.onAction(autocompleterApi, range, itemValue, itemMeta);\n processingAction.set(false);\n });\n }, columns, ItemResponse$1.BUBBLE_TO_SANDBOX, sharedBackstage);\n });\n };\n var commenceIfNecessary = function (context) {\n if (!isActive()) {\n var wrapper = create$4(editor, context.range);\n activeAutocompleter.set(Option.some({\n triggerChar: context.triggerChar,\n element: wrapper,\n matchLength: context.text.length\n }));\n processingAction.set(false);\n }\n };\n var display = function (ac, context, lookupData, items) {\n ac.matchLength = context.text.length;\n var columns = findMap(lookupData, function (ld) {\n return Option.from(ld.columns);\n }).getOr(1);\n InlineView.showAt(autocompleter, {\n anchor: 'node',\n root: Element.fromDom(editor.getBody()),\n node: Option.from(ac.element)\n }, Menu.sketch(createMenuFrom(createPartialMenuWithAlloyItems('autocompleter-value', true, items, columns, 'normal'), columns, FocusMode.ContentFocus, 'normal')));\n InlineView.getContent(autocompleter).each(Highlighting.highlightFirst);\n };\n var doLookup = function (fetchOptions) {\n return activeAutocompleter.get().map(function (ac) {\n return getContext(editor.dom, editor.selection.getRng(), ac.triggerChar).bind(function (newContext) {\n return lookupWithContext(editor, getAutocompleters, newContext, fetchOptions);\n });\n }).getOrThunk(function () {\n return lookup(editor, getAutocompleters);\n });\n };\n var load = function (fetchOptions) {\n doLookup(fetchOptions).fold(cancelIfNecessary, function (lookupInfo) {\n commenceIfNecessary(lookupInfo.context);\n lookupInfo.lookupData.then(function (lookupData) {\n activeAutocompleter.get().map(function (ac) {\n var context = lookupInfo.context;\n if (ac.triggerChar === context.triggerChar) {\n var combinedItems = getCombinedItems(context.triggerChar, lookupData);\n if (combinedItems.length > 0) {\n display(ac, context, lookupData, combinedItems);\n } else if (context.text.length - ac.matchLength >= 10) {\n cancelIfNecessary();\n } else {\n hideIfNecessary();\n }\n }\n });\n });\n });\n };\n var onKeypress = last$2(function (e) {\n if (e.which === 27) {\n return;\n }\n load();\n }, 50);\n var autocompleterUiApi = {\n onKeypress: onKeypress,\n cancelIfNecessary: cancelIfNecessary,\n isMenuOpen: isMenuOpen,\n isActive: isActive,\n isProcessingAction: processingAction.get,\n getView: function () {\n return InlineView.getContent(autocompleter);\n }\n };\n AutocompleterEditorEvents.setup(autocompleterUiApi, editor);\n };\n var Autocompleter = { register: register$2 };\n\n var filter$2 = constant(true);\n var bind$3 = function (element, event, handler) {\n return bind$2(element, event, filter$2, handler);\n };\n var capture$1 = function (element, event, handler) {\n return capture(element, event, filter$2, handler);\n };\n var fromRawEvent$1 = fromRawEvent;\n\n var closest$4 = function (scope, selector, isRoot) {\n return closest$3(scope, selector, isRoot).isSome();\n };\n\n function DelayedFunction (fun, delay) {\n var ref = null;\n var schedule = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n ref = domGlobals.setTimeout(function () {\n fun.apply(null, args);\n ref = null;\n }, delay);\n };\n var cancel = function () {\n if (ref !== null) {\n domGlobals.clearTimeout(ref);\n ref = null;\n }\n };\n return {\n cancel: cancel,\n schedule: schedule\n };\n }\n\n var SIGNIFICANT_MOVE = 5;\n var LONGPRESS_DELAY = 400;\n var getTouch = function (event) {\n var raw = event.raw();\n if (raw.touches === undefined || raw.touches.length !== 1) {\n return Option.none();\n }\n return Option.some(raw.touches[0]);\n };\n var isFarEnough = function (touch, data) {\n var distX = Math.abs(touch.clientX - data.x);\n var distY = Math.abs(touch.clientY - data.y);\n return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE;\n };\n var monitor = function (settings) {\n var startData = Cell(Option.none());\n var longpressFired = Cell(false);\n var longpress$1 = DelayedFunction(function (event) {\n settings.triggerEvent(longpress(), event);\n longpressFired.set(true);\n }, LONGPRESS_DELAY);\n var handleTouchstart = function (event) {\n getTouch(event).each(function (touch) {\n longpress$1.cancel();\n var data = {\n x: touch.clientX,\n y: touch.clientY,\n target: event.target()\n };\n longpress$1.schedule(event);\n longpressFired.set(false);\n startData.set(Option.some(data));\n });\n return Option.none();\n };\n var handleTouchmove = function (event) {\n longpress$1.cancel();\n getTouch(event).each(function (touch) {\n startData.get().each(function (data) {\n if (isFarEnough(touch, data)) {\n startData.set(Option.none());\n }\n });\n });\n return Option.none();\n };\n var handleTouchend = function (event) {\n longpress$1.cancel();\n var isSame = function (data) {\n return eq$1(data.target, event.target());\n };\n return startData.get().filter(isSame).map(function (_data) {\n if (longpressFired.get()) {\n event.prevent();\n return false;\n } else {\n return settings.triggerEvent(tap(), event);\n }\n });\n };\n var handlers = wrapAll$1([\n {\n key: touchstart(),\n value: handleTouchstart\n },\n {\n key: touchmove(),\n value: handleTouchmove\n },\n {\n key: touchend(),\n value: handleTouchend\n }\n ]);\n var fireIfReady = function (event, type) {\n return get(handlers, type).bind(function (handler) {\n return handler(event);\n });\n };\n return { fireIfReady: fireIfReady };\n };\n\n var isDangerous = function (event) {\n var keyEv = event.raw();\n return keyEv.which === BACKSPACE()[0] && !contains([\n 'input',\n 'textarea'\n ], name(event.target())) && !closest$4(event.target(), '[contenteditable=\"true\"]');\n };\n var isFirefox = function () {\n return detect$3().browser.isFirefox();\n };\n var settingsSchema = objOfOnly([\n strictFunction('triggerEvent'),\n defaulted$1('stopBackspace', true)\n ]);\n var bindFocus = function (container, handler) {\n if (isFirefox()) {\n return capture$1(container, 'focus', handler);\n } else {\n return bind$3(container, 'focusin', handler);\n }\n };\n var bindBlur = function (container, handler) {\n if (isFirefox()) {\n return capture$1(container, 'blur', handler);\n } else {\n return bind$3(container, 'focusout', handler);\n }\n };\n var setup$1 = function (container, rawSettings) {\n var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings);\n var pointerEvents = [\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n 'gesturestart',\n 'mousedown',\n 'mouseup',\n 'mouseover',\n 'mousemove',\n 'mouseout',\n 'click'\n ];\n var tapEvent = monitor(settings);\n var simpleEvents = map(pointerEvents.concat([\n 'selectstart',\n 'input',\n 'contextmenu',\n 'change',\n 'transitionend',\n 'drag',\n 'dragstart',\n 'dragend',\n 'dragenter',\n 'dragleave',\n 'dragover',\n 'drop',\n 'keyup'\n ]), function (type) {\n return bind$3(container, type, function (event) {\n tapEvent.fireIfReady(event, type).each(function (tapStopped) {\n if (tapStopped) {\n event.kill();\n }\n });\n var stopped = settings.triggerEvent(type, event);\n if (stopped) {\n event.kill();\n }\n });\n });\n var pasteTimeout = Cell(Option.none());\n var onPaste = bind$3(container, 'paste', function (event) {\n tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) {\n if (tapStopped) {\n event.kill();\n }\n });\n var stopped = settings.triggerEvent('paste', event);\n if (stopped) {\n event.kill();\n }\n pasteTimeout.set(Option.some(domGlobals.setTimeout(function () {\n settings.triggerEvent(postPaste(), event);\n }, 0)));\n });\n var onKeydown = bind$3(container, 'keydown', function (event) {\n var stopped = settings.triggerEvent('keydown', event);\n if (stopped) {\n event.kill();\n } else if (settings.stopBackspace === true && isDangerous(event)) {\n event.prevent();\n }\n });\n var onFocusIn = bindFocus(container, function (event) {\n var stopped = settings.triggerEvent('focusin', event);\n if (stopped) {\n event.kill();\n }\n });\n var focusoutTimeout = Cell(Option.none());\n var onFocusOut = bindBlur(container, function (event) {\n var stopped = settings.triggerEvent('focusout', event);\n if (stopped) {\n event.kill();\n }\n focusoutTimeout.set(Option.some(domGlobals.setTimeout(function () {\n settings.triggerEvent(postBlur(), event);\n }, 0)));\n });\n var unbind = function () {\n each(simpleEvents, function (e) {\n e.unbind();\n });\n onKeydown.unbind();\n onFocusIn.unbind();\n onFocusOut.unbind();\n onPaste.unbind();\n pasteTimeout.get().each(domGlobals.clearTimeout);\n focusoutTimeout.get().each(domGlobals.clearTimeout);\n };\n return { unbind: unbind };\n };\n\n var derive$2 = function (rawEvent, rawTarget) {\n var source = get(rawEvent, 'target').map(function (getTarget) {\n return getTarget();\n }).getOr(rawTarget);\n return Cell(source);\n };\n\n var fromSource = function (event, source) {\n var stopper = Cell(false);\n var cutter = Cell(false);\n var stop = function () {\n stopper.set(true);\n };\n var cut = function () {\n cutter.set(true);\n };\n return {\n stop: stop,\n cut: cut,\n isStopped: stopper.get,\n isCut: cutter.get,\n event: constant(event),\n setSource: source.set,\n getSource: source.get\n };\n };\n var fromExternal = function (event) {\n var stopper = Cell(false);\n var stop = function () {\n stopper.set(true);\n };\n return {\n stop: stop,\n cut: noop,\n isStopped: stopper.get,\n isCut: constant(false),\n event: constant(event),\n setSource: die('Cannot set source of a broadcasted event'),\n getSource: die('Cannot get source of a broadcasted event')\n };\n };\n\n var adt$b = Adt.generate([\n { stopped: [] },\n { resume: ['element'] },\n { complete: [] }\n ]);\n var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) {\n var handler = lookup(eventType, target);\n var simulatedEvent = fromSource(rawEvent, source);\n return handler.fold(function () {\n logger.logEventNoHandlers(eventType, target);\n return adt$b.complete();\n }, function (handlerInfo) {\n var descHandler = handlerInfo.descHandler;\n var eventHandler = getCurried(descHandler);\n eventHandler(simulatedEvent);\n if (simulatedEvent.isStopped()) {\n logger.logEventStopped(eventType, handlerInfo.element, descHandler.purpose());\n return adt$b.stopped();\n } else if (simulatedEvent.isCut()) {\n logger.logEventCut(eventType, handlerInfo.element, descHandler.purpose());\n return adt$b.complete();\n } else {\n return parent(handlerInfo.element).fold(function () {\n logger.logNoParent(eventType, handlerInfo.element, descHandler.purpose());\n return adt$b.complete();\n }, function (parent) {\n logger.logEventResponse(eventType, handlerInfo.element, descHandler.purpose());\n return adt$b.resume(parent);\n });\n }\n });\n };\n var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) {\n return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () {\n return true;\n }, function (parent) {\n return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger);\n }, function () {\n return false;\n });\n };\n var triggerHandler = function (lookup, eventType, rawEvent, target, logger) {\n var source = derive$2(rawEvent, target);\n return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger);\n };\n var broadcast = function (listeners, rawEvent, _logger) {\n var simulatedEvent = fromExternal(rawEvent);\n each(listeners, function (listener) {\n var descHandler = listener.descHandler();\n var handler = getCurried(descHandler);\n handler(simulatedEvent);\n });\n return simulatedEvent.isStopped();\n };\n var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) {\n var rawTarget = rawEvent.target();\n return triggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, logger);\n };\n var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) {\n var source = derive$2(rawEvent, rawTarget);\n return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger);\n };\n\n var eventHandler = function (element, descHandler) {\n return {\n element: element,\n descHandler: descHandler\n };\n };\n var broadcastHandler = function (id, handler) {\n return {\n id: constant(id),\n descHandler: constant(handler)\n };\n };\n function EventRegistry () {\n var registry = {};\n var registerId = function (extraArgs, id, events) {\n each$1(events, function (v, k) {\n var handlers = registry[k] !== undefined ? registry[k] : {};\n handlers[id] = curryArgs(v, extraArgs);\n registry[k] = handlers;\n });\n };\n var findHandler = function (handlers, elem) {\n return read$1(elem).fold(function () {\n return Option.none();\n }, function (id) {\n return handlers.bind(function (h) {\n return get(h, id);\n }).map(function (descHandler) {\n return eventHandler(elem, descHandler);\n });\n });\n };\n var filterByType = function (type) {\n return get(registry, type).map(function (handlers) {\n return mapToArray(handlers, function (f, id) {\n return broadcastHandler(id, f);\n });\n }).getOr([]);\n };\n var find = function (isAboveRoot, type, target) {\n var handlers = get(registry, type);\n return closest(target, function (elem) {\n return findHandler(handlers, elem);\n }, isAboveRoot);\n };\n var unregisterId = function (id) {\n each$1(registry, function (handlersById, _eventName) {\n if (handlersById.hasOwnProperty(id)) {\n delete handlersById[id];\n }\n });\n };\n return {\n registerId: registerId,\n unregisterId: unregisterId,\n filterByType: filterByType,\n find: find\n };\n }\n\n function Registry () {\n var events = EventRegistry();\n var components = {};\n var readOrTag = function (component) {\n var elem = component.element();\n return read$1(elem).fold(function () {\n return write('uid-', component.element());\n }, function (uid) {\n return uid;\n });\n };\n var failOnDuplicate = function (component, tagId) {\n var conflict = components[tagId];\n if (conflict === component) {\n unregister(component);\n } else {\n throw new Error('The tagId \"' + tagId + '\" is already used by: ' + element(conflict.element()) + '\\nCannot use it for: ' + element(component.element()) + '\\n' + 'The conflicting element is' + (inBody(conflict.element()) ? ' ' : ' not ') + 'already in the DOM');\n }\n };\n var register = function (component) {\n var tagId = readOrTag(component);\n if (hasNonNullableKey(components, tagId)) {\n failOnDuplicate(component, tagId);\n }\n var extraArgs = [component];\n events.registerId(extraArgs, tagId, component.events());\n components[tagId] = component;\n };\n var unregister = function (component) {\n read$1(component.element()).each(function (tagId) {\n delete components[tagId];\n events.unregisterId(tagId);\n });\n };\n var filter = function (type) {\n return events.filterByType(type);\n };\n var find = function (isAboveRoot, type, target) {\n return events.find(isAboveRoot, type, target);\n };\n var getById = function (id) {\n return get(components, id);\n };\n return {\n find: find,\n filter: filter,\n register: register,\n unregister: unregister,\n getById: getById\n };\n }\n\n var factory$3 = function (detail) {\n var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']);\n return {\n uid: detail.uid,\n dom: __assign({\n tag: 'div',\n attributes: __assign({ role: 'presentation' }, attributes)\n }, domWithoutAttributes),\n components: detail.components,\n behaviours: get$c(detail.containerBehaviours),\n events: detail.events,\n domModification: detail.domModification,\n eventOrder: detail.eventOrder\n };\n };\n var Container = single$2({\n name: 'Container',\n factory: factory$3,\n configFields: [\n defaulted$1('components', []),\n field$1('containerBehaviours', []),\n defaulted$1('events', {}),\n defaulted$1('domModification', {}),\n defaulted$1('eventOrder', {})\n ]\n });\n\n var takeover = function (root) {\n var isAboveRoot = function (el) {\n return parent(root.element()).fold(function () {\n return true;\n }, function (parent) {\n return eq$1(el, parent);\n });\n };\n var registry = Registry();\n var lookup = function (eventName, target) {\n return registry.find(isAboveRoot, eventName, target);\n };\n var domEvents = setup$1(root.element(), {\n triggerEvent: function (eventName, event) {\n return monitorEvent(eventName, event.target(), function (logger) {\n return triggerUntilStopped(lookup, eventName, event, logger);\n });\n }\n });\n var systemApi = {\n debugInfo: constant('real'),\n triggerEvent: function (eventName, target, data) {\n monitorEvent(eventName, target, function (logger) {\n return triggerOnUntilStopped(lookup, eventName, data, target, logger);\n });\n },\n triggerFocus: function (target, originator) {\n read$1(target).fold(function () {\n focus$1(target);\n }, function (_alloyId) {\n monitorEvent(focus(), target, function (logger) {\n triggerHandler(lookup, focus(), {\n originator: constant(originator),\n kill: noop,\n prevent: noop,\n target: constant(target)\n }, target, logger);\n return false;\n });\n });\n },\n triggerEscape: function (comp, simulatedEvent) {\n systemApi.triggerEvent('keydown', comp.element(), simulatedEvent.event());\n },\n getByUid: function (uid) {\n return getByUid(uid);\n },\n getByDom: function (elem) {\n return getByDom(elem);\n },\n build: build$1,\n addToGui: function (c) {\n add(c);\n },\n removeFromGui: function (c) {\n remove$1(c);\n },\n addToWorld: function (c) {\n addToWorld(c);\n },\n removeFromWorld: function (c) {\n removeFromWorld(c);\n },\n broadcast: function (message) {\n broadcast$1(message);\n },\n broadcastOn: function (channels, message) {\n broadcastOn(channels, message);\n },\n broadcastEvent: function (eventName, event) {\n broadcastEvent(eventName, event);\n },\n isConnected: constant(true)\n };\n var addToWorld = function (component) {\n component.connect(systemApi);\n if (!isText(component.element())) {\n registry.register(component);\n each(component.components(), addToWorld);\n systemApi.triggerEvent(systemInit(), component.element(), { target: constant(component.element()) });\n }\n };\n var removeFromWorld = function (component) {\n if (!isText(component.element())) {\n each(component.components(), removeFromWorld);\n registry.unregister(component);\n }\n component.disconnect();\n };\n var add = function (component) {\n attach$1(root, component);\n };\n var remove$1 = function (component) {\n detach(component);\n };\n var destroy = function () {\n domEvents.unbind();\n remove(root.element());\n };\n var broadcastData = function (data) {\n var receivers = registry.filter(receive());\n each(receivers, function (receiver) {\n var descHandler = receiver.descHandler();\n var handler = getCurried(descHandler);\n handler(data);\n });\n };\n var broadcast$1 = function (message) {\n broadcastData({\n universal: constant(true),\n data: constant(message)\n });\n };\n var broadcastOn = function (channels, message) {\n broadcastData({\n universal: constant(false),\n channels: constant(channels),\n data: constant(message)\n });\n };\n var broadcastEvent = function (eventName, event) {\n var listeners = registry.filter(eventName);\n return broadcast(listeners, event);\n };\n var getByUid = function (uid) {\n return registry.getById(uid).fold(function () {\n return Result.error(new Error('Could not find component with uid: \"' + uid + '\" in system.'));\n }, Result.value);\n };\n var getByDom = function (elem) {\n var uid = read$1(elem).getOr('not found');\n return getByUid(uid);\n };\n addToWorld(root);\n return {\n root: constant(root),\n element: root.element,\n destroy: destroy,\n add: add,\n remove: remove$1,\n getByUid: getByUid,\n getByDom: getByDom,\n addToWorld: addToWorld,\n removeFromWorld: removeFromWorld,\n broadcast: broadcast$1,\n broadcastOn: broadcastOn,\n broadcastEvent: broadcastEvent\n };\n };\n\n var renderBar = function (spec, backstage) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-bar',\n 'tox-form__controls-h-stack'\n ]\n },\n components: map(spec.items, backstage.interpreter)\n };\n };\n\n var schema$e = constant([\n defaulted$1('prefix', 'form-field'),\n field$1('fieldBehaviours', [\n Composing,\n Representing\n ])\n ]);\n var parts$3 = constant([\n optional({\n schema: [strict$1('dom')],\n name: 'label'\n }),\n optional({\n factory: {\n sketch: function (spec) {\n return {\n uid: spec.uid,\n dom: {\n tag: 'span',\n styles: { display: 'none' },\n attributes: { 'aria-hidden': 'true' },\n innerHtml: spec.text\n }\n };\n }\n },\n schema: [strict$1('text')],\n name: 'aria-descriptor'\n }),\n required({\n factory: {\n sketch: function (spec) {\n var excludeFactory = exclude$1(spec, ['factory']);\n return spec.factory.sketch(excludeFactory);\n }\n },\n schema: [strict$1('factory')],\n name: 'field'\n })\n ]);\n\n var factory$4 = function (detail, components, _spec, _externals) {\n var behaviours = augment(detail.fieldBehaviours, [\n Composing.config({\n find: function (container) {\n return getPart(container, detail, 'field');\n }\n }),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (field) {\n return Composing.getCurrent(field).bind(Representing.getValue);\n },\n setValue: function (field, value) {\n Composing.getCurrent(field).each(function (current) {\n Representing.setValue(current, value);\n });\n }\n }\n })\n ]);\n var events = derive([runOnAttached(function (component, _simulatedEvent) {\n var ps = getParts(component, detail, [\n 'label',\n 'field',\n 'aria-descriptor'\n ]);\n ps.field().each(function (field) {\n var id = generate$1(detail.prefix);\n ps.label().each(function (label) {\n set$1(label.element(), 'for', id);\n set$1(field.element(), 'id', id);\n });\n ps['aria-descriptor']().each(function (descriptor) {\n var descriptorId = generate$1(detail.prefix);\n set$1(descriptor.element(), 'id', descriptorId);\n set$1(field.element(), 'aria-describedby', descriptorId);\n });\n });\n })]);\n var apis = {\n getField: function (container) {\n return getPart(container, detail, 'field');\n },\n getLabel: function (container) {\n return getPart(container, detail, 'label');\n }\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: behaviours,\n events: events,\n apis: apis\n };\n };\n var FormField = composite$1({\n name: 'FormField',\n configFields: schema$e(),\n partFields: parts$3(),\n factory: factory$4,\n apis: {\n getField: function (apis, comp) {\n return apis.getField(comp);\n },\n getLabel: function (apis, comp) {\n return apis.getLabel(comp);\n }\n }\n });\n\n var exhibit$4 = function (base, tabConfig) {\n return nu$6({\n attributes: wrapAll$1([{\n key: tabConfig.tabAttr,\n value: 'true'\n }])\n });\n };\n\n var ActiveTabstopping = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$4\n });\n\n var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')];\n\n var Tabstopping = create$1({\n fields: TabstopSchema,\n name: 'tabstopping',\n active: ActiveTabstopping\n });\n\n var renderFormFieldWith = function (pLabel, pField, extraClasses, extraBehaviours) {\n var spec = renderFormFieldSpecWith(pLabel, pField, extraClasses, extraBehaviours);\n return FormField.sketch(spec);\n };\n var renderFormField = function (pLabel, pField) {\n return renderFormFieldWith(pLabel, pField, [], []);\n };\n var renderFormFieldSpecWith = function (pLabel, pField, extraClasses, extraBehaviours) {\n return {\n dom: renderFormFieldDomWith(extraClasses),\n components: pLabel.toArray().concat([pField]),\n fieldBehaviours: derive$1(extraBehaviours)\n };\n };\n var renderFormFieldDom = function () {\n return renderFormFieldDomWith([]);\n };\n var renderFormFieldDomWith = function (extraClasses) {\n return {\n tag: 'div',\n classes: ['tox-form__group'].concat(extraClasses)\n };\n };\n var renderLabel = function (label, providersBackstage) {\n return FormField.parts().label({\n dom: {\n tag: 'label',\n classes: ['tox-label'],\n innerHtml: providersBackstage.translate(label)\n }\n });\n };\n\n var formChangeEvent = generate$1('form-component-change');\n var formCloseEvent = generate$1('form-close');\n var formCancelEvent = generate$1('form-cancel');\n var formActionEvent = generate$1('form-action');\n var formSubmitEvent = generate$1('form-submit');\n var formBlockEvent = generate$1('form-block');\n var formUnblockEvent = generate$1('form-unblock');\n var formTabChangeEvent = generate$1('form-tabchange');\n var formResizeEvent = generate$1('form-resize');\n\n var renderCollection = function (spec, providersBackstage) {\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var runOnItem = function (f) {\n return function (comp, se) {\n closest$3(se.event().target(), '[data-collection-item-value]').each(function (target) {\n f(comp, se, target, get$2(target, 'data-collection-item-value'));\n });\n };\n };\n var escapeAttribute = function (ch) {\n if (ch === '\"') {\n return '"';\n }\n return ch;\n };\n var setContents = function (comp, items) {\n var htmlLines = map(items, function (item) {\n var itemText = global$6.translate(item.text);\n var textContent = spec.columns === 1 ? '
' + itemText + '
' : '';\n var iconContent = '
' + item.icon + '
';\n var mapItemName = {\n '_': ' ',\n ' - ': ' ',\n '-': ' '\n };\n var ariaLabel = itemText.replace(/\\_| \\- |\\-/g, function (match) {\n return mapItemName[match];\n });\n var readonlyClass = providersBackstage.isReadOnly() ? ' tox-collection__item--state-disabled' : '';\n return '
' + iconContent + textContent + '
';\n });\n var chunks = spec.columns > 1 && spec.columns !== 'auto' ? chunk(htmlLines, spec.columns) : [htmlLines];\n var html = map(chunks, function (ch) {\n return '
' + ch.join('') + '
';\n });\n set(comp.element(), html.join(''));\n };\n var onClick = runOnItem(function (comp, se, tgt, itemValue) {\n se.stop();\n if (!providersBackstage.isReadOnly()) {\n emitWith(comp, formActionEvent, {\n name: spec.name,\n value: itemValue\n });\n }\n });\n var collectionEvents = [\n run(mouseover(), runOnItem(function (comp, se, tgt) {\n focus$1(tgt);\n })),\n run(click(), onClick),\n run(tap(), onClick),\n run(focusin(), runOnItem(function (comp, se, tgt) {\n descendant$1(comp.element(), '.' + activeClass).each(function (currentActive) {\n remove$4(currentActive, activeClass);\n });\n add$2(tgt, activeClass);\n })),\n run(focusout(), runOnItem(function (comp) {\n descendant$1(comp.element(), '.' + activeClass).each(function (currentActive) {\n remove$4(currentActive, activeClass);\n });\n })),\n runOnExecute(runOnItem(function (comp, se, tgt, itemValue) {\n emitWith(comp, formActionEvent, {\n name: spec.name,\n value: itemValue\n });\n }))\n ];\n var iterCollectionItems = function (comp, applyAttributes) {\n return map(descendants(comp.element(), '.tox-collection__item'), applyAttributes);\n };\n var pField = FormField.parts().field({\n dom: {\n tag: 'div',\n classes: ['tox-collection'].concat(spec.columns !== 1 ? ['tox-collection--grid'] : ['tox-collection--list'])\n },\n components: [],\n factory: { sketch: identity },\n behaviours: derive$1([\n Disabling.config({\n disabled: providersBackstage.isReadOnly,\n onDisabled: function (comp) {\n iterCollectionItems(comp, function (childElm) {\n add$2(childElm, 'tox-collection__item--state-disabled');\n set$1(childElm, 'aria-disabled', true);\n });\n },\n onEnabled: function (comp) {\n iterCollectionItems(comp, function (childElm) {\n remove$4(childElm, 'tox-collection__item--state-disabled');\n remove$1(childElm, 'aria-disabled');\n });\n }\n }),\n receivingConfig(),\n Replacing.config({}),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: []\n },\n onSetValue: function (comp, items) {\n setContents(comp, items);\n if (spec.columns === 'auto') {\n detectSize(comp, 5, 'tox-collection__item').each(function (_a) {\n var numRows = _a.numRows, numColumns = _a.numColumns;\n Keying.setGridSize(comp, numRows, numColumns);\n });\n }\n emit(comp, formResizeEvent);\n }\n }),\n Tabstopping.config({}),\n Keying.config(deriveCollectionMovement(spec.columns, 'normal')),\n config('collection-events', collectionEvents)\n ]),\n eventOrder: {\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'collection-events'\n ]\n }\n });\n var extraClasses = ['tox-form__group--collection'];\n return renderFormFieldWith(pLabel, pField, extraClasses, []);\n };\n\n var schema$f = constant([\n option('data'),\n defaulted$1('inputAttributes', {}),\n defaulted$1('inputStyles', {}),\n defaulted$1('tag', 'input'),\n defaulted$1('inputClasses', []),\n onHandler('onSetValue'),\n defaulted$1('styles', {}),\n defaulted$1('eventOrder', {}),\n field$1('inputBehaviours', [\n Representing,\n Focusing\n ]),\n defaulted$1('selectOnFocus', true)\n ]);\n var focusBehaviours = function (detail) {\n return derive$1([Focusing.config({\n onFocus: !detail.selectOnFocus ? noop : function (component) {\n var input = component.element();\n var value = get$5(input);\n input.dom().setSelectionRange(0, value.length);\n }\n })]);\n };\n var behaviours = function (detail) {\n return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({\n store: __assign(__assign({ mode: 'manual' }, detail.data.map(function (data) {\n return { initialValue: data };\n }).getOr({})), {\n getValue: function (input) {\n return get$5(input.element());\n },\n setValue: function (input, data) {\n var current = get$5(input.element());\n if (current !== data) {\n set$3(input.element(), data);\n }\n }\n }),\n onSetValue: detail.onSetValue\n })]));\n };\n var dom$2 = function (detail) {\n return {\n tag: detail.tag,\n attributes: __assign({ type: 'text' }, detail.inputAttributes),\n styles: detail.inputStyles,\n classes: detail.inputClasses\n };\n };\n\n var factory$5 = function (detail, _spec) {\n return {\n uid: detail.uid,\n dom: dom$2(detail),\n components: [],\n behaviours: behaviours(detail),\n eventOrder: detail.eventOrder\n };\n };\n var Input = single$2({\n name: 'Input',\n configFields: schema$f(),\n factory: factory$5\n });\n\n var exports$1 = {}, module = { exports: exports$1 };\n (function (define, exports, module, require) {\n (function (f) {\n if (typeof exports === 'object' && typeof module !== 'undefined') {\n module.exports = f();\n } else if (typeof define === 'function' && define.amd) {\n define([], f);\n } else {\n var g;\n if (typeof window !== 'undefined') {\n g = window;\n } else if (typeof global !== 'undefined') {\n g = global;\n } else if (typeof self !== 'undefined') {\n g = self;\n } else {\n g = this;\n }\n g.EphoxContactWrapper = f();\n }\n }(function () {\n return function () {\n function r(e, n, t) {\n function o(i, f) {\n if (!n[i]) {\n if (!e[i]) {\n var c = 'function' == typeof require && require;\n if (!f && c)\n return c(i, !0);\n if (u)\n return u(i, !0);\n var a = new Error('Cannot find module \\'' + i + '\\'');\n throw a.code = 'MODULE_NOT_FOUND', a;\n }\n var p = n[i] = { exports: {} };\n e[i][0].call(p.exports, function (r) {\n var n = e[i][1][r];\n return o(n || r);\n }, p, p.exports, r, e, n, t);\n }\n return n[i].exports;\n }\n for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++)\n o(t[i]);\n return o;\n }\n return r;\n }()({\n 1: [\n function (require, module, exports) {\n var process = module.exports = {};\n var cachedSetTimeout;\n var cachedClearTimeout;\n function defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n }\n function defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n }\n (function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n }());\n function runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n return setTimeout(fun, 0);\n }\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n }\n function runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n return clearTimeout(marker);\n }\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n return cachedClearTimeout.call(this, marker);\n }\n }\n }\n var queue = [];\n var draining = false;\n var currentQueue;\n var queueIndex = -1;\n function cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n }\n function drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n while (len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n }\n process.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n };\n function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }\n Item.prototype.run = function () {\n this.fun.apply(null, this.array);\n };\n process.title = 'browser';\n process.browser = true;\n process.env = {};\n process.argv = [];\n process.version = '';\n process.versions = {};\n function noop() {\n }\n process.on = noop;\n process.addListener = noop;\n process.once = noop;\n process.off = noop;\n process.removeListener = noop;\n process.removeAllListeners = noop;\n process.emit = noop;\n process.prependListener = noop;\n process.prependOnceListener = noop;\n process.listeners = function (name) {\n return [];\n };\n process.binding = function (name) {\n throw new Error('process.binding is not supported');\n };\n process.cwd = function () {\n return '/';\n };\n process.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n };\n process.umask = function () {\n return 0;\n };\n },\n {}\n ],\n 2: [\n function (require, module, exports) {\n (function (setImmediate) {\n (function (root) {\n var setTimeoutFunc = setTimeout;\n function noop() {\n }\n function bind(fn, thisArg) {\n return function () {\n fn.apply(thisArg, arguments);\n };\n }\n function Promise(fn) {\n if (typeof this !== 'object')\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function')\n throw new TypeError('not a function');\n this._state = 0;\n this._handled = false;\n this._value = undefined;\n this._deferreds = [];\n doResolve(fn, this);\n }\n function handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function () {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n }\n function resolve(self, newValue) {\n try {\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n }\n function reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n }\n function finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function () {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n }\n function Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n }\n function doResolve(fn, self) {\n var done = false;\n try {\n fn(function (value) {\n if (done)\n return;\n done = true;\n resolve(self, value);\n }, function (reason) {\n if (done)\n return;\n done = true;\n reject(self, reason);\n });\n } catch (ex) {\n if (done)\n return;\n done = true;\n reject(self, ex);\n }\n }\n Promise.prototype['catch'] = function (onRejected) {\n return this.then(null, onRejected);\n };\n Promise.prototype.then = function (onFulfilled, onRejected) {\n var prom = new this.constructor(noop);\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n };\n Promise.all = function (arr) {\n var args = Array.prototype.slice.call(arr);\n return new Promise(function (resolve, reject) {\n if (args.length === 0)\n return resolve([]);\n var remaining = args.length;\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n };\n Promise.resolve = function (value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n return new Promise(function (resolve) {\n resolve(value);\n });\n };\n Promise.reject = function (value) {\n return new Promise(function (resolve, reject) {\n reject(value);\n });\n };\n Promise.race = function (values) {\n return new Promise(function (resolve, reject) {\n for (var i = 0, len = values.length; i < len; i++) {\n values[i].then(resolve, reject);\n }\n });\n };\n Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {\n setImmediate(fn);\n } : function (fn) {\n setTimeoutFunc(fn, 0);\n };\n Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err);\n }\n };\n Promise._setImmediateFn = function _setImmediateFn(fn) {\n Promise._immediateFn = fn;\n };\n Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {\n Promise._unhandledRejectionFn = fn;\n };\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Promise;\n } else if (!root.Promise) {\n root.Promise = Promise;\n }\n }(this));\n }.call(this, require('timers').setImmediate));\n },\n { 'timers': 3 }\n ],\n 3: [\n function (require, module, exports) {\n (function (setImmediate, clearImmediate) {\n var nextTick = require('process/browser.js').nextTick;\n var apply = Function.prototype.apply;\n var slice = Array.prototype.slice;\n var immediateIds = {};\n var nextImmediateId = 0;\n exports.setTimeout = function () {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n };\n exports.setInterval = function () {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n };\n exports.clearTimeout = exports.clearInterval = function (timeout) {\n timeout.close();\n };\n function Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n }\n Timeout.prototype.unref = Timeout.prototype.ref = function () {\n };\n Timeout.prototype.close = function () {\n this._clearFn.call(window, this._id);\n };\n exports.enroll = function (item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n };\n exports.unenroll = function (item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n };\n exports._unrefActive = exports.active = function (item) {\n clearTimeout(item._idleTimeoutId);\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n };\n exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n immediateIds[id] = true;\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n exports.clearImmediate(id);\n }\n });\n return id;\n };\n exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) {\n delete immediateIds[id];\n };\n }.call(this, require('timers').setImmediate, require('timers').clearImmediate));\n },\n {\n 'process/browser.js': 1,\n 'timers': 3\n }\n ],\n 4: [\n function (require, module, exports) {\n var promisePolyfill = require('promise-polyfill');\n var Global = function () {\n if (typeof window !== 'undefined') {\n return window;\n } else {\n return Function('return this;')();\n }\n }();\n module.exports = { boltExport: Global.Promise || promisePolyfill };\n },\n { 'promise-polyfill': 2 }\n ]\n }, {}, [4])(4);\n }));\n }(undefined, exports$1, module, undefined));\n var Promise = module.exports.boltExport;\n\n var nu$a = function (baseFn) {\n var data = Option.none();\n var callbacks = [];\n var map = function (f) {\n return nu$a(function (nCallback) {\n get(function (data) {\n nCallback(f(data));\n });\n });\n };\n var get = function (nCallback) {\n if (isReady()) {\n call(nCallback);\n } else {\n callbacks.push(nCallback);\n }\n };\n var set = function (x) {\n if (!isReady()) {\n data = Option.some(x);\n run(callbacks);\n callbacks = [];\n }\n };\n var isReady = function () {\n return data.isSome();\n };\n var run = function (cbs) {\n each(cbs, call);\n };\n var call = function (cb) {\n data.each(function (x) {\n domGlobals.setTimeout(function () {\n cb(x);\n }, 0);\n });\n };\n baseFn(set);\n return {\n get: get,\n map: map,\n isReady: isReady\n };\n };\n var pure = function (a) {\n return nu$a(function (callback) {\n callback(a);\n });\n };\n var LazyValue = {\n nu: nu$a,\n pure: pure\n };\n\n var errorReporter = function (err) {\n domGlobals.setTimeout(function () {\n throw err;\n }, 0);\n };\n var make$3 = function (run) {\n var get = function (callback) {\n run().then(callback, errorReporter);\n };\n var map = function (fab) {\n return make$3(function () {\n return run().then(fab);\n });\n };\n var bind = function (aFutureB) {\n return make$3(function () {\n return run().then(function (v) {\n return aFutureB(v).toPromise();\n });\n });\n };\n var anonBind = function (futureB) {\n return make$3(function () {\n return run().then(function () {\n return futureB.toPromise();\n });\n });\n };\n var toLazy = function () {\n return LazyValue.nu(get);\n };\n var toCached = function () {\n var cache = null;\n return make$3(function () {\n if (cache === null) {\n cache = run();\n }\n return cache;\n });\n };\n var toPromise = run;\n return {\n map: map,\n bind: bind,\n anonBind: anonBind,\n toLazy: toLazy,\n toCached: toCached,\n toPromise: toPromise,\n get: get\n };\n };\n var nu$b = function (baseFn) {\n return make$3(function () {\n return new Promise(baseFn);\n });\n };\n var pure$1 = function (a) {\n return make$3(function () {\n return Promise.resolve(a);\n });\n };\n var Future = {\n nu: nu$b,\n pure: pure$1\n };\n\n var ariaElements = [\n 'input',\n 'textarea'\n ];\n var isAriaElement = function (elem) {\n var name$1 = name(elem);\n return contains(ariaElements, name$1);\n };\n var markValid = function (component, invalidConfig) {\n var elem = invalidConfig.getRoot(component).getOr(component.element());\n remove$4(elem, invalidConfig.invalidClass);\n invalidConfig.notify.each(function (notifyInfo) {\n if (isAriaElement(component.element())) {\n set$1(component.element(), 'aria-invalid', false);\n }\n notifyInfo.getContainer(component).each(function (container) {\n set(container, notifyInfo.validHtml);\n });\n notifyInfo.onValid(component);\n });\n };\n var markInvalid = function (component, invalidConfig, invalidState, text) {\n var elem = invalidConfig.getRoot(component).getOr(component.element());\n add$2(elem, invalidConfig.invalidClass);\n invalidConfig.notify.each(function (notifyInfo) {\n if (isAriaElement(component.element())) {\n set$1(component.element(), 'aria-invalid', true);\n }\n notifyInfo.getContainer(component).each(function (container) {\n set(container, text);\n });\n notifyInfo.onInvalid(component, text);\n });\n };\n var query = function (component, invalidConfig, _invalidState) {\n return invalidConfig.validator.fold(function () {\n return Future.pure(Result.value(true));\n }, function (validatorInfo) {\n return validatorInfo.validate(component);\n });\n };\n var run$1 = function (component, invalidConfig, invalidState) {\n invalidConfig.notify.each(function (notifyInfo) {\n notifyInfo.onValidate(component);\n });\n return query(component, invalidConfig).map(function (valid) {\n if (component.getSystem().isConnected()) {\n return valid.fold(function (err) {\n markInvalid(component, invalidConfig, invalidState, err);\n return Result.error(err);\n }, function (v) {\n markValid(component, invalidConfig);\n return Result.value(v);\n });\n } else {\n return Result.error('No longer in system');\n }\n });\n };\n var isInvalid = function (component, invalidConfig) {\n var elem = invalidConfig.getRoot(component).getOr(component.element());\n return has$2(elem, invalidConfig.invalidClass);\n };\n\n var InvalidateApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n markValid: markValid,\n markInvalid: markInvalid,\n query: query,\n run: run$1,\n isInvalid: isInvalid\n });\n\n var events$a = function (invalidConfig, invalidState) {\n return invalidConfig.validator.map(function (validatorInfo) {\n return derive([run(validatorInfo.onEvent, function (component) {\n run$1(component, invalidConfig, invalidState).get(identity);\n })].concat(validatorInfo.validateOnLoad ? [runOnAttached(function (component) {\n run$1(component, invalidConfig, invalidState).get(noop);\n })] : []));\n }).getOr({});\n };\n\n var ActiveInvalidate = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$a\n });\n\n var InvalidateSchema = [\n strict$1('invalidClass'),\n defaulted$1('getRoot', Option.none),\n optionObjOf('notify', [\n defaulted$1('aria', 'alert'),\n defaulted$1('getContainer', Option.none),\n defaulted$1('validHtml', ''),\n onHandler('onValid'),\n onHandler('onInvalid'),\n onHandler('onValidate')\n ]),\n optionObjOf('validator', [\n strict$1('validate'),\n defaulted$1('onEvent', 'input'),\n defaulted$1('validateOnLoad', true)\n ])\n ];\n\n var Invalidating = create$1({\n fields: InvalidateSchema,\n name: 'invalidating',\n active: ActiveInvalidate,\n apis: InvalidateApis,\n extra: {\n validation: function (validator) {\n return function (component) {\n var v = Representing.getValue(component);\n return Future.pure(validator(v));\n };\n }\n }\n });\n\n var getCoupled = function (component, coupleConfig, coupleState, name) {\n return coupleState.getOrCreate(component, coupleConfig, name);\n };\n\n var CouplingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getCoupled: getCoupled\n });\n\n var CouplingSchema = [strictOf('others', setOf$1(Result.value, anyValue$1()))];\n\n var init$5 = function () {\n var coupled = {};\n var getOrCreate = function (component, coupleConfig, name) {\n var available = keys(coupleConfig.others);\n if (!available) {\n throw new Error('Cannot find coupled component: ' + name + '. Known coupled components: ' + JSON.stringify(available, null, 2));\n } else {\n return get(coupled, name).getOrThunk(function () {\n var builder = get(coupleConfig.others, name).getOrDie('No information found for coupled component: ' + name);\n var spec = builder(component);\n var built = component.getSystem().build(spec);\n coupled[name] = built;\n return built;\n });\n }\n };\n var readState = constant({});\n return nu$5({\n readState: readState,\n getOrCreate: getOrCreate\n });\n };\n\n var CouplingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$5\n });\n\n var Coupling = create$1({\n fields: CouplingSchema,\n name: 'coupling',\n apis: CouplingApis,\n state: CouplingState\n });\n\n var suffix = constant('sink');\n var partType = constant(optional({\n name: suffix(),\n overrides: constant({\n dom: { tag: 'div' },\n behaviours: derive$1([Positioning.config({ useFixed: always })]),\n events: derive([\n cutter(keydown()),\n cutter(mousedown()),\n cutter(click())\n ])\n })\n }));\n\n var HighlightOnOpen;\n (function (HighlightOnOpen) {\n HighlightOnOpen[HighlightOnOpen['HighlightFirst'] = 0] = 'HighlightFirst';\n HighlightOnOpen[HighlightOnOpen['HighlightNone'] = 1] = 'HighlightNone';\n }(HighlightOnOpen || (HighlightOnOpen = {})));\n var getAnchor = function (detail, component) {\n var hotspot = detail.getHotspot(component).getOr(component);\n var anchor = 'hotspot';\n var overrides = detail.getAnchorOverrides();\n return detail.layouts.fold(function () {\n return {\n anchor: anchor,\n hotspot: hotspot,\n overrides: overrides\n };\n }, function (layouts) {\n return {\n anchor: anchor,\n hotspot: hotspot,\n overrides: overrides,\n layouts: layouts\n };\n });\n };\n var fetch = function (detail, mapFetch, component) {\n var fetcher = detail.fetch;\n return fetcher(component).map(mapFetch);\n };\n var openF = function (detail, mapFetch, anchor, component, sandbox, externals, highlightOnOpen) {\n var futureData = fetch(detail, mapFetch, component);\n var getLazySink = getSink(component, detail);\n return futureData.map(function (tdata) {\n return tdata.bind(function (data) {\n return Option.from(tieredMenu.sketch(__assign(__assign({}, externals.menu()), {\n uid: generate$2(''),\n data: data,\n highlightImmediately: highlightOnOpen === HighlightOnOpen.HighlightFirst,\n onOpenMenu: function (tmenu, menu) {\n var sink = getLazySink().getOrDie();\n Positioning.position(sink, anchor, menu);\n Sandboxing.decloak(sandbox);\n },\n onOpenSubmenu: function (tmenu, item, submenu) {\n var sink = getLazySink().getOrDie();\n Positioning.position(sink, {\n anchor: 'submenu',\n item: item\n }, submenu);\n Sandboxing.decloak(sandbox);\n },\n onRepositionMenu: function (tmenu, primaryMenu, submenuTriggers) {\n var sink = getLazySink().getOrDie();\n Positioning.position(sink, anchor, primaryMenu);\n each(submenuTriggers, function (st) {\n Positioning.position(sink, {\n anchor: 'submenu',\n item: st.triggeringItem\n }, st.triggeredMenu);\n });\n },\n onEscape: function () {\n Focusing.focus(component);\n Sandboxing.close(sandbox);\n return Option.some(true);\n }\n })));\n });\n });\n };\n var open$1 = function (detail, mapFetch, hotspot, sandbox, externals, onOpenSync, highlightOnOpen) {\n var anchor = getAnchor(detail, hotspot);\n var processed = openF(detail, mapFetch, anchor, hotspot, sandbox, externals, highlightOnOpen);\n return processed.map(function (tdata) {\n tdata.fold(function () {\n if (Sandboxing.isOpen(sandbox)) {\n Sandboxing.close(sandbox);\n }\n }, function (data) {\n Sandboxing.cloak(sandbox);\n Sandboxing.open(sandbox, data);\n onOpenSync(sandbox);\n });\n return sandbox;\n });\n };\n var close$1 = function (detail, mapFetch, component, sandbox, _externals, _onOpenSync, _highlightOnOpen) {\n Sandboxing.close(sandbox);\n return Future.pure(sandbox);\n };\n var togglePopup = function (detail, mapFetch, hotspot, externals, onOpenSync, highlightOnOpen) {\n var sandbox = Coupling.getCoupled(hotspot, 'sandbox');\n var showing = Sandboxing.isOpen(sandbox);\n var action = showing ? close$1 : open$1;\n return action(detail, mapFetch, hotspot, sandbox, externals, onOpenSync, highlightOnOpen);\n };\n var matchWidth = function (hotspot, container, useMinWidth) {\n var menu = Composing.getCurrent(container).getOr(container);\n var buttonWidth = get$7(hotspot.element());\n if (useMinWidth) {\n set$2(menu.element(), 'min-width', buttonWidth + 'px');\n } else {\n set$4(menu.element(), buttonWidth);\n }\n };\n var getSink = function (anyInSystem, sinkDetail) {\n return anyInSystem.getSystem().getByUid(sinkDetail.uid + '-' + suffix()).map(function (internalSink) {\n return function () {\n return Result.value(internalSink);\n };\n }).getOrThunk(function () {\n return sinkDetail.lazySink.fold(function () {\n return function () {\n return Result.error(new Error('No internal sink is specified, nor could an external sink be found'));\n };\n }, function (lazySinkFn) {\n return function () {\n return lazySinkFn(anyInSystem);\n };\n });\n });\n };\n var doRepositionMenus = function (sandbox) {\n Sandboxing.getState(sandbox).each(function (tmenu) {\n tieredMenu.repositionMenus(tmenu);\n });\n };\n var makeSandbox = function (detail, hotspot, extras) {\n var ariaOwner = manager();\n var onOpen = function (component, menu) {\n var anchor = getAnchor(detail, hotspot);\n ariaOwner.link(hotspot.element());\n if (detail.matchWidth) {\n matchWidth(anchor.hotspot, menu, detail.useMinWidth);\n }\n detail.onOpen(anchor, component, menu);\n if (extras !== undefined && extras.onOpen !== undefined) {\n extras.onOpen(component, menu);\n }\n };\n var onClose = function (component, menu) {\n ariaOwner.unlink(hotspot.element());\n if (extras !== undefined && extras.onClose !== undefined) {\n extras.onClose(component, menu);\n }\n };\n var lazySink = getSink(hotspot, detail);\n return {\n dom: {\n tag: 'div',\n classes: detail.sandboxClasses,\n attributes: {\n id: ariaOwner.id,\n role: 'listbox'\n }\n },\n behaviours: SketchBehaviours.augment(detail.sandboxBehaviours, [\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: hotspot\n }\n }),\n Sandboxing.config({\n onOpen: onOpen,\n onClose: onClose,\n isPartOf: function (container, data, queryElem) {\n return isPartOf(data, queryElem) || isPartOf(hotspot, queryElem);\n },\n getAttachPoint: function () {\n return lazySink().getOrDie();\n }\n }),\n Composing.config({\n find: function (sandbox) {\n return Sandboxing.getState(sandbox).bind(function (menu) {\n return Composing.getCurrent(menu);\n });\n }\n }),\n Receiving.config({ channels: __assign(__assign({}, receivingChannel({ isExtraPart: never })), receivingChannel$1({ doReposition: doRepositionMenus })) })\n ])\n };\n };\n var repositionMenus = function (comp) {\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n doRepositionMenus(sandbox);\n };\n\n var sandboxFields = function () {\n return [\n defaulted$1('sandboxClasses', []),\n SketchBehaviours.field('sandboxBehaviours', [\n Composing,\n Receiving,\n Sandboxing,\n Representing\n ])\n ];\n };\n\n var schema$g = constant([\n strict$1('dom'),\n strict$1('fetch'),\n onHandler('onOpen'),\n onKeyboardHandler('onExecute'),\n defaulted$1('getHotspot', Option.some),\n defaulted$1('getAnchorOverrides', constant({})),\n schema$1(),\n field$1('dropdownBehaviours', [\n Toggling,\n Coupling,\n Keying,\n Focusing\n ]),\n strict$1('toggleClass'),\n defaulted$1('eventOrder', {}),\n option('lazySink'),\n defaulted$1('matchWidth', false),\n defaulted$1('useMinWidth', false),\n option('role')\n ].concat(sandboxFields()));\n var parts$4 = constant([\n external$1({\n schema: [tieredMenuMarkers()],\n name: 'menu',\n defaults: function (detail) {\n return { onExecute: detail.onExecute };\n }\n }),\n partType()\n ]);\n\n var factory$6 = function (detail, components, _spec, externals) {\n var _a;\n var lookupAttr = function (attr) {\n return get(detail.dom, 'attributes').bind(function (attrs) {\n return get(attrs, attr);\n });\n };\n var switchToMenu = function (sandbox) {\n Sandboxing.getState(sandbox).each(function (tmenu) {\n tieredMenu.highlightPrimary(tmenu);\n });\n };\n var action = function (component) {\n var onOpenSync = switchToMenu;\n togglePopup(detail, function (x) {\n return x;\n }, component, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop);\n };\n var apis = {\n expand: function (comp) {\n if (!Toggling.isOn(comp)) {\n togglePopup(detail, function (x) {\n return x;\n }, comp, externals, noop, HighlightOnOpen.HighlightNone).get(noop);\n }\n },\n open: function (comp) {\n if (!Toggling.isOn(comp)) {\n togglePopup(detail, function (x) {\n return x;\n }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop);\n }\n },\n isOpen: Toggling.isOn,\n close: function (comp) {\n if (Toggling.isOn(comp)) {\n togglePopup(detail, function (x) {\n return x;\n }, comp, externals, noop, HighlightOnOpen.HighlightFirst).get(noop);\n }\n },\n repositionMenus: function (comp) {\n if (Toggling.isOn(comp)) {\n repositionMenus(comp);\n }\n }\n };\n var triggerExecute = function (comp, _se) {\n emitExecute(comp);\n return Option.some(true);\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.dropdownBehaviours, [\n Toggling.config({\n toggleClass: detail.toggleClass,\n aria: { mode: 'expanded' }\n }),\n Coupling.config({\n others: {\n sandbox: function (hotspot) {\n return makeSandbox(detail, hotspot, {\n onOpen: function () {\n Toggling.on(hotspot);\n },\n onClose: function () {\n Toggling.off(hotspot);\n }\n });\n }\n }\n }),\n Keying.config({\n mode: 'special',\n onSpace: triggerExecute,\n onEnter: triggerExecute,\n onDown: function (comp, _se) {\n if (Dropdown.isOpen(comp)) {\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n switchToMenu(sandbox);\n } else {\n Dropdown.open(comp);\n }\n return Option.some(true);\n },\n onEscape: function (comp, _se) {\n if (Dropdown.isOpen(comp)) {\n Dropdown.close(comp);\n return Option.some(true);\n } else {\n return Option.none();\n }\n }\n }),\n Focusing.config({})\n ]),\n events: events$7(Option.some(action)),\n eventOrder: __assign(__assign({}, detail.eventOrder), (_a = {}, _a[execute()] = [\n 'disabling',\n 'toggling',\n 'alloy.base.behaviour'\n ], _a)),\n apis: apis,\n domModification: {\n attributes: __assign(__assign({ 'aria-haspopup': 'true' }, detail.role.fold(function () {\n return {};\n }, function (role) {\n return { role: role };\n })), detail.dom.tag === 'button' ? { type: lookupAttr('type').getOr('button') } : {})\n }\n };\n };\n var Dropdown = composite$1({\n name: 'Dropdown',\n configFields: schema$g(),\n partFields: parts$4(),\n factory: factory$6,\n apis: {\n open: function (apis, comp) {\n return apis.open(comp);\n },\n expand: function (apis, comp) {\n return apis.expand(comp);\n },\n close: function (apis, comp) {\n return apis.close(comp);\n },\n isOpen: function (apis, comp) {\n return apis.isOpen(comp);\n },\n repositionMenus: function (apis, comp) {\n return apis.repositionMenus(comp);\n }\n }\n });\n\n var exhibit$5 = function () {\n return nu$6({\n styles: {\n '-webkit-user-select': 'none',\n 'user-select': 'none',\n '-ms-user-select': 'none',\n '-moz-user-select': '-moz-none'\n },\n attributes: { unselectable: 'on' }\n });\n };\n var events$b = function () {\n return derive([abort(selectstart(), constant(true))]);\n };\n\n var ActiveUnselecting = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$b,\n exhibit: exhibit$5\n });\n\n var Unselecting = create$1({\n fields: [],\n name: 'unselecting',\n active: ActiveUnselecting\n });\n\n var renderPanelButton = function (spec, sharedBackstage) {\n return Dropdown.sketch({\n dom: spec.dom,\n components: spec.components,\n toggleClass: 'mce-active',\n dropdownBehaviours: derive$1([\n DisablingConfigs.button(sharedBackstage.providers.isReadOnly),\n receivingConfig(),\n Unselecting.config({}),\n Tabstopping.config({})\n ]),\n layouts: spec.layouts,\n sandboxClasses: ['tox-dialog__popups'],\n lazySink: sharedBackstage.getSink,\n fetch: function (comp) {\n return Future.nu(function (callback) {\n return spec.fetch(callback);\n }).map(function (items) {\n return Option.from(createTieredDataFrom(deepMerge(createPartialChoiceMenu(generate$1('menu-value'), items, function (value) {\n spec.onItemAction(comp, value);\n }, spec.columns, spec.presets, ItemResponse$1.CLOSE_ON_EXECUTE, function () {\n return false;\n }, sharedBackstage.providers), { movement: deriveMenuMovement(spec.columns, spec.presets) })));\n });\n },\n parts: { menu: part(false, 1, spec.presets) }\n });\n };\n\n var colorInputChangeEvent = generate$1('color-input-change');\n var colorSwatchChangeEvent = generate$1('color-swatch-change');\n var colorPickerCancelEvent = generate$1('color-picker-cancel');\n var renderColorInput = function (spec, sharedBackstage, colorInputBackstage) {\n var pField = FormField.parts().field({\n factory: Input,\n inputClasses: ['tox-textfield'],\n onSetValue: function (c) {\n return Invalidating.run(c).get(function () {\n });\n },\n inputBehaviours: derive$1([\n Disabling.config({ disabled: sharedBackstage.providers.isReadOnly }),\n receivingConfig(),\n Tabstopping.config({}),\n Invalidating.config({\n invalidClass: 'tox-textbox-field-invalid',\n getRoot: function (comp) {\n return parent(comp.element());\n },\n notify: {\n onValid: function (comp) {\n var val = Representing.getValue(comp);\n emitWith(comp, colorInputChangeEvent, { color: val });\n }\n },\n validator: {\n validateOnLoad: false,\n validate: function (input) {\n var inputValue = Representing.getValue(input);\n if (inputValue.length === 0) {\n return Future.pure(Result.value(true));\n } else {\n var span = Element.fromTag('span');\n set$2(span, 'background-color', inputValue);\n var res = getRaw(span, 'background-color').fold(function () {\n return Result.error('blah');\n }, function (_) {\n return Result.value(inputValue);\n });\n return Future.pure(res);\n }\n }\n }\n })\n ]),\n selectOnFocus: false\n });\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, sharedBackstage.providers);\n });\n var emitSwatchChange = function (colorBit, value) {\n emitWith(colorBit, colorSwatchChangeEvent, { value: value });\n };\n var onItemAction = function (comp, value) {\n memColorButton.getOpt(comp).each(function (colorBit) {\n if (value === 'custom') {\n colorInputBackstage.colorPicker(function (valueOpt) {\n valueOpt.fold(function () {\n return emit(colorBit, colorPickerCancelEvent);\n }, function (value) {\n emitSwatchChange(colorBit, value);\n addColor(value);\n });\n }, '#ffffff');\n } else if (value === 'remove') {\n emitSwatchChange(colorBit, '');\n } else {\n emitSwatchChange(colorBit, value);\n }\n });\n };\n var memColorButton = record(renderPanelButton({\n dom: {\n tag: 'span',\n attributes: { 'aria-label': sharedBackstage.providers.translate('Color swatch') }\n },\n layouts: {\n onRtl: function () {\n return [\n southwest$1,\n southeast$1,\n south$1\n ];\n },\n onLtr: function () {\n return [\n southeast$1,\n southwest$1,\n south$1\n ];\n }\n },\n components: [],\n fetch: getFetch(colorInputBackstage.getColors(), colorInputBackstage.hasCustomColors()),\n columns: colorInputBackstage.getColorCols(),\n presets: 'color',\n onItemAction: onItemAction\n }, sharedBackstage));\n return FormField.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-form__group']\n },\n components: pLabel.toArray().concat([{\n dom: {\n tag: 'div',\n classes: ['tox-color-input']\n },\n components: [\n pField,\n memColorButton.asSpec()\n ]\n }]),\n fieldBehaviours: derive$1([config('form-field-events', [\n run(colorInputChangeEvent, function (comp, se) {\n memColorButton.getOpt(comp).each(function (colorButton) {\n set$2(colorButton.element(), 'background-color', se.event().color());\n });\n emitWith(comp, formChangeEvent, { name: spec.name });\n }),\n run(colorSwatchChangeEvent, function (comp, se) {\n FormField.getField(comp).each(function (field) {\n Representing.setValue(field, se.event().value());\n Composing.getCurrent(comp).each(Focusing.focus);\n });\n }),\n run(colorPickerCancelEvent, function (comp, _se) {\n FormField.getField(comp).each(function (_field) {\n Composing.getCurrent(comp).each(Focusing.focus);\n });\n })\n ])])\n });\n };\n\n var hsvColour = function (hue, saturation, value) {\n return {\n hue: hue,\n saturation: saturation,\n value: value\n };\n };\n var fromRgb = function (rgbaColour) {\n var h = 0;\n var s = 0;\n var v = 0;\n var r = rgbaColour.red / 255;\n var g = rgbaColour.green / 255;\n var b = rgbaColour.blue / 255;\n var minRGB = Math.min(r, Math.min(g, b));\n var maxRGB = Math.max(r, Math.max(g, b));\n if (minRGB === maxRGB) {\n v = minRGB;\n return hsvColour(0, 0, v * 100);\n }\n var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r;\n h = r === minRGB ? 3 : b === minRGB ? 1 : 5;\n h = 60 * (h - d / (maxRGB - minRGB));\n s = (maxRGB - minRGB) / maxRGB;\n v = maxRGB;\n return hsvColour(Math.round(h), Math.round(s * 100), Math.round(v * 100));\n };\n\n var calcHex = function (value) {\n var hue = (100 - value) / 100 * 360;\n var hsv = hsvColour(hue, 100, 100);\n var rgb = fromHsv(hsv);\n return fromRgba(rgb);\n };\n\n var fieldsUpdate = generate$1('rgb-hex-update');\n var sliderUpdate = generate$1('slider-update');\n var paletteUpdate = generate$1('palette-update');\n\n var labelPart = optional({\n schema: [strict$1('dom')],\n name: 'label'\n });\n var edgePart = function (name) {\n return optional({\n name: '' + name + '-edge',\n overrides: function (detail) {\n var action = detail.model.manager.edgeActions[name];\n return action.fold(function () {\n return {};\n }, function (a) {\n return {\n events: derive([\n runActionExtra(touchstart(), function (comp, se, d) {\n return a(comp, d);\n }, [detail]),\n runActionExtra(mousedown(), function (comp, se, d) {\n return a(comp, d);\n }, [detail]),\n runActionExtra(mousemove(), function (comp, se, det) {\n if (det.mouseIsDown.get()) {\n a(comp, det);\n }\n }, [detail])\n ])\n };\n });\n }\n });\n };\n var tlEdgePart = edgePart('top-left');\n var tedgePart = edgePart('top');\n var trEdgePart = edgePart('top-right');\n var redgePart = edgePart('right');\n var brEdgePart = edgePart('bottom-right');\n var bedgePart = edgePart('bottom');\n var blEdgePart = edgePart('bottom-left');\n var ledgePart = edgePart('left');\n var thumbPart = required({\n name: 'thumb',\n defaults: constant({ dom: { styles: { position: 'absolute' } } }),\n overrides: function (detail) {\n return {\n events: derive([\n redirectToPart(touchstart(), detail, 'spectrum'),\n redirectToPart(touchmove(), detail, 'spectrum'),\n redirectToPart(touchend(), detail, 'spectrum'),\n redirectToPart(mousedown(), detail, 'spectrum'),\n redirectToPart(mousemove(), detail, 'spectrum'),\n redirectToPart(mouseup(), detail, 'spectrum')\n ])\n };\n }\n });\n var spectrumPart = required({\n schema: [state$1('mouseIsDown', function () {\n return Cell(false);\n })],\n name: 'spectrum',\n overrides: function (detail) {\n var modelDetail = detail.model;\n var model = modelDetail.manager;\n var setValueFrom = function (component, simulatedEvent) {\n return model.getValueFromEvent(simulatedEvent).map(function (value) {\n return model.setValueFrom(component, detail, value);\n });\n };\n return {\n behaviours: derive$1([\n Keying.config({\n mode: 'special',\n onLeft: function (spectrum) {\n return model.onLeft(spectrum, detail);\n },\n onRight: function (spectrum) {\n return model.onRight(spectrum, detail);\n },\n onUp: function (spectrum) {\n return model.onUp(spectrum, detail);\n },\n onDown: function (spectrum) {\n return model.onDown(spectrum, detail);\n }\n }),\n Focusing.config({})\n ]),\n events: derive([\n run(touchstart(), setValueFrom),\n run(touchmove(), setValueFrom),\n run(mousedown(), setValueFrom),\n run(mousemove(), function (spectrum, se) {\n if (detail.mouseIsDown.get()) {\n setValueFrom(spectrum, se);\n }\n })\n ])\n };\n }\n });\n var SliderParts = [\n labelPart,\n ledgePart,\n redgePart,\n tedgePart,\n bedgePart,\n tlEdgePart,\n trEdgePart,\n blEdgePart,\n brEdgePart,\n thumbPart,\n spectrumPart\n ];\n\n var _sliderChangeEvent = 'slider.change.value';\n var sliderChangeEvent = constant(_sliderChangeEvent);\n var isTouchEvent = function (evt) {\n return evt.type.indexOf('touch') !== -1;\n };\n var getEventSource = function (simulatedEvent) {\n var evt = simulatedEvent.event().raw();\n if (isTouchEvent(evt)) {\n var touchEvent = evt;\n return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Option.some(touchEvent.touches[0]).map(function (t) {\n return Position(t.clientX, t.clientY);\n }) : Option.none();\n } else {\n var mouseEvent = evt;\n return mouseEvent.clientX !== undefined ? Option.some(mouseEvent).map(function (me) {\n return Position(me.clientX, me.clientY);\n }) : Option.none();\n }\n };\n\n var t = 'top', r$1 = 'right', b = 'bottom', l = 'left';\n var minX = function (detail) {\n return detail.model.minX;\n };\n var minY = function (detail) {\n return detail.model.minY;\n };\n var min1X = function (detail) {\n return detail.model.minX - 1;\n };\n var min1Y = function (detail) {\n return detail.model.minY - 1;\n };\n var maxX = function (detail) {\n return detail.model.maxX;\n };\n var maxY = function (detail) {\n return detail.model.maxY;\n };\n var max1X = function (detail) {\n return detail.model.maxX + 1;\n };\n var max1Y = function (detail) {\n return detail.model.maxY + 1;\n };\n var range$2 = function (detail, max, min) {\n return max(detail) - min(detail);\n };\n var xRange = function (detail) {\n return range$2(detail, maxX, minX);\n };\n var yRange = function (detail) {\n return range$2(detail, maxY, minY);\n };\n var halfX = function (detail) {\n return xRange(detail) / 2;\n };\n var halfY = function (detail) {\n return yRange(detail) / 2;\n };\n var step = function (detail) {\n return detail.stepSize;\n };\n var snap = function (detail) {\n return detail.snapToGrid;\n };\n var snapStart = function (detail) {\n return detail.snapStart;\n };\n var rounded = function (detail) {\n return detail.rounded;\n };\n var hasEdge = function (detail, edgeName) {\n return detail[edgeName + '-edge'] !== undefined;\n };\n var hasLEdge = function (detail) {\n return hasEdge(detail, l);\n };\n var hasREdge = function (detail) {\n return hasEdge(detail, r$1);\n };\n var hasTEdge = function (detail) {\n return hasEdge(detail, t);\n };\n var hasBEdge = function (detail) {\n return hasEdge(detail, b);\n };\n var currentValue = function (detail) {\n return detail.model.value.get();\n };\n\n var xValue = function (x) {\n return { x: constant(x) };\n };\n var yValue = function (y) {\n return { y: constant(y) };\n };\n var xyValue = function (x, y) {\n return {\n x: constant(x),\n y: constant(y)\n };\n };\n var fireSliderChange = function (component, value) {\n emitWith(component, sliderChangeEvent(), { value: value });\n };\n var setToTLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail)));\n };\n var setToTEdge = function (edge, detail) {\n fireSliderChange(edge, yValue(min1Y(detail)));\n };\n var setToTEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail)));\n };\n var setToTREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail)));\n };\n var setToREdge = function (edge, detail) {\n fireSliderChange(edge, xValue(max1X(detail)));\n };\n var setToREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), halfY(detail)));\n };\n var setToBREdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail)));\n };\n var setToBEdge = function (edge, detail) {\n fireSliderChange(edge, yValue(max1Y(detail)));\n };\n var setToBEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail)));\n };\n var setToBLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail)));\n };\n var setToLEdge = function (edge, detail) {\n fireSliderChange(edge, xValue(min1X(detail)));\n };\n var setToLEdgeXY = function (edge, detail) {\n fireSliderChange(edge, xyValue(min1X(detail), halfY(detail)));\n };\n\n var reduceBy = function (value, min, max, step) {\n if (value < min) {\n return value;\n } else if (value > max) {\n return max;\n } else if (value === min) {\n return min - 1;\n } else {\n return Math.max(min, value - step);\n }\n };\n var increaseBy = function (value, min, max, step) {\n if (value > max) {\n return value;\n } else if (value < min) {\n return min;\n } else if (value === max) {\n return max + 1;\n } else {\n return Math.min(max, value + step);\n }\n };\n var capValue = function (value, min, max) {\n return Math.max(min, Math.min(max, value));\n };\n var snapValueOf = function (value, min, max, step, snapStart) {\n return snapStart.fold(function () {\n var initValue = value - min;\n var extraValue = Math.round(initValue / step) * step;\n return capValue(min + extraValue, min - 1, max + 1);\n }, function (start) {\n var remainder = (value - start) % step;\n var adjustment = Math.round(remainder / step);\n var rawSteps = Math.floor((value - start) / step);\n var maxSteps = Math.floor((max - start) / step);\n var numSteps = Math.min(maxSteps, rawSteps + adjustment);\n var r = start + numSteps * step;\n return Math.max(start, r);\n });\n };\n var findOffsetOf = function (value, min, max) {\n return Math.min(max, Math.max(value, min)) - min;\n };\n var findValueOf = function (args) {\n var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange;\n var capMin = hasMinEdge ? min - 1 : min;\n var capMax = hasMaxEdge ? max + 1 : max;\n if (value < minBound) {\n return capMin;\n } else if (value > maxBound) {\n return capMax;\n } else {\n var offset = findOffsetOf(value, minBound, maxBound);\n var newValue = capValue(offset / screenRange * range + min, capMin, capMax);\n if (snap && newValue >= min && newValue <= max) {\n return snapValueOf(newValue, min, max, step, snapStart);\n } else if (rounded) {\n return Math.round(newValue);\n } else {\n return newValue;\n }\n }\n };\n var findOffsetOfValue = function (args) {\n var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge;\n if (value < min) {\n return hasMinEdge ? 0 : centerMinEdge;\n } else if (value > max) {\n return hasMaxEdge ? maxBound : centerMaxEdge;\n } else {\n return (value - min) / range * maxOffset;\n }\n };\n\n var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height';\n var getBounds$1 = function (component) {\n return component.element().dom().getBoundingClientRect();\n };\n var getBoundsProperty = function (bounds, property) {\n return bounds[property];\n };\n var getMinXBounds = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, left);\n };\n var getMaxXBounds = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, right);\n };\n var getMinYBounds = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, top);\n };\n var getMaxYBounds = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, bottom);\n };\n var getXScreenRange = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, width);\n };\n var getYScreenRange = function (component) {\n var bounds = getBounds$1(component);\n return getBoundsProperty(bounds, height);\n };\n var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) {\n return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge;\n };\n var getXCenterOffSetOf = function (component, spectrum) {\n var componentBounds = getBounds$1(component);\n var spectrumBounds = getBounds$1(spectrum);\n var componentMinEdge = getBoundsProperty(componentBounds, left);\n var componentMaxEdge = getBoundsProperty(componentBounds, right);\n var spectrumMinEdge = getBoundsProperty(spectrumBounds, left);\n return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);\n };\n var getYCenterOffSetOf = function (component, spectrum) {\n var componentBounds = getBounds$1(component);\n var spectrumBounds = getBounds$1(spectrum);\n var componentMinEdge = getBoundsProperty(componentBounds, top);\n var componentMaxEdge = getBoundsProperty(componentBounds, bottom);\n var spectrumMinEdge = getBoundsProperty(spectrumBounds, top);\n return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);\n };\n\n var fireSliderChange$1 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue = function (x) {\n return { x: constant(x) };\n };\n var findValueOfOffset = function (spectrum, detail, left) {\n var args = {\n min: minX(detail),\n max: maxX(detail),\n range: xRange(detail),\n value: left,\n step: step(detail),\n snap: snap(detail),\n snapStart: snapStart(detail),\n rounded: rounded(detail),\n hasMinEdge: hasLEdge(detail),\n hasMaxEdge: hasREdge(detail),\n minBound: getMinXBounds(spectrum),\n maxBound: getMaxXBounds(spectrum),\n screenRange: getXScreenRange(spectrum)\n };\n return findValueOf(args);\n };\n var setValueFrom = function (spectrum, detail, value) {\n var xValue = findValueOfOffset(spectrum, detail, value);\n var sliderVal = sliderValue(xValue);\n fireSliderChange$1(spectrum, sliderVal);\n return xValue;\n };\n var setToMin = function (spectrum, detail) {\n var min = minX(detail);\n fireSliderChange$1(spectrum, sliderValue(min));\n };\n var setToMax = function (spectrum, detail) {\n var max = maxX(detail);\n fireSliderChange$1(spectrum, sliderValue(max));\n };\n var moveBy = function (direction, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var xValue = f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail));\n fireSliderChange$1(spectrum, sliderValue(xValue));\n return Option.some(xValue);\n };\n var handleMovement = function (direction) {\n return function (spectrum, detail) {\n return moveBy(direction, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var getValueFromEvent = function (simulatedEvent) {\n var pos = getEventSource(simulatedEvent);\n return pos.map(function (p) {\n return p.left();\n });\n };\n var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) {\n var minOffset = 0;\n var maxOffset = getXScreenRange(spectrum);\n var centerMinEdge = minEdge.bind(function (edge) {\n return Option.some(getXCenterOffSetOf(edge, spectrum));\n }).getOr(minOffset);\n var centerMaxEdge = maxEdge.bind(function (edge) {\n return Option.some(getXCenterOffSetOf(edge, spectrum));\n }).getOr(maxOffset);\n var args = {\n min: minX(detail),\n max: maxX(detail),\n range: xRange(detail),\n value: value,\n hasMinEdge: hasLEdge(detail),\n hasMaxEdge: hasREdge(detail),\n minBound: getMinXBounds(spectrum),\n minOffset: minOffset,\n maxBound: getMaxXBounds(spectrum),\n maxOffset: maxOffset,\n centerMinEdge: centerMinEdge,\n centerMaxEdge: centerMaxEdge\n };\n return findOffsetOfValue(args);\n };\n var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) {\n var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge);\n return getMinXBounds(spectrum) - getMinXBounds(slider) + offset;\n };\n var setPositionFromValue = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail);\n var thumbRadius = get$7(thumb.element()) / 2;\n set$2(thumb.element(), 'left', pos - thumbRadius + 'px');\n };\n var onLeft = handleMovement(-1);\n var onRight = handleMovement(1);\n var onUp = Option.none;\n var onDown = Option.none;\n var edgeActions = {\n 'top-left': Option.none(),\n 'top': Option.none(),\n 'top-right': Option.none(),\n 'right': Option.some(setToREdge),\n 'bottom-right': Option.none(),\n 'bottom': Option.none(),\n 'bottom-left': Option.none(),\n 'left': Option.some(setToLEdge)\n };\n\n var HorizontalModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom,\n setToMin: setToMin,\n setToMax: setToMax,\n findValueOfOffset: findValueOfOffset,\n getValueFromEvent: getValueFromEvent,\n findPositionOfValue: findPositionOfValue,\n setPositionFromValue: setPositionFromValue,\n onLeft: onLeft,\n onRight: onRight,\n onUp: onUp,\n onDown: onDown,\n edgeActions: edgeActions\n });\n\n var fireSliderChange$2 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue$1 = function (y) {\n return { y: constant(y) };\n };\n var findValueOfOffset$1 = function (spectrum, detail, top) {\n var args = {\n min: minY(detail),\n max: maxY(detail),\n range: yRange(detail),\n value: top,\n step: step(detail),\n snap: snap(detail),\n snapStart: snapStart(detail),\n rounded: rounded(detail),\n hasMinEdge: hasTEdge(detail),\n hasMaxEdge: hasBEdge(detail),\n minBound: getMinYBounds(spectrum),\n maxBound: getMaxYBounds(spectrum),\n screenRange: getYScreenRange(spectrum)\n };\n return findValueOf(args);\n };\n var setValueFrom$1 = function (spectrum, detail, value) {\n var yValue = findValueOfOffset$1(spectrum, detail, value);\n var sliderVal = sliderValue$1(yValue);\n fireSliderChange$2(spectrum, sliderVal);\n return yValue;\n };\n var setToMin$1 = function (spectrum, detail) {\n var min = minY(detail);\n fireSliderChange$2(spectrum, sliderValue$1(min));\n };\n var setToMax$1 = function (spectrum, detail) {\n var max = maxY(detail);\n fireSliderChange$2(spectrum, sliderValue$1(max));\n };\n var moveBy$1 = function (direction, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var yValue = f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail));\n fireSliderChange$2(spectrum, sliderValue$1(yValue));\n return Option.some(yValue);\n };\n var handleMovement$1 = function (direction) {\n return function (spectrum, detail) {\n return moveBy$1(direction, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var getValueFromEvent$1 = function (simulatedEvent) {\n var pos = getEventSource(simulatedEvent);\n return pos.map(function (p) {\n return p.top();\n });\n };\n var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) {\n var minOffset = 0;\n var maxOffset = getYScreenRange(spectrum);\n var centerMinEdge = minEdge.bind(function (edge) {\n return Option.some(getYCenterOffSetOf(edge, spectrum));\n }).getOr(minOffset);\n var centerMaxEdge = maxEdge.bind(function (edge) {\n return Option.some(getYCenterOffSetOf(edge, spectrum));\n }).getOr(maxOffset);\n var args = {\n min: minY(detail),\n max: maxY(detail),\n range: yRange(detail),\n value: value,\n hasMinEdge: hasTEdge(detail),\n hasMaxEdge: hasBEdge(detail),\n minBound: getMinYBounds(spectrum),\n minOffset: minOffset,\n maxBound: getMaxYBounds(spectrum),\n maxOffset: maxOffset,\n centerMinEdge: centerMinEdge,\n centerMaxEdge: centerMaxEdge\n };\n return findOffsetOfValue(args);\n };\n var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) {\n var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge);\n return getMinYBounds(spectrum) - getMinYBounds(slider) + offset;\n };\n var setPositionFromValue$1 = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail);\n var thumbRadius = get$6(thumb.element()) / 2;\n set$2(thumb.element(), 'top', pos - thumbRadius + 'px');\n };\n var onLeft$1 = Option.none;\n var onRight$1 = Option.none;\n var onUp$1 = handleMovement$1(-1);\n var onDown$1 = handleMovement$1(1);\n var edgeActions$1 = {\n 'top-left': Option.none(),\n 'top': Option.some(setToTEdge),\n 'top-right': Option.none(),\n 'right': Option.none(),\n 'bottom-right': Option.none(),\n 'bottom': Option.some(setToBEdge),\n 'bottom-left': Option.none(),\n 'left': Option.none()\n };\n\n var VerticalModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom$1,\n setToMin: setToMin$1,\n setToMax: setToMax$1,\n findValueOfOffset: findValueOfOffset$1,\n getValueFromEvent: getValueFromEvent$1,\n findPositionOfValue: findPositionOfValue$1,\n setPositionFromValue: setPositionFromValue$1,\n onLeft: onLeft$1,\n onRight: onRight$1,\n onUp: onUp$1,\n onDown: onDown$1,\n edgeActions: edgeActions$1\n });\n\n var fireSliderChange$3 = function (spectrum, value) {\n emitWith(spectrum, sliderChangeEvent(), { value: value });\n };\n var sliderValue$2 = function (x, y) {\n return {\n x: constant(x),\n y: constant(y)\n };\n };\n var setValueFrom$2 = function (spectrum, detail, value) {\n var xValue = findValueOfOffset(spectrum, detail, value.left());\n var yValue = findValueOfOffset$1(spectrum, detail, value.top());\n var val = sliderValue$2(xValue, yValue);\n fireSliderChange$3(spectrum, val);\n return val;\n };\n var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) {\n var f = direction > 0 ? increaseBy : reduceBy;\n var xValue = isVerticalMovement ? currentValue(detail).x() : f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail));\n var yValue = !isVerticalMovement ? currentValue(detail).y() : f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail));\n fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue));\n return Option.some(xValue);\n };\n var handleMovement$2 = function (direction, isVerticalMovement) {\n return function (spectrum, detail) {\n return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () {\n return true;\n });\n };\n };\n var setToMin$2 = function (spectrum, detail) {\n var mX = minX(detail);\n var mY = minY(detail);\n fireSliderChange$3(spectrum, sliderValue$2(mX, mY));\n };\n var setToMax$2 = function (spectrum, detail) {\n var mX = maxX(detail);\n var mY = maxY(detail);\n fireSliderChange$3(spectrum, sliderValue$2(mX, mY));\n };\n var getValueFromEvent$2 = function (simulatedEvent) {\n return getEventSource(simulatedEvent);\n };\n var setPositionFromValue$2 = function (slider, thumb, detail, edges) {\n var value = currentValue(detail);\n var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail);\n var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail);\n var thumbXRadius = get$7(thumb.element()) / 2;\n var thumbYRadius = get$6(thumb.element()) / 2;\n set$2(thumb.element(), 'left', xPos - thumbXRadius + 'px');\n set$2(thumb.element(), 'top', yPos - thumbYRadius + 'px');\n };\n var onLeft$2 = handleMovement$2(-1, false);\n var onRight$2 = handleMovement$2(1, false);\n var onUp$2 = handleMovement$2(-1, true);\n var onDown$2 = handleMovement$2(1, true);\n var edgeActions$2 = {\n 'top-left': Option.some(setToTLEdgeXY),\n 'top': Option.some(setToTEdgeXY),\n 'top-right': Option.some(setToTREdgeXY),\n 'right': Option.some(setToREdgeXY),\n 'bottom-right': Option.some(setToBREdgeXY),\n 'bottom': Option.some(setToBEdgeXY),\n 'bottom-left': Option.some(setToBLEdgeXY),\n 'left': Option.some(setToLEdgeXY)\n };\n\n var TwoDModel = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setValueFrom: setValueFrom$2,\n setToMin: setToMin$2,\n setToMax: setToMax$2,\n getValueFromEvent: getValueFromEvent$2,\n setPositionFromValue: setPositionFromValue$2,\n onLeft: onLeft$2,\n onRight: onRight$2,\n onUp: onUp$2,\n onDown: onDown$2,\n edgeActions: edgeActions$2\n });\n\n var SliderSchema = [\n defaulted$1('stepSize', 1),\n defaulted$1('onChange', noop),\n defaulted$1('onChoose', noop),\n defaulted$1('onInit', noop),\n defaulted$1('onDragStart', noop),\n defaulted$1('onDragEnd', noop),\n defaulted$1('snapToGrid', false),\n defaulted$1('rounded', true),\n option('snapStart'),\n strictOf('model', choose$1('mode', {\n x: [\n defaulted$1('minX', 0),\n defaulted$1('maxX', 100),\n state$1('value', function (spec) {\n return Cell(spec.mode.minX);\n }),\n strict$1('getInitialValue'),\n output('manager', HorizontalModel)\n ],\n y: [\n defaulted$1('minY', 0),\n defaulted$1('maxY', 100),\n state$1('value', function (spec) {\n return Cell(spec.mode.minY);\n }),\n strict$1('getInitialValue'),\n output('manager', VerticalModel)\n ],\n xy: [\n defaulted$1('minX', 0),\n defaulted$1('maxX', 100),\n defaulted$1('minY', 0),\n defaulted$1('maxY', 100),\n state$1('value', function (spec) {\n return Cell({\n x: constant(spec.mode.minX),\n y: constant(spec.mode.minY)\n });\n }),\n strict$1('getInitialValue'),\n output('manager', TwoDModel)\n ]\n })),\n field$1('sliderBehaviours', [\n Keying,\n Representing\n ]),\n state$1('mouseIsDown', function () {\n return Cell(false);\n })\n ];\n\n var sketch = function (detail, components, _spec, _externals) {\n var _a;\n var getThumb = function (component) {\n return getPartOrDie(component, detail, 'thumb');\n };\n var getSpectrum = function (component) {\n return getPartOrDie(component, detail, 'spectrum');\n };\n var getLeftEdge = function (component) {\n return getPart(component, detail, 'left-edge');\n };\n var getRightEdge = function (component) {\n return getPart(component, detail, 'right-edge');\n };\n var getTopEdge = function (component) {\n return getPart(component, detail, 'top-edge');\n };\n var getBottomEdge = function (component) {\n return getPart(component, detail, 'bottom-edge');\n };\n var modelDetail = detail.model;\n var model = modelDetail.manager;\n var refresh = function (slider, thumb) {\n model.setPositionFromValue(slider, thumb, detail, {\n getLeftEdge: getLeftEdge,\n getRightEdge: getRightEdge,\n getTopEdge: getTopEdge,\n getBottomEdge: getBottomEdge,\n getSpectrum: getSpectrum\n });\n };\n var changeValue = function (slider, newValue) {\n modelDetail.value.set(newValue);\n var thumb = getThumb(slider);\n refresh(slider, thumb);\n detail.onChange(slider, thumb, newValue);\n return Option.some(true);\n };\n var resetToMin = function (slider) {\n model.setToMin(slider, detail);\n };\n var resetToMax = function (slider) {\n model.setToMax(slider, detail);\n };\n var choose = function (slider) {\n var fireOnChoose = function () {\n getPart(slider, detail, 'thumb').each(function (thumb) {\n var value = modelDetail.value.get();\n detail.onChoose(slider, thumb, value);\n });\n };\n var wasDown = detail.mouseIsDown.get();\n detail.mouseIsDown.set(false);\n if (wasDown) {\n fireOnChoose();\n }\n };\n var onDragStart = function (slider, simulatedEvent) {\n simulatedEvent.stop();\n detail.mouseIsDown.set(true);\n detail.onDragStart(slider, getThumb(slider));\n };\n var onDragEnd = function (slider, simulatedEvent) {\n simulatedEvent.stop();\n detail.onDragEnd(slider, getThumb(slider));\n choose(slider);\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.sliderBehaviours, [\n Keying.config({\n mode: 'special',\n focusIn: function (slider) {\n return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(constant(true));\n }\n }),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (_) {\n return modelDetail.value.get();\n }\n }\n }),\n Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) })\n ]),\n events: derive([\n run(sliderChangeEvent(), function (slider, simulatedEvent) {\n changeValue(slider, simulatedEvent.event().value());\n }),\n runOnAttached(function (slider, _simulatedEvent) {\n var getInitial = modelDetail.getInitialValue();\n modelDetail.value.set(getInitial);\n var thumb = getThumb(slider);\n refresh(slider, thumb);\n var spectrum = getSpectrum(slider);\n detail.onInit(slider, thumb, spectrum, modelDetail.value.get());\n }),\n run(touchstart(), onDragStart),\n run(touchend(), onDragEnd),\n run(mousedown(), onDragStart),\n run(mouseup(), onDragEnd)\n ]),\n apis: {\n resetToMin: resetToMin,\n resetToMax: resetToMax,\n changeValue: changeValue,\n refresh: refresh\n },\n domModification: { styles: { position: 'relative' } }\n };\n };\n\n var Slider = composite$1({\n name: 'Slider',\n configFields: SliderSchema,\n partFields: SliderParts,\n factory: sketch,\n apis: {\n resetToMin: function (apis, slider) {\n apis.resetToMin(slider);\n },\n resetToMax: function (apis, slider) {\n apis.resetToMax(slider);\n },\n refresh: function (apis, slider) {\n apis.refresh(slider);\n }\n }\n });\n\n var sliderFactory = function (translate, getClass) {\n var spectrum = Slider.parts().spectrum({\n dom: {\n tag: 'div',\n classes: [getClass('hue-slider-spectrum')],\n attributes: { role: 'presentation' }\n }\n });\n var thumb = Slider.parts().thumb({\n dom: {\n tag: 'div',\n classes: [getClass('hue-slider-thumb')],\n attributes: { role: 'presentation' }\n }\n });\n return Slider.sketch({\n dom: {\n tag: 'div',\n classes: [getClass('hue-slider')],\n attributes: { role: 'presentation' }\n },\n rounded: false,\n model: {\n mode: 'y',\n getInitialValue: constant({ y: constant(0) })\n },\n components: [\n spectrum,\n thumb\n ],\n sliderBehaviours: derive$1([Focusing.config({})]),\n onChange: function (slider, _thumb, value) {\n emitWith(slider, sliderUpdate, { value: value });\n }\n });\n };\n\n var owner$3 = 'form';\n var schema$h = [field$1('formBehaviours', [Representing])];\n var getPartName = function (name) {\n return '';\n };\n var sketch$1 = function (fSpec) {\n var parts = function () {\n var record = [];\n var field = function (name, config) {\n record.push(name);\n return generateOne(owner$3, getPartName(name), config);\n };\n return {\n field: field,\n record: function () {\n return record;\n }\n };\n }();\n var spec = fSpec(parts);\n var partNames = parts.record();\n var fieldParts = map(partNames, function (n) {\n return required({\n name: n,\n pname: getPartName(n)\n });\n });\n return composite(owner$3, schema$h, fieldParts, make$4, spec);\n };\n var toResult$1 = function (o, e) {\n return o.fold(function () {\n return Result.error(e);\n }, Result.value);\n };\n var make$4 = function (detail, components) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.formBehaviours, [Representing.config({\n store: {\n mode: 'manual',\n getValue: function (form) {\n var resPs = getAllParts(form, detail);\n return map$2(resPs, function (resPThunk, pName) {\n return resPThunk().bind(function (v) {\n var opt = Composing.getCurrent(v);\n return toResult$1(opt, new Error('Cannot find a current component to extract the value from for form part \\'' + pName + '\\': ' + element(v.element())));\n }).map(Representing.getValue);\n });\n },\n setValue: function (form, values) {\n each$1(values, function (newValue, key) {\n getPart(form, detail, key).each(function (wrapper) {\n Composing.getCurrent(wrapper).each(function (field) {\n Representing.setValue(field, newValue);\n });\n });\n });\n }\n }\n })]),\n apis: {\n getField: function (form, key) {\n return getPart(form, detail, key).bind(Composing.getCurrent);\n }\n }\n };\n };\n var Form = {\n getField: makeApi(function (apis, component, key) {\n return apis.getField(component, key);\n }),\n sketch: sketch$1\n };\n\n var validInput = generate$1('valid-input');\n var invalidInput = generate$1('invalid-input');\n var validatingInput = generate$1('validating-input');\n var translatePrefix = 'colorcustom.rgb.';\n var rgbFormFactory = function (translate, getClass, onValidHexx, onInvalidHexx) {\n var invalidation = function (label, isValid) {\n return Invalidating.config({\n invalidClass: getClass('invalid'),\n notify: {\n onValidate: function (comp) {\n emitWith(comp, validatingInput, { type: label });\n },\n onValid: function (comp) {\n emitWith(comp, validInput, {\n type: label,\n value: Representing.getValue(comp)\n });\n },\n onInvalid: function (comp) {\n emitWith(comp, invalidInput, {\n type: label,\n value: Representing.getValue(comp)\n });\n }\n },\n validator: {\n validate: function (comp) {\n var value = Representing.getValue(comp);\n var res = isValid(value) ? Result.value(true) : Result.error(translate('aria.input.invalid'));\n return Future.pure(res);\n },\n validateOnLoad: false\n }\n });\n };\n var renderTextField = function (isValid, name, label, description, data) {\n var helptext = translate(translatePrefix + 'range');\n var pLabel = FormField.parts().label({\n dom: {\n tag: 'label',\n innerHtml: label,\n attributes: { 'aria-label': description }\n }\n });\n var pField = FormField.parts().field({\n data: data,\n factory: Input,\n inputAttributes: __assign({ type: 'text' }, name === 'hex' ? { 'aria-live': 'polite' } : {}),\n inputClasses: [getClass('textfield')],\n inputBehaviours: derive$1([\n invalidation(name, isValid),\n Tabstopping.config({})\n ]),\n onSetValue: function (input) {\n if (Invalidating.isInvalid(input)) {\n var run = Invalidating.run(input);\n run.get(noop);\n }\n }\n });\n var comps = [\n pLabel,\n pField\n ];\n var concats = name !== 'hex' ? [FormField.parts()['aria-descriptor']({ text: helptext })] : [];\n var components = comps.concat(concats);\n return {\n dom: {\n tag: 'div',\n attributes: { role: 'presentation' }\n },\n components: components\n };\n };\n var copyRgbToHex = function (form, rgba) {\n var hex = fromRgba(rgba);\n Form.getField(form, 'hex').each(function (hexField) {\n if (!Focusing.isFocused(hexField)) {\n Representing.setValue(form, { hex: hex.value });\n }\n });\n return hex;\n };\n var copyRgbToForm = function (form, rgb) {\n var red = rgb.red;\n var green = rgb.green;\n var blue = rgb.blue;\n Representing.setValue(form, {\n red: red,\n green: green,\n blue: blue\n });\n };\n var memPreview = record({\n dom: {\n tag: 'div',\n classes: [getClass('rgba-preview')],\n styles: { 'background-color': 'white' },\n attributes: { role: 'presentation' }\n }\n });\n var updatePreview = function (anyInSystem, hex) {\n memPreview.getOpt(anyInSystem).each(function (preview) {\n set$2(preview.element(), 'background-color', '#' + hex.value);\n });\n };\n var factory = function () {\n var state = {\n red: Cell(Option.some(255)),\n green: Cell(Option.some(255)),\n blue: Cell(Option.some(255)),\n hex: Cell(Option.some('ffffff'))\n };\n var copyHexToRgb = function (form, hex) {\n var rgb = fromHex(hex);\n copyRgbToForm(form, rgb);\n setValueRgb(rgb);\n };\n var get = function (prop) {\n return state[prop].get();\n };\n var set = function (prop, value) {\n state[prop].set(value);\n };\n var getValueRgb = function () {\n return get('red').bind(function (red) {\n return get('green').bind(function (green) {\n return get('blue').map(function (blue) {\n return rgbaColour(red, green, blue, 1);\n });\n });\n });\n };\n var setValueRgb = function (rgb) {\n var red = rgb.red;\n var green = rgb.green;\n var blue = rgb.blue;\n set('red', Option.some(red));\n set('green', Option.some(green));\n set('blue', Option.some(blue));\n };\n var onInvalidInput = function (form, simulatedEvent) {\n var data = simulatedEvent.event();\n if (data.type() !== 'hex') {\n set(data.type(), Option.none());\n } else {\n onInvalidHexx(form);\n }\n };\n var onValidHex = function (form, value) {\n onValidHexx(form);\n var hex = hexColour(value);\n set('hex', Option.some(value));\n var rgb = fromHex(hex);\n copyRgbToForm(form, rgb);\n setValueRgb(rgb);\n emitWith(form, fieldsUpdate, { hex: hex });\n updatePreview(form, hex);\n };\n var onValidRgb = function (form, prop, value) {\n var val = parseInt(value, 10);\n set(prop, Option.some(val));\n getValueRgb().each(function (rgb) {\n var hex = copyRgbToHex(form, rgb);\n updatePreview(form, hex);\n });\n };\n var isHexInputEvent = function (data) {\n return data.type() === 'hex';\n };\n var onValidInput = function (form, simulatedEvent) {\n var data = simulatedEvent.event();\n if (isHexInputEvent(data)) {\n onValidHex(form, data.value());\n } else {\n onValidRgb(form, data.type(), data.value());\n }\n };\n var formPartStrings = function (key) {\n return {\n label: translate(translatePrefix + key + '.label'),\n description: translate(translatePrefix + key + '.description')\n };\n };\n var redStrings = formPartStrings('red');\n var greenStrings = formPartStrings('green');\n var blueStrings = formPartStrings('blue');\n var hexStrings = formPartStrings('hex');\n return deepMerge(Form.sketch(function (parts) {\n return {\n dom: {\n tag: 'form',\n classes: [getClass('rgb-form')],\n attributes: { 'aria-label': translate('aria.color.picker') }\n },\n components: [\n parts.field('red', FormField.sketch(renderTextField(isRgbaComponent, 'red', redStrings.label, redStrings.description, 255))),\n parts.field('green', FormField.sketch(renderTextField(isRgbaComponent, 'green', greenStrings.label, greenStrings.description, 255))),\n parts.field('blue', FormField.sketch(renderTextField(isRgbaComponent, 'blue', blueStrings.label, blueStrings.description, 255))),\n parts.field('hex', FormField.sketch(renderTextField(isHexString, 'hex', hexStrings.label, hexStrings.description, 'ffffff'))),\n memPreview.asSpec()\n ],\n formBehaviours: derive$1([\n Invalidating.config({ invalidClass: getClass('form-invalid') }),\n config('rgb-form-events', [\n run(validInput, onValidInput),\n run(invalidInput, onInvalidInput),\n run(validatingInput, onInvalidInput)\n ])\n ])\n };\n }), {\n apis: {\n updateHex: function (form, hex) {\n Representing.setValue(form, { hex: hex.value });\n copyHexToRgb(form, hex);\n updatePreview(form, hex);\n }\n }\n });\n };\n var rgbFormSketcher = single$2({\n factory: factory,\n name: 'RgbForm',\n configFields: [],\n apis: {\n updateHex: function (apis, form, hex) {\n apis.updateHex(form, hex);\n }\n },\n extraApis: {}\n });\n return rgbFormSketcher;\n };\n\n var paletteFactory = function (_translate, getClass) {\n var spectrumPart = Slider.parts().spectrum({\n dom: {\n tag: 'canvas',\n attributes: { role: 'presentation' },\n classes: [getClass('sv-palette-spectrum')]\n }\n });\n var thumbPart = Slider.parts().thumb({\n dom: {\n tag: 'div',\n attributes: { role: 'presentation' },\n classes: [getClass('sv-palette-thumb')],\n innerHtml: '
'\n }\n });\n var setColour = function (canvas, rgba) {\n var width = canvas.width, height = canvas.height;\n var ctx = canvas.getContext('2d');\n if (ctx === null) {\n return;\n }\n ctx.fillStyle = rgba;\n ctx.fillRect(0, 0, width, height);\n var grdWhite = ctx.createLinearGradient(0, 0, width, 0);\n grdWhite.addColorStop(0, 'rgba(255,255,255,1)');\n grdWhite.addColorStop(1, 'rgba(255,255,255,0)');\n ctx.fillStyle = grdWhite;\n ctx.fillRect(0, 0, width, height);\n var grdBlack = ctx.createLinearGradient(0, 0, 0, height);\n grdBlack.addColorStop(0, 'rgba(0,0,0,0)');\n grdBlack.addColorStop(1, 'rgba(0,0,0,1)');\n ctx.fillStyle = grdBlack;\n ctx.fillRect(0, 0, width, height);\n };\n var setSliderColour = function (slider, rgba) {\n var canvas = slider.components()[0].element().dom();\n setColour(canvas, toString(rgba));\n };\n var factory = function (_detail) {\n var getInitialValue = constant({\n x: constant(0),\n y: constant(0)\n });\n var onChange = function (slider, _thumb, value) {\n emitWith(slider, paletteUpdate, { value: value });\n };\n var onInit = function (_slider, _thumb, spectrum, _value) {\n setColour(spectrum.element().dom(), toString(red));\n };\n var sliderBehaviours = derive$1([\n Composing.config({ find: Option.some }),\n Focusing.config({})\n ]);\n return Slider.sketch({\n dom: {\n tag: 'div',\n attributes: { role: 'presentation' },\n classes: [getClass('sv-palette')]\n },\n model: {\n mode: 'xy',\n getInitialValue: getInitialValue\n },\n rounded: false,\n components: [\n spectrumPart,\n thumbPart\n ],\n onChange: onChange,\n onInit: onInit,\n sliderBehaviours: sliderBehaviours\n });\n };\n var saturationBrightnessPaletteSketcher = single$2({\n factory: factory,\n name: 'SaturationBrightnessPalette',\n configFields: [],\n apis: {\n setRgba: function (_apis, slider, rgba) {\n setSliderColour(slider, rgba);\n }\n },\n extraApis: {}\n });\n return saturationBrightnessPaletteSketcher;\n };\n\n var makeFactory = function (translate, getClass) {\n var factory = function (detail) {\n var rgbForm = rgbFormFactory(translate, getClass, detail.onValidHex, detail.onInvalidHex);\n var sbPalette = paletteFactory(translate, getClass);\n var state = { paletteRgba: Cell(red) };\n var memPalette = record(sbPalette.sketch({}));\n var memRgb = record(rgbForm.sketch({}));\n var updatePalette = function (anyInSystem, hex) {\n memPalette.getOpt(anyInSystem).each(function (palette) {\n var rgba = fromHex(hex);\n state.paletteRgba.set(rgba);\n sbPalette.setRgba(palette, rgba);\n });\n };\n var updateFields = function (anyInSystem, hex) {\n memRgb.getOpt(anyInSystem).each(function (form) {\n rgbForm.updateHex(form, hex);\n });\n };\n var runUpdates = function (anyInSystem, hex, updates) {\n each(updates, function (update) {\n update(anyInSystem, hex);\n });\n };\n var paletteUpdates = function () {\n var updates = [updateFields];\n return function (form, simulatedEvent) {\n var value = simulatedEvent.event().value();\n var oldRgb = state.paletteRgba.get();\n var hsvColour$1 = fromRgb(oldRgb);\n var newHsvColour = hsvColour(hsvColour$1.hue, value.x(), 100 - value.y());\n var rgb = fromHsv(newHsvColour);\n var nuHex = fromRgba(rgb);\n runUpdates(form, nuHex, updates);\n };\n };\n var sliderUpdates = function () {\n var updates = [\n updatePalette,\n updateFields\n ];\n return function (form, simulatedEvent) {\n var value = simulatedEvent.event().value();\n var hex = calcHex(value.y());\n runUpdates(form, hex, updates);\n };\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: [\n memPalette.asSpec(),\n sliderFactory(translate, getClass),\n memRgb.asSpec()\n ],\n behaviours: derive$1([\n config('colour-picker-events', [\n run(paletteUpdate, paletteUpdates()),\n run(sliderUpdate, sliderUpdates())\n ]),\n Composing.config({\n find: function (comp) {\n return memRgb.getOpt(comp);\n }\n }),\n Keying.config({ mode: 'acyclic' })\n ])\n };\n };\n var colourPickerSketcher = single$2({\n name: 'ColourPicker',\n configFields: [\n strict$1('dom'),\n defaulted$1('onValidHex', noop),\n defaulted$1('onInvalidHex', noop)\n ],\n factory: factory\n });\n return colourPickerSketcher;\n };\n\n var self$1 = function () {\n return Composing.config({ find: Option.some });\n };\n var memento = function (mem) {\n return Composing.config({ find: mem.getOpt });\n };\n var childAt = function (index) {\n return Composing.config({\n find: function (comp) {\n return child(comp.element(), index).bind(function (element) {\n return comp.getSystem().getByDom(element).toOption();\n });\n }\n });\n };\n var ComposingConfigs = {\n self: self$1,\n memento: memento,\n childAt: childAt\n };\n\n var english = {\n 'colorcustom.rgb.red.label': 'R',\n 'colorcustom.rgb.red.description': 'Red component',\n 'colorcustom.rgb.green.label': 'G',\n 'colorcustom.rgb.green.description': 'Green component',\n 'colorcustom.rgb.blue.label': 'B',\n 'colorcustom.rgb.blue.description': 'Blue component',\n 'colorcustom.rgb.hex.label': '#',\n 'colorcustom.rgb.hex.description': 'Hex color code',\n 'colorcustom.rgb.range': 'Range 0 to 255',\n 'colorcustom.sb.saturation': 'Saturation',\n 'colorcustom.sb.brightness': 'Brightness',\n 'colorcustom.sb.picker': 'Saturation and Brightness Picker',\n 'colorcustom.sb.palette': 'Saturation and Brightness Palette',\n 'colorcustom.sb.instructions': 'Use arrow keys to select saturation and brightness, on x and y axes',\n 'colorcustom.hue.hue': 'Hue',\n 'colorcustom.hue.slider': 'Hue Slider',\n 'colorcustom.hue.palette': 'Hue Palette',\n 'colorcustom.hue.instructions': 'Use arrow keys to select a hue',\n 'aria.color.picker': 'Color Picker',\n 'aria.input.invalid': 'Invalid input'\n };\n var getEnglishText = function (key) {\n return english[key];\n };\n var translate$1 = function (key) {\n return getEnglishText(key);\n };\n var renderColorPicker = function (_spec) {\n var getClass = function (key) {\n return 'tox-' + key;\n };\n var colourPickerFactory = makeFactory(translate$1, getClass);\n var onValidHex = function (form) {\n emitWith(form, formActionEvent, {\n name: 'hex-valid',\n value: true\n });\n };\n var onInvalidHex = function (form) {\n emitWith(form, formActionEvent, {\n name: 'hex-valid',\n value: false\n });\n };\n var memPicker = record(colourPickerFactory.sketch({\n dom: {\n tag: 'div',\n classes: [getClass('color-picker-container')],\n attributes: { role: 'presentation' }\n },\n onValidHex: onValidHex,\n onInvalidHex: onInvalidHex\n }));\n return {\n dom: { tag: 'div' },\n components: [memPicker.asSpec()],\n behaviours: derive$1([\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (comp) {\n var picker = memPicker.get(comp);\n var optRgbForm = Composing.getCurrent(picker);\n var optHex = optRgbForm.bind(function (rgbForm) {\n var formValues = Representing.getValue(rgbForm);\n return formValues.hex;\n });\n return optHex.map(function (hex) {\n return '#' + hex;\n }).getOr('');\n },\n setValue: function (comp, newValue) {\n var pattern = /^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/;\n var m = pattern.exec(newValue);\n var picker = memPicker.get(comp);\n var optRgbForm = Composing.getCurrent(picker);\n optRgbForm.fold(function () {\n domGlobals.console.log('Can not find form');\n }, function (rgbForm) {\n Representing.setValue(rgbForm, { hex: Option.from(m[1]).getOr('') });\n Form.getField(rgbForm, 'hex').each(function (hexField) {\n emit(hexField, input());\n });\n });\n }\n }\n }),\n ComposingConfigs.self()\n ])\n };\n };\n\n var global$a = tinymce.util.Tools.resolve('tinymce.Resource');\n\n var isOldCustomEditor = function (spec) {\n return Object.prototype.hasOwnProperty.call(spec, 'init');\n };\n var renderCustomEditor = function (spec) {\n var editorApi = Cell(Option.none());\n var memReplaced = record({ dom: { tag: spec.tag } });\n var initialValue = Cell(Option.none());\n return {\n dom: {\n tag: 'div',\n classes: ['tox-custom-editor']\n },\n behaviours: derive$1([\n config('editor-foo-events', [runOnAttached(function (component) {\n memReplaced.getOpt(component).each(function (ta) {\n (isOldCustomEditor(spec) ? spec.init(ta.element().dom()) : global$a.load(spec.scriptId, spec.scriptUrl).then(function (init) {\n return init(ta.element().dom(), spec.settings);\n })).then(function (ea) {\n initialValue.get().each(function (cvalue) {\n ea.setValue(cvalue);\n });\n initialValue.set(Option.none());\n editorApi.set(Option.some(ea));\n });\n });\n })]),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function () {\n return editorApi.get().fold(function () {\n return initialValue.get().getOr('');\n }, function (ed) {\n return ed.getValue();\n });\n },\n setValue: function (component, value) {\n editorApi.get().fold(function () {\n initialValue.set(Option.some(value));\n }, function (ed) {\n return ed.setValue(value);\n });\n }\n }\n }),\n ComposingConfigs.self()\n ]),\n components: [memReplaced.asSpec()]\n };\n };\n\n var processors = objOf([\n defaulted$1('preprocess', identity),\n defaulted$1('postprocess', identity)\n ]);\n var memento$1 = function (mem, rawProcessors) {\n var ps = asRawOrDie('RepresentingConfigs.memento processors', processors, rawProcessors);\n return Representing.config({\n store: {\n mode: 'manual',\n getValue: function (comp) {\n var other = mem.get(comp);\n var rawValue = Representing.getValue(other);\n return ps.postprocess(rawValue);\n },\n setValue: function (comp, rawValue) {\n var newValue = ps.preprocess(rawValue);\n var other = mem.get(comp);\n Representing.setValue(other, newValue);\n }\n }\n });\n };\n var withComp = function (optInitialValue, getter, setter) {\n return Representing.config(deepMerge({\n store: {\n mode: 'manual',\n getValue: getter,\n setValue: setter\n }\n }, optInitialValue.map(function (initialValue) {\n return { store: { initialValue: initialValue } };\n }).getOr({})));\n };\n var withElement = function (initialValue, getter, setter) {\n return withComp(initialValue, function (c) {\n return getter(c.element());\n }, function (c, v) {\n return setter(c.element(), v);\n });\n };\n var domValue = function (optInitialValue) {\n return withElement(optInitialValue, get$5, set$3);\n };\n var domHtml = function (optInitialValue) {\n return withElement(optInitialValue, get$1, set);\n };\n var memory$1 = function (initialValue) {\n return Representing.config({\n store: {\n mode: 'memory',\n initialValue: initialValue\n }\n });\n };\n var RepresentingConfigs = {\n memento: memento$1,\n withElement: withElement,\n withComp: withComp,\n domValue: domValue,\n domHtml: domHtml,\n memory: memory$1\n };\n\n var extensionsAccepted = '.jpg,.jpeg,.png,.gif';\n var filterByExtension = function (files) {\n var re = new RegExp('(' + extensionsAccepted.split(/\\s*,\\s*/).join('|') + ')$', 'i');\n return filter(from$1(files), function (file) {\n return re.test(file.name);\n });\n };\n var renderDropZone = function (spec, providersBackstage) {\n var stopper = function (_, se) {\n se.stop();\n };\n var sequence = function (actions) {\n return function (comp, se) {\n each(actions, function (a) {\n a(comp, se);\n });\n };\n };\n var onDrop = function (comp, se) {\n if (!Disabling.isDisabled(comp)) {\n var transferEvent = se.event().raw();\n handleFiles(comp, transferEvent.dataTransfer.files);\n }\n };\n var onSelect = function (component, simulatedEvent) {\n var files = simulatedEvent.event().raw().target.files;\n handleFiles(component, files);\n };\n var handleFiles = function (component, files) {\n Representing.setValue(component, filterByExtension(files));\n emitWith(component, formChangeEvent, { name: spec.name });\n };\n var memInput = record({\n dom: {\n tag: 'input',\n attributes: {\n type: 'file',\n accept: 'image/*'\n },\n styles: { display: 'none' }\n },\n behaviours: derive$1([config('input-file-events', [\n cutter(click()),\n cutter(tap())\n ])])\n });\n var renderField = function (s) {\n return {\n uid: s.uid,\n dom: {\n tag: 'div',\n classes: ['tox-dropzone-container']\n },\n behaviours: derive$1([\n RepresentingConfigs.memory([]),\n ComposingConfigs.self(),\n Disabling.config({}),\n Toggling.config({\n toggleClass: 'dragenter',\n toggleOnExecute: false\n }),\n config('dropzone-events', [\n run('dragenter', sequence([\n stopper,\n Toggling.toggle\n ])),\n run('dragleave', sequence([\n stopper,\n Toggling.toggle\n ])),\n run('dragover', stopper),\n run('drop', sequence([\n stopper,\n onDrop\n ])),\n run(change(), onSelect)\n ])\n ]),\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-dropzone'],\n styles: {}\n },\n components: [\n {\n dom: {\n tag: 'p',\n innerHtml: providersBackstage.translate('Drop an image here')\n }\n },\n Button.sketch({\n dom: {\n tag: 'button',\n innerHtml: providersBackstage.translate('Browse for an image'),\n styles: { position: 'relative' },\n classes: [\n 'tox-button',\n 'tox-button--secondary'\n ]\n },\n components: [memInput.asSpec()],\n action: function (comp) {\n var inputComp = memInput.get(comp);\n inputComp.element().dom().click();\n },\n buttonBehaviours: derive$1([\n Tabstopping.config({}),\n DisablingConfigs.button(providersBackstage.isReadOnly),\n receivingConfig()\n ])\n })\n ]\n }]\n };\n };\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var pField = FormField.parts().field({ factory: { sketch: renderField } });\n return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []);\n };\n\n var renderGrid = function (spec, backstage) {\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-form__grid',\n 'tox-form__grid--' + spec.columns + 'col'\n ]\n },\n components: map(spec.items, backstage.interpreter)\n };\n };\n\n var beforeObject = generate$1('alloy-fake-before-tabstop');\n var afterObject = generate$1('alloy-fake-after-tabstop');\n var craftWithClasses = function (classes) {\n return {\n dom: {\n tag: 'div',\n styles: {\n width: '1px',\n height: '1px',\n outline: 'none'\n },\n attributes: { tabindex: '0' },\n classes: classes\n },\n behaviours: derive$1([\n Focusing.config({ ignore: true }),\n Tabstopping.config({})\n ])\n };\n };\n var craft = function (spec) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-navobj']\n },\n components: [\n craftWithClasses([beforeObject]),\n spec,\n craftWithClasses([afterObject])\n ],\n behaviours: derive$1([ComposingConfigs.childAt(1)])\n };\n };\n var triggerTab = function (placeholder, shiftKey) {\n emitWith(placeholder, keydown(), {\n raw: {\n which: 9,\n shiftKey: shiftKey\n }\n });\n };\n var onFocus$1 = function (container, targetComp) {\n var target = targetComp.element();\n if (has$2(target, beforeObject)) {\n triggerTab(container, true);\n } else if (has$2(target, afterObject)) {\n triggerTab(container, false);\n }\n };\n var isPseudoStop = function (element) {\n return closest$4(element, [\n '.' + beforeObject,\n '.' + afterObject\n ].join(','), constant(false));\n };\n\n var platformNeedsSandboxing = !(detect$3().browser.isIE() || detect$3().browser.isEdge());\n var getDynamicSource = function (isSandbox) {\n var cachedValue = Cell('');\n return {\n getValue: function (_frameComponent) {\n return cachedValue.get();\n },\n setValue: function (frameComponent, html) {\n if (!isSandbox) {\n set$1(frameComponent.element(), 'src', 'javascript:\\'\\'');\n var doc = frameComponent.element().dom().contentWindow.document;\n doc.open();\n doc.write(html);\n doc.close();\n } else {\n set$1(frameComponent.element(), 'srcdoc', html);\n }\n cachedValue.set(html);\n }\n };\n };\n var renderIFrame = function (spec, providersBackstage) {\n var isSandbox = platformNeedsSandboxing && spec.sandboxed;\n var attributes = __assign(__assign({}, spec.label.map(function (title) {\n return { title: title };\n }).getOr({})), isSandbox ? { sandbox: 'allow-scripts allow-same-origin' } : {});\n var sourcing = getDynamicSource(isSandbox);\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var factory = function (newSpec) {\n return craft({\n uid: newSpec.uid,\n dom: {\n tag: 'iframe',\n attributes: attributes\n },\n behaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({}),\n RepresentingConfigs.withComp(Option.none(), sourcing.getValue, sourcing.setValue)\n ])\n });\n };\n var pField = FormField.parts().field({ factory: { sketch: factory } });\n return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []);\n };\n\n function create$5(width, height) {\n return resize(domGlobals.document.createElement('canvas'), width, height);\n }\n function clone$1(canvas) {\n var tCanvas = create$5(canvas.width, canvas.height);\n var ctx = get2dContext(tCanvas);\n ctx.drawImage(canvas, 0, 0);\n return tCanvas;\n }\n function get2dContext(canvas) {\n return canvas.getContext('2d');\n }\n function resize(canvas, width, height) {\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n\n function getWidth(image) {\n return image.naturalWidth || image.width;\n }\n function getHeight(image) {\n return image.naturalHeight || image.height;\n }\n\n var promise = function () {\n var Promise = function (fn) {\n if (typeof this !== 'object') {\n throw new TypeError('Promises must be constructed via new');\n }\n if (typeof fn !== 'function') {\n throw new TypeError('not a function');\n }\n this._state = null;\n this._value = null;\n this._deferreds = [];\n doResolve(fn, bind(resolve, this), bind(reject, this));\n };\n var asap = Promise.immediateFn || typeof window.setImmediate === 'function' && window.setImmediate || function (fn) {\n domGlobals.setTimeout(fn, 1);\n };\n function bind(fn, thisArg) {\n return function () {\n return fn.apply(thisArg, arguments);\n };\n }\n var isArray = Array.isArray || function (value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n };\n function handle(deferred) {\n var me = this;\n if (this._state === null) {\n this._deferreds.push(deferred);\n return;\n }\n asap(function () {\n var cb = me._state ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (me._state ? deferred.resolve : deferred.reject)(me._value);\n return;\n }\n var ret;\n try {\n ret = cb(me._value);\n } catch (e) {\n deferred.reject(e);\n return;\n }\n deferred.resolve(ret);\n });\n }\n function resolve(newValue) {\n try {\n if (newValue === this) {\n throw new TypeError('A promise cannot be resolved with itself.');\n }\n if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n var then = newValue.then;\n if (typeof then === 'function') {\n doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));\n return;\n }\n }\n this._state = true;\n this._value = newValue;\n finale.call(this);\n } catch (e) {\n reject.call(this, e);\n }\n }\n function reject(newValue) {\n this._state = false;\n this._value = newValue;\n finale.call(this);\n }\n function finale() {\n for (var _i = 0, _a = this._deferreds; _i < _a.length; _i++) {\n var deferred = _a[_i];\n handle.call(this, deferred);\n }\n this._deferreds = [];\n }\n function Handler(onFulfilled, onRejected, resolve, reject) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.resolve = resolve;\n this.reject = reject;\n }\n function doResolve(fn, onFulfilled, onRejected) {\n var done = false;\n try {\n fn(function (value) {\n if (done) {\n return;\n }\n done = true;\n onFulfilled(value);\n }, function (reason) {\n if (done) {\n return;\n }\n done = true;\n onRejected(reason);\n });\n } catch (ex) {\n if (done) {\n return;\n }\n done = true;\n onRejected(ex);\n }\n }\n Promise.prototype.catch = function (onRejected) {\n return this.then(null, onRejected);\n };\n Promise.prototype.then = function (onFulfilled, onRejected) {\n var me = this;\n return new Promise(function (resolve, reject) {\n handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));\n });\n };\n Promise.all = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values);\n return new Promise(function (resolve, reject) {\n if (args.length === 0) {\n return resolve([]);\n }\n var remaining = args.length;\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(val, function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n };\n Promise.resolve = function (value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n return new Promise(function (resolve) {\n resolve(value);\n });\n };\n Promise.reject = function (reason) {\n return new Promise(function (resolve, reject) {\n reject(reason);\n });\n };\n Promise.race = function (values) {\n return new Promise(function (resolve, reject) {\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var value = values_1[_i];\n value.then(resolve, reject);\n }\n });\n };\n return Promise;\n };\n var Promise$1 = window.Promise ? window.Promise : promise();\n\n function blobToImage(blob) {\n return new Promise$1(function (resolve, reject) {\n var blobUrl = domGlobals.URL.createObjectURL(blob);\n var image = new domGlobals.Image();\n var removeListeners = function () {\n image.removeEventListener('load', loaded);\n image.removeEventListener('error', error);\n };\n function loaded() {\n removeListeners();\n resolve(image);\n }\n function error() {\n removeListeners();\n reject('Unable to load data of type ' + blob.type + ': ' + blobUrl);\n }\n image.addEventListener('load', loaded);\n image.addEventListener('error', error);\n image.src = blobUrl;\n if (image.complete) {\n loaded();\n }\n });\n }\n function dataUriToBlobSync(uri) {\n var data = uri.split(',');\n var matches = /data:([^;]+)/.exec(data[0]);\n if (!matches) {\n return Option.none();\n }\n var mimetype = matches[1];\n var base64 = data[1];\n var sliceSize = 1024;\n var byteCharacters = domGlobals.atob(base64);\n var bytesLength = byteCharacters.length;\n var slicesCount = Math.ceil(bytesLength / sliceSize);\n var byteArrays = new Array(slicesCount);\n for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {\n var begin = sliceIndex * sliceSize;\n var end = Math.min(begin + sliceSize, bytesLength);\n var bytes = new Array(end - begin);\n for (var offset = begin, i = 0; offset < end; ++i, ++offset) {\n bytes[i] = byteCharacters[offset].charCodeAt(0);\n }\n byteArrays[sliceIndex] = new Uint8Array(bytes);\n }\n return Option.some(new domGlobals.Blob(byteArrays, { type: mimetype }));\n }\n function dataUriToBlob(uri) {\n return new Promise$1(function (resolve, reject) {\n dataUriToBlobSync(uri).fold(function () {\n reject('uri is not base64: ' + uri);\n }, resolve);\n });\n }\n function canvasToBlob(canvas, type, quality) {\n type = type || 'image/png';\n if (domGlobals.HTMLCanvasElement.prototype.toBlob) {\n return new Promise$1(function (resolve, reject) {\n canvas.toBlob(function (blob) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n }, type, quality);\n });\n } else {\n return dataUriToBlob(canvas.toDataURL(type, quality));\n }\n }\n function canvasToDataURL(canvas, type, quality) {\n type = type || 'image/png';\n return canvas.toDataURL(type, quality);\n }\n function blobToCanvas(blob) {\n return blobToImage(blob).then(function (image) {\n revokeImageUrl(image);\n var canvas = create$5(getWidth(image), getHeight(image));\n var context = get2dContext(canvas);\n context.drawImage(image, 0, 0);\n return canvas;\n });\n }\n function blobToDataUri(blob) {\n return new Promise$1(function (resolve) {\n var reader = new domGlobals.FileReader();\n reader.onloadend = function () {\n resolve(reader.result);\n };\n reader.readAsDataURL(blob);\n });\n }\n function revokeImageUrl(image) {\n domGlobals.URL.revokeObjectURL(image.src);\n }\n\n function create$6(getCanvas, blob, uri) {\n var initialType = blob.type;\n var getType = constant(initialType);\n function toBlob() {\n return Promise$1.resolve(blob);\n }\n var toDataURL = constant(uri);\n function toBase64() {\n return uri.split(',')[1];\n }\n function toAdjustedBlob(type, quality) {\n return getCanvas.then(function (canvas) {\n return canvasToBlob(canvas, type, quality);\n });\n }\n function toAdjustedDataURL(type, quality) {\n return getCanvas.then(function (canvas) {\n return canvasToDataURL(canvas, type, quality);\n });\n }\n function toAdjustedBase64(type, quality) {\n return toAdjustedDataURL(type, quality).then(function (dataurl) {\n return dataurl.split(',')[1];\n });\n }\n function toCanvas() {\n return getCanvas.then(clone$1);\n }\n return {\n getType: getType,\n toBlob: toBlob,\n toDataURL: toDataURL,\n toBase64: toBase64,\n toAdjustedBlob: toAdjustedBlob,\n toAdjustedDataURL: toAdjustedDataURL,\n toAdjustedBase64: toAdjustedBase64,\n toCanvas: toCanvas\n };\n }\n function fromBlob(blob) {\n return blobToDataUri(blob).then(function (uri) {\n return create$6(blobToCanvas(blob), blob, uri);\n });\n }\n function fromCanvas(canvas, type) {\n return canvasToBlob(canvas, type).then(function (blob) {\n return create$6(Promise$1.resolve(canvas), blob, canvas.toDataURL());\n });\n }\n\n var blobToImageResult = function (blob) {\n return fromBlob(blob);\n };\n\n function clamp$1(value, min, max) {\n var parsedValue = typeof value === 'string' ? parseFloat(value) : value;\n if (parsedValue > max) {\n parsedValue = max;\n } else if (parsedValue < min) {\n parsedValue = min;\n }\n return parsedValue;\n }\n function identity$1() {\n return [\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1\n ];\n }\n var DELTA_INDEX = [\n 0,\n 0.01,\n 0.02,\n 0.04,\n 0.05,\n 0.06,\n 0.07,\n 0.08,\n 0.1,\n 0.11,\n 0.12,\n 0.14,\n 0.15,\n 0.16,\n 0.17,\n 0.18,\n 0.2,\n 0.21,\n 0.22,\n 0.24,\n 0.25,\n 0.27,\n 0.28,\n 0.3,\n 0.32,\n 0.34,\n 0.36,\n 0.38,\n 0.4,\n 0.42,\n 0.44,\n 0.46,\n 0.48,\n 0.5,\n 0.53,\n 0.56,\n 0.59,\n 0.62,\n 0.65,\n 0.68,\n 0.71,\n 0.74,\n 0.77,\n 0.8,\n 0.83,\n 0.86,\n 0.89,\n 0.92,\n 0.95,\n 0.98,\n 1,\n 1.06,\n 1.12,\n 1.18,\n 1.24,\n 1.3,\n 1.36,\n 1.42,\n 1.48,\n 1.54,\n 1.6,\n 1.66,\n 1.72,\n 1.78,\n 1.84,\n 1.9,\n 1.96,\n 2,\n 2.12,\n 2.25,\n 2.37,\n 2.5,\n 2.62,\n 2.75,\n 2.87,\n 3,\n 3.2,\n 3.4,\n 3.6,\n 3.8,\n 4,\n 4.3,\n 4.7,\n 4.9,\n 5,\n 5.5,\n 6,\n 6.5,\n 6.8,\n 7,\n 7.3,\n 7.5,\n 7.8,\n 8,\n 8.4,\n 8.7,\n 9,\n 9.4,\n 9.6,\n 9.8,\n 10\n ];\n function multiply(matrix1, matrix2) {\n var col = [];\n var out = new Array(25);\n var val;\n for (var i = 0; i < 5; i++) {\n for (var j = 0; j < 5; j++) {\n col[j] = matrix2[j + i * 5];\n }\n for (var j = 0; j < 5; j++) {\n val = 0;\n for (var k = 0; k < 5; k++) {\n val += matrix1[j + k * 5] * col[k];\n }\n out[j + i * 5] = val;\n }\n }\n return out;\n }\n function adjustContrast(matrix, value) {\n var x;\n value = clamp$1(value, -1, 1);\n value *= 100;\n if (value < 0) {\n x = 127 + value / 100 * 127;\n } else {\n x = value % 1;\n if (x === 0) {\n x = DELTA_INDEX[value];\n } else {\n x = DELTA_INDEX[Math.floor(value)] * (1 - x) + DELTA_INDEX[Math.floor(value) + 1] * x;\n }\n x = x * 127 + 127;\n }\n return multiply(matrix, [\n x / 127,\n 0,\n 0,\n 0,\n 0.5 * (127 - x),\n 0,\n x / 127,\n 0,\n 0,\n 0.5 * (127 - x),\n 0,\n 0,\n x / 127,\n 0,\n 0.5 * (127 - x),\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1\n ]);\n }\n function adjustBrightness(matrix, value) {\n value = clamp$1(255 * value, -255, 255);\n return multiply(matrix, [\n 1,\n 0,\n 0,\n 0,\n value,\n 0,\n 1,\n 0,\n 0,\n value,\n 0,\n 0,\n 1,\n 0,\n value,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1\n ]);\n }\n function adjustColors(matrix, adjustR, adjustG, adjustB) {\n adjustR = clamp$1(adjustR, 0, 2);\n adjustG = clamp$1(adjustG, 0, 2);\n adjustB = clamp$1(adjustB, 0, 2);\n return multiply(matrix, [\n adjustR,\n 0,\n 0,\n 0,\n 0,\n 0,\n adjustG,\n 0,\n 0,\n 0,\n 0,\n 0,\n adjustB,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1\n ]);\n }\n\n function colorFilter(ir, matrix) {\n return ir.toCanvas().then(function (canvas) {\n return applyColorFilter(canvas, ir.getType(), matrix);\n });\n }\n function applyColorFilter(canvas, type, matrix) {\n var context = get2dContext(canvas);\n function applyMatrix(pixelsData, m) {\n var r, g, b, a;\n var data = pixelsData.data, m0 = m[0], m1 = m[1], m2 = m[2], m3 = m[3], m4 = m[4], m5 = m[5], m6 = m[6], m7 = m[7], m8 = m[8], m9 = m[9], m10 = m[10], m11 = m[11], m12 = m[12], m13 = m[13], m14 = m[14], m15 = m[15], m16 = m[16], m17 = m[17], m18 = m[18], m19 = m[19];\n for (var i = 0; i < data.length; i += 4) {\n r = data[i];\n g = data[i + 1];\n b = data[i + 2];\n a = data[i + 3];\n data[i] = r * m0 + g * m1 + b * m2 + a * m3 + m4;\n data[i + 1] = r * m5 + g * m6 + b * m7 + a * m8 + m9;\n data[i + 2] = r * m10 + g * m11 + b * m12 + a * m13 + m14;\n data[i + 3] = r * m15 + g * m16 + b * m17 + a * m18 + m19;\n }\n return pixelsData;\n }\n var pixels = applyMatrix(context.getImageData(0, 0, canvas.width, canvas.height), matrix);\n context.putImageData(pixels, 0, 0);\n return fromCanvas(canvas, type);\n }\n function convoluteFilter(ir, matrix) {\n return ir.toCanvas().then(function (canvas) {\n return applyConvoluteFilter(canvas, ir.getType(), matrix);\n });\n }\n function applyConvoluteFilter(canvas, type, matrix) {\n var context = get2dContext(canvas);\n function applyMatrix(pIn, pOut, aMatrix) {\n function clamp(value, min, max) {\n if (value > max) {\n value = max;\n } else if (value < min) {\n value = min;\n }\n return value;\n }\n var side = Math.round(Math.sqrt(aMatrix.length));\n var halfSide = Math.floor(side / 2);\n var rgba = pIn.data;\n var drgba = pOut.data;\n var w = pIn.width;\n var h = pIn.height;\n for (var y = 0; y < h; y++) {\n for (var x = 0; x < w; x++) {\n var r = 0;\n var g = 0;\n var b = 0;\n for (var cy = 0; cy < side; cy++) {\n for (var cx = 0; cx < side; cx++) {\n var scx = clamp(x + cx - halfSide, 0, w - 1);\n var scy = clamp(y + cy - halfSide, 0, h - 1);\n var innerOffset = (scy * w + scx) * 4;\n var wt = aMatrix[cy * side + cx];\n r += rgba[innerOffset] * wt;\n g += rgba[innerOffset + 1] * wt;\n b += rgba[innerOffset + 2] * wt;\n }\n }\n var offset = (y * w + x) * 4;\n drgba[offset] = clamp(r, 0, 255);\n drgba[offset + 1] = clamp(g, 0, 255);\n drgba[offset + 2] = clamp(b, 0, 255);\n }\n }\n return pOut;\n }\n var pixelsIn = context.getImageData(0, 0, canvas.width, canvas.height);\n var pixelsOut = context.getImageData(0, 0, canvas.width, canvas.height);\n pixelsOut = applyMatrix(pixelsIn, pixelsOut, matrix);\n context.putImageData(pixelsOut, 0, 0);\n return fromCanvas(canvas, type);\n }\n function functionColorFilter(colorFn) {\n var filterImpl = function (canvas, type, value) {\n var context = get2dContext(canvas);\n var lookup = new Array(256);\n function applyLookup(pixelsData, lookupData) {\n var data = pixelsData.data;\n for (var i = 0; i < data.length; i += 4) {\n data[i] = lookupData[data[i]];\n data[i + 1] = lookupData[data[i + 1]];\n data[i + 2] = lookupData[data[i + 2]];\n }\n return pixelsData;\n }\n for (var i = 0; i < lookup.length; i++) {\n lookup[i] = colorFn(i, value);\n }\n var pixels = applyLookup(context.getImageData(0, 0, canvas.width, canvas.height), lookup);\n context.putImageData(pixels, 0, 0);\n return fromCanvas(canvas, type);\n };\n return function (ir, value) {\n return ir.toCanvas().then(function (canvas) {\n return filterImpl(canvas, ir.getType(), value);\n });\n };\n }\n function complexAdjustableColorFilter(matrixAdjustFn) {\n return function (ir, adjust) {\n return colorFilter(ir, matrixAdjustFn(identity$1(), adjust));\n };\n }\n function basicColorFilter(matrix) {\n return function (ir) {\n return colorFilter(ir, matrix);\n };\n }\n function basicConvolutionFilter(kernel) {\n return function (ir) {\n return convoluteFilter(ir, kernel);\n };\n }\n var invert = basicColorFilter([\n -1,\n 0,\n 0,\n 0,\n 255,\n 0,\n -1,\n 0,\n 0,\n 255,\n 0,\n 0,\n -1,\n 0,\n 255,\n 0,\n 0,\n 0,\n 1,\n 0,\n 0,\n 0,\n 0,\n 0,\n 1\n ]);\n var brightness = complexAdjustableColorFilter(adjustBrightness);\n var contrast = complexAdjustableColorFilter(adjustContrast);\n var colorize = function (ir, adjustR, adjustG, adjustB) {\n return colorFilter(ir, adjustColors(identity$1(), adjustR, adjustG, adjustB));\n };\n var sharpen = basicConvolutionFilter([\n 0,\n -1,\n 0,\n -1,\n 5,\n -1,\n 0,\n -1,\n 0\n ]);\n var gamma = functionColorFilter(function (color, value) {\n return Math.pow(color / 255, 1 - value) * 255;\n });\n\n function scale(image, dW, dH) {\n var sW = getWidth(image);\n var sH = getHeight(image);\n var wRatio = dW / sW;\n var hRatio = dH / sH;\n var scaleCapped = false;\n if (wRatio < 0.5 || wRatio > 2) {\n wRatio = wRatio < 0.5 ? 0.5 : 2;\n scaleCapped = true;\n }\n if (hRatio < 0.5 || hRatio > 2) {\n hRatio = hRatio < 0.5 ? 0.5 : 2;\n scaleCapped = true;\n }\n var scaled = _scale(image, wRatio, hRatio);\n return !scaleCapped ? scaled : scaled.then(function (tCanvas) {\n return scale(tCanvas, dW, dH);\n });\n }\n function _scale(image, wRatio, hRatio) {\n return new Promise$1(function (resolve) {\n var sW = getWidth(image);\n var sH = getHeight(image);\n var dW = Math.floor(sW * wRatio);\n var dH = Math.floor(sH * hRatio);\n var canvas = create$5(dW, dH);\n var context = get2dContext(canvas);\n context.drawImage(image, 0, 0, sW, sH, 0, 0, dW, dH);\n resolve(canvas);\n });\n }\n\n function rotate(ir, angle) {\n return ir.toCanvas().then(function (canvas) {\n return applyRotate(canvas, ir.getType(), angle);\n });\n }\n function applyRotate(image, type, angle) {\n var canvas = create$5(image.width, image.height);\n var context = get2dContext(canvas);\n var translateX = 0;\n var translateY = 0;\n angle = angle < 0 ? 360 + angle : angle;\n if (angle === 90 || angle === 270) {\n resize(canvas, canvas.height, canvas.width);\n }\n if (angle === 90 || angle === 180) {\n translateX = canvas.width;\n }\n if (angle === 270 || angle === 180) {\n translateY = canvas.height;\n }\n context.translate(translateX, translateY);\n context.rotate(angle * Math.PI / 180);\n context.drawImage(image, 0, 0);\n return fromCanvas(canvas, type);\n }\n function flip(ir, axis) {\n return ir.toCanvas().then(function (canvas) {\n return applyFlip(canvas, ir.getType(), axis);\n });\n }\n function applyFlip(image, type, axis) {\n var canvas = create$5(image.width, image.height);\n var context = get2dContext(canvas);\n if (axis === 'v') {\n context.scale(1, -1);\n context.drawImage(image, 0, -canvas.height);\n } else {\n context.scale(-1, 1);\n context.drawImage(image, -canvas.width, 0);\n }\n return fromCanvas(canvas, type);\n }\n function crop(ir, x, y, w, h) {\n return ir.toCanvas().then(function (canvas) {\n return applyCrop(canvas, ir.getType(), x, y, w, h);\n });\n }\n function applyCrop(image, type, x, y, w, h) {\n var canvas = create$5(w, h);\n var context = get2dContext(canvas);\n context.drawImage(image, -x, -y);\n return fromCanvas(canvas, type);\n }\n function resize$1(ir, w, h) {\n return ir.toCanvas().then(function (canvas) {\n return scale(canvas, w, h).then(function (newCanvas) {\n return fromCanvas(newCanvas, ir.getType());\n });\n });\n }\n\n var invert$1 = function (ir) {\n return invert(ir);\n };\n var sharpen$1 = function (ir) {\n return sharpen(ir);\n };\n var gamma$1 = function (ir, value) {\n return gamma(ir, value);\n };\n var colorize$1 = function (ir, adjustR, adjustG, adjustB) {\n return colorize(ir, adjustR, adjustG, adjustB);\n };\n var brightness$1 = function (ir, adjust) {\n return brightness(ir, adjust);\n };\n var contrast$1 = function (ir, adjust) {\n return contrast(ir, adjust);\n };\n var flip$1 = function (ir, axis) {\n return flip(ir, axis);\n };\n var crop$1 = function (ir, x, y, w, h) {\n return crop(ir, x, y, w, h);\n };\n var resize$2 = function (ir, w, h) {\n return resize$1(ir, w, h);\n };\n var rotate$1 = function (ir, angle) {\n return rotate(ir, angle);\n };\n\n var renderIcon$1 = function (iconHtml, behaviours) {\n return __assign({\n dom: {\n tag: 'span',\n innerHtml: iconHtml,\n classes: [\n 'tox-icon',\n 'tox-tbtn__icon-wrap'\n ]\n }\n }, behaviours);\n };\n var renderIconFromPack = function (iconName, iconsProvider) {\n return renderIcon$1(get$d(iconName, iconsProvider), {});\n };\n var renderReplacableIconFromPack = function (iconName, iconsProvider) {\n return renderIcon$1(get$d(iconName, iconsProvider), { behaviours: derive$1([Replacing.config({})]) });\n };\n var renderLabel$1 = function (text, prefix, providersBackstage) {\n return {\n dom: {\n tag: 'span',\n innerHtml: providersBackstage.translate(text),\n classes: [prefix + '__select-label']\n },\n behaviours: derive$1([Replacing.config({})])\n };\n };\n\n var internalToolbarButtonExecute = generate$1('toolbar.button.execute');\n var onToolbarButtonExecute = function (info) {\n return runOnExecute(function (comp, _simulatedEvent) {\n runWithApi(info, comp)(function (itemApi) {\n emitWith(comp, internalToolbarButtonExecute, { buttonApi: itemApi });\n info.onAction(itemApi);\n });\n });\n };\n var toolbarButtonEventOrder = {\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'toggling',\n 'toolbar-button-events'\n ]\n };\n\n var updateMenuText = generate$1('update-menu-text');\n var updateMenuIcon = generate$1('update-menu-icon');\n var renderCommonDropdown = function (spec, prefix, sharedBackstage) {\n var editorOffCell = Cell(noop);\n var optMemDisplayText = spec.text.map(function (text) {\n return record(renderLabel$1(text, prefix, sharedBackstage.providers));\n });\n var optMemDisplayIcon = spec.icon.map(function (iconName) {\n return record(renderReplacableIconFromPack(iconName, sharedBackstage.providers.icons));\n });\n var onLeftOrRightInMenu = function (comp, se) {\n var dropdown = Representing.getValue(comp);\n Focusing.focus(dropdown);\n emitWith(dropdown, 'keydown', { raw: se.event().raw() });\n Dropdown.close(dropdown);\n return Option.some(true);\n };\n var role = spec.role.fold(function () {\n return {};\n }, function (role) {\n return { role: role };\n });\n var tooltipAttributes = spec.tooltip.fold(function () {\n return {};\n }, function (tooltip) {\n var translatedTooltip = sharedBackstage.providers.translate(tooltip);\n return {\n 'title': translatedTooltip,\n 'aria-label': translatedTooltip\n };\n });\n var memDropdown = record(Dropdown.sketch(__assign(__assign({}, role), {\n dom: {\n tag: 'button',\n classes: [\n prefix,\n prefix + '--select'\n ].concat(map(spec.classes, function (c) {\n return prefix + '--' + c;\n })),\n attributes: __assign({}, tooltipAttributes)\n },\n components: componentRenderPipeline([\n optMemDisplayIcon.map(function (mem) {\n return mem.asSpec();\n }),\n optMemDisplayText.map(function (mem) {\n return mem.asSpec();\n }),\n Option.some({\n dom: {\n tag: 'div',\n classes: [prefix + '__select-chevron'],\n innerHtml: get$d('chevron-down', sharedBackstage.providers.icons)\n }\n })\n ]),\n matchWidth: true,\n useMinWidth: true,\n dropdownBehaviours: derive$1(__spreadArrays(spec.dropdownBehaviours, [\n DisablingConfigs.button(function () {\n return spec.disabled || sharedBackstage.providers.isReadOnly();\n }),\n receivingConfig(),\n Unselecting.config({}),\n Replacing.config({}),\n config('dropdown-events', [\n onControlAttached(spec, editorOffCell),\n onControlDetached(spec, editorOffCell)\n ]),\n config('menubutton-update-display-text', [\n run(updateMenuText, function (comp, se) {\n optMemDisplayText.bind(function (mem) {\n return mem.getOpt(comp);\n }).each(function (displayText) {\n Replacing.set(displayText, [text(sharedBackstage.providers.translate(se.event().text()))]);\n });\n }),\n run(updateMenuIcon, function (comp, se) {\n optMemDisplayIcon.bind(function (mem) {\n return mem.getOpt(comp);\n }).each(function (displayIcon) {\n Replacing.set(displayIcon, [renderReplacableIconFromPack(se.event().icon(), sharedBackstage.providers.icons)]);\n });\n })\n ])\n ])),\n eventOrder: deepMerge(toolbarButtonEventOrder, {\n mousedown: [\n 'focusing',\n 'alloy.base.behaviour',\n 'item-type-events',\n 'normal-dropdown-events'\n ]\n }),\n sandboxBehaviours: derive$1([Keying.config({\n mode: 'special',\n onLeft: onLeftOrRightInMenu,\n onRight: onLeftOrRightInMenu\n })]),\n lazySink: sharedBackstage.getSink,\n toggleClass: prefix + '--active',\n parts: { menu: part(false, spec.columns, spec.presets) },\n fetch: function () {\n return Future.nu(spec.fetch);\n }\n })));\n return memDropdown.asSpec();\n };\n\n var isMenuItemReference = function (item) {\n return isString(item);\n };\n var isSeparator = function (item) {\n return item.type === 'separator';\n };\n var isExpandingMenuItem = function (item) {\n return has(item, 'getSubmenuItems');\n };\n var separator$1 = { type: 'separator' };\n var unwrapReferences = function (items, menuItems) {\n var realItems = foldl(items, function (acc, item) {\n if (isMenuItemReference(item)) {\n if (item === '') {\n return acc;\n } else if (item === '|') {\n return acc.length > 0 && !isSeparator(acc[acc.length - 1]) ? acc.concat([separator$1]) : acc;\n } else if (has(menuItems, item.toLowerCase())) {\n return acc.concat([menuItems[item.toLowerCase()]]);\n } else {\n return acc;\n }\n } else {\n return acc.concat([item]);\n }\n }, []);\n if (realItems.length > 0 && isSeparator(realItems[realItems.length - 1])) {\n realItems.pop();\n }\n return realItems;\n };\n var getFromExpandingItem = function (item, menuItems) {\n var submenuItems = item.getSubmenuItems();\n var rest = expand(submenuItems, menuItems);\n var newMenus = deepMerge(rest.menus, wrap$1(item.value, rest.items));\n var newExpansions = deepMerge(rest.expansions, wrap$1(item.value, item.value));\n return {\n item: item,\n menus: newMenus,\n expansions: newExpansions\n };\n };\n var getFromItem = function (item, menuItems) {\n return isExpandingMenuItem(item) ? getFromExpandingItem(item, menuItems) : {\n item: item,\n menus: {},\n expansions: {}\n };\n };\n var generateValueIfRequired = function (item) {\n if (isSeparator(item)) {\n return item;\n } else {\n var itemValue = get(item, 'value').getOrThunk(function () {\n return generate$1('generated-menu-item');\n });\n return deepMerge({ value: itemValue }, item);\n }\n };\n var expand = function (items, menuItems) {\n var realItems = unwrapReferences(isString(items) ? items.split(' ') : items, menuItems);\n return foldr(realItems, function (acc, item) {\n var itemWithValue = generateValueIfRequired(item);\n var newData = getFromItem(itemWithValue, menuItems);\n return {\n menus: deepMerge(acc.menus, newData.menus),\n items: [newData.item].concat(acc.items),\n expansions: deepMerge(acc.expansions, newData.expansions)\n };\n }, {\n menus: {},\n expansions: {},\n items: []\n });\n };\n\n var build$2 = function (items, itemResponse, backstage, isHorizontalMenu) {\n var primary = generate$1('primary-menu');\n var data = expand(items, backstage.shared.providers.menuItems());\n if (data.items.length === 0) {\n return Option.none();\n }\n var mainMenu = createPartialMenu(primary, data.items, itemResponse, backstage, isHorizontalMenu);\n var submenus = map$2(data.menus, function (menuItems, menuName) {\n return createPartialMenu(menuName, menuItems, itemResponse, backstage, false);\n });\n var menus = deepMerge(submenus, wrap$1(primary, mainMenu));\n return Option.from(tieredMenu.tieredData(primary, menus, data.expansions));\n };\n\n var getMenuButtonApi = function (component) {\n return {\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n },\n setActive: function (state) {\n var elm = component.element();\n if (state) {\n add$2(elm, 'tox-tbtn--enabled');\n set$1(elm, 'aria-pressed', true);\n } else {\n remove$4(elm, 'tox-tbtn--enabled');\n remove$1(elm, 'aria-pressed');\n }\n },\n isActive: function () {\n return has$2(component.element(), 'tox-tbtn--enabled');\n }\n };\n };\n var renderMenuButton = function (spec, prefix, backstage, role) {\n return renderCommonDropdown({\n text: spec.text,\n icon: spec.icon,\n tooltip: spec.tooltip,\n role: role,\n fetch: function (callback) {\n spec.fetch(function (items) {\n callback(build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, false));\n });\n },\n onSetup: spec.onSetup,\n getApi: getMenuButtonApi,\n columns: 1,\n presets: 'normal',\n classes: [],\n dropdownBehaviours: [Tabstopping.config({})]\n }, prefix, backstage.shared);\n };\n var getFetch$1 = function (items, getButton, backstage) {\n var getMenuItemAction = function (item) {\n return function (api) {\n var newValue = !api.isActive();\n api.setActive(newValue);\n item.storage.set(newValue);\n backstage.shared.getSink().each(function (sink) {\n getButton().getOpt(sink).each(function (orig) {\n focus$1(orig.element());\n emitWith(orig, formActionEvent, {\n name: item.name,\n value: item.storage.get()\n });\n });\n });\n };\n };\n var getMenuItemSetup = function (item) {\n return function (api) {\n api.setActive(item.storage.get());\n };\n };\n return function (success) {\n success(map(items, function (item) {\n var text = item.text.fold(function () {\n return {};\n }, function (text) {\n return { text: text };\n });\n return __assign(__assign({\n type: item.type,\n active: false\n }, text), {\n onAction: getMenuItemAction(item),\n onSetup: getMenuItemSetup(item)\n });\n }));\n };\n };\n\n var renderCommonSpec = function (spec, actionOpt, extraBehaviours, dom, components, providersBackstage) {\n if (extraBehaviours === void 0) {\n extraBehaviours = [];\n }\n var action = actionOpt.fold(function () {\n return {};\n }, function (action) {\n return { action: action };\n });\n var common = __assign({\n buttonBehaviours: derive$1([\n DisablingConfigs.button(function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }),\n receivingConfig(),\n Tabstopping.config({}),\n config('button press', [\n preventDefault('click'),\n preventDefault('mousedown')\n ])\n ].concat(extraBehaviours)),\n eventOrder: {\n click: [\n 'button press',\n 'alloy.base.behaviour'\n ],\n mousedown: [\n 'button press',\n 'alloy.base.behaviour'\n ]\n }\n }, action);\n var domFinal = deepMerge(common, { dom: dom });\n return deepMerge(domFinal, { components: components });\n };\n var renderIconButtonSpec = function (spec, action, providersBackstage, extraBehaviours) {\n if (extraBehaviours === void 0) {\n extraBehaviours = [];\n }\n var tooltipAttributes = spec.tooltip.map(function (tooltip) {\n return {\n 'aria-label': providersBackstage.translate(tooltip),\n 'title': providersBackstage.translate(tooltip)\n };\n }).getOr({});\n var dom = {\n tag: 'button',\n classes: ['tox-tbtn'],\n attributes: tooltipAttributes\n };\n var icon = spec.icon.map(function (iconName) {\n return renderIconFromPack(iconName, providersBackstage.icons);\n });\n var components = componentRenderPipeline([icon]);\n return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage);\n };\n var renderIconButton = function (spec, action, providersBackstage, extraBehaviours) {\n if (extraBehaviours === void 0) {\n extraBehaviours = [];\n }\n var iconButtonSpec = renderIconButtonSpec(spec, Option.some(action), providersBackstage, extraBehaviours);\n return Button.sketch(iconButtonSpec);\n };\n var renderButtonSpec = function (spec, action, providersBackstage, extraBehaviours, extraClasses) {\n if (extraBehaviours === void 0) {\n extraBehaviours = [];\n }\n if (extraClasses === void 0) {\n extraClasses = [];\n }\n var translatedText = providersBackstage.translate(spec.text);\n var icon = spec.icon ? spec.icon.map(function (iconName) {\n return renderIconFromPack(iconName, providersBackstage.icons);\n }) : Option.none();\n var components = icon.isSome() ? componentRenderPipeline([icon]) : [];\n var innerHtml = icon.isSome() ? {} : { innerHtml: translatedText };\n var classes = __spreadArrays(!spec.primary && !spec.borderless ? [\n 'tox-button',\n 'tox-button--secondary'\n ] : ['tox-button'], icon.isSome() ? ['tox-button--icon'] : [], spec.borderless ? ['tox-button--naked'] : [], extraClasses);\n var dom = __assign(__assign({\n tag: 'button',\n classes: classes\n }, innerHtml), { attributes: { title: translatedText } });\n return renderCommonSpec(spec, action, extraBehaviours, dom, components, providersBackstage);\n };\n var renderButton = function (spec, action, providersBackstage, extraBehaviours, extraClasses) {\n if (extraBehaviours === void 0) {\n extraBehaviours = [];\n }\n if (extraClasses === void 0) {\n extraClasses = [];\n }\n var buttonSpec = renderButtonSpec(spec, Option.some(action), providersBackstage, extraBehaviours, extraClasses);\n return Button.sketch(buttonSpec);\n };\n var getAction = function (name, buttonType) {\n return function (comp) {\n if (buttonType === 'custom') {\n emitWith(comp, formActionEvent, {\n name: name,\n value: {}\n });\n } else if (buttonType === 'submit') {\n emit(comp, formSubmitEvent);\n } else if (buttonType === 'cancel') {\n emit(comp, formCancelEvent);\n } else {\n domGlobals.console.error('Unknown button type: ', buttonType);\n }\n };\n };\n var isMenuFooterButtonSpec = function (spec, buttonType) {\n return buttonType === 'menu';\n };\n var isNormalFooterButtonSpec = function (spec, buttonType) {\n return buttonType === 'custom' || buttonType === 'cancel' || buttonType === 'submit';\n };\n var renderFooterButton = function (spec, buttonType, backstage) {\n if (isMenuFooterButtonSpec(spec, buttonType)) {\n var getButton = function () {\n return memButton_1;\n };\n var menuButtonSpec = spec;\n var fixedSpec = __assign(__assign({}, spec), {\n onSetup: function (api) {\n api.setDisabled(spec.disabled);\n return noop;\n },\n fetch: getFetch$1(menuButtonSpec.items, getButton, backstage)\n });\n var memButton_1 = record(renderMenuButton(fixedSpec, 'tox-tbtn', backstage, Option.none()));\n return memButton_1.asSpec();\n } else if (isNormalFooterButtonSpec(spec, buttonType)) {\n var action = getAction(spec.name, buttonType);\n var buttonSpec = __assign(__assign({}, spec), { borderless: false });\n return renderButton(buttonSpec, action, backstage.shared.providers, []);\n } else {\n domGlobals.console.error('Unknown footer button type: ', buttonType);\n }\n };\n var renderDialogButton = function (spec, providersBackstage) {\n var action = getAction(spec.name, 'custom');\n return renderFormField(Option.none(), FormField.parts().field(__assign({ factory: Button }, renderButtonSpec(spec, Option.some(action), providersBackstage, [\n RepresentingConfigs.memory(''),\n ComposingConfigs.self()\n ]))));\n };\n\n var schema$i = constant([\n defaulted$1('field1Name', 'field1'),\n defaulted$1('field2Name', 'field2'),\n onStrictHandler('onLockedChange'),\n markers(['lockClass']),\n defaulted$1('locked', false),\n SketchBehaviours.field('coupledFieldBehaviours', [\n Composing,\n Representing\n ])\n ]);\n var getField = function (comp, detail, partName) {\n return getPart(comp, detail, partName).bind(Composing.getCurrent);\n };\n var coupledPart = function (selfName, otherName) {\n return required({\n factory: FormField,\n name: selfName,\n overrides: function (detail) {\n return {\n fieldBehaviours: derive$1([config('coupled-input-behaviour', [run(input(), function (me) {\n getField(me, detail, otherName).each(function (other) {\n getPart(me, detail, 'lock').each(function (lock) {\n if (Toggling.isOn(lock)) {\n detail.onLockedChange(me, other, lock);\n }\n });\n });\n })])])\n };\n }\n });\n };\n var parts$5 = constant([\n coupledPart('field1', 'field2'),\n coupledPart('field2', 'field1'),\n required({\n factory: Button,\n schema: [strict$1('dom')],\n name: 'lock',\n overrides: function (detail) {\n return {\n buttonBehaviours: derive$1([Toggling.config({\n selected: detail.locked,\n toggleClass: detail.markers.lockClass,\n aria: { mode: 'pressed' }\n })])\n };\n }\n })\n ]);\n\n var factory$7 = function (detail, components, _spec, _externals) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: SketchBehaviours.augment(detail.coupledFieldBehaviours, [\n Composing.config({ find: Option.some }),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (comp) {\n var _a;\n var parts = getPartsOrDie(comp, detail, [\n 'field1',\n 'field2'\n ]);\n return _a = {}, _a[detail.field1Name] = Representing.getValue(parts.field1()), _a[detail.field2Name] = Representing.getValue(parts.field2()), _a;\n },\n setValue: function (comp, value) {\n var parts = getPartsOrDie(comp, detail, [\n 'field1',\n 'field2'\n ]);\n if (hasNonNullableKey(value, detail.field1Name)) {\n Representing.setValue(parts.field1(), value[detail.field1Name]);\n }\n if (hasNonNullableKey(value, detail.field2Name)) {\n Representing.setValue(parts.field2(), value[detail.field2Name]);\n }\n }\n }\n })\n ]),\n apis: {\n getField1: function (component) {\n return getPart(component, detail, 'field1');\n },\n getField2: function (component) {\n return getPart(component, detail, 'field2');\n },\n getLock: function (component) {\n return getPart(component, detail, 'lock');\n }\n }\n };\n };\n var FormCoupledInputs = composite$1({\n name: 'FormCoupledInputs',\n configFields: schema$i(),\n partFields: parts$5(),\n factory: factory$7,\n apis: {\n getField1: function (apis, component) {\n return apis.getField1(component);\n },\n getField2: function (apis, component) {\n return apis.getField2(component);\n },\n getLock: function (apis, component) {\n return apis.getLock(component);\n }\n }\n });\n\n var formatSize = function (size) {\n var unitDec = {\n '': 0,\n 'px': 0,\n 'pt': 1,\n 'mm': 1,\n 'pc': 2,\n 'ex': 2,\n 'em': 2,\n 'ch': 2,\n 'rem': 2,\n 'cm': 3,\n 'in': 4,\n '%': 4\n };\n var maxDecimal = function (unit) {\n return unit in unitDec ? unitDec[unit] : 1;\n };\n var numText = size.value.toFixed(maxDecimal(size.unit));\n if (numText.indexOf('.') !== -1) {\n numText = numText.replace(/\\.?0*$/, '');\n }\n return numText + size.unit;\n };\n var parseSize = function (sizeText) {\n var numPattern = /^\\s*(\\d+(?:\\.\\d+)?)\\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\\s*$/;\n var match = numPattern.exec(sizeText);\n if (match !== null) {\n var value = parseFloat(match[1]);\n var unit = match[2];\n return Result.value({\n value: value,\n unit: unit\n });\n } else {\n return Result.error(sizeText);\n }\n };\n var convertUnit = function (size, unit) {\n var inInch = {\n '': 96,\n 'px': 96,\n 'pt': 72,\n 'cm': 2.54,\n 'pc': 12,\n 'mm': 25.4,\n 'in': 1\n };\n var supported = function (u) {\n return Object.prototype.hasOwnProperty.call(inInch, u);\n };\n if (size.unit === unit) {\n return Option.some(size.value);\n } else if (supported(size.unit) && supported(unit)) {\n if (inInch[size.unit] === inInch[unit]) {\n return Option.some(size.value);\n } else {\n return Option.some(size.value / inInch[size.unit] * inInch[unit]);\n }\n } else {\n return Option.none();\n }\n };\n var noSizeConversion = function (_input) {\n return Option.none();\n };\n var ratioSizeConversion = function (scale, unit) {\n return function (size) {\n return convertUnit(size, unit).map(function (value) {\n return {\n value: value * scale,\n unit: unit\n };\n });\n };\n };\n var makeRatioConverter = function (currentFieldText, otherFieldText) {\n var cValue = parseSize(currentFieldText).toOption();\n var oValue = parseSize(otherFieldText).toOption();\n return lift2(cValue, oValue, function (cSize, oSize) {\n return convertUnit(cSize, oSize.unit).map(function (val) {\n return oSize.value / val;\n }).map(function (r) {\n return ratioSizeConversion(r, oSize.unit);\n }).getOr(noSizeConversion);\n }).getOr(noSizeConversion);\n };\n\n var renderSizeInput = function (spec, providersBackstage) {\n var converter = noSizeConversion;\n var ratioEvent = generate$1('ratio-event');\n var pLock = FormCoupledInputs.parts().lock({\n dom: {\n tag: 'button',\n classes: [\n 'tox-lock',\n 'tox-button',\n 'tox-button--naked',\n 'tox-button--icon'\n ],\n attributes: { title: providersBackstage.translate(spec.label.getOr('Constrain proportions')) }\n },\n components: [\n {\n dom: {\n tag: 'span',\n classes: [\n 'tox-icon',\n 'tox-lock-icon__lock'\n ],\n innerHtml: get$d('lock', providersBackstage.icons)\n }\n },\n {\n dom: {\n tag: 'span',\n classes: [\n 'tox-icon',\n 'tox-lock-icon__unlock'\n ],\n innerHtml: get$d('unlock', providersBackstage.icons)\n }\n }\n ],\n buttonBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n }),\n receivingConfig(),\n Tabstopping.config({})\n ])\n });\n var formGroup = function (components) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-form__group']\n },\n components: components\n };\n };\n var getFieldPart = function (isField1) {\n return FormField.parts().field({\n factory: Input,\n inputClasses: ['tox-textfield'],\n inputBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n }),\n receivingConfig(),\n Tabstopping.config({}),\n config('size-input-events', [\n run(focusin(), function (component, _simulatedEvent) {\n emitWith(component, ratioEvent, { isField1: isField1 });\n }),\n run(change(), function (component, _simulatedEvent) {\n emitWith(component, formChangeEvent, { name: spec.name });\n })\n ])\n ]),\n selectOnFocus: false\n });\n };\n var getLabel = function (label) {\n return {\n dom: {\n tag: 'label',\n classes: ['tox-label'],\n innerHtml: providersBackstage.translate(label)\n }\n };\n };\n var widthField = FormCoupledInputs.parts().field1(formGroup([\n FormField.parts().label(getLabel('Width')),\n getFieldPart(true)\n ]));\n var heightField = FormCoupledInputs.parts().field2(formGroup([\n FormField.parts().label(getLabel('Height')),\n getFieldPart(false)\n ]));\n return FormCoupledInputs.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-form__group']\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-form__controls-h-stack']\n },\n components: [\n widthField,\n heightField,\n formGroup([\n getLabel(' '),\n pLock\n ])\n ]\n }],\n field1Name: 'width',\n field2Name: 'height',\n locked: true,\n markers: { lockClass: 'tox-locked' },\n onLockedChange: function (current, other, _lock) {\n parseSize(Representing.getValue(current)).each(function (size) {\n converter(size).each(function (newSize) {\n Representing.setValue(other, formatSize(newSize));\n });\n });\n },\n coupledFieldBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n },\n onDisabled: function (comp) {\n FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.disable);\n FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.disable);\n FormCoupledInputs.getLock(comp).each(Disabling.disable);\n },\n onEnabled: function (comp) {\n FormCoupledInputs.getField1(comp).bind(FormField.getField).each(Disabling.enable);\n FormCoupledInputs.getField2(comp).bind(FormField.getField).each(Disabling.enable);\n FormCoupledInputs.getLock(comp).each(Disabling.enable);\n }\n }),\n receivingConfig(),\n config('size-input-events2', [run(ratioEvent, function (component, simulatedEvent) {\n var isField1 = simulatedEvent.event().isField1();\n var optCurrent = isField1 ? FormCoupledInputs.getField1(component) : FormCoupledInputs.getField2(component);\n var optOther = isField1 ? FormCoupledInputs.getField2(component) : FormCoupledInputs.getField1(component);\n var value1 = optCurrent.map(Representing.getValue).getOr('');\n var value2 = optOther.map(Representing.getValue).getOr('');\n converter = makeRatioConverter(value1, value2);\n })])\n ])\n });\n };\n\n var undo = constant(generate$1('undo'));\n var redo = constant(generate$1('redo'));\n var zoom = constant(generate$1('zoom'));\n var back = constant(generate$1('back'));\n var apply = constant(generate$1('apply'));\n var swap = constant(generate$1('swap'));\n var transform = constant(generate$1('transform'));\n var tempTransform = constant(generate$1('temp-transform'));\n var transformApply = constant(generate$1('transform-apply'));\n var internal = {\n undo: undo,\n redo: redo,\n zoom: zoom,\n back: back,\n apply: apply,\n swap: swap,\n transform: transform,\n tempTransform: tempTransform,\n transformApply: transformApply\n };\n var saveState = constant('save-state');\n var disable$1 = constant('disable');\n var enable$1 = constant('enable');\n var external$2 = {\n formActionEvent: formActionEvent,\n saveState: saveState,\n disable: disable$1,\n enable: enable$1\n };\n\n var renderEditPanel = function (imagePanel, providersBackstage) {\n var createButton = function (text, action, disabled, primary) {\n return record(renderButton({\n name: text,\n text: text,\n disabled: disabled,\n primary: primary,\n icon: Option.none(),\n borderless: false\n }, action, providersBackstage));\n };\n var createIconButton = function (icon, tooltip, action, disabled) {\n return record(renderIconButton({\n name: icon,\n icon: Option.some(icon),\n tooltip: Option.some(tooltip),\n disabled: disabled,\n primary: false,\n borderless: false\n }, action, providersBackstage));\n };\n var disableAllComponents = function (comps, eventcomp) {\n comps.map(function (mem) {\n var component = mem.get(eventcomp);\n if (component.hasConfigured(Disabling)) {\n Disabling.disable(component);\n }\n });\n };\n var enableAllComponents = function (comps, eventcomp) {\n comps.map(function (mem) {\n var component = mem.get(eventcomp);\n if (component.hasConfigured(Disabling)) {\n Disabling.enable(component);\n }\n });\n };\n var panelDom = {\n tag: 'div',\n classes: [\n 'tox-image-tools__toolbar',\n 'tox-image-tools-edit-panel'\n ]\n };\n var noop$1 = noop;\n var emit$1 = function (comp, event, data) {\n emitWith(comp, event, data);\n };\n var emitDisable = function (component) {\n return emit(component, external$2.disable());\n };\n var emitEnable = function (component) {\n return emit(component, external$2.enable());\n };\n var emitTransform = function (comp, transform) {\n emitDisable(comp);\n emit$1(comp, internal.transform(), { transform: transform });\n emitEnable(comp);\n };\n var emitTempTransform = function (comp, transform) {\n emitDisable(comp);\n emit$1(comp, internal.tempTransform(), { transform: transform });\n emitEnable(comp);\n };\n var getBackSwap = function (anyInSystem) {\n return function () {\n memContainer.getOpt(anyInSystem).each(function (container) {\n Replacing.set(container, [ButtonPanel]);\n });\n };\n };\n var emitTransformApply = function (comp, transform) {\n emitDisable(comp);\n emit$1(comp, internal.transformApply(), {\n transform: transform,\n swap: getBackSwap(comp)\n });\n emitEnable(comp);\n };\n var createBackButton = function () {\n return createButton('Back', function (button) {\n return emit$1(button, internal.back(), { swap: getBackSwap(button) });\n }, false, false);\n };\n var createSpacer = function () {\n return record({\n dom: {\n tag: 'div',\n classes: ['tox-spacer']\n },\n behaviours: derive$1([Disabling.config({})])\n });\n };\n var createApplyButton = function () {\n return createButton('Apply', function (button) {\n return emit$1(button, internal.apply(), { swap: getBackSwap(button) });\n }, true, true);\n };\n var makeCropTransform = function () {\n return function (ir) {\n var rect = imagePanel.getRect();\n return crop$1(ir, rect.x, rect.y, rect.w, rect.h);\n };\n };\n var cropPanelComponents = [\n createBackButton(),\n createSpacer(),\n createButton('Apply', function (button) {\n var transform = makeCropTransform();\n emitTransformApply(button, transform);\n imagePanel.hideCrop();\n }, false, true)\n ];\n var CropPanel = Container.sketch({\n dom: panelDom,\n components: cropPanelComponents.map(function (mem) {\n return mem.asSpec();\n }),\n containerBehaviours: derive$1([config('image-tools-crop-buttons-events', [\n run(external$2.disable(), function (comp, _se) {\n disableAllComponents(cropPanelComponents, comp);\n }),\n run(external$2.enable(), function (comp, _se) {\n enableAllComponents(cropPanelComponents, comp);\n })\n ])])\n });\n var memSize = record(renderSizeInput({\n name: 'size',\n label: Option.none(),\n constrain: true,\n disabled: false\n }, providersBackstage));\n var makeResizeTransform = function (width, height) {\n return function (ir) {\n return resize$2(ir, width, height);\n };\n };\n var resizePanelComponents = [\n createBackButton(),\n createSpacer(),\n memSize,\n createSpacer(),\n createButton('Apply', function (button) {\n memSize.getOpt(button).each(function (sizeInput) {\n var value = Representing.getValue(sizeInput);\n var width = parseInt(value.width, 10);\n var height = parseInt(value.height, 10);\n var transform = makeResizeTransform(width, height);\n emitTransformApply(button, transform);\n });\n }, false, true)\n ];\n var ResizePanel = Container.sketch({\n dom: panelDom,\n components: resizePanelComponents.map(function (mem) {\n return mem.asSpec();\n }),\n containerBehaviours: derive$1([config('image-tools-resize-buttons-events', [\n run(external$2.disable(), function (comp, _se) {\n disableAllComponents(resizePanelComponents, comp);\n }),\n run(external$2.enable(), function (comp, _se) {\n enableAllComponents(resizePanelComponents, comp);\n })\n ])])\n });\n var makeValueTransform = function (transform, value) {\n return function (ir) {\n return transform(ir, value);\n };\n };\n var horizontalFlip = makeValueTransform(flip$1, 'h');\n var verticalFlip = makeValueTransform(flip$1, 'v');\n var counterclockwiseRotate = makeValueTransform(rotate$1, -90);\n var clockwiseRotate = makeValueTransform(rotate$1, 90);\n var flipRotateOnAction = function (comp, operation) {\n emitTempTransform(comp, operation);\n };\n var flipRotateComponents = [\n createBackButton(),\n createSpacer(),\n createIconButton('flip-horizontally', 'Flip horizontally', function (button) {\n flipRotateOnAction(button, horizontalFlip);\n }, false),\n createIconButton('flip-vertically', 'Flip vertically', function (button) {\n flipRotateOnAction(button, verticalFlip);\n }, false),\n createIconButton('rotate-left', 'Rotate counterclockwise', function (button) {\n flipRotateOnAction(button, counterclockwiseRotate);\n }, false),\n createIconButton('rotate-right', 'Rotate clockwise', function (button) {\n flipRotateOnAction(button, clockwiseRotate);\n }, false),\n createSpacer(),\n createApplyButton()\n ];\n var FlipRotatePanel = Container.sketch({\n dom: panelDom,\n components: flipRotateComponents.map(function (mem) {\n return mem.asSpec();\n }),\n containerBehaviours: derive$1([config('image-tools-fliprotate-buttons-events', [\n run(external$2.disable(), function (comp, _se) {\n disableAllComponents(flipRotateComponents, comp);\n }),\n run(external$2.enable(), function (comp, _se) {\n enableAllComponents(flipRotateComponents, comp);\n })\n ])])\n });\n var makeSlider = function (label, onChoose, min, value, max) {\n var labelPart = Slider.parts().label({\n dom: {\n tag: 'label',\n classes: ['tox-label'],\n innerHtml: providersBackstage.translate(label)\n }\n });\n var spectrum = Slider.parts().spectrum({\n dom: {\n tag: 'div',\n classes: ['tox-slider__rail'],\n attributes: { role: 'presentation' }\n }\n });\n var thumb = Slider.parts().thumb({\n dom: {\n tag: 'div',\n classes: ['tox-slider__handle'],\n attributes: { role: 'presentation' }\n }\n });\n return record(Slider.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-slider'],\n attributes: { role: 'presentation' }\n },\n model: {\n mode: 'x',\n minX: min,\n maxX: max,\n getInitialValue: constant({ x: constant(value) })\n },\n components: [\n labelPart,\n spectrum,\n thumb\n ],\n sliderBehaviours: derive$1([Focusing.config({})]),\n onChoose: onChoose\n }));\n };\n var makeVariableSlider = function (label, transform, min, value, max) {\n var onChoose = function (slider, _thumb, value) {\n var valTransform = makeValueTransform(transform, value.x() / 100);\n emitTransform(slider, valTransform);\n };\n return makeSlider(label, onChoose, min, value, max);\n };\n var variableFilterPanelComponents = function (label, transform, min, value, max) {\n return [\n createBackButton(),\n makeVariableSlider(label, transform, min, value, max),\n createApplyButton()\n ];\n };\n var createVariableFilterPanel = function (label, transform, min, value, max) {\n var filterPanelComponents = variableFilterPanelComponents(label, transform, min, value, max);\n return Container.sketch({\n dom: panelDom,\n components: filterPanelComponents.map(function (mem) {\n return mem.asSpec();\n }),\n containerBehaviours: derive$1([config('image-tools-filter-panel-buttons-events', [\n run(external$2.disable(), function (comp, _se) {\n disableAllComponents(filterPanelComponents, comp);\n }),\n run(external$2.enable(), function (comp, _se) {\n enableAllComponents(filterPanelComponents, comp);\n })\n ])])\n });\n };\n var filterPanelComponents = [\n createBackButton(),\n createSpacer(),\n createApplyButton()\n ];\n var FilterPanel = Container.sketch({\n dom: panelDom,\n components: filterPanelComponents.map(function (mem) {\n return mem.asSpec();\n })\n });\n var BrightnessPanel = createVariableFilterPanel('Brightness', brightness$1, -100, 0, 100);\n var ContrastPanel = createVariableFilterPanel('Contrast', contrast$1, -100, 0, 100);\n var GammaPanel = createVariableFilterPanel('Gamma', gamma$1, -100, 0, 100);\n var makeColorTransform = function (red, green, blue) {\n return function (ir) {\n return colorize$1(ir, red, green, blue);\n };\n };\n var makeColorSlider = function (label) {\n var onChoose = function (slider, _thumb, _value) {\n var redOpt = memRed.getOpt(slider);\n var blueOpt = memBlue.getOpt(slider);\n var greenOpt = memGreen.getOpt(slider);\n redOpt.each(function (red) {\n blueOpt.each(function (blue) {\n greenOpt.each(function (green) {\n var r = Representing.getValue(red).x() / 100;\n var g = Representing.getValue(green).x() / 100;\n var b = Representing.getValue(blue).x() / 100;\n var transform = makeColorTransform(r, g, b);\n emitTransform(slider, transform);\n });\n });\n });\n };\n return makeSlider(label, onChoose, 0, 100, 200);\n };\n var memRed = makeColorSlider('R');\n var memGreen = makeColorSlider('G');\n var memBlue = makeColorSlider('B');\n var colorizePanelComponents = [\n createBackButton(),\n memRed,\n memGreen,\n memBlue,\n createApplyButton()\n ];\n var ColorizePanel = Container.sketch({\n dom: panelDom,\n components: colorizePanelComponents.map(function (mem) {\n return mem.asSpec();\n })\n });\n var getTransformPanelEvent = function (panel, transform, update) {\n return function (button) {\n var swap = function () {\n memContainer.getOpt(button).each(function (container) {\n Replacing.set(container, [panel]);\n update(container);\n });\n };\n emit$1(button, internal.swap(), {\n transform: transform,\n swap: swap\n });\n };\n };\n var cropPanelUpdate = function (_anyInSystem) {\n imagePanel.showCrop();\n };\n var resizePanelUpdate = function (anyInSystem) {\n memSize.getOpt(anyInSystem).each(function (sizeInput) {\n var measurements = imagePanel.getMeasurements();\n var width = measurements.width;\n var height = measurements.height;\n Representing.setValue(sizeInput, {\n width: width,\n height: height\n });\n });\n };\n var sharpenTransform = Option.some(sharpen$1);\n var invertTransform = Option.some(invert$1);\n var buttonPanelComponents = [\n createIconButton('crop', 'Crop', getTransformPanelEvent(CropPanel, Option.none(), cropPanelUpdate), false),\n createIconButton('resize', 'Resize', getTransformPanelEvent(ResizePanel, Option.none(), resizePanelUpdate), false),\n createIconButton('orientation', 'Orientation', getTransformPanelEvent(FlipRotatePanel, Option.none(), noop$1), false),\n createIconButton('brightness', 'Brightness', getTransformPanelEvent(BrightnessPanel, Option.none(), noop$1), false),\n createIconButton('sharpen', 'Sharpen', getTransformPanelEvent(FilterPanel, sharpenTransform, noop$1), false),\n createIconButton('contrast', 'Contrast', getTransformPanelEvent(ContrastPanel, Option.none(), noop$1), false),\n createIconButton('color-levels', 'Color levels', getTransformPanelEvent(ColorizePanel, Option.none(), noop$1), false),\n createIconButton('gamma', 'Gamma', getTransformPanelEvent(GammaPanel, Option.none(), noop$1), false),\n createIconButton('invert', 'Invert', getTransformPanelEvent(FilterPanel, invertTransform, noop$1), false)\n ];\n var ButtonPanel = Container.sketch({\n dom: panelDom,\n components: buttonPanelComponents.map(function (mem) {\n return mem.asSpec();\n })\n });\n var container = Container.sketch({\n dom: { tag: 'div' },\n components: [ButtonPanel],\n containerBehaviours: derive$1([Replacing.config({})])\n });\n var memContainer = record(container);\n var getApplyButton = function (anyInSystem) {\n return memContainer.getOpt(anyInSystem).map(function (container) {\n var panel = container.components()[0];\n return panel.components()[panel.components().length - 1];\n });\n };\n return {\n memContainer: memContainer,\n getApplyButton: getApplyButton\n };\n };\n\n var global$b = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');\n\n var global$c = tinymce.util.Tools.resolve('tinymce.geom.Rect');\n\n var global$d = tinymce.util.Tools.resolve('tinymce.util.Observable');\n\n var global$e = tinymce.util.Tools.resolve('tinymce.util.Tools');\n\n var global$f = tinymce.util.Tools.resolve('tinymce.util.VK');\n\n function getDocumentSize(doc) {\n var max = Math.max;\n var documentElement = doc.documentElement;\n var body = doc.body;\n var scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);\n var clientWidth = max(documentElement.clientWidth, body.clientWidth);\n var offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);\n var scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);\n var clientHeight = max(documentElement.clientHeight, body.clientHeight);\n var offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);\n return {\n width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,\n height: scrollHeight < offsetHeight ? clientHeight : scrollHeight\n };\n }\n function updateWithTouchData(e) {\n var keys, i;\n if (e.changedTouches) {\n keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');\n for (i = 0; i < keys.length; i++) {\n e[keys[i]] = e.changedTouches[0][keys[i]];\n }\n }\n }\n function DragHelper (id, settings) {\n var $eventOverlay;\n var doc = settings.document || domGlobals.document;\n var downButton;\n var startX, startY;\n settings = settings || {};\n var handleElement = doc.getElementById(settings.handle || id);\n var start = function (e) {\n var docSize = getDocumentSize(doc);\n var cursor;\n updateWithTouchData(e);\n e.preventDefault();\n downButton = e.button;\n var handleElm = handleElement;\n startX = e.screenX;\n startY = e.screenY;\n if (domGlobals.window.getComputedStyle) {\n cursor = domGlobals.window.getComputedStyle(handleElm, null).getPropertyValue('cursor');\n } else {\n cursor = handleElm.runtimeStyle.cursor;\n }\n $eventOverlay = global$b('
').css({\n position: 'absolute',\n top: 0,\n left: 0,\n width: docSize.width,\n height: docSize.height,\n zIndex: 2147483647,\n opacity: 0.0001,\n cursor: cursor\n }).appendTo(doc.body);\n global$b(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop);\n settings.start(e);\n };\n var drag = function (e) {\n updateWithTouchData(e);\n if (e.button !== downButton) {\n return stop(e);\n }\n e.deltaX = e.screenX - startX;\n e.deltaY = e.screenY - startY;\n e.preventDefault();\n settings.drag(e);\n };\n var stop = function (e) {\n updateWithTouchData(e);\n global$b(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop);\n $eventOverlay.remove();\n if (settings.stop) {\n settings.stop(e);\n }\n };\n this.destroy = function () {\n global$b(handleElement).off();\n };\n global$b(handleElement).on('mousedown touchstart', start);\n }\n\n var count = 0;\n var create$7 = function (currentRect, viewPortRect, clampRect, containerElm, action) {\n var dragHelpers;\n var prefix = 'tox-';\n var id = prefix + 'crid-' + count++;\n var handles = [\n {\n name: 'move',\n xMul: 0,\n yMul: 0,\n deltaX: 1,\n deltaY: 1,\n deltaW: 0,\n deltaH: 0,\n label: 'Crop Mask'\n },\n {\n name: 'nw',\n xMul: 0,\n yMul: 0,\n deltaX: 1,\n deltaY: 1,\n deltaW: -1,\n deltaH: -1,\n label: 'Top Left Crop Handle'\n },\n {\n name: 'ne',\n xMul: 1,\n yMul: 0,\n deltaX: 0,\n deltaY: 1,\n deltaW: 1,\n deltaH: -1,\n label: 'Top Right Crop Handle'\n },\n {\n name: 'sw',\n xMul: 0,\n yMul: 1,\n deltaX: 1,\n deltaY: 0,\n deltaW: -1,\n deltaH: 1,\n label: 'Bottom Left Crop Handle'\n },\n {\n name: 'se',\n xMul: 1,\n yMul: 1,\n deltaX: 0,\n deltaY: 0,\n deltaW: 1,\n deltaH: 1,\n label: 'Bottom Right Crop Handle'\n }\n ];\n var blockers = [\n 'top',\n 'right',\n 'bottom',\n 'left'\n ];\n var getAbsoluteRect = function (outerRect, relativeRect) {\n return {\n x: relativeRect.x + outerRect.x,\n y: relativeRect.y + outerRect.y,\n w: relativeRect.w,\n h: relativeRect.h\n };\n };\n var getRelativeRect = function (outerRect, innerRect) {\n return {\n x: innerRect.x - outerRect.x,\n y: innerRect.y - outerRect.y,\n w: innerRect.w,\n h: innerRect.h\n };\n };\n var getInnerRect = function () {\n return getRelativeRect(clampRect, currentRect);\n };\n function moveRect(handle, startRect, deltaX, deltaY) {\n var x, y, w, h, rect;\n x = startRect.x;\n y = startRect.y;\n w = startRect.w;\n h = startRect.h;\n x += deltaX * handle.deltaX;\n y += deltaY * handle.deltaY;\n w += deltaX * handle.deltaW;\n h += deltaY * handle.deltaH;\n if (w < 20) {\n w = 20;\n }\n if (h < 20) {\n h = 20;\n }\n rect = currentRect = global$c.clamp({\n x: x,\n y: y,\n w: w,\n h: h\n }, clampRect, handle.name === 'move');\n rect = getRelativeRect(clampRect, rect);\n instance.fire('updateRect', { rect: rect });\n setInnerRect(rect);\n }\n function render() {\n function createDragHelper(handle) {\n var startRect;\n return new DragHelper(id, {\n document: containerElm.ownerDocument,\n handle: id + '-' + handle.name,\n start: function () {\n startRect = currentRect;\n },\n drag: function (e) {\n moveRect(handle, startRect, e.deltaX, e.deltaY);\n }\n });\n }\n global$b('
').appendTo(containerElm);\n global$e.each(blockers, function (blocker) {\n global$b('#' + id, containerElm).append('
');\n });\n global$e.each(handles, function (handle) {\n global$b('#' + id, containerElm).append('
');\n });\n dragHelpers = global$e.map(handles, createDragHelper);\n repaint(currentRect);\n global$b(containerElm).on('focusin focusout', function (e) {\n global$b(e.target).attr('aria-grabbed', e.type === 'focus' ? 'true' : 'false');\n });\n global$b(containerElm).on('keydown', function (e) {\n var activeHandle;\n global$e.each(handles, function (handle) {\n if (e.target.id === id + '-' + handle.name) {\n activeHandle = handle;\n return false;\n }\n });\n function moveAndBlock(evt, handle, startRect, deltaX, deltaY) {\n evt.stopPropagation();\n evt.preventDefault();\n moveRect(activeHandle, startRect, deltaX, deltaY);\n }\n switch (e.keyCode) {\n case global$f.LEFT:\n moveAndBlock(e, activeHandle, currentRect, -10, 0);\n break;\n case global$f.RIGHT:\n moveAndBlock(e, activeHandle, currentRect, 10, 0);\n break;\n case global$f.UP:\n moveAndBlock(e, activeHandle, currentRect, 0, -10);\n break;\n case global$f.DOWN:\n moveAndBlock(e, activeHandle, currentRect, 0, 10);\n break;\n case global$f.ENTER:\n case global$f.SPACEBAR:\n e.preventDefault();\n action();\n break;\n }\n });\n }\n function toggleVisibility(state) {\n var selectors = global$e.map(handles, function (handle) {\n return '#' + id + '-' + handle.name;\n }).concat(global$e.map(blockers, function (blocker) {\n return '#' + id + '-' + blocker;\n })).join(',');\n if (state) {\n global$b(selectors, containerElm).show();\n } else {\n global$b(selectors, containerElm).hide();\n }\n }\n function repaint(rect) {\n function updateElementRect(name, rect) {\n if (rect.h < 0) {\n rect.h = 0;\n }\n if (rect.w < 0) {\n rect.w = 0;\n }\n global$b('#' + id + '-' + name, containerElm).css({\n left: rect.x,\n top: rect.y,\n width: rect.w,\n height: rect.h\n });\n }\n global$e.each(handles, function (handle) {\n global$b('#' + id + '-' + handle.name, containerElm).css({\n left: rect.w * handle.xMul + rect.x,\n top: rect.h * handle.yMul + rect.y\n });\n });\n updateElementRect('top', {\n x: viewPortRect.x,\n y: viewPortRect.y,\n w: viewPortRect.w,\n h: rect.y - viewPortRect.y\n });\n updateElementRect('right', {\n x: rect.x + rect.w,\n y: rect.y,\n w: viewPortRect.w - rect.x - rect.w + viewPortRect.x,\n h: rect.h\n });\n updateElementRect('bottom', {\n x: viewPortRect.x,\n y: rect.y + rect.h,\n w: viewPortRect.w,\n h: viewPortRect.h - rect.y - rect.h + viewPortRect.y\n });\n updateElementRect('left', {\n x: viewPortRect.x,\n y: rect.y,\n w: rect.x - viewPortRect.x,\n h: rect.h\n });\n updateElementRect('move', rect);\n }\n function setRect(rect) {\n currentRect = rect;\n repaint(currentRect);\n }\n function setViewPortRect(rect) {\n viewPortRect = rect;\n repaint(currentRect);\n }\n function setInnerRect(rect) {\n setRect(getAbsoluteRect(clampRect, rect));\n }\n function setClampRect(rect) {\n clampRect = rect;\n repaint(currentRect);\n }\n function destroy() {\n global$e.each(dragHelpers, function (helper) {\n helper.destroy();\n });\n dragHelpers = [];\n }\n render();\n var instance = global$e.extend({\n toggleVisibility: toggleVisibility,\n setClampRect: setClampRect,\n setRect: setRect,\n getInnerRect: getInnerRect,\n setInnerRect: setInnerRect,\n setViewPortRect: setViewPortRect,\n destroy: destroy\n }, global$d);\n return instance;\n };\n var CropRect = { create: create$7 };\n\n var loadImage = function (image) {\n return new global$4(function (resolve) {\n var loaded = function () {\n image.removeEventListener('load', loaded);\n resolve(image);\n };\n if (image.complete) {\n resolve(image);\n } else {\n image.addEventListener('load', loaded);\n }\n });\n };\n var renderImagePanel = function (initialUrl) {\n var memBg = record({\n dom: {\n tag: 'div',\n classes: ['tox-image-tools__image-bg'],\n attributes: { role: 'presentation' }\n }\n });\n var zoomState = Cell(1);\n var cropRect = Cell(Option.none());\n var rectState = Cell({\n x: 0,\n y: 0,\n w: 1,\n h: 1\n });\n var viewRectState = Cell({\n x: 0,\n y: 0,\n w: 1,\n h: 1\n });\n var repaintImg = function (anyInSystem, img) {\n memContainer.getOpt(anyInSystem).each(function (panel) {\n var zoom = zoomState.get();\n var panelW = get$7(panel.element());\n var panelH = get$6(panel.element());\n var width = img.dom().naturalWidth * zoom;\n var height = img.dom().naturalHeight * zoom;\n var left = Math.max(0, panelW / 2 - width / 2);\n var top = Math.max(0, panelH / 2 - height / 2);\n var css = {\n left: left.toString() + 'px',\n top: top.toString() + 'px',\n width: width.toString() + 'px',\n height: height.toString() + 'px',\n position: 'absolute'\n };\n setAll$1(img, css);\n memBg.getOpt(panel).each(function (bg) {\n setAll$1(bg.element(), css);\n });\n cropRect.get().each(function (cRect) {\n var rect = rectState.get();\n cRect.setRect({\n x: rect.x * zoom + left,\n y: rect.y * zoom + top,\n w: rect.w * zoom,\n h: rect.h * zoom\n });\n cRect.setClampRect({\n x: left,\n y: top,\n w: width,\n h: height\n });\n cRect.setViewPortRect({\n x: 0,\n y: 0,\n w: panelW,\n h: panelH\n });\n });\n });\n };\n var zoomFit = function (anyInSystem, img) {\n memContainer.getOpt(anyInSystem).each(function (panel) {\n var panelW = get$7(panel.element());\n var panelH = get$6(panel.element());\n var width = img.dom().naturalWidth;\n var height = img.dom().naturalHeight;\n var zoom = Math.min(panelW / width, panelH / height);\n if (zoom >= 1) {\n zoomState.set(1);\n } else {\n zoomState.set(zoom);\n }\n });\n };\n var updateSrc = function (anyInSystem, url) {\n var img = Element.fromTag('img');\n set$1(img, 'src', url);\n return loadImage(img.dom()).then(function () {\n return memContainer.getOpt(anyInSystem).map(function (panel) {\n var aImg = external({ element: img });\n Replacing.replaceAt(panel, 1, Option.some(aImg));\n var lastViewRect = viewRectState.get();\n var viewRect = {\n x: 0,\n y: 0,\n w: img.dom().naturalWidth,\n h: img.dom().naturalHeight\n };\n viewRectState.set(viewRect);\n var rect = global$c.inflate(viewRect, -20, -20);\n rectState.set(rect);\n if (lastViewRect.w !== viewRect.w || lastViewRect.h !== viewRect.h) {\n zoomFit(panel, img);\n }\n repaintImg(panel, img);\n return img;\n });\n });\n };\n var zoom = function (anyInSystem, direction) {\n var currentZoom = zoomState.get();\n var newZoom = direction > 0 ? Math.min(2, currentZoom + 0.1) : Math.max(0.1, currentZoom - 0.1);\n zoomState.set(newZoom);\n memContainer.getOpt(anyInSystem).each(function (panel) {\n var img = panel.components()[1].element();\n repaintImg(panel, img);\n });\n };\n var showCrop = function () {\n cropRect.get().each(function (cRect) {\n cRect.toggleVisibility(true);\n });\n };\n var hideCrop = function () {\n cropRect.get().each(function (cRect) {\n cRect.toggleVisibility(false);\n });\n };\n var getRect = function () {\n return rectState.get();\n };\n var container = Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-image-tools__image']\n },\n components: [\n memBg.asSpec(),\n {\n dom: {\n tag: 'img',\n attributes: { src: initialUrl }\n }\n },\n {\n dom: { tag: 'div' },\n behaviours: derive$1([config('image-panel-crop-events', [runOnAttached(function (comp) {\n memContainer.getOpt(comp).each(function (container) {\n var el = container.element().dom();\n var cRect = CropRect.create({\n x: 10,\n y: 10,\n w: 100,\n h: 100\n }, {\n x: 0,\n y: 0,\n w: 200,\n h: 200\n }, {\n x: 0,\n y: 0,\n w: 200,\n h: 200\n }, el, function () {\n });\n cRect.toggleVisibility(false);\n cRect.on('updateRect', function (e) {\n var rect = e.rect;\n var zoom = zoomState.get();\n var newRect = {\n x: Math.round(rect.x / zoom),\n y: Math.round(rect.y / zoom),\n w: Math.round(rect.w / zoom),\n h: Math.round(rect.h / zoom)\n };\n rectState.set(newRect);\n });\n cropRect.set(Option.some(cRect));\n });\n })])])\n }\n ],\n containerBehaviours: derive$1([\n Replacing.config({}),\n config('image-panel-events', [runOnAttached(function (comp) {\n updateSrc(comp, initialUrl);\n })])\n ])\n });\n var memContainer = record(container);\n var getMeasurements = function () {\n var viewRect = viewRectState.get();\n return {\n width: viewRect.w,\n height: viewRect.h\n };\n };\n return {\n memContainer: memContainer,\n updateSrc: updateSrc,\n zoom: zoom,\n showCrop: showCrop,\n hideCrop: hideCrop,\n getRect: getRect,\n getMeasurements: getMeasurements\n };\n };\n\n var createButton = function (innerHtml, icon, disabled, action, providersBackstage) {\n return renderIconButton({\n name: innerHtml,\n icon: Option.some(icon),\n disabled: disabled,\n tooltip: Option.some(innerHtml),\n primary: false,\n borderless: false\n }, action, providersBackstage);\n };\n var setButtonEnabled = function (button, enabled) {\n if (enabled) {\n Disabling.enable(button);\n } else {\n Disabling.disable(button);\n }\n };\n var renderSideBar = function (providersBackstage) {\n var updateButtonUndoStates = function (anyInSystem, undoEnabled, redoEnabled) {\n memUndo.getOpt(anyInSystem).each(function (undo) {\n setButtonEnabled(undo, undoEnabled);\n });\n memRedo.getOpt(anyInSystem).each(function (redo) {\n setButtonEnabled(redo, redoEnabled);\n });\n };\n var memUndo = record(createButton('Undo', 'undo', true, function (button) {\n emitWith(button, internal.undo(), { direction: 1 });\n }, providersBackstage));\n var memRedo = record(createButton('Redo', 'redo', true, function (button) {\n emitWith(button, internal.redo(), { direction: 1 });\n }, providersBackstage));\n var container = Container.sketch({\n dom: {\n tag: 'div',\n classes: [\n 'tox-image-tools__toolbar',\n 'tox-image-tools__sidebar'\n ]\n },\n components: [\n memUndo.asSpec(),\n memRedo.asSpec(),\n createButton('Zoom in', 'zoom-in', false, function (button) {\n emitWith(button, internal.zoom(), { direction: 1 });\n }, providersBackstage),\n createButton('Zoom out', 'zoom-out', false, function (button) {\n emitWith(button, internal.zoom(), { direction: -1 });\n }, providersBackstage)\n ]\n });\n return {\n container: container,\n updateButtonUndoStates: updateButtonUndoStates\n };\n };\n\n function UndoStack () {\n var data = [];\n var index = -1;\n function add(state) {\n var removed = data.splice(++index);\n data.push(state);\n return {\n state: state,\n removed: removed\n };\n }\n function undo() {\n if (canUndo()) {\n return data[--index];\n }\n }\n function redo() {\n if (canRedo()) {\n return data[++index];\n }\n }\n function canUndo() {\n return index > 0;\n }\n function canRedo() {\n return index !== -1 && index < data.length - 1;\n }\n return {\n data: data,\n add: add,\n undo: undo,\n redo: redo,\n canUndo: canUndo,\n canRedo: canRedo\n };\n }\n\n var makeState = function (initialState) {\n var blobState = Cell(initialState);\n var tempState = Cell(Option.none());\n var undoStack = UndoStack();\n undoStack.add(initialState);\n var getBlobState = function () {\n return blobState.get();\n };\n var setBlobState = function (state) {\n blobState.set(state);\n };\n var getTempState = function () {\n return tempState.get().fold(function () {\n return blobState.get();\n }, function (temp) {\n return temp;\n });\n };\n var updateTempState = function (blob) {\n var newTempState = createState(blob);\n destroyTempState();\n tempState.set(Option.some(newTempState));\n return newTempState.url;\n };\n var createState = function (blob) {\n return {\n blob: blob,\n url: domGlobals.URL.createObjectURL(blob)\n };\n };\n var destroyState = function (state) {\n domGlobals.URL.revokeObjectURL(state.url);\n };\n var destroyStates = function (states) {\n global$e.each(states, destroyState);\n };\n var destroyTempState = function () {\n tempState.get().each(destroyState);\n tempState.set(Option.none());\n };\n var addBlobState = function (blob) {\n var newState = createState(blob);\n setBlobState(newState);\n var removed = undoStack.add(newState).removed;\n destroyStates(removed);\n return newState.url;\n };\n var addTempState = function (blob) {\n var newState = createState(blob);\n tempState.set(Option.some(newState));\n return newState.url;\n };\n var applyTempState = function (postApply) {\n return tempState.get().fold(function () {\n }, function (temp) {\n addBlobState(temp.blob);\n postApply();\n });\n };\n var undo = function () {\n var currentState = undoStack.undo();\n setBlobState(currentState);\n return currentState.url;\n };\n var redo = function () {\n var currentState = undoStack.redo();\n setBlobState(currentState);\n return currentState.url;\n };\n var getHistoryStates = function () {\n var undoEnabled = undoStack.canUndo();\n var redoEnabled = undoStack.canRedo();\n return {\n undoEnabled: undoEnabled,\n redoEnabled: redoEnabled\n };\n };\n return {\n getBlobState: getBlobState,\n setBlobState: setBlobState,\n addBlobState: addBlobState,\n getTempState: getTempState,\n updateTempState: updateTempState,\n addTempState: addTempState,\n applyTempState: applyTempState,\n destroyTempState: destroyTempState,\n undo: undo,\n redo: redo,\n getHistoryStates: getHistoryStates\n };\n };\n\n var renderImageTools = function (detail, providersBackstage) {\n var state = makeState(detail.currentState);\n var zoom = function (anyInSystem, simulatedEvent) {\n var direction = simulatedEvent.event().direction();\n imagePanel.zoom(anyInSystem, direction);\n };\n var updateButtonUndoStates = function (anyInSystem) {\n var historyStates = state.getHistoryStates();\n sideBar.updateButtonUndoStates(anyInSystem, historyStates.undoEnabled, historyStates.redoEnabled);\n emitWith(anyInSystem, external$2.formActionEvent, {\n name: external$2.saveState(),\n value: historyStates.undoEnabled\n });\n };\n var disableUndoRedo = function (anyInSystem) {\n sideBar.updateButtonUndoStates(anyInSystem, false, false);\n };\n var undo = function (anyInSystem, _simulatedEvent) {\n var url = state.undo();\n updateSrc(anyInSystem, url).then(function (_oImg) {\n unblock(anyInSystem);\n updateButtonUndoStates(anyInSystem);\n });\n };\n var redo = function (anyInSystem, _simulatedEvent) {\n var url = state.redo();\n updateSrc(anyInSystem, url).then(function (_oImg) {\n unblock(anyInSystem);\n updateButtonUndoStates(anyInSystem);\n });\n };\n var imageResultToBlob = function (ir) {\n return ir.toBlob();\n };\n var block = function (anyInSystem) {\n emitWith(anyInSystem, external$2.formActionEvent, {\n name: external$2.disable(),\n value: {}\n });\n };\n var unblock = function (anyInSystem) {\n editPanel.getApplyButton(anyInSystem).each(function (applyButton) {\n Disabling.enable(applyButton);\n });\n emitWith(anyInSystem, external$2.formActionEvent, {\n name: external$2.enable(),\n value: {}\n });\n };\n var updateSrc = function (anyInSystem, src) {\n block(anyInSystem);\n return imagePanel.updateSrc(anyInSystem, src);\n };\n var blobManipulate = function (anyInSystem, blob, filter, action, swap) {\n block(anyInSystem);\n return blobToImageResult(blob).then(filter).then(imageResultToBlob).then(action).then(function (url) {\n return updateSrc(anyInSystem, url).then(function (oImg) {\n updateButtonUndoStates(anyInSystem);\n swap();\n unblock(anyInSystem);\n return oImg;\n });\n }).catch(function (err) {\n domGlobals.console.log(err);\n unblock(anyInSystem);\n return err;\n });\n };\n var manipulate = function (anyInSystem, filter, swap) {\n var blob = state.getBlobState().blob;\n var action = function (blob) {\n return state.updateTempState(blob);\n };\n blobManipulate(anyInSystem, blob, filter, action, swap);\n };\n var tempManipulate = function (anyInSystem, filter) {\n var blob = state.getTempState().blob;\n var action = function (blob) {\n return state.addTempState(blob);\n };\n blobManipulate(anyInSystem, blob, filter, action, noop);\n };\n var manipulateApply = function (anyInSystem, filter, swap) {\n var blob = state.getBlobState().blob;\n var action = function (blob) {\n var url = state.addBlobState(blob);\n destroyTempState(anyInSystem);\n return url;\n };\n blobManipulate(anyInSystem, blob, filter, action, swap);\n };\n var apply = function (anyInSystem, simulatedEvent) {\n var postApply = function () {\n destroyTempState(anyInSystem);\n var swap = simulatedEvent.event().swap();\n swap();\n };\n state.applyTempState(postApply);\n };\n var destroyTempState = function (anyInSystem) {\n var currentUrl = state.getBlobState().url;\n state.destroyTempState();\n updateButtonUndoStates(anyInSystem);\n return currentUrl;\n };\n var cancel = function (anyInSystem) {\n var currentUrl = destroyTempState(anyInSystem);\n updateSrc(anyInSystem, currentUrl).then(function (_oImg) {\n unblock(anyInSystem);\n });\n };\n var back = function (anyInSystem, simulatedEvent) {\n cancel(anyInSystem);\n var swap = simulatedEvent.event().swap();\n swap();\n imagePanel.hideCrop();\n };\n var transform = function (anyInSystem, simulatedEvent) {\n return manipulate(anyInSystem, simulatedEvent.event().transform(), noop);\n };\n var tempTransform = function (anyInSystem, simulatedEvent) {\n return tempManipulate(anyInSystem, simulatedEvent.event().transform());\n };\n var transformApply = function (anyInSystem, simulatedEvent) {\n return manipulateApply(anyInSystem, simulatedEvent.event().transform(), simulatedEvent.event().swap());\n };\n var imagePanel = renderImagePanel(detail.currentState.url);\n var sideBar = renderSideBar(providersBackstage);\n var editPanel = renderEditPanel(imagePanel, providersBackstage);\n var swap = function (anyInSystem, simulatedEvent) {\n disableUndoRedo(anyInSystem);\n var transform = simulatedEvent.event().transform();\n var swap = simulatedEvent.event().swap();\n transform.fold(function () {\n swap();\n }, function (transform) {\n manipulate(anyInSystem, transform, swap);\n });\n };\n return {\n dom: {\n tag: 'div',\n attributes: { role: 'presentation' }\n },\n components: [\n editPanel.memContainer.asSpec(),\n imagePanel.memContainer.asSpec(),\n sideBar.container\n ],\n behaviours: derive$1([\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function () {\n return state.getBlobState();\n }\n }\n }),\n config('image-tools-events', [\n run(internal.undo(), undo),\n run(internal.redo(), redo),\n run(internal.zoom(), zoom),\n run(internal.back(), back),\n run(internal.apply(), apply),\n run(internal.transform(), transform),\n run(internal.tempTransform(), tempTransform),\n run(internal.transformApply(), transformApply),\n run(internal.swap(), swap)\n ]),\n ComposingConfigs.self()\n ])\n };\n };\n\n var renderLabel$2 = function (spec, backstageShared) {\n var label = {\n dom: {\n tag: 'label',\n innerHtml: backstageShared.providers.translate(spec.label),\n classes: ['tox-label']\n }\n };\n var comps = map(spec.items, backstageShared.interpreter);\n return {\n dom: {\n tag: 'div',\n classes: ['tox-form__group']\n },\n components: [label].concat(comps),\n behaviours: derive$1([\n ComposingConfigs.self(),\n Replacing.config({}),\n RepresentingConfigs.domHtml(Option.none()),\n Keying.config({ mode: 'acyclic' })\n ])\n };\n };\n\n var renderPanel = function (spec, backstage) {\n return {\n dom: {\n tag: 'div',\n classes: spec.classes\n },\n components: map(spec.items, backstage.shared.interpreter)\n };\n };\n\n var factory$8 = function (detail, _spec) {\n var options = map(detail.options, function (option) {\n return {\n dom: {\n tag: 'option',\n value: option.value,\n innerHtml: option.text\n }\n };\n });\n var initialValues = detail.data.map(function (v) {\n return wrap$1('initialValue', v);\n }).getOr({});\n return {\n uid: detail.uid,\n dom: {\n tag: 'select',\n classes: detail.selectClasses,\n attributes: detail.selectAttributes\n },\n components: options,\n behaviours: augment(detail.selectBehaviours, [\n Focusing.config({}),\n Representing.config({\n store: __assign({\n mode: 'manual',\n getValue: function (select) {\n return get$5(select.element());\n },\n setValue: function (select, newValue) {\n var found = find(detail.options, function (opt) {\n return opt.value === newValue;\n });\n if (found.isSome()) {\n set$3(select.element(), newValue);\n }\n }\n }, initialValues)\n })\n ])\n };\n };\n var HtmlSelect = single$2({\n name: 'HtmlSelect',\n configFields: [\n strict$1('options'),\n field$1('selectBehaviours', [\n Focusing,\n Representing\n ]),\n defaulted$1('selectClasses', []),\n defaulted$1('selectAttributes', {}),\n option('data')\n ],\n factory: factory$8\n });\n\n var renderSelectBox = function (spec, providersBackstage) {\n var translatedOptions = map(spec.items, function (item) {\n return {\n text: providersBackstage.translate(item.text),\n value: item.value\n };\n });\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var pField = FormField.parts().field({\n dom: {},\n selectAttributes: { size: spec.size },\n options: translatedOptions,\n factory: HtmlSelect,\n selectBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n }),\n Tabstopping.config({}),\n config('selectbox-change', [run(change(), function (component, _) {\n emitWith(component, formChangeEvent, { name: spec.name });\n })])\n ])\n });\n var chevron = spec.size > 1 ? Option.none() : Option.some({\n dom: {\n tag: 'div',\n classes: ['tox-selectfield__icon-js'],\n innerHtml: get$d('chevron-down', providersBackstage.icons)\n }\n });\n var selectWrap = {\n dom: {\n tag: 'div',\n classes: ['tox-selectfield']\n },\n components: flatten([\n [pField],\n chevron.toArray()\n ])\n };\n return FormField.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-form__group']\n },\n components: flatten([\n pLabel.toArray(),\n [selectWrap]\n ]),\n fieldBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n },\n onDisabled: function (comp) {\n FormField.getField(comp).each(Disabling.disable);\n },\n onEnabled: function (comp) {\n FormField.getField(comp).each(Disabling.enable);\n }\n }),\n receivingConfig()\n ])\n });\n };\n\n var renderTable = function (spec, providersBackstage) {\n var renderTh = function (text) {\n return {\n dom: {\n tag: 'th',\n innerHtml: providersBackstage.translate(text)\n }\n };\n };\n var renderHeader = function (header) {\n return {\n dom: { tag: 'thead' },\n components: [{\n dom: { tag: 'tr' },\n components: map(header, renderTh)\n }]\n };\n };\n var renderTd = function (text) {\n return {\n dom: {\n tag: 'td',\n innerHtml: providersBackstage.translate(text)\n }\n };\n };\n var renderTr = function (row) {\n return {\n dom: { tag: 'tr' },\n components: map(row, renderTd)\n };\n };\n var renderRows = function (rows) {\n return {\n dom: { tag: 'tbody' },\n components: map(rows, renderTr)\n };\n };\n return {\n dom: {\n tag: 'table',\n classes: ['tox-dialog__table']\n },\n components: [\n renderHeader(spec.header),\n renderRows(spec.cells)\n ],\n behaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({})\n ])\n };\n };\n\n var renderTextField = function (spec, providersBackstage) {\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var baseInputBehaviours = [\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n }),\n receivingConfig(),\n Keying.config({\n mode: 'execution',\n useEnter: spec.multiline !== true,\n useControlEnter: spec.multiline === true,\n execute: function (comp) {\n emit(comp, formSubmitEvent);\n return Option.some(true);\n }\n }),\n config('textfield-change', [\n run(input(), function (component, _) {\n emitWith(component, formChangeEvent, { name: spec.name });\n }),\n run(postPaste(), function (component, _) {\n emitWith(component, formChangeEvent, { name: spec.name });\n })\n ]),\n Tabstopping.config({})\n ];\n var validatingBehaviours = spec.validation.map(function (vl) {\n return Invalidating.config({\n getRoot: function (input) {\n return parent(input.element());\n },\n invalidClass: 'tox-invalid',\n validator: {\n validate: function (input) {\n var v = Representing.getValue(input);\n var result = vl.validator(v);\n return Future.pure(result === true ? Result.value(v) : Result.error(result));\n },\n validateOnLoad: vl.validateOnLoad\n }\n });\n }).toArray();\n var placeholder = spec.placeholder.fold(constant({}), function (p) {\n return { placeholder: providersBackstage.translate(p) };\n });\n var inputMode = spec.inputMode.fold(constant({}), function (mode) {\n return { inputmode: mode };\n });\n var inputAttributes = __assign(__assign({}, placeholder), inputMode);\n var pField = FormField.parts().field({\n tag: spec.multiline === true ? 'textarea' : 'input',\n inputAttributes: inputAttributes,\n inputClasses: [spec.classname],\n inputBehaviours: derive$1(flatten([\n baseInputBehaviours,\n validatingBehaviours\n ])),\n selectOnFocus: false,\n factory: Input\n });\n var extraClasses = spec.flex ? ['tox-form__group--stretched'] : [];\n var extraClasses2 = extraClasses.concat(spec.maximized ? ['tox-form-group--maximize'] : []);\n var extraBehaviours = [\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n },\n onDisabled: function (comp) {\n FormField.getField(comp).each(Disabling.disable);\n },\n onEnabled: function (comp) {\n FormField.getField(comp).each(Disabling.enable);\n }\n }),\n receivingConfig()\n ];\n return renderFormFieldWith(pLabel, pField, extraClasses2, extraBehaviours);\n };\n var renderInput = function (spec, providersBackstage) {\n return renderTextField({\n name: spec.name,\n multiline: false,\n label: spec.label,\n inputMode: spec.inputMode,\n placeholder: spec.placeholder,\n flex: false,\n disabled: spec.disabled,\n classname: 'tox-textfield',\n validation: Option.none(),\n maximized: spec.maximized\n }, providersBackstage);\n };\n var renderTextarea = function (spec, providersBackstage) {\n return renderTextField({\n name: spec.name,\n multiline: true,\n label: spec.label,\n inputMode: Option.none(),\n placeholder: spec.placeholder,\n flex: true,\n disabled: spec.disabled,\n classname: 'tox-textarea',\n validation: Option.none(),\n maximized: spec.maximized\n }, providersBackstage);\n };\n\n var events$c = function (streamConfig, streamState) {\n var streams = streamConfig.stream.streams;\n var processor = streams.setup(streamConfig, streamState);\n return derive([\n run(streamConfig.event, processor),\n runOnDetached(function () {\n return streamState.cancel();\n })\n ].concat(streamConfig.cancelEvent.map(function (e) {\n return [run(e, function () {\n return streamState.cancel();\n })];\n }).getOr([])));\n };\n\n var ActiveStreaming = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$c\n });\n\n var throttle = function (_config) {\n var state = Cell(null);\n var readState = function () {\n return { timer: state.get() !== null ? 'set' : 'unset' };\n };\n var setTimer = function (t) {\n state.set(t);\n };\n var cancel = function () {\n var t = state.get();\n if (t !== null) {\n t.cancel();\n }\n };\n return nu$5({\n readState: readState,\n setTimer: setTimer,\n cancel: cancel\n });\n };\n var init$6 = function (spec) {\n return spec.stream.streams.state(spec);\n };\n\n var StreamingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n throttle: throttle,\n init: init$6\n });\n\n var setup$2 = function (streamInfo, streamState) {\n var sInfo = streamInfo.stream;\n var throttler = last$2(streamInfo.onStream, sInfo.delay);\n streamState.setTimer(throttler);\n return function (component, simulatedEvent) {\n throttler.throttle(component, simulatedEvent);\n if (sInfo.stopEvent) {\n simulatedEvent.stop();\n }\n };\n };\n var StreamingSchema = [\n strictOf('stream', choose$1('mode', {\n throttle: [\n strict$1('delay'),\n defaulted$1('stopEvent', true),\n output('streams', {\n setup: setup$2,\n state: throttle\n })\n ]\n })),\n defaulted$1('event', 'input'),\n option('cancelEvent'),\n onStrictHandler('onStream')\n ];\n\n var Streaming = create$1({\n fields: StreamingSchema,\n name: 'streaming',\n active: ActiveStreaming,\n state: StreamingState\n });\n\n var setValueFromItem = function (model, input, item) {\n var itemData = Representing.getValue(item);\n Representing.setValue(input, itemData);\n setCursorAtEnd(input);\n };\n var setSelectionOn = function (input, f) {\n var el = input.element();\n var value = get$5(el);\n var node = el.dom();\n if (get$2(el, 'type') !== 'number') {\n f(node, value);\n }\n };\n var setCursorAtEnd = function (input) {\n setSelectionOn(input, function (node, value) {\n return node.setSelectionRange(value.length, value.length);\n });\n };\n var setSelectionToEnd = function (input, startOffset) {\n setSelectionOn(input, function (node, value) {\n return node.setSelectionRange(startOffset, value.length);\n });\n };\n var attemptSelectOver = function (model, input, item) {\n if (!model.selectsOver) {\n return Option.none();\n } else {\n var currentValue = Representing.getValue(input);\n var inputDisplay_1 = model.getDisplayText(currentValue);\n var itemValue = Representing.getValue(item);\n var itemDisplay = model.getDisplayText(itemValue);\n return itemDisplay.indexOf(inputDisplay_1) === 0 ? Option.some(function () {\n setValueFromItem(model, input, item);\n setSelectionToEnd(input, inputDisplay_1.length);\n }) : Option.none();\n }\n };\n\n var itemExecute = constant('alloy.typeahead.itemexecute');\n\n var make$5 = function (detail, components, spec, externals) {\n var navigateList = function (comp, simulatedEvent, highlighter) {\n detail.previewing.set(false);\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n if (Sandboxing.isOpen(sandbox)) {\n Composing.getCurrent(sandbox).each(function (menu) {\n Highlighting.getHighlighted(menu).fold(function () {\n highlighter(menu);\n }, function () {\n dispatchEvent(sandbox, menu.element(), 'keydown', simulatedEvent);\n });\n });\n } else {\n var onOpenSync = function (sandbox) {\n Composing.getCurrent(sandbox).each(highlighter);\n };\n open$1(detail, mapFetch(comp), comp, sandbox, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop);\n }\n };\n var focusBehaviours$1 = focusBehaviours(detail);\n var mapFetch = function (comp) {\n return function (tdata) {\n return tdata.map(function (data) {\n var menus = values(data.menus);\n var items = bind(menus, function (menu) {\n return filter(menu.items, function (item) {\n return item.type === 'item';\n });\n });\n var repState = Representing.getState(comp);\n repState.update(map(items, function (item) {\n return item.data;\n }));\n return data;\n });\n };\n };\n var behaviours = [\n Focusing.config({}),\n Representing.config({\n onSetValue: detail.onSetValue,\n store: __assign({\n mode: 'dataset',\n getDataKey: function (comp) {\n return get$5(comp.element());\n },\n getFallbackEntry: function (itemString) {\n return {\n value: itemString,\n meta: {}\n };\n },\n setValue: function (comp, data) {\n set$3(comp.element(), detail.model.getDisplayText(data));\n }\n }, detail.initialData.map(function (d) {\n return wrap$1('initialValue', d);\n }).getOr({}))\n }),\n Streaming.config({\n stream: {\n mode: 'throttle',\n delay: detail.responseTime,\n stopEvent: false\n },\n onStream: function (component, _simulatedEvent) {\n var sandbox = Coupling.getCoupled(component, 'sandbox');\n var focusInInput = Focusing.isFocused(component);\n if (focusInInput) {\n if (get$5(component.element()).length >= detail.minChars) {\n var previousValue_1 = Composing.getCurrent(sandbox).bind(function (menu) {\n return Highlighting.getHighlighted(menu).map(Representing.getValue);\n });\n detail.previewing.set(true);\n var onOpenSync = function (_sandbox) {\n Composing.getCurrent(sandbox).each(function (menu) {\n previousValue_1.fold(function () {\n if (detail.model.selectsOver) {\n Highlighting.highlightFirst(menu);\n }\n }, function (pv) {\n Highlighting.highlightBy(menu, function (item) {\n var itemData = Representing.getValue(item);\n return itemData.value === pv.value;\n });\n Highlighting.getHighlighted(menu).orThunk(function () {\n Highlighting.highlightFirst(menu);\n return Option.none();\n });\n });\n });\n };\n open$1(detail, mapFetch(component), component, sandbox, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop);\n }\n }\n },\n cancelEvent: typeaheadCancel()\n }),\n Keying.config({\n mode: 'special',\n onDown: function (comp, simulatedEvent) {\n navigateList(comp, simulatedEvent, Highlighting.highlightFirst);\n return Option.some(true);\n },\n onEscape: function (comp) {\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n if (Sandboxing.isOpen(sandbox)) {\n Sandboxing.close(sandbox);\n return Option.some(true);\n }\n return Option.none();\n },\n onUp: function (comp, simulatedEvent) {\n navigateList(comp, simulatedEvent, Highlighting.highlightLast);\n return Option.some(true);\n },\n onEnter: function (comp) {\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n var sandboxIsOpen = Sandboxing.isOpen(sandbox);\n if (sandboxIsOpen && !detail.previewing.get()) {\n return Composing.getCurrent(sandbox).bind(function (menu) {\n return Highlighting.getHighlighted(menu);\n }).map(function (item) {\n emitWith(comp, itemExecute(), { item: item });\n return true;\n });\n } else {\n var currentValue = Representing.getValue(comp);\n emit(comp, typeaheadCancel());\n detail.onExecute(sandbox, comp, currentValue);\n if (sandboxIsOpen) {\n Sandboxing.close(sandbox);\n }\n return Option.some(true);\n }\n }\n }),\n Toggling.config({\n toggleClass: detail.markers.openClass,\n aria: { mode: 'expanded' }\n }),\n Coupling.config({\n others: {\n sandbox: function (hotspot) {\n return makeSandbox(detail, hotspot, {\n onOpen: function () {\n return Toggling.on(hotspot);\n },\n onClose: function () {\n return Toggling.off(hotspot);\n }\n });\n }\n }\n }),\n config('typeaheadevents', [\n runOnExecute(function (comp) {\n var onOpenSync = noop;\n togglePopup(detail, mapFetch(comp), comp, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop);\n }),\n run(itemExecute(), function (comp, se) {\n var sandbox = Coupling.getCoupled(comp, 'sandbox');\n setValueFromItem(detail.model, comp, se.event().item());\n emit(comp, typeaheadCancel());\n detail.onItemExecute(comp, sandbox, se.event().item(), Representing.getValue(comp));\n Sandboxing.close(sandbox);\n setCursorAtEnd(comp);\n })\n ].concat(detail.dismissOnBlur ? [run(postBlur(), function (typeahead) {\n var sandbox = Coupling.getCoupled(typeahead, 'sandbox');\n if (search(sandbox.element()).isNone()) {\n Sandboxing.close(sandbox);\n }\n })] : []))\n ];\n return {\n uid: detail.uid,\n dom: dom$2(deepMerge(detail, {\n inputAttributes: {\n 'role': 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-haspopup': 'true'\n }\n })),\n behaviours: __assign(__assign({}, focusBehaviours$1), augment(detail.typeaheadBehaviours, behaviours)),\n eventOrder: detail.eventOrder\n };\n };\n\n var schema$j = constant([\n option('lazySink'),\n strict$1('fetch'),\n defaulted$1('minChars', 5),\n defaulted$1('responseTime', 1000),\n onHandler('onOpen'),\n defaulted$1('getHotspot', Option.some),\n defaulted$1('getAnchorOverrides', constant({})),\n defaulted$1('layouts', Option.none()),\n defaulted$1('eventOrder', {}),\n defaultedObjOf('model', {}, [\n defaulted$1('getDisplayText', function (itemData) {\n return itemData.meta !== undefined && itemData.meta.text !== undefined ? itemData.meta.text : itemData.value;\n }),\n defaulted$1('selectsOver', true),\n defaulted$1('populateFromBrowse', true)\n ]),\n onHandler('onSetValue'),\n onKeyboardHandler('onExecute'),\n onHandler('onItemExecute'),\n defaulted$1('inputClasses', []),\n defaulted$1('inputAttributes', {}),\n defaulted$1('inputStyles', {}),\n defaulted$1('matchWidth', true),\n defaulted$1('useMinWidth', false),\n defaulted$1('dismissOnBlur', true),\n markers(['openClass']),\n option('initialData'),\n field$1('typeaheadBehaviours', [\n Focusing,\n Representing,\n Streaming,\n Keying,\n Toggling,\n Coupling\n ]),\n state$1('previewing', function () {\n return Cell(true);\n })\n ].concat(schema$f()).concat(sandboxFields()));\n var parts$6 = constant([external$1({\n schema: [tieredMenuMarkers()],\n name: 'menu',\n overrides: function (detail) {\n return {\n fakeFocus: true,\n onHighlight: function (menu, item) {\n if (!detail.previewing.get()) {\n menu.getSystem().getByUid(detail.uid).each(function (input) {\n if (detail.model.populateFromBrowse) {\n setValueFromItem(detail.model, input, item);\n }\n });\n } else {\n menu.getSystem().getByUid(detail.uid).each(function (input) {\n attemptSelectOver(detail.model, input, item).fold(function () {\n return Highlighting.dehighlight(menu, item);\n }, function (fn) {\n return fn();\n });\n });\n }\n detail.previewing.set(false);\n },\n onExecute: function (menu, item) {\n return menu.getSystem().getByUid(detail.uid).toOption().map(function (typeahead) {\n emitWith(typeahead, itemExecute(), { item: item });\n return true;\n });\n },\n onHover: function (menu, item) {\n detail.previewing.set(false);\n menu.getSystem().getByUid(detail.uid).each(function (input) {\n if (detail.model.populateFromBrowse) {\n setValueFromItem(detail.model, input, item);\n }\n });\n }\n };\n }\n })]);\n\n var Typeahead = composite$1({\n name: 'Typeahead',\n configFields: schema$j(),\n partFields: parts$6(),\n factory: make$5\n });\n\n var wrap$2 = function (delegate) {\n var toCached = function () {\n return wrap$2(delegate.toCached());\n };\n var bindFuture = function (f) {\n return wrap$2(delegate.bind(function (resA) {\n return resA.fold(function (err) {\n return Future.pure(Result.error(err));\n }, function (a) {\n return f(a);\n });\n }));\n };\n var bindResult = function (f) {\n return wrap$2(delegate.map(function (resA) {\n return resA.bind(f);\n }));\n };\n var mapResult = function (f) {\n return wrap$2(delegate.map(function (resA) {\n return resA.map(f);\n }));\n };\n var mapError = function (f) {\n return wrap$2(delegate.map(function (resA) {\n return resA.mapError(f);\n }));\n };\n var foldResult = function (whenError, whenValue) {\n return delegate.map(function (res) {\n return res.fold(whenError, whenValue);\n });\n };\n var withTimeout = function (timeout, errorThunk) {\n return wrap$2(Future.nu(function (callback) {\n var timedOut = false;\n var timer = domGlobals.setTimeout(function () {\n timedOut = true;\n callback(Result.error(errorThunk()));\n }, timeout);\n delegate.get(function (result) {\n if (!timedOut) {\n domGlobals.clearTimeout(timer);\n callback(result);\n }\n });\n }));\n };\n return __assign(__assign({}, delegate), {\n toCached: toCached,\n bindFuture: bindFuture,\n bindResult: bindResult,\n mapResult: mapResult,\n mapError: mapError,\n foldResult: foldResult,\n withTimeout: withTimeout\n });\n };\n var nu$c = function (worker) {\n return wrap$2(Future.nu(worker));\n };\n var value$2 = function (value) {\n return wrap$2(Future.pure(Result.value(value)));\n };\n var error$1 = function (error) {\n return wrap$2(Future.pure(Result.error(error)));\n };\n var fromResult$1 = function (result) {\n return wrap$2(Future.pure(result));\n };\n var fromFuture = function (future) {\n return wrap$2(future.map(Result.value));\n };\n var fromPromise = function (promise) {\n return nu$c(function (completer) {\n promise.then(function (value) {\n completer(Result.value(value));\n }, function (error) {\n completer(Result.error(error));\n });\n });\n };\n var FutureResult = {\n nu: nu$c,\n wrap: wrap$2,\n pure: value$2,\n value: value$2,\n error: error$1,\n fromResult: fromResult$1,\n fromFuture: fromFuture,\n fromPromise: fromPromise\n };\n\n var separator$2 = { type: 'separator' };\n var toMenuItem = function (target) {\n return {\n type: 'menuitem',\n value: target.url,\n text: target.title,\n meta: { attach: target.attach },\n onAction: function () {\n }\n };\n };\n var staticMenuItem = function (title, url) {\n return {\n type: 'menuitem',\n value: url,\n text: title,\n meta: { attach: undefined },\n onAction: function () {\n }\n };\n };\n var toMenuItems = function (targets) {\n return map(targets, toMenuItem);\n };\n var filterLinkTargets = function (type, targets) {\n return filter(targets, function (target) {\n return target.type === type;\n });\n };\n var filteredTargets = function (type, targets) {\n return toMenuItems(filterLinkTargets(type, targets));\n };\n var headerTargets = function (linkInfo) {\n return filteredTargets('header', linkInfo.targets);\n };\n var anchorTargets = function (linkInfo) {\n return filteredTargets('anchor', linkInfo.targets);\n };\n var anchorTargetTop = function (linkInfo) {\n return Option.from(linkInfo.anchorTop).map(function (url) {\n return staticMenuItem('', url);\n }).toArray();\n };\n var anchorTargetBottom = function (linkInfo) {\n return Option.from(linkInfo.anchorBottom).map(function (url) {\n return staticMenuItem('', url);\n }).toArray();\n };\n var historyTargets = function (history) {\n return map(history, function (url) {\n return staticMenuItem(url, url);\n });\n };\n var joinMenuLists = function (items) {\n return foldl(items, function (a, b) {\n var bothEmpty = a.length === 0 || b.length === 0;\n return bothEmpty ? a.concat(b) : a.concat(separator$2, b);\n }, []);\n };\n var filterByQuery = function (term, menuItems) {\n var lowerCaseTerm = term.toLowerCase();\n return filter(menuItems, function (item) {\n var text = item.meta !== undefined && item.meta.text !== undefined ? item.meta.text : item.text;\n return contains$1(text.toLowerCase(), lowerCaseTerm) || contains$1(item.value.toLowerCase(), lowerCaseTerm);\n });\n };\n\n var getItems = function (fileType, input, urlBackstage) {\n var urlInputValue = Representing.getValue(input);\n var term = urlInputValue.meta.text !== undefined ? urlInputValue.meta.text : urlInputValue.value;\n var info = urlBackstage.getLinkInformation();\n return info.fold(function () {\n return [];\n }, function (linkInfo) {\n var history = filterByQuery(term, historyTargets(urlBackstage.getHistory(fileType)));\n return fileType === 'file' ? joinMenuLists([\n history,\n filterByQuery(term, headerTargets(linkInfo)),\n filterByQuery(term, flatten([\n anchorTargetTop(linkInfo),\n anchorTargets(linkInfo),\n anchorTargetBottom(linkInfo)\n ]))\n ]) : history;\n });\n };\n var errorId = generate$1('aria-invalid');\n var renderUrlInput = function (spec, backstage, urlBackstage) {\n var _a;\n var providersBackstage = backstage.shared.providers;\n var updateHistory = function (component) {\n var urlEntry = Representing.getValue(component);\n urlBackstage.addToHistory(urlEntry.value, spec.filetype);\n };\n var pField = FormField.parts().field({\n factory: Typeahead,\n dismissOnBlur: true,\n inputClasses: ['tox-textfield'],\n sandboxClasses: ['tox-dialog__popups'],\n inputAttributes: {\n 'aria-errormessage': errorId,\n 'type': 'url'\n },\n minChars: 0,\n responseTime: 0,\n fetch: function (input) {\n var items = getItems(spec.filetype, input, urlBackstage);\n var tdata = build$2(items, ItemResponse$1.BUBBLE_TO_SANDBOX, backstage, false);\n return Future.pure(tdata);\n },\n getHotspot: function (comp) {\n return memUrlBox.getOpt(comp);\n },\n onSetValue: function (comp, _newValue) {\n if (comp.hasConfigured(Invalidating)) {\n Invalidating.run(comp).get(noop);\n }\n },\n typeaheadBehaviours: derive$1(flatten([\n urlBackstage.getValidationHandler().map(function (handler) {\n return Invalidating.config({\n getRoot: function (comp) {\n return parent(comp.element());\n },\n invalidClass: 'tox-control-wrap--status-invalid',\n notify: {\n onInvalid: function (comp, err) {\n memInvalidIcon.getOpt(comp).each(function (invalidComp) {\n set$1(invalidComp.element(), 'title', providersBackstage.translate(err));\n });\n }\n },\n validator: {\n validate: function (input) {\n var urlEntry = Representing.getValue(input);\n return FutureResult.nu(function (completer) {\n handler({\n type: spec.filetype,\n url: urlEntry.value\n }, function (validation) {\n if (validation.status === 'invalid') {\n var err = Result.error(validation.message);\n completer(err);\n } else {\n var val = Result.value(validation.message);\n completer(val);\n }\n });\n });\n },\n validateOnLoad: false\n }\n });\n }).toArray(),\n [\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n }),\n Tabstopping.config({}),\n config('urlinput-events', flatten([\n spec.filetype === 'file' ? [run(input(), function (comp) {\n emitWith(comp, formChangeEvent, { name: spec.name });\n })] : [],\n [\n run(change(), function (comp) {\n emitWith(comp, formChangeEvent, { name: spec.name });\n updateHistory(comp);\n }),\n run(postPaste(), function (comp) {\n emitWith(comp, formChangeEvent, { name: spec.name });\n updateHistory(comp);\n })\n ]\n ]))\n ]\n ])),\n eventOrder: (_a = {}, _a[input()] = [\n 'streaming',\n 'urlinput-events',\n 'invalidating'\n ], _a),\n model: {\n getDisplayText: function (itemData) {\n return itemData.value;\n },\n selectsOver: false,\n populateFromBrowse: false\n },\n markers: { openClass: 'tox-textfield--popup-open' },\n lazySink: backstage.shared.getSink,\n parts: { menu: part(false, 1, 'normal') },\n onExecute: function (_menu, component, _entry) {\n emitWith(component, formSubmitEvent, {});\n },\n onItemExecute: function (typeahead, _sandbox, _item, _value) {\n updateHistory(typeahead);\n emitWith(typeahead, formChangeEvent, { name: spec.name });\n }\n });\n var pLabel = spec.label.map(function (label) {\n return renderLabel(label, providersBackstage);\n });\n var makeIcon = function (name, errId, icon, label) {\n if (icon === void 0) {\n icon = name;\n }\n if (label === void 0) {\n label = name;\n }\n return {\n dom: {\n tag: 'div',\n classes: [\n 'tox-icon',\n 'tox-control-wrap__status-icon-' + name\n ],\n innerHtml: get$d(icon, providersBackstage.icons),\n attributes: __assign({\n 'title': providersBackstage.translate(label),\n 'aria-live': 'polite'\n }, errId.fold(function () {\n return {};\n }, function (id) {\n return { id: id };\n }))\n }\n };\n };\n var memInvalidIcon = record(makeIcon('invalid', Option.some(errorId), 'warning'));\n var memStatus = record({\n dom: {\n tag: 'div',\n classes: ['tox-control-wrap__status-icon-wrap']\n },\n components: [memInvalidIcon.asSpec()]\n });\n var optUrlPicker = urlBackstage.getUrlPicker(spec.filetype);\n var browseUrlEvent = generate$1('browser.url.event');\n var memUrlBox = record({\n dom: {\n tag: 'div',\n classes: ['tox-control-wrap']\n },\n components: [\n pField,\n memStatus.asSpec()\n ],\n behaviours: derive$1([Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }\n })])\n });\n var memUrlPickerButton = record(renderButton({\n name: spec.name,\n icon: Option.some('browse'),\n text: spec.label.getOr(''),\n disabled: spec.disabled,\n primary: false,\n borderless: true\n }, function (component) {\n return emit(component, browseUrlEvent);\n }, providersBackstage, [], ['tox-browse-url']));\n var controlHWrapper = function () {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-form__controls-h-stack']\n },\n components: flatten([\n [memUrlBox.asSpec()],\n optUrlPicker.map(function () {\n return memUrlPickerButton.asSpec();\n }).toArray()\n ])\n };\n };\n var openUrlPicker = function (comp) {\n Composing.getCurrent(comp).each(function (field) {\n var componentData = Representing.getValue(field);\n var urlData = __assign({ fieldname: spec.name }, componentData);\n optUrlPicker.each(function (picker) {\n picker(urlData).get(function (chosenData) {\n Representing.setValue(field, chosenData);\n emitWith(comp, formChangeEvent, { name: spec.name });\n });\n });\n });\n };\n return FormField.sketch({\n dom: renderFormFieldDom(),\n components: pLabel.toArray().concat([controlHWrapper()]),\n fieldBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providersBackstage.isReadOnly();\n },\n onDisabled: function (comp) {\n FormField.getField(comp).each(Disabling.disable);\n memUrlPickerButton.getOpt(comp).each(Disabling.disable);\n },\n onEnabled: function (comp) {\n FormField.getField(comp).each(Disabling.enable);\n memUrlPickerButton.getOpt(comp).each(Disabling.enable);\n }\n }),\n receivingConfig(),\n config('url-input-events', [run(browseUrlEvent, openUrlPicker)])\n ])\n });\n };\n\n var renderAlertBanner = function (spec, providersBackstage) {\n return Container.sketch({\n dom: {\n tag: 'div',\n attributes: { role: 'alert' },\n classes: [\n 'tox-notification',\n 'tox-notification--in',\n 'tox-notification--' + spec.level\n ]\n },\n components: [\n {\n dom: {\n tag: 'div',\n classes: ['tox-notification__icon']\n },\n components: [Button.sketch({\n dom: {\n tag: 'button',\n classes: [\n 'tox-button',\n 'tox-button--naked',\n 'tox-button--icon'\n ],\n innerHtml: get$d(spec.icon, providersBackstage.icons),\n attributes: { title: providersBackstage.translate(spec.iconTooltip) }\n },\n action: function (comp) {\n emitWith(comp, formActionEvent, {\n name: 'alert-banner',\n value: spec.url\n });\n }\n })]\n },\n {\n dom: {\n tag: 'div',\n classes: ['tox-notification__body'],\n innerHtml: providersBackstage.translate(spec.text)\n }\n }\n ]\n });\n };\n\n var renderCheckbox = function (spec, providerBackstage) {\n var repBehaviour = Representing.config({\n store: {\n mode: 'manual',\n getValue: function (comp) {\n var el = comp.element().dom();\n return el.checked;\n },\n setValue: function (comp, value) {\n var el = comp.element().dom();\n el.checked = value;\n }\n }\n });\n var toggleCheckboxHandler = function (comp) {\n comp.element().dom().click();\n return Option.some(true);\n };\n var pField = FormField.parts().field({\n factory: { sketch: identity },\n dom: {\n tag: 'input',\n classes: ['tox-checkbox__input'],\n attributes: { type: 'checkbox' }\n },\n behaviours: derive$1([\n ComposingConfigs.self(),\n Disabling.config({\n disabled: function () {\n return spec.disabled || providerBackstage.isReadOnly();\n }\n }),\n Tabstopping.config({}),\n Focusing.config({}),\n repBehaviour,\n Keying.config({\n mode: 'special',\n onEnter: toggleCheckboxHandler,\n onSpace: toggleCheckboxHandler,\n stopSpaceKeyup: true\n }),\n config('checkbox-events', [run(change(), function (component, _) {\n emitWith(component, formChangeEvent, { name: spec.name });\n })])\n ])\n });\n var pLabel = FormField.parts().label({\n dom: {\n tag: 'span',\n classes: ['tox-checkbox__label'],\n innerHtml: providerBackstage.translate(spec.label)\n },\n behaviours: derive$1([Unselecting.config({})])\n });\n var makeIcon = function (className) {\n var iconName = className === 'checked' ? 'selected' : 'unselected';\n return {\n dom: {\n tag: 'span',\n classes: [\n 'tox-icon',\n 'tox-checkbox-icon__' + className\n ],\n innerHtml: get$d(iconName, providerBackstage.icons)\n }\n };\n };\n var memIcons = record({\n dom: {\n tag: 'div',\n classes: ['tox-checkbox__icons']\n },\n components: [\n makeIcon('checked'),\n makeIcon('unchecked')\n ]\n });\n return FormField.sketch({\n dom: {\n tag: 'label',\n classes: ['tox-checkbox']\n },\n components: [\n pField,\n memIcons.asSpec(),\n pLabel\n ],\n fieldBehaviours: derive$1([\n Disabling.config({\n disabled: function () {\n return spec.disabled || providerBackstage.isReadOnly();\n },\n disableClass: 'tox-checkbox--disabled',\n onDisabled: function (comp) {\n FormField.getField(comp).each(Disabling.disable);\n },\n onEnabled: function (comp) {\n FormField.getField(comp).each(Disabling.enable);\n }\n }),\n receivingConfig()\n ])\n });\n };\n\n var renderHtmlPanel = function (spec) {\n if (spec.presets === 'presentation') {\n return Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-form__group'],\n innerHtml: spec.html\n }\n });\n } else {\n return Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-form__group'],\n innerHtml: spec.html,\n attributes: { role: 'document' }\n },\n containerBehaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({})\n ])\n });\n }\n };\n\n var make$6 = function (render) {\n return function (parts, spec, backstage) {\n return get(spec, 'name').fold(function () {\n return render(spec, backstage);\n }, function (fieldName) {\n return parts.field(fieldName, render(spec, backstage));\n });\n };\n };\n var makeIframe = function (render) {\n return function (parts, spec, backstage) {\n var iframeSpec = deepMerge(spec, { source: 'dynamic' });\n return make$6(render)(parts, iframeSpec, backstage);\n };\n };\n var factories = {\n bar: make$6(function (spec, backstage) {\n return renderBar(spec, backstage.shared);\n }),\n collection: make$6(function (spec, backstage) {\n return renderCollection(spec, backstage.shared.providers);\n }),\n alertbanner: make$6(function (spec, backstage) {\n return renderAlertBanner(spec, backstage.shared.providers);\n }),\n input: make$6(function (spec, backstage) {\n return renderInput(spec, backstage.shared.providers);\n }),\n textarea: make$6(function (spec, backstage) {\n return renderTextarea(spec, backstage.shared.providers);\n }),\n label: make$6(function (spec, backstage) {\n return renderLabel$2(spec, backstage.shared);\n }),\n iframe: makeIframe(function (spec, backstage) {\n return renderIFrame(spec, backstage.shared.providers);\n }),\n button: make$6(function (spec, backstage) {\n return renderDialogButton(spec, backstage.shared.providers);\n }),\n checkbox: make$6(function (spec, backstage) {\n return renderCheckbox(spec, backstage.shared.providers);\n }),\n colorinput: make$6(function (spec, backstage) {\n return renderColorInput(spec, backstage.shared, backstage.colorinput);\n }),\n colorpicker: make$6(renderColorPicker),\n dropzone: make$6(function (spec, backstage) {\n return renderDropZone(spec, backstage.shared.providers);\n }),\n grid: make$6(function (spec, backstage) {\n return renderGrid(spec, backstage.shared);\n }),\n selectbox: make$6(function (spec, backstage) {\n return renderSelectBox(spec, backstage.shared.providers);\n }),\n sizeinput: make$6(function (spec, backstage) {\n return renderSizeInput(spec, backstage.shared.providers);\n }),\n urlinput: make$6(function (spec, backstage) {\n return renderUrlInput(spec, backstage, backstage.urlinput);\n }),\n customeditor: make$6(renderCustomEditor),\n htmlpanel: make$6(renderHtmlPanel),\n imagetools: make$6(function (spec, backstage) {\n return renderImageTools(spec, backstage.shared.providers);\n }),\n table: make$6(function (spec, backstage) {\n return renderTable(spec, backstage.shared.providers);\n }),\n panel: make$6(function (spec, backstage) {\n return renderPanel(spec, backstage);\n })\n };\n var noFormParts = {\n field: function (_name, spec) {\n return spec;\n }\n };\n var interpretInForm = function (parts, spec, oldBackstage) {\n var newBackstage = deepMerge(oldBackstage, {\n shared: {\n interpreter: function (childSpec) {\n return interpretParts(parts, childSpec, newBackstage);\n }\n }\n });\n return interpretParts(parts, spec, newBackstage);\n };\n var interpretParts = function (parts, spec, backstage) {\n return get(factories, spec.type).fold(function () {\n domGlobals.console.error('Unknown factory type \"' + spec.type + '\", defaulting to container: ', spec);\n return spec;\n }, function (factory) {\n return factory(parts, spec, backstage);\n });\n };\n var interpretWithoutForm = function (spec, backstage) {\n var parts = noFormParts;\n return interpretParts(parts, spec, backstage);\n };\n\n var bubbleAlignments = {\n valignCentre: [],\n alignCentre: [],\n alignLeft: [],\n alignRight: [],\n right: [],\n left: [],\n bottom: [],\n top: []\n };\n var getInlineDialogAnchor = function (contentAreaElement, lazyAnchorbar, lazyUseEditableAreaAnchor) {\n var bubble = nu$8(-12, 12, bubbleAlignments);\n var overrides = { maxHeightFunction: expandable() };\n var editableAreaAnchor = function () {\n return {\n anchor: 'node',\n root: getBody(owner(contentAreaElement())),\n node: Option.from(contentAreaElement()),\n bubble: bubble,\n layouts: {\n onRtl: function () {\n return [northwest$3];\n },\n onLtr: function () {\n return [northeast$3];\n }\n },\n overrides: overrides\n };\n };\n var standardAnchor = function () {\n return {\n anchor: 'hotspot',\n hotspot: lazyAnchorbar(),\n bubble: bubble,\n layouts: {\n onRtl: function () {\n return [southeast$1];\n },\n onLtr: function () {\n return [southwest$1];\n }\n },\n overrides: overrides\n };\n };\n return function () {\n return lazyUseEditableAreaAnchor() ? editableAreaAnchor() : standardAnchor();\n };\n };\n var getBannerAnchor = function (contentAreaElement, lazyAnchorbar, lazyUseEditableAreaAnchor) {\n var editableAreaAnchor = function () {\n return {\n anchor: 'node',\n root: getBody(owner(contentAreaElement())),\n node: Option.from(contentAreaElement()),\n layouts: {\n onRtl: function () {\n return [north$3];\n },\n onLtr: function () {\n return [north$3];\n }\n }\n };\n };\n var standardAnchor = function () {\n return {\n anchor: 'hotspot',\n hotspot: lazyAnchorbar(),\n layouts: {\n onRtl: function () {\n return [south$1];\n },\n onLtr: function () {\n return [south$1];\n }\n }\n };\n };\n return function () {\n return lazyUseEditableAreaAnchor() ? editableAreaAnchor() : standardAnchor();\n };\n };\n var getCursorAnchor = function (editor, bodyElement) {\n return function () {\n return {\n anchor: 'selection',\n root: bodyElement(),\n getSelection: function () {\n var rng = editor.selection.getRng();\n return Option.some(Selection.range(Element.fromDom(rng.startContainer), rng.startOffset, Element.fromDom(rng.endContainer), rng.endOffset));\n }\n };\n };\n };\n var getNodeAnchor = function (bodyElement) {\n return function (element) {\n return {\n anchor: 'node',\n root: bodyElement(),\n node: element\n };\n };\n };\n var getAnchors = function (editor, lazyAnchorbar, isToolbarTop) {\n var useFixedToolbarContainer = useFixedContainer(editor);\n var bodyElement = function () {\n return Element.fromDom(editor.getBody());\n };\n var contentAreaElement = function () {\n return Element.fromDom(editor.getContentAreaContainer());\n };\n var lazyUseEditableAreaAnchor = function () {\n return useFixedToolbarContainer || !isToolbarTop();\n };\n return {\n inlineDialog: getInlineDialogAnchor(contentAreaElement, lazyAnchorbar, lazyUseEditableAreaAnchor),\n banner: getBannerAnchor(contentAreaElement, lazyAnchorbar, lazyUseEditableAreaAnchor),\n cursor: getCursorAnchor(editor, bodyElement),\n node: getNodeAnchor(bodyElement)\n };\n };\n\n var colorPicker = function (editor) {\n return function (callback, value) {\n var dialog = colorPickerDialog(editor);\n dialog(callback, value);\n };\n };\n var hasCustomColors$1 = function (editor) {\n return function () {\n return hasCustomColors(editor);\n };\n };\n var getColors$2 = function (editor) {\n return function () {\n return getColors(editor);\n };\n };\n var getColorCols$2 = function (editor) {\n return function () {\n return getColorCols$1(editor);\n };\n };\n var ColorInputBackstage = function (editor) {\n return {\n colorPicker: colorPicker(editor),\n hasCustomColors: hasCustomColors$1(editor),\n getColors: getColors$2(editor),\n getColorCols: getColorCols$2(editor)\n };\n };\n\n var isDraggableModal$1 = function (editor) {\n return function () {\n return isDraggableModal(editor);\n };\n };\n var DialogBackstage = function (editor) {\n return { isDraggableModal: isDraggableModal$1(editor) };\n };\n\n var HeaderBackstage = function (editor) {\n var mode = Cell(isToolbarLocationBottom(editor) ? 'bottom' : 'top');\n return {\n isPositionedAtTop: function () {\n return mode.get() === 'top';\n },\n getDockingMode: mode.get,\n setDockingMode: mode.set\n };\n };\n\n var defaultStyleFormats = [\n {\n title: 'Headings',\n items: [\n {\n title: 'Heading 1',\n format: 'h1'\n },\n {\n title: 'Heading 2',\n format: 'h2'\n },\n {\n title: 'Heading 3',\n format: 'h3'\n },\n {\n title: 'Heading 4',\n format: 'h4'\n },\n {\n title: 'Heading 5',\n format: 'h5'\n },\n {\n title: 'Heading 6',\n format: 'h6'\n }\n ]\n },\n {\n title: 'Inline',\n items: [\n {\n title: 'Bold',\n format: 'bold'\n },\n {\n title: 'Italic',\n format: 'italic'\n },\n {\n title: 'Underline',\n format: 'underline'\n },\n {\n title: 'Strikethrough',\n format: 'strikethrough'\n },\n {\n title: 'Superscript',\n format: 'superscript'\n },\n {\n title: 'Subscript',\n format: 'subscript'\n },\n {\n title: 'Code',\n format: 'code'\n }\n ]\n },\n {\n title: 'Blocks',\n items: [\n {\n title: 'Paragraph',\n format: 'p'\n },\n {\n title: 'Blockquote',\n format: 'blockquote'\n },\n {\n title: 'Div',\n format: 'div'\n },\n {\n title: 'Pre',\n format: 'pre'\n }\n ]\n },\n {\n title: 'Align',\n items: [\n {\n title: 'Left',\n format: 'alignleft'\n },\n {\n title: 'Center',\n format: 'aligncenter'\n },\n {\n title: 'Right',\n format: 'alignright'\n },\n {\n title: 'Justify',\n format: 'alignjustify'\n }\n ]\n }\n ];\n var isNestedFormat = function (format) {\n return has(format, 'items');\n };\n var isBlockFormat = function (format) {\n return has(format, 'block');\n };\n var isInlineFormat = function (format) {\n return has(format, 'inline');\n };\n var isSelectorFormat = function (format) {\n return has(format, 'selector');\n };\n var mapFormats = function (userFormats) {\n return foldl(userFormats, function (acc, fmt) {\n if (isNestedFormat(fmt)) {\n var result = mapFormats(fmt.items);\n return {\n customFormats: acc.customFormats.concat(result.customFormats),\n formats: acc.formats.concat([{\n title: fmt.title,\n items: result.formats\n }])\n };\n } else if (isInlineFormat(fmt) || isBlockFormat(fmt) || isSelectorFormat(fmt)) {\n var formatName = 'custom-' + fmt.title.toLowerCase();\n return {\n customFormats: acc.customFormats.concat([{\n name: formatName,\n format: fmt\n }]),\n formats: acc.formats.concat([{\n title: fmt.title,\n format: formatName,\n icon: fmt.icon\n }])\n };\n } else {\n return __assign(__assign({}, acc), { formats: acc.formats.concat(fmt) });\n }\n }, {\n customFormats: [],\n formats: []\n });\n };\n var registerCustomFormats = function (editor, userFormats) {\n var result = mapFormats(userFormats);\n var registerFormats = function (customFormats) {\n each(customFormats, function (fmt) {\n if (!editor.formatter.has(fmt.name)) {\n editor.formatter.register(fmt.name, fmt.format);\n }\n });\n };\n if (editor.formatter) {\n registerFormats(result.customFormats);\n } else {\n editor.on('init', function () {\n registerFormats(result.customFormats);\n });\n }\n return result.formats;\n };\n var getStyleFormats = function (editor) {\n return getUserStyleFormats(editor).map(function (userFormats) {\n var registeredUserFormats = registerCustomFormats(editor, userFormats);\n return isMergeStyleFormats(editor) ? defaultStyleFormats.concat(registeredUserFormats) : registeredUserFormats;\n }).getOr(defaultStyleFormats);\n };\n\n var processBasic = function (item, isSelectedFor, getPreviewFor) {\n var formatterSpec = {\n type: 'formatter',\n isSelected: isSelectedFor(item.format),\n getStylePreview: getPreviewFor(item.format)\n };\n return deepMerge(item, formatterSpec);\n };\n var register$3 = function (editor, formats, isSelectedFor, getPreviewFor) {\n var enrichSupported = function (item) {\n return processBasic(item, isSelectedFor, getPreviewFor);\n };\n var enrichMenu = function (item) {\n var submenuSpec = { type: 'submenu' };\n return deepMerge(item, submenuSpec);\n };\n var enrichCustom = function (item) {\n var formatName = generate$1(item.title);\n var customSpec = {\n type: 'formatter',\n format: formatName,\n isSelected: isSelectedFor(formatName),\n getStylePreview: getPreviewFor(formatName)\n };\n var newItem = deepMerge(item, customSpec);\n editor.formatter.register(formatName, newItem);\n return newItem;\n };\n var doEnrich = function (items) {\n return map(items, function (item) {\n var keys$1 = keys(item);\n if (hasNonNullableKey(item, 'items')) {\n var newItems_1 = doEnrich(item.items);\n return deepMerge(enrichMenu(item), {\n getStyleItems: function () {\n return newItems_1;\n }\n });\n } else if (hasNonNullableKey(item, 'format')) {\n return enrichSupported(item);\n } else if (keys$1.length === 1 && contains(keys$1, 'title')) {\n return deepMerge(item, { type: 'separator' });\n } else {\n return enrichCustom(item);\n }\n });\n };\n return doEnrich(formats);\n };\n\n var init$7 = function (editor) {\n var isSelectedFor = function (format) {\n return function () {\n return editor.formatter.match(format);\n };\n };\n var getPreviewFor = function (format) {\n return function () {\n var fmt = editor.formatter.get(format);\n return fmt !== undefined ? Option.some({\n tag: fmt.length > 0 ? fmt[0].inline || fmt[0].block || 'div' : 'div',\n styles: editor.dom.parseStyle(editor.formatter.getCssText(format))\n }) : Option.none();\n };\n };\n var flatten = function (fmt) {\n var subs = fmt.items;\n return subs !== undefined && subs.length > 0 ? bind(subs, flatten) : [fmt.format];\n };\n var settingsFormats = Cell([]);\n var settingsFlattenedFormats = Cell([]);\n var eventsFormats = Cell([]);\n var eventsFlattenedFormats = Cell([]);\n var replaceSettings = Cell(false);\n editor.on('PreInit', function (_e) {\n var formats = getStyleFormats(editor);\n var enriched = register$3(editor, formats, isSelectedFor, getPreviewFor);\n settingsFormats.set(enriched);\n settingsFlattenedFormats.set(bind(enriched, flatten));\n });\n editor.on('addStyleModifications', function (e) {\n var modifications = register$3(editor, e.items, isSelectedFor, getPreviewFor);\n eventsFormats.set(modifications);\n replaceSettings.set(e.replace);\n eventsFlattenedFormats.set(bind(modifications, flatten));\n });\n var getData = function () {\n var fromSettings = replaceSettings.get() ? [] : settingsFormats.get();\n var fromEvents = eventsFormats.get();\n return fromSettings.concat(fromEvents);\n };\n var getFlattenedKeys = function () {\n var fromSettings = replaceSettings.get() ? [] : settingsFlattenedFormats.get();\n var fromEvents = eventsFlattenedFormats.get();\n return fromSettings.concat(fromEvents);\n };\n return {\n getData: getData,\n getFlattenedKeys: getFlattenedKeys\n };\n };\n\n var trim$1 = global$e.trim;\n var hasContentEditableState = function (value) {\n return function (node) {\n if (node && node.nodeType === 1) {\n if (node.contentEditable === value) {\n return true;\n }\n if (node.getAttribute('data-mce-contenteditable') === value) {\n return true;\n }\n }\n return false;\n };\n };\n var isContentEditableTrue = hasContentEditableState('true');\n var isContentEditableFalse = hasContentEditableState('false');\n var create$8 = function (type, title, url, level, attach) {\n return {\n type: type,\n title: title,\n url: url,\n level: level,\n attach: attach\n };\n };\n var isChildOfContentEditableTrue = function (node) {\n while (node = node.parentNode) {\n var value = node.contentEditable;\n if (value && value !== 'inherit') {\n return isContentEditableTrue(node);\n }\n }\n return false;\n };\n var select = function (selector, root) {\n return map(descendants(Element.fromDom(root), selector), function (element) {\n return element.dom();\n });\n };\n var getElementText = function (elm) {\n return elm.innerText || elm.textContent;\n };\n var getOrGenerateId = function (elm) {\n return elm.id ? elm.id : generate$1('h');\n };\n var isAnchor = function (elm) {\n return elm && elm.nodeName === 'A' && (elm.id || elm.name) !== undefined;\n };\n var isValidAnchor = function (elm) {\n return isAnchor(elm) && isEditable(elm);\n };\n var isHeader = function (elm) {\n return elm && /^(H[1-6])$/.test(elm.nodeName);\n };\n var isEditable = function (elm) {\n return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm);\n };\n var isValidHeader = function (elm) {\n return isHeader(elm) && isEditable(elm);\n };\n var getLevel = function (elm) {\n return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0;\n };\n var headerTarget = function (elm) {\n var headerId = getOrGenerateId(elm);\n var attach = function () {\n elm.id = headerId;\n };\n return create$8('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);\n };\n var anchorTarget = function (elm) {\n var anchorId = elm.id || elm.name;\n var anchorText = getElementText(elm);\n return create$8('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);\n };\n var getHeaderTargets = function (elms) {\n return map(filter(elms, isValidHeader), headerTarget);\n };\n var getAnchorTargets = function (elms) {\n return map(filter(elms, isValidAnchor), anchorTarget);\n };\n var getTargetElements = function (elm) {\n var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm);\n return elms;\n };\n var hasTitle = function (target) {\n return trim$1(target.title).length > 0;\n };\n var find$5 = function (elm) {\n var elms = getTargetElements(elm);\n return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle);\n };\n var LinkTargets = { find: find$5 };\n\n var STORAGE_KEY = 'tinymce-url-history';\n var HISTORY_LENGTH = 5;\n var isHttpUrl = function (url) {\n return isString(url) && /^https?/.test(url);\n };\n var isArrayOfUrl = function (a) {\n return isArray(a) && a.length <= HISTORY_LENGTH && forall(a, isHttpUrl);\n };\n var isRecordOfUrlArray = function (r) {\n return isObject(r) && find$1(r, function (value) {\n return !isArrayOfUrl(value);\n }).isNone();\n };\n var getAllHistory = function () {\n var unparsedHistory = global$9.getItem(STORAGE_KEY);\n if (unparsedHistory === null) {\n return {};\n }\n var history;\n try {\n history = JSON.parse(unparsedHistory);\n } catch (e) {\n if (e instanceof SyntaxError) {\n domGlobals.console.log('Local storage ' + STORAGE_KEY + ' was not valid JSON', e);\n return {};\n }\n throw e;\n }\n if (!isRecordOfUrlArray(history)) {\n domGlobals.console.log('Local storage ' + STORAGE_KEY + ' was not valid format', history);\n return {};\n }\n return history;\n };\n var setAllHistory = function (history) {\n if (!isRecordOfUrlArray(history)) {\n throw new Error('Bad format for history:\\n' + JSON.stringify(history));\n }\n global$9.setItem(STORAGE_KEY, JSON.stringify(history));\n };\n var getHistory = function (fileType) {\n var history = getAllHistory();\n return Object.prototype.hasOwnProperty.call(history, fileType) ? history[fileType] : [];\n };\n var addToHistory = function (url, fileType) {\n if (!isHttpUrl(url)) {\n return;\n }\n var history = getAllHistory();\n var items = Object.prototype.hasOwnProperty.call(history, fileType) ? history[fileType] : [];\n var itemsWithoutUrl = filter(items, function (item) {\n return item !== url;\n });\n history[fileType] = [url].concat(itemsWithoutUrl).slice(0, HISTORY_LENGTH);\n setAllHistory(history);\n };\n\n var isTruthy = function (value) {\n return !!value;\n };\n var makeMap = function (value) {\n return map$2(global$e.makeMap(value, /[, ]/), isTruthy);\n };\n var getPicker = function (editor) {\n return Option.from(getFilePickerCallback(editor)).filter(isFunction);\n };\n var getPickerTypes = function (editor) {\n var optFileTypes = Option.some(getFilePickerTypes(editor)).filter(isTruthy);\n var optLegacyTypes = Option.some(getFileBrowserCallbackTypes(editor)).filter(isTruthy);\n var optTypes = optFileTypes.or(optLegacyTypes).map(makeMap);\n return getPicker(editor).fold(function () {\n return false;\n }, function (_picker) {\n return optTypes.fold(function () {\n return true;\n }, function (types) {\n return keys(types).length > 0 ? types : false;\n });\n });\n };\n var getPickerSetting = function (editor, filetype) {\n var pickerTypes = getPickerTypes(editor);\n if (isBoolean(pickerTypes)) {\n return pickerTypes ? getPicker(editor) : Option.none();\n } else {\n return pickerTypes[filetype] ? getPicker(editor) : Option.none();\n }\n };\n var getUrlPicker = function (editor, filetype) {\n return getPickerSetting(editor, filetype).map(function (picker) {\n return function (entry) {\n return Future.nu(function (completer) {\n var handler = function (value, meta) {\n if (!isString(value)) {\n throw new Error('Expected value to be string');\n }\n if (meta !== undefined && !isObject(meta)) {\n throw new Error('Expected meta to be a object');\n }\n var r = {\n value: value,\n meta: meta\n };\n completer(r);\n };\n var meta = __assign({\n filetype: filetype,\n fieldname: entry.fieldname\n }, Option.from(entry.meta).getOr({}));\n picker.call(editor, handler, entry.value, meta);\n });\n };\n });\n };\n var getLinkInformation = function (editor) {\n if (noTypeaheadUrls(editor)) {\n return Option.none();\n }\n return Option.some({\n targets: LinkTargets.find(editor.getBody()),\n anchorTop: getAnchorTop(editor),\n anchorBottom: getAnchorBottom(editor)\n });\n };\n var getValidationHandler = function (editor) {\n return Option.from(getFilePickerValidatorHandler(editor));\n };\n var UrlInputBackstage = function (editor) {\n return {\n getHistory: getHistory,\n addToHistory: addToHistory,\n getLinkInformation: function () {\n return getLinkInformation(editor);\n },\n getValidationHandler: function () {\n return getValidationHandler(editor);\n },\n getUrlPicker: function (filetype) {\n return getUrlPicker(editor, filetype);\n }\n };\n };\n\n var init$8 = function (sink, editor, lazyAnchorbar) {\n var contextMenuState = Cell(false);\n var toolbar = HeaderBackstage(editor);\n var backstage = {\n shared: {\n providers: {\n icons: function () {\n return editor.ui.registry.getAll().icons;\n },\n menuItems: function () {\n return editor.ui.registry.getAll().menuItems;\n },\n translate: global$6.translate,\n isReadOnly: function () {\n return editor.mode.isReadOnly();\n }\n },\n interpreter: function (s) {\n return interpretWithoutForm(s, backstage);\n },\n anchors: getAnchors(editor, lazyAnchorbar, toolbar.isPositionedAtTop),\n header: toolbar,\n getSink: function () {\n return Result.value(sink);\n }\n },\n urlinput: UrlInputBackstage(editor),\n styleselect: init$7(editor),\n colorinput: ColorInputBackstage(editor),\n dialog: DialogBackstage(editor),\n isContextMenuOpen: function () {\n return contextMenuState.get();\n },\n setContextMenuState: function (state) {\n return contextMenuState.set(state);\n }\n };\n return backstage;\n };\n\n var expandable$1 = constant(function (element, available) {\n setMax$1(element, Math.floor(available));\n });\n\n var showContextToolbarEvent = 'contexttoolbar-show';\n var hideContextToolbarEvent = 'contexttoolbar-hide';\n\n var schema$k = constant([\n strict$1('items'),\n markers(['itemSelector']),\n field$1('tgroupBehaviours', [Keying])\n ]);\n var parts$7 = constant([group({\n name: 'items',\n unit: 'item'\n })]);\n\n var factory$9 = function (detail, components, _spec, _externals) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.tgroupBehaviours, [Keying.config({\n mode: 'flow',\n selector: detail.markers.itemSelector\n })]),\n domModification: { attributes: { role: 'toolbar' } }\n };\n };\n var ToolbarGroup = composite$1({\n name: 'ToolbarGroup',\n configFields: schema$k(),\n partFields: parts$7(),\n factory: factory$9\n });\n\n var schema$l = constant([\n strict$1('dom'),\n defaulted$1('shell', true),\n field$1('toolbarBehaviours', [Replacing])\n ]);\n var enhanceGroups = function () {\n return { behaviours: derive$1([Replacing.config({})]) };\n };\n var parts$8 = constant([optional({\n name: 'groups',\n overrides: enhanceGroups\n })]);\n\n var factory$a = function (detail, components, _spec, _externals) {\n var setGroups = function (toolbar, groups) {\n getGroupContainer(toolbar).fold(function () {\n domGlobals.console.error('Toolbar was defined to not be a shell, but no groups container was specified in components');\n throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components');\n }, function (container) {\n Replacing.set(container, groups);\n });\n };\n var getGroupContainer = function (component) {\n return detail.shell ? Option.some(component) : getPart(component, detail, 'groups');\n };\n var extra = detail.shell ? {\n behaviours: [Replacing.config({})],\n components: []\n } : {\n behaviours: [],\n components: components\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: extra.components,\n behaviours: augment(detail.toolbarBehaviours, extra.behaviours),\n apis: { setGroups: setGroups },\n domModification: { attributes: { role: 'group' } }\n };\n };\n var Toolbar = composite$1({\n name: 'Toolbar',\n configFields: schema$l(),\n partFields: parts$8(),\n factory: factory$a,\n apis: {\n setGroups: function (apis, toolbar, groups) {\n apis.setGroups(toolbar, groups);\n }\n }\n });\n\n var generate$6 = function (xs, f) {\n var init = {\n len: 0,\n list: []\n };\n var r = foldl(xs, function (b, a) {\n var value = f(a, b.len);\n return value.fold(constant(b), function (v) {\n return {\n len: v.finish(),\n list: b.list.concat([v])\n };\n });\n }, init);\n return r.list;\n };\n\n var output$1 = function (within, extra, withinWidth) {\n return {\n within: constant(within),\n extra: constant(extra),\n withinWidth: constant(withinWidth)\n };\n };\n var apportion = function (units, total, len) {\n var parray = generate$6(units, function (unit, current) {\n var width = len(unit);\n return Option.some({\n element: constant(unit),\n start: constant(current),\n finish: constant(current + width),\n width: constant(width)\n });\n });\n var within = filter(parray, function (unit) {\n return unit.finish() <= total;\n });\n var withinWidth = foldr(within, function (acc, el) {\n return acc + el.width();\n }, 0);\n var extra = parray.slice(within.length);\n return {\n within: constant(within),\n extra: constant(extra),\n withinWidth: constant(withinWidth)\n };\n };\n var toUnit = function (parray) {\n return map(parray, function (unit) {\n return unit.element();\n });\n };\n var fitLast = function (within, extra, withinWidth) {\n var fits = toUnit(within.concat(extra));\n return output$1(fits, [], withinWidth);\n };\n var overflow = function (within, extra, overflower, withinWidth) {\n var fits = toUnit(within).concat([overflower]);\n return output$1(fits, toUnit(extra), withinWidth);\n };\n var fitAll = function (within, extra, withinWidth) {\n return output$1(toUnit(within), [], withinWidth);\n };\n var tryFit = function (total, units, len) {\n var divide = apportion(units, total, len);\n return divide.extra().length === 0 ? Option.some(divide) : Option.none();\n };\n var partition$3 = function (total, units, len, overflower) {\n var divide = tryFit(total, units, len).getOrThunk(function () {\n return apportion(units, total - len(overflower), len);\n });\n var within = divide.within();\n var extra = divide.extra();\n var withinWidth = divide.withinWidth();\n if (extra.length === 1 && extra[0].width() <= len(overflower)) {\n return fitLast(within, extra, withinWidth);\n } else if (extra.length >= 1) {\n return overflow(within, extra, overflower, withinWidth);\n } else {\n return fitAll(within, extra, withinWidth);\n }\n };\n\n var setGroups = function (toolbar, storedGroups) {\n var bGroups = map(storedGroups, function (g) {\n return premade$1(g);\n });\n Toolbar.setGroups(toolbar, bGroups);\n };\n var findFocusedComp = function (comps) {\n return findMap(comps, function (comp) {\n return search(comp.element()).bind(function (focusedElm) {\n return comp.getSystem().getByDom(focusedElm).toOption();\n });\n });\n };\n var refresh = function (toolbar, detail, setOverflow) {\n var primary = getPartOrDie(toolbar, detail, 'primary');\n var overflowGroup = Coupling.getCoupled(toolbar, 'overflowGroup');\n set$2(primary.element(), 'visibility', 'hidden');\n var groups = detail.builtGroups.get().concat([overflowGroup]);\n var focusedComp = findFocusedComp(groups);\n setOverflow([]);\n setGroups(primary, groups);\n var availableWidth = get$7(primary.element());\n var overflows = partition$3(availableWidth, detail.builtGroups.get(), function (comp) {\n return get$7(comp.element());\n }, overflowGroup);\n if (overflows.extra().length === 0) {\n Replacing.remove(primary, overflowGroup);\n setOverflow([]);\n } else {\n setGroups(primary, overflows.within());\n setOverflow(overflows.extra());\n }\n remove$6(primary.element(), 'visibility');\n reflow(primary.element());\n focusedComp.each(Focusing.focus);\n };\n\n var schema$m = constant([\n field$1('splitToolbarBehaviours', [Coupling]),\n state$1('builtGroups', function () {\n return Cell([]);\n })\n ]);\n\n var schema$n = constant([\n markers(['overflowToggledClass']),\n optionFunction('getOverflowBounds'),\n strict$1('lazySink'),\n state$1('overflowGroups', function () {\n return Cell([]);\n })\n ].concat(schema$m()));\n var parts$9 = constant([\n required({\n factory: Toolbar,\n schema: schema$l(),\n name: 'primary'\n }),\n external$1({\n schema: schema$l(),\n name: 'overflow'\n }),\n external$1({ name: 'overflow-button' }),\n external$1({ name: 'overflow-group' })\n ]);\n\n var schema$o = constant([\n markers(['toggledClass']),\n strict$1('lazySink'),\n strictFunction('fetch'),\n optionFunction('getBounds'),\n optionObjOf('fireDismissalEventInstead', [defaulted$1('event', dismissRequested())]),\n schema$1()\n ]);\n var parts$a = constant([\n external$1({\n name: 'button',\n overrides: function (detail) {\n return {\n dom: { attributes: { 'aria-haspopup': 'true' } },\n buttonBehaviours: derive$1([Toggling.config({\n toggleClass: detail.markers.toggledClass,\n aria: { mode: 'expanded' },\n toggleOnExecute: false\n })])\n };\n }\n }),\n external$1({\n factory: Toolbar,\n schema: schema$l(),\n name: 'toolbar',\n overrides: function (detail) {\n return {\n toolbarBehaviours: derive$1([Keying.config({\n mode: 'cyclic',\n onEscape: function (comp) {\n getPart(comp, detail, 'button').each(Focusing.focus);\n return Option.none();\n }\n })])\n };\n }\n })\n ]);\n\n var toggle$2 = function (button, externals) {\n var toolbarSandbox = Coupling.getCoupled(button, 'toolbarSandbox');\n if (Sandboxing.isOpen(toolbarSandbox)) {\n Sandboxing.close(toolbarSandbox);\n } else {\n Sandboxing.open(toolbarSandbox, externals.toolbar());\n }\n };\n var position$2 = function (button, toolbar, detail, layouts) {\n var bounds = detail.getBounds.map(function (bounder) {\n return bounder();\n });\n var sink = detail.lazySink(button).getOrDie();\n Positioning.positionWithinBounds(sink, {\n anchor: 'hotspot',\n hotspot: button,\n layouts: layouts,\n overrides: { maxWidthFunction: expandable$1() }\n }, toolbar, bounds);\n };\n var setGroups$1 = function (button, toolbar, detail, layouts, groups) {\n Toolbar.setGroups(toolbar, groups);\n position$2(button, toolbar, detail, layouts);\n Toggling.on(button);\n };\n var makeSandbox$1 = function (button, spec, detail) {\n var ariaOwner = manager();\n var onOpen = function (sandbox, toolbar) {\n detail.fetch().get(function (groups) {\n setGroups$1(button, toolbar, detail, spec.layouts, groups);\n ariaOwner.link(button.element());\n Keying.focusIn(toolbar);\n });\n };\n var onClose = function () {\n Toggling.off(button);\n Focusing.focus(button);\n ariaOwner.unlink(button.element());\n };\n return {\n dom: {\n tag: 'div',\n attributes: { id: ariaOwner.id }\n },\n behaviours: derive$1([\n Keying.config({\n mode: 'special',\n onEscape: function (comp) {\n Sandboxing.close(comp);\n return Option.some(true);\n }\n }),\n Sandboxing.config({\n onOpen: onOpen,\n onClose: onClose,\n isPartOf: function (container, data, queryElem) {\n return isPartOf(data, queryElem) || isPartOf(button, queryElem);\n },\n getAttachPoint: function () {\n return detail.lazySink(button).getOrDie();\n }\n }),\n Receiving.config({\n channels: __assign(__assign({}, receivingChannel(__assign({ isExtraPart: never }, detail.fireDismissalEventInstead.map(function (fe) {\n return { fireEventInstead: { event: fe.event } };\n }).getOr({})))), receivingChannel$1({\n doReposition: function () {\n Sandboxing.getState(Coupling.getCoupled(button, 'toolbarSandbox')).each(function (toolbar) {\n position$2(button, toolbar, detail, spec.layouts);\n });\n }\n }))\n })\n ])\n };\n };\n var factory$b = function (detail, components, spec, externals) {\n return __assign(__assign({}, Button.sketch(__assign(__assign({}, externals.button()), {\n action: function (button) {\n toggle$2(button, externals);\n },\n buttonBehaviours: SketchBehaviours.augment({ dump: externals.button().buttonBehaviours }, [Coupling.config({\n others: {\n toolbarSandbox: function (button) {\n return makeSandbox$1(button, spec, detail);\n }\n }\n })])\n }))), {\n apis: {\n setGroups: function (button, groups) {\n Sandboxing.getState(Coupling.getCoupled(button, 'toolbarSandbox')).each(function (toolbar) {\n setGroups$1(button, toolbar, detail, spec.layouts, groups);\n });\n },\n reposition: function (button) {\n Sandboxing.getState(Coupling.getCoupled(button, 'toolbarSandbox')).each(function (toolbar) {\n position$2(button, toolbar, detail, spec.layouts);\n });\n },\n toggle: function (button) {\n toggle$2(button, externals);\n },\n getToolbar: function (button) {\n return Sandboxing.getState(Coupling.getCoupled(button, 'toolbarSandbox'));\n }\n }\n });\n };\n var FloatingToolbarButton = composite$1({\n name: 'FloatingToolbarButton',\n factory: factory$b,\n configFields: schema$o(),\n partFields: parts$a(),\n apis: {\n setGroups: function (apis, button, groups) {\n apis.setGroups(button, groups);\n },\n reposition: function (apis, button) {\n apis.reposition(button);\n },\n toggle: function (apis, button) {\n apis.toggle(button);\n },\n getToolbar: function (apis, button) {\n return apis.getToolbar(button);\n }\n }\n });\n\n var buildGroups = function (comps) {\n return map(comps, function (g) {\n return premade$1(g);\n });\n };\n var refresh$1 = function (toolbar, memFloatingToolbarButton, detail) {\n refresh(toolbar, detail, function (overflowGroups) {\n detail.overflowGroups.set(overflowGroups);\n memFloatingToolbarButton.getOpt(toolbar).each(function (floatingToolbarButton) {\n FloatingToolbarButton.setGroups(floatingToolbarButton, buildGroups(overflowGroups));\n });\n });\n };\n var factory$c = function (detail, components, spec, externals) {\n var memFloatingToolbarButton = record(FloatingToolbarButton.sketch({\n fetch: function () {\n return Future.nu(function (resolve) {\n resolve(buildGroups(detail.overflowGroups.get()));\n });\n },\n layouts: {\n onLtr: function () {\n return [\n southwest$1,\n southeast$1\n ];\n },\n onRtl: function () {\n return [\n southeast$1,\n southwest$1\n ];\n },\n onBottomLtr: function () {\n return [\n northwest$1,\n northeast$1\n ];\n },\n onBottomRtl: function () {\n return [\n northeast$1,\n northwest$1\n ];\n }\n },\n getBounds: spec.getOverflowBounds,\n lazySink: detail.lazySink,\n fireDismissalEventInstead: {},\n markers: { toggledClass: detail.markers.overflowToggledClass },\n parts: {\n button: externals['overflow-button'](),\n toolbar: externals.overflow()\n }\n }));\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.splitToolbarBehaviours, [Coupling.config({\n others: {\n overflowGroup: function () {\n return ToolbarGroup.sketch(__assign(__assign({}, externals['overflow-group']()), { items: [memFloatingToolbarButton.asSpec()] }));\n }\n }\n })]),\n apis: {\n setGroups: function (toolbar, groups) {\n detail.builtGroups.set(map(groups, toolbar.getSystem().build));\n refresh$1(toolbar, memFloatingToolbarButton, detail);\n },\n refresh: function (toolbar) {\n return refresh$1(toolbar, memFloatingToolbarButton, detail);\n },\n toggle: function (toolbar) {\n memFloatingToolbarButton.getOpt(toolbar).each(function (floatingToolbarButton) {\n FloatingToolbarButton.toggle(floatingToolbarButton);\n });\n },\n reposition: function (toolbar) {\n memFloatingToolbarButton.getOpt(toolbar).each(function (floatingToolbarButton) {\n FloatingToolbarButton.reposition(floatingToolbarButton);\n });\n },\n getOverflow: function (toolbar) {\n return memFloatingToolbarButton.getOpt(toolbar).bind(function (floatingToolbarButton) {\n return FloatingToolbarButton.getToolbar(floatingToolbarButton);\n });\n }\n },\n domModification: { attributes: { role: 'group' } }\n };\n };\n var SplitFloatingToolbar = composite$1({\n name: 'SplitFloatingToolbar',\n configFields: schema$n(),\n partFields: parts$9(),\n factory: factory$c,\n apis: {\n setGroups: function (apis, toolbar, groups) {\n apis.setGroups(toolbar, groups);\n },\n refresh: function (apis, toolbar) {\n apis.refresh(toolbar);\n },\n reposition: function (apis, toolbar) {\n apis.reposition(toolbar);\n },\n toggle: function (apis, toolbar) {\n apis.toggle(toolbar);\n },\n getOverflow: function (apis, toolbar) {\n return apis.getOverflow(toolbar);\n }\n }\n });\n\n var getAnimationRoot = function (component, slideConfig) {\n return slideConfig.getAnimationRoot.fold(function () {\n return component.element();\n }, function (get) {\n return get(component);\n });\n };\n\n var getDimensionProperty = function (slideConfig) {\n return slideConfig.dimension.property;\n };\n var getDimension = function (slideConfig, elem) {\n return slideConfig.dimension.getDimension(elem);\n };\n var disableTransitions = function (component, slideConfig) {\n var root = getAnimationRoot(component, slideConfig);\n remove$5(root, [\n slideConfig.shrinkingClass,\n slideConfig.growingClass\n ]);\n };\n var setShrunk = function (component, slideConfig) {\n remove$4(component.element(), slideConfig.openClass);\n add$2(component.element(), slideConfig.closedClass);\n set$2(component.element(), getDimensionProperty(slideConfig), '0px');\n reflow(component.element());\n };\n var setGrown = function (component, slideConfig) {\n remove$4(component.element(), slideConfig.closedClass);\n add$2(component.element(), slideConfig.openClass);\n remove$6(component.element(), getDimensionProperty(slideConfig));\n };\n var doImmediateShrink = function (component, slideConfig, slideState, _calculatedSize) {\n slideState.setCollapsed();\n set$2(component.element(), getDimensionProperty(slideConfig), getDimension(slideConfig, component.element()));\n reflow(component.element());\n disableTransitions(component, slideConfig);\n setShrunk(component, slideConfig);\n slideConfig.onStartShrink(component);\n slideConfig.onShrunk(component);\n };\n var doStartShrink = function (component, slideConfig, slideState, calculatedSize) {\n var size = calculatedSize.getOrThunk(function () {\n return getDimension(slideConfig, component.element());\n });\n slideState.setCollapsed();\n set$2(component.element(), getDimensionProperty(slideConfig), size);\n reflow(component.element());\n var root = getAnimationRoot(component, slideConfig);\n remove$4(root, slideConfig.growingClass);\n add$2(root, slideConfig.shrinkingClass);\n setShrunk(component, slideConfig);\n slideConfig.onStartShrink(component);\n };\n var doStartSmartShrink = function (component, slideConfig, slideState) {\n var size = getDimension(slideConfig, component.element());\n var shrinker = size === '0px' ? doImmediateShrink : doStartShrink;\n shrinker(component, slideConfig, slideState, Option.some(size));\n };\n var doStartGrow = function (component, slideConfig, slideState) {\n var root = getAnimationRoot(component, slideConfig);\n var wasShrinking = has$2(root, slideConfig.shrinkingClass);\n var beforeSize = getDimension(slideConfig, component.element());\n setGrown(component, slideConfig);\n var fullSize = getDimension(slideConfig, component.element());\n var startPartialGrow = function () {\n set$2(component.element(), getDimensionProperty(slideConfig), beforeSize);\n reflow(component.element());\n };\n var startCompleteGrow = function () {\n setShrunk(component, slideConfig);\n };\n var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow;\n setStartSize();\n remove$4(root, slideConfig.shrinkingClass);\n add$2(root, slideConfig.growingClass);\n setGrown(component, slideConfig);\n set$2(component.element(), getDimensionProperty(slideConfig), fullSize);\n slideState.setExpanded();\n slideConfig.onStartGrow(component);\n };\n var refresh$2 = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n remove$6(component.element(), getDimensionProperty(slideConfig));\n var fullSize = getDimension(slideConfig, component.element());\n set$2(component.element(), getDimensionProperty(slideConfig), fullSize);\n }\n };\n var grow = function (component, slideConfig, slideState) {\n if (!slideState.isExpanded()) {\n doStartGrow(component, slideConfig, slideState);\n }\n };\n var shrink = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n doStartSmartShrink(component, slideConfig, slideState);\n }\n };\n var immediateShrink = function (component, slideConfig, slideState) {\n if (slideState.isExpanded()) {\n doImmediateShrink(component, slideConfig, slideState, Option.none());\n }\n };\n var hasGrown = function (component, slideConfig, slideState) {\n return slideState.isExpanded();\n };\n var hasShrunk = function (component, slideConfig, slideState) {\n return slideState.isCollapsed();\n };\n var isGrowing = function (component, slideConfig, _slideState) {\n var root = getAnimationRoot(component, slideConfig);\n return has$2(root, slideConfig.growingClass) === true;\n };\n var isShrinking = function (component, slideConfig, _slideState) {\n var root = getAnimationRoot(component, slideConfig);\n return has$2(root, slideConfig.shrinkingClass) === true;\n };\n var isTransitioning = function (component, slideConfig, slideState) {\n return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true;\n };\n var toggleGrow = function (component, slideConfig, slideState) {\n var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow;\n f(component, slideConfig, slideState);\n };\n\n var SlidingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n refresh: refresh$2,\n grow: grow,\n shrink: shrink,\n immediateShrink: immediateShrink,\n hasGrown: hasGrown,\n hasShrunk: hasShrunk,\n isGrowing: isGrowing,\n isShrinking: isShrinking,\n isTransitioning: isTransitioning,\n toggleGrow: toggleGrow,\n disableTransitions: disableTransitions\n });\n\n var exhibit$6 = function (base, slideConfig, _slideState) {\n var expanded = slideConfig.expanded;\n return expanded ? nu$6({\n classes: [slideConfig.openClass],\n styles: {}\n }) : nu$6({\n classes: [slideConfig.closedClass],\n styles: wrap$1(slideConfig.dimension.property, '0px')\n });\n };\n var events$d = function (slideConfig, slideState) {\n return derive([runOnSource(transitionend(), function (component, simulatedEvent) {\n var raw = simulatedEvent.event().raw();\n if (raw.propertyName === slideConfig.dimension.property) {\n disableTransitions(component, slideConfig);\n if (slideState.isExpanded()) {\n remove$6(component.element(), slideConfig.dimension.property);\n }\n var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk;\n notify(component);\n }\n })]);\n };\n\n var ActiveSliding = /*#__PURE__*/Object.freeze({\n __proto__: null,\n exhibit: exhibit$6,\n events: events$d\n });\n\n var SlidingSchema = [\n strict$1('closedClass'),\n strict$1('openClass'),\n strict$1('shrinkingClass'),\n strict$1('growingClass'),\n option('getAnimationRoot'),\n onHandler('onShrunk'),\n onHandler('onStartShrink'),\n onHandler('onGrown'),\n onHandler('onStartGrow'),\n defaulted$1('expanded', false),\n strictOf('dimension', choose$1('property', {\n width: [\n output('property', 'width'),\n output('getDimension', function (elem) {\n return get$7(elem) + 'px';\n })\n ],\n height: [\n output('property', 'height'),\n output('getDimension', function (elem) {\n return get$6(elem) + 'px';\n })\n ]\n }))\n ];\n\n var init$9 = function (spec) {\n var state = Cell(spec.expanded);\n var readState = function () {\n return 'expanded: ' + state.get();\n };\n return nu$5({\n isExpanded: function () {\n return state.get() === true;\n },\n isCollapsed: function () {\n return state.get() === false;\n },\n setCollapsed: curry(state.set, false),\n setExpanded: curry(state.set, true),\n readState: readState\n });\n };\n\n var SlidingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$9\n });\n\n var Sliding = create$1({\n fields: SlidingSchema,\n name: 'sliding',\n active: ActiveSliding,\n apis: SlidingApis,\n state: SlidingState\n });\n\n var schema$p = constant([\n markers([\n 'closedClass',\n 'openClass',\n 'shrinkingClass',\n 'growingClass',\n 'overflowToggledClass'\n ]),\n onHandler('onOpened'),\n onHandler('onClosed')\n ].concat(schema$m()));\n var parts$b = constant([\n required({\n factory: Toolbar,\n schema: schema$l(),\n name: 'primary'\n }),\n required({\n factory: Toolbar,\n schema: schema$l(),\n name: 'overflow',\n overrides: function (detail) {\n return {\n toolbarBehaviours: derive$1([\n Sliding.config({\n dimension: { property: 'height' },\n closedClass: detail.markers.closedClass,\n openClass: detail.markers.openClass,\n shrinkingClass: detail.markers.shrinkingClass,\n growingClass: detail.markers.growingClass,\n onShrunk: function (comp) {\n getPart(comp, detail, 'overflow-button').each(function (button) {\n Toggling.off(button);\n Focusing.focus(button);\n });\n detail.onClosed(comp);\n },\n onGrown: function (comp) {\n Keying.focusIn(comp);\n detail.onOpened(comp);\n },\n onStartGrow: function (comp) {\n getPart(comp, detail, 'overflow-button').each(Toggling.on);\n }\n }),\n Keying.config({\n mode: 'acyclic',\n onEscape: function (comp) {\n getPart(comp, detail, 'overflow-button').each(Focusing.focus);\n return Option.some(true);\n }\n })\n ])\n };\n }\n }),\n external$1({\n name: 'overflow-button',\n overrides: function (detail) {\n return {\n buttonBehaviours: derive$1([Toggling.config({\n toggleClass: detail.markers.overflowToggledClass,\n aria: { mode: 'pressed' },\n toggleOnExecute: false\n })])\n };\n }\n }),\n external$1({ name: 'overflow-group' })\n ]);\n\n var toggleToolbar = function (toolbar, detail) {\n getPart(toolbar, detail, 'overflow').each(function (overf) {\n refresh$3(toolbar, detail);\n Sliding.toggleGrow(overf);\n });\n };\n var refresh$3 = function (toolbar, detail) {\n getPart(toolbar, detail, 'overflow').each(function (overflow) {\n refresh(toolbar, detail, function (groups) {\n var builtGroups = map(groups, function (g) {\n return premade$1(g);\n });\n Toolbar.setGroups(overflow, builtGroups);\n });\n getPart(toolbar, detail, 'overflow-button').each(function (button) {\n if (Sliding.hasGrown(overflow)) {\n Toggling.on(button);\n }\n });\n Sliding.refresh(overflow);\n });\n };\n var factory$d = function (detail, components, spec, externals) {\n var toolbarToggleEvent = 'alloy.toolbar.toggle';\n var doSetGroups = function (toolbar, groups) {\n var built = map(groups, toolbar.getSystem().build);\n detail.builtGroups.set(built);\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: augment(detail.splitToolbarBehaviours, [\n Coupling.config({\n others: {\n overflowGroup: function (toolbar) {\n return ToolbarGroup.sketch(__assign(__assign({}, externals['overflow-group']()), {\n items: [Button.sketch(__assign(__assign({}, externals['overflow-button']()), {\n action: function (_button) {\n emit(toolbar, toolbarToggleEvent);\n }\n }))]\n }));\n }\n }\n }),\n config('toolbar-toggle-events', [run(toolbarToggleEvent, function (toolbar) {\n getPart(toolbar, detail, 'overflow').each(function (overf) {\n refresh$3(toolbar, detail);\n Sliding.toggleGrow(overf);\n });\n })])\n ]),\n apis: {\n setGroups: function (toolbar, groups) {\n doSetGroups(toolbar, groups);\n refresh$3(toolbar, detail);\n },\n refresh: function (toolbar) {\n return refresh$3(toolbar, detail);\n },\n toggle: function (toolbar) {\n return toggleToolbar(toolbar, detail);\n }\n },\n domModification: { attributes: { role: 'group' } }\n };\n };\n var SplitSlidingToolbar = composite$1({\n name: 'SplitSlidingToolbar',\n configFields: schema$p(),\n partFields: parts$b(),\n factory: factory$d,\n apis: {\n setGroups: function (apis, toolbar, groups) {\n apis.setGroups(toolbar, groups);\n },\n refresh: function (apis, toolbar) {\n apis.refresh(toolbar);\n },\n toggle: function (apis, toolbar) {\n apis.toggle(toolbar);\n }\n }\n });\n\n var toolbarHeightChange = constant(generate$1('toolbar-height-change'));\n\n var renderToolbarGroupCommon = function (toolbarGroup) {\n var attributes = toolbarGroup.title.fold(function () {\n return {};\n }, function (title) {\n return { attributes: { title: title } };\n });\n return {\n dom: __assign({\n tag: 'div',\n classes: ['tox-toolbar__group']\n }, attributes),\n components: [ToolbarGroup.parts().items({})],\n items: toolbarGroup.items,\n markers: { itemSelector: '*:not(.tox-split-button) > .tox-tbtn:not([disabled]), ' + '.tox-split-button:not([disabled]), ' + '.tox-toolbar-nav-js:not([disabled])' },\n tgroupBehaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({})\n ])\n };\n };\n var renderToolbarGroup = function (toolbarGroup) {\n return ToolbarGroup.sketch(renderToolbarGroupCommon(toolbarGroup));\n };\n var getToolbarbehaviours = function (toolbarSpec, modeName) {\n var onAttached = runOnAttached(function (component) {\n var groups = map(toolbarSpec.initGroups, renderToolbarGroup);\n Toolbar.setGroups(component, groups);\n });\n return derive$1([\n DisablingConfigs.toolbarButton(toolbarSpec.providers.isReadOnly),\n receivingConfig(),\n Keying.config({\n mode: modeName,\n onEscape: toolbarSpec.onEscape,\n selector: '.tox-toolbar__group'\n }),\n config('toolbar-events', [onAttached])\n ]);\n };\n var renderMoreToolbarCommon = function (toolbarSpec) {\n var modeName = toolbarSpec.cyclicKeying ? 'cyclic' : 'acyclic';\n return {\n uid: toolbarSpec.uid,\n dom: {\n tag: 'div',\n classes: ['tox-toolbar-overlord']\n },\n parts: {\n 'overflow-group': renderToolbarGroupCommon({\n title: Option.none(),\n items: []\n }),\n 'overflow-button': renderIconButtonSpec({\n name: 'more',\n icon: Option.some('more-drawer'),\n disabled: false,\n tooltip: Option.some('More...'),\n primary: false,\n borderless: false\n }, Option.none(), toolbarSpec.providers)\n },\n splitToolbarBehaviours: getToolbarbehaviours(toolbarSpec, modeName)\n };\n };\n var renderFloatingMoreToolbar = function (toolbarSpec) {\n var baseSpec = renderMoreToolbarCommon(toolbarSpec);\n var overflowXOffset = 4;\n var primary = SplitFloatingToolbar.parts().primary({\n dom: {\n tag: 'div',\n classes: ['tox-toolbar__primary']\n }\n });\n return SplitFloatingToolbar.sketch(__assign(__assign({}, baseSpec), {\n lazySink: toolbarSpec.getSink,\n getOverflowBounds: function () {\n var headerElem = toolbarSpec.moreDrawerData.lazyHeader().element();\n var headerBounds = absolute$1(headerElem);\n var docElem = documentElement(headerElem);\n var docBounds = absolute$1(docElem);\n var height = Math.max(docElem.dom().scrollHeight, docBounds.height);\n return bounds$1(headerBounds.x + overflowXOffset, docBounds.y, headerBounds.width - overflowXOffset * 2, height);\n },\n parts: __assign(__assign({}, baseSpec.parts), {\n overflow: {\n dom: {\n tag: 'div',\n classes: ['tox-toolbar__overflow'],\n attributes: toolbarSpec.attributes\n }\n }\n }),\n components: [primary],\n markers: { overflowToggledClass: 'tox-tbtn--enabled' }\n }));\n };\n var renderSlidingMoreToolbar = function (toolbarSpec) {\n var primary = SplitSlidingToolbar.parts().primary({\n dom: {\n tag: 'div',\n classes: ['tox-toolbar__primary']\n }\n });\n var overflow = SplitSlidingToolbar.parts().overflow({\n dom: {\n tag: 'div',\n classes: ['tox-toolbar__overflow']\n }\n });\n var baseSpec = renderMoreToolbarCommon(toolbarSpec);\n return SplitSlidingToolbar.sketch(__assign(__assign({}, baseSpec), {\n components: [\n primary,\n overflow\n ],\n markers: {\n openClass: 'tox-toolbar__overflow--open',\n closedClass: 'tox-toolbar__overflow--closed',\n growingClass: 'tox-toolbar__overflow--growing',\n shrinkingClass: 'tox-toolbar__overflow--shrinking',\n overflowToggledClass: 'tox-tbtn--enabled'\n },\n onOpened: function (comp) {\n comp.getSystem().broadcastOn([toolbarHeightChange()], { type: 'opened' });\n },\n onClosed: function (comp) {\n comp.getSystem().broadcastOn([toolbarHeightChange()], { type: 'closed' });\n }\n }));\n };\n var renderToolbar = function (toolbarSpec) {\n var modeName = toolbarSpec.cyclicKeying ? 'cyclic' : 'acyclic';\n return Toolbar.sketch({\n uid: toolbarSpec.uid,\n dom: {\n tag: 'div',\n classes: ['tox-toolbar'].concat(toolbarSpec.type === ToolbarMode.scrolling ? ['tox-toolbar--scrolling'] : [])\n },\n components: [Toolbar.parts().groups({})],\n toolbarBehaviours: getToolbarbehaviours(toolbarSpec, modeName)\n });\n };\n\n var baseToolbarButtonFields = [\n defaultedBoolean('disabled', false),\n optionString('tooltip'),\n optionString('icon'),\n optionString('text'),\n defaultedFunction('onSetup', function () {\n return noop;\n })\n ];\n var toolbarButtonSchema = objOf([\n strictString('type'),\n strictFunction('onAction')\n ].concat(baseToolbarButtonFields));\n var createToolbarButton = function (spec) {\n return asRaw('toolbarbutton', toolbarButtonSchema, spec);\n };\n\n var baseMenuButtonFields = [\n optionString('text'),\n optionString('tooltip'),\n optionString('icon'),\n strictFunction('fetch'),\n defaultedFunction('onSetup', function () {\n return noop;\n })\n ];\n\n var MenuButtonSchema = objOf(__spreadArrays([strictString('type')], baseMenuButtonFields));\n var createMenuButton = function (spec) {\n return asRaw('menubutton', MenuButtonSchema, spec);\n };\n\n var splitButtonSchema = objOf([\n strictString('type'),\n optionString('tooltip'),\n optionString('icon'),\n optionString('text'),\n optionFunction('select'),\n strictFunction('fetch'),\n defaultedFunction('onSetup', function () {\n return noop;\n }),\n defaultedStringEnum('presets', 'normal', [\n 'normal',\n 'color',\n 'listpreview'\n ]),\n defaulted$1('columns', 1),\n strictFunction('onAction'),\n strictFunction('onItemAction')\n ]);\n var createSplitButton = function (spec) {\n return asRaw('SplitButton', splitButtonSchema, spec);\n };\n\n var baseToolbarToggleButtonFields = [defaultedBoolean('active', false)].concat(baseToolbarButtonFields);\n var toggleButtonSchema = objOf(baseToolbarToggleButtonFields.concat([\n strictString('type'),\n strictFunction('onAction')\n ]));\n var createToggleButton = function (spec) {\n return asRaw('ToggleButton', toggleButtonSchema, spec);\n };\n\n var groupToolbarButtonSchema = objOf([\n strictString('type'),\n strictOf('items', oneOf([\n arrOfObj$1([\n strictString('name'),\n strictArrayOf('items', string)\n ]),\n string\n ]))\n ].concat(baseToolbarButtonFields));\n var createGroupToolbarButton = function (spec) {\n return asRaw('GroupToolbarButton', groupToolbarButtonSchema, spec);\n };\n\n var contextBarFields = [\n defaultedFunction('predicate', function () {\n return false;\n }),\n defaultedStringEnum('scope', 'node', [\n 'node',\n 'editor'\n ]),\n defaultedStringEnum('position', 'selection', [\n 'node',\n 'selection',\n 'line'\n ])\n ];\n var contextButtonFields = baseToolbarButtonFields.concat([\n defaulted$1('type', 'contextformbutton'),\n defaulted$1('primary', false),\n strictFunction('onAction'),\n state$1('original', identity)\n ]);\n var contextToggleButtonFields = baseToolbarToggleButtonFields.concat([\n defaulted$1('type', 'contextformbutton'),\n defaulted$1('primary', false),\n strictFunction('onAction'),\n state$1('original', identity)\n ]);\n var launchButtonFields = baseToolbarButtonFields.concat([defaulted$1('type', 'contextformbutton')]);\n var launchToggleButtonFields = baseToolbarToggleButtonFields.concat([defaulted$1('type', 'contextformtogglebutton')]);\n var toggleOrNormal = choose$1('type', {\n contextformbutton: contextButtonFields,\n contextformtogglebutton: contextToggleButtonFields\n });\n var contextFormSchema = objOf([\n defaulted$1('type', 'contextform'),\n defaultedFunction('initValue', function () {\n return '';\n }),\n optionString('label'),\n strictArrayOf('commands', toggleOrNormal),\n optionOf('launch', choose$1('type', {\n contextformbutton: launchButtonFields,\n contextformtogglebutton: launchToggleButtonFields\n }))\n ].concat(contextBarFields));\n var contextToolbarSchema = objOf([\n defaulted$1('type', 'contexttoolbar'),\n strictString('items')\n ].concat(contextBarFields));\n var createContextToolbar = function (spec) {\n return asRaw('ContextToolbar', contextToolbarSchema, spec);\n };\n var createContextForm = function (spec) {\n return asRaw('ContextForm', contextFormSchema, spec);\n };\n\n var getState$2 = function (component, replaceConfig, reflectState) {\n return reflectState;\n };\n\n var ReflectingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getState: getState$2\n });\n\n var events$e = function (reflectingConfig, reflectingState) {\n var update = function (component, data) {\n reflectingConfig.updateState.each(function (updateState) {\n var newState = updateState(component, data);\n reflectingState.set(newState);\n });\n reflectingConfig.renderComponents.each(function (renderComponents) {\n var newComponents = renderComponents(data, reflectingState.get());\n var newChildren = map(newComponents, component.getSystem().build);\n replaceChildren(component, newChildren);\n });\n };\n return derive([\n run(receive(), function (component, message) {\n var receivingData = message;\n var channel = reflectingConfig.channel;\n if (contains(receivingData.channels(), channel)) {\n update(component, receivingData.data());\n }\n }),\n runOnAttached(function (comp, _se) {\n reflectingConfig.initialData.each(function (rawData) {\n update(comp, rawData);\n });\n })\n ]);\n };\n\n var ActiveReflecting = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$e\n });\n\n var init$a = function () {\n var cell = Cell(Option.none());\n var set = function (optS) {\n return cell.set(optS);\n };\n var clear = function () {\n return cell.set(Option.none());\n };\n var get = function () {\n return cell.get();\n };\n var readState = function () {\n return cell.get().fold(function () {\n return 'none';\n }, function (x) {\n return x;\n });\n };\n return {\n readState: readState,\n get: get,\n set: set,\n clear: clear\n };\n };\n\n var ReflectingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$a\n });\n\n var ReflectingSchema = [\n strict$1('channel'),\n option('renderComponents'),\n option('updateState'),\n option('initialData')\n ];\n\n var Reflecting = create$1({\n fields: ReflectingSchema,\n name: 'reflecting',\n active: ActiveReflecting,\n apis: ReflectingApis,\n state: ReflectingState\n });\n\n var schema$q = constant([\n strict$1('toggleClass'),\n strict$1('fetch'),\n onStrictHandler('onExecute'),\n defaulted$1('getHotspot', Option.some),\n defaulted$1('getAnchorOverrides', constant({})),\n schema$1(),\n onStrictHandler('onItemExecute'),\n option('lazySink'),\n strict$1('dom'),\n onHandler('onOpen'),\n field$1('splitDropdownBehaviours', [\n Coupling,\n Keying,\n Focusing\n ]),\n defaulted$1('matchWidth', false),\n defaulted$1('useMinWidth', false),\n defaulted$1('eventOrder', {}),\n option('role')\n ].concat(sandboxFields()));\n var arrowPart = required({\n factory: Button,\n schema: [strict$1('dom')],\n name: 'arrow',\n defaults: function () {\n return { buttonBehaviours: derive$1([Focusing.revoke()]) };\n },\n overrides: function (detail) {\n return {\n dom: {\n tag: 'span',\n attributes: { role: 'presentation' }\n },\n action: function (arrow) {\n arrow.getSystem().getByUid(detail.uid).each(emitExecute);\n },\n buttonBehaviours: derive$1([Toggling.config({\n toggleOnExecute: false,\n toggleClass: detail.toggleClass\n })])\n };\n }\n });\n var buttonPart = required({\n factory: Button,\n schema: [strict$1('dom')],\n name: 'button',\n defaults: function () {\n return { buttonBehaviours: derive$1([Focusing.revoke()]) };\n },\n overrides: function (detail) {\n return {\n dom: {\n tag: 'span',\n attributes: { role: 'presentation' }\n },\n action: function (btn) {\n btn.getSystem().getByUid(detail.uid).each(function (splitDropdown) {\n detail.onExecute(splitDropdown, btn);\n });\n }\n };\n }\n });\n var parts$c = constant([\n arrowPart,\n buttonPart,\n optional({\n factory: {\n sketch: function (spec) {\n return {\n uid: spec.uid,\n dom: {\n tag: 'span',\n styles: { display: 'none' },\n attributes: { 'aria-hidden': 'true' },\n innerHtml: spec.text\n }\n };\n }\n },\n schema: [strict$1('text')],\n name: 'aria-descriptor'\n }),\n external$1({\n schema: [tieredMenuMarkers()],\n name: 'menu',\n defaults: function (detail) {\n return {\n onExecute: function (tmenu, item) {\n tmenu.getSystem().getByUid(detail.uid).each(function (splitDropdown) {\n detail.onItemExecute(splitDropdown, tmenu, item);\n });\n }\n };\n }\n }),\n partType()\n ]);\n\n var factory$e = function (detail, components, spec, externals) {\n var switchToMenu = function (sandbox) {\n Composing.getCurrent(sandbox).each(function (current) {\n Highlighting.highlightFirst(current);\n Keying.focusIn(current);\n });\n };\n var action = function (component) {\n var onOpenSync = switchToMenu;\n togglePopup(detail, function (x) {\n return x;\n }, component, externals, onOpenSync, HighlightOnOpen.HighlightFirst).get(noop);\n };\n var openMenu = function (comp) {\n action(comp);\n return Option.some(true);\n };\n var executeOnButton = function (comp) {\n var button = getPartOrDie(comp, detail, 'button');\n emitExecute(button);\n return Option.some(true);\n };\n var buttonEvents = __assign(__assign({}, derive([runOnAttached(function (component, _simulatedEvent) {\n var ariaDescriptor = getPart(component, detail, 'aria-descriptor');\n ariaDescriptor.each(function (descriptor) {\n var descriptorId = generate$1('aria');\n set$1(descriptor.element(), 'id', descriptorId);\n set$1(component.element(), 'aria-describedby', descriptorId);\n });\n })])), events$7(Option.some(action)));\n var apis = {\n repositionMenus: function (comp) {\n if (Toggling.isOn(comp)) {\n repositionMenus(comp);\n }\n }\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n apis: apis,\n eventOrder: __assign(__assign({}, detail.eventOrder), {\n 'alloy.execute': [\n 'disabling',\n 'toggling',\n 'alloy.base.behaviour'\n ]\n }),\n events: buttonEvents,\n behaviours: augment(detail.splitDropdownBehaviours, [\n Coupling.config({\n others: {\n sandbox: function (hotspot) {\n var arrow = getPartOrDie(hotspot, detail, 'arrow');\n var extras = {\n onOpen: function () {\n Toggling.on(arrow);\n Toggling.on(hotspot);\n },\n onClose: function () {\n Toggling.off(arrow);\n Toggling.off(hotspot);\n }\n };\n return makeSandbox(detail, hotspot, extras);\n }\n }\n }),\n Keying.config({\n mode: 'special',\n onSpace: executeOnButton,\n onEnter: executeOnButton,\n onDown: openMenu\n }),\n Focusing.config({}),\n Toggling.config({\n toggleOnExecute: false,\n aria: { mode: 'expanded' }\n })\n ]),\n domModification: {\n attributes: {\n 'role': detail.role.getOr('button'),\n 'aria-haspopup': true\n }\n }\n };\n };\n var SplitDropdown = composite$1({\n name: 'SplitDropdown',\n configFields: schema$q(),\n partFields: parts$c(),\n factory: factory$e,\n apis: {\n repositionMenus: function (apis, comp) {\n return apis.repositionMenus(comp);\n }\n }\n });\n\n var getButtonApi = function (component) {\n return {\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var getToggleApi = function (component) {\n return {\n setActive: function (state) {\n Toggling.set(component, state);\n },\n isActive: function () {\n return Toggling.isOn(component);\n },\n isDisabled: function () {\n return Disabling.isDisabled(component);\n },\n setDisabled: function (state) {\n return Disabling.set(component, state);\n }\n };\n };\n var getTooltipAttributes = function (tooltip, providersBackstage) {\n return tooltip.map(function (tooltip) {\n return {\n 'aria-label': providersBackstage.translate(tooltip),\n 'title': providersBackstage.translate(tooltip)\n };\n }).getOr({});\n };\n var focusButtonEvent = generate$1('focus-button');\n var rtlIcon$1 = [\n 'checklist',\n 'ordered-list'\n ];\n var rtlTransform$1 = [\n 'indent',\n 'outdent',\n 'table-insert-column-after',\n 'table-insert-column-before',\n 'unordered-list'\n ];\n var renderCommonStructure = function (icon, text, tooltip, receiver, behaviours, providersBackstage) {\n var _d;\n var getIconName = function (iconName) {\n return global$6.isRtl() && contains(rtlIcon$1, iconName) ? iconName + '-rtl' : iconName;\n };\n var needsRtlClass = global$6.isRtl() && icon.exists(function (name) {\n return contains(rtlTransform$1, name);\n });\n return {\n dom: {\n tag: 'button',\n classes: ['tox-tbtn'].concat(text.isSome() ? ['tox-tbtn--select'] : []).concat(needsRtlClass ? ['tox-tbtn__icon-rtl'] : []),\n attributes: getTooltipAttributes(tooltip, providersBackstage)\n },\n components: componentRenderPipeline([\n icon.map(function (iconName) {\n return renderIconFromPack(getIconName(iconName), providersBackstage.icons);\n }),\n text.map(function (text) {\n return renderLabel$1(text, 'tox-tbtn', providersBackstage);\n })\n ]),\n eventOrder: (_d = {}, _d[mousedown()] = [\n 'focusing',\n 'alloy.base.behaviour',\n 'common-button-display-events'\n ], _d),\n buttonBehaviours: derive$1([\n DisablingConfigs.toolbarButton(providersBackstage.isReadOnly),\n receivingConfig(),\n config('common-button-display-events', [run(mousedown(), function (button, se) {\n se.event().prevent();\n emit(button, focusButtonEvent);\n })])\n ].concat(receiver.map(function (r) {\n return Reflecting.config({\n channel: r,\n initialData: {\n icon: icon,\n text: text\n },\n renderComponents: function (data, _state) {\n return componentRenderPipeline([\n data.icon.map(function (iconName) {\n return renderIconFromPack(getIconName(iconName), providersBackstage.icons);\n }),\n data.text.map(function (text) {\n return renderLabel$1(text, 'tox-tbtn', providersBackstage);\n })\n ]);\n }\n });\n }).toArray()).concat(behaviours.getOr([])))\n };\n };\n var renderFloatingToolbarButton = function (spec, backstage, identifyButtons, attributes) {\n var sharedBackstage = backstage.shared;\n return FloatingToolbarButton.sketch({\n lazySink: sharedBackstage.getSink,\n fetch: function () {\n return Future.nu(function (resolve) {\n resolve(map(identifyButtons(spec.items), renderToolbarGroup));\n });\n },\n markers: { toggledClass: 'tox-tbtn--enabled' },\n parts: {\n button: renderCommonStructure(spec.icon, spec.text, spec.tooltip, Option.none(), Option.none(), sharedBackstage.providers),\n toolbar: {\n dom: {\n tag: 'div',\n classes: ['tox-toolbar__overflow'],\n attributes: attributes\n }\n }\n }\n });\n };\n var renderCommonToolbarButton = function (spec, specialisation, providersBackstage) {\n var editorOffCell = Cell(noop);\n var structure = renderCommonStructure(spec.icon, spec.text, spec.tooltip, Option.none(), Option.none(), providersBackstage);\n return Button.sketch({\n dom: structure.dom,\n components: structure.components,\n eventOrder: toolbarButtonEventOrder,\n buttonBehaviours: derive$1([\n config('toolbar-button-events', [\n onToolbarButtonExecute({\n onAction: spec.onAction,\n getApi: specialisation.getApi\n }),\n onControlAttached(specialisation, editorOffCell),\n onControlDetached(specialisation, editorOffCell)\n ]),\n DisablingConfigs.toolbarButton(function () {\n return spec.disabled || providersBackstage.isReadOnly();\n }),\n receivingConfig()\n ].concat(specialisation.toolbarButtonBehaviours))\n });\n };\n var renderToolbarButton = function (spec, providersBackstage) {\n return renderToolbarButtonWith(spec, providersBackstage, []);\n };\n var renderToolbarButtonWith = function (spec, providersBackstage, bonusEvents) {\n return renderCommonToolbarButton(spec, {\n toolbarButtonBehaviours: [].concat(bonusEvents.length > 0 ? [config('toolbarButtonWith', bonusEvents)] : []),\n getApi: getButtonApi,\n onSetup: spec.onSetup\n }, providersBackstage);\n };\n var renderToolbarToggleButton = function (spec, providersBackstage) {\n return renderToolbarToggleButtonWith(spec, providersBackstage, []);\n };\n var renderToolbarToggleButtonWith = function (spec, providersBackstage, bonusEvents) {\n return deepMerge(renderCommonToolbarButton(spec, {\n toolbarButtonBehaviours: [\n Replacing.config({}),\n Toggling.config({\n toggleClass: 'tox-tbtn--enabled',\n aria: { mode: 'pressed' },\n toggleOnExecute: false\n })\n ].concat(bonusEvents.length > 0 ? [config('toolbarToggleButtonWith', bonusEvents)] : []),\n getApi: getToggleApi,\n onSetup: spec.onSetup\n }, providersBackstage));\n };\n var fetchChoices = function (getApi, spec, providersBackstage) {\n return function (comp) {\n return Future.nu(function (callback) {\n return spec.fetch(callback);\n }).map(function (items) {\n return Option.from(createTieredDataFrom(deepMerge(createPartialChoiceMenu(generate$1('menu-value'), items, function (value) {\n spec.onItemAction(getApi(comp), value);\n }, spec.columns, spec.presets, ItemResponse$1.CLOSE_ON_EXECUTE, spec.select.getOr(function () {\n return false;\n }), providersBackstage), {\n movement: deriveMenuMovement(spec.columns, spec.presets),\n menuBehaviours: SimpleBehaviours.unnamedEvents(spec.columns !== 'auto' ? [] : [runOnAttached(function (comp, _se) {\n detectSize(comp, 4, classForPreset(spec.presets)).each(function (_d) {\n var numRows = _d.numRows, numColumns = _d.numColumns;\n Keying.setGridSize(comp, numRows, numColumns);\n });\n })])\n })));\n });\n };\n };\n var renderSplitButton = function (spec, sharedBackstage) {\n var _d;\n var displayChannel = generate$1('channel-update-split-dropdown-display');\n var getApi = function (comp) {\n return {\n isDisabled: function () {\n return Disabling.isDisabled(comp);\n },\n setDisabled: function (state) {\n return Disabling.set(comp, state);\n },\n setIconFill: function (id, value) {\n descendant$1(comp.element(), 'svg path[id=\"' + id + '\"], rect[id=\"' + id + '\"]').each(function (underlinePath) {\n set$1(underlinePath, 'fill', value);\n });\n },\n setIconStroke: function (id, value) {\n descendant$1(comp.element(), 'svg path[id=\"' + id + '\"], rect[id=\"' + id + '\"]').each(function (underlinePath) {\n set$1(underlinePath, 'stroke', value);\n });\n },\n setActive: function (state) {\n set$1(comp.element(), 'aria-pressed', state);\n descendant$1(comp.element(), 'span').each(function (button) {\n comp.getSystem().getByDom(button).each(function (buttonComp) {\n return Toggling.set(buttonComp, state);\n });\n });\n },\n isActive: function () {\n return descendant$1(comp.element(), 'span').exists(function (button) {\n return comp.getSystem().getByDom(button).exists(Toggling.isOn);\n });\n }\n };\n };\n var editorOffCell = Cell(noop);\n var specialisation = {\n getApi: getApi,\n onSetup: spec.onSetup\n };\n return SplitDropdown.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-split-button'],\n attributes: __assign({ 'aria-pressed': false }, getTooltipAttributes(spec.tooltip, sharedBackstage.providers))\n },\n onExecute: function (button) {\n spec.onAction(getApi(button));\n },\n onItemExecute: function (_a, _b, _c) {\n },\n splitDropdownBehaviours: derive$1([\n DisablingConfigs.splitButton(sharedBackstage.providers.isReadOnly),\n receivingConfig(),\n config('split-dropdown-events', [\n run(focusButtonEvent, Focusing.focus),\n onControlAttached(specialisation, editorOffCell),\n onControlDetached(specialisation, editorOffCell)\n ]),\n Unselecting.config({})\n ]),\n eventOrder: (_d = {}, _d[attachedToDom()] = [\n 'alloy.base.behaviour',\n 'split-dropdown-events'\n ], _d),\n toggleClass: 'tox-tbtn--enabled',\n lazySink: sharedBackstage.getSink,\n fetch: fetchChoices(getApi, spec, sharedBackstage.providers),\n parts: { menu: part(false, spec.columns, spec.presets) },\n components: [\n SplitDropdown.parts().button(renderCommonStructure(spec.icon, spec.text, Option.none(), Option.some(displayChannel), Option.some([Toggling.config({\n toggleClass: 'tox-tbtn--enabled',\n toggleOnExecute: false\n })]), sharedBackstage.providers)),\n SplitDropdown.parts().arrow({\n dom: {\n tag: 'button',\n classes: [\n 'tox-tbtn',\n 'tox-split-button__chevron'\n ],\n innerHtml: get$d('chevron-down', sharedBackstage.providers.icons)\n },\n buttonBehaviours: derive$1([\n DisablingConfigs.splitButton(sharedBackstage.providers.isReadOnly),\n receivingConfig()\n ])\n }),\n SplitDropdown.parts()['aria-descriptor']({ text: sharedBackstage.providers.translate('To open the popup, press Shift+Enter') })\n ]\n });\n };\n\n var getFormApi = function (input) {\n return {\n hide: function () {\n return emit(input, sandboxClose());\n },\n getValue: function () {\n return Representing.getValue(input);\n }\n };\n };\n var runOnExecute$1 = function (memInput, original) {\n return run(internalToolbarButtonExecute, function (comp, se) {\n var input = memInput.get(comp);\n var formApi = getFormApi(input);\n original.onAction(formApi, se.event().buttonApi());\n });\n };\n var renderContextButton = function (memInput, button, extras) {\n var _a = button.original, primary = _a.primary, rest = __rest(_a, ['primary']);\n var bridged = getOrDie(createToolbarButton(__assign(__assign({}, rest), {\n type: 'button',\n onAction: function () {\n }\n })));\n return renderToolbarButtonWith(bridged, extras.backstage.shared.providers, [runOnExecute$1(memInput, button)]);\n };\n var renderContextToggleButton = function (memInput, button, extras) {\n var _a = button.original, primary = _a.primary, rest = __rest(_a, ['primary']);\n var bridged = getOrDie(createToggleButton(__assign(__assign({}, rest), {\n type: 'togglebutton',\n onAction: function () {\n }\n })));\n return renderToolbarToggleButtonWith(bridged, extras.backstage.shared.providers, [runOnExecute$1(memInput, button)]);\n };\n var generateOne$1 = function (memInput, button, providersBackstage) {\n var extras = { backstage: { shared: { providers: providersBackstage } } };\n if (button.type === 'contextformtogglebutton') {\n return renderContextToggleButton(memInput, button, extras);\n } else {\n return renderContextButton(memInput, button, extras);\n }\n };\n var generate$7 = function (memInput, buttons, providersBackstage) {\n var mementos = map(buttons, function (button) {\n return record(generateOne$1(memInput, button, providersBackstage));\n });\n var asSpecs = function () {\n return map(mementos, function (mem) {\n return mem.asSpec();\n });\n };\n var findPrimary = function (compInSystem) {\n return findMap(buttons, function (button, i) {\n if (button.primary) {\n return Option.from(mementos[i]).bind(function (mem) {\n return mem.getOpt(compInSystem);\n }).filter(not(Disabling.isDisabled));\n } else {\n return Option.none();\n }\n });\n };\n return {\n asSpecs: asSpecs,\n findPrimary: findPrimary\n };\n };\n\n var buildInitGroups = function (ctx, providers) {\n var inputAttributes = ctx.label.fold(function () {\n return {};\n }, function (label) {\n return { 'aria-label': label };\n });\n var memInput = record(Input.sketch({\n inputClasses: [\n 'tox-toolbar-textfield',\n 'tox-toolbar-nav-js'\n ],\n data: ctx.initValue(),\n inputAttributes: inputAttributes,\n selectOnFocus: true,\n inputBehaviours: derive$1([Keying.config({\n mode: 'special',\n onEnter: function (input) {\n return commands.findPrimary(input).map(function (primary) {\n emitExecute(primary);\n return true;\n });\n },\n onLeft: function (comp, se) {\n se.cut();\n return Option.none();\n },\n onRight: function (comp, se) {\n se.cut();\n return Option.none();\n }\n })])\n }));\n var commands = generate$7(memInput, ctx.commands, providers);\n return [\n {\n title: Option.none(),\n items: [memInput.asSpec()]\n },\n {\n title: Option.none(),\n items: commands.asSpecs()\n }\n ];\n };\n var renderContextForm = function (toolbarType, ctx, providers) {\n return renderToolbar({\n type: toolbarType,\n uid: generate$1('context-toolbar'),\n initGroups: buildInitGroups(ctx, providers),\n onEscape: Option.none,\n cyclicKeying: true,\n providers: providers\n });\n };\n var ContextForm = {\n renderContextForm: renderContextForm,\n buildInitGroups: buildInitGroups\n };\n\n var getHorizontalBounds = function (contentAreaBox, viewportBounds) {\n var x = Math.max(viewportBounds.x, contentAreaBox.x);\n var contentBoxWidth = contentAreaBox.right - x;\n var maxViewportWidth = viewportBounds.width - (x - viewportBounds.x);\n var width = Math.min(contentBoxWidth, maxViewportWidth);\n return {\n x: x,\n width: width\n };\n };\n var getVerticalBounds = function (editor, contentAreaBox, viewportBounds, isToolbarLocationTop) {\n var container = Element.fromDom(editor.getContainer());\n var header = descendant$1(container, '.tox-editor-header').getOr(container);\n var headerBox = box(header);\n var isToolbarBelowContentArea = headerBox.y >= contentAreaBox.bottom;\n var isToolbarAbove = isToolbarLocationTop && !isToolbarBelowContentArea;\n if (editor.inline && isToolbarAbove) {\n return {\n y: Math.max(headerBox.bottom, viewportBounds.y),\n bottom: viewportBounds.bottom\n };\n }\n if (editor.inline && !isToolbarAbove) {\n return {\n y: viewportBounds.y,\n bottom: Math.min(headerBox.y, viewportBounds.bottom)\n };\n }\n var containerBounds = box(container);\n if (isToolbarAbove) {\n return {\n y: Math.max(headerBox.bottom, viewportBounds.y),\n bottom: Math.min(containerBounds.bottom, viewportBounds.bottom)\n };\n }\n return {\n y: Math.max(containerBounds.y, viewportBounds.y),\n bottom: Math.min(headerBox.y, viewportBounds.bottom)\n };\n };\n var getContextToolbarBounds = function (editor, sharedBackstage) {\n var viewportBounds = getBounds(domGlobals.window);\n var contentAreaBox = box(Element.fromDom(editor.getContentAreaContainer()));\n var toolbarOrMenubarEnabled = isMenubarEnabled(editor) || isToolbarEnabled(editor) || isMultipleToolbars(editor);\n var _a = getHorizontalBounds(contentAreaBox, viewportBounds), x = _a.x, width = _a.width;\n if (editor.inline && !toolbarOrMenubarEnabled) {\n return bounds$1(x, viewportBounds.y, width, viewportBounds.height);\n } else {\n var isToolbarTop = sharedBackstage.header.isPositionedAtTop();\n var _b = getVerticalBounds(editor, contentAreaBox, viewportBounds, isToolbarTop), y = _b.y, bottom = _b.bottom;\n return bounds$1(x, y, width, bottom - y);\n }\n };\n\n var matchTargetWith = function (elem, candidates) {\n var ctxs = filter(candidates, function (toolbarApi) {\n return toolbarApi.predicate(elem.dom());\n });\n var _a = partition(ctxs, function (t) {\n return t.type === 'contexttoolbar';\n }), pass = _a.pass, fail = _a.fail;\n return {\n contextToolbars: pass,\n contextForms: fail\n };\n };\n var filterByPositionForStartNode = function (toolbars) {\n if (toolbars.length <= 1) {\n return toolbars;\n } else {\n var doesPositionExist = function (value) {\n return exists(toolbars, function (t) {\n return t.position === value;\n });\n };\n var filterToolbarsByPosition = function (value) {\n return filter(toolbars, function (t) {\n return t.position === value;\n });\n };\n var hasSelectionToolbars = doesPositionExist('selection');\n var hasNodeToolbars = doesPositionExist('node');\n if (hasSelectionToolbars || hasNodeToolbars) {\n if (hasNodeToolbars && hasSelectionToolbars) {\n var nodeToolbars = filterToolbarsByPosition('node');\n var selectionToolbars = map(filterToolbarsByPosition('selection'), function (t) {\n return __assign(__assign({}, t), { position: 'node' });\n });\n return nodeToolbars.concat(selectionToolbars);\n } else {\n return hasSelectionToolbars ? filterToolbarsByPosition('selection') : filterToolbarsByPosition('node');\n }\n } else {\n return filterToolbarsByPosition('line');\n }\n }\n };\n var filterByPositionForAncestorNode = function (toolbars) {\n if (toolbars.length <= 1) {\n return toolbars;\n } else {\n var findPosition_1 = function (value) {\n return find(toolbars, function (t) {\n return t.position === value;\n });\n };\n var basePosition = findPosition_1('selection').orThunk(function () {\n return findPosition_1('node');\n }).orThunk(function () {\n return findPosition_1('line');\n }).map(function (t) {\n return t.position;\n });\n return basePosition.fold(function () {\n return [];\n }, function (pos) {\n return filter(toolbars, function (t) {\n return t.position === pos;\n });\n });\n }\n };\n var matchStartNode = function (elem, nodeCandidates, editorCandidates) {\n var nodeMatches = matchTargetWith(elem, nodeCandidates);\n if (nodeMatches.contextForms.length > 0) {\n return Option.some({\n elem: elem,\n toolbars: [nodeMatches.contextForms[0]]\n });\n } else {\n var editorMatches = matchTargetWith(elem, editorCandidates);\n if (editorMatches.contextForms.length > 0) {\n return Option.some({\n elem: elem,\n toolbars: [editorMatches.contextForms[0]]\n });\n } else if (nodeMatches.contextToolbars.length > 0 || editorMatches.contextToolbars.length > 0) {\n var toolbars = filterByPositionForStartNode(nodeMatches.contextToolbars.concat(editorMatches.contextToolbars));\n return Option.some({\n elem: elem,\n toolbars: toolbars\n });\n } else {\n return Option.none();\n }\n }\n };\n var matchAncestor = function (isRoot, startNode, scopes) {\n if (isRoot(startNode)) {\n return Option.none();\n } else {\n return ancestor(startNode, function (ancestorElem) {\n var _a = matchTargetWith(ancestorElem, scopes.inNodeScope), contextToolbars = _a.contextToolbars, contextForms = _a.contextForms;\n var toolbars = contextForms.length > 0 ? contextForms : filterByPositionForAncestorNode(contextToolbars);\n return toolbars.length > 0 ? Option.some({\n elem: ancestorElem,\n toolbars: toolbars\n }) : Option.none();\n }, isRoot);\n }\n };\n var lookup$1 = function (scopes, editor) {\n var rootElem = Element.fromDom(editor.getBody());\n var isRoot = function (elem) {\n return eq$1(elem, rootElem);\n };\n var isOutsideRoot = function (startNode) {\n return !isRoot(startNode) && !contains$2(rootElem, startNode);\n };\n var startNode = Element.fromDom(editor.selection.getNode());\n if (isOutsideRoot(startNode)) {\n return Option.none();\n }\n return matchStartNode(startNode, scopes.inNodeScope, scopes.inEditorScope).orThunk(function () {\n return matchAncestor(isRoot, startNode, scopes);\n });\n };\n\n var categorise = function (contextToolbars, navigate) {\n var forms = {};\n var inNodeScope = [];\n var inEditorScope = [];\n var formNavigators = {};\n var lookupTable = {};\n var registerForm = function (key, toolbarApi) {\n var contextForm = getOrDie(createContextForm(toolbarApi));\n forms[key] = contextForm;\n contextForm.launch.map(function (launch) {\n formNavigators['form:' + key + ''] = __assign(__assign({}, toolbarApi.launch), {\n type: launch.type === 'contextformtogglebutton' ? 'togglebutton' : 'button',\n onAction: function () {\n navigate(contextForm);\n }\n });\n });\n if (contextForm.scope === 'editor') {\n inEditorScope.push(contextForm);\n } else {\n inNodeScope.push(contextForm);\n }\n lookupTable[key] = contextForm;\n };\n var registerToolbar = function (key, toolbarApi) {\n createContextToolbar(toolbarApi).each(function (contextToolbar) {\n if (toolbarApi.scope === 'editor') {\n inEditorScope.push(contextToolbar);\n } else {\n inNodeScope.push(contextToolbar);\n }\n lookupTable[key] = contextToolbar;\n });\n };\n var keys$1 = keys(contextToolbars);\n each(keys$1, function (key) {\n var toolbarApi = contextToolbars[key];\n if (toolbarApi.type === 'contextform') {\n registerForm(key, toolbarApi);\n } else if (toolbarApi.type === 'contexttoolbar') {\n registerToolbar(key, toolbarApi);\n }\n });\n return {\n forms: forms,\n inNodeScope: inNodeScope,\n inEditorScope: inEditorScope,\n lookupTable: lookupTable,\n formNavigators: formNavigators\n };\n };\n\n var forwardSlideEvent = generate$1('forward-slide');\n var backSlideEvent = generate$1('backward-slide');\n var changeSlideEvent = generate$1('change-slide-event');\n var resizingClass = 'tox-pop--resizing';\n var renderContextToolbar = function (spec) {\n var stack = Cell([]);\n return InlineView.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-pop']\n },\n fireDismissalEventInstead: { event: 'doNotDismissYet' },\n onShow: function (comp) {\n stack.set([]);\n InlineView.getContent(comp).each(function (c) {\n remove$6(c.element(), 'visibility');\n });\n remove$4(comp.element(), resizingClass);\n remove$6(comp.element(), 'width');\n },\n inlineBehaviours: derive$1([\n config('context-toolbar-events', [\n runOnSource(transitionend(), function (comp, _se) {\n remove$4(comp.element(), resizingClass);\n remove$6(comp.element(), 'width');\n }),\n run(changeSlideEvent, function (comp, se) {\n remove$6(comp.element(), 'width');\n var currentWidth = get$7(comp.element());\n InlineView.setContent(comp, se.event().contents());\n add$2(comp.element(), resizingClass);\n var newWidth = get$7(comp.element());\n set$2(comp.element(), 'width', currentWidth + 'px');\n InlineView.getContent(comp).each(function (newContents) {\n se.event().focus().bind(function (f) {\n focus$1(f);\n return search(comp.element());\n }).orThunk(function () {\n Keying.focusIn(newContents);\n return active();\n });\n });\n global$2.setTimeout(function () {\n set$2(comp.element(), 'width', newWidth + 'px');\n }, 0);\n }),\n run(forwardSlideEvent, function (comp, se) {\n InlineView.getContent(comp).each(function (oldContents) {\n stack.set(stack.get().concat([{\n bar: oldContents,\n focus: active()\n }]));\n });\n emitWith(comp, changeSlideEvent, {\n contents: se.event().forwardContents(),\n focus: Option.none()\n });\n }),\n run(backSlideEvent, function (comp, _se) {\n last(stack.get()).each(function (last) {\n stack.set(stack.get().slice(0, stack.get().length - 1));\n emitWith(comp, changeSlideEvent, {\n contents: premade$1(last.bar),\n focus: last.focus\n });\n });\n })\n ]),\n Keying.config({\n mode: 'special',\n onEscape: function (comp) {\n return last(stack.get()).fold(function () {\n return spec.onEscape();\n }, function (_) {\n emit(comp, backSlideEvent);\n return Option.some(true);\n });\n }\n })\n ]),\n lazySink: function () {\n return Result.value(spec.sink);\n }\n });\n };\n\n var generateSelectItems = function (_editor, backstage, spec) {\n var generateItem = function (rawItem, response, disabled, value) {\n var translatedText = backstage.shared.providers.translate(rawItem.title);\n if (rawItem.type === 'separator') {\n return Option.some({\n type: 'separator',\n text: translatedText\n });\n } else if (rawItem.type === 'submenu') {\n var items = bind(rawItem.getStyleItems(), function (si) {\n return validate(si, response, value);\n });\n if (response === 0 && items.length <= 0) {\n return Option.none();\n } else {\n return Option.some({\n type: 'nestedmenuitem',\n text: translatedText,\n disabled: items.length <= 0,\n getSubmenuItems: function () {\n return bind(rawItem.getStyleItems(), function (si) {\n return validate(si, response, value);\n });\n }\n });\n }\n } else {\n return Option.some(__assign({\n type: 'togglemenuitem',\n text: translatedText,\n icon: rawItem.icon,\n active: rawItem.isSelected(value),\n disabled: disabled,\n onAction: spec.onAction(rawItem)\n }, rawItem.getStylePreview().fold(function () {\n return {};\n }, function (preview) {\n return { meta: { style: preview } };\n })));\n }\n };\n var validate = function (item, response, value) {\n var invalid = item.type === 'formatter' && spec.isInvalid(item);\n if (response === 0) {\n return invalid ? [] : generateItem(item, response, false, value).toArray();\n } else {\n return generateItem(item, response, invalid, value).toArray();\n }\n };\n var validateItems = function (preItems) {\n var value = spec.getCurrentValue();\n var response = spec.shouldHide ? 0 : 1;\n return bind(preItems, function (item) {\n return validate(item, response, value);\n });\n };\n var getFetch = function (backstage, getStyleItems) {\n return function (callback) {\n var preItems = getStyleItems();\n var items = validateItems(preItems);\n var menu = build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, false);\n callback(menu);\n };\n };\n return {\n validateItems: validateItems,\n getFetch: getFetch\n };\n };\n var createMenuItems = function (editor, backstage, spec) {\n var dataset = spec.dataset;\n var getStyleItems = dataset.type === 'basic' ? function () {\n return map(dataset.data, function (d) {\n return processBasic(d, spec.isSelectedFor, spec.getPreviewFor);\n });\n } : dataset.getData;\n return {\n items: generateSelectItems(editor, backstage, spec),\n getStyleItems: getStyleItems\n };\n };\n var createSelectButton = function (editor, backstage, spec) {\n var _a = createMenuItems(editor, backstage, spec), items = _a.items, getStyleItems = _a.getStyleItems;\n var getApi = function (comp) {\n return {\n getComponent: function () {\n return comp;\n }\n };\n };\n var onSetup = function (api) {\n spec.setInitialValue.each(function (f) {\n return f(api.getComponent());\n });\n return spec.nodeChangeHandler.map(function (f) {\n var handler = f(api.getComponent());\n editor.on('NodeChange', handler);\n return function () {\n editor.off('NodeChange', handler);\n };\n }).getOr(noop);\n };\n return renderCommonDropdown({\n text: spec.icon.isSome() ? Option.none() : Option.some(''),\n icon: spec.icon,\n tooltip: Option.from(spec.tooltip),\n role: Option.none(),\n fetch: items.getFetch(backstage, getStyleItems),\n onSetup: onSetup,\n getApi: getApi,\n columns: 1,\n presets: 'normal',\n classes: spec.icon.isSome() ? [] : ['bespoke'],\n dropdownBehaviours: []\n }, 'tox-tbtn', backstage.shared);\n };\n\n var process = function (rawFormats) {\n return map(rawFormats, function (item) {\n var title = item, format = item;\n var values = item.split('=');\n if (values.length > 1) {\n title = values[0];\n format = values[1];\n }\n return {\n title: title,\n format: format\n };\n });\n };\n var buildBasicStaticDataset = function (data) {\n return {\n type: 'basic',\n data: data\n };\n };\n var Delimiter;\n (function (Delimiter) {\n Delimiter[Delimiter['SemiColon'] = 0] = 'SemiColon';\n Delimiter[Delimiter['Space'] = 1] = 'Space';\n }(Delimiter || (Delimiter = {})));\n var split = function (rawFormats, delimiter) {\n if (delimiter === Delimiter.SemiColon) {\n return rawFormats.replace(/;$/, '').split(';');\n } else {\n return rawFormats.split(' ');\n }\n };\n var buildBasicSettingsDataset = function (editor, settingName, defaults, delimiter) {\n var rawFormats = editor.getParam(settingName, defaults, 'string');\n var data = process(split(rawFormats, delimiter));\n return {\n type: 'basic',\n data: data\n };\n };\n\n var alignMenuItems = [\n {\n title: 'Left',\n icon: 'align-left',\n format: 'alignleft',\n command: 'JustifyLeft'\n },\n {\n title: 'Center',\n icon: 'align-center',\n format: 'aligncenter',\n command: 'JustifyCenter'\n },\n {\n title: 'Right',\n icon: 'align-right',\n format: 'alignright',\n command: 'JustifyRight'\n },\n {\n title: 'Justify',\n icon: 'align-justify',\n format: 'alignjustify',\n command: 'JustifyFull'\n }\n ];\n var getSpec = function (editor) {\n var getMatchingValue = function () {\n return find(alignMenuItems, function (item) {\n return editor.formatter.match(item.format);\n });\n };\n var isSelectedFor = function (format) {\n return function () {\n return editor.formatter.match(format);\n };\n };\n var getPreviewFor = function (_format) {\n return function () {\n return Option.none();\n };\n };\n var updateSelectMenuIcon = function (comp) {\n var match = getMatchingValue();\n var alignment = match.fold(function () {\n return 'left';\n }, function (item) {\n return item.title.toLowerCase();\n });\n emitWith(comp, updateMenuIcon, { icon: 'align-' + alignment });\n };\n var nodeChangeHandler = Option.some(function (comp) {\n return function () {\n return updateSelectMenuIcon(comp);\n };\n });\n var setInitialValue = Option.some(function (comp) {\n return updateSelectMenuIcon(comp);\n });\n var dataset = buildBasicStaticDataset(alignMenuItems);\n var onAction = function (rawItem) {\n return function () {\n return find(alignMenuItems, function (item) {\n return item.format === rawItem.format;\n }).each(function (item) {\n return editor.execCommand(item.command);\n });\n };\n };\n return {\n tooltip: 'Align',\n icon: Option.some('align-left'),\n isSelectedFor: isSelectedFor,\n getCurrentValue: constant(Option.none()),\n getPreviewFor: getPreviewFor,\n onAction: onAction,\n setInitialValue: setInitialValue,\n nodeChangeHandler: nodeChangeHandler,\n dataset: dataset,\n shouldHide: false,\n isInvalid: function (item) {\n return !editor.formatter.canApply(item.format);\n }\n };\n };\n var createAlignSelect = function (editor, backstage) {\n return createSelectButton(editor, backstage, getSpec(editor));\n };\n var alignSelectMenu = function (editor, backstage) {\n var menuItems = createMenuItems(editor, backstage, getSpec(editor));\n editor.ui.registry.addNestedMenuItem('align', {\n text: backstage.shared.providers.translate('Align'),\n getSubmenuItems: function () {\n return menuItems.items.validateItems(menuItems.getStyleItems());\n }\n });\n };\n\n var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';\n var systemStackFonts = [\n '-apple-system',\n 'Segoe UI',\n 'Roboto',\n 'Helvetica Neue',\n 'sans-serif'\n ];\n var splitFonts = function (fontFamily) {\n var fonts = fontFamily.split(/\\s*,\\s*/);\n return map(fonts, function (font) {\n return font.replace(/^['\"]+|['\"]+$/g, '');\n });\n };\n var isSystemFontStack = function (fontFamily) {\n var matchesSystemStack = function () {\n var fonts = splitFonts(fontFamily.toLowerCase());\n return forall(systemStackFonts, function (font) {\n return fonts.indexOf(font.toLowerCase()) > -1;\n });\n };\n return fontFamily.indexOf('-apple-system') === 0 && matchesSystemStack();\n };\n var getSpec$1 = function (editor) {\n var getMatchingValue = function () {\n var getFirstFont = function (fontFamily) {\n return fontFamily ? splitFonts(fontFamily)[0] : '';\n };\n var fontFamily = editor.queryCommandValue('FontName');\n var items = dataset.data;\n var font = fontFamily ? fontFamily.toLowerCase() : '';\n var matchOpt = find(items, function (item) {\n var format = item.format;\n return format.toLowerCase() === font || getFirstFont(format).toLowerCase() === getFirstFont(font).toLowerCase();\n }).orThunk(function () {\n if (isSystemFontStack(font)) {\n return Option.from({\n title: 'System Font',\n format: font\n });\n } else {\n return Option.none();\n }\n });\n return {\n matchOpt: matchOpt,\n font: fontFamily\n };\n };\n var isSelectedFor = function (item) {\n return function (valueOpt) {\n return valueOpt.exists(function (value) {\n return value.format === item;\n });\n };\n };\n var getCurrentValue = function () {\n var matchOpt = getMatchingValue().matchOpt;\n return matchOpt;\n };\n var getPreviewFor = function (item) {\n return function () {\n return Option.some({\n tag: 'div',\n styles: item.indexOf('dings') === -1 ? { 'font-family': item } : {}\n });\n };\n };\n var onAction = function (rawItem) {\n return function () {\n editor.undoManager.transact(function () {\n editor.focus();\n editor.execCommand('FontName', false, rawItem.format);\n });\n };\n };\n var updateSelectMenuText = function (comp) {\n var _a = getMatchingValue(), matchOpt = _a.matchOpt, font = _a.font;\n var text = matchOpt.fold(function () {\n return font;\n }, function (item) {\n return item.title;\n });\n emitWith(comp, updateMenuText, { text: text });\n };\n var nodeChangeHandler = Option.some(function (comp) {\n return function () {\n return updateSelectMenuText(comp);\n };\n });\n var setInitialValue = Option.some(function (comp) {\n return updateSelectMenuText(comp);\n });\n var dataset = buildBasicSettingsDataset(editor, 'font_formats', defaultFontsFormats, Delimiter.SemiColon);\n return {\n tooltip: 'Fonts',\n icon: Option.none(),\n isSelectedFor: isSelectedFor,\n getCurrentValue: getCurrentValue,\n getPreviewFor: getPreviewFor,\n onAction: onAction,\n setInitialValue: setInitialValue,\n nodeChangeHandler: nodeChangeHandler,\n dataset: dataset,\n shouldHide: false,\n isInvalid: function () {\n return false;\n }\n };\n };\n var createFontSelect = function (editor, backstage) {\n return createSelectButton(editor, backstage, getSpec$1(editor));\n };\n var fontSelectMenu = function (editor, backstage) {\n var menuItems = createMenuItems(editor, backstage, getSpec$1(editor));\n editor.ui.registry.addNestedMenuItem('fontformats', {\n text: backstage.shared.providers.translate('Fonts'),\n getSubmenuItems: function () {\n return menuItems.items.validateItems(menuItems.getStyleItems());\n }\n });\n };\n\n var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';\n var legacyFontSizes = {\n '8pt': '1',\n '10pt': '2',\n '12pt': '3',\n '14pt': '4',\n '18pt': '5',\n '24pt': '6',\n '36pt': '7'\n };\n var round$1 = function (number, precision) {\n var factor = Math.pow(10, precision);\n return Math.round(number * factor) / factor;\n };\n var toPt = function (fontSize, precision) {\n if (/[0-9.]+px$/.test(fontSize)) {\n return round$1(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';\n }\n return fontSize;\n };\n var toLegacy = function (fontSize) {\n return get(legacyFontSizes, fontSize).getOr('');\n };\n var getSpec$2 = function (editor) {\n var getMatchingValue = function () {\n var matchOpt = Option.none();\n var items = dataset.data;\n var fontSize = editor.queryCommandValue('FontSize');\n if (fontSize) {\n var _loop_1 = function (precision) {\n var pt = toPt(fontSize, precision);\n var legacy = toLegacy(pt);\n matchOpt = find(items, function (item) {\n return item.format === fontSize || item.format === pt || item.format === legacy;\n });\n };\n for (var precision = 3; matchOpt.isNone() && precision >= 0; precision--) {\n _loop_1(precision);\n }\n }\n return {\n matchOpt: matchOpt,\n size: fontSize\n };\n };\n var isSelectedFor = function (item) {\n return function (valueOpt) {\n return valueOpt.exists(function (value) {\n return value.format === item;\n });\n };\n };\n var getCurrentValue = function () {\n var matchOpt = getMatchingValue().matchOpt;\n return matchOpt;\n };\n var getPreviewFor = constant(constant(Option.none()));\n var onAction = function (rawItem) {\n return function () {\n editor.undoManager.transact(function () {\n editor.focus();\n editor.execCommand('FontSize', false, rawItem.format);\n });\n };\n };\n var updateSelectMenuText = function (comp) {\n var _a = getMatchingValue(), matchOpt = _a.matchOpt, size = _a.size;\n var text = matchOpt.fold(function () {\n return size;\n }, function (match) {\n return match.title;\n });\n emitWith(comp, updateMenuText, { text: text });\n };\n var nodeChangeHandler = Option.some(function (comp) {\n return function () {\n return updateSelectMenuText(comp);\n };\n });\n var setInitialValue = Option.some(function (comp) {\n return updateSelectMenuText(comp);\n });\n var dataset = buildBasicSettingsDataset(editor, 'fontsize_formats', defaultFontsizeFormats, Delimiter.Space);\n return {\n tooltip: 'Font sizes',\n icon: Option.none(),\n isSelectedFor: isSelectedFor,\n getPreviewFor: getPreviewFor,\n getCurrentValue: getCurrentValue,\n onAction: onAction,\n setInitialValue: setInitialValue,\n nodeChangeHandler: nodeChangeHandler,\n dataset: dataset,\n shouldHide: false,\n isInvalid: function () {\n return false;\n }\n };\n };\n var createFontsizeSelect = function (editor, backstage) {\n return createSelectButton(editor, backstage, getSpec$2(editor));\n };\n var fontsizeSelectMenu = function (editor, backstage) {\n var menuItems = createMenuItems(editor, backstage, getSpec$2(editor));\n editor.ui.registry.addNestedMenuItem('fontsizes', {\n text: 'Font sizes',\n getSubmenuItems: function () {\n return menuItems.items.validateItems(menuItems.getStyleItems());\n }\n });\n };\n\n var findNearest = function (editor, getStyles, parents) {\n var styles = getStyles();\n return findMap(parents, function (parent) {\n return find(styles, function (fmt) {\n return editor.formatter.matchNode(parent, fmt.format);\n });\n }).orThunk(function () {\n if (editor.formatter.match('p')) {\n return Option.some({\n title: 'Paragraph',\n format: 'p'\n });\n }\n return Option.none();\n });\n };\n var getCurrentSelectionParents = function (editor) {\n var currentNode = editor.selection.getStart(true) || editor.getBody();\n return editor.dom.getParents(currentNode, function () {\n return true;\n }, editor.getBody());\n };\n\n var onSetupFormatToggle = function (editor, name) {\n return function (api) {\n var unbindCell = Cell(Option.none());\n var init = function () {\n api.setActive(editor.formatter.match(name));\n var unbind = editor.formatter.formatChanged(name, api.setActive).unbind;\n unbindCell.set(Option.some(unbind));\n };\n editor.initialized ? init() : editor.on('init', init);\n return function () {\n return unbindCell.get().each(function (unbind) {\n return unbind();\n });\n };\n };\n };\n var onActionToggleFormat = function (editor) {\n return function (rawItem) {\n return function () {\n editor.undoManager.transact(function () {\n editor.focus();\n editor.execCommand('mceToggleFormat', false, rawItem.format);\n });\n };\n };\n };\n\n var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre';\n var getSpec$3 = function (editor) {\n var getMatchingValue = function (nodeChangeEvent) {\n return findNearest(editor, function () {\n return dataset.data;\n }, nodeChangeEvent);\n };\n var isSelectedFor = function (format) {\n return function () {\n return editor.formatter.match(format);\n };\n };\n var getPreviewFor = function (format) {\n return function () {\n var fmt = editor.formatter.get(format);\n return Option.some({\n tag: fmt.length > 0 ? fmt[0].inline || fmt[0].block || 'div' : 'div',\n styles: editor.dom.parseStyle(editor.formatter.getCssText(format))\n });\n };\n };\n var updateSelectMenuText = function (parents, comp) {\n var detectedFormat = getMatchingValue(parents);\n var text = detectedFormat.fold(function () {\n return 'Paragraph';\n }, function (fmt) {\n return fmt.title;\n });\n emitWith(comp, updateMenuText, { text: text });\n };\n var nodeChangeHandler = Option.some(function (comp) {\n return function (e) {\n return updateSelectMenuText(e.parents, comp);\n };\n });\n var setInitialValue = Option.some(function (comp) {\n var parents = getCurrentSelectionParents(editor);\n updateSelectMenuText(parents, comp);\n });\n var dataset = buildBasicSettingsDataset(editor, 'block_formats', defaultBlocks, Delimiter.SemiColon);\n return {\n tooltip: 'Blocks',\n icon: Option.none(),\n isSelectedFor: isSelectedFor,\n getCurrentValue: constant(Option.none()),\n getPreviewFor: getPreviewFor,\n onAction: onActionToggleFormat(editor),\n setInitialValue: setInitialValue,\n nodeChangeHandler: nodeChangeHandler,\n dataset: dataset,\n shouldHide: false,\n isInvalid: function (item) {\n return !editor.formatter.canApply(item.format);\n }\n };\n };\n var createFormatSelect = function (editor, backstage) {\n return createSelectButton(editor, backstage, getSpec$3(editor));\n };\n var formatSelectMenu = function (editor, backstage) {\n var menuItems = createMenuItems(editor, backstage, getSpec$3(editor));\n editor.ui.registry.addNestedMenuItem('blockformats', {\n text: 'Blocks',\n getSubmenuItems: function () {\n return menuItems.items.validateItems(menuItems.getStyleItems());\n }\n });\n };\n\n var getSpec$4 = function (editor, dataset) {\n var isSelectedFor = function (format) {\n return function () {\n return editor.formatter.match(format);\n };\n };\n var getPreviewFor = function (format) {\n return function () {\n var fmt = editor.formatter.get(format);\n return fmt !== undefined ? Option.some({\n tag: fmt.length > 0 ? fmt[0].inline || fmt[0].block || 'div' : 'div',\n styles: editor.dom.parseStyle(editor.formatter.getCssText(format))\n }) : Option.none();\n };\n };\n var updateSelectMenuText = function (parents, comp) {\n var getFormatItems = function (fmt) {\n var subs = fmt.items;\n return subs !== undefined && subs.length > 0 ? bind(subs, getFormatItems) : [{\n title: fmt.title,\n format: fmt.format\n }];\n };\n var flattenedItems = bind(getStyleFormats(editor), getFormatItems);\n var detectedFormat = findNearest(editor, function () {\n return flattenedItems;\n }, parents);\n var text = detectedFormat.fold(function () {\n return 'Paragraph';\n }, function (fmt) {\n return fmt.title;\n });\n emitWith(comp, updateMenuText, { text: text });\n };\n var nodeChangeHandler = Option.some(function (comp) {\n return function (e) {\n return updateSelectMenuText(e.parents, comp);\n };\n });\n var setInitialValue = Option.some(function (comp) {\n var parents = getCurrentSelectionParents(editor);\n updateSelectMenuText(parents, comp);\n });\n return {\n tooltip: 'Formats',\n icon: Option.none(),\n isSelectedFor: isSelectedFor,\n getCurrentValue: constant(Option.none()),\n getPreviewFor: getPreviewFor,\n onAction: onActionToggleFormat(editor),\n setInitialValue: setInitialValue,\n nodeChangeHandler: nodeChangeHandler,\n shouldHide: editor.getParam('style_formats_autohide', false, 'boolean'),\n isInvalid: function (item) {\n return !editor.formatter.canApply(item.format);\n },\n dataset: dataset\n };\n };\n var createStyleSelect = function (editor, backstage) {\n var dataset = __assign({ type: 'advanced' }, backstage.styleselect);\n return createSelectButton(editor, backstage, getSpec$4(editor, dataset));\n };\n var styleSelectMenu = function (editor, backstage) {\n var dataset = __assign({ type: 'advanced' }, backstage.styleselect);\n var menuItems = createMenuItems(editor, backstage, getSpec$4(editor, dataset));\n editor.ui.registry.addNestedMenuItem('formats', {\n text: 'Formats',\n getSubmenuItems: function () {\n return menuItems.items.validateItems(menuItems.getStyleItems());\n }\n });\n };\n\n var defaultToolbar = [\n {\n name: 'history',\n items: [\n 'undo',\n 'redo'\n ]\n },\n {\n name: 'styles',\n items: ['styleselect']\n },\n {\n name: 'formatting',\n items: [\n 'bold',\n 'italic'\n ]\n },\n {\n name: 'alignment',\n items: [\n 'alignleft',\n 'aligncenter',\n 'alignright',\n 'alignjustify'\n ]\n },\n {\n name: 'indentation',\n items: [\n 'outdent',\n 'indent'\n ]\n },\n {\n name: 'permanent pen',\n items: ['permanentpen']\n },\n {\n name: 'comments',\n items: ['addcomment']\n }\n ];\n var renderFromBridge = function (bridgeBuilder, render) {\n return function (spec, extras, editor) {\n var internal = bridgeBuilder(spec).mapError(function (errInfo) {\n return formatError(errInfo);\n }).getOrDie();\n return render(internal, extras, editor);\n };\n };\n var types = {\n button: renderFromBridge(createToolbarButton, function (s, extras) {\n return renderToolbarButton(s, extras.backstage.shared.providers);\n }),\n togglebutton: renderFromBridge(createToggleButton, function (s, extras) {\n return renderToolbarToggleButton(s, extras.backstage.shared.providers);\n }),\n menubutton: renderFromBridge(createMenuButton, function (s, extras) {\n return renderMenuButton(s, 'tox-tbtn', extras.backstage, Option.none());\n }),\n splitbutton: renderFromBridge(createSplitButton, function (s, extras) {\n return renderSplitButton(s, extras.backstage.shared);\n }),\n grouptoolbarbutton: renderFromBridge(createGroupToolbarButton, function (s, extras, editor) {\n var _a;\n var buttons = editor.ui.registry.getAll().buttons;\n var identify = function (toolbar) {\n return identifyButtons(editor, {\n buttons: buttons,\n toolbar: toolbar,\n allowToolbarGroups: false\n }, extras, Option.none());\n };\n var attributes = (_a = {}, _a[Attribute] = extras.backstage.shared.header.isPositionedAtTop() ? AttributeValue.TopToBottom : AttributeValue.BottomToTop, _a);\n switch (getToolbarMode(editor)) {\n case ToolbarMode.floating:\n return renderFloatingToolbarButton(s, extras.backstage, identify, attributes);\n default:\n throw new Error('Toolbar groups are only supported when using floating toolbar mode');\n }\n }),\n styleSelectButton: function (editor, extras) {\n return createStyleSelect(editor, extras.backstage);\n },\n fontsizeSelectButton: function (editor, extras) {\n return createFontsizeSelect(editor, extras.backstage);\n },\n fontSelectButton: function (editor, extras) {\n return createFontSelect(editor, extras.backstage);\n },\n formatButton: function (editor, extras) {\n return createFormatSelect(editor, extras.backstage);\n },\n alignMenuButton: function (editor, extras) {\n return createAlignSelect(editor, extras.backstage);\n }\n };\n var extractFrom = function (spec, extras, editor) {\n return get(types, spec.type).fold(function () {\n domGlobals.console.error('skipping button defined by', spec);\n return Option.none();\n }, function (render) {\n return Option.some(render(spec, extras, editor));\n });\n };\n var bespokeButtons = {\n styleselect: types.styleSelectButton,\n fontsizeselect: types.fontsizeSelectButton,\n fontselect: types.fontSelectButton,\n formatselect: types.formatButton,\n align: types.alignMenuButton\n };\n var removeUnusedDefaults = function (buttons) {\n var filteredItemGroups = map(defaultToolbar, function (group) {\n var items = filter(group.items, function (subItem) {\n return has(buttons, subItem) || has(bespokeButtons, subItem);\n });\n return {\n name: group.name,\n items: items\n };\n });\n return filter(filteredItemGroups, function (group) {\n return group.items.length > 0;\n });\n };\n var convertStringToolbar = function (strToolbar) {\n var groupsStrings = strToolbar.split('|');\n return map(groupsStrings, function (g) {\n return { items: g.trim().split(' ') };\n });\n };\n var isToolbarGroupSettingArray = function (toolbar) {\n return isArrayOf(toolbar, function (t) {\n return has(t, 'name') && has(t, 'items');\n });\n };\n var createToolbar = function (toolbarConfig) {\n var toolbar = toolbarConfig.toolbar;\n var buttons = toolbarConfig.buttons;\n if (toolbar === false) {\n return [];\n } else if (toolbar === undefined || toolbar === true) {\n return removeUnusedDefaults(buttons);\n } else if (isString(toolbar)) {\n return convertStringToolbar(toolbar);\n } else if (isToolbarGroupSettingArray(toolbar)) {\n return toolbar;\n } else {\n domGlobals.console.error('Toolbar type should be string, string[], boolean or ToolbarGroup[]');\n return [];\n }\n };\n var lookupButton = function (editor, buttons, toolbarItem, allowToolbarGroups, extras, prefixes) {\n return get(buttons, toolbarItem.toLowerCase()).orThunk(function () {\n return prefixes.bind(function (ps) {\n return findMap(ps, function (prefix) {\n return get(buttons, prefix + toolbarItem.toLowerCase());\n });\n });\n }).fold(function () {\n return get(bespokeButtons, toolbarItem.toLowerCase()).map(function (r) {\n return r(editor, extras);\n }).orThunk(function () {\n return Option.none();\n });\n }, function (spec) {\n if (spec.type === 'grouptoolbarbutton' && !allowToolbarGroups) {\n domGlobals.console.warn('Ignoring the \\'' + toolbarItem + '\\' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.');\n return Option.none();\n } else {\n return extractFrom(spec, extras, editor);\n }\n });\n };\n var identifyButtons = function (editor, toolbarConfig, extras, prefixes) {\n var toolbarGroups = createToolbar(toolbarConfig);\n var groups = map(toolbarGroups, function (group) {\n var items = bind(group.items, function (toolbarItem) {\n return toolbarItem.trim().length === 0 ? [] : lookupButton(editor, toolbarConfig.buttons, toolbarItem, toolbarConfig.allowToolbarGroups, extras, prefixes).toArray();\n });\n return {\n title: Option.from(editor.translate(group.name)),\n items: items\n };\n });\n return filter(groups, function (group) {\n return group.items.length > 0;\n });\n };\n\n var bubbleSize = 12;\n var bubbleAlignments$1 = {\n valignCentre: [],\n alignCentre: [],\n alignLeft: ['tox-pop--align-left'],\n alignRight: ['tox-pop--align-right'],\n right: ['tox-pop--right'],\n left: ['tox-pop--left'],\n bottom: ['tox-pop--bottom'],\n top: ['tox-pop--top']\n };\n var anchorOverrides = {\n maxHeightFunction: expandable(),\n maxWidthFunction: expandable$1()\n };\n var desktopAnchorSpecLayouts = {\n onLtr: function () {\n return [\n north$1,\n south$1,\n northeast$1,\n southeast$1,\n northwest$1,\n southwest$1,\n north$3,\n south$3,\n northeast$3,\n southeast$3,\n northwest$3,\n southwest$3\n ];\n },\n onRtl: function () {\n return [\n north$1,\n south$1,\n northwest$1,\n southwest$1,\n northeast$1,\n southeast$1,\n north$3,\n south$3,\n northwest$3,\n southwest$3,\n northeast$3,\n southeast$3\n ];\n }\n };\n var mobileAnchorSpecLayouts = {\n onLtr: function () {\n return [\n south$1,\n southeast$1,\n southwest$1,\n northeast$1,\n northwest$1,\n north$1,\n north$3,\n south$3,\n northeast$3,\n southeast$3,\n northwest$3,\n southwest$3\n ];\n },\n onRtl: function () {\n return [\n south$1,\n southwest$1,\n southeast$1,\n northwest$1,\n northeast$1,\n north$1,\n north$3,\n south$3,\n northwest$3,\n southwest$3,\n northeast$3,\n southeast$3\n ];\n }\n };\n var getAnchorLayout = function (position, isTouch) {\n if (position === 'line') {\n return {\n bubble: nu$8(bubbleSize, 0, bubbleAlignments$1),\n layouts: {\n onLtr: function () {\n return [east$1];\n },\n onRtl: function () {\n return [west$1];\n }\n },\n overrides: anchorOverrides\n };\n } else {\n return {\n bubble: nu$8(0, bubbleSize, bubbleAlignments$1),\n layouts: isTouch ? mobileAnchorSpecLayouts : desktopAnchorSpecLayouts,\n overrides: anchorOverrides\n };\n }\n };\n var register$4 = function (editor, registryContextToolbars, sink, extras) {\n var isTouch = detect$3().deviceType.isTouch;\n var contextbar = build$1(renderContextToolbar({\n sink: sink,\n onEscape: function () {\n editor.focus();\n return Option.some(true);\n }\n }));\n var getBounds = function () {\n return getContextToolbarBounds(editor, extras.backstage.shared);\n };\n var isRangeOverlapping = function (aTop, aBottom, bTop, bBottom) {\n return Math.max(aTop, bTop) <= Math.min(aBottom, bBottom);\n };\n var getLastElementVerticalBound = function () {\n var nodeBounds = lastElement.get().map(function (ele) {\n return ele.getBoundingClientRect();\n }).getOrThunk(function () {\n return editor.selection.getRng().getBoundingClientRect();\n });\n var diffTop = editor.inline ? get$8().top() : absolute$1(Element.fromDom(editor.getBody())).y;\n return {\n y: nodeBounds.top + diffTop,\n bottom: nodeBounds.bottom + diffTop\n };\n };\n var shouldContextToolbarHide = function () {\n if (isTouch() && extras.backstage.isContextMenuOpen()) {\n return true;\n }\n var lastElementBounds = getLastElementVerticalBound();\n var contextToolbarBounds = getBounds();\n return !isRangeOverlapping(lastElementBounds.y, lastElementBounds.bottom, contextToolbarBounds.y, contextToolbarBounds.bottom);\n };\n var forceHide = function () {\n InlineView.hide(contextbar);\n };\n var hideOrRepositionIfNecessary = function () {\n lastAnchor.get().each(function (anchor) {\n var contextBarEle = contextbar.element();\n remove$6(contextBarEle, 'display');\n if (shouldContextToolbarHide()) {\n set$2(contextBarEle, 'display', 'none');\n } else {\n Positioning.positionWithinBounds(sink, anchor, contextbar, Option.some(getBounds()));\n }\n });\n };\n var lastAnchor = Cell(Option.none());\n var lastElement = Cell(Option.none());\n var timer = Cell(null);\n var wrapInPopDialog = function (toolbarSpec) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-pop__dialog']\n },\n components: [toolbarSpec],\n behaviours: derive$1([\n Keying.config({ mode: 'acyclic' }),\n config('pop-dialog-wrap-events', [\n runOnAttached(function (comp) {\n editor.shortcuts.add('ctrl+F9', 'focus statusbar', function () {\n return Keying.focusIn(comp);\n });\n }),\n runOnDetached(function (_comp) {\n editor.shortcuts.remove('ctrl+F9');\n })\n ])\n ])\n };\n };\n var getScopes = cached(function () {\n return categorise(registryContextToolbars, function (toolbarApi) {\n var alloySpec = buildToolbar([toolbarApi]);\n emitWith(contextbar, forwardSlideEvent, { forwardContents: wrapInPopDialog(alloySpec) });\n });\n });\n var buildContextToolbarGroups = function (allButtons, ctx) {\n return identifyButtons(editor, {\n buttons: allButtons,\n toolbar: ctx.items,\n allowToolbarGroups: false\n }, extras, Option.some(['form:']));\n };\n var buildContextMenuGroups = function (ctx, providers) {\n return ContextForm.buildInitGroups(ctx, providers);\n };\n var buildToolbar = function (toolbars) {\n var buttons = editor.ui.registry.getAll().buttons;\n var scopes = getScopes();\n var allButtons = __assign(__assign({}, buttons), scopes.formNavigators);\n var toolbarType = getToolbarMode(editor) === ToolbarMode.scrolling ? ToolbarMode.scrolling : ToolbarMode.default;\n var initGroups = flatten(map(toolbars, function (ctx) {\n return ctx.type === 'contexttoolbar' ? buildContextToolbarGroups(allButtons, ctx) : buildContextMenuGroups(ctx, extras.backstage.shared.providers);\n }));\n return renderToolbar({\n type: toolbarType,\n uid: generate$1('context-toolbar'),\n initGroups: initGroups,\n onEscape: Option.none,\n cyclicKeying: true,\n providers: extras.backstage.shared.providers\n });\n };\n editor.on(showContextToolbarEvent, function (e) {\n var scopes = getScopes();\n get(scopes.lookupTable, e.toolbarKey).each(function (ctx) {\n launchContext([ctx], e.target === editor ? Option.none() : Option.some(e));\n InlineView.getContent(contextbar).each(Keying.focusIn);\n });\n });\n var getAnchor = function (position, element) {\n var anchorage = position === 'node' ? extras.backstage.shared.anchors.node(element) : extras.backstage.shared.anchors.cursor();\n return deepMerge(anchorage, getAnchorLayout(position, isTouch()));\n };\n var launchContext = function (toolbarApi, elem) {\n clearTimer();\n if (isTouch() && extras.backstage.isContextMenuOpen()) {\n return;\n }\n var toolbarSpec = buildToolbar(toolbarApi);\n var sElem = elem.map(Element.fromDom);\n var anchor = getAnchor(toolbarApi[0].position, sElem);\n lastAnchor.set(Option.some(anchor));\n lastElement.set(elem);\n var contextBarEle = contextbar.element();\n remove$6(contextBarEle, 'display');\n InlineView.showWithinBounds(contextbar, anchor, wrapInPopDialog(toolbarSpec), function () {\n return Option.some(getBounds());\n });\n if (shouldContextToolbarHide()) {\n set$2(contextBarEle, 'display', 'none');\n }\n };\n var launchContextToolbar = function () {\n if (!editor.hasFocus()) {\n return;\n }\n var scopes = getScopes();\n lookup$1(scopes, editor).fold(function () {\n lastAnchor.set(Option.none());\n InlineView.hide(contextbar);\n }, function (info) {\n launchContext(info.toolbars, Option.some(info.elem.dom()));\n });\n };\n var clearTimer = function () {\n var current = timer.get();\n if (current !== null) {\n global$2.clearTimeout(current);\n timer.set(null);\n }\n };\n var resetTimer = function (t) {\n clearTimer();\n timer.set(t);\n };\n editor.on('init', function () {\n editor.on(hideContextToolbarEvent, forceHide);\n editor.on('ScrollContent ScrollWindow longpress', hideOrRepositionIfNecessary);\n editor.on('click keyup focus SetContent ObjectResized ResizeEditor', function () {\n resetTimer(global$2.setEditorTimeout(editor, launchContextToolbar, 0));\n });\n editor.on('focusout', function (_e) {\n global$2.setEditorTimeout(editor, function () {\n if (search(sink.element()).isNone() && search(contextbar.element()).isNone()) {\n lastAnchor.set(Option.none());\n InlineView.hide(contextbar);\n }\n }, 0);\n });\n editor.on('SwitchMode', function () {\n if (editor.mode.isReadOnly()) {\n lastAnchor.set(Option.none());\n InlineView.hide(contextbar);\n }\n });\n editor.on('NodeChange', function (_e) {\n search(contextbar.element()).fold(function () {\n resetTimer(global$2.setEditorTimeout(editor, launchContextToolbar, 0));\n }, function (_) {\n });\n });\n });\n };\n\n var setup$3 = function (editor, mothership, uiMothership) {\n var broadcastEvent = function (name, evt) {\n each([\n mothership,\n uiMothership\n ], function (ship) {\n ship.broadcastEvent(name, evt);\n });\n };\n var broadcastOn = function (channel, message) {\n each([\n mothership,\n uiMothership\n ], function (ship) {\n ship.broadcastOn([channel], message);\n });\n };\n var fireDismissPopups = function (evt) {\n return broadcastOn(dismissPopups(), { target: evt.target() });\n };\n var onTouchstart = bind$3(Element.fromDom(domGlobals.document), 'touchstart', fireDismissPopups);\n var onTouchmove = bind$3(Element.fromDom(domGlobals.document), 'touchmove', function (evt) {\n return broadcastEvent(documentTouchmove(), evt);\n });\n var onTouchend = bind$3(Element.fromDom(domGlobals.document), 'touchend', function (evt) {\n return broadcastEvent(documentTouchend(), evt);\n });\n var onMousedown = bind$3(Element.fromDom(domGlobals.document), 'mousedown', fireDismissPopups);\n var onMouseup = bind$3(Element.fromDom(domGlobals.document), 'mouseup', function (evt) {\n if (evt.raw().button === 0) {\n broadcastOn(mouseReleased(), { target: evt.target() });\n }\n });\n var onContentClick = function (raw) {\n return broadcastOn(dismissPopups(), { target: Element.fromDom(raw.target) });\n };\n var onContentMouseup = function (raw) {\n if (raw.button === 0) {\n broadcastOn(mouseReleased(), { target: Element.fromDom(raw.target) });\n }\n };\n var onWindowScroll = function (evt) {\n return broadcastEvent(windowScroll(), fromRawEvent$1(evt));\n };\n var onWindowResize = function (evt) {\n broadcastOn(repositionPopups(), {});\n broadcastEvent(windowResize(), fromRawEvent$1(evt));\n };\n var onEditorResize = function () {\n return broadcastOn(repositionPopups(), {});\n };\n editor.on('PostRender', function () {\n editor.on('click', onContentClick);\n editor.on('tap', onContentClick);\n editor.on('mouseup', onContentMouseup);\n editor.on('ScrollWindow', onWindowScroll);\n editor.on('ResizeWindow', onWindowResize);\n editor.on('ResizeEditor', onEditorResize);\n });\n editor.on('remove', function () {\n editor.off('click', onContentClick);\n editor.off('tap', onContentClick);\n editor.off('mouseup', onContentMouseup);\n editor.off('ScrollWindow', onWindowScroll);\n editor.off('ResizeWindow', onWindowResize);\n editor.off('ResizeEditor', onEditorResize);\n onMousedown.unbind();\n onTouchstart.unbind();\n onTouchmove.unbind();\n onTouchend.unbind();\n onMouseup.unbind();\n });\n editor.on('detach', function () {\n detachSystem(mothership);\n detachSystem(uiMothership);\n mothership.destroy();\n uiMothership.destroy();\n });\n };\n\n var parts$d = AlloyParts;\n var partType$1 = PartType;\n\n var schema$r = constant([\n defaulted$1('shell', false),\n strict$1('makeItem'),\n defaulted$1('setupItem', noop),\n SketchBehaviours.field('listBehaviours', [Replacing])\n ]);\n var customListDetail = function () {\n return { behaviours: derive$1([Replacing.config({})]) };\n };\n var itemsPart = optional({\n name: 'items',\n overrides: customListDetail\n });\n var parts$e = constant([itemsPart]);\n var name$2 = constant('CustomList');\n\n var factory$f = function (detail, components, _spec, _external) {\n var setItems = function (list, items) {\n getListContainer(list).fold(function () {\n domGlobals.console.error('Custom List was defined to not be a shell, but no item container was specified in components');\n throw new Error('Custom List was defined to not be a shell, but no item container was specified in components');\n }, function (container) {\n var itemComps = Replacing.contents(container);\n var numListsRequired = items.length;\n var numListsToAdd = numListsRequired - itemComps.length;\n var itemsToAdd = numListsToAdd > 0 ? range(numListsToAdd, function () {\n return detail.makeItem();\n }) : [];\n var itemsToRemove = itemComps.slice(numListsRequired);\n each(itemsToRemove, function (item) {\n return Replacing.remove(container, item);\n });\n each(itemsToAdd, function (item) {\n return Replacing.append(container, item);\n });\n var builtLists = Replacing.contents(container);\n each(builtLists, function (item, i) {\n detail.setupItem(list, item, items[i], i);\n });\n });\n };\n var extra = detail.shell ? {\n behaviours: [Replacing.config({})],\n components: []\n } : {\n behaviours: [],\n components: components\n };\n var getListContainer = function (component) {\n return detail.shell ? Option.some(component) : getPart(component, detail, 'items');\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: extra.components,\n behaviours: augment(detail.listBehaviours, extra.behaviours),\n apis: { setItems: setItems }\n };\n };\n var CustomList = composite$1({\n name: name$2(),\n configFields: schema$r(),\n partFields: parts$e(),\n factory: factory$f,\n apis: {\n setItems: function (apis, list, items) {\n apis.setItems(list, items);\n }\n }\n });\n\n var getOffsetParent = function (element) {\n var isFixed = getRaw(element, 'position').is('fixed');\n var offsetParent$1 = isFixed ? Option.none() : offsetParent(element);\n return offsetParent$1.orThunk(function () {\n var marker = Element.fromTag('span');\n return parent(element).bind(function (parent) {\n append(parent, marker);\n var offsetParent$1 = offsetParent(marker);\n remove(marker);\n return offsetParent$1;\n });\n });\n };\n var getOrigin = function (element) {\n return getOffsetParent(element).map(absolute).getOrThunk(function () {\n return Position(0, 0);\n });\n };\n\n var morphAdt = Adt.generate([\n { static: [] },\n { absolute: ['positionCss'] },\n { fixed: ['positionCss'] }\n ]);\n var appear = function (component, contextualInfo) {\n var elem = component.element();\n add$2(elem, contextualInfo.transitionClass);\n remove$4(elem, contextualInfo.fadeOutClass);\n add$2(elem, contextualInfo.fadeInClass);\n contextualInfo.onShow(component);\n };\n var disappear = function (component, contextualInfo) {\n var elem = component.element();\n add$2(elem, contextualInfo.transitionClass);\n remove$4(elem, contextualInfo.fadeInClass);\n add$2(elem, contextualInfo.fadeOutClass);\n contextualInfo.onHide(component);\n };\n var isPartiallyVisible = function (box, viewport) {\n return box.y < viewport.bottom && box.bottom > viewport.y;\n };\n var isTopCompletelyVisible = function (box, viewport) {\n return box.y >= viewport.y;\n };\n var isBottomCompletelyVisible = function (box, viewport) {\n return box.bottom <= viewport.bottom;\n };\n var isVisibleForModes = function (modes, box, viewport) {\n return forall(modes, function (mode) {\n switch (mode) {\n case 'bottom':\n return isBottomCompletelyVisible(box, viewport);\n case 'top':\n return isTopCompletelyVisible(box, viewport);\n }\n });\n };\n var getPrior = function (elem, state) {\n return state.getInitialPosition().map(function (pos) {\n return bounds$1(pos.bounds.x, pos.bounds.y, get$7(elem), get$6(elem));\n });\n };\n var storePrior = function (elem, box, state) {\n state.setInitialPosition(Option.some({\n style: getAllRaw(elem),\n position: get$4(elem, 'position') || 'static',\n bounds: box\n }));\n };\n var revertToOriginal = function (elem, box$1, state) {\n return state.getInitialPosition().bind(function (position) {\n state.setInitialPosition(Option.none());\n switch (position.position) {\n case 'static':\n return Option.some(morphAdt.static());\n case 'absolute':\n var offsetBox_1 = getOffsetParent(elem).map(box).getOrThunk(function () {\n return box(body());\n });\n return Option.some(morphAdt.absolute(NuPositionCss('absolute', get(position.style, 'left').map(function (_left) {\n return box$1.x - offsetBox_1.x;\n }), get(position.style, 'top').map(function (_top) {\n return box$1.y - offsetBox_1.y;\n }), get(position.style, 'right').map(function (_right) {\n return offsetBox_1.right - box$1.right;\n }), get(position.style, 'bottom').map(function (_bottom) {\n return offsetBox_1.bottom - box$1.bottom;\n }))));\n default:\n return Option.none();\n }\n });\n };\n var morphToOriginal = function (elem, viewport, state) {\n return getPrior(elem, state).filter(function (box) {\n return isVisibleForModes(state.getModes(), box, viewport);\n }).bind(function (box) {\n return revertToOriginal(elem, box, state);\n });\n };\n var morphToFixed = function (elem, viewport, state) {\n var box$1 = box(elem);\n if (!isVisibleForModes(state.getModes(), box$1, viewport)) {\n storePrior(elem, box$1, state);\n var winBox = win();\n var left = box$1.x - winBox.x;\n var top = viewport.y - winBox.y;\n var bottom = winBox.bottom - viewport.bottom;\n var isTop = box$1.y <= viewport.y;\n return Option.some(morphAdt.fixed(NuPositionCss('fixed', Option.some(left), isTop ? Option.some(top) : Option.none(), Option.none(), !isTop ? Option.some(bottom) : Option.none())));\n } else {\n return Option.none();\n }\n };\n var getMorph = function (component, viewport, state) {\n var elem = component.element();\n var isDocked = getRaw(elem, 'position').is('fixed');\n return isDocked ? morphToOriginal(elem, viewport, state) : morphToFixed(elem, viewport, state);\n };\n var getMorphToOriginal = function (component, state) {\n var elem = component.element();\n return getPrior(elem, state).bind(function (box) {\n return revertToOriginal(elem, box, state);\n });\n };\n\n var morphToStatic = function (component, config) {\n each([\n 'left',\n 'right',\n 'top',\n 'bottom',\n 'position'\n ], function (prop) {\n return remove$6(component.element(), prop);\n });\n config.onUndocked(component);\n };\n var morphToCoord = function (component, config, position) {\n applyPositionCss(component.element(), position);\n var method = position.position() === 'fixed' ? config.onDocked : config.onUndocked;\n method(component);\n };\n var updateVisibility = function (component, config, state, viewport, morphToDocked) {\n if (morphToDocked === void 0) {\n morphToDocked = false;\n }\n config.contextual.each(function (contextInfo) {\n contextInfo.lazyContext(component).each(function (box) {\n var isVisible = isPartiallyVisible(box, viewport);\n if (isVisible !== state.isVisible()) {\n state.setVisible(isVisible);\n if (morphToDocked && !isVisible) {\n add$3(component.element(), [contextInfo.fadeOutClass]);\n contextInfo.onHide(component);\n } else {\n var method = isVisible ? appear : disappear;\n method(component, contextInfo);\n }\n }\n });\n });\n };\n var refreshInternal = function (component, config, state) {\n var viewport = config.lazyViewport(component);\n var isDocked = state.isDocked();\n if (isDocked) {\n updateVisibility(component, config, state, viewport);\n }\n getMorph(component, viewport, state).each(function (morph) {\n state.setDocked(!isDocked);\n morph.fold(function () {\n return morphToStatic(component, config);\n }, function (position) {\n return morphToCoord(component, config, position);\n }, function (position) {\n updateVisibility(component, config, state, viewport, true);\n morphToCoord(component, config, position);\n });\n });\n };\n var resetInternal = function (component, config, state) {\n var elem = component.element();\n state.setDocked(false);\n getMorphToOriginal(component, state).each(function (morph) {\n morph.fold(function () {\n return morphToStatic(component, config);\n }, function (position) {\n return morphToCoord(component, config, position);\n }, noop);\n });\n state.setVisible(true);\n config.contextual.each(function (contextInfo) {\n remove$5(elem, [\n contextInfo.fadeInClass,\n contextInfo.fadeOutClass,\n contextInfo.transitionClass\n ]);\n contextInfo.onShow(component);\n });\n refresh$4(component, config, state);\n };\n var refresh$4 = function (component, config, state) {\n if (component.getSystem().isConnected()) {\n refreshInternal(component, config, state);\n }\n };\n var reset = function (component, config, state) {\n if (state.isDocked()) {\n resetInternal(component, config, state);\n }\n };\n var isDocked = function (component, config, state) {\n return state.isDocked();\n };\n var setModes = function (component, config, state, modes) {\n return state.setModes(modes);\n };\n var getModes = function (component, config, state) {\n return state.getModes();\n };\n\n var DockingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n refresh: refresh$4,\n reset: reset,\n isDocked: isDocked,\n getModes: getModes,\n setModes: setModes\n });\n\n var events$f = function (dockInfo, dockState) {\n return derive([\n runOnSource(transitionend(), function (component, simulatedEvent) {\n dockInfo.contextual.each(function (contextInfo) {\n if (has$2(component.element(), contextInfo.transitionClass)) {\n remove$5(component.element(), [\n contextInfo.transitionClass,\n contextInfo.fadeInClass\n ]);\n var notify = dockState.isVisible() ? contextInfo.onShown : contextInfo.onHidden;\n notify(component);\n }\n simulatedEvent.stop();\n });\n }),\n run(windowScroll(), function (component, _) {\n refresh$4(component, dockInfo, dockState);\n }),\n run(windowResize(), function (component, _) {\n reset(component, dockInfo, dockState);\n })\n ]);\n };\n\n var ActiveDocking = /*#__PURE__*/Object.freeze({\n __proto__: null,\n events: events$f\n });\n\n var DockingSchema = [\n optionObjOf('contextual', [\n strictString('fadeInClass'),\n strictString('fadeOutClass'),\n strictString('transitionClass'),\n strictFunction('lazyContext'),\n onHandler('onShow'),\n onHandler('onShown'),\n onHandler('onHide'),\n onHandler('onHidden')\n ]),\n defaultedFunction('lazyViewport', win),\n defaultedArrayOf('modes', [\n 'top',\n 'bottom'\n ], string),\n onHandler('onDocked'),\n onHandler('onUndocked')\n ];\n\n var init$b = function (spec) {\n var docked = Cell(false);\n var visible = Cell(true);\n var initialBounds = Cell(Option.none());\n var modes = Cell(spec.modes);\n var readState = function () {\n return 'docked: ' + docked.get() + ', visible: ' + visible.get() + ', modes: ' + modes.get().join(',');\n };\n return nu$5({\n isDocked: docked.get,\n setDocked: docked.set,\n getInitialPosition: initialBounds.get,\n setInitialPosition: initialBounds.set,\n isVisible: visible.get,\n setVisible: visible.set,\n getModes: modes.get,\n setModes: modes.set,\n readState: readState\n });\n };\n\n var DockingState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$b\n });\n\n var Docking = create$1({\n fields: DockingSchema,\n name: 'docking',\n active: ActiveDocking,\n apis: DockingApis,\n state: DockingState\n });\n\n var visibility = {\n fadeInClass: 'tox-editor-dock-fadein',\n fadeOutClass: 'tox-editor-dock-fadeout',\n transitionClass: 'tox-editor-dock-transition'\n };\n var editorStickyOnClass = 'tox-tinymce--toolbar-sticky-on';\n var editorStickyOffClass = 'tox-tinymce--toolbar-sticky-off';\n var scrollFromBehindHeader = function (e, containerHeader) {\n var doc = owner(containerHeader);\n var viewHeight = doc.dom().defaultView.innerHeight;\n var scrollPos = get$8(doc);\n var markerElement = Element.fromDom(e.elm);\n var markerPos = absolute$1(markerElement);\n var markerHeight = get$6(markerElement);\n var markerTop = markerPos.y;\n var markerBottom = markerTop + markerHeight;\n var editorHeaderPos = absolute(containerHeader);\n var editorHeaderHeight = get$6(containerHeader);\n var editorHeaderTop = editorHeaderPos.top();\n var editorHeaderBottom = editorHeaderTop + editorHeaderHeight;\n var editorHeaderDockedAtTop = Math.abs(editorHeaderTop - scrollPos.top()) < 2;\n var editorHeaderDockedAtBottom = Math.abs(editorHeaderBottom - (scrollPos.top() + viewHeight)) < 2;\n if (editorHeaderDockedAtTop && markerTop < editorHeaderBottom) {\n to(scrollPos.left(), markerTop - editorHeaderHeight, doc);\n } else if (editorHeaderDockedAtBottom && markerBottom > editorHeaderTop) {\n var y = markerTop - viewHeight + markerHeight + editorHeaderHeight;\n to(scrollPos.left(), y, doc);\n }\n };\n var isDockedMode = function (header, mode) {\n return contains(Docking.getModes(header), mode);\n };\n var updateIframeContentFlow = function (header) {\n var getOccupiedHeight = function (elm) {\n return getOuter$1(elm) + (parseInt(get$4(elm, 'margin-top'), 10) || 0) + (parseInt(get$4(elm, 'margin-bottom'), 10) || 0);\n };\n var elm = header.element();\n parent(elm).each(function (parentElem) {\n var padding = 'padding-' + Docking.getModes(header)[0];\n if (Docking.isDocked(header)) {\n var parentWidth = get$7(parentElem);\n set$2(elm, 'width', parentWidth + 'px');\n set$2(parentElem, padding, getOccupiedHeight(elm) + 'px');\n } else {\n remove$6(elm, 'width');\n remove$6(parentElem, padding);\n }\n });\n };\n var updateSinkVisibility = function (sinkElem, visible) {\n if (visible) {\n remove$4(sinkElem, visibility.fadeOutClass);\n add$3(sinkElem, [\n visibility.transitionClass,\n visibility.fadeInClass\n ]);\n } else {\n remove$4(sinkElem, visibility.fadeInClass);\n add$3(sinkElem, [\n visibility.fadeOutClass,\n visibility.transitionClass\n ]);\n }\n };\n var updateEditorClasses = function (editor, docked) {\n var editorContainer = Element.fromDom(editor.getContainer());\n if (docked) {\n add$2(editorContainer, editorStickyOnClass);\n remove$4(editorContainer, editorStickyOffClass);\n } else {\n add$2(editorContainer, editorStickyOffClass);\n remove$4(editorContainer, editorStickyOnClass);\n }\n };\n var restoreFocus = function (headerElem, focusedElem) {\n var ownerDoc = owner(focusedElem);\n active(ownerDoc).filter(function (activeElm) {\n return !eq$1(focusedElem, activeElm);\n }).filter(function (activeElm) {\n return eq$1(activeElm, Element.fromDom(ownerDoc.dom().body)) || contains$2(headerElem, activeElm);\n }).each(function () {\n return focus$1(focusedElem);\n });\n };\n var findFocusedElem = function (rootElm, lazySink) {\n return search(rootElm).orThunk(function () {\n return lazySink().toOption().bind(function (sink) {\n return search(sink.element());\n });\n });\n };\n var setup$4 = function (editor, sharedBackstage, lazyHeader) {\n if (!editor.inline) {\n if (!sharedBackstage.header.isPositionedAtTop()) {\n editor.on('ResizeEditor', function () {\n lazyHeader().each(Docking.reset);\n });\n }\n editor.on('ResizeWindow ResizeEditor', function () {\n lazyHeader().each(updateIframeContentFlow);\n });\n editor.on('SkinLoaded', function () {\n lazyHeader().each(function (comp) {\n Docking.isDocked(comp) ? Docking.reset(comp) : Docking.refresh(comp);\n });\n });\n editor.on('FullscreenStateChanged', function () {\n lazyHeader().each(Docking.reset);\n });\n }\n editor.on('AfterScrollIntoView', function (e) {\n lazyHeader().each(function (header) {\n Docking.refresh(header);\n var headerElem = header.element();\n if (isVisible(headerElem)) {\n scrollFromBehindHeader(e, headerElem);\n }\n });\n });\n editor.on('PostRender', function () {\n updateEditorClasses(editor, false);\n });\n };\n var isDocked$1 = function (lazyHeader) {\n return lazyHeader().map(Docking.isDocked).getOr(false);\n };\n var getIframeBehaviours = function () {\n var _a;\n return [Receiving.config({ channels: (_a = {}, _a[toolbarHeightChange()] = { onReceive: updateIframeContentFlow }, _a) })];\n };\n var getBehaviours$2 = function (editor, sharedBackstage) {\n var focusedElm = Cell(Option.none());\n var lazySink = sharedBackstage.getSink;\n var runOnSinkElement = function (f) {\n lazySink().each(function (sink) {\n return f(sink.element());\n });\n };\n var onDockingSwitch = function (comp) {\n if (!editor.inline) {\n updateIframeContentFlow(comp);\n }\n updateEditorClasses(editor, Docking.isDocked(comp));\n comp.getSystem().broadcastOn([repositionPopups()], {});\n lazySink().each(function (sink) {\n return sink.getSystem().broadcastOn([repositionPopups()], {});\n });\n };\n var additionalBehaviours = editor.inline ? [] : getIframeBehaviours();\n return __spreadArrays([\n Focusing.config({}),\n Docking.config({\n contextual: __assign({\n lazyContext: function (comp) {\n var headerHeight = getOuter$1(comp.element());\n var container = editor.inline ? editor.getContentAreaContainer() : editor.getContainer();\n var box$1 = box(Element.fromDom(container));\n var boxHeight = box$1.height - headerHeight;\n var topBound = box$1.y + (isDockedMode(comp, 'top') ? 0 : headerHeight);\n return Option.some(bounds$1(box$1.x, topBound, box$1.width, boxHeight));\n },\n onShow: function () {\n runOnSinkElement(function (elem) {\n return updateSinkVisibility(elem, true);\n });\n },\n onShown: function (comp) {\n runOnSinkElement(function (elem) {\n return remove$5(elem, [\n visibility.transitionClass,\n visibility.fadeInClass\n ]);\n });\n focusedElm.get().each(function (elem) {\n restoreFocus(comp.element(), elem);\n focusedElm.set(Option.none());\n });\n },\n onHide: function (comp) {\n focusedElm.set(findFocusedElem(comp.element(), lazySink));\n runOnSinkElement(function (elem) {\n return updateSinkVisibility(elem, false);\n });\n },\n onHidden: function () {\n runOnSinkElement(function (elem) {\n return remove$5(elem, [visibility.transitionClass]);\n });\n }\n }, visibility),\n modes: [sharedBackstage.header.getDockingMode()],\n onDocked: onDockingSwitch,\n onUndocked: onDockingSwitch\n })\n ], additionalBehaviours);\n };\n\n var StickyHeader = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setup: setup$4,\n isDocked: isDocked$1,\n getBehaviours: getBehaviours$2\n });\n\n var setup$5 = noop;\n var isDocked$2 = never;\n var getBehaviours$3 = constant([]);\n\n var StaticHeader = /*#__PURE__*/Object.freeze({\n __proto__: null,\n setup: setup$5,\n isDocked: isDocked$2,\n getBehaviours: getBehaviours$3\n });\n\n var renderHeader = function (spec) {\n var editor = spec.editor;\n var getBehaviours = spec.sticky ? getBehaviours$2 : getBehaviours$3;\n return {\n uid: spec.uid,\n dom: spec.dom,\n components: spec.components,\n behaviours: derive$1(getBehaviours(editor, spec.sharedBackstage))\n };\n };\n\n var factory$g = function (detail, spec) {\n var setMenus = function (comp, menus) {\n var newMenus = map(menus, function (m) {\n var buttonSpec = {\n type: 'menubutton',\n text: m.text,\n fetch: function (callback) {\n callback(m.getItems());\n }\n };\n var internal = createMenuButton(buttonSpec).mapError(function (errInfo) {\n return formatError(errInfo);\n }).getOrDie();\n return renderMenuButton(internal, 'tox-mbtn', spec.backstage, Option.some('menuitem'));\n });\n Replacing.set(comp, newMenus);\n };\n var apis = {\n focus: Keying.focusIn,\n setMenus: setMenus\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: [],\n behaviours: derive$1([\n Replacing.config({}),\n config('menubar-events', [\n runOnAttached(function (component) {\n detail.onSetup(component);\n }),\n run(mouseover(), function (comp, se) {\n descendant$1(comp.element(), '.' + 'tox-mbtn--active').each(function (activeButton) {\n closest$3(se.event().target(), '.' + 'tox-mbtn').each(function (hoveredButton) {\n if (!eq$1(activeButton, hoveredButton)) {\n comp.getSystem().getByDom(activeButton).each(function (activeComp) {\n comp.getSystem().getByDom(hoveredButton).each(function (hoveredComp) {\n Dropdown.expand(hoveredComp);\n Dropdown.close(activeComp);\n Focusing.focus(hoveredComp);\n });\n });\n }\n });\n });\n }),\n run(focusShifted(), function (comp, se) {\n se.event().prevFocus().bind(function (prev) {\n return comp.getSystem().getByDom(prev).toOption();\n }).each(function (prev) {\n se.event().newFocus().bind(function (nu) {\n return comp.getSystem().getByDom(nu).toOption();\n }).each(function (nu) {\n if (Dropdown.isOpen(prev)) {\n Dropdown.expand(nu);\n Dropdown.close(prev);\n }\n });\n });\n })\n ]),\n Keying.config({\n mode: 'flow',\n selector: '.' + 'tox-mbtn',\n onEscape: function (comp) {\n detail.onEscape(comp);\n return Option.some(true);\n }\n }),\n Tabstopping.config({})\n ]),\n apis: apis,\n domModification: { attributes: { role: 'menubar' } }\n };\n };\n var SilverMenubar = single$2({\n factory: factory$g,\n name: 'silver.Menubar',\n configFields: [\n strict$1('dom'),\n strict$1('uid'),\n strict$1('onEscape'),\n strict$1('backstage'),\n defaulted$1('onSetup', noop)\n ],\n apis: {\n focus: function (apis, comp) {\n apis.focus(comp);\n },\n setMenus: function (apis, comp, menus) {\n apis.setMenus(comp, menus);\n }\n }\n });\n\n var owner$4 = 'container';\n var schema$s = [field$1('slotBehaviours', [])];\n var getPartName$1 = function (name) {\n return '';\n };\n var sketch$2 = function (sSpec) {\n var parts = function () {\n var record = [];\n var slot = function (name, config) {\n record.push(name);\n return generateOne(owner$4, getPartName$1(name), config);\n };\n return {\n slot: slot,\n record: function () {\n return record;\n }\n };\n }();\n var spec = sSpec(parts);\n var partNames = parts.record();\n var fieldParts = map(partNames, function (n) {\n return required({\n name: n,\n pname: getPartName$1(n)\n });\n });\n return composite(owner$4, schema$s, fieldParts, make$7, spec);\n };\n var make$7 = function (detail, components) {\n var getSlotNames = function (_) {\n return getAllPartNames(detail);\n };\n var getSlot = function (container, key) {\n return getPart(container, detail, key);\n };\n var onSlot = function (f, def) {\n return function (container, key) {\n return getPart(container, detail, key).map(function (slot) {\n return f(slot, key);\n }).getOr(def);\n };\n };\n var onSlots = function (f) {\n return function (container, keys) {\n each(keys, function (key) {\n return f(container, key);\n });\n };\n };\n var doShowing = function (comp, _key) {\n return get$2(comp.element(), 'aria-hidden') !== 'true';\n };\n var doShow = function (comp, key) {\n if (!doShowing(comp)) {\n var element = comp.element();\n remove$6(element, 'display');\n remove$1(element, 'aria-hidden');\n emitWith(comp, slotVisibility(), {\n name: key,\n visible: true\n });\n }\n };\n var doHide = function (comp, key) {\n if (doShowing(comp)) {\n var element = comp.element();\n set$2(element, 'display', 'none');\n set$1(element, 'aria-hidden', 'true');\n emitWith(comp, slotVisibility(), {\n name: key,\n visible: false\n });\n }\n };\n var isShowing = onSlot(doShowing, false);\n var hideSlot = onSlot(doHide);\n var hideSlots = onSlots(hideSlot);\n var hideAllSlots = function (container) {\n return hideSlots(container, getSlotNames());\n };\n var showSlot = onSlot(doShow);\n var apis = {\n getSlotNames: getSlotNames,\n getSlot: getSlot,\n isShowing: isShowing,\n hideSlot: hideSlot,\n hideAllSlots: hideAllSlots,\n showSlot: showSlot\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: get$c(detail.slotBehaviours),\n apis: apis\n };\n };\n var slotApis = map$2({\n getSlotNames: function (apis, c) {\n return apis.getSlotNames(c);\n },\n getSlot: function (apis, c, key) {\n return apis.getSlot(c, key);\n },\n isShowing: function (apis, c, key) {\n return apis.isShowing(c, key);\n },\n hideSlot: function (apis, c, key) {\n return apis.hideSlot(c, key);\n },\n hideAllSlots: function (apis, c) {\n return apis.hideAllSlots(c);\n },\n showSlot: function (apis, c, key) {\n return apis.showSlot(c, key);\n }\n }, function (value) {\n return makeApi(value);\n });\n var SlotContainer = __assign(__assign({}, slotApis), { sketch: sketch$2 });\n\n var sidebarSchema = objOf([\n optionString('icon'),\n optionString('tooltip'),\n defaultedFunction('onShow', noop),\n defaultedFunction('onHide', noop),\n defaultedFunction('onSetup', function () {\n return noop;\n })\n ]);\n var createSidebar = function (spec) {\n return asRaw('sidebar', sidebarSchema, spec);\n };\n\n var setup$6 = function (editor) {\n var sidebars = editor.ui.registry.getAll().sidebars;\n each(keys(sidebars), function (name) {\n var spec = sidebars[name];\n var isActive = function () {\n return Option.from(editor.queryCommandValue('ToggleSidebar')).is(name);\n };\n editor.ui.registry.addToggleButton(name, {\n icon: spec.icon,\n tooltip: spec.tooltip,\n onAction: function (buttonApi) {\n editor.execCommand('ToggleSidebar', false, name);\n buttonApi.setActive(isActive());\n },\n onSetup: function (buttonApi) {\n var handleToggle = function () {\n return buttonApi.setActive(isActive());\n };\n editor.on('ToggleSidebar', handleToggle);\n return function () {\n editor.off('ToggleSidebar', handleToggle);\n };\n }\n });\n });\n };\n var getApi = function (comp) {\n return {\n element: function () {\n return comp.element().dom();\n }\n };\n };\n var makePanels = function (parts, panelConfigs) {\n var specs = map(keys(panelConfigs), function (name) {\n var spec = panelConfigs[name];\n var bridged = getOrDie(createSidebar(spec));\n return {\n name: name,\n getApi: getApi,\n onSetup: bridged.onSetup,\n onShow: bridged.onShow,\n onHide: bridged.onHide\n };\n });\n return map(specs, function (spec) {\n var editorOffCell = Cell(noop);\n return parts.slot(spec.name, {\n dom: {\n tag: 'div',\n classes: ['tox-sidebar__pane']\n },\n behaviours: SimpleBehaviours.unnamedEvents([\n onControlAttached(spec, editorOffCell),\n onControlDetached(spec, editorOffCell),\n run(slotVisibility(), function (sidepanel, se) {\n var data = se.event();\n var optSidePanelSpec = find(specs, function (config) {\n return config.name === data.name();\n });\n optSidePanelSpec.each(function (sidePanelSpec) {\n var handler = data.visible() ? sidePanelSpec.onShow : sidePanelSpec.onHide;\n handler(sidePanelSpec.getApi(sidepanel));\n });\n })\n ])\n });\n });\n };\n var makeSidebar = function (panelConfigs) {\n return SlotContainer.sketch(function (parts) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-sidebar__pane-container']\n },\n components: makePanels(parts, panelConfigs),\n slotBehaviours: SimpleBehaviours.unnamedEvents([runOnAttached(function (slotContainer) {\n return SlotContainer.hideAllSlots(slotContainer);\n })])\n };\n });\n };\n var setSidebar = function (sidebar, panelConfigs) {\n var optSlider = Composing.getCurrent(sidebar);\n optSlider.each(function (slider) {\n return Replacing.set(slider, [makeSidebar(panelConfigs)]);\n });\n };\n var toggleSidebar = function (sidebar, name) {\n var optSlider = Composing.getCurrent(sidebar);\n optSlider.each(function (slider) {\n var optSlotContainer = Composing.getCurrent(slider);\n optSlotContainer.each(function (slotContainer) {\n if (Sliding.hasGrown(slider)) {\n if (SlotContainer.isShowing(slotContainer, name)) {\n Sliding.shrink(slider);\n } else {\n SlotContainer.hideAllSlots(slotContainer);\n SlotContainer.showSlot(slotContainer, name);\n }\n } else {\n SlotContainer.hideAllSlots(slotContainer);\n SlotContainer.showSlot(slotContainer, name);\n Sliding.grow(slider);\n }\n });\n });\n };\n var whichSidebar = function (sidebar) {\n var optSlider = Composing.getCurrent(sidebar);\n return optSlider.bind(function (slider) {\n var sidebarOpen = Sliding.isGrowing(slider) || Sliding.hasGrown(slider);\n if (sidebarOpen) {\n var optSlotContainer = Composing.getCurrent(slider);\n return optSlotContainer.bind(function (slotContainer) {\n return find(SlotContainer.getSlotNames(slotContainer), function (name) {\n return SlotContainer.isShowing(slotContainer, name);\n });\n });\n } else {\n return Option.none();\n }\n });\n };\n var fixSize = generate$1('FixSizeEvent');\n var autoSize = generate$1('AutoSizeEvent');\n var renderSidebar = function (spec) {\n return {\n uid: spec.uid,\n dom: {\n tag: 'div',\n classes: ['tox-sidebar'],\n attributes: { role: 'complementary' }\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-sidebar__slider']\n },\n components: [],\n behaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({}),\n Sliding.config({\n dimension: { property: 'width' },\n closedClass: 'tox-sidebar--sliding-closed',\n openClass: 'tox-sidebar--sliding-open',\n shrinkingClass: 'tox-sidebar--sliding-shrinking',\n growingClass: 'tox-sidebar--sliding-growing',\n onShrunk: function (slider) {\n var optSlotContainer = Composing.getCurrent(slider);\n optSlotContainer.each(SlotContainer.hideAllSlots);\n emit(slider, autoSize);\n },\n onGrown: function (slider) {\n emit(slider, autoSize);\n },\n onStartGrow: function (slider) {\n emitWith(slider, fixSize, { width: getRaw(slider.element(), 'width').getOr('') });\n },\n onStartShrink: function (slider) {\n emitWith(slider, fixSize, { width: get$7(slider.element()) + 'px' });\n }\n }),\n Replacing.config({}),\n Composing.config({\n find: function (comp) {\n var children = Replacing.contents(comp);\n return head(children);\n }\n })\n ])\n }],\n behaviours: derive$1([\n ComposingConfigs.childAt(0),\n config('sidebar-sliding-events', [\n run(fixSize, function (comp, se) {\n set$2(comp.element(), 'width', se.event().width());\n }),\n run(autoSize, function (comp, _se) {\n remove$6(comp.element(), 'width');\n })\n ])\n ])\n };\n };\n\n var getAttrs = function (elem) {\n var attributes = elem.dom().attributes !== undefined ? elem.dom().attributes : [];\n return foldl(attributes, function (b, attr) {\n var _a;\n if (attr.name === 'class') {\n return b;\n } else {\n return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a));\n }\n }, {});\n };\n var getClasses = function (elem) {\n return Array.prototype.slice.call(elem.dom().classList, 0);\n };\n var fromHtml$2 = function (html) {\n var elem = Element.fromHtml(html);\n var children$1 = children(elem);\n var attrs = getAttrs(elem);\n var classes = getClasses(elem);\n var contents = children$1.length === 0 ? {} : { innerHtml: get$1(elem) };\n return __assign({\n tag: name(elem),\n classes: classes,\n attributes: attrs\n }, contents);\n };\n\n var renderSpinner = function (providerBackstage) {\n return {\n dom: {\n tag: 'div',\n attributes: { 'aria-label': providerBackstage.translate('Loading...') },\n classes: ['tox-throbber__busy-spinner']\n },\n components: [{ dom: fromHtml$2('
') }],\n behaviours: derive$1([\n Keying.config({\n mode: 'special',\n onTab: function () {\n return Option.some(true);\n },\n onShiftTab: function () {\n return Option.some(true);\n }\n }),\n Focusing.config({})\n ])\n };\n };\n var toggleThrobber = function (comp, state, providerBackstage) {\n var element = comp.element();\n if (state === true) {\n Replacing.set(comp, [renderSpinner(providerBackstage)]);\n remove$6(element, 'display');\n remove$1(element, 'aria-hidden');\n } else {\n Replacing.set(comp, []);\n set$2(element, 'display', 'none');\n set$1(element, 'aria-hidden', 'true');\n }\n };\n var renderThrobber = function (spec) {\n return {\n uid: spec.uid,\n dom: {\n tag: 'div',\n attributes: { 'aria-hidden': 'true' },\n classes: ['tox-throbber'],\n styles: { display: 'none' }\n },\n behaviours: derive$1([Replacing.config({})]),\n components: []\n };\n };\n var setup$7 = function (editor, lazyThrobber, sharedBackstage) {\n var throbberState = Cell(false);\n var timer = Cell(Option.none());\n var toggle = function (state) {\n if (state !== throbberState.get()) {\n toggleThrobber(lazyThrobber(), state, sharedBackstage.providers);\n throbberState.set(state);\n }\n };\n editor.on('ProgressState', function (e) {\n timer.get().each(global$2.clearTimeout);\n if (isNumber(e.time)) {\n var timerId = global$2.setEditorTimeout(editor, function () {\n return toggle(e.state);\n }, e.time);\n timer.set(Option.some(timerId));\n } else {\n toggle(e.state);\n timer.set(Option.none());\n }\n });\n };\n\n var factory$h = function (detail, components, _spec) {\n var apis = {\n getSocket: function (comp) {\n return parts$d.getPart(comp, detail, 'socket');\n },\n setSidebar: function (comp, panelConfigs) {\n parts$d.getPart(comp, detail, 'sidebar').each(function (sidebar) {\n return setSidebar(sidebar, panelConfigs);\n });\n },\n toggleSidebar: function (comp, name) {\n parts$d.getPart(comp, detail, 'sidebar').each(function (sidebar) {\n return toggleSidebar(sidebar, name);\n });\n },\n whichSidebar: function (comp) {\n return parts$d.getPart(comp, detail, 'sidebar').bind(whichSidebar).getOrNull();\n },\n getHeader: function (comp) {\n return parts$d.getPart(comp, detail, 'header');\n },\n getToolbar: function (comp) {\n return parts$d.getPart(comp, detail, 'toolbar');\n },\n setToolbar: function (comp, groups) {\n parts$d.getPart(comp, detail, 'toolbar').each(function (toolbar) {\n toolbar.getApis().setGroups(toolbar, groups);\n });\n },\n setToolbars: function (comp, toolbars) {\n parts$d.getPart(comp, detail, 'multiple-toolbar').each(function (mToolbar) {\n CustomList.setItems(mToolbar, toolbars);\n });\n },\n refreshToolbar: function (comp) {\n var toolbar = parts$d.getPart(comp, detail, 'toolbar');\n toolbar.each(function (toolbar) {\n return toolbar.getApis().refresh(toolbar);\n });\n },\n getThrobber: function (comp) {\n return parts$d.getPart(comp, detail, 'throbber');\n },\n focusToolbar: function (comp) {\n var optToolbar = parts$d.getPart(comp, detail, 'toolbar').orThunk(function () {\n return parts$d.getPart(comp, detail, 'multiple-toolbar');\n });\n optToolbar.each(function (toolbar) {\n Keying.focusIn(toolbar);\n });\n },\n setMenubar: function (comp, menus) {\n parts$d.getPart(comp, detail, 'menubar').each(function (menubar) {\n SilverMenubar.setMenus(menubar, menus);\n });\n },\n focusMenubar: function (comp) {\n parts$d.getPart(comp, detail, 'menubar').each(function (menubar) {\n SilverMenubar.focus(menubar);\n });\n }\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n apis: apis,\n behaviours: detail.behaviours\n };\n };\n var partMenubar = partType$1.optional({\n factory: SilverMenubar,\n name: 'menubar',\n schema: [strict$1('backstage')]\n });\n var toolbarFactory = function (spec) {\n if (spec.type === ToolbarMode.sliding) {\n return renderSlidingMoreToolbar;\n } else if (spec.type === ToolbarMode.floating) {\n return renderFloatingMoreToolbar;\n } else {\n return renderToolbar;\n }\n };\n var partMultipleToolbar = partType$1.optional({\n factory: {\n sketch: function (spec) {\n return CustomList.sketch({\n uid: spec.uid,\n dom: spec.dom,\n listBehaviours: derive$1([Keying.config({\n mode: 'acyclic',\n selector: '.tox-toolbar'\n })]),\n makeItem: function () {\n return renderToolbar({\n type: spec.type,\n uid: generate$1('multiple-toolbar-item'),\n cyclicKeying: false,\n initGroups: [],\n providers: spec.providers,\n onEscape: function () {\n return Option.none();\n }\n });\n },\n setupItem: function (_mToolbar, tc, data, _index) {\n Toolbar.setGroups(tc, data);\n },\n shell: true\n });\n }\n },\n name: 'multiple-toolbar',\n schema: [\n strict$1('dom'),\n strict$1('onEscape')\n ]\n });\n var partToolbar = partType$1.optional({\n factory: {\n sketch: function (spec) {\n var renderer = toolbarFactory(spec);\n var toolbarSpec = {\n type: spec.type,\n uid: spec.uid,\n onEscape: function () {\n spec.onEscape();\n return Option.some(true);\n },\n cyclicKeying: false,\n initGroups: [],\n getSink: spec.getSink,\n providers: spec.providers,\n moreDrawerData: {\n lazyToolbar: spec.lazyToolbar,\n lazyMoreButton: spec.lazyMoreButton,\n lazyHeader: spec.lazyHeader\n },\n attributes: spec.attributes\n };\n return renderer(toolbarSpec);\n }\n },\n name: 'toolbar',\n schema: [\n strict$1('dom'),\n strict$1('onEscape'),\n strict$1('getSink')\n ]\n });\n var partHeader = partType$1.optional({\n factory: { sketch: renderHeader },\n name: 'header',\n schema: [strict$1('dom')]\n });\n var partSocket = partType$1.optional({\n name: 'socket',\n schema: [strict$1('dom')]\n });\n var partSidebar = partType$1.optional({\n factory: { sketch: renderSidebar },\n name: 'sidebar',\n schema: [strict$1('dom')]\n });\n var partThrobber = partType$1.optional({\n factory: { sketch: renderThrobber },\n name: 'throbber',\n schema: [strict$1('dom')]\n });\n var OuterContainer = composite$1({\n name: 'OuterContainer',\n factory: factory$h,\n configFields: [\n strict$1('dom'),\n strict$1('behaviours')\n ],\n partFields: [\n partHeader,\n partMenubar,\n partToolbar,\n partMultipleToolbar,\n partSocket,\n partSidebar,\n partThrobber\n ],\n apis: {\n getSocket: function (apis, comp) {\n return apis.getSocket(comp);\n },\n setSidebar: function (apis, comp, panelConfigs) {\n apis.setSidebar(comp, panelConfigs);\n },\n toggleSidebar: function (apis, comp, name) {\n apis.toggleSidebar(comp, name);\n },\n whichSidebar: function (apis, comp) {\n return apis.whichSidebar(comp);\n },\n getHeader: function (apis, comp) {\n return apis.getHeader(comp);\n },\n getToolbar: function (apis, comp) {\n return apis.getToolbar(comp);\n },\n setToolbar: function (apis, comp, grps) {\n var groups = map(grps, function (grp) {\n return renderToolbarGroup(grp);\n });\n apis.setToolbar(comp, groups);\n },\n setToolbars: function (apis, comp, ts) {\n var renderedToolbars = map(ts, function (g) {\n return map(g, renderToolbarGroup);\n });\n apis.setToolbars(comp, renderedToolbars);\n },\n refreshToolbar: function (apis, comp) {\n return apis.refreshToolbar(comp);\n },\n getThrobber: function (apis, comp) {\n return apis.getThrobber(comp);\n },\n setMenubar: function (apis, comp, menus) {\n apis.setMenubar(comp, menus);\n },\n focusMenubar: function (apis, comp) {\n apis.focusMenubar(comp);\n },\n focusToolbar: function (apis, comp) {\n apis.focusToolbar(comp);\n }\n }\n });\n\n var defaultMenubar = 'file edit view insert format tools table help';\n var defaultMenus = {\n file: {\n title: 'File',\n items: 'newdocument restoredraft | preview | print | deleteallconversations'\n },\n edit: {\n title: 'Edit',\n items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'\n },\n view: {\n title: 'View',\n items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments'\n },\n insert: {\n title: 'Insert',\n items: 'image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime'\n },\n format: {\n title: 'Format',\n items: 'bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat'\n },\n tools: {\n title: 'Tools',\n items: 'spellchecker spellcheckerlanguage | a11ycheck code wordcount'\n },\n table: {\n title: 'Table',\n items: 'inserttable | cell row column | advtablesort | tableprops deletetable'\n },\n help: {\n title: 'Help',\n items: 'help'\n }\n };\n var make$8 = function (menu, registry, editor) {\n var removedMenuItems = getRemovedMenuItems(editor).split(/[ ,]/);\n return {\n text: menu.title,\n getItems: function () {\n return bind(menu.items, function (i) {\n var itemName = i.toLowerCase();\n if (itemName.trim().length === 0) {\n return [];\n } else if (exists(removedMenuItems, function (removedMenuItem) {\n return removedMenuItem === itemName;\n })) {\n return [];\n } else if (itemName === 'separator' || itemName === '|') {\n return [{ type: 'separator' }];\n } else if (registry.menuItems[itemName]) {\n return [registry.menuItems[itemName]];\n } else {\n return [];\n }\n });\n }\n };\n };\n var parseItemsString = function (items) {\n if (typeof items === 'string') {\n return items.split(' ');\n }\n return items;\n };\n var identifyMenus = function (editor, registry) {\n var rawMenuData = __assign(__assign({}, defaultMenus), registry.menus);\n var userDefinedMenus = keys(registry.menus).length > 0;\n var menubar = registry.menubar === undefined || registry.menubar === true ? parseItemsString(defaultMenubar) : parseItemsString(registry.menubar === false ? '' : registry.menubar);\n var validMenus = filter(menubar, function (menuName) {\n return userDefinedMenus ? registry.menus.hasOwnProperty(menuName) && registry.menus[menuName].hasOwnProperty('items') || defaultMenus.hasOwnProperty(menuName) : defaultMenus.hasOwnProperty(menuName);\n });\n var menus = map(validMenus, function (menuName) {\n var menuData = rawMenuData[menuName];\n return make$8({\n title: menuData.title,\n items: parseItemsString(menuData.items)\n }, registry, editor);\n });\n return filter(menus, function (menu) {\n var isNotSeparator = function (item) {\n return item.type !== 'separator';\n };\n return menu.getItems().length > 0 && exists(menu.getItems(), isNotSeparator);\n });\n };\n\n var fireSkinLoaded$1 = function (editor) {\n var done = function () {\n editor._skinLoaded = true;\n fireSkinLoaded(editor);\n };\n return function () {\n if (editor.initialized) {\n done();\n } else {\n editor.on('init', done);\n }\n };\n };\n var fireSkinLoadError$1 = function (editor, err) {\n return function () {\n return fireSkinLoadError(editor, { message: err });\n };\n };\n\n var loadSkin = function (isInline, editor) {\n var skinUrl = getSkinUrl(editor);\n var skinUiCss;\n if (skinUrl) {\n skinUiCss = skinUrl + '/skin.min.css';\n editor.contentCSS.push(skinUrl + (isInline ? '/content.inline' : '/content') + '.min.css');\n }\n if (isSkinDisabled(editor) === false && skinUiCss) {\n editor.ui.styleSheetLoader.load(skinUiCss, fireSkinLoaded$1(editor), fireSkinLoadError$1(editor, 'Skin could not be loaded'));\n } else {\n fireSkinLoaded$1(editor)();\n }\n };\n var iframe = curry(loadSkin, false);\n var inline = curry(loadSkin, true);\n\n var setToolbar = function (editor, uiComponents, rawUiConfig, backstage) {\n var comp = uiComponents.outerContainer;\n var toolbarConfig = rawUiConfig.toolbar;\n var toolbarButtonsConfig = rawUiConfig.buttons;\n if (isArrayOf(toolbarConfig, isString)) {\n var toolbars = toolbarConfig.map(function (t) {\n var config = {\n toolbar: t,\n buttons: toolbarButtonsConfig,\n allowToolbarGroups: rawUiConfig.allowToolbarGroups\n };\n return identifyButtons(editor, config, { backstage: backstage }, Option.none());\n });\n OuterContainer.setToolbars(comp, toolbars);\n } else {\n OuterContainer.setToolbar(comp, identifyButtons(editor, rawUiConfig, { backstage: backstage }, Option.none()));\n }\n };\n\n var DOM = global$5.DOM;\n var detection = detect$3();\n var isiOS12 = detection.os.isiOS() && detection.os.version.major <= 12;\n var setupEvents = function (editor) {\n var contentWindow = editor.getWin();\n var initialDocEle = editor.getDoc().documentElement;\n var lastWindowDimensions = Cell(Position(contentWindow.innerWidth, contentWindow.innerHeight));\n var lastDocumentDimensions = Cell(Position(initialDocEle.offsetWidth, initialDocEle.offsetHeight));\n var resizeWindow = function (e) {\n var outer = lastWindowDimensions.get();\n if (outer.left() !== contentWindow.innerWidth || outer.top() !== contentWindow.innerHeight) {\n lastWindowDimensions.set(Position(contentWindow.innerWidth, contentWindow.innerHeight));\n fireResizeContent(editor, e);\n }\n };\n var resizeDocument = function (e) {\n var docEle = editor.getDoc().documentElement;\n var inner = lastDocumentDimensions.get();\n if (inner.left() !== docEle.offsetWidth || inner.top() !== docEle.offsetHeight) {\n lastDocumentDimensions.set(Position(docEle.offsetWidth, docEle.offsetHeight));\n fireResizeContent(editor, e);\n }\n };\n var scroll = function (e) {\n return fireScrollContent(editor, e);\n };\n DOM.bind(contentWindow, 'resize', resizeWindow);\n DOM.bind(contentWindow, 'scroll', scroll);\n var elementLoad = capture$1(Element.fromDom(editor.getBody()), 'load', resizeDocument);\n editor.on('NodeChange', resizeDocument);\n editor.on('remove', function () {\n elementLoad.unbind();\n DOM.unbind(contentWindow, 'resize', resizeWindow);\n DOM.unbind(contentWindow, 'scroll', scroll);\n });\n };\n var render = function (editor, uiComponents, rawUiConfig, backstage, args) {\n var lastToolbarWidth = Cell(0);\n iframe(editor);\n var eTargetNode = Element.fromDom(args.targetNode);\n var uiRoot = getContentContainer(getRootNode(eTargetNode));\n attachSystemAfter(eTargetNode, uiComponents.mothership);\n attachSystem(uiRoot, uiComponents.uiMothership);\n editor.on('PostRender', function () {\n setToolbar(editor, uiComponents, rawUiConfig, backstage);\n lastToolbarWidth.set(editor.getWin().innerWidth);\n OuterContainer.setMenubar(uiComponents.outerContainer, identifyMenus(editor, rawUiConfig));\n OuterContainer.setSidebar(uiComponents.outerContainer, rawUiConfig.sidebar);\n setupEvents(editor);\n });\n var socket = OuterContainer.getSocket(uiComponents.outerContainer).getOrDie('Could not find expected socket element');\n if (isiOS12 === true) {\n setAll$1(socket.element(), {\n 'overflow': 'scroll',\n '-webkit-overflow-scrolling': 'touch'\n });\n var limit = first(function () {\n editor.fire('ScrollContent');\n }, 20);\n bind$3(socket.element(), 'scroll', limit.throttle);\n }\n setupReadonlyModeSwitch(editor, uiComponents);\n editor.addCommand('ToggleSidebar', function (ui, value) {\n OuterContainer.toggleSidebar(uiComponents.outerContainer, value);\n editor.fire('ToggleSidebar');\n });\n editor.addQueryValueHandler('ToggleSidebar', function () {\n return OuterContainer.whichSidebar(uiComponents.outerContainer);\n });\n var toolbarMode = getToolbarMode(editor);\n var refreshDrawer = function () {\n OuterContainer.refreshToolbar(uiComponents.outerContainer);\n };\n if (toolbarMode === ToolbarMode.sliding || toolbarMode === ToolbarMode.floating) {\n editor.on('ResizeWindow ResizeEditor ResizeContent', function () {\n var width = editor.getWin().innerWidth;\n if (width !== lastToolbarWidth.get()) {\n refreshDrawer();\n lastToolbarWidth.set(width);\n }\n });\n }\n return {\n iframeContainer: socket.element().dom(),\n editorContainer: uiComponents.outerContainer.element().dom()\n };\n };\n\n var Iframe = /*#__PURE__*/Object.freeze({\n __proto__: null,\n render: render\n });\n\n var revocable = function (doRevoke) {\n var subject = Cell(Option.none());\n var revoke = function () {\n subject.get().each(doRevoke);\n };\n var clear = function () {\n revoke();\n subject.set(Option.none());\n };\n var set = function (s) {\n revoke();\n subject.set(Option.some(s));\n };\n var isSet = function () {\n return subject.get().isSome();\n };\n return {\n clear: clear,\n isSet: isSet,\n set: set\n };\n };\n var unbindable = function () {\n return revocable(function (s) {\n s.unbind();\n });\n };\n var value$3 = function () {\n var subject = Cell(Option.none());\n var clear = function () {\n subject.set(Option.none());\n };\n var set = function (s) {\n subject.set(Option.some(s));\n };\n var on = function (f) {\n subject.get().each(f);\n };\n var isSet = function () {\n return subject.get().isSome();\n };\n return {\n clear: clear,\n set: set,\n isSet: isSet,\n on: on\n };\n };\n\n var parseToInt = function (val) {\n var re = /^[0-9\\.]+(|px)$/i;\n if (re.test('' + val)) {\n return Option.some(parseInt('' + val, 10));\n }\n return Option.none();\n };\n var numToPx = function (val) {\n return isNumber(val) ? val + 'px' : val;\n };\n var calcCappedSize = function (size, minSize, maxSize) {\n var minOverride = minSize.filter(function (min) {\n return size < min;\n });\n var maxOverride = maxSize.filter(function (max) {\n return size > max;\n });\n return minOverride.or(maxOverride).getOr(size);\n };\n\n var getHeight$1 = function (editor) {\n var baseHeight = getHeightSetting(editor);\n var minHeight = getMinHeightSetting(editor);\n var maxHeight = getMaxHeightSetting(editor);\n return parseToInt(baseHeight).map(function (height) {\n return calcCappedSize(height, minHeight, maxHeight);\n });\n };\n var getHeightWithFallback = function (editor) {\n var height = getHeight$1(editor);\n return height.getOr(getHeightSetting(editor));\n };\n var getWidth$1 = function (editor) {\n var baseWidth = getWidthSetting(editor);\n var minWidth = getMinWidthSetting(editor);\n var maxWidth = getMaxWidthSetting(editor);\n return parseToInt(baseWidth).map(function (width) {\n return calcCappedSize(width, minWidth, maxWidth);\n });\n };\n var getWidthWithFallback = function (editor) {\n var width = getWidth$1(editor);\n return width.getOr(getWidthSetting(editor));\n };\n\n var InlineHeader = function (editor, targetElm, uiComponents, backstage, floatContainer) {\n var uiMothership = uiComponents.uiMothership, outerContainer = uiComponents.outerContainer;\n var DOM = global$5.DOM;\n var useFixedToolbarContainer = useFixedContainer(editor);\n var isSticky = isStickyToolbar(editor);\n var editorMaxWidthOpt = getMaxWidthSetting(editor).or(getWidth$1(editor));\n var headerBackstage = backstage.shared.header;\n var isPositionedAtTop = headerBackstage.isPositionedAtTop;\n var toolbarMode = getToolbarMode(editor);\n var isSplitToolbar = toolbarMode === ToolbarMode.sliding || toolbarMode === ToolbarMode.floating;\n var visible = Cell(false);\n var isVisible = function () {\n return visible.get() && !editor.removed;\n };\n var calcToolbarOffset = function (toolbar) {\n return isSplitToolbar ? toolbar.fold(function () {\n return 0;\n }, function (tbar) {\n return tbar.components().length > 1 ? get$6(tbar.components()[1].element()) : 0;\n }) : 0;\n };\n var calcMode = function (container) {\n switch (getToolbarLocation(editor)) {\n case ToolbarLocation.auto:\n var toolbar_1 = OuterContainer.getToolbar(outerContainer);\n var offset = calcToolbarOffset(toolbar_1);\n var toolbarHeight = get$6(container.element()) - offset;\n var targetBounds = box(targetElm);\n var roomAtTop = targetBounds.y > toolbarHeight;\n if (roomAtTop) {\n return 'top';\n } else {\n var doc = documentElement(targetElm);\n var docHeight = Math.max(doc.dom().scrollHeight, get$6(doc));\n var roomAtBottom = targetBounds.bottom < docHeight - toolbarHeight;\n if (roomAtBottom) {\n return 'bottom';\n } else {\n var winBounds = win();\n var isRoomAtBottomViewport = winBounds.bottom < targetBounds.bottom - toolbarHeight;\n return isRoomAtBottomViewport ? 'bottom' : 'top';\n }\n }\n case ToolbarLocation.bottom:\n return 'bottom';\n case ToolbarLocation.top:\n default:\n return 'top';\n }\n };\n var setupMode = function (mode) {\n var container = floatContainer.get();\n Docking.setModes(container, [mode]);\n headerBackstage.setDockingMode(mode);\n var verticalDir = isPositionedAtTop() ? AttributeValue.TopToBottom : AttributeValue.BottomToTop;\n set$1(container.element(), Attribute, verticalDir);\n };\n var updateChromeWidth = function () {\n var maxWidth = editorMaxWidthOpt.getOrThunk(function () {\n var bodyMargin = parseToInt(get$4(body(), 'margin-left')).getOr(0);\n return get$7(body()) - absolute(targetElm).left() + bodyMargin;\n });\n set$2(floatContainer.get().element(), 'max-width', maxWidth + 'px');\n };\n var updateChromePosition = function () {\n var toolbar = OuterContainer.getToolbar(outerContainer);\n var offset = calcToolbarOffset(toolbar);\n var targetBounds = box(targetElm);\n var top = isPositionedAtTop() ? Math.max(targetBounds.y - get$6(floatContainer.get().element()) + offset, 0) : targetBounds.bottom;\n setAll$1(outerContainer.element(), {\n position: 'absolute',\n top: Math.round(top) + 'px',\n left: Math.round(targetBounds.x) + 'px'\n });\n };\n var repositionPopups$1 = function () {\n uiMothership.broadcastOn([repositionPopups()], {});\n };\n var updateChromeUi = function (resetDocking) {\n if (resetDocking === void 0) {\n resetDocking = false;\n }\n if (!isVisible()) {\n return;\n }\n if (!useFixedToolbarContainer) {\n updateChromeWidth();\n }\n if (isSplitToolbar) {\n OuterContainer.refreshToolbar(outerContainer);\n }\n if (!useFixedToolbarContainer) {\n updateChromePosition();\n }\n if (isSticky) {\n var floatContainerComp = floatContainer.get();\n resetDocking ? Docking.reset(floatContainerComp) : Docking.refresh(floatContainerComp);\n }\n repositionPopups$1();\n };\n var updateMode = function (updateUi) {\n if (updateUi === void 0) {\n updateUi = true;\n }\n if (useFixedToolbarContainer || !isSticky || !isVisible()) {\n return;\n }\n var currentMode = headerBackstage.getDockingMode();\n var newMode = calcMode(floatContainer.get());\n if (newMode !== currentMode) {\n setupMode(newMode);\n if (updateUi) {\n updateChromeUi(true);\n }\n }\n };\n var show = function () {\n visible.set(true);\n set$2(outerContainer.element(), 'display', 'flex');\n DOM.addClass(editor.getBody(), 'mce-edit-focus');\n remove$6(uiMothership.element(), 'display');\n updateMode(false);\n updateChromeUi();\n };\n var hide = function () {\n visible.set(false);\n if (uiComponents.outerContainer) {\n set$2(outerContainer.element(), 'display', 'none');\n DOM.removeClass(editor.getBody(), 'mce-edit-focus');\n }\n set$2(uiMothership.element(), 'display', 'none');\n };\n return {\n isVisible: isVisible,\n isPositionedAtTop: isPositionedAtTop,\n show: show,\n hide: hide,\n update: updateChromeUi,\n updateMode: updateMode,\n repositionPopups: repositionPopups$1\n };\n };\n\n var getTargetPosAndBounds = function (targetElm, isToolbarTop) {\n var bounds = box(targetElm);\n return {\n pos: isToolbarTop ? bounds.y : bounds.bottom,\n bounds: bounds\n };\n };\n var setupEvents$1 = function (editor, targetElm, ui) {\n var prevPosAndBounds = Cell(getTargetPosAndBounds(targetElm, ui.isPositionedAtTop()));\n var resizeContent = function (e) {\n var _a = getTargetPosAndBounds(targetElm, ui.isPositionedAtTop()), pos = _a.pos, bounds = _a.bounds;\n var _b = prevPosAndBounds.get(), prevPos = _b.pos, prevBounds = _b.bounds;\n var hasResized = bounds.height !== prevBounds.height || bounds.width !== prevBounds.width;\n prevPosAndBounds.set({\n pos: pos,\n bounds: bounds\n });\n if (hasResized) {\n fireResizeContent(editor, e);\n }\n if (ui.isVisible()) {\n if (prevPos !== pos) {\n ui.update(true);\n } else if (hasResized) {\n ui.updateMode();\n ui.repositionPopups();\n }\n }\n };\n editor.on('activate', ui.show);\n editor.on('deactivate', ui.hide);\n editor.on('SkinLoaded ResizeWindow', function () {\n return ui.update(true);\n });\n editor.on('NodeChange keydown', function (e) {\n global$2.requestAnimationFrame(function () {\n return resizeContent(e);\n });\n });\n editor.on('ScrollWindow', function () {\n return ui.updateMode();\n });\n var elementLoad = unbindable();\n elementLoad.set(capture$1(Element.fromDom(editor.getBody()), 'load', resizeContent));\n editor.on('remove', function () {\n elementLoad.clear();\n });\n };\n var render$1 = function (editor, uiComponents, rawUiConfig, backstage, args) {\n var mothership = uiComponents.mothership, uiMothership = uiComponents.uiMothership, outerContainer = uiComponents.outerContainer;\n var floatContainer = Cell(null);\n var targetElm = Element.fromDom(args.targetNode);\n var ui = InlineHeader(editor, targetElm, uiComponents, backstage, floatContainer);\n inline(editor);\n var render = function () {\n if (floatContainer.get()) {\n ui.show();\n return;\n }\n floatContainer.set(OuterContainer.getHeader(outerContainer).getOrDie());\n var uiContainer = getUiContainer(editor);\n attachSystem(uiContainer, mothership);\n attachSystem(uiContainer, uiMothership);\n setToolbar(editor, uiComponents, rawUiConfig, backstage);\n OuterContainer.setMenubar(outerContainer, identifyMenus(editor, rawUiConfig));\n ui.show();\n setupEvents$1(editor, targetElm, ui);\n editor.nodeChanged();\n };\n editor.on('focus', render);\n editor.on('blur hide', ui.hide);\n editor.on('init', function () {\n if (editor.hasFocus()) {\n render();\n }\n });\n setupReadonlyModeSwitch(editor, uiComponents);\n return { editorContainer: outerContainer.element().dom() };\n };\n\n var Inline = /*#__PURE__*/Object.freeze({\n __proto__: null,\n render: render$1\n });\n\n var register$5 = function (editor) {\n var alignToolbarButtons = [\n {\n name: 'alignleft',\n text: 'Align left',\n cmd: 'JustifyLeft',\n icon: 'align-left'\n },\n {\n name: 'aligncenter',\n text: 'Align center',\n cmd: 'JustifyCenter',\n icon: 'align-center'\n },\n {\n name: 'alignright',\n text: 'Align right',\n cmd: 'JustifyRight',\n icon: 'align-right'\n },\n {\n name: 'alignjustify',\n text: 'Justify',\n cmd: 'JustifyFull',\n icon: 'align-justify'\n }\n ];\n global$e.each(alignToolbarButtons, function (item) {\n editor.ui.registry.addToggleButton(item.name, {\n tooltip: item.text,\n onAction: function () {\n return editor.execCommand(item.cmd);\n },\n icon: item.icon,\n onSetup: onSetupFormatToggle(editor, item.name)\n });\n });\n var alignNoneToolbarButton = {\n name: 'alignnone',\n text: 'No alignment',\n cmd: 'JustifyNone',\n icon: 'align-none'\n };\n editor.ui.registry.addButton(alignNoneToolbarButton.name, {\n tooltip: alignNoneToolbarButton.text,\n onAction: function () {\n return editor.execCommand(alignNoneToolbarButton.cmd);\n },\n icon: alignNoneToolbarButton.icon\n });\n };\n\n var toggleFormat = function (editor, fmt) {\n return function () {\n editor.execCommand('mceToggleFormat', false, fmt);\n };\n };\n var registerFormatButtons = function (editor) {\n global$e.each([\n {\n name: 'bold',\n text: 'Bold',\n icon: 'bold'\n },\n {\n name: 'italic',\n text: 'Italic',\n icon: 'italic'\n },\n {\n name: 'underline',\n text: 'Underline',\n icon: 'underline'\n },\n {\n name: 'strikethrough',\n text: 'Strikethrough',\n icon: 'strike-through'\n },\n {\n name: 'subscript',\n text: 'Subscript',\n icon: 'subscript'\n },\n {\n name: 'superscript',\n text: 'Superscript',\n icon: 'superscript'\n }\n ], function (btn, _idx) {\n editor.ui.registry.addToggleButton(btn.name, {\n tooltip: btn.text,\n icon: btn.icon,\n onSetup: onSetupFormatToggle(editor, btn.name),\n onAction: toggleFormat(editor, btn.name)\n });\n });\n for (var i = 1; i <= 6; i++) {\n var name_1 = 'h' + i;\n editor.ui.registry.addToggleButton(name_1, {\n text: name_1.toUpperCase(),\n tooltip: 'Heading ' + i,\n onSetup: onSetupFormatToggle(editor, name_1),\n onAction: toggleFormat(editor, name_1)\n });\n }\n };\n var registerCommandButtons = function (editor) {\n global$e.each([\n {\n name: 'cut',\n text: 'Cut',\n action: 'Cut',\n icon: 'cut'\n },\n {\n name: 'copy',\n text: 'Copy',\n action: 'Copy',\n icon: 'copy'\n },\n {\n name: 'paste',\n text: 'Paste',\n action: 'Paste',\n icon: 'paste'\n },\n {\n name: 'help',\n text: 'Help',\n action: 'mceHelp',\n icon: 'help'\n },\n {\n name: 'selectall',\n text: 'Select all',\n action: 'SelectAll',\n icon: 'select-all'\n },\n {\n name: 'newdocument',\n text: 'New document',\n action: 'mceNewDocument',\n icon: 'new-document'\n },\n {\n name: 'removeformat',\n text: 'Clear formatting',\n action: 'RemoveFormat',\n icon: 'remove-formatting'\n },\n {\n name: 'remove',\n text: 'Remove',\n action: 'Delete',\n icon: 'remove'\n }\n ], function (btn) {\n editor.ui.registry.addButton(btn.name, {\n tooltip: btn.text,\n icon: btn.icon,\n onAction: function () {\n return editor.execCommand(btn.action);\n }\n });\n });\n };\n var registerCommandToggleButtons = function (editor) {\n global$e.each([{\n name: 'blockquote',\n text: 'Blockquote',\n action: 'mceBlockQuote',\n icon: 'quote'\n }], function (btn) {\n editor.ui.registry.addToggleButton(btn.name, {\n tooltip: btn.text,\n icon: btn.icon,\n onAction: function () {\n return editor.execCommand(btn.action);\n },\n onSetup: onSetupFormatToggle(editor, btn.name)\n });\n });\n };\n var registerButtons = function (editor) {\n registerFormatButtons(editor);\n registerCommandButtons(editor);\n registerCommandToggleButtons(editor);\n };\n var registerMenuItems = function (editor) {\n global$e.each([\n {\n name: 'bold',\n text: 'Bold',\n action: 'Bold',\n icon: 'bold',\n shortcut: 'Meta+B'\n },\n {\n name: 'italic',\n text: 'Italic',\n action: 'Italic',\n icon: 'italic',\n shortcut: 'Meta+I'\n },\n {\n name: 'underline',\n text: 'Underline',\n action: 'Underline',\n icon: 'underline',\n shortcut: 'Meta+U'\n },\n {\n name: 'strikethrough',\n text: 'Strikethrough',\n action: 'Strikethrough',\n icon: 'strike-through',\n shortcut: ''\n },\n {\n name: 'subscript',\n text: 'Subscript',\n action: 'Subscript',\n icon: 'subscript',\n shortcut: ''\n },\n {\n name: 'superscript',\n text: 'Superscript',\n action: 'Superscript',\n icon: 'superscript',\n shortcut: ''\n },\n {\n name: 'removeformat',\n text: 'Clear formatting',\n action: 'RemoveFormat',\n icon: 'remove-formatting',\n shortcut: ''\n },\n {\n name: 'newdocument',\n text: 'New document',\n action: 'mceNewDocument',\n icon: 'new-document',\n shortcut: ''\n },\n {\n name: 'cut',\n text: 'Cut',\n action: 'Cut',\n icon: 'cut',\n shortcut: 'Meta+X'\n },\n {\n name: 'copy',\n text: 'Copy',\n action: 'Copy',\n icon: 'copy',\n shortcut: 'Meta+C'\n },\n {\n name: 'paste',\n text: 'Paste',\n action: 'Paste',\n icon: 'paste',\n shortcut: 'Meta+V'\n },\n {\n name: 'selectall',\n text: 'Select all',\n action: 'SelectAll',\n icon: 'select-all',\n shortcut: 'Meta+A'\n }\n ], function (btn) {\n editor.ui.registry.addMenuItem(btn.name, {\n text: btn.text,\n icon: btn.icon,\n shortcut: btn.shortcut,\n onAction: function () {\n return editor.execCommand(btn.action);\n }\n });\n });\n editor.ui.registry.addMenuItem('codeformat', {\n text: 'Code',\n icon: 'sourcecode',\n onAction: toggleFormat(editor, 'code')\n });\n };\n var register$6 = function (editor) {\n registerButtons(editor);\n registerMenuItems(editor);\n };\n\n var toggleUndoRedoState = function (api, editor, type) {\n var checkState = function () {\n return editor.undoManager ? editor.undoManager[type]() : false;\n };\n var onUndoStateChange = function () {\n api.setDisabled(editor.mode.isReadOnly() || !checkState());\n };\n api.setDisabled(!checkState());\n editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', onUndoStateChange);\n return function () {\n return editor.off('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', onUndoStateChange);\n };\n };\n var registerMenuItems$1 = function (editor) {\n editor.ui.registry.addMenuItem('undo', {\n text: 'Undo',\n icon: 'undo',\n shortcut: 'Meta+Z',\n onSetup: function (api) {\n return toggleUndoRedoState(api, editor, 'hasUndo');\n },\n onAction: function () {\n return editor.execCommand('undo');\n }\n });\n editor.ui.registry.addMenuItem('redo', {\n text: 'Redo',\n icon: 'redo',\n shortcut: 'Meta+Y',\n onSetup: function (api) {\n return toggleUndoRedoState(api, editor, 'hasRedo');\n },\n onAction: function () {\n return editor.execCommand('redo');\n }\n });\n };\n var registerButtons$1 = function (editor) {\n editor.ui.registry.addButton('undo', {\n tooltip: 'Undo',\n icon: 'undo',\n onSetup: function (api) {\n return toggleUndoRedoState(api, editor, 'hasUndo');\n },\n onAction: function () {\n return editor.execCommand('undo');\n }\n });\n editor.ui.registry.addButton('redo', {\n tooltip: 'Redo',\n icon: 'redo',\n onSetup: function (api) {\n return toggleUndoRedoState(api, editor, 'hasRedo');\n },\n onAction: function () {\n return editor.execCommand('redo');\n }\n });\n };\n var register$7 = function (editor) {\n registerMenuItems$1(editor);\n registerButtons$1(editor);\n };\n\n var toggleVisualAidState = function (api, editor) {\n api.setActive(editor.hasVisual);\n var onVisualAid = function (e) {\n api.setActive(e.hasVisual);\n };\n editor.on('VisualAid', onVisualAid);\n return function () {\n return editor.off('VisualAid', onVisualAid);\n };\n };\n var registerMenuItems$2 = function (editor) {\n editor.ui.registry.addToggleMenuItem('visualaid', {\n text: 'Visual aids',\n onSetup: function (api) {\n return toggleVisualAidState(api, editor);\n },\n onAction: function () {\n editor.execCommand('mceToggleVisualAid');\n }\n });\n };\n var registerToolbarButton = function (editor) {\n editor.ui.registry.addButton('visualaid', {\n tooltip: 'Visual aids',\n text: 'Visual aids',\n onAction: function () {\n return editor.execCommand('mceToggleVisualAid');\n }\n });\n };\n var register$8 = function (editor) {\n registerToolbarButton(editor);\n registerMenuItems$2(editor);\n };\n\n var toggleOutdentState = function (api, editor) {\n api.setDisabled(!editor.queryCommandState('outdent'));\n var onNodeChange = function () {\n api.setDisabled(!editor.queryCommandState('outdent'));\n };\n editor.on('NodeChange', onNodeChange);\n return function () {\n return editor.off('NodeChange', onNodeChange);\n };\n };\n var registerButtons$2 = function (editor) {\n editor.ui.registry.addButton('outdent', {\n tooltip: 'Decrease indent',\n icon: 'outdent',\n onSetup: function (api) {\n return toggleOutdentState(api, editor);\n },\n onAction: function () {\n return editor.execCommand('outdent');\n }\n });\n editor.ui.registry.addButton('indent', {\n tooltip: 'Increase indent',\n icon: 'indent',\n onAction: function () {\n return editor.execCommand('indent');\n }\n });\n };\n var register$9 = function (editor) {\n registerButtons$2(editor);\n };\n\n var register$a = function (editor, backstage) {\n alignSelectMenu(editor, backstage);\n fontSelectMenu(editor, backstage);\n styleSelectMenu(editor, backstage);\n formatSelectMenu(editor, backstage);\n fontsizeSelectMenu(editor, backstage);\n };\n\n var setup$8 = function (editor, backstage) {\n register$5(editor);\n register$6(editor);\n register$a(editor, backstage);\n register$7(editor);\n register$1(editor);\n register$8(editor);\n register$9(editor);\n };\n\n var nu$d = function (x, y) {\n return {\n anchor: 'makeshift',\n x: x,\n y: y\n };\n };\n var transpose$1 = function (pos, dx, dy) {\n return nu$d(pos.x + dx, pos.y + dy);\n };\n var isTouchEvent$1 = function (e) {\n return e.type === 'longpress' || e.type.indexOf('touch') === 0;\n };\n var fromPageXY = function (e) {\n if (isTouchEvent$1(e)) {\n var touch = e.touches[0];\n return nu$d(touch.pageX, touch.pageY);\n } else {\n return nu$d(e.pageX, e.pageY);\n }\n };\n var fromClientXY = function (e) {\n if (isTouchEvent$1(e)) {\n var touch = e.touches[0];\n return nu$d(touch.clientX, touch.clientY);\n } else {\n return nu$d(e.clientX, e.clientY);\n }\n };\n var transposeContentAreaContainer = function (element, pos) {\n var containerPos = global$5.DOM.getPos(element);\n return transpose$1(pos, containerPos.x, containerPos.y);\n };\n var getPointAnchor = function (editor, e) {\n if (e.type === 'contextmenu' || e.type === 'longpress') {\n if (editor.inline) {\n return fromPageXY(e);\n } else {\n return transposeContentAreaContainer(editor.getContentAreaContainer(), fromClientXY(e));\n }\n } else {\n return getSelectionAnchor(editor);\n }\n };\n var getSelectionAnchor = function (editor) {\n return {\n anchor: 'selection',\n root: Element.fromDom(editor.selection.getNode())\n };\n };\n var getNodeAnchor$1 = function (editor) {\n return {\n anchor: 'node',\n node: Option.some(Element.fromDom(editor.selection.getNode())),\n root: Element.fromDom(editor.getBody())\n };\n };\n\n var getAnchorSpec = function (editor, e, isTriggeredByKeyboardEvent) {\n return isTriggeredByKeyboardEvent ? getNodeAnchor$1(editor) : getPointAnchor(editor, e);\n };\n var initAndShow = function (editor, e, buildMenu, backstage, contextmenu, isTriggeredByKeyboardEvent) {\n var items = buildMenu();\n var anchorSpec = getAnchorSpec(editor, e, isTriggeredByKeyboardEvent);\n build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, false).map(function (menuData) {\n e.preventDefault();\n InlineView.showMenuAt(contextmenu, anchorSpec, {\n menu: { markers: markers$1('normal') },\n data: menuData\n });\n });\n };\n\n var layouts = {\n onLtr: function () {\n return [\n south$1,\n southeast$1,\n southwest$1,\n northeast$1,\n northwest$1,\n north$1,\n north$3,\n south$3,\n northeast$3,\n southeast$3,\n northwest$3,\n southwest$3\n ];\n },\n onRtl: function () {\n return [\n south$1,\n southwest$1,\n southeast$1,\n northwest$1,\n northeast$1,\n north$1,\n north$3,\n south$3,\n northwest$3,\n southwest$3,\n northeast$3,\n southeast$3\n ];\n }\n };\n var bubbleSize$1 = 12;\n var bubbleAlignments$2 = {\n valignCentre: [],\n alignCentre: [],\n alignLeft: ['tox-pop--align-left'],\n alignRight: ['tox-pop--align-right'],\n right: ['tox-pop--right'],\n left: ['tox-pop--left'],\n bottom: ['tox-pop--bottom'],\n top: ['tox-pop--top']\n };\n var isTouchWithinSelection = function (editor, e) {\n var selection = editor.selection;\n if (selection.isCollapsed() || e.touches.length < 1) {\n return false;\n } else {\n var touch_1 = e.touches[0];\n var rng = selection.getRng();\n var rngRectOpt = getFirstRect$1(editor.getWin(), Selection.domRange(rng));\n return rngRectOpt.exists(function (rngRect) {\n return rngRect.left() <= touch_1.clientX && rngRect.right() >= touch_1.clientX && rngRect.top() <= touch_1.clientY && rngRect.bottom() >= touch_1.clientY;\n });\n }\n };\n var getAnchorSpec$1 = function (editor, isTriggeredByKeyboardEvent, e) {\n var anchorSpec = isTriggeredByKeyboardEvent ? getNodeAnchor$1(editor) : getPointAnchor(editor, e);\n return __assign({\n bubble: nu$8(0, bubbleSize$1, bubbleAlignments$2),\n layouts: layouts,\n overrides: {\n maxWidthFunction: expandable$1(),\n maxHeightFunction: expandable()\n }\n }, anchorSpec);\n };\n var setupiOSOverrides = function (editor) {\n var originalSelection = editor.selection.getRng();\n var selectionReset = function () {\n global$2.setEditorTimeout(editor, function () {\n editor.selection.setRng(originalSelection);\n }, 10);\n unbindEventListeners();\n };\n editor.once('touchend', selectionReset);\n var preventMousedown = function (e) {\n e.preventDefault();\n e.stopImmediatePropagation();\n };\n editor.on('mousedown', preventMousedown, true);\n var clearSelectionReset = function () {\n return unbindEventListeners();\n };\n editor.once('longpresscancel', clearSelectionReset);\n var unbindEventListeners = function () {\n editor.off('touchend', selectionReset);\n editor.off('longpresscancel', clearSelectionReset);\n editor.off('mousedown', preventMousedown);\n };\n };\n var show = function (editor, e, items, backstage, contextmenu, isTriggeredByKeyboardEvent, highlightImmediately) {\n var anchorSpec = getAnchorSpec$1(editor, isTriggeredByKeyboardEvent, e);\n build$2(items, ItemResponse$1.CLOSE_ON_EXECUTE, backstage, true).map(function (menuData) {\n e.preventDefault();\n InlineView.showMenuWithinBounds(contextmenu, anchorSpec, {\n menu: {\n markers: markers$1('normal'),\n highlightImmediately: highlightImmediately\n },\n data: menuData,\n type: 'horizontal'\n }, function () {\n return Option.some(getContextToolbarBounds(editor, backstage.shared));\n });\n editor.fire(hideContextToolbarEvent);\n });\n };\n var initAndShow$1 = function (editor, e, buildMenu, backstage, contextmenu, isTriggeredByKeyboardEvent) {\n var detection = detect$3();\n var isiOS = detection.os.isiOS();\n var isOSX = detection.os.isOSX();\n var isAndroid = detection.os.isAndroid();\n var isTouch = detection.deviceType.isTouch();\n var shouldHighlightImmediately = function () {\n return !(isAndroid || isiOS || isOSX && isTouch);\n };\n var open = function () {\n var items = buildMenu();\n show(editor, e, items, backstage, contextmenu, isTriggeredByKeyboardEvent, shouldHighlightImmediately());\n };\n if ((isOSX || isiOS) && !isTriggeredByKeyboardEvent) {\n var openiOS_1 = function () {\n setupiOSOverrides(editor);\n open();\n };\n if (isTouchWithinSelection(editor, e)) {\n openiOS_1();\n } else {\n editor.once('selectionchange', openiOS_1);\n editor.once('touchend', function () {\n return editor.off('selectionchange', openiOS_1);\n });\n }\n } else {\n if (isAndroid && !isTriggeredByKeyboardEvent) {\n editor.selection.setCursorLocation(e.target, 0);\n }\n open();\n }\n };\n\n var patchPipeConfig = function (config) {\n return typeof config === 'string' ? config.split(/[ ,]/) : config;\n };\n var shouldNeverUseNative = function (editor) {\n return editor.getParam('contextmenu_never_use_native', false, 'boolean');\n };\n var getMenuItems = function (editor, name, defaultItems) {\n var contextMenus = editor.ui.registry.getAll().contextMenus;\n return Option.from(editor.getParam(name)).map(patchPipeConfig).getOrThunk(function () {\n return filter(patchPipeConfig(defaultItems), function (item) {\n return has(contextMenus, item);\n });\n });\n };\n var isContextMenuDisabled = function (editor) {\n return editor.getParam('contextmenu') === false;\n };\n var getContextMenu = function (editor) {\n return getMenuItems(editor, 'contextmenu', 'link linkchecker image imagetools table spellchecker configurepermanentpen');\n };\n\n var isSeparator$1 = function (item) {\n return isString(item) ? item === '|' : item.type === 'separator';\n };\n var separator$3 = { type: 'separator' };\n var makeContextItem = function (item) {\n if (isString(item)) {\n return item;\n } else {\n switch (item.type) {\n case 'separator':\n return separator$3;\n case 'submenu':\n return {\n type: 'nestedmenuitem',\n text: item.text,\n icon: item.icon,\n getSubmenuItems: function () {\n var items = item.getSubmenuItems();\n if (isString(items)) {\n return items;\n } else {\n return map(items, makeContextItem);\n }\n }\n };\n default:\n return {\n type: 'menuitem',\n text: item.text,\n icon: item.icon,\n onAction: noarg(item.onAction)\n };\n }\n }\n };\n var addContextMenuGroup = function (xs, groupItems) {\n if (groupItems.length === 0) {\n return xs;\n }\n var lastMenuItem = last(xs).filter(function (item) {\n return !isSeparator$1(item);\n });\n var before = lastMenuItem.fold(function () {\n return [];\n }, function (_) {\n return [separator$3];\n });\n return xs.concat(before).concat(groupItems).concat([separator$3]);\n };\n var generateContextMenu = function (contextMenus, menuConfig, selectedElement) {\n var sections = foldl(menuConfig, function (acc, name) {\n if (has(contextMenus, name)) {\n var items = contextMenus[name].update(selectedElement);\n if (isString(items)) {\n return addContextMenuGroup(acc, items.split(' '));\n } else if (items.length > 0) {\n var allItems = map(items, makeContextItem);\n return addContextMenuGroup(acc, allItems);\n } else {\n return acc;\n }\n } else {\n return acc.concat([name]);\n }\n }, []);\n if (sections.length > 0 && isSeparator$1(sections[sections.length - 1])) {\n sections.pop();\n }\n return sections;\n };\n var isNativeOverrideKeyEvent = function (editor, e) {\n return e.ctrlKey && !shouldNeverUseNative(editor);\n };\n var isTriggeredByKeyboard = function (editor, e) {\n return e.type !== 'longpress' && (e.button !== 2 || e.target === editor.getBody() && e.pointerType === '');\n };\n var setup$9 = function (editor, lazySink, backstage) {\n var detection = detect$3();\n var isTouch = detection.deviceType.isTouch;\n var contextmenu = build$1(InlineView.sketch({\n dom: { tag: 'div' },\n lazySink: lazySink,\n onEscape: function () {\n return editor.focus();\n },\n onShow: function () {\n return backstage.setContextMenuState(true);\n },\n onHide: function () {\n return backstage.setContextMenuState(false);\n },\n fireDismissalEventInstead: {},\n inlineBehaviours: derive$1([config('dismissContextMenu', [run(dismissRequested(), function (comp, _se) {\n Sandboxing.close(comp);\n editor.focus();\n })])])\n }));\n var hideContextMenu = function (_e) {\n return InlineView.hide(contextmenu);\n };\n var showContextMenu = function (e) {\n if (shouldNeverUseNative(editor)) {\n e.preventDefault();\n }\n if (isNativeOverrideKeyEvent(editor, e) || isContextMenuDisabled(editor)) {\n return;\n }\n var isTriggeredByKeyboardEvent = isTriggeredByKeyboard(editor, e);\n var buildMenu = function () {\n var selectedElement = isTriggeredByKeyboardEvent ? editor.selection.getStart(true) : e.target;\n var registry = editor.ui.registry.getAll();\n var menuConfig = getContextMenu(editor);\n return generateContextMenu(registry.contextMenus, menuConfig, selectedElement);\n };\n var initAndShow$2 = isTouch() ? initAndShow$1 : initAndShow;\n initAndShow$2(editor, e, buildMenu, backstage, contextmenu, isTriggeredByKeyboardEvent);\n };\n editor.on('init', function () {\n var hideEvents = 'ResizeEditor ScrollContent ScrollWindow longpresscancel' + (isTouch() ? '' : ' ResizeWindow');\n editor.on(hideEvents, hideContextMenu);\n editor.on('longpress contextmenu', showContextMenu);\n });\n };\n\n var adt$c = Adt.generate([\n {\n offset: [\n 'x',\n 'y'\n ]\n },\n {\n absolute: [\n 'x',\n 'y'\n ]\n },\n {\n fixed: [\n 'x',\n 'y'\n ]\n }\n ]);\n var subtract = function (change) {\n return function (point) {\n return point.translate(-change.left(), -change.top());\n };\n };\n var add$4 = function (change) {\n return function (point) {\n return point.translate(change.left(), change.top());\n };\n };\n var transform$1 = function (changes) {\n return function (x, y) {\n return foldl(changes, function (rest, f) {\n return f(rest);\n }, Position(x, y));\n };\n };\n var asFixed = function (coord, scroll, origin) {\n return coord.fold(transform$1([\n add$4(origin),\n subtract(scroll)\n ]), transform$1([subtract(scroll)]), transform$1([]));\n };\n var asAbsolute = function (coord, scroll, origin) {\n return coord.fold(transform$1([add$4(origin)]), transform$1([]), transform$1([add$4(scroll)]));\n };\n var asOffset = function (coord, scroll, origin) {\n return coord.fold(transform$1([]), transform$1([subtract(origin)]), transform$1([\n add$4(scroll),\n subtract(origin)\n ]));\n };\n var withinRange = function (coord1, coord2, xRange, yRange, scroll, origin) {\n var a1 = asAbsolute(coord1, scroll, origin);\n var a2 = asAbsolute(coord2, scroll, origin);\n return Math.abs(a1.left() - a2.left()) <= xRange && Math.abs(a1.top() - a2.top()) <= yRange;\n };\n var getDeltas = function (coord1, coord2, xRange, yRange, scroll, origin) {\n var a1 = asAbsolute(coord1, scroll, origin);\n var a2 = asAbsolute(coord2, scroll, origin);\n var left = Math.abs(a1.left() - a2.left());\n var top = Math.abs(a1.top() - a2.top());\n return Position(left, top);\n };\n var toStyles = function (coord, scroll, origin) {\n var stylesOpt = coord.fold(function (x, y) {\n return {\n position: Option.some('absolute'),\n left: Option.some(x + 'px'),\n top: Option.some(y + 'px')\n };\n }, function (x, y) {\n return {\n position: Option.some('absolute'),\n left: Option.some(x - origin.left() + 'px'),\n top: Option.some(y - origin.top() + 'px')\n };\n }, function (x, y) {\n return {\n position: Option.some('fixed'),\n left: Option.some(x + 'px'),\n top: Option.some(y + 'px')\n };\n });\n return __assign({\n right: Option.none(),\n bottom: Option.none()\n }, stylesOpt);\n };\n var translate$2 = function (coord, deltaX, deltaY) {\n return coord.fold(function (x, y) {\n return offset(x + deltaX, y + deltaY);\n }, function (x, y) {\n return absolute$3(x + deltaX, y + deltaY);\n }, function (x, y) {\n return fixed$1(x + deltaX, y + deltaY);\n });\n };\n var absorb = function (partialCoord, originalCoord, scroll, origin) {\n var absorbOne = function (stencil, nu) {\n return function (optX, optY) {\n var original = stencil(originalCoord, scroll, origin);\n return nu(optX.getOr(original.left()), optY.getOr(original.top()));\n };\n };\n return partialCoord.fold(absorbOne(asOffset, offset), absorbOne(asAbsolute, absolute$3), absorbOne(asFixed, fixed$1));\n };\n var offset = adt$c.offset;\n var absolute$3 = adt$c.absolute;\n var fixed$1 = adt$c.fixed;\n\n var parseAttrToInt = function (element, name) {\n var value = get$2(element, name);\n return isUndefined(value) ? NaN : parseInt(value, 10);\n };\n var get$e = function (component, snapsInfo) {\n var element = component.element();\n var x = parseAttrToInt(element, snapsInfo.leftAttr);\n var y = parseAttrToInt(element, snapsInfo.topAttr);\n return isNaN(x) || isNaN(y) ? Option.none() : Option.some(Position(x, y));\n };\n var set$8 = function (component, snapsInfo, pt) {\n var element = component.element();\n set$1(element, snapsInfo.leftAttr, pt.left() + 'px');\n set$1(element, snapsInfo.topAttr, pt.top() + 'px');\n };\n var clear = function (component, snapsInfo) {\n var element = component.element();\n remove$1(element, snapsInfo.leftAttr);\n remove$1(element, snapsInfo.topAttr);\n };\n\n var getCoords = function (component, snapInfo, coord, delta) {\n return get$e(component, snapInfo).fold(function () {\n return coord;\n }, function (fixed) {\n return fixed$1(fixed.left() + delta.left(), fixed.top() + delta.top());\n });\n };\n var moveOrSnap = function (component, snapInfo, coord, delta, scroll, origin) {\n var newCoord = getCoords(component, snapInfo, coord, delta);\n var snap = snapInfo.mustSnap ? findClosestSnap(component, snapInfo, newCoord, scroll, origin) : findSnap(component, snapInfo, newCoord, scroll, origin);\n var fixedCoord = asFixed(newCoord, scroll, origin);\n set$8(component, snapInfo, fixedCoord);\n return snap.fold(function () {\n return {\n coord: fixed$1(fixedCoord.left(), fixedCoord.top()),\n extra: Option.none()\n };\n }, function (spanned) {\n return {\n coord: spanned.output,\n extra: spanned.extra\n };\n });\n };\n var stopDrag = function (component, snapInfo) {\n clear(component, snapInfo);\n };\n var findMatchingSnap = function (snaps, newCoord, scroll, origin) {\n return findMap(snaps, function (snap) {\n var sensor = snap.sensor;\n var inRange = withinRange(newCoord, sensor, snap.range.left(), snap.range.top(), scroll, origin);\n return inRange ? Option.some({\n output: absorb(snap.output, newCoord, scroll, origin),\n extra: snap.extra\n }) : Option.none();\n });\n };\n var findClosestSnap = function (component, snapInfo, newCoord, scroll, origin) {\n var snaps = snapInfo.getSnapPoints(component);\n var matchSnap = findMatchingSnap(snaps, newCoord, scroll, origin);\n return matchSnap.orThunk(function () {\n var bestSnap = foldl(snaps, function (acc, snap) {\n var sensor = snap.sensor;\n var deltas = getDeltas(newCoord, sensor, snap.range.left(), snap.range.top(), scroll, origin);\n return acc.deltas.fold(function () {\n return {\n deltas: Option.some(deltas),\n snap: Option.some(snap)\n };\n }, function (bestDeltas) {\n var currAvg = (deltas.left() + deltas.top()) / 2;\n var bestAvg = (bestDeltas.left() + bestDeltas.top()) / 2;\n if (currAvg <= bestAvg) {\n return {\n deltas: Option.some(deltas),\n snap: Option.some(snap)\n };\n } else {\n return acc;\n }\n });\n }, {\n deltas: Option.none(),\n snap: Option.none()\n });\n return bestSnap.snap.map(function (snap) {\n return {\n output: absorb(snap.output, newCoord, scroll, origin),\n extra: snap.extra\n };\n });\n });\n };\n var findSnap = function (component, snapInfo, newCoord, scroll, origin) {\n var snaps = snapInfo.getSnapPoints(component);\n return findMatchingSnap(snaps, newCoord, scroll, origin);\n };\n var snapTo = function (snap, scroll, origin) {\n return {\n coord: absorb(snap.output, snap.output, scroll, origin),\n extra: snap.extra\n };\n };\n\n var snapTo$1 = function (component, dragConfig, _state, snap) {\n var target = dragConfig.getTarget(component.element());\n if (dragConfig.repositionTarget) {\n var doc = owner(component.element());\n var scroll = get$8(doc);\n var origin = getOrigin(target);\n var snapPin = snapTo(snap, scroll, origin);\n var styles = toStyles(snapPin.coord, scroll, origin);\n setOptions(target, styles);\n }\n };\n\n var DraggingApis = /*#__PURE__*/Object.freeze({\n __proto__: null,\n snapTo: snapTo$1\n });\n\n var initialAttribute = 'data-initial-z-index';\n var resetZIndex = function (blocker) {\n parent(blocker.element()).filter(isElement).each(function (root) {\n getOpt(root, initialAttribute).fold(function () {\n return remove$6(root, 'z-index');\n }, function (zIndex) {\n return set$2(root, 'z-index', zIndex);\n });\n remove$1(root, initialAttribute);\n });\n };\n var changeZIndex = function (blocker) {\n parent(blocker.element()).filter(isElement).each(function (root) {\n getRaw(root, 'z-index').each(function (zindex) {\n set$1(root, initialAttribute, zindex);\n });\n set$2(root, 'z-index', get$4(blocker.element(), 'z-index'));\n });\n };\n var instigate = function (anyComponent, blocker) {\n anyComponent.getSystem().addToGui(blocker);\n changeZIndex(blocker);\n };\n var discard = function (blocker) {\n resetZIndex(blocker);\n blocker.getSystem().removeFromGui(blocker);\n };\n var createComponent = function (component, blockerClass, blockerEvents) {\n return component.getSystem().build(Container.sketch({\n dom: {\n styles: {\n 'left': '0px',\n 'top': '0px',\n 'width': '100%',\n 'height': '100%',\n 'position': 'fixed',\n 'z-index': '1000000000000000'\n },\n classes: [blockerClass]\n },\n events: blockerEvents\n }));\n };\n\n var SnapSchema = optionObjOf('snaps', [\n strict$1('getSnapPoints'),\n onHandler('onSensor'),\n strict$1('leftAttr'),\n strict$1('topAttr'),\n defaulted$1('lazyViewport', win),\n defaulted$1('mustSnap', false)\n ]);\n\n var schema$t = [\n defaulted$1('useFixed', never),\n strict$1('blockerClass'),\n defaulted$1('getTarget', identity),\n defaulted$1('onDrag', noop),\n defaulted$1('repositionTarget', true),\n defaulted$1('onDrop', noop),\n defaultedFunction('getBounds', win),\n SnapSchema\n ];\n\n var getCurrentCoord = function (target) {\n return lift3(getRaw(target, 'left'), getRaw(target, 'top'), getRaw(target, 'position'), function (left, top, position) {\n var nu = position === 'fixed' ? fixed$1 : offset;\n return nu(parseInt(left, 10), parseInt(top, 10));\n }).getOrThunk(function () {\n var location = absolute(target);\n return absolute$3(location.left(), location.top());\n });\n };\n var clampCoords = function (component, coords, scroll, origin, startData) {\n var bounds = startData.bounds;\n var absoluteCoord = asAbsolute(coords, scroll, origin);\n var newX = clamp(absoluteCoord.left(), bounds.x, bounds.x + bounds.width - startData.width);\n var newY = clamp(absoluteCoord.top(), bounds.y, bounds.y + bounds.height - startData.height);\n var newCoords = absolute$3(newX, newY);\n return coords.fold(function () {\n var offset$1 = asOffset(newCoords, scroll, origin);\n return offset(offset$1.left(), offset$1.top());\n }, function () {\n return newCoords;\n }, function () {\n var fixed = asFixed(newCoords, scroll, origin);\n return fixed$1(fixed.left(), fixed.top());\n });\n };\n var calcNewCoord = function (component, optSnaps, currentCoord, scroll, origin, delta, startData) {\n var newCoord = optSnaps.fold(function () {\n var translated = translate$2(currentCoord, delta.left(), delta.top());\n var fixedCoord = asFixed(translated, scroll, origin);\n return fixed$1(fixedCoord.left(), fixedCoord.top());\n }, function (snapInfo) {\n var snapping = moveOrSnap(component, snapInfo, currentCoord, delta, scroll, origin);\n snapping.extra.each(function (extra) {\n snapInfo.onSensor(component, extra);\n });\n return snapping.coord;\n });\n return clampCoords(component, newCoord, scroll, origin, startData);\n };\n var dragBy = function (component, dragConfig, startData, delta) {\n var target = dragConfig.getTarget(component.element());\n if (dragConfig.repositionTarget) {\n var doc = owner(component.element());\n var scroll = get$8(doc);\n var origin = getOrigin(target);\n var currentCoord = getCurrentCoord(target);\n var newCoord = calcNewCoord(component, dragConfig.snaps, currentCoord, scroll, origin, delta, startData);\n var styles = toStyles(newCoord, scroll, origin);\n setOptions(target, styles);\n }\n dragConfig.onDrag(component, target, delta);\n };\n\n var calcStartData = function (dragConfig, comp) {\n return {\n bounds: dragConfig.getBounds(),\n height: getOuter$1(comp.element()),\n width: getOuter$2(comp.element())\n };\n };\n var move$1 = function (component, dragConfig, dragState, dragMode, event) {\n var delta = dragState.update(dragMode, event);\n var dragStartData = dragState.getStartData().getOrThunk(function () {\n return calcStartData(dragConfig, component);\n });\n delta.each(function (dlt) {\n dragBy(component, dragConfig, dragStartData, dlt);\n });\n };\n var stop = function (component, blocker, dragConfig, dragState) {\n blocker.each(discard);\n dragConfig.snaps.each(function (snapInfo) {\n stopDrag(component, snapInfo);\n });\n var target = dragConfig.getTarget(component.element());\n dragState.reset();\n dragConfig.onDrop(component, target);\n };\n var handlers = function (events) {\n return function (dragConfig, dragState) {\n var updateStartState = function (comp) {\n dragState.setStartData(calcStartData(dragConfig, comp));\n };\n return derive(__spreadArrays([run(windowScroll(), function (comp) {\n dragState.getStartData().each(function () {\n return updateStartState(comp);\n });\n })], events(dragConfig, dragState, updateStartState)));\n };\n };\n\n var init$c = function (dragApi) {\n return derive([\n run(mousedown(), dragApi.forceDrop),\n run(mouseup(), dragApi.drop),\n run(mousemove(), function (comp, simulatedEvent) {\n dragApi.move(simulatedEvent.event());\n }),\n run(mouseout(), dragApi.delayDrop)\n ]);\n };\n\n var getData$1 = function (event) {\n return Option.from(Position(event.x(), event.y()));\n };\n var getDelta$1 = function (old, nu) {\n return Position(nu.left() - old.left(), nu.top() - old.top());\n };\n\n var MouseData = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getData: getData$1,\n getDelta: getDelta$1\n });\n\n var events$g = function (dragConfig, dragState, updateStartState) {\n return [run(mousedown(), function (component, simulatedEvent) {\n var raw = simulatedEvent.event().raw();\n if (raw.button !== 0) {\n return;\n }\n simulatedEvent.stop();\n var stop$1 = function () {\n return stop(component, Option.some(blocker), dragConfig, dragState);\n };\n var delayDrop = DelayedFunction(stop$1, 200);\n var dragApi = {\n drop: stop$1,\n delayDrop: delayDrop.schedule,\n forceDrop: stop$1,\n move: function (event) {\n delayDrop.cancel();\n move$1(component, dragConfig, dragState, MouseData, event);\n }\n };\n var blocker = createComponent(component, dragConfig.blockerClass, init$c(dragApi));\n var start = function () {\n updateStartState(component);\n instigate(component, blocker);\n };\n start();\n })];\n };\n var schema$u = __spreadArrays(schema$t, [output('dragger', { handlers: handlers(events$g) })]);\n\n var init$d = function (dragApi) {\n return derive([\n run(touchstart(), dragApi.forceDrop),\n run(touchend(), dragApi.drop),\n run(touchcancel(), dragApi.drop),\n run(touchmove(), function (comp, simulatedEvent) {\n dragApi.move(simulatedEvent.event());\n })\n ]);\n };\n\n var getDataFrom = function (touches) {\n var touch = touches[0];\n return Option.some(Position(touch.clientX, touch.clientY));\n };\n var getData$2 = function (event) {\n var raw = event.raw();\n var touches = raw.touches;\n return touches.length === 1 ? getDataFrom(touches) : Option.none();\n };\n var getDelta$2 = function (old, nu) {\n return Position(nu.left() - old.left(), nu.top() - old.top());\n };\n\n var TouchData = /*#__PURE__*/Object.freeze({\n __proto__: null,\n getData: getData$2,\n getDelta: getDelta$2\n });\n\n var events$h = function (dragConfig, dragState, updateStartState) {\n var blockerCell = Cell(Option.none());\n return [\n run(touchstart(), function (component, simulatedEvent) {\n simulatedEvent.stop();\n var stop$1 = function () {\n stop(component, blockerCell.get(), dragConfig, dragState);\n blockerCell.set(Option.none());\n };\n var dragApi = {\n drop: stop$1,\n delayDrop: function () {\n },\n forceDrop: stop$1,\n move: function (event) {\n move$1(component, dragConfig, dragState, TouchData, event);\n }\n };\n var blocker = createComponent(component, dragConfig.blockerClass, init$d(dragApi));\n blockerCell.set(Option.some(blocker));\n var start = function () {\n updateStartState(component);\n instigate(component, blocker);\n };\n start();\n }),\n run(touchmove(), function (component, simulatedEvent) {\n simulatedEvent.stop();\n move$1(component, dragConfig, dragState, TouchData, simulatedEvent.event());\n }),\n run(touchend(), function (component, simulatedEvent) {\n simulatedEvent.stop();\n stop(component, blockerCell.get(), dragConfig, dragState);\n blockerCell.set(Option.none());\n }),\n run(touchcancel(), function (component) {\n stop(component, blockerCell.get(), dragConfig, dragState);\n blockerCell.set(Option.none());\n })\n ];\n };\n var schema$v = __spreadArrays(schema$t, [output('dragger', { handlers: handlers(events$h) })]);\n\n var events$i = function (dragConfig, dragState, updateStartState) {\n return __spreadArrays(events$g(dragConfig, dragState, updateStartState), events$h(dragConfig, dragState, updateStartState));\n };\n var schema$w = __spreadArrays(schema$t, [output('dragger', { handlers: handlers(events$i) })]);\n\n var mouse = schema$u;\n var touch = schema$v;\n var mouseOrTouch = schema$w;\n\n var DraggingBranches = /*#__PURE__*/Object.freeze({\n __proto__: null,\n mouse: mouse,\n touch: touch,\n mouseOrTouch: mouseOrTouch\n });\n\n var init$e = function () {\n var previous = Option.none();\n var startData = Option.none();\n var reset = function () {\n previous = Option.none();\n startData = Option.none();\n };\n var calculateDelta = function (mode, nu) {\n var result = previous.map(function (old) {\n return mode.getDelta(old, nu);\n });\n previous = Option.some(nu);\n return result;\n };\n var update = function (mode, dragEvent) {\n return mode.getData(dragEvent).bind(function (nuData) {\n return calculateDelta(mode, nuData);\n });\n };\n var setStartData = function (data) {\n startData = Option.some(data);\n };\n var getStartData = function () {\n return startData;\n };\n var readState = constant({});\n return nu$5({\n readState: readState,\n reset: reset,\n update: update,\n getStartData: getStartData,\n setStartData: setStartData\n });\n };\n\n var DragState = /*#__PURE__*/Object.freeze({\n __proto__: null,\n init: init$e\n });\n\n var Dragging = createModes$1({\n branchKey: 'mode',\n branches: DraggingBranches,\n name: 'dragging',\n active: {\n events: function (dragConfig, dragState) {\n var dragger = dragConfig.dragger;\n return dragger.handlers(dragConfig, dragState);\n }\n },\n extra: {\n snap: function (sConfig) {\n return {\n sensor: sConfig.sensor,\n range: sConfig.range,\n output: sConfig.output,\n extra: Option.from(sConfig.extra)\n };\n }\n },\n state: DragState,\n apis: DraggingApis\n });\n\n var snapWidth = 40;\n var snapOffset = snapWidth / 2;\n var calcSnap = function (selectorOpt, td, x, y, width, height) {\n return selectorOpt.fold(function () {\n return Dragging.snap({\n sensor: absolute$3(x - snapOffset, y - snapOffset),\n range: Position(width, height),\n output: absolute$3(Option.some(x), Option.some(y)),\n extra: { td: td }\n });\n }, function (selectorHandle) {\n var sensorLeft = x - snapOffset;\n var sensorTop = y - snapOffset;\n var sensorWidth = snapWidth;\n var sensorHeight = snapWidth;\n var rect = selectorHandle.element().dom().getBoundingClientRect();\n return Dragging.snap({\n sensor: absolute$3(sensorLeft, sensorTop),\n range: Position(sensorWidth, sensorHeight),\n output: absolute$3(Option.some(x - rect.width / 2), Option.some(y - rect.height / 2)),\n extra: { td: td }\n });\n });\n };\n var getSnapsConfig = function (getSnapPoints, cell, onChange) {\n var isSameCell = function (cellOpt, td) {\n return cellOpt.exists(function (currentTd) {\n return eq$1(currentTd, td);\n });\n };\n return {\n getSnapPoints: getSnapPoints,\n leftAttr: 'data-drag-left',\n topAttr: 'data-drag-top',\n onSensor: function (component, extra) {\n var td = extra.td;\n if (!isSameCell(cell.get(), td)) {\n cell.set(Option.some(td));\n onChange(td);\n }\n },\n mustSnap: true\n };\n };\n var createSelector = function (snaps) {\n return record(Button.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-selector']\n },\n buttonBehaviours: derive$1([\n Dragging.config({\n mode: 'mouseOrTouch',\n blockerClass: 'blocker',\n snaps: snaps\n }),\n Unselecting.config({})\n ]),\n eventOrder: {\n mousedown: [\n 'dragging',\n 'alloy.base.behaviour'\n ],\n touchstart: [\n 'dragging',\n 'alloy.base.behaviour'\n ]\n }\n }));\n };\n var setup$a = function (editor, sink) {\n var tlTds = Cell([]);\n var brTds = Cell([]);\n var isVisible = Cell(false);\n var startCell = Cell(Option.none());\n var finishCell = Cell(Option.none());\n var getTopLeftSnap = function (td) {\n var box = absolute$1(td);\n return calcSnap(memTopLeft.getOpt(sink), td, box.x, box.y, box.width, box.height);\n };\n var getTopLeftSnaps = function () {\n return map(tlTds.get(), function (td) {\n return getTopLeftSnap(td);\n });\n };\n var getBottomRightSnap = function (td) {\n var box = absolute$1(td);\n return calcSnap(memBottomRight.getOpt(sink), td, box.right, box.bottom, box.width, box.height);\n };\n var getBottomRightSnaps = function () {\n return map(brTds.get(), function (td) {\n return getBottomRightSnap(td);\n });\n };\n var topLeftSnaps = getSnapsConfig(getTopLeftSnaps, startCell, function (start) {\n finishCell.get().each(function (finish) {\n editor.fire('TableSelectorChange', {\n start: start,\n finish: finish\n });\n });\n });\n var bottomRightSnaps = getSnapsConfig(getBottomRightSnaps, finishCell, function (finish) {\n startCell.get().each(function (start) {\n editor.fire('TableSelectorChange', {\n start: start,\n finish: finish\n });\n });\n });\n var memTopLeft = createSelector(topLeftSnaps);\n var memBottomRight = createSelector(bottomRightSnaps);\n var topLeft = build$1(memTopLeft.asSpec());\n var bottomRight = build$1(memBottomRight.asSpec());\n var showOrHideHandle = function (selector, cell, isAbove, isBelow) {\n var cellRect = cell.dom().getBoundingClientRect();\n remove$6(selector.element(), 'display');\n var viewportHeight = defaultView(Element.fromDom(editor.getBody())).dom().innerHeight;\n var aboveViewport = isAbove(cellRect);\n var belowViewport = isBelow(cellRect, viewportHeight);\n if (aboveViewport || belowViewport) {\n set$2(selector.element(), 'display', 'none');\n }\n };\n var snapTo = function (selector, cell, getSnapConfig, pos) {\n var snap = getSnapConfig(cell);\n Dragging.snapTo(selector, snap);\n var isAbove = function (rect) {\n return rect[pos] < 0;\n };\n var isBelow = function (rect, viewportHeight) {\n return rect[pos] > viewportHeight;\n };\n showOrHideHandle(selector, cell, isAbove, isBelow);\n };\n var snapTopLeft = function (cell) {\n return snapTo(topLeft, cell, getTopLeftSnap, 'top');\n };\n var snapLastTopLeft = function () {\n return startCell.get().each(snapTopLeft);\n };\n var snapBottomRight = function (cell) {\n return snapTo(bottomRight, cell, getBottomRightSnap, 'bottom');\n };\n var snapLastBottomRight = function () {\n return finishCell.get().each(snapBottomRight);\n };\n if (detect$3().deviceType.isTouch()) {\n editor.on('TableSelectionChange', function (e) {\n if (!isVisible.get()) {\n attach$1(sink, topLeft);\n attach$1(sink, bottomRight);\n isVisible.set(true);\n }\n startCell.set(Option.some(e.start));\n finishCell.set(Option.some(e.finish));\n e.otherCells.each(function (otherCells) {\n tlTds.set(otherCells.upOrLeftCells);\n brTds.set(otherCells.downOrRightCells);\n snapTopLeft(e.start);\n snapBottomRight(e.finish);\n });\n });\n editor.on('ResizeEditor ResizeWindow ScrollContent', function () {\n snapLastTopLeft();\n snapLastBottomRight();\n });\n editor.on('TableSelectionClear', function () {\n if (isVisible.get()) {\n detach(topLeft);\n detach(bottomRight);\n isVisible.set(false);\n }\n startCell.set(Option.none());\n finishCell.set(Option.none());\n });\n }\n };\n\n var ResizeTypes;\n (function (ResizeTypes) {\n ResizeTypes[ResizeTypes['None'] = 0] = 'None';\n ResizeTypes[ResizeTypes['Both'] = 1] = 'Both';\n ResizeTypes[ResizeTypes['Vertical'] = 2] = 'Vertical';\n }(ResizeTypes || (ResizeTypes = {})));\n var getDimensions = function (editor, deltas, resizeType, originalHeight, originalWidth) {\n var dimensions = {};\n dimensions.height = calcCappedSize(originalHeight + deltas.top(), getMinHeightSetting(editor), getMaxHeightSetting(editor));\n if (resizeType === ResizeTypes.Both) {\n dimensions.width = calcCappedSize(originalWidth + deltas.left(), getMinWidthSetting(editor), getMaxWidthSetting(editor));\n }\n return dimensions;\n };\n var resize$3 = function (editor, deltas, resizeType) {\n var container = Element.fromDom(editor.getContainer());\n var dimensions = getDimensions(editor, deltas, resizeType, get$6(container), get$7(container));\n each$1(dimensions, function (val, dim) {\n return set$2(container, dim, numToPx(val));\n });\n fireResizeEditor(editor);\n };\n\n var isHidden$1 = function (elm) {\n if (elm.nodeType === 1) {\n if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {\n return true;\n }\n if (elm.getAttribute('data-mce-type') === 'bookmark') {\n return true;\n }\n }\n return false;\n };\n var renderElementPath = function (editor, settings, providersBackstage) {\n if (!settings.delimiter) {\n settings.delimiter = '\\xBB';\n }\n var getDataPath = function (data) {\n var parts = data || [];\n var newPathElements = map(parts, function (part, index) {\n return Button.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-statusbar__path-item'],\n attributes: {\n 'role': 'button',\n 'data-index': index,\n 'tab-index': -1,\n 'aria-level': index + 1\n },\n innerHtml: part.name\n },\n action: function (_btn) {\n editor.focus();\n editor.selection.select(part.element);\n editor.nodeChanged();\n },\n buttonBehaviours: derive$1([\n DisablingConfigs.button(providersBackstage.isReadOnly),\n receivingConfig()\n ])\n });\n });\n var divider = {\n dom: {\n tag: 'div',\n classes: ['tox-statusbar__path-divider'],\n attributes: { 'aria-hidden': true },\n innerHtml: ' ' + settings.delimiter + ' '\n }\n };\n return foldl(newPathElements.slice(1), function (acc, element) {\n var newAcc = acc;\n newAcc.push(divider);\n newAcc.push(element);\n return newAcc;\n }, [newPathElements[0]]);\n };\n var updatePath = function (parents) {\n var newPath = [];\n var i = parents.length;\n while (i-- > 0) {\n var parent_1 = parents[i];\n if (parent_1.nodeType === 1 && !isHidden$1(parent_1)) {\n var args = editor.fire('ResolveName', {\n name: parent_1.nodeName.toLowerCase(),\n target: parent_1\n });\n if (!args.isDefaultPrevented()) {\n newPath.push({\n name: args.name,\n element: parent_1\n });\n }\n if (args.isPropagationStopped()) {\n break;\n }\n }\n }\n return newPath;\n };\n return {\n dom: {\n tag: 'div',\n classes: ['tox-statusbar__path'],\n attributes: { role: 'navigation' }\n },\n behaviours: derive$1([\n Keying.config({\n mode: 'flow',\n selector: 'div[role=button]'\n }),\n Disabling.config({ disabled: providersBackstage.isReadOnly }),\n receivingConfig(),\n Tabstopping.config({}),\n Replacing.config({}),\n config('elementPathEvents', [runOnAttached(function (comp, _e) {\n editor.shortcuts.add('alt+F11', 'focus statusbar elementpath', function () {\n return Keying.focusIn(comp);\n });\n editor.on('NodeChange', function (e) {\n var newPath = updatePath(e.parents);\n if (newPath.length > 0) {\n Replacing.set(comp, getDataPath(newPath));\n } else {\n Replacing.set(comp, []);\n }\n });\n })])\n ]),\n components: []\n };\n };\n\n var renderWordCount = function (editor, providersBackstage) {\n var replaceCountText = function (comp, count, mode) {\n return Replacing.set(comp, [text(providersBackstage.translate([\n '{0} ' + mode,\n count[mode]\n ]))]);\n };\n return Button.sketch({\n dom: {\n tag: 'button',\n classes: ['tox-statusbar__wordcount']\n },\n components: [],\n buttonBehaviours: derive$1([\n DisablingConfigs.button(providersBackstage.isReadOnly),\n receivingConfig(),\n Tabstopping.config({}),\n Replacing.config({}),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: {\n mode: 'words',\n count: {\n words: 0,\n characters: 0\n }\n }\n }\n }),\n config('wordcount-events', [\n runOnExecute(function (comp) {\n var currentVal = Representing.getValue(comp);\n var newMode = currentVal.mode === 'words' ? 'characters' : 'words';\n Representing.setValue(comp, {\n mode: newMode,\n count: currentVal.count\n });\n replaceCountText(comp, currentVal.count, newMode);\n }),\n runOnAttached(function (comp) {\n editor.on('wordCountUpdate', function (e) {\n var mode = Representing.getValue(comp).mode;\n Representing.setValue(comp, {\n mode: mode,\n count: e.wordCount\n });\n replaceCountText(comp, e.wordCount, mode);\n });\n })\n ])\n ]),\n eventOrder: {\n 'alloy.execute': [\n 'disabling',\n 'alloy.base.behaviour',\n 'wordcount-events'\n ]\n }\n });\n };\n\n var renderStatusbar = function (editor, providersBackstage) {\n var renderResizeHandlerIcon = function (resizeType) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-statusbar__resize-handle'],\n attributes: {\n 'title': providersBackstage.translate('Resize'),\n 'aria-hidden': 'true'\n },\n innerHtml: get$d('resize-handle', providersBackstage.icons)\n },\n behaviours: derive$1([Dragging.config({\n mode: 'mouse',\n repositionTarget: false,\n onDrag: function (comp, target, delta) {\n resize$3(editor, delta, resizeType);\n },\n blockerClass: 'tox-blocker'\n })])\n };\n };\n var renderBranding = function () {\n var label = global$6.translate([\n 'Powered by {0}',\n 'Tiny'\n ]);\n var linkHtml = '' + label + '';\n return {\n dom: {\n tag: 'span',\n classes: ['tox-statusbar__branding'],\n innerHtml: linkHtml\n }\n };\n };\n var getResizeType = function (editor) {\n var fallback = !contains$1(editor.getParam('plugins', '', 'string'), 'autoresize');\n var resize = editor.getParam('resize', fallback);\n if (resize === false) {\n return ResizeTypes.None;\n } else if (resize === 'both') {\n return ResizeTypes.Both;\n } else {\n return ResizeTypes.Vertical;\n }\n };\n var getTextComponents = function () {\n var components = [];\n if (editor.getParam('elementpath', true, 'boolean')) {\n components.push(renderElementPath(editor, {}, providersBackstage));\n }\n if (contains$1(editor.getParam('plugins', '', 'string'), 'wordcount')) {\n components.push(renderWordCount(editor, providersBackstage));\n }\n if (editor.getParam('branding', true, 'boolean')) {\n components.push(renderBranding());\n }\n if (components.length > 0) {\n return [{\n dom: {\n tag: 'div',\n classes: ['tox-statusbar__text-container']\n },\n components: components\n }];\n }\n return [];\n };\n var getComponents = function () {\n var components = getTextComponents();\n var resizeType = getResizeType(editor);\n if (resizeType !== ResizeTypes.None) {\n components.push(renderResizeHandlerIcon(resizeType));\n }\n return components;\n };\n return {\n dom: {\n tag: 'div',\n classes: ['tox-statusbar']\n },\n components: getComponents()\n };\n };\n\n var setup$b = function (editor) {\n var _a;\n var isInline = editor.inline;\n var mode = isInline ? Inline : Iframe;\n var header = isStickyToolbar(editor) ? StickyHeader : StaticHeader;\n var lazyOuterContainer = Option.none();\n var platform = detect$3();\n var isIE = platform.browser.isIE();\n var platformClasses = isIE ? ['tox-platform-ie'] : [];\n var isTouch = platform.deviceType.isTouch();\n var touchPlatformClass = 'tox-platform-touch';\n var deviceClasses = isTouch ? [touchPlatformClass] : [];\n var isToolbarBottom = isToolbarLocationBottom(editor);\n var dirAttributes = global$6.isRtl() ? { attributes: { dir: 'rtl' } } : {};\n var verticalDirAttributes = { attributes: (_a = {}, _a[Attribute] = isToolbarBottom ? AttributeValue.BottomToTop : AttributeValue.TopToBottom, _a) };\n var lazyHeader = function () {\n return lazyOuterContainer.bind(OuterContainer.getHeader);\n };\n var isHeaderDocked = function () {\n return header.isDocked(lazyHeader);\n };\n var sink = build$1({\n dom: __assign({\n tag: 'div',\n classes: [\n 'tox',\n 'tox-silver-sink',\n 'tox-tinymce-aux'\n ].concat(platformClasses).concat(deviceClasses)\n }, dirAttributes),\n behaviours: derive$1([Positioning.config({\n useFixed: function () {\n return isHeaderDocked();\n }\n })])\n });\n var lazySink = function () {\n return Result.value(sink);\n };\n var memAnchorBar = record({\n dom: {\n tag: 'div',\n classes: ['tox-anchorbar']\n }\n });\n var lazyAnchorBar = function () {\n return lazyOuterContainer.bind(function (container) {\n return memAnchorBar.getOpt(container);\n }).getOrDie('Could not find a anchor bar element');\n };\n var lazyToolbar = function () {\n return lazyOuterContainer.bind(function (container) {\n return OuterContainer.getToolbar(container);\n }).getOrDie('Could not find more toolbar element');\n };\n var lazyThrobber = function () {\n return lazyOuterContainer.bind(function (container) {\n return OuterContainer.getThrobber(container);\n }).getOrDie('Could not find throbber element');\n };\n var backstage = init$8(sink, editor, lazyAnchorBar);\n var partMenubar = OuterContainer.parts().menubar({\n dom: {\n tag: 'div',\n classes: ['tox-menubar']\n },\n backstage: backstage,\n onEscape: function () {\n editor.focus();\n }\n });\n var toolbarMode = getToolbarMode(editor);\n var partToolbar = OuterContainer.parts().toolbar(__assign({\n dom: {\n tag: 'div',\n classes: ['tox-toolbar']\n },\n getSink: lazySink,\n providers: backstage.shared.providers,\n onEscape: function () {\n editor.focus();\n },\n type: toolbarMode,\n lazyToolbar: lazyToolbar,\n lazyHeader: function () {\n return lazyHeader().getOrDie('Could not find header element');\n }\n }, verticalDirAttributes));\n var partMultipleToolbar = OuterContainer.parts()['multiple-toolbar']({\n dom: {\n tag: 'div',\n classes: ['tox-toolbar-overlord']\n },\n providers: backstage.shared.providers,\n onEscape: function () {\n },\n type: toolbarMode\n });\n var partSocket = OuterContainer.parts().socket({\n dom: {\n tag: 'div',\n classes: ['tox-edit-area']\n }\n });\n var partSidebar = OuterContainer.parts().sidebar({\n dom: {\n tag: 'div',\n classes: ['tox-sidebar']\n }\n });\n var partThrobber = OuterContainer.parts().throbber({\n dom: {\n tag: 'div',\n classes: ['tox-throbber']\n },\n backstage: backstage\n });\n var sb = editor.getParam('statusbar', true, 'boolean');\n var statusbar = sb && !isInline ? Option.some(renderStatusbar(editor, backstage.shared.providers)) : Option.none();\n var socketSidebarContainer = {\n dom: {\n tag: 'div',\n classes: ['tox-sidebar-wrap']\n },\n components: [\n partSocket,\n partSidebar\n ]\n };\n var hasMultipleToolbar = isMultipleToolbars(editor);\n var hasToolbar = isToolbarEnabled(editor);\n var hasMenubar = isMenubarEnabled(editor);\n var getPartToolbar = function () {\n if (hasMultipleToolbar) {\n return [partMultipleToolbar];\n } else if (hasToolbar) {\n return [partToolbar];\n } else {\n return [];\n }\n };\n var partHeader = OuterContainer.parts().header({\n dom: __assign({\n tag: 'div',\n classes: ['tox-editor-header']\n }, verticalDirAttributes),\n components: flatten([\n hasMenubar ? [partMenubar] : [],\n getPartToolbar(),\n useFixedContainer(editor) ? [] : [memAnchorBar.asSpec()]\n ]),\n sticky: isStickyToolbar(editor),\n editor: editor,\n sharedBackstage: backstage.shared\n });\n var editorComponents = flatten([\n isToolbarBottom ? [] : [partHeader],\n isInline ? [] : [socketSidebarContainer],\n isToolbarBottom ? [partHeader] : []\n ]);\n var editorContainer = {\n dom: {\n tag: 'div',\n classes: ['tox-editor-container']\n },\n components: editorComponents\n };\n var containerComponents = flatten([\n [editorContainer],\n isInline ? [] : statusbar.toArray(),\n [partThrobber]\n ]);\n var isHidden = isDistractionFree(editor);\n var attributes = __assign(__assign({ role: 'application' }, global$6.isRtl() ? { dir: 'rtl' } : {}), isHidden ? { 'aria-hidden': 'true' } : {});\n var outerContainer = build$1(OuterContainer.sketch({\n dom: {\n tag: 'div',\n classes: [\n 'tox',\n 'tox-tinymce'\n ].concat(isInline ? ['tox-tinymce-inline'] : []).concat(isToolbarBottom ? ['tox-tinymce--toolbar-bottom'] : []).concat(deviceClasses).concat(platformClasses),\n styles: __assign({ visibility: 'hidden' }, isHidden ? {\n opacity: '0',\n border: '0'\n } : {}),\n attributes: attributes\n },\n components: containerComponents,\n behaviours: derive$1([Keying.config({\n mode: 'cyclic',\n selector: '.tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a'\n })])\n }));\n lazyOuterContainer = Option.some(outerContainer);\n editor.shortcuts.add('alt+F9', 'focus menubar', function () {\n OuterContainer.focusMenubar(outerContainer);\n });\n editor.shortcuts.add('alt+F10', 'focus toolbar', function () {\n OuterContainer.focusToolbar(outerContainer);\n });\n var mothership = takeover(outerContainer);\n var uiMothership = takeover(sink);\n setup$3(editor, mothership, uiMothership);\n var getUi = function () {\n var channels = {\n broadcastAll: uiMothership.broadcast,\n broadcastOn: uiMothership.broadcastOn,\n register: function () {\n }\n };\n return { channels: channels };\n };\n var setEditorSize = function () {\n var parsedHeight = numToPx(getHeightWithFallback(editor));\n var parsedWidth = numToPx(getWidthWithFallback(editor));\n if (!editor.inline) {\n if (isValidValue('div', 'width', parsedWidth)) {\n set$2(outerContainer.element(), 'width', parsedWidth);\n }\n if (isValidValue('div', 'height', parsedHeight)) {\n set$2(outerContainer.element(), 'height', parsedHeight);\n } else {\n set$2(outerContainer.element(), 'height', '200px');\n }\n }\n return parsedHeight;\n };\n var renderUI = function () {\n header.setup(editor, backstage.shared, lazyHeader);\n setup$8(editor, backstage);\n setup$9(editor, lazySink, backstage);\n setup$6(editor);\n setup$7(editor, lazyThrobber, backstage.shared);\n map$2(getToolbarGroups(editor), function (toolbarGroupButtonConfig, name) {\n editor.ui.registry.addGroupToolbarButton(name, toolbarGroupButtonConfig);\n });\n var _a = editor.ui.registry.getAll(), buttons = _a.buttons, menuItems = _a.menuItems, contextToolbars = _a.contextToolbars, sidebars = _a.sidebars;\n var toolbarOpt = getMultipleToolbarsSetting(editor);\n var rawUiConfig = {\n menuItems: menuItems,\n menus: getMenus(editor),\n menubar: getMenubar(editor),\n toolbar: toolbarOpt.getOrThunk(function () {\n return getToolbar(editor);\n }),\n allowToolbarGroups: toolbarMode === ToolbarMode.floating,\n buttons: buttons,\n sidebar: sidebars\n };\n register$4(editor, contextToolbars, sink, { backstage: backstage });\n setup$a(editor, sink);\n var elm = editor.getElement();\n var height = setEditorSize();\n var uiComponents = {\n mothership: mothership,\n uiMothership: uiMothership,\n outerContainer: outerContainer\n };\n var args = {\n targetNode: elm,\n height: height\n };\n return mode.render(editor, uiComponents, rawUiConfig, backstage, args);\n };\n return {\n mothership: mothership,\n uiMothership: uiMothership,\n backstage: backstage,\n renderUI: renderUI,\n getUi: getUi\n };\n };\n\n var describedBy = function (describedElement, describeElement) {\n var describeId = Option.from(get$2(describedElement, 'id')).fold(function () {\n var id = generate$1('dialog-describe');\n set$1(describeElement, 'id', id);\n return id;\n }, identity);\n set$1(describedElement, 'aria-describedby', describeId);\n };\n\n var labelledBy = function (labelledElement, labelElement) {\n var labelId = Option.from(get$2(labelledElement, 'id')).fold(function () {\n var id = generate$1('dialog-label');\n set$1(labelElement, 'id', id);\n return id;\n }, identity);\n set$1(labelledElement, 'aria-labelledby', labelId);\n };\n\n var schema$x = constant([\n strict$1('lazySink'),\n option('dragBlockClass'),\n defaultedFunction('getBounds', win),\n defaulted$1('useTabstopAt', constant(true)),\n defaulted$1('eventOrder', {}),\n field$1('modalBehaviours', [Keying]),\n onKeyboardHandler('onExecute'),\n onStrictKeyboardHandler('onEscape')\n ]);\n var basic = { sketch: identity };\n var parts$f = constant([\n optional({\n name: 'draghandle',\n overrides: function (detail, spec) {\n return {\n behaviours: derive$1([Dragging.config({\n mode: 'mouse',\n getTarget: function (handle) {\n return ancestor$2(handle, '[role=\"dialog\"]').getOr(handle);\n },\n blockerClass: detail.dragBlockClass.getOrDie(new Error('The drag blocker class was not specified for a dialog with a drag handle: \\n' + JSON.stringify(spec, null, 2)).message),\n getBounds: detail.getDragBounds\n })])\n };\n }\n }),\n required({\n schema: [strict$1('dom')],\n name: 'title'\n }),\n required({\n factory: basic,\n schema: [strict$1('dom')],\n name: 'close'\n }),\n required({\n factory: basic,\n schema: [strict$1('dom')],\n name: 'body'\n }),\n optional({\n factory: basic,\n schema: [strict$1('dom')],\n name: 'footer'\n }),\n external$1({\n factory: {\n sketch: function (spec, detail) {\n return __assign(__assign({}, spec), {\n dom: detail.dom,\n components: detail.components\n });\n }\n },\n schema: [\n defaulted$1('dom', {\n tag: 'div',\n styles: {\n position: 'fixed',\n left: '0px',\n top: '0px',\n right: '0px',\n bottom: '0px'\n }\n }),\n defaulted$1('components', [])\n ],\n name: 'blocker'\n })\n ]);\n\n var factory$i = function (detail, components, spec, externals) {\n var dialogBusyEvent = generate$1('alloy.dialog.busy');\n var dialogIdleEvent = generate$1('alloy.dialog.idle');\n var busyBehaviours = derive$1([\n Keying.config({\n mode: 'special',\n onTab: function () {\n return Option.some(true);\n },\n onShiftTab: function () {\n return Option.some(true);\n }\n }),\n Focusing.config({})\n ]);\n var showDialog = function (dialog) {\n var sink = detail.lazySink(dialog).getOrDie();\n var busyComp = Cell(Option.none());\n var externalBlocker = externals.blocker();\n var blocker = sink.getSystem().build(__assign(__assign({}, externalBlocker), {\n components: externalBlocker.components.concat([premade$1(dialog)]),\n behaviours: derive$1([\n Focusing.config({}),\n config('dialog-blocker-events', [\n runOnSource(focusin(), function () {\n Keying.focusIn(dialog);\n }),\n run(dialogIdleEvent, function (_blocker, _se) {\n if (has$1(dialog.element(), 'aria-busy')) {\n remove$1(dialog.element(), 'aria-busy');\n busyComp.get().each(function (bc) {\n return Replacing.remove(dialog, bc);\n });\n }\n }),\n run(dialogBusyEvent, function (blocker, se) {\n set$1(dialog.element(), 'aria-busy', 'true');\n var getBusySpec = se.event().getBusySpec();\n busyComp.get().each(function (bc) {\n Replacing.remove(dialog, bc);\n });\n var busySpec = getBusySpec(dialog, busyBehaviours);\n var busy = blocker.getSystem().build(busySpec);\n busyComp.set(Option.some(busy));\n Replacing.append(dialog, premade$1(busy));\n if (busy.hasConfigured(Keying)) {\n Keying.focusIn(busy);\n }\n })\n ])\n ])\n }));\n attach$1(sink, blocker);\n Keying.focusIn(dialog);\n };\n var hideDialog = function (dialog) {\n parent(dialog.element()).each(function (blockerDom) {\n dialog.getSystem().getByDom(blockerDom).each(function (blocker) {\n detach(blocker);\n });\n });\n };\n var getDialogBody = function (dialog) {\n return getPartOrDie(dialog, detail, 'body');\n };\n var getDialogFooter = function (dialog) {\n return getPartOrDie(dialog, detail, 'footer');\n };\n var setBusy = function (dialog, getBusySpec) {\n emitWith(dialog, dialogBusyEvent, { getBusySpec: getBusySpec });\n };\n var setIdle = function (dialog) {\n emit(dialog, dialogIdleEvent);\n };\n var modalEventsId = generate$1('modal-events');\n var eventOrder = __assign(__assign({}, detail.eventOrder), { 'alloy.system.attached': [modalEventsId].concat(detail.eventOrder['alloy.system.attached'] || []) });\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n apis: {\n show: showDialog,\n hide: hideDialog,\n getBody: getDialogBody,\n getFooter: getDialogFooter,\n setIdle: setIdle,\n setBusy: setBusy\n },\n eventOrder: eventOrder,\n domModification: {\n attributes: {\n 'role': 'dialog',\n 'aria-modal': 'true'\n }\n },\n behaviours: augment(detail.modalBehaviours, [\n Replacing.config({}),\n Keying.config({\n mode: 'cyclic',\n onEnter: detail.onExecute,\n onEscape: detail.onEscape,\n useTabstopAt: detail.useTabstopAt\n }),\n config(modalEventsId, [runOnAttached(function (c) {\n labelledBy(c.element(), getPartOrDie(c, detail, 'title').element());\n describedBy(c.element(), getPartOrDie(c, detail, 'body').element());\n })])\n ])\n };\n };\n var ModalDialog = composite$1({\n name: 'ModalDialog',\n configFields: schema$x(),\n partFields: parts$f(),\n factory: factory$i,\n apis: {\n show: function (apis, dialog) {\n apis.show(dialog);\n },\n hide: function (apis, dialog) {\n apis.hide(dialog);\n },\n getBody: function (apis, dialog) {\n return apis.getBody(dialog);\n },\n getFooter: function (apis, dialog) {\n return apis.getFooter(dialog);\n },\n setBusy: function (apis, dialog, getBusySpec) {\n apis.setBusy(dialog, getBusySpec);\n },\n setIdle: function (apis, dialog) {\n apis.setIdle(dialog);\n }\n }\n });\n\n var dialogToggleMenuItemSchema = objOf([\n strictString('type'),\n strictString('name')\n ].concat(commonMenuItemFields));\n var dialogToggleMenuItemDataProcessor = boolean;\n\n var baseButtonFields = [\n field('name', 'name', defaultedThunk(function () {\n return generate$1('button-name');\n }), string),\n optionString('icon'),\n defaultedStringEnum('align', 'end', [\n 'start',\n 'end'\n ]),\n defaultedBoolean('primary', false),\n defaultedBoolean('disabled', false)\n ];\n var dialogButtonFields = __spreadArrays(baseButtonFields, [strictString('text')]);\n var normalButtonFields = __spreadArrays([strictStringEnum('type', [\n 'submit',\n 'cancel',\n 'custom'\n ])], dialogButtonFields);\n var menuButtonFields = __spreadArrays([\n strictStringEnum('type', ['menu']),\n optionString('text'),\n optionString('tooltip'),\n optionString('icon'),\n strictArrayOf('items', dialogToggleMenuItemSchema)\n ], baseButtonFields);\n var dialogButtonSchema = choose$1('type', {\n submit: normalButtonFields,\n cancel: normalButtonFields,\n custom: normalButtonFields,\n menu: menuButtonFields\n });\n\n var alertBannerFields = [\n strictString('type'),\n strictString('text'),\n strictStringEnum('level', [\n 'info',\n 'warn',\n 'error',\n 'success'\n ]),\n strictString('icon'),\n defaulted$1('url', '')\n ];\n var alertBannerSchema = objOf(alertBannerFields);\n\n var createBarFields = function (itemsField) {\n return [\n strictString('type'),\n itemsField\n ];\n };\n\n var buttonFields = [\n strictString('type'),\n strictString('text'),\n defaultedBoolean('disabled', false),\n defaultedBoolean('primary', false),\n field('name', 'name', defaultedThunk(function () {\n return generate$1('button-name');\n }), string),\n optionString('icon'),\n defaultedBoolean('borderless', false)\n ];\n var buttonSchema = objOf(buttonFields);\n\n var checkboxFields = [\n strictString('type'),\n strictString('name'),\n strictString('label'),\n defaultedBoolean('disabled', false)\n ];\n var checkboxSchema = objOf(checkboxFields);\n var checkboxDataProcessor = boolean;\n\n var formComponentFields = [\n strictString('type'),\n strictString('name')\n ];\n var formComponentWithLabelFields = formComponentFields.concat([optionString('label')]);\n\n var colorInputFields = formComponentWithLabelFields;\n var colorInputSchema = objOf(colorInputFields);\n var colorInputDataProcessor = string;\n\n var colorPickerFields = formComponentWithLabelFields;\n var colorPickerSchema = objOf(colorPickerFields);\n var colorPickerDataProcessor = string;\n\n var dropZoneFields = formComponentWithLabelFields;\n var dropZoneSchema = objOf(dropZoneFields);\n var dropZoneDataProcessor = arrOfVal();\n\n var createGridFields = function (itemsField) {\n return [\n strictString('type'),\n strictNumber('columns'),\n itemsField\n ];\n };\n\n var iframeFields = formComponentWithLabelFields.concat([defaultedBoolean('sandboxed', true)]);\n var iframeSchema = objOf(iframeFields);\n var iframeDataProcessor = string;\n\n var inputFields = formComponentWithLabelFields.concat([\n optionString('inputMode'),\n optionString('placeholder'),\n defaultedBoolean('maximized', false),\n defaultedBoolean('disabled', false)\n ]);\n var inputSchema = objOf(inputFields);\n var inputDataProcessor = string;\n\n var selectBoxFields = formComponentWithLabelFields.concat([\n strictArrayOfObj('items', [\n strictString('text'),\n strictString('value')\n ]),\n defaultedNumber('size', 1),\n defaultedBoolean('disabled', false)\n ]);\n var selectBoxSchema = objOf(selectBoxFields);\n var selectBoxDataProcessor = string;\n\n var sizeInputFields = formComponentWithLabelFields.concat([\n defaultedBoolean('constrain', true),\n defaultedBoolean('disabled', false)\n ]);\n var sizeInputSchema = objOf(sizeInputFields);\n var sizeInputDataProcessor = objOf([\n strictString('width'),\n strictString('height')\n ]);\n\n var textAreaFields = formComponentWithLabelFields.concat([\n optionString('placeholder'),\n defaultedBoolean('maximized', false),\n defaultedBoolean('disabled', false)\n ]);\n var textAreaSchema = objOf(textAreaFields);\n var textAreaDataProcessor = string;\n\n var urlInputFields = formComponentWithLabelFields.concat([\n defaultedStringEnum('filetype', 'file', [\n 'image',\n 'media',\n 'file'\n ]),\n defaulted$1('disabled', false)\n ]);\n var urlInputSchema = objOf(urlInputFields);\n var urlInputDataProcessor = objOf([\n strictString('value'),\n defaulted$1('meta', {})\n ]);\n\n var customEditorFields = formComponentFields.concat([\n defaultedString('tag', 'textarea'),\n strictString('scriptId'),\n strictString('scriptUrl'),\n defaultedPostMsg('settings', undefined)\n ]);\n var customEditorFieldsOld = formComponentFields.concat([\n defaultedString('tag', 'textarea'),\n strictFunction('init')\n ]);\n var customEditorSchema = valueOf(function (v) {\n return asRaw('customeditor.old', objOfOnly(customEditorFieldsOld), v).orThunk(function () {\n return asRaw('customeditor.new', objOfOnly(customEditorFields), v);\n });\n });\n var customEditorDataProcessor = string;\n\n var htmlPanelFields = [\n strictString('type'),\n strictString('html'),\n defaultedStringEnum('presets', 'presentation', [\n 'presentation',\n 'document'\n ])\n ];\n var htmlPanelSchema = objOf(htmlPanelFields);\n\n var imageToolsFields = formComponentWithLabelFields.concat([strictOf('currentState', objOf([\n strict$1('blob'),\n strictString('url')\n ]))]);\n var imageToolsSchema = objOf(imageToolsFields);\n\n var collectionFields = formComponentWithLabelFields.concat([defaulted$1('columns', 'auto')]);\n var collectionSchema = objOf(collectionFields);\n var collectionDataProcessor = arrOfObj$1([\n strictString('value'),\n strictString('text'),\n strictString('icon')\n ]);\n\n var createLabelFields = function (itemsField) {\n return [\n strictString('type'),\n strictString('label'),\n itemsField\n ];\n };\n\n var tableFields = [\n strictString('type'),\n strictArrayOf('header', string),\n strictArrayOf('cells', arrOf(string))\n ];\n var tableSchema = objOf(tableFields);\n\n var createItemsField = function (name) {\n return field('items', 'items', strict(), arrOf(valueOf(function (v) {\n return asRaw('Checking item of ' + name, itemSchema$2, v).fold(function (sErr) {\n return Result.error(formatError(sErr));\n }, function (passValue) {\n return Result.value(passValue);\n });\n })));\n };\n var itemSchema$2 = valueThunkOf(function () {\n return chooseProcessor('type', {\n alertbanner: alertBannerSchema,\n bar: objOf(createBarFields(createItemsField('bar'))),\n button: buttonSchema,\n checkbox: checkboxSchema,\n colorinput: colorInputSchema,\n colorpicker: colorPickerSchema,\n dropzone: dropZoneSchema,\n grid: objOf(createGridFields(createItemsField('grid'))),\n iframe: iframeSchema,\n input: inputSchema,\n selectbox: selectBoxSchema,\n sizeinput: sizeInputSchema,\n textarea: textAreaSchema,\n urlinput: urlInputSchema,\n customeditor: customEditorSchema,\n htmlpanel: htmlPanelSchema,\n imagetools: imageToolsSchema,\n collection: collectionSchema,\n label: objOf(createLabelFields(createItemsField('label'))),\n table: tableSchema,\n panel: panelSchema\n });\n });\n var panelFields = [\n strictString('type'),\n defaulted$1('classes', []),\n strictArrayOf('items', itemSchema$2)\n ];\n var panelSchema = objOf(panelFields);\n\n var tabFields = [\n field('name', 'name', defaultedThunk(function () {\n return generate$1('tab-name');\n }), string),\n strictString('title'),\n strictArrayOf('items', itemSchema$2)\n ];\n var tabPanelFields = [\n strictString('type'),\n strictArrayOfObj('tabs', tabFields)\n ];\n var tabPanelSchema = objOf(tabPanelFields);\n\n var dialogButtonFields$1 = dialogButtonFields;\n var dialogButtonSchema$1 = dialogButtonSchema;\n var dialogSchema = objOf([\n strictString('title'),\n strictOf('body', chooseProcessor('type', {\n panel: panelSchema,\n tabpanel: tabPanelSchema\n })),\n defaultedString('size', 'normal'),\n strictArrayOf('buttons', dialogButtonSchema$1),\n defaulted$1('initialData', {}),\n defaultedFunction('onAction', noop),\n defaultedFunction('onChange', noop),\n defaultedFunction('onSubmit', noop),\n defaultedFunction('onClose', noop),\n defaultedFunction('onCancel', noop),\n defaulted$1('onTabChange', noop)\n ]);\n var createDialog = function (spec) {\n return asRaw('dialog', dialogSchema, spec);\n };\n\n var getAllObjects = function (obj) {\n if (isObject(obj)) {\n return [obj].concat(bind(values(obj), getAllObjects));\n } else if (isArray(obj)) {\n return bind(obj, getAllObjects);\n } else {\n return [];\n }\n };\n\n var isNamedItem = function (obj) {\n return isString(obj.type) && isString(obj.name);\n };\n var dataProcessors = {\n checkbox: checkboxDataProcessor,\n colorinput: colorInputDataProcessor,\n colorpicker: colorPickerDataProcessor,\n dropzone: dropZoneDataProcessor,\n input: inputDataProcessor,\n iframe: iframeDataProcessor,\n sizeinput: sizeInputDataProcessor,\n selectbox: selectBoxDataProcessor,\n size: sizeInputDataProcessor,\n textarea: textAreaDataProcessor,\n urlinput: urlInputDataProcessor,\n customeditor: customEditorDataProcessor,\n collection: collectionDataProcessor,\n togglemenuitem: dialogToggleMenuItemDataProcessor\n };\n var getDataProcessor = function (item) {\n return Option.from(dataProcessors[item.type]);\n };\n var getNamedItems = function (structure) {\n return filter(getAllObjects(structure), isNamedItem);\n };\n\n var createDataValidator = function (structure) {\n var namedItems = getNamedItems(structure);\n var fields = bind(namedItems, function (item) {\n return getDataProcessor(item).fold(function () {\n return [];\n }, function (schema) {\n return [strictOf(item.name, schema)];\n });\n });\n return objOf(fields);\n };\n\n var urlDialogButtonSchema = objOf(__spreadArrays([strictStringEnum('type', [\n 'cancel',\n 'custom'\n ])], dialogButtonFields$1));\n var urlDialogSchema = objOf([\n strictString('title'),\n strictString('url'),\n optionNumber('height'),\n optionNumber('width'),\n optionArrayOf('buttons', urlDialogButtonSchema),\n defaultedFunction('onAction', noop),\n defaultedFunction('onCancel', noop),\n defaultedFunction('onClose', noop),\n defaultedFunction('onMessage', noop)\n ]);\n var createUrlDialog = function (spec) {\n return asRaw('dialog', urlDialogSchema, spec);\n };\n\n var extract$1 = function (structure) {\n var internalDialog = getOrDie(createDialog(structure));\n var dataValidator = createDataValidator(structure);\n var initialData = structure.initialData;\n return {\n internalDialog: internalDialog,\n dataValidator: dataValidator,\n initialData: initialData\n };\n };\n var DialogManager = {\n open: function (factory, structure) {\n var extraction = extract$1(structure);\n return factory(extraction.internalDialog, extraction.initialData, extraction.dataValidator);\n },\n openUrl: function (factory, structure) {\n var internalDialog = getOrDie(createUrlDialog(structure));\n return factory(internalDialog);\n },\n redial: function (structure) {\n return extract$1(structure);\n }\n };\n\n var toValidValues = function (values) {\n var errors = [];\n var result = {};\n each$1(values, function (value, name) {\n value.fold(function () {\n errors.push(name);\n }, function (v) {\n result[name] = v;\n });\n });\n return errors.length > 0 ? Result.error(errors) : Result.value(result);\n };\n\n var renderBodyPanel = function (spec, backstage) {\n var memForm = record(Form.sketch(function (parts) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-form'].concat(spec.classes)\n },\n components: map(spec.items, function (item) {\n return interpretInForm(parts, item, backstage);\n })\n };\n }));\n return {\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body']\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-content']\n },\n components: [memForm.asSpec()]\n }],\n behaviours: derive$1([\n Keying.config({\n mode: 'acyclic',\n useTabstopAt: not(isPseudoStop)\n }),\n ComposingConfigs.memento(memForm),\n RepresentingConfigs.memento(memForm, {\n postprocess: function (formValue) {\n return toValidValues(formValue).fold(function (err) {\n domGlobals.console.error(err);\n return {};\n }, function (vals) {\n return vals;\n });\n }\n })\n ])\n };\n };\n\n var factory$j = function (detail, _spec) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: detail.components,\n events: events$7(detail.action),\n behaviours: augment(detail.tabButtonBehaviours, [\n Focusing.config({}),\n Keying.config({\n mode: 'execution',\n useSpace: true,\n useEnter: true\n }),\n Representing.config({\n store: {\n mode: 'memory',\n initialValue: detail.value\n }\n })\n ]),\n domModification: detail.domModification\n };\n };\n var TabButton = single$2({\n name: 'TabButton',\n configFields: [\n defaulted$1('uid', undefined),\n strict$1('value'),\n field('dom', 'dom', mergeWithThunk(function () {\n return {\n attributes: {\n 'role': 'tab',\n 'id': generate$1('aria'),\n 'aria-selected': 'false'\n }\n };\n }), anyValue$1()),\n option('action'),\n defaulted$1('domModification', {}),\n field$1('tabButtonBehaviours', [\n Focusing,\n Keying,\n Representing\n ]),\n strict$1('view')\n ],\n factory: factory$j\n });\n\n var schema$y = constant([\n strict$1('tabs'),\n strict$1('dom'),\n defaulted$1('clickToDismiss', false),\n field$1('tabbarBehaviours', [\n Highlighting,\n Keying\n ]),\n markers([\n 'tabClass',\n 'selectedClass'\n ])\n ]);\n var tabsPart = group({\n factory: TabButton,\n name: 'tabs',\n unit: 'tab',\n overrides: function (barDetail) {\n var dismissTab$1 = function (tabbar, button) {\n Highlighting.dehighlight(tabbar, button);\n emitWith(tabbar, dismissTab(), {\n tabbar: tabbar,\n button: button\n });\n };\n var changeTab$1 = function (tabbar, button) {\n Highlighting.highlight(tabbar, button);\n emitWith(tabbar, changeTab(), {\n tabbar: tabbar,\n button: button\n });\n };\n return {\n action: function (button) {\n var tabbar = button.getSystem().getByUid(barDetail.uid).getOrDie();\n var activeButton = Highlighting.isHighlighted(tabbar, button);\n var response = function () {\n if (activeButton && barDetail.clickToDismiss) {\n return dismissTab$1;\n } else if (!activeButton) {\n return changeTab$1;\n } else {\n return noop;\n }\n }();\n response(tabbar, button);\n },\n domModification: { classes: [barDetail.markers.tabClass] }\n };\n }\n });\n var parts$g = constant([tabsPart]);\n\n var factory$k = function (detail, components, _spec, _externals) {\n return {\n 'uid': detail.uid,\n 'dom': detail.dom,\n components: components,\n 'debug.sketcher': 'Tabbar',\n 'domModification': { attributes: { role: 'tablist' } },\n 'behaviours': augment(detail.tabbarBehaviours, [\n Highlighting.config({\n highlightClass: detail.markers.selectedClass,\n itemClass: detail.markers.tabClass,\n onHighlight: function (tabbar, tab) {\n set$1(tab.element(), 'aria-selected', 'true');\n },\n onDehighlight: function (tabbar, tab) {\n set$1(tab.element(), 'aria-selected', 'false');\n }\n }),\n Keying.config({\n mode: 'flow',\n getInitial: function (tabbar) {\n return Highlighting.getHighlighted(tabbar).map(function (tab) {\n return tab.element();\n });\n },\n selector: '.' + detail.markers.tabClass,\n executeOnMove: true\n })\n ])\n };\n };\n var Tabbar = composite$1({\n name: 'Tabbar',\n configFields: schema$y(),\n partFields: parts$g(),\n factory: factory$k\n });\n\n var factory$l = function (detail, _spec) {\n return {\n uid: detail.uid,\n dom: detail.dom,\n behaviours: augment(detail.tabviewBehaviours, [Replacing.config({})]),\n domModification: { attributes: { role: 'tabpanel' } }\n };\n };\n var Tabview = single$2({\n name: 'Tabview',\n configFields: [field$1('tabviewBehaviours', [Replacing])],\n factory: factory$l\n });\n\n var schema$z = constant([\n defaulted$1('selectFirst', true),\n onHandler('onChangeTab'),\n onHandler('onDismissTab'),\n defaulted$1('tabs', []),\n field$1('tabSectionBehaviours', [])\n ]);\n var barPart = required({\n factory: Tabbar,\n schema: [\n strict$1('dom'),\n strictObjOf('markers', [\n strict$1('tabClass'),\n strict$1('selectedClass')\n ])\n ],\n name: 'tabbar',\n defaults: function (detail) {\n return { tabs: detail.tabs };\n }\n });\n var viewPart = required({\n factory: Tabview,\n name: 'tabview'\n });\n var parts$h = constant([\n barPart,\n viewPart\n ]);\n\n var factory$m = function (detail, components, _spec, _externals) {\n var changeTab$1 = function (button) {\n var tabValue = Representing.getValue(button);\n getPart(button, detail, 'tabview').each(function (tabview) {\n var tabWithValue = find(detail.tabs, function (t) {\n return t.value === tabValue;\n });\n tabWithValue.each(function (tabData) {\n var panel = tabData.view();\n getOpt(button.element(), 'id').each(function (id) {\n set$1(tabview.element(), 'aria-labelledby', id);\n });\n Replacing.set(tabview, panel);\n detail.onChangeTab(tabview, button, panel);\n });\n });\n };\n var changeTabBy = function (section, byPred) {\n getPart(section, detail, 'tabbar').each(function (tabbar) {\n byPred(tabbar).each(emitExecute);\n });\n };\n return {\n uid: detail.uid,\n dom: detail.dom,\n components: components,\n behaviours: get$c(detail.tabSectionBehaviours),\n events: derive(flatten([\n detail.selectFirst ? [runOnAttached(function (section, _simulatedEvent) {\n changeTabBy(section, Highlighting.getFirst);\n })] : [],\n [\n run(changeTab(), function (section, simulatedEvent) {\n var button = simulatedEvent.event().button();\n changeTab$1(button);\n }),\n run(dismissTab(), function (section, simulatedEvent) {\n var button = simulatedEvent.event().button();\n detail.onDismissTab(section, button);\n })\n ]\n ])),\n apis: {\n getViewItems: function (section) {\n return getPart(section, detail, 'tabview').map(function (tabview) {\n return Replacing.contents(tabview);\n }).getOr([]);\n },\n showTab: function (section, tabKey) {\n var getTabIfNotActive = function (tabbar) {\n var candidates = Highlighting.getCandidates(tabbar);\n var optTab = find(candidates, function (c) {\n return Representing.getValue(c) === tabKey;\n });\n return optTab.filter(function (tab) {\n return !Highlighting.isHighlighted(tabbar, tab);\n });\n };\n changeTabBy(section, getTabIfNotActive);\n }\n }\n };\n };\n var TabSection = composite$1({\n name: 'TabSection',\n configFields: schema$z(),\n partFields: parts$h(),\n factory: factory$m,\n apis: {\n getViewItems: function (apis, component) {\n return apis.getViewItems(component);\n },\n showTab: function (apis, component, tabKey) {\n apis.showTab(component, tabKey);\n }\n }\n });\n\n var measureHeights = function (allTabs, tabview, tabviewComp) {\n return map(allTabs, function (_tab, i) {\n Replacing.set(tabviewComp, allTabs[i].view());\n var rect = tabview.dom().getBoundingClientRect();\n Replacing.set(tabviewComp, []);\n return rect.height;\n });\n };\n var getMaxHeight = function (heights) {\n return head(sort(heights, function (a, b) {\n if (a > b) {\n return -1;\n } else if (a < b) {\n return +1;\n } else {\n return 0;\n }\n }));\n };\n var getMaxTabviewHeight = function (dialog, tabview, tablist) {\n var documentElement$1 = documentElement(dialog).dom();\n var rootElm = ancestor$2(dialog, '.tox-dialog-wrap').getOr(dialog);\n var isFixed = get$4(rootElm, 'position') === 'fixed';\n var maxHeight;\n if (isFixed) {\n maxHeight = Math.max(documentElement$1.clientHeight, domGlobals.window.innerHeight);\n } else {\n maxHeight = Math.max(documentElement$1.offsetHeight, documentElement$1.scrollHeight);\n }\n var tabviewHeight = get$6(tabview);\n var isTabListBeside = tabview.dom().offsetLeft >= tablist.dom().offsetLeft + get$7(tablist);\n var currentTabHeight = isTabListBeside ? Math.max(get$6(tablist), tabviewHeight) : tabviewHeight;\n var dialogTopMargin = parseInt(get$4(dialog, 'margin-top'), 10) || 0;\n var dialogBottomMargin = parseInt(get$4(dialog, 'margin-bottom'), 10) || 0;\n var dialogHeight = get$6(dialog) + dialogTopMargin + dialogBottomMargin;\n var chromeHeight = dialogHeight - currentTabHeight;\n return maxHeight - chromeHeight;\n };\n var showTab = function (allTabs, comp) {\n head(allTabs).each(function (tab) {\n return TabSection.showTab(comp, tab.value);\n });\n };\n var setTabviewHeight = function (tabview, height) {\n set$2(tabview, 'height', height + 'px');\n if (!detect$3().browser.isIE()) {\n set$2(tabview, 'flex-basis', height + 'px');\n } else {\n remove$6(tabview, 'flex-basis');\n }\n };\n var updateTabviewHeight = function (dialogBody, tabview, maxTabHeight) {\n ancestor$2(dialogBody, '[role=\"dialog\"]').each(function (dialog) {\n descendant$1(dialog, '[role=\"tablist\"]').each(function (tablist) {\n maxTabHeight.get().map(function (height) {\n set$2(tabview, 'height', '0');\n set$2(tabview, 'flex-basis', '0');\n return Math.min(height, getMaxTabviewHeight(dialog, tabview, tablist));\n }).each(function (height) {\n setTabviewHeight(tabview, height);\n });\n });\n });\n };\n var getTabview = function (dialog) {\n return descendant$1(dialog, '[role=\"tabpanel\"]');\n };\n var setMode = function (allTabs) {\n var smartTabHeight = function () {\n var maxTabHeight = Cell(Option.none());\n var extraEvents = [\n runOnAttached(function (comp) {\n var dialog = comp.element();\n getTabview(dialog).each(function (tabview) {\n set$2(tabview, 'visibility', 'hidden');\n comp.getSystem().getByDom(tabview).toOption().each(function (tabviewComp) {\n var heights = measureHeights(allTabs, tabview, tabviewComp);\n var maxTabHeightOpt = getMaxHeight(heights);\n maxTabHeight.set(maxTabHeightOpt);\n });\n updateTabviewHeight(dialog, tabview, maxTabHeight);\n remove$6(tabview, 'visibility');\n showTab(allTabs, comp);\n global$2.requestAnimationFrame(function () {\n updateTabviewHeight(dialog, tabview, maxTabHeight);\n });\n });\n }),\n run(windowResize(), function (comp) {\n var dialog = comp.element();\n getTabview(dialog).each(function (tabview) {\n updateTabviewHeight(dialog, tabview, maxTabHeight);\n });\n }),\n run(formResizeEvent, function (comp, _se) {\n var dialog = comp.element();\n getTabview(dialog).each(function (tabview) {\n var oldFocus = active();\n set$2(tabview, 'visibility', 'hidden');\n var oldHeight = getRaw(tabview, 'height').map(function (h) {\n return parseInt(h, 10);\n });\n remove$6(tabview, 'height');\n remove$6(tabview, 'flex-basis');\n var newHeight = tabview.dom().getBoundingClientRect().height;\n var hasGrown = oldHeight.forall(function (h) {\n return newHeight > h;\n });\n if (hasGrown) {\n maxTabHeight.set(Option.from(newHeight));\n updateTabviewHeight(dialog, tabview, maxTabHeight);\n } else {\n oldHeight.each(function (h) {\n setTabviewHeight(tabview, h);\n });\n }\n remove$6(tabview, 'visibility');\n oldFocus.each(focus$1);\n });\n })\n ];\n var selectFirst = false;\n return {\n extraEvents: extraEvents,\n selectFirst: selectFirst\n };\n }();\n var naiveTabHeight = function () {\n var extraEvents = [];\n var selectFirst = true;\n return {\n extraEvents: extraEvents,\n selectFirst: selectFirst\n };\n }();\n return {\n smartTabHeight: smartTabHeight,\n naiveTabHeight: naiveTabHeight\n };\n };\n\n var SendDataToSectionChannel = 'send-data-to-section';\n var SendDataToViewChannel = 'send-data-to-view';\n var renderTabPanel = function (spec, backstage) {\n var storedValue = Cell({});\n var updateDataWithForm = function (form) {\n var formData = Representing.getValue(form);\n var validData = toValidValues(formData).getOr({});\n var currentData = storedValue.get();\n var newData = deepMerge(currentData, validData);\n storedValue.set(newData);\n };\n var setDataOnForm = function (form) {\n var tabData = storedValue.get();\n Representing.setValue(form, tabData);\n };\n var oldTab = Cell(null);\n var allTabs = map(spec.tabs, function (tab) {\n return {\n value: tab.name,\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-nav-item'],\n innerHtml: backstage.shared.providers.translate(tab.title)\n },\n view: function () {\n return [Form.sketch(function (parts) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-form']\n },\n components: map(tab.items, function (item) {\n return interpretInForm(parts, item, backstage);\n }),\n formBehaviours: derive$1([\n Keying.config({\n mode: 'acyclic',\n useTabstopAt: not(isPseudoStop)\n }),\n config('TabView.form.events', [\n runOnAttached(setDataOnForm),\n runOnDetached(updateDataWithForm)\n ]),\n Receiving.config({\n channels: wrapAll$1([\n {\n key: SendDataToSectionChannel,\n value: { onReceive: updateDataWithForm }\n },\n {\n key: SendDataToViewChannel,\n value: { onReceive: setDataOnForm }\n }\n ])\n })\n ])\n };\n })];\n }\n };\n });\n var tabMode = setMode(allTabs).smartTabHeight;\n return TabSection.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body']\n },\n onChangeTab: function (section, button, _viewItems) {\n var name = Representing.getValue(button);\n emitWith(section, formTabChangeEvent, {\n name: name,\n oldName: oldTab.get()\n });\n oldTab.set(name);\n },\n tabs: allTabs,\n components: [\n TabSection.parts().tabbar({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-nav']\n },\n components: [Tabbar.parts().tabs({})],\n markers: {\n tabClass: 'tox-tab',\n selectedClass: 'tox-dialog__body-nav-item--active'\n },\n tabbarBehaviours: derive$1([Tabstopping.config({})])\n }),\n TabSection.parts().tabview({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-content']\n }\n })\n ],\n selectFirst: tabMode.selectFirst,\n tabSectionBehaviours: derive$1([\n config('tabpanel', tabMode.extraEvents),\n Keying.config({ mode: 'acyclic' }),\n Composing.config({\n find: function (comp) {\n return head(TabSection.getViewItems(comp));\n }\n }),\n Representing.config({\n store: {\n mode: 'manual',\n getValue: function (tsection) {\n tsection.getSystem().broadcastOn([SendDataToSectionChannel], {});\n return storedValue.get();\n },\n setValue: function (tsection, value) {\n storedValue.set(value);\n tsection.getSystem().broadcastOn([SendDataToViewChannel], {});\n }\n }\n })\n ])\n });\n };\n\n var dialogChannel = generate$1('update-dialog');\n var titleChannel = generate$1('update-title');\n var bodyChannel = generate$1('update-body');\n var footerChannel = generate$1('update-footer');\n var bodySendMessageChannel = generate$1('body-send-message');\n\n var renderBody = function (spec, id, backstage, ariaAttrs) {\n var renderComponents = function (incoming) {\n switch (incoming.body.type) {\n case 'tabpanel': {\n return [renderTabPanel(incoming.body, backstage)];\n }\n default: {\n return [renderBodyPanel(incoming.body, backstage)];\n }\n }\n };\n var updateState = function (_comp, incoming) {\n return Option.some({\n isTabPanel: function () {\n return incoming.body.type === 'tabpanel';\n }\n });\n };\n var ariaAttributes = { 'aria-live': 'polite' };\n return {\n dom: {\n tag: 'div',\n classes: ['tox-dialog__content-js'],\n attributes: __assign(__assign({}, id.map(function (x) {\n return { id: x };\n }).getOr({})), ariaAttrs ? ariaAttributes : {})\n },\n components: [],\n behaviours: derive$1([\n ComposingConfigs.childAt(0),\n Reflecting.config({\n channel: bodyChannel,\n updateState: updateState,\n renderComponents: renderComponents,\n initialData: spec\n })\n ])\n };\n };\n var renderInlineBody = function (spec, contentId, backstage, ariaAttrs) {\n return renderBody(spec, Option.some(contentId), backstage, ariaAttrs);\n };\n var renderModalBody = function (spec, backstage) {\n var bodySpec = renderBody(spec, Option.none(), backstage, false);\n return ModalDialog.parts().body(bodySpec);\n };\n var renderIframeBody = function (spec) {\n var bodySpec = {\n dom: {\n tag: 'div',\n classes: ['tox-dialog__content-js']\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-iframe']\n },\n components: [craft({\n dom: {\n tag: 'iframe',\n attributes: { src: spec.url }\n },\n behaviours: derive$1([\n Tabstopping.config({}),\n Focusing.config({})\n ])\n })]\n }],\n behaviours: derive$1([Keying.config({\n mode: 'acyclic',\n useTabstopAt: not(isPseudoStop)\n })])\n };\n return ModalDialog.parts().body(bodySpec);\n };\n\n var isTouch = global$8.deviceType.isTouch();\n var hiddenHeader = function (title, close) {\n return {\n dom: {\n tag: 'div',\n styles: { display: 'none' },\n classes: ['tox-dialog__header']\n },\n components: [\n title,\n close\n ]\n };\n };\n var pClose = function (onClose, providersBackstage) {\n return ModalDialog.parts().close(Button.sketch({\n dom: {\n tag: 'button',\n classes: [\n 'tox-button',\n 'tox-button--icon',\n 'tox-button--naked'\n ],\n attributes: {\n 'type': 'button',\n 'aria-label': providersBackstage.translate('Close')\n }\n },\n action: onClose,\n buttonBehaviours: derive$1([Tabstopping.config({})])\n }));\n };\n var pUntitled = function () {\n return ModalDialog.parts().title({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__title'],\n innerHtml: '',\n styles: { display: 'none' }\n }\n });\n };\n var pBodyMessage = function (message, providersBackstage) {\n return ModalDialog.parts().body({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body']\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-dialog__body-content']\n },\n components: [{ dom: fromHtml$2('

' + providersBackstage.translate(message) + '

') }]\n }]\n });\n };\n var pFooter = function (buttons) {\n return ModalDialog.parts().footer({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__footer']\n },\n components: buttons\n });\n };\n var pFooterGroup = function (startButtons, endButtons) {\n return [\n Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__footer-start']\n },\n components: startButtons\n }),\n Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__footer-end']\n },\n components: endButtons\n })\n ];\n };\n var renderDialog = function (spec) {\n var _a;\n var dialogClass = 'tox-dialog';\n var blockerClass = dialogClass + '-wrap';\n var blockerBackdropClass = blockerClass + '__backdrop';\n var scrollLockClass = dialogClass + '__disable-scroll';\n return ModalDialog.sketch({\n lazySink: spec.lazySink,\n onEscape: function (comp) {\n spec.onEscape(comp);\n return Option.some(true);\n },\n useTabstopAt: function (elem) {\n return !isPseudoStop(elem);\n },\n dom: {\n tag: 'div',\n classes: [dialogClass].concat(spec.extraClasses),\n styles: __assign({ position: 'relative' }, spec.extraStyles)\n },\n components: __spreadArrays([\n spec.header,\n spec.body\n ], spec.footer.toArray()),\n parts: {\n blocker: {\n dom: fromHtml$2('
'),\n components: [{\n dom: {\n tag: 'div',\n classes: isTouch ? [\n blockerBackdropClass,\n blockerBackdropClass + '--opaque'\n ] : [blockerBackdropClass]\n }\n }]\n }\n },\n dragBlockClass: blockerClass,\n modalBehaviours: derive$1(__spreadArrays([\n Focusing.config({}),\n config('dialog-events', spec.dialogEvents.concat([runOnSource(focusin(), function (comp, _se) {\n Keying.focusIn(comp);\n })])),\n config('scroll-lock', [\n runOnAttached(function () {\n add$2(body(), scrollLockClass);\n }),\n runOnDetached(function () {\n remove$4(body(), scrollLockClass);\n })\n ])\n ], spec.extraBehaviours)),\n eventOrder: __assign((_a = {}, _a[execute()] = ['dialog-events'], _a[attachedToDom()] = [\n 'scroll-lock',\n 'dialog-events',\n 'alloy.base.behaviour'\n ], _a[detachedFromDom()] = [\n 'alloy.base.behaviour',\n 'dialog-events',\n 'scroll-lock'\n ], _a), spec.eventOrder)\n });\n };\n\n var renderClose = function (providersBackstage) {\n return Button.sketch({\n dom: {\n tag: 'button',\n classes: [\n 'tox-button',\n 'tox-button--icon',\n 'tox-button--naked'\n ],\n attributes: {\n 'type': 'button',\n 'aria-label': providersBackstage.translate('Close'),\n 'title': providersBackstage.translate('Close')\n }\n },\n components: [{\n dom: {\n tag: 'div',\n classes: ['tox-icon'],\n innerHtml: '' + ''\n }\n }],\n action: function (comp) {\n emit(comp, formCancelEvent);\n }\n });\n };\n var renderTitle = function (spec, id, providersBackstage) {\n var renderComponents = function (data) {\n return [text(providersBackstage.translate(data.title))];\n };\n return {\n dom: {\n tag: 'div',\n classes: ['tox-dialog__title'],\n attributes: __assign({}, id.map(function (x) {\n return { id: x };\n }).getOr({}))\n },\n components: renderComponents(spec),\n behaviours: derive$1([Reflecting.config({\n channel: titleChannel,\n renderComponents: renderComponents\n })])\n };\n };\n var renderDragHandle = function () {\n return { dom: fromHtml$2('
') };\n };\n var renderInlineHeader = function (spec, titleId, providersBackstage) {\n return Container.sketch({\n dom: fromHtml$2('
'),\n components: [\n renderTitle(spec, Option.some(titleId), providersBackstage),\n renderDragHandle(),\n renderClose(providersBackstage)\n ],\n containerBehaviours: derive$1([Dragging.config({\n mode: 'mouse',\n blockerClass: 'blocker',\n getTarget: function (handle) {\n return closest$3(handle, '[role=\"dialog\"]').getOrDie();\n },\n snaps: {\n getSnapPoints: function () {\n return [];\n },\n leftAttr: 'data-drag-left',\n topAttr: 'data-drag-top'\n }\n })])\n });\n };\n var renderModalHeader = function (spec, providersBackstage) {\n var pTitle = ModalDialog.parts().title(renderTitle(spec, Option.none(), providersBackstage));\n var pHandle = ModalDialog.parts().draghandle(renderDragHandle());\n var pClose = ModalDialog.parts().close(renderClose(providersBackstage));\n var components = [pTitle].concat(spec.draggable ? [pHandle] : []).concat([pClose]);\n return Container.sketch({\n dom: fromHtml$2('
'),\n components: components\n });\n };\n\n var getHeader = function (title, backstage) {\n return renderModalHeader({\n title: backstage.shared.providers.translate(title),\n draggable: backstage.dialog.isDraggableModal()\n }, backstage.shared.providers);\n };\n var getEventExtras = function (lazyDialog, extra) {\n return {\n onClose: function () {\n return extra.closeWindow();\n },\n onBlock: function (blockEvent) {\n ModalDialog.setBusy(lazyDialog(), function (d, bs) {\n return {\n dom: {\n tag: 'div',\n classes: ['tox-dialog__busy-spinner'],\n attributes: { 'aria-label': blockEvent.message() },\n styles: {\n left: '0px',\n right: '0px',\n bottom: '0px',\n top: '0px',\n position: 'absolute'\n }\n },\n behaviours: bs,\n components: [{ dom: fromHtml$2('
') }]\n };\n });\n },\n onUnblock: function () {\n ModalDialog.setIdle(lazyDialog());\n }\n };\n };\n var renderModalDialog = function (spec, initialData, dialogEvents, backstage) {\n var _a;\n var updateState = function (_comp, incoming) {\n return Option.some(incoming);\n };\n return build$1(renderDialog(__assign(__assign({}, spec), {\n lazySink: backstage.shared.getSink,\n extraBehaviours: __spreadArrays([\n Reflecting.config({\n channel: dialogChannel,\n updateState: updateState,\n initialData: initialData\n }),\n RepresentingConfigs.memory({})\n ], spec.extraBehaviours),\n onEscape: function (comp) {\n emit(comp, formCancelEvent);\n },\n dialogEvents: dialogEvents,\n eventOrder: (_a = {}, _a[receive()] = [\n 'reflecting',\n 'receiving'\n ], _a[attachedToDom()] = [\n 'scroll-lock',\n 'reflecting',\n 'messages',\n 'dialog-events',\n 'alloy.base.behaviour'\n ], _a[detachedFromDom()] = [\n 'alloy.base.behaviour',\n 'dialog-events',\n 'messages',\n 'reflecting',\n 'scroll-lock'\n ], _a)\n })));\n };\n var mapMenuButtons = function (buttons) {\n var mapItems = function (button) {\n var items = map(button.items, function (item) {\n var cell = Cell(false);\n return __assign(__assign({}, item), { storage: cell });\n });\n return __assign(__assign({}, button), { items: items });\n };\n return map(buttons, function (button) {\n if (button.type === 'menu') {\n return mapItems(button);\n }\n return button;\n });\n };\n var extractCellsToObject = function (buttons) {\n return foldl(buttons, function (acc, button) {\n if (button.type === 'menu') {\n var menuButton = button;\n return foldl(menuButton.items, function (innerAcc, item) {\n innerAcc[item.name] = item.storage;\n return innerAcc;\n }, acc);\n }\n return acc;\n }, {});\n };\n\n var initCommonEvents = function (fireApiEvent, extras) {\n return [\n runWithTarget(focusin(), onFocus$1),\n fireApiEvent(formCloseEvent, function (_api, spec) {\n extras.onClose();\n spec.onClose();\n }),\n fireApiEvent(formCancelEvent, function (api, spec, _event, self) {\n spec.onCancel(api);\n emit(self, formCloseEvent);\n }),\n run(formUnblockEvent, function (_c, _se) {\n return extras.onUnblock();\n }),\n run(formBlockEvent, function (_c, se) {\n return extras.onBlock(se.event());\n })\n ];\n };\n var initUrlDialog = function (getInstanceApi, extras) {\n var fireApiEvent = function (eventName, f) {\n return run(eventName, function (c, se) {\n withSpec(c, function (spec, _c) {\n f(getInstanceApi(), spec, se.event(), c);\n });\n });\n };\n var withSpec = function (c, f) {\n Reflecting.getState(c).get().each(function (currentDialog) {\n f(currentDialog, c);\n });\n };\n return __spreadArrays(initCommonEvents(fireApiEvent, extras), [fireApiEvent(formActionEvent, function (api, spec, event) {\n spec.onAction(api, { name: event.name() });\n })]);\n };\n var initDialog = function (getInstanceApi, extras, getSink) {\n var fireApiEvent = function (eventName, f) {\n return run(eventName, function (c, se) {\n withSpec(c, function (spec, _c) {\n f(getInstanceApi(), spec, se.event(), c);\n });\n });\n };\n var withSpec = function (c, f) {\n Reflecting.getState(c).get().each(function (currentDialogInit) {\n f(currentDialogInit.internalDialog, c);\n });\n };\n return __spreadArrays(initCommonEvents(fireApiEvent, extras), [\n fireApiEvent(formSubmitEvent, function (api, spec) {\n return spec.onSubmit(api);\n }),\n fireApiEvent(formChangeEvent, function (api, spec, event) {\n spec.onChange(api, { name: event.name() });\n }),\n fireApiEvent(formActionEvent, function (api, spec, event, component) {\n var focusIn = function () {\n return Keying.focusIn(component);\n };\n var isDisabled = function (focused) {\n return has$1(focused, 'disabled') || getOpt(focused, 'aria-disabled').exists(function (val) {\n return val === 'true';\n });\n };\n var current = active();\n spec.onAction(api, {\n name: event.name(),\n value: event.value()\n });\n active().fold(focusIn, function (focused) {\n if (isDisabled(focused)) {\n focusIn();\n } else if (current.exists(function (cur) {\n return contains$2(focused, cur) && isDisabled(cur);\n })) {\n focusIn();\n } else {\n getSink().toOption().filter(function (sink) {\n return !contains$2(sink.element(), focused);\n }).each(focusIn);\n }\n });\n }),\n fireApiEvent(formTabChangeEvent, function (api, spec, event) {\n spec.onTabChange(api, {\n newTabName: event.name(),\n oldTabName: event.oldName()\n });\n }),\n runOnDetached(function (component) {\n var api = getInstanceApi();\n Representing.setValue(component, api.getData());\n })\n ]);\n };\n var SilverDialogEvents = {\n initUrlDialog: initUrlDialog,\n initDialog: initDialog\n };\n\n var makeButton = function (button, backstage) {\n return renderFooterButton(button, button.type, backstage);\n };\n var lookup$2 = function (compInSystem, footerButtons, buttonName) {\n return find(footerButtons, function (button) {\n return button.name === buttonName;\n }).bind(function (memButton) {\n return memButton.memento.getOpt(compInSystem);\n });\n };\n var renderComponents = function (_data, state) {\n var footerButtons = state.map(function (s) {\n return s.footerButtons;\n }).getOr([]);\n var buttonGroups = partition(footerButtons, function (button) {\n return button.align === 'start';\n });\n var makeGroup = function (edge, buttons) {\n return Container.sketch({\n dom: {\n tag: 'div',\n classes: ['tox-dialog__footer-' + edge]\n },\n components: map(buttons, function (button) {\n return button.memento.asSpec();\n })\n });\n };\n var startButtons = makeGroup('start', buttonGroups.pass);\n var endButtons = makeGroup('end', buttonGroups.fail);\n return [\n startButtons,\n endButtons\n ];\n };\n var renderFooter = function (initSpec, backstage) {\n var updateState = function (_comp, data) {\n var footerButtons = map(data.buttons, function (button) {\n var memButton = record(makeButton(button, backstage));\n return {\n name: button.name,\n align: button.align,\n memento: memButton\n };\n });\n var lookupByName = function (compInSystem, buttonName) {\n return lookup$2(compInSystem, footerButtons, buttonName);\n };\n return Option.some({\n lookupByName: lookupByName,\n footerButtons: footerButtons\n });\n };\n return {\n dom: fromHtml$2('
'),\n components: [],\n behaviours: derive$1([Reflecting.config({\n channel: footerChannel,\n initialData: initSpec,\n updateState: updateState,\n renderComponents: renderComponents\n })])\n };\n };\n var renderInlineFooter = function (initSpec, backstage) {\n return renderFooter(initSpec, backstage);\n };\n var renderModalFooter = function (initSpec, backstage) {\n return ModalDialog.parts().footer(renderFooter(initSpec, backstage));\n };\n\n var getCompByName = function (access, name) {\n var root = access.getRoot();\n if (root.getSystem().isConnected()) {\n var form_1 = Composing.getCurrent(access.getFormWrapper()).getOr(access.getFormWrapper());\n return Form.getField(form_1, name).fold(function () {\n var footer = access.getFooter();\n var footerState = Reflecting.getState(footer);\n return footerState.get().bind(function (f) {\n return f.lookupByName(form_1, name);\n });\n }, function (comp) {\n return Option.some(comp);\n });\n } else {\n return Option.none();\n }\n };\n var validateData = function (access, data) {\n var root = access.getRoot();\n return Reflecting.getState(root).get().map(function (dialogState) {\n return getOrDie(asRaw('data', dialogState.dataValidator, data));\n }).getOr(data);\n };\n var getDialogApi = function (access, doRedial, menuItemStates) {\n var withRoot = function (f) {\n var root = access.getRoot();\n if (root.getSystem().isConnected()) {\n f(root);\n }\n };\n var getData = function () {\n var root = access.getRoot();\n var valueComp = root.getSystem().isConnected() ? access.getFormWrapper() : root;\n var representedValues = Representing.getValue(valueComp);\n var menuItemCurrentState = map$2(menuItemStates, function (cell) {\n return cell.get();\n });\n return __assign(__assign({}, representedValues), menuItemCurrentState);\n };\n var setData = function (newData) {\n withRoot(function (_) {\n var prevData = instanceApi.getData();\n var mergedData = __assign(__assign({}, prevData), newData);\n var newInternalData = validateData(access, mergedData);\n var form = access.getFormWrapper();\n Representing.setValue(form, newInternalData);\n each$1(menuItemStates, function (v, k) {\n if (has(mergedData, k)) {\n v.set(mergedData[k]);\n }\n });\n });\n };\n var disable = function (name) {\n getCompByName(access, name).each(Disabling.disable);\n };\n var enable = function (name) {\n getCompByName(access, name).each(Disabling.enable);\n };\n var focus = function (name) {\n getCompByName(access, name).each(Focusing.focus);\n };\n var block = function (message) {\n if (!isString(message)) {\n throw new Error('The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument');\n }\n withRoot(function (root) {\n emitWith(root, formBlockEvent, { message: message });\n });\n };\n var unblock = function () {\n withRoot(function (root) {\n emit(root, formUnblockEvent);\n });\n };\n var showTab = function (name) {\n withRoot(function (_) {\n var body = access.getBody();\n var bodyState = Reflecting.getState(body);\n if (bodyState.get().exists(function (b) {\n return b.isTabPanel();\n })) {\n Composing.getCurrent(body).each(function (tabSection) {\n TabSection.showTab(tabSection, name);\n });\n }\n });\n };\n var redial = function (d) {\n withRoot(function (root) {\n var dialogInit = doRedial(d);\n root.getSystem().broadcastOn([dialogChannel], dialogInit);\n root.getSystem().broadcastOn([titleChannel], dialogInit.internalDialog);\n root.getSystem().broadcastOn([bodyChannel], dialogInit.internalDialog);\n root.getSystem().broadcastOn([footerChannel], dialogInit.internalDialog);\n instanceApi.setData(dialogInit.initialData);\n });\n };\n var close = function () {\n withRoot(function (root) {\n emit(root, formCloseEvent);\n });\n };\n var instanceApi = {\n getData: getData,\n setData: setData,\n disable: disable,\n enable: enable,\n focus: focus,\n block: block,\n unblock: unblock,\n showTab: showTab,\n redial: redial,\n close: close\n };\n return instanceApi;\n };\n\n var renderDialog$1 = function (dialogInit, extra, backstage) {\n var header = getHeader(dialogInit.internalDialog.title, backstage);\n var body = renderModalBody({ body: dialogInit.internalDialog.body }, backstage);\n var storagedMenuButtons = mapMenuButtons(dialogInit.internalDialog.buttons);\n var objOfCells = extractCellsToObject(storagedMenuButtons);\n var footer = renderModalFooter({ buttons: storagedMenuButtons }, backstage);\n var dialogEvents = SilverDialogEvents.initDialog(function () {\n return instanceApi;\n }, getEventExtras(function () {\n return dialog;\n }, extra), backstage.shared.getSink);\n var dialogSize = dialogInit.internalDialog.size !== 'normal' ? dialogInit.internalDialog.size === 'large' ? ['tox-dialog--width-lg'] : ['tox-dialog--width-md'] : [];\n var spec = {\n header: header,\n body: body,\n footer: Option.some(footer),\n extraClasses: dialogSize,\n extraBehaviours: [],\n extraStyles: {}\n };\n var dialog = renderModalDialog(spec, dialogInit, dialogEvents, backstage);\n var modalAccess = function () {\n var getForm = function () {\n var outerForm = ModalDialog.getBody(dialog);\n return Composing.getCurrent(outerForm).getOr(outerForm);\n };\n return {\n getRoot: function () {\n return dialog;\n },\n getBody: function () {\n return ModalDialog.getBody(dialog);\n },\n getFooter: function () {\n return ModalDialog.getFooter(dialog);\n },\n getFormWrapper: getForm\n };\n }();\n var instanceApi = getDialogApi(modalAccess, extra.redial, objOfCells);\n return {\n dialog: dialog,\n instanceApi: instanceApi\n };\n };\n\n var renderInlineDialog = function (dialogInit, extra, backstage, ariaAttrs) {\n var _a, _b;\n var dialogLabelId = generate$1('dialog-label');\n var dialogContentId = generate$1('dialog-content');\n var updateState = function (_comp, incoming) {\n return Option.some(incoming);\n };\n var memHeader = record(renderInlineHeader({\n title: dialogInit.internalDialog.title,\n draggable: true\n }, dialogLabelId, backstage.shared.providers));\n var memBody = record(renderInlineBody({ body: dialogInit.internalDialog.body }, dialogContentId, backstage, ariaAttrs));\n var storagedMenuButtons = mapMenuButtons(dialogInit.internalDialog.buttons);\n var objOfCells = extractCellsToObject(storagedMenuButtons);\n var memFooter = record(renderInlineFooter({ buttons: storagedMenuButtons }, backstage));\n var dialogEvents = SilverDialogEvents.initDialog(function () {\n return instanceApi;\n }, {\n onBlock: function () {\n },\n onUnblock: function () {\n },\n onClose: function () {\n return extra.closeWindow();\n }\n }, backstage.shared.getSink);\n var dialog = build$1({\n dom: {\n tag: 'div',\n classes: [\n 'tox-dialog',\n 'tox-dialog-inline'\n ],\n attributes: (_a = { role: 'dialog' }, _a['aria-labelledby'] = dialogLabelId, _a['aria-describedby'] = '' + dialogContentId, _a)\n },\n eventOrder: (_b = {}, _b[receive()] = [\n Reflecting.name(),\n Receiving.name()\n ], _b[execute()] = ['execute-on-form'], _b[attachedToDom()] = [\n 'reflecting',\n 'execute-on-form'\n ], _b),\n behaviours: derive$1([\n Keying.config({\n mode: 'cyclic',\n onEscape: function (c) {\n emit(c, formCloseEvent);\n return Option.some(true);\n },\n useTabstopAt: function (elem) {\n return !isPseudoStop(elem) && (name(elem) !== 'button' || get$2(elem, 'disabled') !== 'disabled');\n }\n }),\n Reflecting.config({\n channel: dialogChannel,\n updateState: updateState,\n initialData: dialogInit\n }),\n Focusing.config({}),\n config('execute-on-form', dialogEvents.concat([runOnSource(focusin(), function (comp, _se) {\n Keying.focusIn(comp);\n })])),\n RepresentingConfigs.memory({})\n ]),\n components: [\n memHeader.asSpec(),\n memBody.asSpec(),\n memFooter.asSpec()\n ]\n });\n var instanceApi = getDialogApi({\n getRoot: function () {\n return dialog;\n },\n getFooter: function () {\n return memFooter.get(dialog);\n },\n getBody: function () {\n return memBody.get(dialog);\n },\n getFormWrapper: function () {\n var body = memBody.get(dialog);\n return Composing.getCurrent(body).getOr(body);\n }\n }, extra.redial, objOfCells);\n return {\n dialog: dialog,\n instanceApi: instanceApi\n };\n };\n\n var global$g = tinymce.util.Tools.resolve('tinymce.util.URI');\n\n var getUrlDialogApi = function (root) {\n var withRoot = function (f) {\n if (root.getSystem().isConnected()) {\n f(root);\n }\n };\n var block = function (message) {\n if (!isString(message)) {\n throw new Error('The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument');\n }\n withRoot(function (root) {\n emitWith(root, formBlockEvent, { message: message });\n });\n };\n var unblock = function () {\n withRoot(function (root) {\n emit(root, formUnblockEvent);\n });\n };\n var close = function () {\n withRoot(function (root) {\n emit(root, formCloseEvent);\n });\n };\n var sendMessage = function (data) {\n withRoot(function (root) {\n root.getSystem().broadcastOn([bodySendMessageChannel], data);\n });\n };\n return {\n block: block,\n unblock: unblock,\n close: close,\n sendMessage: sendMessage\n };\n };\n\n var SUPPORTED_MESSAGE_ACTIONS = [\n 'insertContent',\n 'setContent',\n 'execCommand',\n 'close',\n 'block',\n 'unblock'\n ];\n var isSupportedMessage = function (data) {\n return isObject(data) && SUPPORTED_MESSAGE_ACTIONS.indexOf(data.mceAction) !== -1;\n };\n var isCustomMessage = function (data) {\n return !isSupportedMessage(data) && isObject(data) && has(data, 'mceAction');\n };\n var handleMessage = function (editor, api, data) {\n switch (data.mceAction) {\n case 'insertContent':\n editor.insertContent(data.content);\n break;\n case 'setContent':\n editor.setContent(data.content);\n break;\n case 'execCommand':\n var ui = isBoolean(data.ui) ? data.ui : false;\n editor.execCommand(data.cmd, ui, data.value);\n break;\n case 'close':\n api.close();\n break;\n case 'block':\n api.block(data.message);\n break;\n case 'unblock':\n api.unblock();\n break;\n }\n };\n var renderUrlDialog = function (internalDialog, extra, editor, backstage) {\n var _a;\n var header = getHeader(internalDialog.title, backstage);\n var body = renderIframeBody(internalDialog);\n var footer = internalDialog.buttons.bind(function (buttons) {\n if (buttons.length === 0) {\n return Option.none();\n } else {\n return Option.some(renderModalFooter({ buttons: buttons }, backstage));\n }\n });\n var dialogEvents = SilverDialogEvents.initUrlDialog(function () {\n return instanceApi;\n }, getEventExtras(function () {\n return dialog;\n }, extra));\n var styles = __assign(__assign({}, internalDialog.height.fold(function () {\n return {};\n }, function (height) {\n return {\n 'height': height + 'px',\n 'max-height': height + 'px'\n };\n })), internalDialog.width.fold(function () {\n return {};\n }, function (width) {\n return {\n 'width': width + 'px',\n 'max-width': width + 'px'\n };\n }));\n var classes = internalDialog.width.isNone() && internalDialog.height.isNone() ? ['tox-dialog--width-lg'] : [];\n var iframeUri = new global$g(internalDialog.url, { base_uri: new global$g(domGlobals.window.location.href) });\n var iframeDomain = iframeUri.protocol + '://' + iframeUri.host + (iframeUri.port ? ':' + iframeUri.port : '');\n var messageHandlerUnbinder = Cell(Option.none());\n var extraBehaviours = [\n config('messages', [\n runOnAttached(function () {\n var unbind = bind$3(Element.fromDom(domGlobals.window), 'message', function (e) {\n if (iframeUri.isSameOrigin(new global$g(e.raw().origin))) {\n var data = e.raw().data;\n if (isSupportedMessage(data)) {\n handleMessage(editor, instanceApi, data);\n } else if (isCustomMessage(data)) {\n internalDialog.onMessage(instanceApi, data);\n }\n }\n });\n messageHandlerUnbinder.set(Option.some(unbind));\n }),\n runOnDetached(function () {\n messageHandlerUnbinder.get().each(function (unbinder) {\n return unbinder.unbind();\n });\n })\n ]),\n Receiving.config({\n channels: (_a = {}, _a[bodySendMessageChannel] = {\n onReceive: function (comp, data) {\n descendant$1(comp.element(), 'iframe').each(function (iframeEle) {\n var iframeWin = iframeEle.dom().contentWindow;\n iframeWin.postMessage(data, iframeDomain);\n });\n }\n }, _a)\n })\n ];\n var spec = {\n header: header,\n body: body,\n footer: footer,\n extraClasses: classes,\n extraBehaviours: extraBehaviours,\n extraStyles: styles\n };\n var dialog = renderModalDialog(spec, internalDialog, dialogEvents, backstage);\n var instanceApi = getUrlDialogApi(dialog);\n return {\n dialog: dialog,\n instanceApi: instanceApi\n };\n };\n\n var setup$c = function (extras) {\n var sharedBackstage = extras.backstage.shared;\n var open = function (message, callback) {\n var closeDialog = function () {\n ModalDialog.hide(alertDialog);\n callback();\n };\n var memFooterClose = record(renderFooterButton({\n name: 'close-alert',\n text: 'OK',\n primary: true,\n align: 'end',\n disabled: false,\n icon: Option.none()\n }, 'cancel', extras.backstage));\n var titleSpec = pUntitled();\n var closeSpec = pClose(closeDialog, sharedBackstage.providers);\n var alertDialog = build$1(renderDialog({\n lazySink: function () {\n return sharedBackstage.getSink();\n },\n header: hiddenHeader(titleSpec, closeSpec),\n body: pBodyMessage(message, sharedBackstage.providers),\n footer: Option.some(pFooter(pFooterGroup([], [memFooterClose.asSpec()]))),\n onEscape: closeDialog,\n extraClasses: ['tox-alert-dialog'],\n extraBehaviours: [],\n extraStyles: {},\n dialogEvents: [run(formCancelEvent, closeDialog)],\n eventOrder: {}\n }));\n ModalDialog.show(alertDialog);\n var footerCloseButton = memFooterClose.get(alertDialog);\n Focusing.focus(footerCloseButton);\n };\n return { open: open };\n };\n\n var setup$d = function (extras) {\n var sharedBackstage = extras.backstage.shared;\n var open = function (message, callback) {\n var closeDialog = function (state) {\n ModalDialog.hide(confirmDialog);\n callback(state);\n };\n var memFooterYes = record(renderFooterButton({\n name: 'yes',\n text: 'Yes',\n primary: true,\n align: 'end',\n disabled: false,\n icon: Option.none()\n }, 'submit', extras.backstage));\n var footerNo = renderFooterButton({\n name: 'no',\n text: 'No',\n primary: false,\n align: 'end',\n disabled: false,\n icon: Option.none()\n }, 'cancel', extras.backstage);\n var titleSpec = pUntitled();\n var closeSpec = pClose(function () {\n return closeDialog(false);\n }, sharedBackstage.providers);\n var confirmDialog = build$1(renderDialog({\n lazySink: function () {\n return sharedBackstage.getSink();\n },\n header: hiddenHeader(titleSpec, closeSpec),\n body: pBodyMessage(message, sharedBackstage.providers),\n footer: Option.some(pFooter(pFooterGroup([], [\n footerNo,\n memFooterYes.asSpec()\n ]))),\n onEscape: function () {\n return closeDialog(false);\n },\n extraClasses: ['tox-confirm-dialog'],\n extraBehaviours: [],\n extraStyles: {},\n dialogEvents: [\n run(formCancelEvent, function () {\n return closeDialog(false);\n }),\n run(formSubmitEvent, function () {\n return closeDialog(true);\n })\n ],\n eventOrder: {}\n }));\n ModalDialog.show(confirmDialog);\n var footerYesButton = memFooterYes.get(confirmDialog);\n Focusing.focus(footerYesButton);\n };\n return { open: open };\n };\n\n var validateData$1 = function (data, validator) {\n return getOrDie(asRaw('data', validator, data));\n };\n var isAlertOrConfirmDialog = function (target) {\n return closest$4(target, '.tox-alert-dialog') || closest$4(target, '.tox-confirm-dialog');\n };\n var inlineAdditionalBehaviours = function (editor, isStickyToolbar, isToolbarLocationTop) {\n if (isStickyToolbar && isToolbarLocationTop) {\n return [];\n } else {\n return [Docking.config({\n contextual: {\n lazyContext: function () {\n return Option.some(box(Element.fromDom(editor.getContentAreaContainer())));\n },\n fadeInClass: 'tox-dialog-dock-fadein',\n fadeOutClass: 'tox-dialog-dock-fadeout',\n transitionClass: 'tox-dialog-dock-transition'\n },\n modes: ['top']\n })];\n }\n };\n var setup$e = function (extras) {\n var backstage = extras.backstage;\n var editor = extras.editor;\n var isStickyToolbar$1 = isStickyToolbar(editor);\n var alertDialog = setup$c(extras);\n var confirmDialog = setup$d(extras);\n var open = function (config, params, closeWindow) {\n if (params !== undefined && params.inline === 'toolbar') {\n return openInlineDialog(config, backstage.shared.anchors.inlineDialog(), closeWindow, params.ariaAttrs);\n } else if (params !== undefined && params.inline === 'cursor') {\n return openInlineDialog(config, backstage.shared.anchors.cursor(), closeWindow, params.ariaAttrs);\n } else {\n return openModalDialog(config, closeWindow);\n }\n };\n var openUrl = function (config, closeWindow) {\n return openModalUrlDialog(config, closeWindow);\n };\n var openModalUrlDialog = function (config, closeWindow) {\n var factory = function (contents) {\n var dialog = renderUrlDialog(contents, {\n closeWindow: function () {\n ModalDialog.hide(dialog.dialog);\n closeWindow(dialog.instanceApi);\n }\n }, editor, backstage);\n ModalDialog.show(dialog.dialog);\n return dialog.instanceApi;\n };\n return DialogManager.openUrl(factory, config);\n };\n var openModalDialog = function (config, closeWindow) {\n var factory = function (contents, internalInitialData, dataValidator) {\n var initialData = internalInitialData;\n var dialogInit = {\n dataValidator: dataValidator,\n initialData: initialData,\n internalDialog: contents\n };\n var dialog = renderDialog$1(dialogInit, {\n redial: DialogManager.redial,\n closeWindow: function () {\n ModalDialog.hide(dialog.dialog);\n closeWindow(dialog.instanceApi);\n }\n }, backstage);\n ModalDialog.show(dialog.dialog);\n dialog.instanceApi.setData(initialData);\n return dialog.instanceApi;\n };\n return DialogManager.open(factory, config);\n };\n var openInlineDialog = function (config$1, anchor, closeWindow, ariaAttrs) {\n var factory = function (contents, internalInitialData, dataValidator) {\n var initialData = validateData$1(internalInitialData, dataValidator);\n var inlineDialog = value$3();\n var isToolbarLocationTop = backstage.shared.header.isPositionedAtTop();\n var dialogInit = {\n dataValidator: dataValidator,\n initialData: initialData,\n internalDialog: contents\n };\n var refreshDocking = function () {\n return inlineDialog.on(function (dialog) {\n InlineView.reposition(dialog);\n Docking.refresh(dialog);\n });\n };\n var dialogUi = renderInlineDialog(dialogInit, {\n redial: DialogManager.redial,\n closeWindow: function () {\n inlineDialog.on(InlineView.hide);\n editor.off('ResizeEditor', refreshDocking);\n inlineDialog.clear();\n closeWindow(dialogUi.instanceApi);\n }\n }, backstage, ariaAttrs);\n var inlineDialogComp = build$1(InlineView.sketch(__assign(__assign({\n lazySink: backstage.shared.getSink,\n dom: {\n tag: 'div',\n classes: []\n },\n fireDismissalEventInstead: {}\n }, isToolbarLocationTop ? {} : { fireRepositionEventInstead: {} }), {\n inlineBehaviours: derive$1(__spreadArrays([config('window-manager-inline-events', [run(dismissRequested(), function (_comp, _se) {\n emit(dialogUi.dialog, formCancelEvent);\n })])], inlineAdditionalBehaviours(editor, isStickyToolbar$1, isToolbarLocationTop))),\n isExtraPart: function (_comp, target) {\n return isAlertOrConfirmDialog(target);\n }\n })));\n inlineDialog.set(inlineDialogComp);\n InlineView.showWithin(inlineDialogComp, anchor, premade$1(dialogUi.dialog), Option.some(body()));\n if (!isStickyToolbar$1 || !isToolbarLocationTop) {\n Docking.refresh(inlineDialogComp);\n editor.on('ResizeEditor', refreshDocking);\n }\n dialogUi.instanceApi.setData(initialData);\n Keying.focusIn(dialogUi.dialog);\n return dialogUi.instanceApi;\n };\n return DialogManager.open(factory, config$1);\n };\n var confirm = function (message, callback) {\n confirmDialog.open(message, function (state) {\n callback(state);\n });\n };\n var alert = function (message, callback) {\n alertDialog.open(message, function () {\n callback();\n });\n };\n var close = function (instanceApi) {\n instanceApi.close();\n };\n return {\n open: open,\n openUrl: openUrl,\n alert: alert,\n close: close,\n confirm: confirm\n };\n };\n\n function Theme () {\n global$1.add('silver', function (editor) {\n var _a = setup$b(editor), uiMothership = _a.uiMothership, backstage = _a.backstage, renderUI = _a.renderUI, getUi = _a.getUi;\n Autocompleter.register(editor, backstage.shared);\n var windowMgr = setup$e({\n editor: editor,\n backstage: backstage\n });\n return {\n renderUI: renderUI,\n getWindowManagerImpl: constant(windowMgr),\n getNotificationManagerImpl: function () {\n return NotificationManagerImpl(editor, { backstage: backstage }, uiMothership);\n },\n ui: getUi()\n };\n });\n }\n\n Theme();\n\n}(window));\n","/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n *\n * Version: 5.4.1 (2020-07-08)\n */\n!function(V){\"use strict\";var r=function(e){if(null===e)return\"null\";if(e===undefined)return\"undefined\";var t=typeof e;return\"object\"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&\"Array\"===e.constructor.name)?\"array\":\"object\"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&\"String\"===e.constructor.name)?\"string\":t},t=function(e){return{eq:e}},s=t(function(e,t){return e===t}),i=function(o){return t(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r=r.length&&n.substr(o,o+r.length)===r;var n,r,o},We=function(t){return function(e){return e.replace(t,\"\")}},Ke=We(/^\\s+|\\s+$/g),Xe=We(/^\\s+/g),Ye=We(/\\s+$/g),Ge=/.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/,Je=function(t){return function(e){return qe(e,t)}},Qe=[{name:\"Edge\",versionRegexes:[/.*?edge\\/ ?([0-9]+)\\.([0-9]+)$/],search:function(e){return qe(e,\"edge/\")&&qe(e,\"chrome\")&&qe(e,\"safari\")&&qe(e,\"applewebkit\")}},{name:\"Chrome\",versionRegexes:[/.*?chrome\\/([0-9]+)\\.([0-9]+).*/,Ge],search:function(e){return qe(e,\"chrome\")&&!qe(e,\"chromeframe\")}},{name:\"IE\",versionRegexes:[/.*?msie\\ ?([0-9]+)\\.([0-9]+).*/,/.*?rv:([0-9]+)\\.([0-9]+).*/],search:function(e){return qe(e,\"msie\")||qe(e,\"trident\")}},{name:\"Opera\",versionRegexes:[Ge,/.*?opera\\/([0-9]+)\\.([0-9]+).*/],search:Je(\"opera\")},{name:\"Firefox\",versionRegexes:[/.*?firefox\\/\\ ?([0-9]+)\\.([0-9]+).*/],search:Je(\"firefox\")},{name:\"Safari\",versionRegexes:[Ge,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(qe(e,\"safari\")||qe(e,\"mobile/\"))&&qe(e,\"applewebkit\")}}],Ze=[{name:\"Windows\",search:Je(\"win\"),versionRegexes:[/.*?windows\\ nt\\ ?([0-9]+)\\.([0-9]+).*/]},{name:\"iOS\",search:function(e){return qe(e,\"iphone\")||qe(e,\"ipad\")},versionRegexes:[/.*?version\\/\\ ?([0-9]+)\\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:\"Android\",search:Je(\"android\"),versionRegexes:[/.*?android\\ ?([0-9]+)\\.([0-9]+).*/]},{name:\"OSX\",search:Je(\"mac os x\"),versionRegexes:[/.*?mac\\ os\\ x\\ ?([0-9]+)_([0-9]+).*/]},{name:\"Linux\",search:Je(\"linux\"),versionRegexes:[]},{name:\"Solaris\",search:Je(\"sunos\"),versionRegexes:[]},{name:\"FreeBSD\",search:Je(\"freebsd\"),versionRegexes:[]},{name:\"ChromeOS\",search:Je(\"cros\"),versionRegexes:[/.*?chrome\\/([0-9]+)\\.([0-9]+).*/]}],et={browsers:x(Qe),oses:x(Ze)},tt=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p=et.browsers(),g=et.oses(),h=He(p,e).fold(Be.unknown,Be.nu),v=Ve(g,e).fold(ze.unknown,ze.nu);return{browser:h,os:v,deviceType:(r=h,o=e,i=t,a=(n=v).isiOS()&&!0===/ipad/i.test(o),u=n.isiOS()&&!a,s=n.isiOS()||n.isAndroid(),c=s||i(\"(pointer:coarse)\"),l=a||!u&&s&&i(\"(min-device-width:768px)\"),f=u||s&&!l,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),m=!f&&!l&&!d,{isiPad:x(a),isiPhone:x(u),isTablet:x(l),isPhone:x(f),isTouch:x(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:x(d),isDesktop:x(m)})}},nt=function(e){return V.window.matchMedia(e).matches},rt=(ke=!(Ne=function(){return tt(V.navigator.userAgent,nt)}),function(){for(var e=[],t=0;t\\\"\\u0060\\u007E-\\uD7FF\\uE000-\\uFFEF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,ur=/[<>&\\u007E-\\uD7FF\\uE000-\\uFFEF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,sr=/[<>&\\\"\\']/g,cr=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,lr={128:\"\\u20ac\",130:\"\\u201a\",131:\"\\u0192\",132:\"\\u201e\",133:\"\\u2026\",134:\"\\u2020\",135:\"\\u2021\",136:\"\\u02c6\",137:\"\\u2030\",138:\"\\u0160\",139:\"\\u2039\",140:\"\\u0152\",142:\"\\u017d\",145:\"\\u2018\",146:\"\\u2019\",147:\"\\u201c\",148:\"\\u201d\",149:\"\\u2022\",150:\"\\u2013\",151:\"\\u2014\",152:\"\\u02dc\",153:\"\\u2122\",154:\"\\u0161\",155:\"\\u203a\",156:\"\\u0153\",158:\"\\u017e\",159:\"\\u0178\"},fr={'\"':\""\",\"'\":\"'\",\"<\":\"<\",\">\":\">\",\"&\":\"&\",\"`\":\"`\"},dr={\"<\":\"<\",\">\":\">\",\"&\":\"&\",\""\":'\"',\"'\":\"'\"},mr=function(e,t){var n,r,o,i={};if(e){for(e=e.split(\",\"),t=t||10,n=0;n>10),56320+(1023&t))):lr[t]||String.fromCharCode(t):dr[e]||pr[e]||(n=e,(r=Ct.fromTag(\"div\").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},br={},Cr={},wr=yt.makeMap,xr=yt.each,Sr=yt.extend,Nr=yt.explode,Er=yt.inArray,kr=function(e,t){return(e=yt.trim(e))?e.split(t||\" \"):[]},_r=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n
').css(n).appendTo(a)[0];return c.set(B.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&Ri(e.caret).addClass(\"mce-visual-caret-before\")}),d(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:f,getCss:function(){return\".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}\"},reposition:function(){c.get().each(function(e){var t=bc(a,e.element,e.before);Ri(e.caret).css(xe({},t))})},destroy:function(){return fa.clearInterval(n)}}},wc=function(){return vc.isIE()||vc.isEdge()||vc.isFirefox()},xc=function(e){return yc(e)||xn(e)&&wc()},Sc=Dn,Nc=bn(\"display\",\"block table table-cell table-caption list-item\"),Ec=Eu,kc=Su,_c=vn,Tc=Zu,Rc=function(e,t){for(var n;n=e(t);)if(!kc(n))return n;return null},Ac=function(e,t,n,r,o){var i=new Ai(e,r);if(t<0){if((Sc(e)||kc(e))&&n(e=Rc(i.prev,!0)))return e;for(;e=Rc(i.prev,o);)if(n(e))return e}if(0=o.data.length-1)return 1===e&&(r=u(o))?Ic(r):n;if(Au(o)&&s<=1)return-1===e&&(r=a(o))?Mc(r):n;if(s===o.data.length)return(r=u(o))?Ic(r):n;if(0===s)return(r=a(o))?Mc(r):n}return n},Uc=function(e,t){return B.from(Bc(e?0:-1,t)).filter(Sc)},zc=function(e,t,n){var r=Fc(e,t,n);return-1===e?Cs.fromRangeStart(r):Cs.fromRangeEnd(r)},jc=function(e){return B.from(e.getNode()).map(Ct.fromDom)},Hc=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Vc=function(e,t){var n=Oc(e,t);return!(n||!Rn(e.getNode()))||n};(xs=ws=ws||{})[xs.Backwards=-1]=\"Backwards\",xs[xs.Forwards=1]=\"Forwards\";var qc,$c=Dn,Wc=En,Kc=vn,Xc=Rn,Yc=Zu,Gc=function(e){return Gu(e)||!!es(t=e)&&!0!==W(te(t.getElementsByTagName(\"*\")),function(e,t){return e||$u(t)},!1);var t},Jc=ts,Qc=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!bl(c,i,r)||yl(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},wl=function(e){return En(e)&&0=n.length?t=n.length-1:t<0&&(t=0),n[t]||e},rf=function(e,t,u){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=function(e){var t;return 3===(t=e[0]).nodeType&&t===n&&r>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===i&&0\":\" />\",n&&s&&l[e]&&0\"),s&&l[e]&&0\")},comment:function(e){u.push(\"\\x3c!--\",e,\"--\\x3e\")},pi:function(e,t){t?u.push(\"\"):u.push(\"\"),s&&u.push(\"\\n\")},doctype:function(e){u.push(\"\",s?\"\\n\":\"\")},reset:function(){u.length=0},getContent:function(){return u.join(\"\").replace(/\\n$/,\"\")}}},Of=function(t,p){void 0===p&&(p=Rr());var g=Df(t);(t=t||{}).validate=!(\"validate\"in t)||t.validate;return{serialize:function(e){var f=t.validate,d={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=d[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,f&&r&&1]+(?:(?:\"[^\"]*\")|(?:\\'[^\\']*\\')|[^>]*))*|\\/|\\s+)>/g;for(u.lastIndex=r=n;o=u.exec(t);){if(r=u.lastIndex,\"/\"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r},Lf=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return\"string\"==typeof r&&\"data-mce-bogus\"===r.toLowerCase()?o:null}return null};function If(W,K){void 0===K&&(K=Rr());var e=function(){};!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:e,Y=W.cdata?W.cdata:e,G=W.text?W.text:e,J=W.start?W.start:e,Q=W.end?W.end:e,Z=W.pi?W.pi:e,ee=W.doctype?W.doctype:e,n=function(m,e){void 0===e&&(e=\"html\");for(var t,n,r,p,o,i,a,g,u,s,c,l,f,h,v,d,y,b,C,w=m.html,x=0,S=[],N=0,E=yr.decode,k=yt.makeMap(\"src,href,data,background,formaction,poster,xlink:href\"),_=/((java|vb)script|mhtml):/i,T=\"html\"===e?0:1,R=function(e){var t,n;for(t=S.length;t--&&S[t].name!==e;);if(0<=t){for(n=S.length-1;t<=n;n--)(e=S[n]).valid&&Q(e.name);S.length=t}},A=function(e,t){return G(Bf(e,m),t)},D=function(e){\"\"!==e&&(\">\"===e.charAt(0)&&(e=\" \"+e),W.allow_conditional_comments||\"[if\"!==e.substr(0,3).toLowerCase()||(e=\" \"+e),X(Bf(e,m)))},O=function(e,t){var n=e||\"\",r=!$e(n,\"--\"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf(\"[if \",n)&&(u=n,/^\\s*\\[if [\\w\\W]+\\]>.*/.test(r.substr(u)))){var o=r.indexOf(\"[endif]\",n);return r.indexOf(\">\",o)}if(t){var i=r.indexOf(\">\",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(w,r,t);return e=w.substr(t,o-t),D(r?n+e:e),o+1},B=function(e,t,n,r,o){var i,a,u,s,c,l;if(t=t.toLowerCase(),u=t in F?t:E(n||r||o||\"\"),n=de(m.uris,u).getOr(u),U&&!g&&!1==(0===(s=t).indexOf(\"data-\")||0===s.indexOf(\"aria-\"))){if(!(i=h[t])&&v){for(a=v.length;a--&&!(i=v[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(k[t]&&!W.allow_script_urls){var f=n.replace(/[\\s\\u0000-\\u001F]+/g,\"\");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(_.test(f))return;if(l=f,!(c=W).allow_html_data_urls&&(/^data:image\\//i.test(l)?!1===c.allow_svg_data_urls&&/^data:image\\/svg\\+xml/i.test(l):/^data:/i.test(l)))return}g&&(t in k||0===t.indexOf(\"on\"))||(p.map[t]=n,p.push({name:t,value:n}))},P=new RegExp(\"<(?:(?:!--([\\\\w\\\\W]*?)--!?>)|(?:!\\\\[CDATA\\\\[([\\\\w\\\\W]*?)\\\\]\\\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\\\w\\\\W]*?)>)|(?:!(--)?)|(?:\\\\?([^\\\\s\\\\/<>]+) ?([\\\\w\\\\W]*?)[?/]>)|(?:\\\\/([A-Za-z][A-Za-z0-9\\\\-_\\\\:\\\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\\\-_\\\\:\\\\.]*)((?:\\\\s+[^\\\"'>]+(?:(?:\\\"[^\\\"]*\\\")|(?:'[^']*')|[^>]*))*|\\\\/|\\\\s+)>))\",\"g\"),L=/([\\w:\\-]+)(?:\\s*=\\s*(?:(?:\\\"((?:[^\\\"])*)\\\")|(?:\\'((?:[^\\'])*)\\')|([^>\\s]+)))?/g,I=K.getShortEndedElements(),M=W.self_closing_elements||K.getSelfClosingElements(),F=K.getBoolAttrs(),U=W.validate,z=W.remove_internals,j=W.fix_self_closing,H=K.getSpecialElements(),V=w+\">\";t=P.exec(V);){var q=t[0];if(xw.length){A(E(w.substr(t.index))),x=t.index+q.length;continue}\":\"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),u=n in I,j&&M[n]&&0]*data-mce-bogus=\"all\"[^>]*>/g,f=e.schema;a=e.getTempAttrs(),u=c,s=new RegExp([\"\\\\s?(\"+a.join(\"|\")+')=\"[^\"]+\"'].join(\"|\"),\"gi\"),c=u.replace(s,\"\");for(var d=f.getShortEndedElements();i=l.exec(c);)r=l.lastIndex,o=i[0].length,n=d[i[1]]?r:Hf.findEndTag(f,c,r),c=c.substring(0,r-o)+c.substring(n),l.lastIndex=r-o;return Cu(c)},qf=Vf,$f=function(e,t,n,r){var o,i,a,u,s;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire(\"BeforeGetContent\",t),\"raw\"===t.format)o=yt.trim(qf(e.serializer,r.innerHTML));else if(\"text\"===t.format)o=Cu(r.innerText||r.textContent);else{if(\"tree\"===t.format)return e.serializer.serialize(r,t);a=(i=e).serializer.serialize(r,t),u=Ys(i),s=new RegExp(\"^(<\"+u+\"[^>]*>( | |\\\\s|\\xa0|
|)<\\\\/\"+u+\">[\\r\\n]*|
[\\r\\n]*)$\"),o=a.replace(s,\"\")}return\"text\"===t.format||nr(Ct.fromDom(r))?t.content=o:t.content=yt.trim(o),t.no_events||e.fire(\"GetContent\",t),t.content},Wf=yt.each,Kf=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Wf(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf(\"_\")&&\"style\"!==t&&0!==t.indexOf(\"data-\")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,\"style\")),o.parseStyle(o.getAttrib(t,\"style\")))&&(!kl(e)&&!kl(t)))}},Xf=function(n,r,o){return B.from(o.container()).filter(En).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Yf=N(Xf,!0,Tl),Gf=N(Xf,!1,Tl),Jf=function(e){var t=e.container();return En(t)&&0===t.data.length},Qf=function(t,n){return function(e){return B.from(Bc(t?0:-1,e)).filter(n).isSome()}},Zf=function(e){return\"IMG\"===e.nodeName&&\"block\"===Fn(Ct.fromDom(e),\"display\")},ed=function(e){return Dn(e)&&!(vn(t=e)&&\"all\"===t.getAttribute(\"data-mce-bogus\"));var t},td=Qf(!0,Zf),nd=Qf(!1,Zf),rd=Qf(!0,xn),od=Qf(!1,xn),id=Qf(!0,ed),ad=Qf(!1,ed),ud=function(e,t){var n,r,o,i=Ct.fromDom(e),a=Ct.fromDom(t);return n=a,r=\"pre,code\",o=N(Dt,i),eu(n,r,o).isSome()},sd=function(e,t){return Zu(t)&&!1===(r=e,En(o=t)&&/^[ \\t\\r\\n]*$/.test(o.data)&&!1===ud(r,o))||vn(n=t)&&\"A\"===n.nodeName&&n.hasAttribute(\"name\")||cd(t);var n,r,o},cd=Cn(\"data-mce-bookmark\"),ld=Cn(\"data-mce-bogus\"),fd=(Mf=\"data-mce-bogus\",Ff=\"all\",function(e){return vn(e)&&e.getAttribute(Mf)===Ff}),dd=function(e,t){return void 0===t&&(t=!0),function(e,t){var n,r=0;if(sd(e,e))return!1;if(!(n=e.firstChild))return!0;var o=new Ai(n,e);do{if(t){if(fd(n)){n=o.next(!0);continue}if(ld(n)){n=o.next();continue}}if(Rn(n))r++,n=o.next();else{if(sd(e,n))return!1;n=o.next()}}while(n);return r<=1}(e.dom(),t)},md=function(e){var t=Ya(e,\"br\"),n=H(function(e){for(var t=[],n=e.dom();n;)t.push(Ct.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Yn);t.length===n.length&&z(n,nn)},pd=function(e){tn(e),Zt(e,Ct.fromHtml('
'))},gd=function(n){$t(n).each(function(t){Ft(t).each(function(e){Kn(n)&&Yn(t)&&Kn(e)&&nn(t)})})},hd=function(e,t,n){return Bt(t,e)?function(e,t){for(var n=A(t)?t:g,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Ct.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Dt(e,t)}).slice(0,-1):[]},vd=function(e,t){return hd(e,t,x(!1))},yd=function(e,t){return[e].concat(vd(e,t))},bd=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,W(r=a,function(e,t){return Tl(t)||_l(t)?e.previousCharIsSpace||\"\"===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+Dr}:{previousCharIsSpace:!0,str:e.str+\" \"}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:\"\"}).str))}},Cd=function(e,t){var n=e.data.slice(t),r=n.length-Xe(n).length;return bd(e,t,r)},wd=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Ss.isTextPosition(n)&&o===r.parentNode&&i>Ss.before(r).offset()?Ss(t.container(),t.offset()-1):t;var n,r,o,i},xd=function(e){return Zu(e.previousSibling)?B.some((t=e.previousSibling,En(t)?Ss(t,t.data.length):Ss.after(t))):e.previousSibling?ml(e.previousSibling):B.none();var t},Sd=function(e){return Zu(e.nextSibling)?B.some((t=e.nextSibling,En(t)?Ss(t,0):Ss.before(t))):e.nextSibling?dl(e.nextSibling):B.none();var t},Nd=function(r,o){return xd(o).orThunk(function(){return Sd(o)}).orThunk(function(){return e=r,t=o,n=Ss.before(t.previousSibling?t.previousSibling:t.parentNode),fl(e,n).fold(function(){return ll(e,Ss.after(t))},B.some);var e,t,n})},Ed=function(n,r){return Sd(r).orThunk(function(){return xd(r)}).orThunk(function(){return t=r,ll(e=n,Ss.after(t)).fold(function(){return fl(e,Ss.before(t))},B.some);var e,t})},kd=function(e,t,n){return(e?Ed:Nd)(t,n).map(N(wd,n))},_d=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Td=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(wt(t))},Rd=function(e){if(dd(e)){var t=Ct.fromHtml('
');return tn(e),Zt(e,t),B.some(Ss.before(t.dom()))}return B.none()},Ad=function(e,t,l){var n,r,o,i,a=Ft(e).filter(Et),u=Ut(e).filter(Et);return nn(e),r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Ye((r=u).data).length,r.appendData(o.data),nn(Ct.fromDom(o)),i&&Cd(r,a),n.container()===s?Ss(u,c):n},((n=a).isSome()&&r.isSome()&&o.isSome()?B.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):B.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Ye(r).length,bd(t,n-o,o);var t,n,r,o}),u.each(function(e){return Cd(e.dom(),0)})),t})},Dd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=kd(n,t.getBody(),e.dom()),u=Qa(e,N(Td,t),(o=t.getBody(),function(e){return e.dom()===o})),s=Ad(e,a,(i=e,me(t.schema.getTextInlineElements(),wt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(\"\"),t.selection.setCursorLocation()):u.bind(Rd).fold(function(){r&&_d(t,n,s)},function(e){r&&_d(t,n,B.some(e))})},Od=function(e,t){return{start:e,end:t}},Bd=Qi([{removeTable:[\"element\"]},{emptyCells:[\"cells\"]},{deleteCellSelection:[\"rng\",\"cell\"]}]),Pd=function(e,t){return nu(Ct.fromDom(e),\"td,th\",t)},Ld=function(e,t){return eu(e,\"table\",t)},Id=function(e){return!Dt(e.start,e.end)},Md=function(e,t){return Ld(e.start,t).bind(function(r){return Ld(e.end,t).bind(function(e){return t=Dt(r,e),n=r,t?B.some(n):B.none();var t,n})})},Fd=function(e){return Ya(e,\"td,th\")},Ud=function(r,e){var t=Pd(e.startContainer,r),n=Pd(e.endContainer,r);return e.collapsed?B.none():Bu(t,n,Od).fold(function(){return t.fold(function(){return n.bind(function(t){return Ld(t,r).bind(function(e){return Z(Fd(e)).map(function(e){return Od(e,t)})})})},function(t){return Ld(t,r).bind(function(e){return ee(Fd(e)).map(function(e){return Od(t,e)})})})},function(e){return zd(r,e)?B.none():(n=r,Ld((t=e).start,n).bind(function(e){return ee(Fd(e)).map(function(e){return Od(t.start,e)})}));var t,n})},zd=function(e,t){return Md(t,e).isSome()},jd=function(e,t,n){return e.filter(function(e){return Id(e)&&zd(n,e)}).orThunk(function(){return Ud(n,t)}).bind(function(e){return Md(t=e,n).map(function(e){return{rng:t,table:e,cells:Fd(e)}});var t})},Hd=function(e,t){return X(e,function(e){return Dt(e,t)})},Vd=function(e,r,o){return e.filter(function(e){return n=o,!Id(t=e)&&Md(t,n).exists(function(e){var t=e.dom().rows;return 1===t.length&&1===t[0].cells.length})&&ff(e.start,r);var t,n}).map(function(e){return e.start})},qd=function(n){return Bu(Hd((r=n).cells,r.rng.start),Hd(r.cells,r.rng.end),function(e,t){return r.cells.slice(e,t+1)}).map(function(e){var t=n.cells;return e.length===t.length?Bd.removeTable(n.table):Bd.emptyCells(e)});var r},$d=function(e,t){var n,r,o,i,a,u=(n=e,function(e){return Dt(n,e)}),s=(o=u,i=Pd((r=t).startContainer,o),a=Pd(r.endContainer,o),Bu(i,a,Od));return Vd(s,t,u).map(function(e){return Bd.deleteCellSelection(t,e)}).orThunk(function(){return jd(s,t,u).bind(qd)})},Wd=function(e){var t;return(8===xt(t=e)||\"#comment\"===wt(t)?Ft:$t)(e).bind(Wd).orThunk(function(){return B.some(e)})},Kd=function(e,t){return z(t,pd),e.selection.setCursorLocation(t[0].dom(),0),!0},Xd=function(e,t,n){t.deleteContents();var r,o=Wd(n).getOr(n),i=Ct.fromDom(e.dom.getParent(o.dom(),e.dom.isBlock));if(dd(i)&&(pd(i),e.selection.setCursorLocation(i.dom(),0)),!Dt(n,i)){var a=Mt(i).is(n)?[]:Mt(r=i).map(Ht).map(function(e){return H(e,function(e){return!Dt(r,e)})}).getOr([]);z(a.concat(Ht(n)),function(e){Dt(e,i)||Bt(e,i)||nn(e)})}return!0},Yd=function(e,t){return Dd(e,!1,t),!0},Gd=function(n,e,r,t){return Qd(e,t).fold(function(){return t=n,$d(e,r).map(function(e){return e.fold(N(Yd,t),N(Kd,t),N(Xd,t))});var t},function(e){return Zd(n,e)}).getOr(!1)},Jd=function(e,t){return K(yd(t,e),tr)},Qd=function(e,t){return K(yd(t,e),function(e){return\"caption\"===wt(e)})},Zd=function(e,t){return pd(t),e.selection.setCursorLocation(t.dom(),0),B.some(!0)},em=function(u,s,c,l,f){return ul(c,u.getBody(),f).bind(function(e){return o=c,i=f,a=e,dl((r=l).dom()).bind(function(t){return ml(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Zd(u,l):(t=l,n=e,Qd(s,Ct.fromDom(n.getNode())).map(function(e){return!1===Dt(e,t)}));var t,n,r,o,i,a}).or(B.some(!0))},tm=function(o,i,a,e){var u=Ss.fromRangeStart(o.selection.getRng());return Jd(a,e).bind(function(e){return dd(e)?Zd(o,e):(t=a,n=e,r=u,ul(i,o.getBody(),r).bind(function(e){return Jd(t,Ct.fromDom(e.getNode())).map(function(e){return!1===Dt(e,n)})}));var t,n,r}).getOr(!1)},nm=function(e,t){return(e?rd:od)(t)},rm=function(a,u,r){var s=Ct.fromDom(a.getBody());return Qd(s,r).fold(function(){return tm(a,u,s,r)||(e=a,t=u,n=Ss.fromRangeStart(e.selection.getRng()),nm(t,n)||al(t,e.getBody(),n).map(function(e){return nm(t,e)}).getOr(!1));var e,t,n},function(e){return t=a,n=u,r=s,o=e,i=Ss.fromRangeStart(t.selection.getRng()),(dd(o)?Zd(t,o):em(t,r,n,o,i)).getOr(!1);var t,n,r,o,i})},om=function(e,t){var n,r,o,i,a,u=Ct.fromDom(e.selection.getStart(!0)),s=sf(e);return e.selection.isCollapsed()&&0===s.length?rm(e,t,u):(n=e,r=u,o=Ct.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=sf(n)).length?Kd(n,a):Gd(n,o,i,r))},im=function(a){var u=Ss.fromRangeStart(a),s=Ss.fromRangeEnd(a),c=a.commonAncestorContainer;return al(!1,c,s).map(function(e){return!Oc(u,s,c)&&Oc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=V.document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},am=function(e){return e.collapsed?e:im(e)},um=function(e,t){var n,r;return e.getBlockElements()[t.name]&&((r=t).firstChild&&r.firstChild===r.lastChild)&&(\"br\"===(n=t.firstChild).name||n.value===Dr)},sm=function(e,t){var n,r,o,i=t.firstChild,a=t.lastChild;return i&&\"meta\"===i.name&&(i=i.next),a&&\"mce_marker\"===a.attr(\"id\")&&(a=a.prev),r=a,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||um(n,r))&&(a=a.prev),!(!i||i!==a)&&(\"ul\"===i.name||\"ol\"===i.name)},cm=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&((t=e.firstChild).data===Dr||Rn(t));var t},lm=function(e){return 0|)$/,\" \"):m(\"nextSibling\")||(l=l.replace(/( | )(
|)$/,\" \"))),t=l);var h=e.parser,v=n.merge,y=Of({validate:e.getParam(\"validate\")},e.schema),b='​';if(i={content:t,format:\"html\",selection:!0,paste:n.paste},(i=e.fire(\"BeforeSetContent\",i)).isDefaultPrevented())e.fire(\"SetContent\",{content:i.content,format:\"html\",selection:!0,paste:n.paste});else{-1===(t=i.content).indexOf(\"{$caret}\")&&(t+=\"{$caret}\"),t=t.replace(/\\{\\$caret\\}/,b);var C,w,x,S,N,E,k=(u=p.getRng()).startContainer||(u.parentElement?u.parentElement():null),_=e.getBody();k===_&&p.isCollapsed()&&g.isBlock(_.firstChild)&&(C=e,(w=_.firstChild)&&!C.schema.getShortEndedElements()[w.nodeName])&&g.isEmpty(_.firstChild)&&((u=g.createRng()).setStart(_.firstChild,0),u.setEnd(_.firstChild,0),p.setRng(u)),p.isCollapsed()||(vm(e),x=e.selection.getRng(),S=t,N=x.startContainer,E=x.startOffset,En(N)&&x.collapsed&&(N.data[E]===Dr?(N.deleteData(E,1),/[\\u00a0| ]$/.test(S)||(S+=\" \")):N.data[E-1]===Dr&&(N.deleteData(E-1,1),/[\\u00a0| ]$/.test(S)||(S=\" \"+S))),t=S);var T,R,A,D={context:(r=p.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},O=h.parse(t,D);if(!0===n.paste&&sm(e.schema,O)&&fm(g,r))return u=pm(y,g,e.selection.getRng(),O),e.selection.setRng(u),void e.fire(\"SetContent\",i);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr(\"data-mce-fragment\",\"1\")}(O),\"mce_marker\"===(s=O.lastChild).attr(\"id\"))for(s=(a=s).prev;s;s=s.walk(!0))if(3===s.type||!g.isBlock(s.name)){e.schema.isValidChild(s.parent.name,\"span\")&&s.parent.insert(a,s,\"br\"===s.name);break}if(e._selectionOverrides.showBlockCaretContainer(r),D.invalid){for(hm(e,b),r=p.getNode(),o=e.getBody(),9===r.nodeType?r=s=o:s=r;s!==o;)s=(r=s).parentNode;t=r===o?o.innerHTML:g.getOuterHTML(r),t=y.serialize(h.parse(t.replace(//i,function(){return y.serialize(O)}))),r===o?g.setHTML(o,t):g.setOuterHTML(r,t)}else!function(e,t,n){if(\"all\"===n.getAttribute(\"data-mce-bogus\"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&\"BR\"===r.nodeName?e.dom.setHTML(n,t):hm(e,t)}}(e,t=y.serialize(O),r);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Kf(r);yt.each(r.select(\"*[data-mce-fragment]\"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,v),function(n,e){var t,r,o=n.dom,i=n.selection;if(e){n.selection.scrollIntoView(e);var a=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if(\"false\"===n.dom.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),mt.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),gm(c)||c.getAttribute(\"data-mce-fragment\")||!(t=function(e){var t=Ss.fromRangeStart(e);if(t=tl(n.getBody()).next(t))return t.toRange()}(u))?o.add(c,o.create(\"br\",{\"data-mce-bogus\":\"1\"})):(u=t,o.remove(c))),i.setRng(u)}}(e,g.get(\"mce_marker\")),T=e.getBody(),yt.each(T.getElementsByTagName(\"*\"),function(e){e.removeAttribute(\"data-mce-fragment\")}),R=e.dom,A=e.selection.getStart(),B.from(R.getParent(A,\"td,th\")).map(Ct.fromDom).each(gd),e.fire(\"SetContent\",i),e.addVisual()}},bm=function(e){var t=Kt(e).dom();return e.dom()===t.activeElement},Cm=function(e){return void 0===e&&(e=Ct.fromDom(V.document)),B.from(e.dom().activeElement).map(Ct.fromDom)},wm=function(e,t,n,r){return{start:x(e),soffset:x(t),finish:x(n),foffset:x(r)}},xm=Qi([{before:[\"element\"]},{on:[\"element\",\"offset\"]},{after:[\"element\"]}]),Sm=(xm.before,xm.on,xm.after,function(e){return e.fold(o,o,o)}),Nm=Qi([{domRange:[\"rng\"]},{relative:[\"startSitu\",\"finishSitu\"]},{exact:[\"start\",\"soffset\",\"finish\",\"foffset\"]}]),Em={domRange:Nm.domRange,relative:Nm.relative,exact:Nm.exact,exactFromRange:function(e){return Nm.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return Ct.fromDom(e.startContainer)},relative:function(e,t){return Sm(e)},exact:function(e,t,n,r){return e}});return It(t)},range:wm},km=ot().browser,_m=function(e,t){var n=Et(t)?vf(t).length:Ht(t).length+1;return n',\"TABLE\"===n.nodeName?r=\"\"+a+\"\":/^(UL|OL)$/.test(n.nodeName)&&(r=\"
  • \"+a+\"
  • \"),r=(i=Ys(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,Gs(t),r)):r||'
    ',tp(t,r),t.fire(\"SetContent\",o)):(\"raw\"!==o.format&&(r=Of({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=nr(Ct.fromDom(n))?r:yt.trim(r),tp(t,o.content),o.no_events||t.fire(\"SetContent\",o)),o.content);var t,n,r,o,i,a})},rp=function(e,t){return e.splitText(t)},op=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&En(t)?0
    \").append(n.childNodes)}))},_p[zf=\"pre\"]||(_p[zf]=[]),_p[zf].push(jf);var Ap,Dp,Op=/^(src|href|style)$/,Bp=yt.each,Pp=Ml,Lp=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},Ip=function(e,t,n){var r,o;if(r=t[n?\"startContainer\":\"endContainer\"],o=t[n?\"startOffset\":\"endOffset\"],vn(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[i=r.nodeValue.length&&(r=new Ai(r,e.getBody()).next()||r),En(r)&&!n&&0===o&&(r=new Ai(r,e.getBody()).prev()||r),r},Mp=function(e,t){var n=t?\"firstChild\":\"lastChild\";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return\"TR\"===e.nodeName&&r[n]||r}return e},Fp=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Up=function(e,t,n,r,o){var i=Ct.fromDom(t),a=Ct.fromDom(e.create(r,o)),u=(n?jt:zt)(i);return en(a,u),n?(Gt(i,a),Qt(a,i)):(Jt(i,a),Zt(a,i)),a.dom()},zp=function(e,t,n,r){return!(t=Ol(t,n,r))||\"BR\"===t.nodeName||e.isBlock(t)},jp=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(Pp(s=t,(c=r).inline)||Pp(s,c.block)||c.selector&&(vn(s)&&u.is(s,c.selector))||(a=t,r.links&&\"A\"===a.nodeName)))return!1;var f,d,m,p,g,h,v,y=t;if(r.inline&&\"all\"===r.remove&&k(r.preserve_attributes)){var b=H(l.getAttribs(y),function(e){return M(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),z(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells().length:e},0)},ag=function(e,t){for(var n,r=e.rows(),o=0;o\")?{type:\"fragmented\",fragments:r,content:\"\",bookmark:null,beforeBookmark:null}:{type:\"complete\",fragments:null,content:o,bookmark:null,beforeBookmark:null}},Eg=function(e,t,n){\"fragmented\"===t.type?xg(t.fragments,e.getBody()):e.setContent(t.content,{format:\"raw\"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},kg=function(e){return\"fragmented\"===e.type?e.fragments.join(\"\"):e.content},_g=function(e){var t=Ct.fromTag(\"body\",Sg.get().getOrThunk(function(){var e=V.document.implementation.createHTMLDocument(\"undo\");return Sg.set(B.some(e)),e}));return du(t,kg(e)),z(Ya(t,\"*[data-mce-bogus]\"),rn),t.dom().innerHTML},Tg=function(e,t){return!(!e||!t)&&(r=t,kg(e)===kg(r)||(n=t,_g(e)===_g(n)));var n,r},Rg=function(e){return 0===e.get()},Ag=function(e,t,n){Rg(n)&&(e.typing=t)},Dg=function(e,t){e.typing&&(Ag(e,!1,t),e.add())},Og=function(e){return e instanceof Tf},Bg=function(e,t){Zm(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},Pg=function(){return{type:\"complete\",fragments:[],content:\"\",bookmark:null,beforeBookmark:null}},Lg=function(s){return{undoManager:{beforeChange:function(e,t){return n=s,r=t,void(Rg(e)&&r.set(B.some($s(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=Ng(e);if(i=i||{},i=yt.extend(i,u),!1===Rg(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire(\"BeforeAddUndo\",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&Tg(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam(\"custom_undo_redo_levels\",0,\"number\");if(c&&t.data.length>c){for(var l=0;l\",visual:!0,font_size_legacy_values:\"xx-small,small,medium,large,x-large,xx-large,300%\",forced_root_block:\"p\",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:\"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist\",indent_after:\"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist\",entity_encoding:\"named\",url_converter:u.convertURL,url_converter_scope:u},xe(xe({},s),a?Zg:{}));return ih(Gg||Jg,Gg,c,r,o)},uh=function(e,t,n){return B.from(t.settings[n]).filter(e)},sh=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return\"hash\"===r?(a={},\"string\"==typeof(i=u)?z(0\\ufeff
    ');return Gt(n.element,r),Ph(r,function(){return nn(r)})},Ih=function(n,r,o,i){zh(n,function(e,t){return Fh(n,r,o,i)},o)},Mh=function(e,t,n,r,o){var i,a,u={elm:r.element.dom(),alignToTop:o};i=u,e.fire(\"ScrollIntoView\",i).isDefaultPrevented()||(n(t,ln(t).top(),r,o),a=u,e.fire(\"AfterScrollIntoView\",a))},Fh=function(e,t,n,r){var o=Ct.fromDom(e.getBody()),i=Ct.fromDom(e.getDoc());o.dom().offsetWidth;var a=Lh(Ct.fromDom(n.startContainer),n.startOffset);Mh(e,i,t,a,r),a.cleanup()},Uh=function(e,t,n,r){var o,i=Ct.fromDom(e.getDoc());Mh(e,i,n,(o=t,Ph(Ct.fromDom(o),f)),r)},zh=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Ct.fromDom(r),Ct.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},jh=function(e,t,n,r){var o=e.pos;if(n)fn(o.left(),o.top(),r);else{var i=o.top()-t+e.height;fn(o.left(),i,r)}},Hh=function(e,t,n,r,o){var i=n+t,a=r.pos.top(),u=r.bottom,s=n<=u-a;if(aa.bottom&&dn(n.element,!0===r)},$h=function(e,t,n){return Ih(e,Vh,t,n)},Wh=function(e,t,n){return Uh(e,t,Vh,n)},Kh=function(e,t,n){return Ih(e,qh,t,n)},Xh=function(e,t,n){return Uh(e,t,qh,n)},Yh=function(e,t,n){(e.inline?$h:Kh)(e,t,n)},Gh=function(e){return An(e)||Dn(e)},Jh=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o=t.elementFromPoint(e,n),i=t.body.createTextRange();if(o&&\"HTML\"!==o.tagName||(o=t.body),i.moveToElementText(o),0<(r=(r=yt.toArray(i.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(r[0].bottom+r[0].top)/2;try{return i.moveToPoint(e,n),i.collapse(!0),i}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Dn(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Gh))?null:i}return r},Qh=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return B.from(i).map(Ct.fromDom).map(function(e){return r&&t.collapsed?e:Vt(e,o(e,a)).getOr(e)}).bind(function(e){return Nt(e)?B.some(e):Mt(e).filter(Nt)}).map(function(e){return e.dom()}).getOr(e)},Zh=function(e,t,n){return Qh(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},ev=function(e,t,n){return Qh(e,t,!1,n,function(e,t){return 0o.childNodes.length-1&&(u=!1),_n(o)&&(o=s,i=0),o===s){if(u&&(a=o.childNodes[0_(n)?(C=T(b*v),b=T(C/v)):(b=T(C/v),C=T(b*v))),P(l,b,C),r=0<(r=d.startPos.x+t)?r:0,o=0<(o=d.startPos.y+n)?o:0,S.setStyles(f,{left:r,top:o,display:\"block\"}),f.innerHTML=b+\" × \"+C,d[2]<0&&l.clientWidth<=b&&S.setStyle(l,\"left\",void 0+(g-b)),d[3]<0&&l.clientHeight<=C&&S.setStyle(l,\"top\",void 0+(h-C)),(t=R.scrollWidth-w)+(n=R.scrollHeight-x)!==0&&S.setStyles(f,{left:r-t,top:o-n}),y||(i=c,a=g,u=h,s.fire(\"ObjectResizeStart\",{target:i,width:a,height:u}),y=!0)},I=function(){var e=y;y=!1;var t,n,r,o=function(e,t){t&&(c.style[e]||!s.schema.isValid(c.nodeName.toLowerCase(),e)?S.setStyle(O(c),e,t):S.setAttrib(O(c),e,\"\"+t))};e&&(o(\"width\",b),o(\"height\",C)),S.unbind(E,\"mousemove\",L),S.unbind(E,\"mouseup\",I),k!==E&&(S.unbind(k,\"mousemove\",L),S.unbind(k,\"mouseup\",I)),S.remove(l),S.remove(f),i(c),e&&(t=c,n=b,r=C,s.fire(\"ObjectResized\",{target:t,width:n,height:r}),S.setAttrib(c,\"style\",S.getAttrib(c,\"style\"))),s.nodeChanged()},i=function(e){M(),F();var t=S.getPos(e,R),r=t.x,o=t.y,n=e.getBoundingClientRect(),i=n.width||n.right-n.left,a=n.height||n.bottom-n.top;c!==e&&(c=e,b=C=0);var u=s.fire(\"ObjectSelected\",{target:e});B(e)&&!u.isDefaultPrevented()?N(A,function(n,e){var t;(t=S.get(\"mceResizeHandle\"+e))&&S.remove(t),t=S.add(R,\"div\",{id:\"mceResizeHandle\"+e,\"data-mce-bogus\":\"all\",\"class\":\"mce-resizehandle\",unselectable:!0,style:\"cursor:\"+e+\"-resize; margin:0; padding:0\"}),11===mt.ie&&(t.contentEditable=!1),S.bind(t,\"mousedown\",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),m=(t=e).screenX,p=t.screenY,g=O(c).clientWidth,h=O(c).clientHeight,v=h/g,(d=n).startPos={x:i*n[0]+r,y:a*n[1]+o},w=R.scrollWidth,x=R.scrollHeight,l=c.cloneNode(!0),S.addClass(l,\"mce-clonedresizable\"),S.setAttrib(l,\"data-mce-bogus\",\"all\"),l.contentEditable=!1,l.unSelectabe=!0,S.setStyles(l,{left:r,top:o,margin:0}),P(l,i,a),l.removeAttribute(\"data-mce-selected\"),R.appendChild(l),S.bind(E,\"mousemove\",L),S.bind(E,\"mouseup\",I),k!==E&&(S.bind(k,\"mousemove\",L),S.bind(k,\"mouseup\",I)),f=S.add(R,\"div\",{\"class\":\"mce-resize-helper\",\"data-mce-bogus\":\"all\"},g+\" × \"+h)}),n.elm=t,S.setStyles(t,{left:i*n[0]+r-t.offsetWidth/2,top:a*n[1]+o-t.offsetHeight/2})}):M(),c.setAttribute(\"data-mce-selected\",\"1\")},M=function(){F(),c&&c.removeAttribute(\"data-mce-selected\"),oe(A,function(e,t){var n=S.get(\"mceResizeHandle\"+t);n&&(S.unbind(n),S.remove(n))})},o=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};y||s.removed||(N(S.select(\"img[data-mce-selected],hr[data-mce-selected]\"),function(e){e.removeAttribute(\"data-mce-selected\")}),t=\"mousedown\"===e.type?e.target:r.getNode(),n(t=S.$(t).closest(\"table,img,figure.image,hr\")[0],R)&&(u(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?i(t):M())},a=function(e){return yv(function(e,t){for(;t&&t!==e;){if(bv(t)||yv(t))return t;t=t.parentNode}return null}(s.getBody(),e))},F=function(){oe(A,function(e){e.elm&&(S.unbind(e.elm),delete e.elm)})},u=function(){try{s.getDoc().execCommand(\"enableObjectResizing\",!1,!1)}catch(e){}};s.on(\"init\",function(){if(u(),mt.browser.isIE()||mt.browser.isEdge()){s.on(\"mousedown click\",function(e){var t=e.target,n=t.nodeName;y||!/^(TABLE|IMG|HR)$/.test(n)||a(t)||(2!==e.button&&s.selection.select(t,\"TABLE\"===n),\"mousedown\"===e.type&&s.nodeChanged())});var e=function(e){var t=function(e){fa.setEditorTimeout(s,function(){return s.selection.select(e)})};if(a(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),\"IMG\"===e.target.tagName&&t(e.target))};S.bind(R,\"mscontrolselect\",e),s.on(\"remove\",function(){return S.unbind(R,\"mscontrolselect\",e)})}var t=fa.throttle(function(e){s.composing||o(e)});s.on(\"nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged\",t),s.on(\"keyup compositionend\",function(e){c&&\"TABLE\"===c.nodeName&&t(e)}),s.on(\"hide blur\",M),s.on(\"contextmenu longpress\",n,!0)}),s.on(\"remove\",F);return{isResizable:B,showResizeRect:i,hideResizeRect:M,updateResizeRect:o,destroy:function(){c=l=null}}},wv=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=H(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}};var xv=function(e){return!!e.select},Sv=function(e){return!(!e||!e.ownerDocument)&&Bt(Ct.fromDom(e.ownerDocument),Ct.fromDom(e))},Nv=function(u,s,e,c){var l,f,n=function h(i,n){var a,u;return{selectorChangedWithUnbind:function(e,t){return a||(a={},u={},n.on(\"NodeChange\",function(e){var n=e.element,r=i.getParents(n,null,i.getRoot()),o={};yt.each(a,function(e,n){yt.each(r,function(t){if(i.is(t,n))return u[n]||(yt.each(e,function(e){e(!0,{node:t,selector:n,parents:r})}),u[n]=e),o[n]=e,!1})}),yt.each(u,function(e,t){o[t]||(delete u[t],yt.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),{unbind:function(){wv(a,e,t),wv(u,e,t)}}}}}(u,c).selectorChangedWithUnbind,t=function(e,t){return mv(c,e,t)},r=function(e){var t=o();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},o=function(){var e,t,n,r=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;var o=s.document;if(null==o)return null;if(c.bookmark!==undefined&&!1===Ym(c)){var i=Im(c);if(i.isSome())return i.map(function(e){return eg(c,[e])[0]}).getOr(o.createRange())}try{(e=d())&&!hn(e.anchorNode)&&(t=0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Wh:Xh)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return i(Jh(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=o();return e.collapsed?Ss.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,g.destroy()}},p=gv(m),g=Cv(m,c);return m.bookmarkManager=p,m.controlSelection=g,m},Ev=function(e,a,u){e.addNodeFilter(\"font\",function(e){z(e,function(e){var t,n=a.parse(e.attr(\"style\")),r=e.attr(\"color\"),o=e.attr(\"face\"),i=e.attr(\"size\");r&&(n.color=r),o&&(n[\"font-family\"]=o),i&&(n[\"font-size\"]=u[parseInt(e.attr(\"size\"),10)-1]),e.name=\"span\",e.attr(\"style\",a.serialize(n)),t=e,z([\"color\",\"face\",\"size\"],function(e){t.attr(e,null)})})})},kv=function(e,t){var n,r=Br();t.convert_fonts_to_spans&&Ev(e,r,yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter(\"strike\",function(e){z(e,function(e){var t=n.parse(e.attr(\"style\"));t[\"text-decoration\"]=\"line-through\",e.name=\"span\",e.attr(\"style\",n.serialize(t))})})},_v=function(e){var t,n=decodeURIComponent(e).split(\",\"),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},Tv=function(e,t){var n;try{n=V.atob(t)}catch(LE){return B.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,\"\\n\").replace(/^[\\r\\n]*|[\\r\\n]*$/g,\"\").replace(/^\\s*(()?|\\s*\\/\\/\\s*\\]\\]>(-->)?|\\/\\/\\s*(-->)?|\\]\\]>|\\/\\*\\s*-->\\s*\\*\\/|\\s*-->\\s*)\\s*$/g,\"\")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:\"\",\"script\"===t?((o=n.attr(\"type\"))&&n.attr(\"type\",\"mce-no/type\"===o?null:o.replace(/^mce\\-/,\"\")),\"xhtml\"===s.element_format&&0\")):\"xhtml\"===s.element_format&&0)\\s*/g,\"$1\"),yt.map(l.split(/(?:>|\\s+(?![^\\[\\]]+\\]))/),function(e){var t=yt.map(e.split(/(?:~\\+|~|\\+)/),sy),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[];r=f.length?(f[0].name||(f[0].name=t),t=e.selector,uy(f,n)):uy([t],n);var d=ay.select(t,r)[0]||r.firstChild;return iy(e.styles,function(e,t){(e=s(e))&&ay.setStyle(d,t,e)}),iy(e.attributes,function(e,t){(e=s(e))&&ay.setAttrib(d,t,e)}),iy(e.classes,function(e){e=s(e),ay.hasClass(d,e)||ay.addClass(d,e)}),n.fire(\"PreviewFormats\"),ay.setStyles(r,{position:\"absolute\",left:-65535}),n.getBody().appendChild(r),o=ay.getStyle(n.getBody(),\"fontSize\",!0),o=/px$/.test(o)?parseInt(o,10):0,iy(u.split(\" \"),function(e){var t=ay.getStyle(d,e,!0);if(!(\"background-color\"===e&&/transparent|rgba\\s*\\([^)]+,\\s*0\\)/.test(t)&&(t=ay.getStyle(n.getBody(),e,!0),\"#ffffff\"===ay.toHex(t).toLowerCase())||\"color\"===e&&\"#000000\"===ay.toHex(t).toLowerCase())){if(\"font-size\"===e&&/em|%$/.test(t)){if(0===o)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*o+\"px\"}\"border\"===e&&t&&(a+=\"padding:0 2px;\"),a+=e+\":\"+t+\";\"}}),n.fire(\"AfterPreviewFormats\"),ay.remove(r),a},ly=function(s){var e=ny(s),t=Oa(null);return function(e){e.addShortcut(\"meta+b\",\"\",\"Bold\"),e.addShortcut(\"meta+i\",\"\",\"Italic\"),e.addShortcut(\"meta+u\",\"\",\"Underline\");for(var t=1;t<=6;t++)e.addShortcut(\"access+\"+t,\"\",[\"FormatBlock\",!1,\"h\"+t]);e.addShortcut(\"access+7\",\"\",[\"FormatBlock\",!1,\"p\"]),e.addShortcut(\"access+8\",\"\",[\"FormatBlock\",!1,\"div\"]),e.addShortcut(\"access+9\",\"\",[\"FormatBlock\",!1,\"address\"])}(s),Ep(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,Ug(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,Ug(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,Ug(s).formatter.toggle(r,o,i)},match:N(fp,s),matchAll:N(dp,s),matchNode:N(lp,s),canApply:N(mp,s),formatChanged:N(ty,s,t),getCssText:N(cy,s)}},fy=function(n,r,o){var i=Oa(!1),a=function(e){Ag(r,!1,o),r.add({},e)};n.on(\"init\",function(){r.add()}),n.on(\"BeforeExecCommand\",function(e){var t=e.command.toLowerCase();\"undo\"!==t&&\"redo\"!==t&&\"mcerepaint\"!==t&&(Dg(r,o),r.beforeChange())}),n.on(\"ExecCommand\",function(e){var t=e.command.toLowerCase();\"undo\"!==t&&\"redo\"!==t&&\"mcerepaint\"!==t&&a(e)}),n.on(\"ObjectResizeStart cut\",function(){r.beforeChange()}),n.on(\"SaveContent ObjectResized blur\",a),n.on(\"dragend\",a),n.on(\"keyup\",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===Tg(Ng(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire(\"change\",{level:r.data[0],lastLevel:null})),n.fire(\"TypingUndo\"),i.set(!1),n.nodeChanged()))}),n.on(\"keydown\",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)r.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20t;var t}},Bb=function(n){return function(e){return t=n,e.line===t;var t}},Pb=Dn,Lb=Ac,Ib=function(e,t){return Math.abs(e.left-t)},Mb=function(e,t){return Math.abs(e.right-t)},Fb=function(e,t){return e>=t.left&&e<=t.right},Ub=function(e,t){return e>=t.top&&e<=t.bottom},zb=function(e,o){return be(e,function(e,t){var n=Math.min(Ib(e,o),Mb(e,o)),r=Math.min(Ib(t,o),Mb(t,o));return Fb(o,t)||!Fb(o,e)&&(r===n&&Pb(t.node)||r'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},eC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=tl((e=l).getBody()),o=N(Hc,r.next),i=N(Hc,r.prev),a=t?ws.Forwards:ws.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Jb(a,e,u,s))?n:(n=Zb(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},tC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Db:Ab,i=(e=u).selection.getRng(),(n=Qb(r,e,o,i))?n:(n=Zb(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},nC=function(r,o){return function(){var t,e=o?Ss.fromRangeEnd(r.selection.getRng()):Ss.fromRangeStart(r.selection.getRng()),n=(o?Nb:Sb)(r.getBody(),e);return(o?ee:Z)(n.positions).filter((t=o,function(e){return(t?ad:id)(e)})).fold(x(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},rC=function(o,e){return Y(e,function(e){var t,n,r=(t=Lu(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:o(r),cell:e},{x:r.right,y:o(r),cell:e}]})},oC=function(e,t,n,r,o){var i,a,u=Ya(Ct.fromDom(n),\"td,th,caption\").map(function(e){return e.dom()}),s=H(rC(e,u),function(e){return t(e,o)});return i=r,a=o,W(s,function(e,r){return e.fold(function(){return B.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-i)+Math.abs(e.y-a)),n=Math.sqrt(Math.abs(r.x-i)+Math.abs(r.y-a));return B.some(nt}),uC=function(t,n){return Z(n.getClientRects()).bind(function(e){return iC(t,e.left,e.top)}).bind(function(e){return xb(ml(t=e).map(function(e){return Sb(t,e).positions.concat(e)}).getOr([]),n);var t})},sC=function(t,n){return ee(n.getClientRects()).bind(function(e){return aC(t,e.left,e.top)}).bind(function(e){return xb(dl(t=e).map(function(e){return[e].concat(Nb(t,e).positions)}).getOr([]),n);var t})},cC=function(e,t){e.selection.setRng(t),Yh(e,t)},lC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===ry.Wrap&&0===a.positions.length||!Rn(n.getNode())&&((i=u).breakType===ry.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},fC=N(lC,Sb),dC=N(lC,Nb),mC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(wc()&&(o=t,i=s,a=n,u=Ss.fromRangeStart(i),cl(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=$b(c,e,n,!t,!0);return cC(e,l),!0}return!1},pC=function(e,t){var n=t.getNode(e);return vn(n)&&\"TABLE\"===n.nodeName?B.some(n):B.none()},gC=function(u,s,c){var e=pC(!!s,c),t=!1===s;e.fold(function(){return cC(u,c.toRange())},function(a){return cl(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return cC(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Ys(r=u))?r.undoManager.transact(function(){var e=Ct.fromTag(i);Ln(e,Gs(r)),Zt(e,Ct.fromTag(\"br\")),(n?Jt:Gt)(Ct.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),cC(r,t)}):cC(r,t.toRange()));var n,r,o,t,i})})},hC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Ss.fromRangeStart(l),d=e.getBody();if(!t&&fC(r,f)){var m=(u=d,uC(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return wb(Eb(u,Ss.before(s)),e.left)})}).getOr(Ss.before(s)));return gC(e,t,m),!0}if(t&&dC(r,f)){m=(o=d,sC(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return wb(kb(o,Ss.after(i)),e.left)})}).getOr(Ss.after(i)));return gC(e,t,m),!0}return!1},vC=function(t,n){return function(){return B.from(t.dom.getParent(t.selection.getNode(),\"td,th\")).bind(function(e){return B.from(t.dom.getParent(e,\"table\")).map(function(e){return mC(t,n,e)})}).getOr(!1)}},yC=function(n,r){return function(){return B.from(n.dom.getParent(n.selection.getNode(),\"td,th\")).bind(function(t){return B.from(n.dom.getParent(t,\"table\")).map(function(e){return hC(n,r,e,t)})}).getOr(!1)}},bC=function(e){return M([\"figcaption\"],wt(e))},CC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},wC=function(e,t,n){(n?Zt:Qt)(e,t)},xC=function(e,t,n,r){return\"\"===t?(l=e,f=r,d=Ct.fromTag(\"br\"),wC(l,d,f),CC(d)):(o=e,i=r,a=t,u=n,s=Ct.fromTag(a),c=Ct.fromTag(\"br\"),Ln(s,u),Zt(s,c),wC(o,s,i),CC(c));var o,i,a,u,s,c,l,f,d},SC=function(e,t,n){return t?(o=e.dom(),Nb(o,n).breakAt.isNone()):(r=e.dom(),Sb(r,n).breakAt.isNone());var r,o},NC=function(t,n){var e,r,o=Ct.fromDom(t.getBody()),i=Ss.fromRangeStart(t.selection.getRng()),a=Ys(t),u=Gs(t);return e=i,r=N(Dt,o),Za(Ct.fromDom(e.container()),Kn,r).filter(bC).exists(function(){if(SC(o,n,i)){var e=xC(o,a,u,n);return t.selection.setRng(e),!0}return!1})},EC=function(e,t){return function(){return!!e.selection.isCollapsed()&&NC(e,t)}},kC=function(e,r){return Y(U(e,function(e){return xe({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:f},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},_C=function(e){for(var t=[],n=1;n'},$w=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},Ww=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&\"true\"!==e.getContentEditable(t)},Kw=function(e,t,n){return!1===En(t)?n:e?1===n&&t.data.charAt(n-1)===yu?0:n:n===t.data.length-1&&t.data.charAt(n)===yu?t.data.length:n},Xw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&\"false\"!==e.getContentEditable(n);)\"true\"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Yw=function(o,i,e){B.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(On(n))for(var r=0;ru.childNodes.length-1,u=u.childNodes[Math.min(i,u.childNodes.length-1)]||u,i=f&&En(u)?u.nodeValue.length:0);var w=Xw(d,u);if(w){(l&&!b||!l&&b)&&(u=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||\"P\",m=e.dom,p=Xw(m,r);if(!(a=m.getParent(r,m.isBlock))||!Ww(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),Gw(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),Gw(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,l,g,u,i)),s=d.getParent(u,d.isBlock),o=s?d.getParent(s.parentNode,d.isBlock):null,c=s?s.nodeName.toUpperCase():\"\";var x,S,N,E=o?o.nodeName.toUpperCase():\"\";if(\"LI\"!==E||C||(o=(s=o).parentNode,c=E),/^(LI|DT|DD)$/.test(c)&&d.isEmpty(s))Vw(a,h,o,s,l);else if(!l||s!==a.getBody())l=l||\"P\",Su(s)?(n=Ou(s),d.isEmpty(s)&&qw(s),Gw(a,n),Mw(a,n)):v()?y():v(!0)?(n=s.parentNode.insertBefore(h(),s),Mw(a,$w(s,\"HR\")?n:s)):((N=(S=g).cloneRange()).setStart(S.startContainer,Kw(!0,S.startContainer,S.startOffset)),N.setEnd(S.endContainer,Kw(!1,S.endContainer,S.endOffset)),(t=N.cloneRange()).setEndAfter(s),r=t.extractContents(),x=r,z(Xa(Ct.fromDom(x),Et),function(e){var t=e.dom();t.nodeValue=Cu(t.nodeValue)}),function(e){for(;En(e)&&(e.nodeValue=e.nodeValue.replace(/^[\\r\\n]+/,\"\")),e=e.firstChild;);}(r),n=r.firstChild,d.insertAfter(r,s),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;vn(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&\"\"===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&\"A\"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(d,p,n),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,\"float\",!0))||e.add(t,\"br\")}(d,s),d.isEmpty(s)&&qw(s),n.normalize(),d.isEmpty(n)?(d.remove(n),y()):(Gw(a,n),Mw(a,n))),d.setAttrib(n,\"id\",\"\"),a.fire(\"NewBlock\",{newBlock:n})}},Qw=function(e,t,n){var r=e.create(\"span\",{},\" \");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Zw=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},ex=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();lv(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():\"\",m=!(!t||!t.ctrlKey);\"LI\"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&!function(e,t,n){for(var r,o=new Ai(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+\"px\",t.style.height=o-s+\"px\",v(e.clientX,e.clientY)}}},aS=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!tS(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute(\"data-mce-selected\"),o),n=f.fire(\"drop\",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){rS(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;uS(l)}},uS=function(e){e.dragging=!1,e.element=null,rS(e.ghost)},sS=function(e){var t,n,r={},o=Ea.DOM,i=V.document,a=oS(r,e),u=iS(r,e),s=aS(r,e),c=(t=r,function(){t.dragging&&n.fire(\"dragend\"),uS(t)});(n=e).on(\"mousedown\",a),e.on(\"mousemove\",u),e.on(\"mouseup\",s),o.bind(i,\"mousemove\",u),o.bind(i,\"mouseup\",c),e.on(\"remove\",function(){o.unbind(i,\"mousemove\",u),o.unbind(i,\"mouseup\",c)})},cS=function(e){var n,i,a,u,t;sS(e),(n=e).on(\"drop\",function(e){var t=\"undefined\"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(tS(t)||tS(n.dom.getContentEditableParent(t)))&&e.preventDefault()}),e.getParam(\"block_unsupported_drop\",!0,\"boolean\")&&(a=function(e){if(!e.defaultPrevented){var t=e.dataTransfer;t&&(M(t.types,\"Files\")||0
    ').attr(\"id\",y)).appendTo(g.getBody()),e=g.dom.createRng(),u===s&&mt.ie?(r.empty().append('

    \\xa0

    ').append(u),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(u)):(r.empty().append(Dr).append(u).append(Dr),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:l.getPos(n,g.getBody()).y}),r[0].focus();var m=g.selection.getSel();m.removeAllRanges(),m.addRange(e);var p=Ct.fromDom(n);return z(Ya(Ct.fromDom(g.getBody()),\"*[data-mce-selected]\"),function(e){Dt(p,e)||Mn(e,\"data-mce-selected\")}),g.dom.getAttrib(n,\"data-mce-selected\")||n.setAttribute(\"data-mce-selected\",\"1\"),h=n,w(),e},c=function(){h&&(h.removeAttribute(\"data-mce-selected\"),tu(Ct.fromDom(g.getBody()),\"#\"+y).each(nn),h=null),tu(Ct.fromDom(g.getBody()),\"#\"+y).each(nn),h=null},w=function(){o.hide()};return mt.ceFalse&&function(){g.on(\"mouseup\",function(e){var t=r();t.collapsed&&hh(g,e.clientX,e.clientY)&&a(Kb(g,t,!1))}),g.on(\"click\",function(e){var t=dS(g,e.target);t&&(fS(t)&&(e.preventDefault(),g.focus()),lS(t)&&g.dom.isChildOf(t,g.selection.getNode())&&c())}),g.on(\"blur NewBlock\",function(){c()}),g.on(\"ResizeWindow FullscreenStateChanged\",function(){return o.reposition()});var n,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==fS(dS(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=tl(e);if(!e.firstChild)return!1;var n=Ss.before(e.firstChild),r=t.next(n);return r&&!id(r)&&!ad(r)}(o)};(n=g).on(\"tap\",function(e){var t=dS(n,e.target);fS(t)&&(e.preventDefault(),s(Wb(n,t)))},!0),g.on(\"mousedown\",function(e){var t=e.target;if((t===v||\"HTML\"===t.nodeName||g.dom.isChildOf(t,v))&&!1!==hh(g,e.clientX,e.clientY)){var n=dS(g,t);if(n)fS(n)?(e.preventDefault(),s(Wb(g,n))):(c(),lS(n)&&e.shiftKey||hv(e.clientX,e.clientY,g.selection.getRng())||(w(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===xc(t)){c(),w();var r=Hb(v,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=b(1,r.node,r.before,!1);g.getBody().focus(),a(o)}}}}),g.on(\"keypress\",function(e){vv.modifierPressed(e)||(e.keyCode,fS(g.selection.getNode())&&e.preventDefault())}),g.on(\"GetSelectionRange\",function(e){var t=e.range;if(h){if(!h.parentNode)return void(h=null);(t=t.cloneRange()).selectNode(h),e.range=t}}),g.on(\"SetSelectionRange\",function(e){e.range=u(e.range);var t=s(e.range,e.forward);t&&(e.range=t)});var t,e;g.on(\"AfterSetSelectionRange\",function(e){var t,n=e.range;C(n)||\"mcepastebin\"===n.startContainer.parentNode.id||w(),t=n.startContainer.parentNode,g.dom.hasClass(t,\"mce-offscreen-selection\")||c()}),g.on(\"copy\",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!mt.ie){var r=(t=g.dom.get(y))?t.getElementsByTagName(\"*\")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData(\"text/html\",r.outerHTML),n.setData(\"text/plain\",r.outerText))}}),cS(g),e=Ua(function(){if(!t.removed&&t.getBody().contains(V.document.activeElement)&&t.selection.getRng().collapsed){var e=Xb(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0),(t=g).on(\"focus\",function(){e.throttle()}),t.on(\"blur\",function(){e.cancel()})}(),{showCaret:b,showBlockCaretContainer:function(e){e.hasAttribute(\"data-mce-caret\")&&(Ou(e),a(r()),g.selection.scrollIntoView(e))},hideFakeCaret:w,destroy:function(){o.destroy(),h=null}}},pS=function(u){var s,n,r,o=yt.each,c=vv.BACKSPACE,l=vv.DELETE,f=u.dom,d=u.selection,e=u.parser,t=mt.gecko,i=mt.ie,a=mt.webkit,m=\"data:text/mce-internal,\",p=i?\"Text\":\"URL\",g=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},h=function(e){return e.isDefaultPrevented()},v=function(){u.shortcuts.add(\"meta+a\",null,\"SelectAll\")},y=function(){u.on(\"keydown\",function(e){if(!h(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&\"table\"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},b=function(){u.inline||(u.contentStyles.push(\"body {min-height: 150px}\"),u.on(\"click\",function(e){var t;if(\"HTML\"===e.target.nodeName){if(11\")+\"\";e.getParam(\"document_base_url\",\"\")!==e.documentBaseUrl&&(t+=''),t+='';var n=Ks(e,\"body_id\",\"tinymce\"),r=Ks(e,\"body_class\",\"\");return Xs(e)&&(t+=''),t+='
    '},NS=function(e,t){var n,r,o,i,a=e.editorManager.translate(\"Rich Text Area. Press ALT-0 for help.\"),u=(n=e.id,r=a,t.height,o=e.getParam(\"iframe_attrs\",{}),i=Ct.fromTag(\"iframe\"),Ln(i,o),Ln(i,{id:n+\"_ifr\",frameBorder:\"0\",allowTransparency:\"true\",title:r}),$a(i,\"tox-edit-area__iframe\"),i.dom());u.onload=function(){u.onload=null,e.fire(\"load\")};var s=function(e,t){if(V.document.domain!==V.window.location.hostname&&mt.browser.isIE()){var n=Jv(\"mce\");e[n]=function(){wS(e)};var r='javascript:(function(){document.open();document.domain=\"'+V.document.domain+'\";var ed = window.parent.tinymce.get(\"'+e.id+'\");document.write(ed.iframeHTML);document.close();ed.'+n+\"(true);})()\";return xS.setAttrib(t,\"src\",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=SS(e),xS.add(t.iframeContainer,u),s},ES=Ea.DOM,kS=function(t,n,e){var r=bh.get(e),o=bh.urls[e]||t.documentBaseUrl.replace(/\\/$/,\"\");if(e=yt.trim(e),r&&-1===yt.inArray(n,e)){if(yt.each(bh.dependencies(e),function(e){kS(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(LE){!function(e,t,n){var r=Ia.translate([\"Failed to initialize plugin: {0}\",t]);_h(r,n),Sh(e,r)}(t,e,LE)}}},_S=function(e){return e.replace(/^\\-/,\"\")},TS=function(e){return{editorContainer:e,iframeContainer:e}},RS=function(e){var t,n,r=e.getElement();return e.inline?TS(null):(t=r,n=ES.create(\"div\"),ES.insertAfter(n,t),TS(n))},AS=function(e){var t,n,r,o=e.getElement();return e.orgDisplay=o.style.display,q(oc(e))?e.theme.renderUI():A(oc(e))?(n=(t=e).getElement(),(r=oc(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+\"_parent\"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+\"_iframecontainer\"),r.height=r.iframeHeight?r.iframeHeight:n.offsetHeight,r):RS(e)},DS=function(e){var n,t,r,o,i,a;e.fire(\"ScriptsLoaded\"),n=e,t=yt.trim(Qs(n)),r=n.ui.registry.getAll().icons,o=xe(xe({},ch.get(\"default\").icons),ch.get(t).icons),oe(o,function(e,t){me(r,t)||n.ui.registry.addIcon(t,e)}),function(e){var t=oc(e);if(q(t)){e.settings.theme=_S(t);var n=Ch.get(t);e.theme=new n(e,Ch.urls[t]),e.theme.init&&e.theme.init(e,Ch.urls[t]||e.documentBaseUrl.replace(/\\/$/,\"\"),e.$)}else e.theme={}}(e),i=e,a=[],yt.each(ac(i).split(/[ ,]/),function(e){kS(i,a,_S(e))});var u,s,c,l,f=AS(e);return e.editorContainer=f.editorContainer?f.editorContainer:null,(u=e).contentCSS=u.contentCSS.concat(Th(u)),e.inline?wS(e):(l=NS(s=e,c=f),c.editorContainer&&(xS.get(c.editorContainer).style.display=s.orgDisplay,s.hidden=xS.isHidden(c.editorContainer)),s.getElement().style.display=\"none\",xS.setAttrib(s.id,\"aria-hidden\",\"true\"),void(l||wS(s)))},OS=Ea.DOM,BS=function(e){return\"-\"===e.charAt(0)},PS=function(e,t){var n=ec(t),r=t.getParam(\"language_url\",\"\",\"string\");if(!1===Ia.hasCode(n)&&\"en\"!==n){var o=\"\"!==r?r:t.editorManager.baseURL+\"/langs/\"+n+\".js\";e.add(o,f,undefined,function(){Nh(t,\"LanguageLoadError\",Eh(\"language\",o,n))})}},LS=function(t,e,n){return B.from(e).filter(function(e){return 0\")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand(\"mceInsertContent\",!1,n.replace(/\\{\\$selection\\}/g,i.selection.getContent({format:\"text\"})))},mceInsertLink:function(e,t,n){\"string\"==typeof n&&(n={href:n});var r=i.dom.getParent(i.selection.getNode(),\"a\");n.href=n.href.replace(/ /g,\"%20\"),r&&n.href||i.formatter.remove(\"link\"),n.href&&i.formatter.apply(\"link\",n,r)},selectAll:function(){var e=i.dom.getParent(i.selection.getStart(),An);if(e){var t=i.dom.createRng();t.selectNodeContents(e),i.selection.setRng(t)}},\"delete\":function(){var e;Lw(e=i)||cw(e,!1)||fw(e,!1)||gw(e,!1)||VC(e,!1)||om(e)||KC(e)||bw(e,!1)||(JS(e,\"Delete\"),DC(e))},forwardDelete:function(){var e;cw(e=i,!0)||fw(e,!0)||gw(e,!0)||VC(e,!0)||om(e)||KC(e)||bw(e,!0)||JS(e,\"ForwardDelete\")},mceNewDocument:function(){i.setContent(\"\")},InsertLineBreak:function(e,t,n){return ux(i,n),!0}});var e=function(n){return function(){var e=i.selection.isCollapsed()?[i.dom.getParent(i.selection.getNode(),i.dom.isBlock)]:i.selection.getSelectedBlocks(),t=ZS(e,function(e){return!!i.formatter.matchNode(e,n)});return-1!==eN(t,!0)}};a.addCommands({JustifyLeft:e(\"alignleft\"),JustifyCenter:e(\"aligncenter\"),JustifyRight:e(\"alignright\"),JustifyFull:e(\"alignjustify\"),\"Bold,Italic,Underline,Strikethrough,Superscript,Subscript\":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch(\"blockquote\")},Outdent:function(){return Sw(i)},\"InsertUnorderedList,InsertOrderedList\":function(e){var t=i.dom.getParent(i.selection.getNode(),\"ul,ol\");return t&&(\"insertunorderedlist\"===e&&\"UL\"===t.tagName||\"insertorderedlist\"===e&&\"OL\"===t.tagName)}},\"state\"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler(\"FontName\",function(){return KS(t=i).fold(function(){return WS(t).map(function(e){return $S(t.getBody(),e)}).getOr(\"\")},function(e){return $S(t.getBody(),e)});var t},this),a.addQueryValueHandler(\"FontSize\",function(){return KS(t=i).fold(function(){return WS(t).map(function(e){return qS(t.getBody(),e)}).getOr(\"\")},function(e){return qS(t.getBody(),e)});var t},this)},nN);function nN(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var rN=\"data-mce-contenteditable\",oN=function(e,t,n){Ka(e,t)&&!1===n?function(e,t){Ha(e)?e.dom().classList.remove(t):qa(e,t);Wa(e)}(e,t):n&&$a(e,t)},iN=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},aN=function(e,t){e.dom().contentEditable=t?\"true\":\"false\"},uN=function(e,t){var n,r,o,i=Ct.fromDom(e.getBody());oN(i,\"mce-content-readonly\",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),o=e,B.from(o.selection.getNode()).each(function(e){e.removeAttribute(\"data-mce-selected\")}),e.readonly=!0,aN(i,!1),z(Ya(i,'*[contenteditable=\"true\"]'),function(e){Pn(e,rN,\"true\"),aN(e,!1)})):(e.readonly=!1,aN(i,!0),z(Ya(i,\"*[\"+rN+'=\"true\"]'),function(e){Mn(e,rN),aN(e,!0)}),iN(e,\"StyleWithCSS\",!1),iN(e,\"enableInlineTableEditing\",!1),iN(e,\"enableObjectResizing\",!1),(Ym(r=e)||Xm(r))&&e.focus(),(n=e).selection.setRng(n.selection.getRng()),e.nodeChanged())},sN=function(e){return e.readonly},cN=function(t){t.parser.addAttributeFilter(\"contenteditable\",function(e){sN(t)&&z(e,function(e){e.attr(rN,e.attr(\"contenteditable\")),e.attr(\"contenteditable\",\"false\")})}),t.serializer.addAttributeFilter(rN,function(e){sN(t)&&z(e,function(e){e.attr(\"contenteditable\",e.attr(rN))})}),t.serializer.addTempAttr(rN)},lN=yt.makeMap(\"focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel\",\" \"),fN=(dN.isNative=function(e){return!!lN[e.toLowerCase()]},dN.prototype.fire=function(e,t){e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=this.scope),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=h},t.stopPropagation=function(){t.isPropagationStopped=h},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=h},t.isDefaultPrevented=g,t.isPropagationStopped=g,t.isImmediatePropagationStopped=g),this.settings.beforeFire&&this.settings.beforeFire(t);var n=this.bindings[e];if(n)for(var r=0,o=n.length;r\"),this.parseShortcut);return o[o.length-1]=yt.extend(o[o.length-1],{func:n,scope:r||this.editor}),yt.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},RN.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},RN.prototype.isFunctionKey=function(e){return\"keydown\"===e.type&&112<=e.keyCode&&e.keyCode<=123},RN.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},RN.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},RN);function RN(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on(\"keyup keypress keydown\",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(NN(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),\"keydown\"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&\"keydown\"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var AN=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=xe(xe({},t),{type:r})}})(e={},\"button\"),addGroupToolbarButton:u(e,\"grouptoolbarbutton\"),addToggleButton:u(e,\"togglebutton\"),addMenuButton:u(e,\"menubutton\"),addSplitButton:u(e,\"splitbutton\"),addMenuItem:u(t,\"menuitem\"),addNestedMenuItem:u(t,\"nestedmenuitem\"),addToggleMenuItem:u(t,\"togglemenuitem\"),addAutocompleter:u(n,\"autocompleter\"),addContextMenu:u(o,\"contextmenu\"),addContextToolbar:u(i,\"contexttoolbar\"),addContextForm:u(i,\"contextform\"),addSidebar:u(a,\"sidebar\"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},DN=yt.each,ON=yt.trim,BN=\"source protocol authority userInfo user password host port relative path directory file query anchor\".split(\" \"),PN={ftp:21,http:80,https:443,mailto:25},LN=(IN.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(\",\"),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},IN.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf(\"http\")&&\"file:\"!==e.protocol?e.href:e.protocol+\"//\"+e.host+e.pathname,/^[^:]+:\\/\\/\\/?[^\\/]+\\//.test(t)&&(t=t.replace(/[\\?#].*$/,\"\").replace(/[\\/\\\\][^\\/]+$/,\"\"),/[\\/\\\\]$/.test(t)||(t+=\"/\")),t},IN.prototype.setPath=function(e){var t=/^(.*?)\\/?(\\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source=\"\",this.getURI()},IN.prototype.toRelative=function(e){var t;if(\"./\"===e)return e;var n=new IN(e,{base_uri:this});if(\"mce_host\"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&\"\"!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||\"/\"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+=\"?\"+n.query),n.anchor&&(t+=\"#\"+n.anchor),t)},IN.prototype.toAbsolute=function(e,t){var n=new IN(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},IN.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=PN[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},IN.prototype.toRelPath=function(e,t){var n,r,o=0,i=\"\",a=e.substring(0,e.lastIndexOf(\"/\")).split(\"/\"),u=t.split(\"/\");if(a.length>=u.length)for(n=0,r=a.length;n=u.length||a[n]!==u[n]){o=n+1;break}if(a.length=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=mE(e.x,t.x),r=mE(e.y,t.y),o=dE(e.x+e.w,t.x+t.w),i=dE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:hE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=mE(0,t.x-r),l=mE(0,t.y-o),f=mE(0,i-u),d=mE(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),hE(r,o,(i-=f)-r,(a-=d)-o)},create:hE,fromClientRect:function(e){return hE(e.left,e.top,e.width,e.height)}},yE=yt.each,bE=yt.extend,CE=function(){};CE.extend=sE=function(n){var o=this.prototype,r=function(){var e,t,n;if(!cE&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},t=function(){return this};cE=!0;var i=new this;return cE=!1,n.Mixins&&(yE(n.Mixins,function(e){for(var t in e)\"init\"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&yE(n.Methods.split(\",\"),function(e){n[e]=t}),n.Properties&&yE(n.Properties.split(\",\"),function(e){var t=\"_\"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&yE(n.Statics,function(e,t){r[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=bE({},o.Defaults,n.Defaults)),oe(n,function(e,t){var n,r;\"function\"==typeof e&&o[t]?i[t]=(n=t,r=e,function(){var e=this._super;this._super=o[n];var t=r.apply(this,arguments);return this._super=e,t}):i[t]=e}),r.prototype=i,(r.constructor=r).extend=sE,r};var wE=Math.min,xE=Math.max,SE=Math.round,NE={serialize:function(e){var t=JSON.stringify(e);return q(t)?t.replace(/[\\u0080-\\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return\"\\\\u\"+\"0000\".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(t){}}},EE={callbacks:{},count:0,send:function(t){var n=this,r=Ea.DOM,o=t.count!==undefined?t.count:n.count,i=\"tinymce_jsonp_\"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,\"script\",{id:i,src:t.url,type:\"text/javascript\"}),n.count++}},kE=xe(xe({},gN),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4