Advertisement
xiaomianao666

邀您一起看:分类

Aug 15th, 2024
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥分类@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9wYWdlL21haW5cXFwiKSkucnVsZSk7XFxubGV0IHR5cGUgPSBnZXRQYXJhbSgndHlwZScsICcnKSxcXG4gICAgaWQgPSBnZXRQYXJhbSgnaWQnLCAnJyksXFxuICAgIHRpdGxlID0gZ2V0UGFyYW0oJ3RpdGxlJywgJycpO1xcbmxldCByZXMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcIiArIHR5cGUgKyBcXFwiL1xcXCIgKyBpZCk7XFxubGV0IHVwZGF0ZSA9IFxcXCJcXFwiO1xcbmlmICh0aXRsZSA9PSAnJykge1xcbiAgICBsZXQgbGVuZ3RoID0gcmVzLnZlbmRvcnMubGVuZ3RoO1xcbiAgICB1cGRhdGUgKz0gbGVuZ3RoID4gMCA/ICflhbEnICsgbGVuZ3RoICsgJ+S4queJh+a6kCcgOiAn5pqC5peg54mH5rqQJztcXG4gICAgaWYgKGxlbmd0aCA+IDApIHtcXG4gICAgICAgIGxldCBlID0gcmVzLnZlbmRvcnNbMF07XFxuICAgICAgICB1cGRhdGUgKz0gZS5lcGlzb2Rlc19pbmZvID8gXFxcInxcXFwiIC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dHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXovpPlhaXphY3nva5cXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgIH1cXG4gICAgfVxcbiAqL1xcbmZ1bmN0aW9uIG1vZGVFZGl0UGFnZShkLCBjb25maWdLZXksIHBhcmFtcykge1xcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihwYXJhbXMua2V5KVxcbiAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICBsZXQgZGF0YUtleXMgPSBPYmplY3Qua2V5cyhkYXRhcyk7XFxuICAgICAgICBmb3IgKGxldCBpIGluIGRhdGFLZXlzKSB7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoZGF0YXNbZGF0YUtleV0ua2V5KVxcbiAgICAgICAgfVxcbiAgICB9LCBwYXJhbXMpKVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICAgICAgZGVzYzogcGFyYW1zLmRlc2MsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKHBhcmFtcy5rZXksIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0eXBlOiBwYXJhbXMud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SNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGNvbmZpZ0tleSwgcGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKHBhcmFtcy5rZXksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICBpZihuYW1lID09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV57yW6L6RJ1xcbiAgICAgICAgICAgIGNvbmZpZ1tjb25maWdLZXldLnVzZSA9IG5hbWVcXG4gICAgICAgICAgICBpZiAoIWNvbmZpZ1tjb25maWdLZXldW25hbWVdKSBjb25maWdbY29uZmlnS2V5XVtuYW1lXSA9IHt9XFxuICAgICAgICAgICAgbGV0IGRhdGFzID0gcGFyYW1zLmRhdGE7XFxuICAgICAgICAgICAgbGV0IGRhdGFLZXlzID0gT2JqZWN0LmtleXMoZGF0YXMpO1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gZGF0YUtleXMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGFLZXkgPSBkYXRhS2V5c1tpXVxcbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IGRhdGFzW2RhdGFLZXldXFxuICAgICAgICAgICAgICAgIGNvbmZpZ1tjb25maWdLZXldW25hbWVdW2RhdGFLZXldID0gZ2V0TXlWYXIoZGF0YS5rZXksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxuICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip8nXFxuICAgICAgICB9LCBjb25maWdLZXksIHBhcmFtcylc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VFZGl0UGFnZShkKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lkOiDniYfljZVpZCcgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3R5cGU6IOeJh+WNleexu+WeiycgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO3RpdGxlOiDniYfljZXmoIfpopgnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiZGV0YWlsc1ZpZXdDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXphY3nva7ku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBzZXR0aW5nOiB7XFxuICAgICAgICAgICAgICAgIGtleTogXFxcImlucHV0X3NldHRpbmdfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXorr7nva7pobXpnaLku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cXG4vL+iHquWumuS5ieino+aekC3nvJbovpHpobXpnaJcXG5mdW5jdGlvbiBhbmFseXNpc01vZGVFZGl0UGFnZShkKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJzxmb250IGNvbG9yPVxcXCIjODA4MDgwXFxcIj4nICsgJ+OAkOino+aekOS7o+eggeWGhee9ruWPmOmHj+OAkScgKyAnPGJyPiZuYnNwOyZuYnNwOyZuYnNwO2lucHV0OiDop4bpopHpk77mjqUnICsgJzwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgIH0pXFxuICAgIG1vZGVFZGl0UGFnZShkLCBcXFwiYW5hbHlzaXNDb25maWdzXFxcIiwge1xcbiAgICAgICAga2V5OiBcXFwiaW5wdXRfbmFtZVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5ZCN56ewXFxcIixcXG4gICAgICAgIC8vIHR5cGU6ICdpbnB1dCdcXG4gICAgICAgIGRhdGE6IHtcXG4gICAgICAgICAgICBjb25maWc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfY29kZVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXop6PmnpDku6PnoIFcXFwiLFxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBrZXk6ICdpbnB1dF9leHRyYScsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaVleHRyYeWxnuaAp+WAvCcsXFxuICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYSdcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHNldHRpbmc6IHtcXG4gICAgICAgICAgICAgICAga2V5OiBcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIixcXG4gICAgICAgICAgICAgICAgZGVz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YXRlJywgU3RyaW5nKHZlcnNpb24pKTtcXHJcXG4gICAgICAgIGNvbmZpcm0oe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5rip6aao5o+Q56S6JyxcXHJcXG4gICAgICAgICAgICBjb250ZW50OiAn5q2k6KeE5YiZ5LuF6ZmQ5a2m5Lmg5Lqk5rWB5L2/55SoXFxcXG7or7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpCFcXFxcblxcXFxu5Lu75L2V57uE57uH5oiW5Liq5Lq65LiN5b6X5Lul5Lu75L2V5pa55byP5pa55rOVXFxcXG7kvKDmkq3mraTop4TliJnnmoTmlbTkvZPmiJbpg6jliIYhIVxcXFxuXFxcXG7mhJ/osKLlpKfkvazku6zmj5DkvpvnmoTmioDmnK/mlK/mjIEhISEnLFxcclxcbiAgICAgICAgICAgIGNvbmZpcm06ICcnLFxcclxcbiAgICAgICAgICAgIGNhbmNlbDogJydcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBsZXQgdXBkYXRlSW5mbyA9IGdldEl0ZW0oJ3VwZGF0ZScsICcnKTtcXHJcXG4gICAgICAgIGlmICh1cGRhdGVJbmZvID09ICcnIHx8IHBhcnNlSW50KHVwZGF0ZUluZm8pIDwgdmVyc2lvbikge1xcclxcbiAgICAgICAgICAgIHNldEl0ZW0oJ3VwZGF0ZScsIFN0cmluZyh2ZXJzaW9uKSk7XFxyXFxuICAgICAgICAgICAgY29uZmlybSh7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pys5qyh5pu05paw5YaF5a65JyxcXHJcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+mZjeS9jumFjee9ruaWh+S7tuWHuumUmeamgueOhycsXFxyXFxuICAgICAgICAgICAgICAgIGNvbmZpcm06ICcnLFxcclxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICcnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH1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0YWlsc1ZpZXdDb25maWdzID0gZ2V0Q29uZmlnKCdkZXRhaWxzVmlld0NvbmZpZ3MnKTtcXHJcXG5cXHJcXG4gICAgbGV0IGl0ZW1zID0gW107XFxyXFxuICAgIGxpc3QuZm9yRWFjaChkYXRhID0+IHtcXHJcXG4gICAgICAgIGlmIChkYXRhLnRhcmdldF90eXBlID09ICdkb3VsaXN0X2NhcmRzJykge1xcclxcbiAgICAgICAgICAgIGRhdGEudGFyZ2V0LmRvdWxpc3RzLmZvckVhY2goZSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBlLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSBpZiAoZGF0YS50YXJnZXRfdHlwZSA9PSAnY2hhcnQnKSB7XFxyXFxuICAgICAgICAgICAgbGV0IGUgPSBkYXRhLnRhcmdldDtcXHJcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gXFxcImNvbGxlY3Rpb25cXFwiIHx8IHR5cGUgPT0gXFxcImNoYXJ0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBkYXRhLnRhcmdldF90eXBlLCBlLmlkKSxcXHJcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmxcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGRhdGEudGFyZ2V0X3R5cGUsXFxyXFxuICAgICAgICAgICAgICAgIGlkID0gZGF0YS50YXJnZXQuaWQsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZGF0YS50YXJnZXQudGl0bGU7XFxyXFxuICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcclxcbiAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGRhdGEudGFyZ2V0LmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZGF0YS50YXJnZXQuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiBkYXRhLnR5cGVfbmFtZSxcXHJcXG4gICAgICAgICAgICAgICAgY29udGVudDogZGF0YS50YXJnZXQuY2FyZF9zdWJ0aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgfSk7XFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgIH0pO1xcclxcblxcclxcbiAgICBzZXRTZWFyY2hSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogaXRlbXNcXHJcXG4gICAgfSk7XFxyXFxufVxcclxcblxcclxcbi8v5LqM57qn6aG16Z2iXFxyXFxuZnVuY3Rpb24gZXJqaSgpIHtcXHJcXG4gICAgYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXHJcXG4gICAgICAg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IXimIXimIbimIbimIZcXFwiLCBcXFwi4piF4piG4piG4piG4piGXFxcIl1baW5kZXhdICsgXFxcIjwvZm9udD4mbmJzcDtcXFwiO1xcclxcblxcclxcbiAgICAgICAgciArPSBmdW5jdGlvbihlKSB7XFxyXFxuICAgICAgICAgICAgbGV0IHQxID0gJyc7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBlOyBpKyspIHQxICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIGxldCB0MiA9ICcnO1xcclxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMTAgLSBlOyBpKyspIHQyICs9IFxcXCLilodcXFwiO1xcclxcbiAgICAgICAgICAgIHJldHVybiB0MS5mb250Y29sb3IoJyNmZmFjMmQnKSArIHQyLmZvbnRjb2xvcignI2U1ZTFlNCcpO1xcclxcbiAgICAgICAgfSgoMTAgKiB2YWx1ZSkudG9GaXhlZCgwKSk7XFxyXFxuXFxyXFxuICAgICAgICByICs9ICcmbmJzcDs8c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyAoMTAwICogdmFsdWUpXFxyXFxuICAgICAgICAgICAgLnRvRml4ZWQoMSkgKyBcXFwiJTwvZm9udD48L3NtYWxsPjxici8+XFxcIjtcXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICByICs9IFtpLmRvbmVfY291bnQgPyBpLmRvbmVfY291bnQgKyBcXFwi5Lq655yL6L+HXFxcIiA6IFxcXCJcXFwiLCBpLmRvaW5nX2NvdW50ID8gaS5kb2luZ19jb3VudCArIFxcXCLkurrlnKjnnItcXFwiIDogXFxcIlxcXCIsIGkud2lzaF9jb3VudCA/IGkud2lzaF9jb3VudCArIFxcXCLkurrmg7PnnItcXFwiIDogXFxcIlxcXCJdLmpvaW4oXFxcIiZuYnNwOyZuYnNwO1xcXCIpXFxyXFxuICAgICAgICAuc21hbGwoKVxcclxcbiAgICAgICAgLmZvbnRjb2xv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ScpICsgJyZuYnNwOycpLmZvbnRjb2xvcihcXFwiZ3JleVxcXCIpO1xcclxcbiAgICAgICAgICAgIHIyICs9IGl0ZW0uY2VsZWJyaXRpZXMubWFwKGNlbGVicml0eSA9PiBjZWxlYnJpdHkubmFtZSkuam9pbignJm5ic3A7LyZuYnNwOycpO1xcclxcbiAgICAgICAgICAgIHIyICs9ICc8YnIvPic7XFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgcjIgKz0gJzxici8+JztcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogW3tcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHIgKyByMixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfV1cXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0gZWxzZSBpZihzLmF3YXJkcy5sZW5ndGggPT0gMCl7XFxyXFxuICAgICAgICBzZXRSZXN1bHQoW10pO1xcclxcbiAgICB9IGVsc2V7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBbe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogcjIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH1dXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v5aWW6aG56K+m5oOF6aG16Z2iXFxyXFxuZnVuY3Rpb24gYXdhcmRWaWV3KGlkLCBuYW1lKSB7XFxyXFxuICAgIHNldFBhZ2VUaXRsZShuYW1lKTtcXHJcXG4gICAgbGV0IHMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZ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xcXCI/dHlwZT0uanBnXFxcIixcXHJcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicGljXzJcXFwiXFxyXFxuICAgIH0pKSk7XFxyXFxuXFxyXFxuICAgIGlmIChwYWdlID09IDEpIHtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgaWYgKHRlbXAgPT0gJ3Bob3RvcycpIHtcXHJcXG4gICAgICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIjxiaWc+5YWxPHN0cm9uZz4gXFxcIiArIHIudG90YWwgKyAnIDwvc3Ryb25nPuW8oOWJp+eFpzwvYmlnPjxici8+PHNtYWxsPjxmb250IGNvbG9yPVxcXCJncmV5XFxcIj7lrpjmlrnliafnhafvvJonICsgci5vICsgXFxcIuW8oCZuYnNwO+aIquWbvu+8mlxcXCIgKyByLmMgKyBcXFwi5bygJm5ic3A75bel5L2c54Wn77yaXFxcIiArIHIudyArIFxcXCLlvKAmbmJzcDvmlrDpl7vlm77niYfvvJpcXFwiICsgci5uICsgXFxcIuW8oCZuYnNwO+eyieS4neWbvueJh++8mlxcXCIgKyByLmYgKyBcXFwi5bygPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCI8YmlnPuWFsTxzdHJvbmc+IFxcXCIgKyByLnRvdGFsICsgXFxcIjwvc3Ryb25nPuW8oOa1t+aKpTwvYmlnPlxcXCIsXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBsID0gYS5jb25jYXQobCk7XFxyXFxuICAgIH1cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBsXFxyXFxuICAgIH0pXFxyXFxufVxcclxcblxcclxcbi8v5ryU6IGM5Lq65ZGY6aG16Z2iXFxyXFxuZnVuY3Rpb24gY3JlZGl0cyh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi9jcmVkaXRzXFxcIik7XFxyXFxuICAgIGxldCByID0gW107XFxyXFxuICAgIGkuY3JlZGl0cy5mb3JFYWNoKChlID0+IHtcXHJcXG4gICAgICAgIHIucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGUuY2VsZWJyaXRpZXMuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICAgICAgci5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUubmFtZSArIFxcXCJcXFxcblxcXCIgKyBlLmxhdGluX25hbWUsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6IGUuY2hhcmFjdGVyLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuYXZhdGFyLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5hdmF0YXIubm9ybWFsLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOi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gICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS51c2VyLm5hbWUsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnVzZXIuYXZhdGFyLFxcclxcbiAgICAgICAgICAgIHVybDogZS51c2VyLnVybCxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogZS5jb21tZW50ICsgKHQgPyAnPGJyLz48c21hbGw+55yL6L+HIDxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyB0ICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIgOiBcXFwiXFxcIikgKyAnPGJyLz48c21hbGw+PGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPicgKyBlLnZvdGVfY291bnQgKyBcXFwi6LWe4oCiXFxcIiArIC9cXFxcZHs0fS1cXFxcZHsxLDJ9LVxcXFxkezEsMn0vZy5leGVjKGUuY3JlYXRlX3RpbWUpICsgXFxcIjwvZm9udD48L3NtYWxsPlxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGwucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfSkpO1xcclxcblxcclxcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIGwudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8YmlnPuWFsTxzdHJvbmc+IFxcXCIg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9XFxcImdyZXlcXFwiPicgKyBpICsgciArIG8gKyBcXFwiPC9mb250Pjwvc21hbGw+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0pKTtcXHJcXG5cXHJcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcclxcbiAgICAgICAgbC51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSk7XFxyXFxuICAgICAgICBsLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGJpZz7lhbE8c3Ryb25nPiBcXFwiICsgci50b3RhbCArIFxcXCIgPC9zdHJvbmc+5p2h5Ymn6K+EPC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXHJcXG4gICAgICAgIH0pO1xcclxcblxcclxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICAgICAgZGF0YTogYS5jb25jYXQobClcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgICAgICBkYXRhOiBsXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxufVxcclxcblxcclxcbi8v6aKE5ZGK54mH6aG16Z2iXFxyXFxuZnVuY3Rpb24gdHJhaWxlcnModHlwZSwgaWQpIHtcXHJcXG4gICAgc2V0UGFnZVRpdGxlKCfpooTlkYot54mH5q61LeiKsee1ricpXFxyXFxuICAgIGxldCBpID0gZ2V0RG91YmFuUmVzKFxcX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h7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLoirHnta5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBzZXRIb21lUmVzdWx0KHtcXHJcXG4gICAgICAgIGRhdGE6IHIuY29uY2F0KGwpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChvKVxcclxcbiAgICB9KVxcclxcbn1cXHJcXG5cXHJcXG4vL+inhumikeivhOiuuumhtemdolxcclxcbmZ1bmN0aW9uIHZpZGVvQ29tbWVudCh0eXBlLCBpZCkge1xcclxcbiAgICBsZXQgaSA9IGdldERvdWJhblJlcyhcXFwiaHR0cHM6Ly9mcm9kby5kb3ViYW4uY29tL2FwaS92Mi9cXFwiICsgdHlwZSArIFxcXCIvXFxcIiArIGlkICsgXFxcIi92aWRlb3NcXFwiKS52aWRlb3M7XFxyXFxuICAgIGkuZm9yRWFjaCgoZSA9PiB7XFxyXFxuICAgICAgICBlLmNvbF90eXBlID0gXFxcIm1vdmllXzJcXFwiLCBlLmRlc2MgPSBlLmF1dGhvci5uYW1lICsgXFxcIuKAolxcXCIgKyBlLmNyZWF0ZV90aW1lLCBlLmltZyA9IGUuY292ZXJfdXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvdmVyX3VybCwgZS51cmwgPSBlLnZpZGVvX3VybFxcclxcbiAgICB9KSlcXHJcXG4gICAgaWYgKGkubGVuZ3RoID4gMCkge1xcclxcbiAgICAgICAgaS51bnNoaWZ0KHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuinhumikeivhOiuulxcXCIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcclxcbiAgICAgICAgZGF0YTogaVx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UyLmlkLCBlMi5jb2xsZWN0aW9uc1swXS50aXRsZSksXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfSlcXHJcXG5cXHJcXG4gICAgICAgIGxldCBkZXRhaWxzVmlld0NvbmZpZ3MgPSBnZXRDb25maWcoJ2RldGFpbHNWaWV3Q29uZmlncycpO1xcclxcbiAgICAgICAgbGV0IHdvcmtzID0gZTIuY29sbGVjdGlvbnNbMF0ud29ya3M7XFxyXFxuICAgICAgICBsZXQgbGVuZ3RoID0gd29ya3MubGVuZ3RoIDw9IDMgPyB3b3Jrcy5sZW5ndGggOiAzO1xcclxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgIGxldCBlID0gd29ya3NbaV07XFxyXFxuICAgICAgICAgICAgbGV0IHJhdGluZyA9IFxcXCJcXFwiO1xcclxcbiAgICAgICAgICAgIGlmIChlLnN1YmplY3QuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcclxcbiAgICAgICAgICAgICAgICByYXRpbmcgPSBjb21wdXRlUmF0aW5nKGUuc3ViamVjdC5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLm1heCwgZS5zdWJqZWN0LmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5zdWJqZWN0LmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUgKyBcXFwi5YiGXFxcIjtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YmplY3Quc3VidHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgaWQgPSBlLnN1YmplY3QuaWQsXFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gZS5zdWJqZWN0LnRpdGxlO1xcclxcbiAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBpbWc6IGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnN1YmplY3QuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmFcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgLyphLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2pva2VyLXR4LmNvZGluZy5uZXQvcC9oaWtlcmltZy9kL2hpa2VyL2dpdC9yYXcvbWFzdGVyL2ltZy9tb3JlX3Zlci5wbmc/ZG93bmxvYWQ9ZmFsc2UnLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyMvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXHJcXG4gICAgICAgICAgICAgICAgLnJ1bGUoKGlkLCB0eXBlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgZWxlc3NhcldvcmtzKGlkLCB0eXBlKTtcXHJcXG4gICAgICAgICAgICB9LCBlMi5pZCwgZTIuY29sbGVjdGlvbnNbMF0udGl0bGUpXFxyXFxuICAgICAgICB9KSovXFxyXFxuICAgIH1cXHJcXG4gICAgXFxyX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B7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgLy90aXRsZTogZTMucGhvdG9zWzBdLmRlc2NyaXB0aW9uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzInLFxcclxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMCcsXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZTMucGhvdG9zW2ldLmltYWdlLm5vcm1hbC51cmwgKyAnQFJlZmVyZXI9JyArIGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IGUzLnBob3Rvc1tpXS5pbWFnZS5ub3JtYWwudXJsICsgJ0BSZWZlcmVyPScgKyBlMy5waG90b3NbaV0uaW1hZ2Uubm9ybWFsLnVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuXFxyXFxuICAgICAgICAvKmEucHVzaCh7XFxyXFxuICAgICAgICAgICAgLy90aXRsZTogJ+afpeeci+abtOWkmicsXFxyXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9qb2tlci10eC5jb2RpbmcubmV0L3AvaGlrZXJpbWcvZC9oaWtlci9naXQvcmF3L21hc3Rlci9pbWcvbW9yZS5wbmc/ZG93bmxvYWQ9ZmFsc2UnLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMicsXFxyXFxuICAgICAgICAgICAgZGVzYzogJzAnLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8jLyRwYWdle2Z5cGFnZX0jbm9IaXN0b3J5IycpXFxyXFxuICAgICAgICAgICAgICAgIC5ydWxlKChwaWQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAg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XG4gICAgICAgICAgICAgICAgaWYgKGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmF0aW5nID0gY29tcHV0ZVJhdGluZyhlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcubWF4LCBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcIiBcXFwiICsgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlICsgXFxcIuWIhlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YnR5cGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXIubm9ybWFsLnVybCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHJhdGluZyArICdcXFxcbicgKyBlLmV4dHJhLnNob3J0X2luZm8sXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxyXFxuICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBlLmNlcmVtb255LnRpdGxlLmJvbGQoKSArICc8c21hbGw+KDxhIGhyZWY9XFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5I0BydWxlPWpzOmV2YWwo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uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgbC5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUgKyB5ZWFyLFxcclxcbiAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsLFxcclxcbiAgIC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q29uZmlncy51c2VdLmNvbmZpZztcXHJcXG4gICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgIGltZzogZS5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9nLCBcXFwiIFxcXCIpLnJlcGxhY2UoL1xcXFx0L2csIFxcXCIgXFxcIiksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxyXFxuICAgICAgICB9XVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCB2aWRlb1JlbGF0ZWRJdGVtcyA9IFtdO1xcclxcbiAgICBpZiAoaS50cmFpbGVyKSB7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7pooTlkYo8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgfSk7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogaS50cmFpbGVyLnRpdGxlLFxcclxcbiAgICAgICAgICAgIGltZzogaS50cmFpbGVyLmNvdmVyX3VybCxcXHJcXG4gICAgICAgICAgICB1cmw6IGkudHJhaWxlci52aWRlb191cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogaS50cmFpbGVyLnN1YmplY3RfdGl0bGUgKyBcXFwi4oCiXFxcIiArIGkudHJhaWxlci5jcmVhdGVfdGltZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzJcXFwiXFxyXFxuICAgICAgICB9KTtcXHJcXG4gICAgICAgIHZpZGVvUmVsYXRlZEl0ZW1zLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5pu05aSaJyxcXHJcXG4gICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2dpdGNvZGUubmV0L3FxXzQxODQ2NzU2L2hpa2VyLy0vcmF3L21hc3Rlci9pbWcvbW9yZS5wbmdcXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfMlxcXCIsXFxyXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyMvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJykucnVsZSgodCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIHRyYWlsZXJzKHRbMF0sIHRbMV0pO1xcclxcbiAgICAgICAgICAgIH0sIFtpLnN1YnR5cGUsIGkuaWRdKSxcXHJcXG4gICAgICAgIH0pO1xcclxcbiAgICB9XFxyXFxuICAgIGlmIChpLnZpZGVvKSB7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7op4bpopHor4Torro8L3N0cm9uZz48L2JpZz5cXFwiLFxcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgfSk7XFxyXFxuICAgICAgICB2aWRlb1JlbGF0ZWRJdGVtcy5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogaS52a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YXJjaEl0ZW1dLm5hbWVcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9KVxcclxcbiAgICBpZiAocXVpY2tTZWFyY2hJdGVtcy5sZW5ndGggPiAwKSB7XFxyXFxuICAgICAgICBxdWlja1NlYXJjaEl0ZW1zLnVuc2hpZnQoe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzdHJvbmc+PGJpZz7lv6vpgJ/mkJzntKI8L2JpZz48L3N0cm9uZz4nLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH0sXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAvKnF1aWNrU2VhcmNoSXRlbXMudW5zaGlmdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KSovXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgc2V0SG9tZVJlc3VsdCh7XFxyXFxuICAgICAgICBkYXRhOiBpbmZvSXRlbXMuY29uY2F0KHJhdGluZ0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQocmVsYXRlZEl0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHF1aWNrU2VhcmNoSXRlbXMpXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQodmlkZW9JdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb1JlbGF0ZWRJdGVtcylcXHJcXG4gICAgICAgICAgICAuY29uY2F0KHtcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgLmNvbmNhdChpbnRyb0l0ZW1zKVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxyXFxuICAgICAgICAgICAgICAgICAgaWQ6ICdyZWNvbW1lbmRhdGlvbnMnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jODcxZjc4PuS7peS4iuaVsOaNruadpea6kOS6juixhueTo++8jOWmguaCqOWWnOasou+8jOivt+S4i+i9veWumOaWuWFwcDwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9I2YyMGMwMD7mraTop4TliJnku4XpmZDlrabkuaDkuqTmtYHkvb/nlKjvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOS7u+S9lee7hOe7h+aIluS4quS6uuS4jeW+l+S7peS7u+S9leaWueW8j+aWueazleS8oOaSreatpOinhOWImeeahOaVtOS9k+aIlumDqOWIhu+8gTwvZm9udD48L3NtYWxsPicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyBpZCArICcvJyxcXHJcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSlcXHJcXG4gICAgfSlcXHJcXG4gICAgYmUoW3tcXHJcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKG9iail7XFxyXFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgIGxldCByZXMgPSBnZXREb3ViYW5SZXMob2JqLnVybCk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgbGV0IGRldGFpbHNWaWV3Q29uZmlncyA9IGdldENvbmZpZygnZGV0YWlsc1ZpZXdDb25maWdzJyk7XFxyXFxuICAgICAgICAgICAgbGV0IGwgPSBbcmVzWzBdLHJlc1sxXSxyZXNbMl1dO1xcclxcbiAgICAgICAgICAgIGxldCBpID0gbC5tYXAoKGUgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGUudHlwZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5waWMubm9ybWFsIDogZS5jb3Zlci51cmwgKyAnQFJlZmVyZXI9JyArIGUuY292ZXIudXJsLFxcclxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZS5udWxsX3JhdGluZ19yZWFzb24gfHwgZS5yYXRpbmcudmFsdWVcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIH0pKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMl0pO1xcclxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsxXSk7XFxyXFxuICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdyZWNvbW1lbmRhdGlvbnMnLCBpWzBdKTtcXHJcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08YmlnPjxzdHJvbmc+55u45YWz5o6o6I2QPC9zdHJvbmc+PC9iaWc+XFxcIixcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyNub0hpc3RvcnkjJykucnVsZSgodCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmVjb21tZW5kYXRpb25zKHRbMF0sIHRbMV0pO1xcclxcbiAgICAgICAgICAgICAgICB9LCBbb2JqLnR5cGUsIG9iai5pZF0pLFxcclxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3JlY29tbWVuZGF0aW9ucycse2NvbF90eXBlOiAnbGluZScsZXh0cmE6e2lkOidub29vcCd9fSlcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBwYXJhbToge1xcclxcbiAgICAgICAgICAgIHVybDogXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcIiArIHR5cGUgKyBcXFwiL1xcXCIgKyBpZCArIFxcXCIvcmVjb21tZW5kYXRpb25zXFxcIixcXHJcXG4gICAgICAgICAgICB0eXBlOiB0eXBlLFxcclxcbiAgICAgICAgICAgIGlkOiBpZFxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XSlcXHJcXG59XFxyXFxuXFxyXFxuLy/mjqjojZBcXHJcXG5mdW5jdGlvbiBmaW5kTGlzdChwYWdlLCBjb3VudCkge1xcclxcbiAgICBpZiAoIWdldE15VmFyKCdmaW5kTGlzdCcpKSBwdXRNeVZhcignZmluZExpc3QnLCAne1xcXCJpdGVtXFxcIjpcXFwibW92aWVcXFwiLFxcXCJwbGF5YWJsZVxcXCI6XFxcIjBcXFwiLFxcXCJzY29yZVxcXCI6XFxcIjAsMTBcXFwifScpO1xcclxcbiAgICBsZXQgYSA9IFtdO1xcclxcbiAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2ZpbmRMaXN0JykpO1xcclxcbiAgICBsZXQgY29sb3IgPSBnZXRDb25maWcoJ2Nob29zZUNvbG9yJyk7XFxyXFxuXFxyXFxuICAgIGxldCBpdGVtcyA9IHtcXHJcXG4gICAgICAgIOeUteW9sTogJ21vdmllJyxcXHJcXG4gICAgICAgIOeUteinhuWJpzogJ3R2J1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAoaSBpbiBpdGVtcykge1xcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09PSBpdGVtc1tpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZmluZExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAuaXRlbSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJmaW5kTGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIH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xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiID8gXFxcIlxcXCIgOiBcXFwi77yIXFxcIiArIGUueWVhciArIFxcXCLvvIlcXFwiKSxcXHJcXG4gICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxyXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXHJcXG4gICAgICAgICAgICBpbWc6IGUucGljID8gZS5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLnBpYy5ub3JtYWwgOiBlLmNvdmVyX3VybCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5jb3Zlcl91cmwsXFxyXFxuICAgICAgICAgICAgZGVzYzogZS50eXBlICE9PSBcXFwicGxheWxpc3RcXFwiID8gKGUudGFncy5tYXAoKGUgPT4gZS5uYW1lKSkuam9pbihcXFwiLFxcXCIpICsgXFxcIlxcXFxuXFxcIiArIChlLnJhdGluZyA/IGNvbXB1dGVSYXRpbmcoZS5yYXRpbmcubWF4LCBlLnJhdGluZy52YWx1ZSkgKyBcXFwiIFxcXCIg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o5Y2O6K+t55S15b2xOiAnaG90X2dhaWE/YXJlYT3ljY7or60nLFxcclxcbiAgICAgICAgICAgIOeDremXqOasp+e+jueUteW9sTogJ2hvdF9nYWlhP2FyZWE95qyn576OJyxcXHJcXG4gICAgICAgICAgICDng63pl6jpn6nlm73nlLXlvbE6ICdob3RfZ2FpYT9hcmVhPemfqeWbvScsXFxyXFxuICAgICAgICAgICAg54Ot6Zeo5pel5pys55S15b2xOiAnaG90X2dhaWE/YXJlYT3ml6XmnKwnXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAg55S16KeG5YmnOiB7XFxyXFxuICAgICAgICAgICAg54Ot5pKt55S16KeG5YmnOiAndHZfaG90JyxcXHJcXG4gICAgICAgICAgICDng63mkq3lm73kuqfliac6ICd0dl9kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg54Ot5pKt5qyn576O5YmnOiAndHZfYW1lcmljYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreaXpeWJpzogJ3R2X2phcGFuZXNlJyxcXHJcXG4gICAgICAgICAgICDng63mkq3pn6nliac6ICd0dl9rb3JlYW4nLFxcclxcbiAgICAgICAgICAgIOeDreaSreWKqOeUuzogJ3R2X2FuaW1hdGlvbidcXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICDnu7zoibo6IHtcXHJcXG4gICAgICAgICAgICDng63mkq3nu7zoibo6ICdzaG93X2hvdCcsXFxyXFxuICAgICAgICAgICAg5Zu95YaF57u86Im6OiAnc2hvd19kb21lc3RpYycsXFxyXFxuICAgICAgICAgICAg5Zu95aSW57u86Im6OiAnc2hvd19mb3JlaWduJ1xcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2hvdExpc3QnLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBsZXQgc29ydCA9IHtcXHJcXG4gICAgICAgIOeDreW6puaOkuW6jzogJ3JlY29tbWVuZCcsXFxyXFxuICAgICAgICDml7bpl7TmjpLluo86ICd0aW1lJyxcXHJcXG4gICAgICAgIOivhOWIhuaOkuW6jzogJ3JhbmsnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBzb3J0KSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnNvcnQgPT0gc29ydFtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignaG90TGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgdGVtcC5zb3J0ID0gZTtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhvdExpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICB9LCBzb3J0W3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWFibGVbcl0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIHIgKyAnIDwvZm9udD48L2I+JyA6IHIsXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOiAvL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAucGxheWFibGUgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaG90TGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIHBsYXlhYmxlW3JdKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7or4TliIbljLrpl7Q6JyArIHRlbXAuc2NvcmUucmVwbGFjZSgnLCcsICctJykgKyAnIDwvZm9udD48L2I+JyxcXHJcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICB1cmw6ICQodGVtcC5zY29yZS5yZXBsYWNlKCcsJywgJy0nKSwgJ+ivhOWIhuW6lOWcqDAtMTDkuYvpl7QnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdob3RMaXN0JykpO1xcclxcbiAgICAgICAgICAgIGxldCBpbnB1dHMgPSBpbnB1dC5zcGxpdCgnLScpO1xcclxcbiAgICAgICAgICAgIGlmIChpbnB1dHMubGVuZ3RoID09IDIgJiYgaW5wdXRzLmV2ZXJ5KGUgPT4gZSA+PSAwICYmIGUgPD0gMTApICYmIHBhcnNlRmxvYXQoaW5wdXRzWzBdKSA8IGlucHV0c1sxXSkge1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnNjb3JlID0gaW5wdXQucmVwbGFjZSgnLScsICcsJyk7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJob3RMaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9KVxcclxcblxcclxcbiAgICBsZXQgbCA9IFtdO1xcclxcbiAgICBpZiAodGVtcC5pdGVtLmluZGV4T2YoJz8nKSAhPSAtMSkge1xcclxcbiAgICAgICAgbGV0IHMgPSBnZXREb3ViYW5SZXMoXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvbW92aWUvXFxcIiArIHRlbXAuaXRlbSArICcmcGxheWFibGU9JyArIHRlbXAucGxheWFibGUgKyAnJnNvcnQ9JyArIHRlbXAuc29ydCArICcmc2NvcmVfcmFuZ2U9JyArIHRlbXAuc2NvcmUgKyAocGFnZSA/IFxcXCImc3RhcnQ9XFxcIiArIChwYWdlIC0gMSkgKiBjb3VudCArIFxcXCImY291bnQ9XFxcIiArIGNvdW50IDogXFxcIiZzdGFydD0wJmNvdW50PTMwXFxcIikgKyAnJmxvY19pZD0xMDgyODgnKT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cclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArIFxcXCLvvIhcXFwiICsgZS55ZWFyICsgXFxcIu+8iVxcXCIsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgZS5waWMubm9ybWFsIDogZS5jb3Zlci51cmwgKyAnQFJlZmVyZXI9JyArIGUuY292ZXIudXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IChlLnRhZ3MgPyBlLnRhZ3MubWFwKChlID0+IGUubmFtZSkpLmpvaW4oXFxc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XRlbV1baV0gfHwgKHRlbXBbaXRlbV0gPT0gXFxcIlxcXCIgJiYgaSA9PSAwKSl7XFxyXFxuICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpdGVtc1tpdGVtXVtpXSArICcgPC9mb250PjwvYj4nO1xcclxcbiAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IGl0ZW1zW2l0ZW1dW2ldO1xcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICBsZXQgdXJsID0gJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRleHQsaXRlbSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBbaXRlbV0gPSB0ZXh0LmluZGV4T2YoXFxcIuWFqOmDqFxcXCIpICE9IC0xID8gXFxcIlxcXCIgOiB0ZXh0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBpdGVtc1tpdGVtXVtpXSwgaXRlbSk7XFxyXFxuICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLnllYXIgPT0gXFxcIuiHquWumuS5ieW5tOS7vVxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5bm05Lu9OicgKyB0ZW1wLmN1c3RvbVllYXIgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVllYXIsICfnm7TmjqXovpPlhaXlhbfkvZPlubTku70s5L6L5aaCMjAwMCcpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID09IDQpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tWWVhciA9IGlucHV0O1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAueWVhciA9IFxcXCLoh6rlrprkuYnlubTku71cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAubG9jYWwgPT0gXFxcIuiHquWumuS5ieWcsOWMulxcXCIpe1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5Zyw5Yy6OicgKyB0ZW1wLmN1c3RvbUxvY2FsICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21Mb2NhbCwgJ+ebtOaOpei+k+WFpeWFt+S9k+WcsOWMuizkvovlpoLkuK3lm73lpKfpmYYnKS5pbnB1dCgoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tTG9jYWwgPSBpbnB1dDtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gXFxcIuiHquWumuS5ieWcsOWMulxcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC50eXBlID09IFxcXCLoh6rlrprkuYnnsbvlnotcXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieexu+WeizonICsgdGVtcC5jdXN0b21UeXBlICsgJyA8L2ZvbnQ+PC9iPic7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgXFxyXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21UeXBlLCAn55u05o6l6L6T5YWl5YW35L2T57G75Z6LLOS+i+WmguWJp+aDhScpLmlucHV0KCgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID4gMCl7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21UeXBlID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC50eXBlID0gXFxcIuiHquWumuS5ieexu+Wei1xcXCI7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNsYXNzbGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXHJcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0pO1xcclxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiKXtcXHJcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5jbGFzcyA9PSBcXFwi6Ieq5a6a5LmJ5qCH562+XFxcIil7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnmoIfnrb46JyArIHRlbXAuY3VzdG9tQ2xhc3MgKyAnIDwvZm9udD48L2I+JztcXHJcXG4gICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICBcXHJcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUNsYXNzLCAn55u05o6l6L6T5YWl5YW35L2T5qCH562+LOS+i+Wmgue7j+WFuFxcXFxu5Y+v5YaZ5aSa5Liq5qCH562+LOS9v+eUqFxcXCLoi7HmlofpgJflj7dcXFwi5YiG6ZqUJykuaW5wdXQoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUNsYXNzID0gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jbGFzcyA9IFxcXCLoh6rlrprkuYnmoIfnrb5cXFwiO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJjbGFzc2xpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9KTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxyXFxuICAgICAgICB9KVxcclxcbiAgICB9XFxyXFxuXFxyXFxuICAgIGxldCByYW5rID0ge1xcclxcbiAgICAgICAg6buY6K6k5o6S5bqPOiBcXFwiVVxcXCIsXFxyXFxuICAgICAgICDng63luqY6IFxcXCJUXFxcIixcXHJcXG4gICAgICAgIOivhOWIhjogXFxcIlNcXFwiLFxcclxcbiAgICAgICAg5pe26Ze0OiBcXFwiUlxcXCJcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCByIGluIHJhbmspIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucmFuayA9PT0gcmFua1tyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgIHVybDogJCgnaGlrZXI6IC8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnJhbmsgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY2xhc3NsaXN0XFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcmFua1tyXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG5cXHJcXG4gICAgYS5wdXNoKHtcXHJcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxyXFxuICAgIH0pXFxyXFxuXFxyXFxuICAgIGxldCBmaWx0ZXIgPSB7XFxyXFxuICAgICAgICDlhajpg6jlvbHniYc6ICcnLFxcclxcbiAgICAgICAg5LuF5pyJ54mH5rqQOiAncGxheWFibGUnXFxyXFxuICAgIH1cXHJcXG4gICAgZm9yIChsZXQgciBpbiBmaWx0ZXIpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAuZmlsdGVyID09PSBmaWx0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c3RhcnRzV2l0aCgneycpKSB7XFxyXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFwicGxheWxpc3RcXFwiKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxyXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4ge1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcclxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXHJcXG4gICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhLFxcclxcbiAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFwiQFJlZmVyZXI9XFxcIiArIGUuY292ZXJfdXJsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IGUubnVsbF9yYXR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AgICAgICDlhrfpl6jkvbPniYc6IFxcXCJkYXJrX2hvcnNlXFxcIixcXHJcXG4gICAgICAgICAgICDkuLvpopg6IFxcXCJ0b3BpY1xcXCIsXFxyXFxuICAgICAgICAgICAg5a+85ryUOiBcXFwiZGlyZWN0b3JcXFwiLFxcclxcbiAgICAgICAgICAgIOa8lOWRmDogXFxcImFjdG9yXFxcIixcXHJcXG4gICAgICAgICAgICDns7vliJc6IFxcXCJzZXJpZXNcXFwiLFxcclxcbiAgICAgICAgICAgIOWNjuivrTogXFxcImNoaW5lc2VcXFwiLFxcclxcbiAgICAgICAgICAgIOasp+e+jjogXFxcIndlc3Rlcm5cXFwiLFxcclxcbiAgICAgICAgICAgIOaXpeacrDogXFxcImphcGFuZXNlXFxcIixcXHJcXG4gICAgICAgICAgICDpn6nlm706IFxcXCJrb3JlYVxcXCIsXFxyXFxuICAgICAgICAgICAg5Zac5YmnOiBcXFwiY29tZWR5XFxcIixcXHJcXG4gICAgICAgICAgICDliqjkvZw6IFxcXCJhY3Rpb25cXFwiLFxcclxcbiAgICAgICAgICAgIOeIseaDhTogXFxcImxvdmVcXFwiLFxcclxcbiAgICAgICAgICAgIOenkeW5uzogXFxcInNjaWVuY2VfZmljdGlvblxcXCIsXFxyXFxuICAgICAgICAgICAg5Yqo55S7OiBcXFwiY2FydG9vblxcXCIsXFxyXFxuICAgICAgICAgICAg5oKs55aROiBcXFwibXlzdGVyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5oOK5oKaOiBcXFwicGFuaWNcXFwiLFxcclxcbiAgICAgICAgICAgIOaBkOaAljogXFxcImhvcnJpYmxlXFxcIixcXHJcXG4gICAgICAgICAgICDniq/nvao6IFxcXCJjcmltaW5hbFxcXCIsXFxyXFxuICAgICAgICAgICAg5ZCM5oCnOiBcXFwibGdidFxcXCIsXFxyXFxuICAgICAgICAgICAg5oiY5LqJOiBcXFwid2FyXFxcIixcXHJcXG4gICAgICAgICAgICDlpYflubs6IFxcXCJmYW50YXN5XFxcIixcXHJcXG4gICAgICAgICAgICBcXFwiXFxcXHU2MGM1XFxcXHU4MjcyXFxcIjogXFxcImVyb3RpY2FcXFwiLFxcclxcbiAgICAgICAgICAgIOmfs+S5kDogXFxcIm11c2ljXFxcIixcXHJcXG4gICAgICAgICAgICDnuqrlvZXniYc6IFxcXCJkb2N1bWVudGFyeVxcXCIsXFxyXFxuICAgICAgICAgICAg5rK75oSIOiBcXFwiY3VyZVxcXCIsXFxyXFxuICAgICAgICAgICAg6Im65pyvOiBcXFwiYXJ0XFxcIixcXHJcXG4gICAgICAgICAgICDpu5HoibLlub3pu5g6IFxcXCJkYXJrX2h1bW9yXFxcIixcXHJcXG4gICAgICAgICAgICDpnZLmmKU6IFxcXCJ5b3V0aFxcXCIsXFxyXFxuICAgICAgICAgICAg5aWz5oCnOiBcXFwiZmVtYWxlXFxcIixcXHJcXG4gICAgICAgICAgICDnnJ/lrp7kuovku7bmlLnnvJY6IFxcXCJyZWFsX2V2ZW50XFxcIixcXHJcXG4gICAgICAgICAgICDmmrTlips6IFxcXCJ2aW9sZW5jZVxcXCIsXFxyXFxuICAgICAgICAgICAg6buR55m9OiBcXFwiYmxhY2tfd2hpdGVcXFwiLFxcclxcbiAgICAgICAgICAgIOe+jumjnzogXFxcImZvb2RcXFwiLFxcclxcbiAgICAgICAgICAgIOaXheihjDogXFxcInRyYXZlbFxcXCIsXFxyXFxuICAgICAgICAgICAg5YS/56ulOiBcXFwiY2hpbGRcXFwiLFxcclxcbiAgICAgICAgICAgIOS6uuaApzogXFxcImh1bWFuaXR5XFxcIixcXHJcXG4gICAgICAgICAgICDlrrbluq06IFxcXCJmYW1pbHlcXFwiLFxcclxcbiAgICAgICAgICAgIOaWh+iJujogXFxcImxpdGVyYXJ5X2FydFxcXCIsXFxyXFxuICAgICAgICAgICAg5bCP6K+05pS557yWOiBcXFwibm92ZWxcXFwiLFxcclxcbiAgICAgICAgICAgIOaEn+S6ujogXFxcIm1vdmluZ1xcXCIsXFxyXFxuICAgICAgICAgICAg5Yqx5b+XOiBcXFwiaW5zcGlyYXRpb25cXFwiXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgc3VidHlwZToge1xcclxcbiAgICAgICAgICAgIOWFqOmDqDogXFxcIlxcXCIsXFxyXFxuICAgICAgICAgICAg55S15b2xOiBcXFwibW92aWVcXFwiLFxcclxcbiAgICAgICAgICAgIOeUteinhuWJpzogXFxcInR2XFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXHJcXG4gICAgICAgIGZvciAobGV0IGogaW4gaXRlbXNbaV0pIHtcXHJcXG4gICAgICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcFtpXSA9PT0gaXRlbXNbaV1bal0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGogKyAnIDwvZm9udD48L2I+JyA6IGosXFxyXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxyXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHQpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncGxheWxpc3QnLCAne1xcXCJzdWJ0eXBlXFxcIjpcXFwiXFxcIixcXFwidHlwZVxcXCI6XFxcImFsbFxcXCJ9JykpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgdGVtcFt0WzBdXSA9IHRbMV07XFxyXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGxheWxpc3RcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgIC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CBpIGluIGl0ZW1zKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnR5cGUgPT0gaXRlbXNbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcigncmFua0xpc3QnKSk7XFxyXFxuICAgICAgICAgICAgICAgIHRlbXAudHlwZSA9IGU7XFxyXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJyYW5rTGlzdFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgIH0sIGl0ZW1zW2ldKVxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGxpc3QgPSB7XFxyXFxuICAgICAgICDlj6PnopHmppzljZU6ICdyYW5rX2xpc3QnLFxcclxcbiAgICAgICAg5bm05bqm5qac5Y2VOiAneWVhcl9yYW5rcycsXFxyXFxuICAgICAgICDnsbvlnovmppzljZU6ICdjYXRlZ29yeV9yYW5rcydcXHJcXG4gICAgfVxcclxcbiAgICBmb3IgKGxldCBpIGluIGxp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AgICAgIOaXtumXtDogJydcXHJcXG4gICAgfVxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgfSlcXHJcXG4gICAgZm9yIChsZXQgaSBpbiByYW5rKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOiB0ZW1wLnJhbmsgPT09IHJhbmtbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcclxcbiAgICAgICAgICAgICAgICB0ZW1wLnJhbmsgPSBlO1xcclxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiY29taW5nXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcclxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgfSwgcmFua1tpXSlcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IGxvY2FsID0ge1xcclxcbiAgICAgICAg5Zu95YaFOiAnZG9tZXN0aWMnLFxcclxcbiAgICAgICAg5YWo55CDOiAnaW50ZXJuYXRpb25hbCdcXHJcXG4gICAgfVxcclxcbiAgICBpZiAodGVtcC50eXBlID09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgIGEucHVzaCh7XFxyXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXHJcXG4gICAgICAgIH0pXFxyXFxuICAgICAgICBmb3IgKGxldCBpIGluIGxvY2FsKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAubG9jYWwgPT09IGxvY2FsW2ldID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBpICsgJyA8L2ZvbnQ+PC9iPicgOiBpLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NvbWluZycpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAubG9jYWwgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICAgICAgICAgICAgIH0sIGxvY2FsW2ldKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9XFxyXFxuICAgIH1cXHJcXG4gICAgbGV0IGFyZWEgPSB7XFxyXFxuICAgICAgICDlhajpg6g6ICcnLFxcclxcbiAgICAgICAg576O5Zu9OiAnJmFyZWFfZmlsdGVyPWFtZXJpY2FuJyxcXHJcXG4gICAgICAgIOasp+a0sjogJyZhcmVhX2ZpbHRlcj1ldXJvcGUnLFxcclxcbiAgICAgICAg5pel5pysOiAnJmFyZWFfZmlsdGVyPWphcGFuZXNlJyxcXHJcXG4gICAgICAgIOmfqeWbvTogJyZhcmVhX2ZpbHRlcj1rb3JlYW4nXFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKHRlbXAudHlwZSA9PSAnbW92aWUnICYmIHRlbXAubG9jYWwgPT0gJ2ludGVybmF0aW9uYWwnKSB7XFxyXFxuICAgICAgICBhLnB1c2goe1xcclxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxyXFxuICAgICAgICB9KVxcclxcbiAgICAgICAgZm9yIChsZXQgaSBpbiBhcmVhKSB7XFxyXFxuICAgICAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuYXJlYSA9PT0gYXJlYVtpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXHJcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXHJcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmFyZWEgPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNvbWluZ1xcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxyXFxuICAgICA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1hcCgoZSA9PiB7XFxyXFxuICAgICAgICBsZXQgdHlwZSA9IGUudHlwZSxcXHJcXG4gICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgdGl0bGUgPSBlLnRpdGxlO1xcclxcbiAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuI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AgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3JhbmtpbmcnKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLml0ZW0gPSBlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInJhbmtpbmdcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcclxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgYS5wdXNoKHtcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcclxcbiAgICAgICAgfSlcXHJcXG4gICAgfVxcclxcblxcclxcbiAgICBhLnB1c2goe1xcclxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXHJcXG4gICAgfSlcXHJcXG5cXHJcXG4gICAgbGV0IGkgPSBbXTtcXHJcXG4gICAgbGV0IHBsYXlhYmxlID0ge1xcclxcbiAgICAgICAg5YWo6YOo5b2x54mHOiAnMCcsXFxyXFxuICAgICAgICDku4XmnInniYfmupA6ICcxJ1xcclxcbiAgICB9XFxyXFxuICAgIGZvciAobGV0IHIgaW4gcGxheWFibGUpIHtcXHJcXG4gICAgICAgIGkucHVzaCh7XFxyXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucGxheWFibGUgPT0gcGxheWF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gICAgICBsZXQgdHlwZSA9IGUudHlwZSxcXHJcXG4gICAgICAgICAgICBpZCA9IGUuaWQsXFxyXFxuICAgICAgICAgICAgdGl0bGUgPSBlLnRpdGxlO1xcclxcbiAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxyXFxuICAgICAgICBsZXQgdXJsUGFyYW1zID0ge307XFxyXFxuICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcclxcbiAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0a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ZVRoZW1lI1xcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcclxcbiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcInBsYXlsaXN0XFxcIikge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIHtcXHJcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxyXFxuICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcclxcbiAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxyXFxuICAgICAgICAgICAgaW1nOiBlLmNvbnRlbnQuc3ViamVjdC5waWMubm9ybWFsICsgXFxcIkBSZWZlcmVyPVxcXCIgKyBlLmNvbnRlbnQuc3ViamVjdC5waWMubm9ybWFsLFxcclxcbiAgICAgICAgICAgIGRlc2M6IGUuY29udGVudC5zdWJqZWN0LmNhcmRfc3VidGl0bGUuc3BsaXQoXFxcIi9cXFwiKS5maWx0ZXIoKChlLCB0KSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGlmICh0IDwgMykgcmV0dXJuIGVcXHJcXG4gICAgICAgICAgICB9KSkuam9pbihcXFwiLFxcXCIpICsgXFxcIlxcXFxuXFxcIiArIChlLmNvbnRlbnQu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HZcXFwiKSB7XFxyXFxuICAgICAgICAgICAgZC5wdXNoKHtcXHJcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUgKyAoZS5lcGlzb2Rlc19pbmZvID8gXFxcIuKAolxcXCIgKyBlLmVwaXNvZGVzX2luZm8gOiBcXFwiXFxcIiksXFxyXFxuICAgICAgICAgICAgICAgIGltZzogZS5pY29uLFxcclxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sWzBdIHx8IFxcXCJpY29uXzJcXFwiLFxcclxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHk/aWQ9JyArIGlkICsgJyZ0eXBlPScgKyB0eXBlICsgJyZ0aXRsZT0nICsgZS50aXRsZSkucnVsZSgocmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHJlcy50aXRsZSxcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWMgPSByZXMucGljLm5vcm1hbCArIFxcXCJAUmVmZXJlcj1cXFwiICsgcmVzLnBpYy5ub3JtYWw7XFxyXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoZS50aXRsZSArICctJyArIHRpdGxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVBpY1VybChwaWMpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ2V0VHZVcmxzKGlkLCBlLmlkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICB9LCBsYXp5KVxcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YodXJscykgPT0gXFxcIm9iamVjdFxcXCIpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdXJscy5sZW5ndGg7IGkrKykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnrKwnICsgKGkgKyAxKSArICfpm4YnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzQnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBsYXp5ID8gdXJsc1tpXSArIGxhenkgOiB1cmxzW2ldLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mKHVybHMpID09IFxcXCJzdHJpbmdcXFwiICYmIHVybHMgPT0gJ+iiq+WwgWlwJykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvcmVsZWFzZUlQP3J1bGU96Z2S6LGGXFxcIikpXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5ydWxlO1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSAnc3RyaW5nJyAmJiB1cmxzID09ICfmsqHmnInmlLblvZUnKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ayoeacieaUtuW9leatpOinhumikea6kOeahOivpue7huS/oeaBrycsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICfngrnmiJHlj6/ku6Xljrvop4bpopHmupDnvZHnq5nnnIvnnIsnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGUudXJsXFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxyXFxuICAgICAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIH0sIHJlcywgaWQsIGUsIGxhenksIGV4dHJhKVxcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdtb3ZpZScpIHtcXHJcXG4gICAgICAgICAgICBsZXQgbUxhenkgPSAkKFxcXCJcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdFVybCA9IFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXCIoXFxcIikpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXHJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArICcoKCkgPT4geycgKyBsYXp5ICsgJ30pKCknKVxcclxcbiAgICAgICAgICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgIC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XFxuICAgIH1cXHJcXG4gICAgbGV0IGh0bWwgPSByZXF1ZXN0KG1VcmwsIHtcXHJcXG4gICAgICAgIGhlYWRlcnM6IGhlYWRlcnNcXHJcXG4gICAgfSlcXHJcXG4gICAgaWYgKChodG1sLmluY2x1ZGVzKFxcXCLnmbvlvZXot7PovaxcXFwiKSAmJiBodG1sLmluY2x1ZGVzKFxcXCLlvILluLjor7fmsYJcXFwiKSkgfHwgKGh0bWwuaW5jbHVkZXMoXFxcIndpbmRvdy5sb2NhdGlvbi5ocmVmXFxcIikgJiYgaHRtbC5pbmNsdWRlcyhcXFwic2VjLmRvdWJhblxcXCIpKSkge1xcclxcbiAgICAgICAgcmV0dXJuICfooqvlsIFpcCc7XFxyXFxuICAgIH0gZWxzZSB7XFxyXFxuICAgICAgICBsZXQgcyA9IHtcXHJcXG4gICAgICAgICAgICBxcTogMSxcXHJcXG4gICAgICAgICAgICB5b3VrdTogMyxcXHJcXG4gICAgICAgICAgICBsZXR2OiA2LFxcclxcbiAgICAgICAgICAgIG1ndHY6IDcsXFxyXFxuICAgICAgICAgICAgYmlsaWJpbGk6IDgsXFxyXFxuICAgICAgICAgICAgaXFpeWk6IDksXFxyXFxuICAgICAgICAgICAgY250djogMTIsXFxyXFxuICAgICAgICAgICAgY2N0djY6IDEzLFxcclxcbiAgICAgICAgICAgIG1pZ3V2aWRlbzogMTUsXFxyXFxuICAgICAgICAgICAgeGlndWE6IDE3LFxcclxcbiAgICAgICAgICAgIGFjZnVuOiAxOCxcXHJcXG4gICAgICAgICAgICBtYWlkdWlkdWk6IDE5XFxyXFxuICAgICAgICB9O1xcclxcbiAgICAgICAgbGV0IG51bSA9IHNbdWlkXTtcXHJcXG5cXHJcXG4gICAgICAgIHZhciBzb3VyY2VzID0ge307XFxyXFxuICAgICAgICBsZXQgc2wgPSBodG1sLm1hdGNoKC9zb3VyY2VzXFxcXFtbMS05XXsxLDJ9XFxcXF1bXFxcXHNcXFxcU10qP1xcXFxdL2cpO1xcclxcbiAgICAgICAgaWYgKHNsKSB7XFxyXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzbCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNsW2ldKTtcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgIGxldCBzY3JpcHRfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJnNjcmlwdFtzcmNdJyk7XFxyXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfdXJsID0gXFxcIlxcXCI7XFxyXFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBzY3JpcHRfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gcGFyc2VEb21Gb3JIdG1sKHNjcmlwdF9saXN0W2ldLCAnc2NyaXB0JiZzcmMnKTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmRleE9mKCdtaXhlZF9zdGF0aWMnKSAhPT0gLTEpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHNvdXJjZXNfdXJsID0gdXJsO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIGxldCBzb3VyY2VzX2xpc3QgPSByZXF1ZXN0KHNvdXJjZXNfdXJsKS5tYXRjaCgvc291cmNlc1xcXFxbWzEtOV17MSwyfVxcXFxdW1xcXFxzXFxcXFNdKj9cXFxcXS9nKTtcXHJcXG4gICAgICAgICAgICBmb3IgKHZhciBpIGluIHNvdXJjZXNfbGlzdCkge1xcclxcbiAgICAgICAgICAgICAgICBldmFsKHNvdXJjZXNfbGlzdFtpXSk7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgfVxcclxcblxcclxcbiAgICAgICAgbGV0IHJlbiA9IHNvdXJjZXNbbnVtXTtcXHJcXG4gICAgICAgIGlmIChyZW4gJiYgcmVuLmxlbmd0aC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ZXR0aW5nLWVkaXRvcj9ydWxlPemdkuixhiZ2aWV3PWRldGFpbFZpZXdNb2RlRWRpdFBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlID0gY29uZmlnS2V5XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip8nXFxuICAgICAgICAgICAgfSwgY29uZmlnS2V5KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6VJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9ZGV0YWlsVmlld01vZGVFZGl0UGFnZSdcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KelicsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhkZXRhaWxzVmlld0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyAmJiBjb25maWdLZXkgIT09ICfpu5jorqQnKSwgMilcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpemFjee9ruato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXCInICsgaW5wdXQgKyAnXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKE9iamVjdC5rZXlzKGRldGFpbHNWaWV3Q29uZmlncykuZmlsdGVyKGNvbmZpZ0tleSA9PiBjb25maWdLZXkgIT09ICd1c2UnKSwgMikuc2V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25maWdzID0gZ2V0Q29uZmlnKCdob21lUGFnZUNvbmZpZ3MnKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn6Ieq5a6a5LmJ6aaW6aG1Jy5ib2xkKCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgfSlcXG4gICAgZm9yIChsZXQgY29uZmlnS2V5IG9mIE9iamVjdC5rZXlzKGhvbWVQYWdlQ29uZmlncykpIHtcXG4gICAgICAgIGlmIChjb25maWdLZXkgPT09ICd1c2UnKSBjb250aW51ZTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGNvbmZpZ0tleSA9PT0gaG9tZVBhZ2VDb25maWdzLnVzZSA/IFxcXCLigJzigJxcXFwiICsgY29uZmlnS2V5ICsgXFxcIuKAneKAnVxcXCIgOiBjb25maWdLZXksXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShjb25maWdLZXkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFwiLCAn6aaW6aG16YWN572uJylcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9uYW1lXFxcIiwgY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9jb2RlXFxcIiwgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxuICAgICAgICAgICA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5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09ICfpu5jorqQnKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6YWN572u5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IGNvbmZpZy5ob21lUGFnZUNvbmZpZ3MudXNlKSByZXR1cm4gJ3RvYXN0Oi8v6K+l6YWN572u5q2j5Zyo5L2/55So77yM5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcIicgKyBpbnB1dCArICdcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuaG9tZVBhZ2VDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoaG9tZVBhZ2VDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID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rZXI6Ly9lbXB0eSNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoXFxcImlucHV0X2NvbmZpZ190eXBlXFxcIiwgJ+ino+aekOaPkuS7tumFjee9ricpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfbmFtZVxcXCIsIGNvbmZpZ0tleSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X2V4dHJhXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLmV4dHJhIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJpbnB1dF9zZXR0aW5nX2NvZGVcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uc2V0dGluZyB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPemdkuixhiZ2aWV3PWFuYWx5c2lzTW9kZUVkaXRQYWdlJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjb25maWcuYW5hbHlzaXNDb25maWdzLnVzZSA9IGNvbmZpZ0tleVxcbiAgICAgICAgICAgICAgICB3cml0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AgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlKSByZXR1cm4gJ3RvYXN0Oi8v6K+l6Kej5p6Q5q2j5Zyo5L2/55So77yM5peg5rOV5Yig6Zmk77yBJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcIicgKyBpbnB1dCArICdcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV1cXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/Cfk50nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoYW5hbHlzaXNDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKVxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfkuI3op6PmnpAnICYmIGlucHV0ID09PSAn5pat5o+SJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOino+aekOaXoOazlee8lui+ke+8gSdcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWdLZXkgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImlucHV0X25hbWVcXFwiLCBjb25maWdLZXkpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfY29kZVxcXCIsIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfZXh0cmFcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uZXh0cmEgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRfc2V0dGluZ19jb2RlXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLnNldHRpbmcgfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9zZXR0aW5nLWVkaXRvcj9ydWxlPemdkuixhiZ2aWV3PWFuYWx5c2lzTW9kZUVkaXRQYWdlJztcXG4gICAgICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5OlJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5Y+j5LukXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghaW5wdXQuaW5jbHVkZXMoXFxcIuino+aekOaPkuS7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1xcbiAgICAgICAgICAgIHJlc3VsdCA9IFxcXCJ0b2FzdDovL+mUmeivr+eahOiuvue9rumhtemdouS7o+eggSzor7fliY3lvoAg5pel5b+XIOafpeeci+mUmeivr+WOn+WboFxcXCJcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfimpnvuI8nLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICB1cmw6IHJlc3VsdFxcbiAgICB9KVxcbn1cXG5cXG4vL+iHquWumuS5ieW/q+mAn+aQnOe0ouaooeWdl1xcbmZ1bmN0aW9uIHF1aWNrU2VhcmNoRElZTW9kdWxlKGQsIGNvbmZpZykge1xcbiAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gZ2V0Q29uZmlnKCdxdWlja1NlYXJjaENvbmZpZ3MnLCBjb25maWcpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfoh6rlrprkuYnlv6vpgJ/mkJzntKInLmJvbGQoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICB9KVxcbiAgICBmb3IgKGxldCBjb25maWdLZXkgb2YgcXVpY2tTZWFyY2hDb25maWdzLm9yZGVyKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBjb25maWdLZXksXFxuICAgICAgICAgICAgdXJsOiAkKCfinpXmmK/mt7vliqBcXFxcbuKeluaYr+WIoOmZpFxcXFxu8J+TneaYr+S/ruaUuVxcXFxu8J+UgeaYr+aOkuW6j1xcXFxu4pqZ77iP5piv6K6+572u5qC35byPJykuY29uZmlybSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kuIvmrKHkuI3opoHlho3ngrnmiJHkuoYnXFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kele+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgn5pi+56S65ZCNQEDlsI/nqIvluo/lkI1AQOWbvueJh+mTvuaOpScsICfmoLnmja7mj5DnpLrovpPlhaXlsLHlpb3kuoZcXFxcbuWwj+eoi+W6j+WQjeS4uuepuuWImeS4uua1t+mYlOaQnOe0oicpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXG4gICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggIT0gMyB8fCBpbnB1dFswXSA9PT0gXFxcIlxcXCIpIHJldHVybiBcXFwidG9hc3Q6Ly/moLzlvI/kuI3lr7nvvIzmjInmoLzlvI/ovpPlhaUhXFxcIjtcXG4gICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXG4gICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a3u+WKoOaIkOWKnyc7XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4p6WJyxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlncy5vcmRlciwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcbiAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFwiJyArIGlucHV0ICsgJ1xcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoY29uZmlnS2V5KTtcXG4gICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tjb25maWdLZXldXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4g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bnB1dFswXSkgPT0gLTEpIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIucHVzaChpbnB1dFswXSk7XFxuICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRbMF1dID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxuICAgICAgICAgICAgICAgICAgICBwaWM6IGlucHV0WzJdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJztcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+UgScsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanNvbicpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIGlmIChnZXRNeVZhcignanNvbicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcbiAgICAgICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShxdWlja1NlYXJjaENvbmZpZ3MpKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxuICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuWIq+eCueWHu+S4pOmhueS7peS6pOaNoumhuuW6j1xcXFxu4oCY4oCY5o6S5bqP5a6M5q+V5ZCO54K55oiR5L+d5a2Y5o6S5bqPLOWQpuWImeaOkuW6j+S4jeeUn+aViOKAmeKAmScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgb2xkLm9yZGVyLmZvckVhY2goKHZhbHVlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdvcCcpID09IHZhbHVlID8gdmFsdWUgKyAn4oCY4oCYKOW9k+WJjemAieS4rSnigJnigJknIDogdmFsdWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoa2V5LCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcCA9IGdldE15VmFyKCdvcCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignb3AnLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcCA9PSBrZXkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3YSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IG9sZC5tb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IG9sZC5vcmRlclxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BpbmRleCA9IG5ld2Eub3JkZXIuaW5kZXhPZihvcCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhvcGluZGV4IC0gaW5kZXgpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXJbb3BpbmRleF0gPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW2luZGV4XSA9IG9wO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9waW5kZXggPiBpbmRleCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCwgMCwgb3ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2Uob3BpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCAtIDEsIDAsIG9wKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLmZvckVhY2godmFsdWUgPT4gbmV3YVt2YWx1ZV0gPSBvbGRbdmFsdWVdKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KG5ld2EpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHZhbHVlLCBpbmRleClcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+Kame+4jycsXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3NbJ21vZGUnXSB8fCBcXFwiXFxcIiwgJ+ivt+ato+ehrui+k+WFpee7hOS7tuagt+W8j1xcXFxu5bu66K6u5YC8OmZsZXhfYnV0dG9uIHNjcm9sbF9idXR0b24gaWNvbl9yb3VuZF9zbWFsbF80IGljb25fc21hbGxfNCcpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm1vZGUgPSBpbnB1dDtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/moLflvI/kv67mlLnmiJDlip8nXFxuICAgICAgICB9KVxcbiAgICB9KVxcbn1cXG5cXG4vL+iuvue9rumhtemdolxcbmZ1bmN0aW9uIHNldHRpbmdQYWdlKCkge1xcbiAgICBsZXQgY29uZiA9IGdldENvbmZpZygpO1xcbiAgICBsZXQgZCA9IFtdO1xcblxcbiAgICBsZXQgc3RhckNvbG9yID0gY29uZi5zdGFyQ29sb3IgfHwgJyNmZmFjMmQnO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+iHquWumuS5ieaYn+aYn+minOiJsicuYm9sZCgpLFxcbiAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPScgKyBzdGFyQ29sb3IgKyAnPicgKyAn4piF4piF4piF4piF4piFPC9mb250PicsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICB1cmw6ICQoc3RhckNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLnN0YXJDb2xvciA9IGlucHV0O1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7mm7TmlLnlt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgbGV0IGNob29zZUNvbG9yID0gY29uZi5jaG9vc2VDb2xvciB8fCAnI0ZBNzI5OCc7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn6Ieq5a6a5LmJ6YCJ5Lit5qCH562+6aKc6ImyJy5ib2xkKCksXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIGNob29zZUNvbG9yICsgJz4nICsgJ+aIkeaYr+mihOiniOaViOaenDwvZm9udD4nLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgdXJsOiAkKGNob29zZUNvbG9yLCAn5Yir5b+Y5LqGIycpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxuICAgICAgICAgICAgY29uZmlnLmNob29zZUNvbG9yID0gaW5wdXQ7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXCI7XFxuICAgICAgICB9KVxcbiAgICB9KVxcblxcbiAgICBob21lUGFnZVNldHRpbmdNb2R1bGUoZCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgIH0pXFxuXFxuICAgIHF1aWNrU2VhcmNoRElZTW9kdWxlKGQsIGNvbmYpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICB9KVxcblxcbiAgICBkZXRhaWxWaWV3U2V0dGluZ01vZHVsZShkKTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgfSlcXG5cXG4gICAgaWYgKHRydWUvKmdldEl0ZW0oJ3Bhc3N3b3JkJykgPT0gJ3RydWUnKi8pIHtcXG4gICAgICAgIGFuYWx5c2lzU2V0dGluZ01vZHVsZShkKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+aBouWkjem7mOiupOiuvue9ricuYm9sZCgpLFxcbiAgICAgICAgZGVzYzogJ+mHjeeUnycsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICB1cmw6ICQoWyfph43nva7mmJ/mmJ/popzoibInLCAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJywgJ+mHjee9ruW/q+mAn+aQnOe0oicsICfph43nva7pppbpobXkuLrpu5jorqQnLCAn6YeN572u6K+m5oOF6aG1JyAsICfmuIXpmaTlhajpg6jorr7nva4nXSwgMSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a6KaBXFxcIiArIGlucHV0ICsgXFxcIu+8n1xcXCIpLmNvbmZpcm0oKHNlbCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgaXRlbSA9ICcnO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHNlbCkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5pif5pif6aKc6ImyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3N0YXJDb2xvcic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pgInkuK3moIfnrb7popzoibInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnY2hvb3NlQ29sb3InO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5b+r6YCf5pCc57SiJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3F1aWNrU2VhcmNoQ29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pppbpobXkuLrpu5jorqQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnaG9tZVBhZ2VDb25maWdzJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruivpuaDhemhtSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdkZXRhaWxWaWV3Q29uZmlncyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfmuIXpmaTlhajpg6jorr7nva4nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnYWxsJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3NldHRpbmdQYWdlJykpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdENvbmZpZ3MgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZmlnc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXRlbSA9PSAnYWxsJykge1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGRlZmF1bHRDb25maWdzKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZihpdGVtID09IFxcXCJob21lUGFnZUNvbmZpZ3NcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXVtcXFwi6buY6K6kXFxcIl0gPSBkZWZhdWx0Q29uZmlnc1tpdGVtXVtcXFwi6buY6K6kXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0udXNlID0gXFxcIum7mOiupFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBzZWw7XFxuICAgICAgICAgICAgICAgIH1lbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKGZldGNoKGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXSA9IGRlZmF1bHRDb25maWdzW2l0ZW1dO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7JcXFwiICsgc2VsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBzZXRSZXN1bHQoZCk7XFxufVxcblxcbmxldCB2aWV3ID0gZ2V0UGFyYW0oXFxcInZpZXdcXF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VtcHR5XFxcIiArICckcGFnZXtmeXBhZ2V9LyMvJyArIHNbaV0gKyBcXFwiI25vSGlzdG9yeSNcXFwiXFxyXFxuICAgIH0pXFxyXFxufVxcclxcbnJldHVybiBkO2BcXHJcXG4gICAgICAgIH1cXHJcXG4gICAgfSxcXHJcXG4gICAgYW5hbHlzaXNDb25maWdzOiB7XFxyXFxuICAgICAgICB1c2U6IFxcXCLkuI3op6PmnpBcXFwiLFxcclxcbiAgICAgICAgXFxcIuS4jeino+aekFxcXCI6IHtcXHJcXG4gICAgICAgICAgICBjb25maWc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxyXFxuICAgICAgICAgICAgfSksXFxyXFxuICAgICAgICAgICAgc2V0dGluZzogJC50b1N0cmluZygoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or6Xmj5Lku7bml6Dorr7nva7pobXpnaJcXFwiO1xcclxcbiAgICAgICAgICAgIH0pXFxyXFxuICAgICAgICB9LFxcclxcbiAgICAgICAgXFxcIuaWreaPklxcXCI6IHtcXHJcXG4gICAgICAgICAgICBjb25maWc6ICQudG9TdHJpbmcoKCkgPT4ge1xcclxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UoaW5wdXQpO1xcclxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZpbGVFeGlzdChvbGRmaWxlKSkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0gSlNPTi5wYXJzZShmZXRjaChvbGRmaWxlKSkuY2o7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/msqHmib7liLDmlq3mj5LphY3nva7mlofku7YnO1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgfSksXFxyXFxuICAgICAgICAgICAgc2V0dGluZzogJC50b1N0cmluZygoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlID0gXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvRHVhbk5pYW4vTXlQYXJzZS5qc29uXFxcIjtcXHJcXG4gICAgICAgICAgICAgICAgbGV0IG9sZGZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiO1xcclxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KGZpbGUpKSB7XFxyXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCdqc29uPScgKyBmZXRjaChmaWxlKSk7XFxyXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBqc29uLnNldHRpbmdzLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmaWxlRXhpc3Qob2xkZmlsZSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcclxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL1JvdXRlP3J1bGU9TXlGaWVsZOG0sOKBvyZ0eXBlPeiuvue9rlxcXCI7XFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICB9KVxcclxcbiAgICAgICAgfVxcclxcbiAgICB9XFxyXFxufVxcclxcbiQuZXhwb3J0cyA9IGRlZmF1bHRDb25maWdzO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5bel5YW36ZuGXCIsXCJwYXRoXCI6XCJ1dGlsc1wiLFwicnVsZVwiOlwianM6XFxyXFxuLy/liJ3lp4vljJbphY3nva4sbmFtZeS4uumFjee9rumhueWQjeensFxcclxcbmZ1bmN0aW9uIGluaXRDb25maWdzKG5hbWUsIGNvbmZpZykge1xcclxcbiAgICBpZiAoIWNvbmZpZykge1xcclxcbiAgICAgICAgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxyXFxuICAgIH1cXHJcXG4gICAgaWYgKGNvbmZpZ1tuYW1lXSA9PSBudWxsKSB7XFxyXFxuICAgICAgICBsZXQgZGVmYXVsdENvbmZpZ3MgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kZWZhdWx0Q29uZmlnc1xcXCIpO1xcclxcbiAgICAgICAgY29uZmlnW25hbWVdID0gZGVmYXVsdENvbmZpZ3NbbmFtZV0gPyBkZWZhdWx0Q29uZmlnc1tuYW1lXSA6IHt9O1xcclxcbiAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcclxcbiAgICB9XFxyXFxuICAgIHJldHVybiBjb25maWc7XFxyXFxufVxcclxcblxcclxcbi8v6I635Y+W6YWN572u6aG5XFxyXFxuZnVuY3Rpb24gZ2V0Q29uZmlnKG5hbWUsIHJvb3RDb25maWcpIHtcXHJcXG4gICAgbGV0IGNvbmZpZyA9IHJvb3RDb25maWcgPyByb290Q29uZmlnIDogSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxyXFxuICAgIGlmIChuYW1lKSB7XFxyXFxuICAgICAgICBpZiAoY29uZmlnW25hbWVdID09IG51bGwpIHtcXHJcXG4gICAgICAgICAgICBjb25maWcgPSBpbml0Q29uZmlncyhuYW1lLCBjb25maWcpO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmV0dXJuIGNvbmZpZ1tuYW1lXTtcXHJcXG4gICAgfSBlbHNlIHtcXHJcXG4gICAgICAgIHJldHVybiBjb25maWc7XFxyXFxuICAgIH1cXHJcXG59XFxyXFxuXFxyXFxuLy/nvJbnoIHlt6XlhbfnsbtcXHJcXG5sZXQgWmlwVG9vbCA9IHtcXHJcXG4gICAgZGVwZW5kZW5jZTogJ2h0dHBzOi8vdW5wa2cuY29tL2x6LXN0cmluZ0AxLjQuNC9saWJzL2x6LXN0cmluZy5taW4uanMnLFxcclxcbiAgICBjb21wcmVzczoge1xcclxcbiAgICAgICAgc2l6ZToge1xcclxcbiAgICAgICAgICAgIGtleTogXFxcInRleHQtY29tcHJlc3Mtc2l6ZVxcXCIsXFxyXFxuICAgICAgICAgICAgc2V0OiAobmV3VmFsdWUpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIodGhpcy5rZXksIG5ld1ZhbHVlLnRvU3RyaW5nKCkpXFxyXFxuICAgICAgICAgICAgfSxcXHJcXG4gICAgICAgICAgICBnZXQ6ICgpID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlSW50KGdldE15VmFyKHRoaXMua2V5LCBcXFwiMFxcXCIpKVxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXHJcXG4gICAgICAgICAgICBldmFsKHJlcXVlc3QoWmlwVG9vbC5kZXBlbmRlbmNlKSlcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gTFpTdHJpbmcuY29tcHJlc3NUb0VuY29kZWRVUklDb21wb25lbnQoaW5wdXQpXFxyXFxuICAgICAgICAgICAgICAgIC8vIFppcFRvb2wuY29tcHJlc3Muc2l6ZS5zZXQocmVzdWx0Lmxlbmd0aCAqIDIpXFxyXFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFxcclxcbiAgICAgICAgfVxcclxcbiAgICB9LFxcclxcbiAgICBkZWNvbXByZXNzOiB7XFxyXFxuICAgICAgICBzaXplOiB7XFxyXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxyXFxuICAgICAgICAgICAgICAgIHJldHVybiBnZXRNeVZhcihcXFwidGV4dC1kZWNvbXByZXNzXFxcIiwgXFxcIjBcXFwiKVxcclxcbiAgICAgICAgICAgICAgICAgICAgLmxlbmd0aFxcclxcbiAgICAgICAgICAgIH1cXHJcXG4gICAgICAgIH0sXFxyXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXHJcXG4gICAgICAgICAgICBldmFsKHJlcXVlc3QoWmlwVG9vbC5kZXBlbmRlbmNlKSlcXHJcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gTFpTdHJpbmcuZGVjb21wcmVzc0Z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ZW1hcmsgKyBcXFwi77+lXFxcIiArIG5hbWUgKyBcXFwi77+lXFxcIiArIGVuY1R5cGUgKyBcXFwi77+lXFxcIjtcXHJcXG4gICAgICAgIGxldCByZXN1bHQgPSBjb25maWdcXHJcXG4gICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSBcXFwib2JqZWN0XFxcIikge1xcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04uc3RyaW5naWZ5KGNvbmZpZyk7XFxyXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZXN1bHQgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxyXFxuICAgICAgICAgICAgcmVzdWx0ID0gY29uZmlnO1xcclxcbiAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICB0aHJvdyBcXFwi5a+85Ye65pWw5o2u5LiN5ZCI5rOVXFxcIlxcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxyXFxuICAgICAgICAgICAgY2FzZSAnQmFzZTY0JzpcXHJcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gYmFzZTY0RW5jb2RlKHJlc3VsdCk7XFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIGNhc2UgJ1ppcHBlcic6XFxyXFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IFppcFRvb2wuY29tcHJlc3MuZXhlYyhyZXN1bHQpXFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgIGRlZmF1bHQgOlxcclxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0QXBwVmVyc2lvbigpID4gMjA3MCkge1xcclxcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gXFxcIumdkuixhuWPo+S7pO+/pVxcXCIgKyByZW1hcmsgKyBcXFwi77+lXFxcIiArIG5hbWVcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHNoYXJlUGFzdGUoQ29uZmlnVG9vbC5leHBvcnQobmFtZSwgY29uZmlnLCByZW1hcmssICdaaXBwZXInKSxlbmNUeXBlKTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnXFxcXG5cXFxcbicgKyBzeW1ib2xcXHJcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmm7TmlrDop4bnlYzniYjmnKzoh7MgQzIwNzAg5Lul5LiKJ1xcclxcbiAgICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgfVxcclxcbiAgICAgICAgcmVzdWx0ID0gc3ltYm9sICsgcmVzdWx0XFxyXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcclxcbiAgICB9LFxcclxcbiAgICBpbXBvcnQ6IChjb25maWdDb21tYW5kKSA9PiB7XFxyXFxuICAgICAgICBsZXQgcmVzdWx0ID0gJydcXHJcXG4gICAgICAgIGlmIChjb25maWdDb21tYW5kLnN0YXJ0c1dpdGgoJ+S6kScpKSB7XFxyXFxuICAgICAgICAgICAgaWYgKGdldEFwcFZlcnNpb24oKSA+IDIwNzApIHtcXHJcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gY29uZmlnQ29tbWFuZC5zcGxpdCgn6Z2S6LGGJylbMF0ucmVwbGFjZSgvXFxcXFxcXFxuLywgJycpXFxyXFxuICAgICAgICAgICAgICAgIGNvbmZpZ0NvbW1hbmQgPSBwYXJzZVBhc3RlKHJlc3VsdClcXHJcXG4gICAgICAgICAgICB9IGVsc2Uge1xcclxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgIGxldCByZXN1bHRTcGxpdHMgPSBjb25maWdDb21tYW5kLnNwbGl0KFxcXCLvv6VcXFwiKVxcclxcbiAgICAgICAgICAgIGxldCBlbmNUeXBlID0gcmVzdWx0U3BsaXRzWzNdXFxyXFxuICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0U3BsaXRzWzRdXFxyXFxuICAgICAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxyXFxuICAgICAgICAgICAgICAgIGNhc2UgJ0Jhc2U2NCc6XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBiYXNlNjREZWNvZGUocmVzdWx0KTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gWmlwVG9vbC5kZWNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXHJcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXHJcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgIHRocm93IFxcXCLlr7zlhaXmlbDmja7kuI3lkIjms5VcXFwiXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcclxcbiAgICB9XFxyXFxufVwifV0sXCJzYXZlZFwiOmZhbHNlLFwidGl0bGVcIjpcIumdkuixhlwiLFwidmVyc2lvblwiOjAsXCJ1cmxcIjpcImhpa2VyOi8vZW1wdHkkcGFnZXtmeXBhZ2V9LyMv5YiG57G7O2dldDtVVEYtODt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMCAoTGludXjvvJvvvJsgQW5kcm9pZCAxNO+8m++8myA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UEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFxcXFxcXFwiY29sbGVjdGlvblxcXFxcXFwiIHx8IHR5cGUgPT0gXFxcXFxcXCJjaGFydFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGUudGFyZ2V0X3R5cGUsIGUuaWQpLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgZS5jb3Zlcl91cmxcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIGlmIChkYXRhLnRhcmdldF90eXBlID09ICdjaGFydCcpIHtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IGUgPSBkYXRhLnRhcmdldDtcXFxcclxcXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8kcGFnZXtmeXBhZ2V9I25vSGlzdG9yeSMnKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IFxcXFxcXFwiY29sbGVjdGlvblxcXFxcXFwiIHx8IHR5cGUgPT0gXFxcXFxcXCJjaGFydFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJqZWN0Q29sbGVjdGlvbkxpc3QoTVlfUEFHRSwgNTAsIGlkKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGRhdGEudGFyZ2V0X3R5cGUsIGUuaWQpLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyX3VybCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLmNvdmVyX3VybFxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCB0eXBlID0gZGF0YS50YXJnZXRfdHlwZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlkID0gZGF0YS50YXJnZXQuaWQsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZSA9IGRhdGEudGFyZ2V0LnRpdGxlO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcXFxyXFxcXG4gICAgICAgICAgICBpZiAodXNlQ29uZmlnLnN0YXJ0c1dpdGgoJ3snKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmxQYXJhbXMudXJsID0gJChcXFxcXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFxcXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIC5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZGF0YS50YXJnZXQuY292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iAgICAgICAgICAgIHIyICs9IChpdGVtLmNhdGVnb3J5LnRpdGxlICsgKGl0ZW0uaXNfd29uID8gJycgOiAnKOaPkOWQjSknKSArICcmbmJzcDsnKS5mb250Y29sb3IoXFxcXFxcXCJncmV5XFxcXFxcXCIpO1xcXFxyXFxcXG4gICAgICAgICAgICByMiArPSBpdGVtLmNlbGVicml0aWVzLm1hcChjZWxlYnJpdHkgPT4gY2VsZWJyaXR5Lm5hbWUpLmpvaW4oJyZuYnNwOy8mbmJzcDsnKTtcXFxcclxcXFxuICAgICAgICAgICAgcjIgKz0gJzxici8+JztcXFxcclxcXFxuICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIHIyICs9ICc8YnIvPic7XFxcXHJcXFxcbiAgICB9KVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIGlmIChwYWdlID09IDEpIHtcXFxcclxcXFxuICAgICAgICBzZXRIb21lUmVzdWx0KHtcXFxcclxcXFxuICAgICAgICAgICAgZGF0YTogW3tcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByICsgcjIsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIlxcXFxyXFxcXG4gICAgICAgICAgICB9XVxcXFxyXFxcXG4gICAgICAgIH0pXFxcXHJcXFxcbiAgICB9IGVsc2UgaWYocy5hd2FyZHMubGVuZ3RoID09IDApe1xcXFxyXFxcXG4gICAgICAgIHNldFJlc3VsdChbXSk7XFxcXHJcXFxcbiAgICB9IGVsc2V7XFxcXHJcXFxcbiAgICAgICAgc2V0SG9tZVJlc3VsdCh7XFxcXHJcXFxcbiAgICAgICAgICAgIGRhdGE6IFt7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogcjIsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIlxcXFxyXFxcXG4gICAgICAgICAg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gICAgfSlcXFxcclxcXFxuXFxcXHJcXFxcbiAgICBsZXQgaSA9IFtdO1xcXFxyXFxcXG4gICAgcy5jZXJlbW9uaWVzLmZvckVhY2goZSA9PiB7XFxcXHJcXFxcbiAgICAgICAgaS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgIGRlc2M6IGUueWVhciArICflubQnLFxcXFxyXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcXFxyXFxcXG4gICAgICAgICAgICBpbWc6IGUucGljLm5vcm1hbCArICdAUmVmZXJlcj0nICsgZS5waWMubm9ybWFsLFxcXFxyXFxcXG4gICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IycpLnJ1bGUoKGlkLCBuYW1lKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBhd2FyZFZpZXcoaWQsIG5hbWUpO1xcXFxyXFxcXG4gICAgICAgICAgICB9LCBlLmlkLCBlLnRpdGxlKVxcXFxyXFxcXG4gICAgICAgIH0pXFxcXHJcXFxcbiAgICB9KVxcXFxyXFxcXG4gICAgaWYgKGkubGVuZ3RoID4gMCkge1xcXFxyXFxcXG4gICAgICAgIGkudW5zaGlmdCh7XFxcXHJcXFxcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfljoblsYrlm57pob4nLmJpZygpLmJvbGQoKSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxyXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXHJcXFxcbiAgICAgICAgICA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aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgZS5zdWJqZWN0LmNvdmVyLm5vcm1hbC51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiByYXRpbmcsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICAvKm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gICAgICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfmvJTlkZjnhafniYcnLmJpZygpLmJvbGQoKSArICgnKOWFsScgKyBlMy50b3RhbCArICflvKApJykuc21hbGwoKSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyMvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJykucnVsZSgocGlkKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBlbGVzc2FyUGhvdG9zKHBpZCk7XFxcXHJcXFxcbiAgICAgICAgICAgIH0sIHBpZCksXFxcXHJcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgIH0pXFxcXHJcXFxcblxcXFxyXFxcXG4gICAgICAgIGxldCBwbGVuZ3RoID0gZTMucGhvdG9zLmxlbmd0aCA8PSAyID8gZTMucGhvdG9zLmxlbmd0aCA6IDI7XFxcXHJcXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwbGVuZ3RoOyBpKyspIHtcXFxcclxcXFxuICAgICAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIC8vdGl0bGU6IGUzLnBob3Rvc1swXS5kZXNjcmlwdGlvbixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnM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1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHJhdGluZyA9IFxcXFxcXFwiXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZiAoZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmF0aW5nID0gY29tcHV0ZVJhdGluZyhlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcubWF4LCBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUpICsgXFxcXFxcXCIgXFxcXFxcXCIgKyBlLmV4dHJhLnJhdGluZ19ncm91cC5yYXRpbmcudmFsdWUgKyBcXFxcXFxcIuWIhlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnN1YnR5cGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBlLmlkLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXIubm9ybWFsLnVybCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLmNvdmVyLm5vcm1hbC51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nICsgJ1xcXFxcXFxcbicgKyBlLmV4dHJhLnNob3J0X2luZm8sXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcXFxyXFx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SXRlbXMpXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHZpZGVvSXRlbXMpXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQoe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHZpZGVvUmVsYXRlZEl0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdChpbnRyb0l0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgIGlkOiAncmVjb21tZW5kYXRpb25zJ1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jODcxZjc4PuS7peS4iuaVsOaNruadpea6kOS6juixhueTo++8jOWmguaCqOWWnOasou+8jOivt+S4i+i9veWumOaWuWFwcDwvZm9udD48L3NtYWxs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IGxldCBpID0gbC5tYXAoKGUgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBlLnR5cGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQgPSBlLmlkLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gZS50aXRsZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1c2VDb25maWcgPSBkZXRhaWxzVmlld0NvbmZpZ3NbZGV0YWlsc1ZpZXdDb25maWdzLnVzZV0uY29uZmlnO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHVybFBhcmFtcyA9IHt9O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCd1cmxQYXJhbXMgPSAnICsgdXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHVybFBhcmFtcy51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUucGljID8gZS5waWMubm9ybWFsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIGUucGljLm5vcm1hbCA6IGUuY292ZXIudXJsICsgJ0BSZWZlcmVyPScgKyBlLmNvdmVyLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBlLm51bGxfcmF0aW5nX3JlYXNvbiB8fCBlLnJhdGluZy52YWx1ZVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICB9KSk7XFxcXHJcXFxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsyXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVsxXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywgaVswXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncmVjb21tZW5kYXRpb25zJywge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdPGJpZz48c3Ryb25nPuebuOWFs+aOqOiNkDwvc3Ryb25nPjwvYmlnPlxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5LyNub0hpc3RvcnkjJykucnVsZSgodCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZWNvbW1lbmRhdGlvbnModFswXSwgdFsxXSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCBbb2JqLnR5cGUsIG9iai5pZF0pLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSgncmVjb21tZW5kYXRpb25zJyx7Y29sX3R5cGU6ICdsaW5lJyxleHRyYTp7aWQ6J25vb29wJ319KVxcXFxyXFxcXG4gICAgICAgIH0sXFxcXHJcXFxcbiAgICAgICAgcGFyYW06IHtcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImh0dHBzOi8vZnJvZG8uZG91YmFuLmNvbS9hcGkvdjIvXFxcXFxcXCIgKyB0eXBlICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpZCArIFxcXFxcXF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XFxyXFxcXG4gICAgICAgIOeUteinhuWJpzoge1xcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3nlLXop4bliac6ICd0dl9ob3QnLFxcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3lm73kuqfliac6ICd0dl9kb21lc3RpYycsXFxcXHJcXFxcbiAgICAgICAgICAgIOeDreaSreasp+e+juWJpzogJ3R2X2FtZXJpY2FuJyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt5pel5YmnOiAndHZfamFwYW5lc2UnLFxcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3pn6nliac6ICd0dl9rb3JlYW4nLFxcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3liqjnlLs6ICd0dl9hbmltYXRpb24nXFxcXHJcXFxcbiAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICDnu7zoibo6IHtcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt57u86Im6OiAnc2hvd19ob3QnLFxcXFxyXFxcXG4gICAgICAgICAgICDlm73lhoXnu7zoibo6ICdzaG93X2RvbWVzdGljJyxcXFxcclxcXFxuICAgICAgICAgICAg5Zu95aSW57u86Im6OiAnc2hvd19mb3JlaWduJ1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXFxcclxcXFxuICAgICAgICBmb3IgKGxldCBqIGluIGl0ZW1zW2ldKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5pdGVtID09IGl0ZW1zW2ldW2pdID8gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPicgKyBqICsgJyA8L2ZvbnQ+PC9iPicgOiBqLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2hvdExpc3QnKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdGVtcC5pdGVtID0gZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaG90TGlzdCcsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW1zW2ldW2pdKVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXHJcXFxcbiAgICAgICAgfSlcXFxcclxcXFxuICAgIH1cXFxcclxcXFxuXFxcXHJcXFxcbiAgICBsZXQgc29ydCA9IHtcXFxcclxcXFxuICAgICAgICDng63luqbmjpLluo86ICdyZWNvbW1lbmQnLFxcXFxyXFxcXG4gICAgICAgIOaXtumXtOaOkuW6jzogJ3RpbWUnLFxcXFxyXFxcXG4gICAgICAgIOivhOWIhuaOkuW6jzogJ3JhbmsnXFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbiAgICBmb3IgKGxldCByIGluIHNvcnQpIHtcXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5zb3J0ID09IHNvcnRbcl0gPyAn4oCc4oCc4oCd4o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YXIgKyAnIDwvZm9udD48L2I+JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVllYXIsICfnm7TmjqXovpPlhaXlhbfkvZPlubTku70s5L6L5aaCMjAwMCcpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPT0gNCl7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY3VzdG9tWWVhciA9IGlucHV0O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLnllYXIgPSBcXFxcXFxcIuiHquWumuS5ieW5tOS7vVxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImNsYXNzbGlzdFxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcclxcXFxuICAgICAgICAgICAgfWVsc2UgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcXFxcXCLoh6rlrprkuYnlnLDljLpcXFxcXFxcIil7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLmxvY2FsID09IFxcXFxcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieWcsOWMujonICsgdGVtcC5jdXN0b21Mb2NhbCArICcgPC9mb250PjwvYj4nO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKHRlbXAuY3VzdG9tTG9jYWwsICfnm7TmjqXovpPlhaXlhbfkvZPlnLDljLos5L6L5aaC5Lit5Zu95aSn6ZmGJykuaW5wdXQoKCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUxvY2FsID0gaW5wdXQ7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAubG9jYWwgPSBcXFxcXFxcIuiHquWumuS5ieWcsOWMulxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImNsYXNzbGlzdFxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcclxcXFxuICAgICAgICAgICAgfWVsc2UgaWYoaXRlbXNbaXRlbV1baV0gPT0gXFxcXFxcXCLoh6rlrprkuYnnsbvlnotcXFxcXFxcIil7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZih0ZW1wLnR5cGUgPT0gXFxcXFxcXCLoh6rlrprkuYnnsbvlnotcXFxcXFxcIil7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ57G75Z6LOicgKyB0ZW1wLmN1c3RvbVR5cGUgKyAnIDwvZm9udD48L2I+JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbVR5cGUsICfnm7TmjqXovpPlhaXlhbfkvZPnsbvlnoss5L6L5aaC5Ymn5oOFJykuaW5wdXQoKCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbVR5cGUgPSBpbnB1dDtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC50eXBlID0gXFxcXFxcXCLoh6rlrprkuYnnsbvlnotcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXFxcXFwi6Ieq5a6a5LmJ5qCH562+XFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5jbGFzcyA9PSBcXFxcXFxcIuiHquWumuS5ieagh+etvlxcXFxcXFwiKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnmoIfnrb46JyArIHRlbXAuY3VzdG9tQ2xhc3MgKyAnIDwvZm9udD48L2I+JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUNsYXNzLCAn55u05o6l6L6T5YWl5YW35L2T5qCH562+LOS+i+Wmgue7j+WFuFxcXFxcXFxcbuWPr+WGmeWkmuS4quagh+etvizkvb/nlKhcXFxcXFxcIuiLseaWh+mAl+WPt1xcXFxcXFwi5YiG6ZqUJykuaW5wdXQoKCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGlucHV0Lmxlbmd0aCA+IDApe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbUNsYXNzID0gaW5wdXQ7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAuY2xhc3MgPSBcXFxcXFxcIuiHquWumuS5ieagh+etvlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImNsYXNzbGlzdFxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+ato+ehrui+k+WFpSdcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogdXJsXFxcXHJcXFxcbiAgICAgICAg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FxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgfSwgcmFua1tyXSlcXFxcclxcXFxuICAgICAgICB9KVxcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcclxcXFxuICAgIH0pXFxcXHJcXFxcblxcXFxyXFxcXG4gICAgbGV0IGZpbHRlciA9IHtcXFxcclxcXFxuICAgICAgICDlhajpg6jlvbHniYc6ICcnLFxcXFxyXFxcXG4gICAgICAgIOS7heacieeJh+a6kDogJ3BsYXlhYmxlJ1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG4gICAgZm9yIChsZXQgciBpbiBmaWx0ZXIpIHtcXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5maWx0ZXIgPT09IGZpbHRlcltyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjogLy9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY2xhc3NsaXN0JykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGVtcC5maWx0ZXIgPSBlO1xcXFxyXFxcXG4gICAgICAgICA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NXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZCkucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBcXFxcXFxcInBsYXlsaXN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXR1cm4ge1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycsXFxcXHJcXFxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXFxcclxcXFxuICAgICAgICAgICAgaW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ICd0didcXFxcclxcXFxuICAgIH1cXFxcclxcXFxuICAgIGZvciAobGV0IGkgaW4gaXRlbXMpIHtcXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC50eXBlID09PSBpdGVtc1tpXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaSArICcgPC9mb250PjwvYj4nIDogaSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjb21pbmcnKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0ZW1wLnR5cGUgPSBlO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjb21pbmdcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgfSwgaXRlbXNbaV0pXFxcXHJcXFxcbiAgICAgICAgfSlcXFxcclxcXFxuICAgIH1cXFxcclxcXFxuICAgIGxldCByYW5rID0ge1xcXFxyXFxcXG4gICAgICAgIOeDreW6pjogJyZzb3J0Ynk9aG90JyxcXFxcclxcXFxuICAgICAgICDml7bpl7Q6ICcnXFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbiAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2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ZpZScpIHtcXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXHJcXFxcbiAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICBmb3IgKGxldCBpIGluIGxvY2FsKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5sb2NhbCA9PT0gbG9jYWxbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAubG9jYWwgPSBlO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiY29taW5nXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0sIGxvY2FsW2ldKVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxuICAgIGxldCBhcmVhID0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4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiXFxcXHJcXFxcbiAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICBmb3IgKGxldCBpIGluIGZpbHRlcikge1xcXFxyXFxcXG4gICAgICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuZmlsdGVyID09PSBmaWx0ZXJbaV0gPyAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+JyArIGkgKyAnIDwvZm9udD48L2I+JyA6IGksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vTG9hZGluZyMnKS5sYXp5UnVsZSgoZSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignY29taW5nJykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuZmlsdGVyID0gZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImNvbWluZ1xcXFxcXFwiLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCBmaWx0ZXJbaV0pXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfVxcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIGxldCBzID0gZ2V0RG91YmFuUmVzKFxcXFxcXFwiaH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lrZXI6Ly9lbXB0eT9pZD0nICsgaWQgKyAnJnR5cGU9JyArIHR5cGUgKyAnJnRpdGxlPScgKyBlLnRpdGxlKS5ydWxlKChyZXMsIGlkLCBlLCBsYXp5LCBleHRyYSkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHJlcy50aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljID0gcmVzLnBpYy5ub3JtYWwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgcmVzLnBpYy5ub3JtYWw7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKGUudGl0bGUgKyAnLScgKyB0aXRsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVBpY1VybChwaWMpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmxzID0gZ2V0VHZVcmxzKGlkLCBlLmlkKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsYXp5ID0gJChcXFxcXFxcIlxcXFxcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdFVybCA9IFxcXFxcXFwidG9hc3Q6Ly/op6PmnpDlpLHotKVcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYXp5LnN0YXJ0c1dpdGgoXFxcXFxcXCIoXFxcXFxcXCIpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgncmVzdWx0VXJsID0gJyArIGxhenkpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyAnKCgpID0+IHsnICsgbGF6eSArICd9KSgpJylcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGF6eSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YodXJscykgPT0gXFxcXFxcXCJvYmplY3RcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHVybHMubGVuZ3RoOyBpKyspIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfnrKwnICsgKGkgKyAxKSArICfpm4YnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF80JyxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGxhenkgPyB1cmxzW2ldICsgbGF6eSA6IHVybHNbaV0sXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSBcXFxcXFxcInN0cmluZ1xcXFxcXFwiICYmIHVybHMgPT0gJ+iiq+WwgWlwJykge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZSA9IEpTT04ucGFyc2UocmVxdWVzdChcXFxcXFxcImhpa2VyOi8vcGFnZS9yZWxlYXNlSVA/cnVsZT3pnZLosYZcXFxcXFxcIikpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAucnVsZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZih1cmxzKSA9PSAnc3RyaW5nJyAmJiB1cmxzID09ICfmsqHmnInmlLblvZUnKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ayoeacieaUtuW9leatpOinhumikea6kOeahOivpue7huS/oeaBrycsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn54K55oiR5Y+v5Lul5Y676KeG6aKR5rqQ572R56uZ55yL55yLJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGUudXJsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCByZXMsIGlkLCBlLCBsYXp5LCBleHRyYSlcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdtb3ZpZScpIHtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IG1MYXp5ID0gJChcXFxcXFxcIlxcXFxcXFwiKS5sYXp5UnVsZShsYXp5ID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHRVcmwgPSBcXFxcXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXp5LnN0YXJ0c1dpdGgoXFxcXFxcXCIoXFxcXFxcXCIpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyAnKCgpID0+IHsnICsgbGF6eSArICd9KSgpJylcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSlcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHRVcmxcXFxcclxcXFxuICAgICAgICAgICAgfSwgbGF6eSlcXFxcclxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBlLnRpdGxlICsgKGUuZXBpc29kZXNfaW5mbyA/IFxcXFxcXFwi4oCiXFxcXFxcXCIgKyBlLmVwaXNvZGVzX2luZm8gOiBcXFxcXFxcIlxcXFxcXFwiKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZS5pY29uLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFsxXSB8fCBcXFxcXFxcImljb25fc21hbGxfNFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBtTGF6eSA/IGUudXJsICsgbUxhenkgOiBlLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxufVxcXFxyXFxcXG5cXFxcclxcXFxuLy/ojrflj5bnlLXop4bliafliIbpm4bpk77mjqUsaWTmmK/niYflrZDnvJblj7csdWlk5piv6KeG6aKR5rqQ57yW5Y+3XFxcXHJcXFxcbmZ1bmN0aW9uIGdldFR2VXJscyhpZCwgdWlkKSB7XFxcXHJcXFxcbiAgICBsZXQgY29va2llQ2FjaGUgPSAnaGlrZXI6Ly9maWxlcy9jYWNoZS9kb3ViYW5jb29raWUudHh0JztcXFxcclxcXFxuICAgIGxldCBtVXJsID0gJ2h0dHBzOi8vbW92aWUuZG91YmFuLmN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xuICAgICAgICAgICAgY250djogMTIsXFxcXHJcXFxcbiAgICAgICAgICAgIGNjdHY2OiAxMyxcXFxcclxcXFxuICAgICAgICAgICAgbWlndXZpZGVvOiAxNSxcXFxcclxcXFxuICAgICAgICAgICAgeGlndWE6IDE3LFxcXFxyXFxcXG4gICAgICAgICAgICBhY2Z1bjogMTgsXFxcXHJcXFxcbiAgICAgICAgICAgIG1haWR1aWR1aTogMTlcXFxcclxcXFxuICAgICAgICB9O1xcXFxyXFxcXG4gICAgICAgIGxldCBudW0gPSBzW3VpZF07XFxcXHJcXFxcblxcXFxyXFxcXG4gICAgICAgIHZhciBzb3VyY2VzID0ge307XFxcXHJcXFxcbiAgICAgICAgbGV0IHNsID0gaHRtbC5tYXRjaCgvc291cmNlc1xcXFxcXFxcW1sxLTldezEsMn1cXFxcXFxcXF1bXFxcXFxcXFxzXFxcXFxcXFxTXSo/XFxcXFxcXFxdL2cpO1xcXFxyXFxcXG4gICAgICAgIGlmIChzbCkge1xcXFxyXFxcXG4gICAgICAgICAgICBmb3IgKHZhciBpIGluIHNsKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKHNsW2ldKTtcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBzY3JpcHRfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJnNjcmlwdFtzcmNdJyk7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBzb3VyY2VzX3VybCA9IFxcXFxcXFwiXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gc2NyaXB0X2xpc3QpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBwYXJzZURvbUZvckh0bWwoc2NyaXB0X2xpc3RbaV0sICdzY3JpcHQmJnNyYycpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmRleE9mKCdtaXhlZF9zdGF0aWMnKSAhPT0gLTEpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBzb3VyY2VzX3VybCA9IHVybDtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICBsZXQgc291cmNlc19saXN0ID0gcmVxdWVzdChzb3VyY2VzX3VybCkubWF0Y2goL3NvdXJjZXNcXFxcXFxcXFtbMS05XXsxLDJ9XFxcXFxcXFxdW1xcXFxcXFxcc1xcXFxcXFxcU10qP1xcXFxcXFxcXS9nKTtcXFxcclxcXFxuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzb3VyY2VzX2xpc3QpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV2YWwoc291cmNlc19saXN0W2ldKTtcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuXFxcXHJcXFxcbiAgICAgICAgbGV0IHJlbiA9IHNvdXJjZXNbbnVtXTtcXFxcclxcXFxuICAgICAgICBpZiAocmVuICYmIHJlbi5sZW5ndGggPiAwKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIC8qdmFyIHIgPSByZW4ubWFwKGUgPT4gdW5lc2NhcGUoZS5wbGF5X2xpbmsucmVwbGFjZSgvKGh0dHBzfGh0dHApOlxcXFxcXFxcL1xcXFxcXFxcL3d3dy5kb3ViYW4uY29tXFxcXFxcXFwvbGluazJcXFxcXFxcXC9cXFxcXFxcXD91cmw9LywgJycpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAuc3BsaXQoJzsnKVswXS5zcGxpdCgnLmh0bWwnKVswXSArICcuaHRtbCcpKSovXFxcXHJcXFxcbiAgICAgICAgICAgIHZhciByID0gcmVuLm1hcChlID0+IHVuZXNjYXBlKGUucGxheV9saW5rLnNwbGl0KCc/dXJsPScpWzFdLnNwbGl0KCc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CLigJ3igJ1cXFxcXFxcIiA6IGNvbmZpZ0tleSxcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShjb25maWdLZXkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3MudXNlID09PSBjb25maWdLZXkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFxcXFxcImlucHV0X2NvbmZpZ190eXBlXFxcXFxcXCIsICflvbHniYfor6bmg4XpobXpnaLphY3nva4nKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X25hbWVcXFxcXFxcIiwgY29uZmlnS2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJpbnB1dF9jb2RlXFxcXFxcXCIsIGNvbmZpZy5kZXRhaWxzVmlld0NvbmZpZ3NbY29uZmlnS2V5XS5jb25maWcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X3NldHRpbmdfY29kZVxcXFxcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uc2V0dGluZyB8fCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1kZXRhaWxWaWV3TW9kZUVkaXRQYWdlJztcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgY29uZmlnLmRldGFpbHNWaWV3Q29uZ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5peg5rOV5Yig6Zmk77yBJ1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpemFjee9ruato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcXFxcXCInICsgaW5wdXQgKyAnXFxcXFxcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmRldGFpbHNWaWV3Q29uZmlnc1tjb25maWdLZXldXFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXFxcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICB9KVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoZGV0YWlsc1ZpZXdDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKS5zZWxlY3QoKCkgPT4ge1xcXF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ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmhvbWVQYWdlQ29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3B1dE15VmFyKFxcXFxcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFxcXFxcIiwgJ+mmlumhtemFjee9ricpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaW5wdXRfbmFtZVxcXFxcXFwiLCBjb25maWdLZXkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X2NvZGVcXFxcXFxcIiwgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9aG9tZVBhZ2VNb2RlRWRpdFBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjb25maWcuaG9tZVBhZ2VDb25maWdzLnVzZSA9IGNvbmZpZ0tleVxcXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5oiQ5YqfJ1xcXFxuICAgICAgICAgICAgfSwgY29uZmlnS2V5KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90e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kZWxldGUgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldXFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXFxcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICB9KVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoaG9tZVBhZ2VDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScpLCAyKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgLy8gaWYgKGlucHV0ID09PSAn6buY6K6kJykgcmV0dXJuICd0b2FzdDovL+m7mOiupOmFjee9ruaXoOazlee8lui+ke+8gSdcXFxcbiAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZ0tleSA9IGlucHV0O1xcXFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJpbnB1dF9uYW1lXFxcXFxcXCIsIGNvbmZpZ0tleSk7XFxcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X2NvZGVcXFxcXFxcIiwgY29uZmlnLmhvbWVQYWdlQ29uZmlnc1tjb25maWdLZXldLmNvb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c2lzQ29uZmlncy51c2UgPT09IGNvbmZpZ0tleSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3B1dE15VmFyKFxcXFxcXFwiaW5wdXRfY29uZmlnX3R5cGVcXFxcXFxcIiwgJ+ino+aekOaPkuS7tumFjee9ricpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaW5wdXRfbmFtZVxcXFxcXFwiLCBjb25maWdLZXkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X2NvZGVcXFxcXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLmNvbmZpZyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaW5wdXRfZXh0cmFcXFxcXFxcIiwgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldLmV4dHJhIHx8IFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImlucHV0X3NldHRpbmdfY29kZVxcXFxcXFwiLCBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV0uc2V0dGluZyB8fCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1hbmFseXNpc01vZGVFZGl0UGFnZSc7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlID0gY29uZmlnS2V5XFxcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2U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pZycpKSlcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IGNvbmZpZy5hbmFseXNpc0NvbmZpZ3MudXNlKSByZXR1cm4gJ3RvYXN0Oi8v6K+l6Kej5p6Q5q2j5Zyo5L2/55So77yM5peg5rOV5Yig6Zmk77yBJ1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFxcXFxcIicgKyBpbnB1dCArICdcXFxcXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcuYW5hbHlzaXNDb25maWdzW2NvbmZpZ0tleV1cXFxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcXFxuICAgICAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhhbmFseXNpc0NvbmZpZ3MpLmZpbHRlcihjb25maWdLZXkgPT4gY29uZmlnS2V5ICE9PSAndXNlJyksIDIpXFxcXG4gICAgICAgICAgICAuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAvLyBpZiAoaW5wdXQgPT09ICfkuI3op6PmnpAnICYmIGlucHV0ID09PSAn5pat5o+SJykgcmV0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gICAgICAgIGlmKGlucHV0Lmxlbmd0aCAhPSAzIHx8IGlucHV0WzBdID09PSBcXFxcXFxcIlxcXFxcXFwiKSByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+agvOW8j+S4jeWvue+8jOaMieagvOW8j+i+k+WFpSFcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIGlmIChjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoaW5wdXRbMF0pID09IC0xKSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnB1c2goaW5wdXRbMF0pO1xcXFxuICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dFswXV0gPSB7XFxcXG4gICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxcXG4gICAgICAgICAgICAgICAgcGljOiBpbnB1dFsyXVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mt7vliqDmiJDlip8nO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn4p6WJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIsIDIpLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcXFxuICAgICAgICAgICAgcmV0dXJuICQoJ+ehruiupOWIoOmZpFxcXFxcXFwiJyArIGlucHV0ICsgJ1xcXFxcXFwi77yfJykuY29uZmlybSgoY29uZmlnLCBjb25maWdLZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoY29uZmlnS2V5KTtcXFxcbiAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnNwbGljZShpbmRleCwgMSk7XFxcXG4gICAgICAgICAgICAgICAgZGVsZXRlIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbY29uZmlnS2V5XVxcXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Yig6ZmkJyArIGNvbmZpZ0tleSArICfmiJDlip8nXFxcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfwn5OdJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgIHVybDogJChxdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIsIDIpLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXFxcbiAgICAgICAgICAgIGxldCBxdWlja1NlYXJjaENvbmZpZ3MgPSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzO1xcXFxuICAgICAgICAgICAgbGV0IGR0ZXh0ID0gaW5wdXQgKyAnQEAnICsgcXVpY2tTZWFyY2hDb25maWdzW2lucHV0XS5uYW1lICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ucGljO1xcXFxuICAgICAgICAgICAgcmV0dXJuICQoZHRleHQsICfor7fkv67mlLknKS5pbnB1dCgoY29uZmlnLCByYXcpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnNwbGl0KCdAQCcpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChyYXcgIT0gaW5wdXRbMF0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKHJhdyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXJbaW5kZXhdID0gaW5wdXRbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW3Jhd107XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLmluZGV4T2YoaW5wdXRbMF0pID09IC0xKSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLnB1c2goaW5wdXRbMF0pO1xcXFxuICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRbMF1dID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFsxXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcGljOiBpbnB1dFsyXVxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJztcXFxcbiAgICAgICAgICAgIH0sIGNvbmZpZywgaW5wdXQpXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSlcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ/CflIEnLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnKS5ydWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanNvbicpO1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxcXG4gICAgICAgICAgICB9KSlcXFxcbiAgICAgICAgICAgIGlmIChnZXRNeVZhcignanNvbicpID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KHF1aWNrU2VhcmNoQ29uZmlncykpO1xcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBsZXQgb2xkID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXFxcbiAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5Yir54K55Ye75Lik6aG55Lul5Lqk5o2i6aG65bqPXFxcXFxcXFxu4oCY4oCY5o6S5bqP5a6M5q+V5ZCO54K55oiR5L+d5a2Y5o6S5bqPLOWQpuWImeaOkuW6j+S4jeeUn+aViOKAmeKAmScsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3MgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICBvbGQub3JkZXIuZm9yRWFjaCgodmFsdWUsIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdvcCcpID09IHZhbHVlID8gdmFsdWUgKyAn4oCY4oCYKOW9k+WJjemAieS4rSnigJnigJknIDogdmFsdWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGtleSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvcCA9IGdldE15VmFyKCdvcCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wID09ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ29wJywga2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3AgPT0ga2V5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld2EgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6IG9sZC5tb2RlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlcjogb2xkLm9yZGVyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3BpbmRleCA9IG5ld2Eub3JkZXIuaW5kZXhPZihvcCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1hdGguYWJzKG9waW5kZXggLSBpbmRleCkgPT0gMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW29waW5kZXhdID0ga2V5O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyW2luZGV4XSA9IG9wO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAob3BpbmRleCA+IGluZGV4KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKG9waW5kZXgsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCwgMCwgb3ApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuc3BsaWNlKG9waW5kZXgsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShpbmRleCAtIDEsIDAsIG9wKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5mb3JFYWNoKHZhbHVlID0+IG5ld2FbdmFsdWVdID0gb2xkW3ZhbHVlXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanNvbicsIEpTT04uc3RyaW5naWZ5KG5ld2EpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgICAgICAg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mdNb2R1bGUoZCk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+aBouWkjem7mOiupOiuvue9ricuYm9sZCgpLFxcXFxuICAgICAgICBkZXNjOiAn6YeN55SfJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICB1cmw6ICQoWyfph43nva7mmJ/mmJ/popzoibInLCAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJywgJ+mHjee9ruW/q+mAn+aQnOe0oicsICfph43nva7pppbpobXkuLrpu5jorqQnLCAn6YeN572u6K+m5oOF6aG1JyAsICfmuIXpmaTlhajpg6jorr7nva4nXSwgMSkuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwi56Gu5a6a6KaBXFxcXFxcXCIgKyBpbnB1dCArIFxcXFxcXFwi77yfXFxcXFxcXCIpLmNvbmZpcm0oKHNlbCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdGVtID0gJyc7XFxcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChzZWwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5pif5pif6aKc6ImyJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnc3RhckNvbG9yJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pgInkuK3moIfnrb7popzoibInOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdjaG9vc2VDb2xvcic7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u5b+r6YCf5pCc57SiJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAncXVpY2tTZWFyY2hDb25maWdzJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7pppbpobXkuLrpu5jorqQnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdob21lUGFnZUNvbmZpZ3MnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruivpuaDhemhtSc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ2RldGFpbFZpZXdDb25maWdzJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfmuIXpmaTlhajpg6jorr7nva4nOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdhbGwnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8vIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2Uvc2V0dGluZ1BhZ2UnKSkucnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRDb25maWdzID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RlZmF1bHRDb25maWdzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpdGVtID09ICdhbGwnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShkZWZhdWx0Q29uZmlncykpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3slxcXFxcXFwiICsgc2VsO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZihpdGVtID09IFxcXFxcXFwiaG9tZVBhZ2VDb25maWdzXFxcXFxcXCIpe1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tpdGVtXVtcXFxcXFxcIum7mOiupFxcXFxcXFwiXSA9IGRlZmF1bHRDb25maWdzW2l0ZW1dW1xcXFxcXFwi6buY6K6kXFxcXFxcXCJdO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0udXNlID0gXFxcXFxcXCLpu5jorqRcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3slxcXFxcXFwiICsgc2VsO1xcXFxuICAgICAgICAgICAgICAgIH1lbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWdbaXRlbV0gPSBkZWZhdWx0Q29uZmlnc1tpdGVtXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ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XFxyXFxcXG4gICAgfSxcXFxcclxcXFxuICAgIGFuYWx5c2lzQ29uZmlnczoge1xcXFxyXFxcXG4gICAgICAgIHVzZTogXFxcXFxcXCLkuI3op6PmnpBcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICBcXFxcXFxcIuS4jeino+aekFxcXFxcXFwiOiB7XFxcXHJcXFxcbiAgICAgICAgICAgIGNvbmZpZzogJC50b1N0cmluZygoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxcXHJcXFxcbiAgICAgICAgICAgIH0pLFxcXFxyXFxcXG4gICAgICAgICAgICBzZXR0aW5nOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6K+l5o+S5Lu25peg6K6+572u6aG16Z2iXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICBcXFxcXFxcIuaWreaPklxcXFxcXFwiOiB7XFxcXHJcXFxcbiAgICAgICAgICAgIGNvbmZpZzogJC50b1N0cmluZygoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgZmlsZSA9IFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9EdWFuTmlhbi9NeVBhcnNlLmpzb25cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCBvbGRmaWxlID0gXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChmaWxlKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoJ2pzb249JyArIGZldGNoKGZpbGUpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQganNVcmwgPSBqc29uLnNldHRpbmdzLmNqO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmlsZUV4aXN0KG9sZGZpbGUpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0gSlNPTi5wYXJzZShmZXRjaChvbGRmaWxlKSkuY2o7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UoaW5wdXQpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rKh5om+5Yiw5pat5o+S6YWN572u5paH5Lu2JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSksXFxcXHJcXFxcbiAgICAgICAgICAgIHNldHRpbmc6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGUgPSBcXFxcXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvRHVhbk5pYW4vTXlQYXJzZS5qc29uXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgb2xkZmlsZSA9IFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoZmlsZSkpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCdqc29uPScgKyBmZXRjaChmaWxlKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNldFVybDtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmlsZUV4aXN0KG9sZGZpbGUpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0gSlNPTi5wYXJzZShmZXRjaChvbGRmaWxlKSkuY2o7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9Sb3V0ZT9ydWxlPU15RmllbGThtLDigb8mdHlwZT3orr7nva5cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbn1cXFxcclxcXFxuJC5leHBvcnRzID0gZGVmYXVsdENvbmZpZ3M7XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzNcXFwiLFxcXCJuYW1lXFxcIjpcXFwi5bel5YW36ZuGXFxcIixcXFwicGF0aFxcXCI6XFxcInV0aWxzXFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxyXFxcXG4vL+WIneWni+WMlumFjee9rixuYW1l5Li66YWN572u6aG55ZCN56ewXFxcXHJcXFxcbmZ1bmN0aW9uIGluaXRDb25maWdzKG5hbWUsIG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LnNldChyZXN1bHQubGVuZ3RoICogMilcXFxcclxcXFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH0sXFxcXHJcXFxcbiAgICBkZWNvbXByZXNzOiB7XFxcXHJcXFxcbiAgICAgICAgc2l6ZToge1xcXFxyXFxcXG4gICAgICAgICAgICBnZXQ6ICgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBnZXRNeVZhcihcXFxcXFxcInRleHQtZGVjb21wcmVzc1xcXFxcXFwiLCBcXFxcXFxcIjBcXFxcXFxcIilcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAubGVuZ3RoXFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICB9LFxcXFxyXFxcXG4gICAgICAgIGV4ZWM6IChpbnB1dCkgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICBldmFsKHJlcXVlc3QoWmlwVG9vbC5kZXBlbmRlbmNlKSlcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IExaU3RyaW5nLmRlY29tcHJlc3NGcm9tRW5jb2RlZFVSSUNvbXBvbmVudChpbnB1dClcXFxcclxcXFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxufVxcXFxyXFxcXG5cXFxcclxcXFxuLy8g6YWN572u6aG55bel5YW357G7XFxcXHJcXFxcbmxldCBDb25maWdUb29sID0ge1xcXFxyXFxcXG4gICAgZW5jVHlwZUxpc3Q6IFsnQmFzZTY0JywgJ1ppcHBlciddLmNvbmNhdChnZXRQYXN0ZXMoKSksXFxcXHJcXFxcbiAgICB0b0NsaXBib2FyZDogKGNvbmZpZ0NvbW1hbmQsIG5hbWUpID0+IHtcXFxcclxcXFxuICAgICAgICBpZiAoY29uZmlnQ29tbWFuZC5zdGFydHNXaXRoKCd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gIH1cXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgdHJ5IHtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHJlc3VsdFNwbGl0cyA9IGNvbmZpZ0NvbW1hbmQuc3BsaXQoXFxcXFxcXCLvv6VcXFxcXFxcIilcXFxcclxcXFxuICAgICAgICAgICAgbGV0IGVuY1R5cGUgPSByZXN1bHRTcGxpdHNbM11cXFxcclxcXFxuICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0U3BsaXRzWzRdXFxcXHJcXFxcbiAgICAgICAgICAgIHN3aXRjaCAoZW5jVHlwZSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgY2FzZSAnQmFzZTY0JzpcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBiYXNlNjREZWNvZGUocmVzdWx0KTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ1ppcHBlcic6XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gWmlwVG9vbC5kZWNvbXByZXNzLmV4ZWMocmVzdWx0KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxyXFxcXG4gICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXFxcclxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxcXHJcXFxcbiAgICAgICAgICAgIHRocm93IFxcXFxcXFwi5a+85YWl5pWw5o2u5LiN5ZCI5rOVXFxcXFxcXCJcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcXFxcclxcXFxuICAgIH1cXFxcclxcXFxufVxcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfNDE4NDY3NTYvaGlrZXIvLS9yYXcvbWFzdGVyL2ltZy/liIbnsbsuanBnIiwidGl0bGUiOiLliIbnsbsifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement