Advertisement
xiaomianao666

邀您一起看:热门

Jul 7th, 2024
244
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+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXHJcXG4gICAgICAgICAgICB9XFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICB0cnkge1xcclxcbiAgICAgICAgICAgIGxldCByZXN1bHRTcGxpdHMgPSBjb25maWdDb21tYW5kLnNwbGl0KFxcXCLvv6VcXFwiKVxcclxcbiAgICAgICAgICAgIGxldCBlbmNUeXBlID0gcmVzdWx0U3BsaXRzWzNdXFxyXFxuICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0U3BsaXRzWzRdXFxyXFxuICAgICAgICAgICAgc3dpdGNoIChlbmNUeXBlKSB7XFxyXFxuICAgICAgICAgICAgICAgIGNhc2UgJ0Jhc2U2NCc6XFxyXFxuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBiYXNlNjREZWNvZGUocmVzdWx0KTtcXHJcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcclxcbiAgICAgICAgICAgICAgICBjYXNlICdaaXBwZXInOlxcclxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gWmlwVG9vbC5kZWNvbXByZXNzLmV4ZWMocmVzdWx0KVxcclxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxyXFxuICAgICAgICAgICAgfVxcclxcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcXHJcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXHJcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcclxcbiAgICAgICAgICAgIHRocm93IFxcXCLlr7zlhaXmlbDmja7kuI3lkIjms5VcXFwiXFxyXFxuICAgICAgICB9XFxyXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcclxcbiAgICB9XFxyXFxufVwifV0sXCJzYXZlZFwiOmZhbHNlLFwidGl0bGVcIjpcIumdkuixhlwiLFwidmVyc2lvblwiOjAsXCJ1cmxcIjpcImhpa2VyOi8vZW1wdHkkcGFnZXtmeXBhZ2V9LyMv54Ot6ZeoO2dldDtVVEYtODt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMCAoTGludXjvvJvvvJsgQW5kcm9pZCAxNO+8m++8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4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLkv53lrZhcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IGRhdGEuZGVzYyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoZGF0YS5rZXksIFxcXFxcXFwiXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIHR5cGU6IGRhdGEudHlwZSA/IGRhdGEudHlwZSA6ICcnLFxcXFxuICAgICAgICAgICAgICAgIGhlaWdodDogNSxcXFxcbiAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRNeVZhcihcXFxcXFxcIicgKyBkYXRhLmtleSArICdcXFxcXFxcIiwgaW5wdXQpJ1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ+S/neWtmCcsXFxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGNvbmZpZ0tleSwgcGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcXFxuICAgICAgICAgICAgbGV0IG5hbWUgPSBnZXRNeVZhcihwYXJhbXMua2V5LCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGlmKG5hbWUgPT0gJ+m7mOiupCcpIHJldHVybi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IDUwKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBcXFxcXFxcImNvbGxlY3Rpb25cXFxcXFxcIiB8fCB0eXBlID09IFxcXFxcXFwiY2hhcnRcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YmplY3RDb2xsZWN0aW9uTGlzdChNWV9QQUdFLCA1MCwgaWQpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBlLnRhcmdldF90eXBlLCBlLmlkKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGUuY292ZXJfdXJsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIGUuY292ZXJfdXJsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH0gZWxzZSBpZiAoZGF0YS50YXJnZXRfdHlwZSA9PSAnY2hhcnQnKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBlID0gZGF0YS50YXJnZXQ7XFxcXHJcXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkvJHBhZ2V7ZnlwYWdlfSNub0hpc3RvcnkjJylcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBcXFxcXFxcImNvbGxlY3Rpb25cXFxcXFxcIiB8fCB0eXBlID09IFxcXFxcXFwiY2hhcnRcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViamVjdENvbGxlY3Rpb25MaXN0KE1ZX1BBR0UsIDUwLCBpZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBkYXRhLnRhcmdldF90eXBlLCBlLmlkKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGltZzogZS5jb3Zlcl91cmwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgZS5jb3Zlcl91cmxcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGRhdGEudGFyZ2V0X3R5cGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZCA9IGRhdGEudGFyZ2V0LmlkLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBkYXRhLnRhcmdldC50aXRsZTtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHVzZUNvbmZpZyA9IGRldGFpbHNWaWV3Q29uZmlnc1tkZXRhaWxzVmlld0NvbmZpZ3MudXNlXS5jb25maWc7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXFxcclxcXFxuICAgICAgICAgICAgaWYgKHVzZUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV2YWwoJ3VybFBhcmFtcyA9ICcgKyB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsUGFyYW1zLnVybCA9ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjaW1tZXJzaXZlVGhlbWUjXFxcXFxcXCIgKyAnP3R5cGU9JyArIHR5cGUgKyAnJmlkPScgKyBpZClcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAucnVsZSgodHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9tYWluJykpLnJ1bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3VMaXN0KGlkLCBNWV9QQUdFLCA1MCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGRhdGEudGFyZ2V0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VxcXFxcXFwiPicgKyByYXRpbmdDb3VudCArICfkurror4TliIYnICsgJzwvZm9udD48L3NtYWxsPjxici8+JztcXFxcclxcXFxuXFxcXHJcXFxcbiAgICBsZXQgc3RhckNvbG9yID0gZ2V0Q29uZmlnKCdzdGFyQ29sb3InKTtcXFxcclxcXFxuICAgIGlmIChpLnN0YXRzLmxlbmd0aCA9PSAwKSB7XFxcXHJcXFxcbiAgICAgICAgaS5zdGF0cyA9IFswLCAwLCAwLCAwLCAwXTtcXFxcclxcXFxuICAgIH1cXFxcclxcXFxuICAgIGkuc3RhdHMucmV2ZXJzZSgpLmZvckVhY2goKCh2YWx1ZSwgaW5kZXgpID0+IHtcXFxcclxcXFxuICAgICAgICByICs9ICc8Zm9udCBjb2xvcj0nICsgc3RhckNvbG9yICsgJz4nICsgW1xcXFxcXFwi4piF4piF4piF4piF4piFXFxcXFxcXCIsIFxcXFxcXFwi4piF4piF4piF4piF4piGXFxcXFxcXCIsIFxcXFxcXFwi4piF4piF4piF4piG4piGXFxcXFxcXCIsIFxcXFxcXFwi4piF4piF4piG4piG4piGXFxcXFxcXCIsIFxcXFxcXFwi4piF4piG4piG4piG4piGXFxcXFxcXCJdW2luZGV4XSArIFxcXFxcXFwiPC9mb250PiZuYnNwO1xcXFxcXFwiO1xcXFxyXFxcXG5cXFxcclxcXFxuICAgICAgICByICs9IGZ1bmN0aW9uKGUpIHtcXFxcclxcXFxuICAgICAgICAgICAgbGV0IHQxID0gJyc7XFxcXHJcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZTsgaSsrKSB0MSArPSBcXFxcXFxcIuKWh1xcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgdDIgPSAnJztcXFxcclxcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMCAtIGU7IGkrKykgdDIgKz0gXFxcXFxcXCLilodcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgcmV0dXJ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MudXJsID0gJChcXFxcXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNpbW1lcnNpdmVUaGVtZSNcXFxcXFxcIiArICc/dHlwZT0nICsgdHlwZSArICcmaWQ9JyArIGlkKS5ydWxlKCh0eXBlLCBpZCwgdGl0bGUsIHVzZUNvbmZpZykgPT4ge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZSA9PT0gXFxcXFxcXCJwbGF5bGlzdFxcXFxcXFwiKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvdUxpc3QoaWQsIE1ZX1BBR0UsIDUwKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIGUuc3ViamVjdC5jb3Zlci5ub3JtYWwudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogcmF0aW5nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDog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VzLmxlbmd0aDsgaSsrKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBlID0gdC5tb2R1bGVzW2ldO1xcXFxyXFxcXG4gICAgICAgICAgICBpZiAoIWUuY2VyZW1vbnkgfHwgIWUuY2F0ZWdvcnkpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCByYXRpbmcgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKGUuZXh0cmEucmF0aW5nX2dyb3VwLnJhdGluZykge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJhdGluZyA9IGNvbXB1dGVSYXRpbmcoZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLm1heCwgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlKSArIFxcXFxcXFwiIFxcXFxcXFwiICsgZS5leHRyYS5yYXRpbmdfZ3JvdXAucmF0aW5nLnZhbHVlICsgXFxcXFxcXCLliIZcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZS5zdWJ0eXBlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXFxcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXFxcXFwicGxheWxpc3RcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLmNvdmVyLm5vcm1hbC51cmwgKyBcXFxcXFxcIkBSZWZlcmVyPVxcXFxcXFwiICsgZS5jb3Zlci5ub3JtYWwudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHJhdGluZyArICdcXFxcXFxcXG4nICsgZS5leHRyYS5zaG9ydF9pbmZvLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogdXJsUGFyYW1zLmV4dHJhXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbC5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZS5jZXJlbW9ueS50aXRsZS5ib2xkKCkgKyAnPHNtYWxsPig8YSBocmVmPVxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjQHJ1bGU9anM6ZXZhbChKU09OLnBhcnNlKGZldGNoKGBoaWtlcjovL3BhZ2UvbWFpbmApKS5ydWxlKTthd2FyZFZpZXcoYCcgKyBlLmNlcmVtb255LmlkICsgJ2AsYCcgKyBlLmNlcmVtb255LnRpdGxlICsgJ2ApO1xcXFxcXFwiPuafpeeci+ivpuaDhTwvYT4pPC9zbWFsbD4nICsgJzxici8+JyArIChlLmNhdGVnb3J5LnRpdGxlICsgKGUuaXNfd29uID8gJycgOiAnKOaPkOWQjSknKSkuc21hbGwoKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9KVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIGlmIChNWV9QQUdFID09IDEpIHtcXFxcclxcXFxuICAgICAgICBsLnVuc2hpZnQoe1xcXFxyXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXF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gJyZydWxlPScgKyBxdWlja1NlYXJjaENvbmZpZ3NbcXVpY2tTZWFyY2hJdGVtXS5uYW1lXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfVxcXFxyXFxcXG4gICAgfSlcXFxcclxcXFxuICAgIGlmIChxdWlja1NlYXJjaEl0ZW1zLmxlbmd0aCA+IDApIHtcXFxcclxcXFxuICAgICAgICBxdWlja1NlYXJjaEl0ZW1zLnVuc2hpZnQoe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3Ryb25nPjxiaWc+5b+r6YCf5pCc57SiPC9iaWc+PC9zdHJvbmc+JyxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIC8qcXVpY2tTZWFyY2hJdGVtcy51bnNoaWZ0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSkqL1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG5cXFxcclxcXFxuICAgIHNldEhvbWVSZXN1bHQoe1xcXFxyXFxcXG4gICAgICAgIGRhdGE6IGluZm9JdGVtcy5jb25jYXQocmF0aW5nSXRlbXMpXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQocmVsYXRlZEl0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdChxdWlja1NlYXJjaEl0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb0l0ZW1zKVxcXFxyXFxcXG4gICAgICAgICAgICAuY29uY2F0KHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh2aWRlb1JlbGF0ZWRJdGVtcylcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIC5jb25jYXQoaW50cm9JdGVtcylcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6e1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICBpZDogJ3JlY29tbWVuZGF0aW9ucydcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgLmNvbmNhdCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9Izg3M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tcXFxcclxcXFxuICAgICAgICAgICAgbGV0IGwgPSBbcmVzWzBdLHJlc1sxXSxyZXNbMl1dO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgaSA9IGwubWFwKChlID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZS50eXBlLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gZS5pZCxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IGUudGl0bGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXNlQ29uZmlnID0gZGV0YWlsc1ZpZXdDb25maWdzW2RldGFpbHNWaWV3Q29uZmlncy51c2VdLmNvbmZpZztcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSB7fTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh1c2VDb25maWcuc3RhcnRzV2l0aCgneycpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgndXJsUGFyYW1zID0gJyArIHVzZUNvbmZpZyk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybFBhcmFtcy51cmwgPSAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI2ltbWVyc2l2ZVRoZW1lI1xcXFxcXFwiICsgJz90eXBlPScgKyB0eXBlICsgJyZpZD0nICsgaWQpLnJ1bGUoKHR5cGUsIGlkLCB0aXRsZSwgdXNlQ29uZmlnKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IFxcXFxcXFwicGxheWxpc3RcXFxcXFxcIikge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG91TGlzdChpZCwgTVlfUEFHRSwgNTApO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCh1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxQYXJhbXMudXJsLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB1cmxQYXJhbXMuZXh0cmEsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBlLnBpYyA/IGUucGljLm5vcm1hbCArIFxcXFxcXFwiQFJlZmVyZXI9XFxcXFxcXCIgKyBlLnBpYy5ub3JtYWwgOiBlLmNvdmVyLnVybCArICdAUmVmZXJlcj0nICsgZS5jb3Zlci51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZS5udWxsX3JhdGluZ19yZWFzb24gfHwgZS5yYXRpbmcudmFsdWVcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSkpO1xcXFxyXFxcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMl0pO1xcXFxyXFxcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMV0pO1xcXFxyXFxcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIGlbMF0pO1xcXFxyXFxcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3JlY29tbWVuZGF0aW9ucycsIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxiaWc+PHN0cm9uZz7nm7jlhbPmjqjojZA8L3N0cm9uZz48L2JpZz5cXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eS8jbm9IaXN0b3J5IycpLnJ1bGUoKHQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL21haW4nKSkucnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVjb21tZW5kYXRpb25zKHRbMF0sIHRbMV0pO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSwgW29iai50eXBlLCBvYmouaWRdKSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3JlY29tbWVuZGF0aW9ucycse2NvbF90eXBlOiAnbGluZScsZXh0cmE6e2lkOidub29vcCd9fSlcXFxcclxcXFxuICAgICAgICB9LFxcXFxyXFxcXG4gICAgICAgIHBhcmFtOiB7XFxcXHJcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJodHRwczovL2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ICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGVtcC5wbGF5YWJsZSA9PSBwbGF5YWJsZVtyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjogLy9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1wID0gSlNPTi5wYXJzZShnZXRNeVZhcignZmluZExpc3QnKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0ZW1wLnBsYXlhYmxlID0gZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiZmluZExpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgfSwgcGxheWFibGVbcl0pXFxcXHJcXFxcbiAgICAgICAgfSlcXFxcclxcXFxuICAgIH1cXFxcclxcXFxuXFxcXHJcXFxcbiAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6K+E5YiG5Yy66Ze0OicgKyB0ZW1wLnNjb3JlLnJlcGxhY2UoJywnLCAnLScpICsgJyA8L2ZvbnQ+PC9iPicsXFxcXHJcXFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICB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gICAgICAg54Ot6Zeo5pel5pys55S15b2xOiAnaG90X2dhaWE/YXJlYT3ml6XmnKwnXFxcXHJcXFxcbiAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICDnlLXop4bliac6IHtcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt55S16KeG5YmnOiAndHZfaG90JyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt5Zu95Lqn5YmnOiAndHZfZG9tZXN0aWMnLFxcXFxyXFxcXG4gICAgICAgICAgICDng63mkq3mrKfnvo7liac6ICd0dl9hbWVyaWNhbicsXFxcXHJcXFxcbiAgICAgICAgICAgIOeDreaSreaXpeWJpzogJ3R2X2phcGFuZXNlJyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt6Z+p5YmnOiAndHZfa29yZWFuJyxcXFxcclxcXFxuICAgICAgICAgICAg54Ot5pKt5Yqo55S7OiAndHZfYW5pbWF0aW9uJ1xcXFxyXFxcXG4gICAgICAgIH0sXFxcXHJcXFxcbiAgICAgICAg57u86Im6OiB7XFxcXHJcXFxcbiAgICAgICAgICAgIOeDreaSree7vOiJujogJ3Nob3dfaG90JyxcXFxcclxcXFxuICAgICAgICAgICAg5Zu95YaF57u86Im6OiAnc2hvd19kb21lc3RpYycsXFxcXHJcXFxcbiAgICAgICAgICAgIOWbveWklue7vOiJujogJ3Nob3dfZm9yZWlnbidcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbiAgICBmb3IgKGxldCBpIGluIGl0ZW1zKSB7XFxcXHJcXFxcbiAgICAgICAgZm9yIChsZXQgaiBpbiBpdGVtc1tpXSkge1xcXFxyXFxcXG4gICAgICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRlbXAuaXRlbSA9PSBpdGVtc1tpXVtqXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgaiArICcgPC9mb250PjwvYj4nIDogaixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdob3RMaXN0JykpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRlbXAuaXRlbSA9IGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2hvdExpc3QnLCBKU09OLnN0cmluZ2lmeSh0ZW1wKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtc1tpXVtqXSlcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxyXFxcXG4gICAgICAgIH0pXFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcblxcXFxyXFxcXG4gICAgbGV0IHNvcnQgPSB7XFxcXHJcXFxcbiAgICAgICAg54Ot5bqm5o6S5bqPOiAncmVjb21tZW5kJyxcXFxcclxcXFxuICAgICAgICDml7bpl7TmjpLluo86ICd0aW1lJyxcXFxcclxcXFxuICAgICAgICDor4TliIbmjpLluo86ICdyYW5rJ1xcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG4gICAgZm9yIChsZXQgciBpbiBzb3J0KSB7XFxcXH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lu9XFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieW5tOS7vTonICsgdGVtcC5jdXN0b21ZZWFyICsgJyA8L2ZvbnQ+PC9iPic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21ZZWFyLCAn55u05o6l6L6T5YWl5YW35L2T5bm05Lu9LOS+i+WmgjIwMDAnKS5pbnB1dCgoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdjbGFzc2xpc3QnKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoaW5wdXQubGVuZ3RoID09IDQpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmN1c3RvbVllYXIgPSBpbnB1dDtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC55ZWFyID0gXFxcXFxcXCLoh6rlrprkuYnlubTku71cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXFxcXFwi6Ieq5a6a5LmJ5Zyw5Yy6XFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYodGVtcC5sb2NhbCA9PSBcXFxcXFxcIuiHquWumuS5ieWcsOWMulxcXFxcXFwiKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz7oh6rlrprkuYnlnLDljLo6JyArIHRlbXAuY3VzdG9tTG9jYWwgKyAnIDwvZm9udD48L2I+JztcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgdXJsID0gJCh0ZW1wLmN1c3RvbUxvY2FsLCAn55u05o6l6L6T5YWl5YW35L2T5Zyw5Yy6LOS+i+WmguS4reWbveWkp+mZhicpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21Mb2NhbCA9IGlucHV0O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmxvY2FsID0gXFxcXFxcXCLoh6rlrprkuYnlnLDljLpcXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1lbHNlIGlmKGl0ZW1zW2l0ZW1dW2ldID09IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYodGVtcC50eXBlID09IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCIpe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJ+KAnOKAnOKAneKAnTxiPiA8Zm9udCBjb2xvcj0nICsgY29sb3IgKyAnPuiHquWumuS5ieexu+WeizonICsgdGVtcC5jdXN0b21UeXBlICsgJyA8L2ZvbnQ+PC9iPic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21UeXBlLCAn55u05o6l6L6T5YWl5YW35L2T57G75Z6LLOS+i+WmguWJp+aDhScpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21UeXBlID0gaW5wdXQ7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAudHlwZSA9IFxcXFxcXFwi6Ieq5a6a5LmJ57G75Z6LXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiY2xhc3NsaXN0XFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35q2j56Gu6L6T5YWlJ1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxyXFxcXG4gICAgICAgICAgICB9ZWxzZSBpZihpdGVtc1tpdGVtXVtpXSA9PSBcXFxcXFxcIuiHquWumuS5ieagh+etvlxcXFxcXFwiKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmKHRlbXAuY2xhc3MgPT0gXFxcXFxcXCLoh6rlrprkuYnmoIfnrb5cXFxcXFxcIil7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSAn4oCc4oCc4oCd4oCdPGI+IDxmb250IGNvbG9yPScgKyBjb2xvciArICc+6Ieq5a6a5LmJ5qCH562+OicgKyB0ZW1wLmN1c3RvbUNsYXNzICsgJyA8L2ZvbnQ+PC9iPic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybCA9ICQodGVtcC5jdXN0b21DbGFzcywgJ+ebtOaOpei+k+WFpeWFt+S9k+agh+etvizkvovlpoLnu4/lhbhcXFxcXFxcXG7lj6/lhpnlpJrkuKrmoIfnrb4s5L2/55SoXFxcXFxcXCLoi7HmlofpgJflj7dcXFxcXFxcIuWIhumalCcpLmlucHV0KCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGVtcCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2NsYXNzbGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZihpbnB1dC5sZW5ndGggPiAwKXtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGVtcC5jdXN0b21DbGFzcyA9IGlucHV0O1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLmNsYXNzID0gXFxcXFxcXCLoh6rlrprkuYnmoIfnrb5cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJjbGFzc2xpc3RcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkodGVtcCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/or7fmraPnoa7ovpPlhaUnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybFxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICBhLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcXFxyXFxcXG4gICAgICAgIH0pXFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcblxcXFxyXFxcXG4gICAgbGV0IHJhbmsgPSB7XFxcXHJcXFxcbiAgICAgICAg6buY6K6k5o6S5bqPOiBcXFxcXFxcIlVcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICDng63luqY6IFxcXFxcXFwiVFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgIOivhOWIhjogXFxcXFxcXCJTXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAg5pe26Ze0OiBcXFxcXFxcIlJcXFxcXFxcIlxcXFxyXFxcXG4gICAgfVxcXFxyXFxcXG4gICAgZm9yIChsZXQgciBpbiByYW5rKSB7XFxcXHJcXFxcbiAgICAgICAgYS5wdXNoKHtcXFxcclxcXFxuICAgICAgICAgICAgdGl0bGU6IHRlbXAucmFuayA9PT0gcmFua1tyXSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgciArICcgPC9mb250PjwvYj4nIDogcixcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcclxcXFxuICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjogLy9lbXB0eSNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGUpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCB0ZW1w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IjogXFxcXFxcXCJlcm90aWNhXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOmfs+S5kDogXFxcXFxcXCJtdXNpY1xcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDnuqrlvZXniYc6IFxcXFxcXFwiZG9jdW1lbnRhcnlcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5rK75oSIOiBcXFxcXFxcImN1cmVcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg6Im65pyvOiBcXFxcXFxcImFydFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDpu5HoibLlub3pu5g6IFxcXFxcXFwiZGFya19odW1vclxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDpnZLmmKU6IFxcXFxcXFwieW91dGhcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5aWz5oCnOiBcXFxcXFxcImZlbWFsZVxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDnnJ/lrp7kuovku7bmlLnnvJY6IFxcXFxcXFwicmVhbF9ldmVudFxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDmmrTlips6IFxcXFxcXFwidmlvbGVuY2VcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg6buR55m9OiBcXFxcXFxcImJsYWNrX3doaXRlXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOe+jumjnzogXFxcXFxcXCJmb29kXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOaXheihjDogXFxcXFxcXCJ0cmF2ZWxcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAg5YS/56ulOiBcXFxcXFxcImNoaWxkXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgIOS6uuaApzogXFxcXFxcXCJodW1hbml0eVxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICDlrrbluq06IFxcXFxcXFwiZmFtaWx5XF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29yeV9saXN0c1swXS5rZXk7XFxcXHJcXFxcbiAgICAgICAgZm9yIChsZXQgdCBvZiB0ZW1wLmNhdGVnb3J5X2xpc3RzKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGEucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGVtcC5jYXRlZ29yeSA9PSB0LmtleSA/ICfigJzigJzigJ3igJ08Yj4gPGZvbnQgY29sb3I9JyArIGNvbG9yICsgJz4nICsgdC50aXRsZSArICcgPC9mb250PjwvYj4nIDogdC50aXRsZSxcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChlKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRlbXAgPSBKU09OLnBhcnNlKGdldE15VmFyKCdyYW5rTGlzdCcpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB0ZW1wLmNhdGVnb3J5ID0gZTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcInJhbmtMaXN0XFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHRlbXApKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0sIHQua2V5KVxcXFxyXFxcXG4gICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgIH1cXFxcclxcXFxuXFxcXHJcXFxcbiAgICBsZXQgbCA9IFtdO1xcXFxyXFxcXG4gICAgaWYgKHRlbXAubGlzdCA9PSAncmFua19saXN0JyAmJi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iAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwodXNlQ29uZmlnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgfSwgdHlwZSwgaWQsIHRpdGxlLCB1c2VDb25maWcpO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXR1cm4ge1xcXFxyXFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgIHVybDogdXJsUGFyYW1zLnVybCxcXFxcclxcXFxuICAgICAgICAgICAgZXh0cmE6IHVybFBhcmFtcy5leHRyYSxcXFxcclxcXFxuICAgICAgICAgICAgaW1nOiBlLmNvbnRlbnQuc3ViamVjdC5waWMubm9ybWFsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIGUuY29udGVudC5zdWJqZWN0LnBpYy5ub3JtYWwsXFxcXHJcXFxcbiAgICAgICAgICAgIGRlc2M6IGUuY29udGVudC5zdWJqZWN0LmNhcmRfc3VidGl0bGUuc3BsaXQoXFxcXFxcXCIvXFxcXFxcXCIpLmZpbHRlcigoKGUsIHQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh0IDwgMykgcmV0dXJuIGVcXFxcclxcXFxuICAgICAgICAgICAgfSkpLmpvaW4oXFxcXFxcXCIsXFxcXFxcXCIpICsgXFxcXFxcXCJcXFxcXFxcXG5cXFxcXFxcIiArIChlLmNvbnRlbnQuc3ViamVjdC5yYXRpbmcgPyBjb21wdXRlUmF0aW5nKGUuY29udGVudC5zdWJqZWN0LnJhdGluZy5tYXgsIGUuY29udGVudC5zdWJqZWN0LnJhdGluZy52YWx1ZSkgKyBcXFxcXFxcIiBcXFxcXFxcIiArIGUuY29udGVudC5zdWJqZWN0LnJhdGluZy52YWx1ZS50b0ZpeGVkKDEpICsgXFxcXFxcXCLliIZcXFxcXF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c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGUudGl0bGUgKyAoZS5lcGlzb2Rlc19pbmZvID8gXFxcXFxcXCLigKJcXFxcXFxcIiArIGUuZXBpc29kZXNfaW5mbyA6IFxcXFxcXFwiXFxcXFxcXCIpLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBlLmljb24sXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sWzBdIHx8IFxcXFxcXFwiaWNvbl8yXFxcXFxcXCIsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHk/aWQ9JyArIGlkICsgJyZ0eXBlPScgKyB0eXBlICsgJyZ0aXRsZT0nICsgZS50aXRsZSkucnVsZSgocmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSByZXMudGl0bGUsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpYyA9IHJlcy5waWMubm9ybWFsICsgXFxcXFxcXCJAUmVmZXJlcj1cXFxcXFxcIiArIHJlcy5waWMubm9ybWFsO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShlLnRpdGxlICsgJy0nICsgdGl0bGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VQaWNVcmwocGljKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvbWFpbicpKS5ydWxlKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGdldFR2VXJscyhpZCwgZS5pZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGF6eSA9ICQoXFxcXFxcXCJcXFxcXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHRVcmwgPSBcXFxcXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXFxcXFwiKFxcXFxcXFwiKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdFVybCA9ICcgKyBsYXp5KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdFVybFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxhenkpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHVybHMpID09IFxcXFxcXFwib2JqZWN0XFxcXFxcXCIpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB1cmxzLmxlbmd0aDsgaSsrKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn56ysJyArIChpICsgMSkgKyAn6ZuGJyxcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfNCcsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBsYXp5ID8gdXJsc1tpXSArIGxhenkgOiB1cmxzW2ldLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gXFxcXFxcXCJzdHJpbmdcXFxcXFxcIiAmJiB1cmxzID09ICfooqvlsIFpcCcpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGUgPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcXFxcXCJoaWtlcjovL3BhZ2UvcmVsZWFzZUlQP3J1bGU96Z2S6LGGXFxcXFxcXCIpKVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJ1bGU7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YodXJscykgPT0gJ3N0cmluZycgJiYgdXJscyA9PSAn5rKh5pyJ5pS25b2VJykge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfosYbnk6PmsqHmnInmlLblvZXmraTop4bpopHmupDnmoTor6bnu4bkv6Hmga8nLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+eCueaIkeWPr+S7peWOu+inhumikea6kOe9keermeeci+eciycsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBlLnVybFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSwgcmVzLCBpZCwgZSwgbGF6eSwgZXh0cmEpXFxcXHJcXFxcbiAgICAgICAgICAgIH0pXFxcXHJcXFxcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnbW92aWUnKSB7XFxcXHJcXFxcbiAgICAgICAgICAgIGxldCBtTGF6eSA9ICQoXFxcXFxcXCJcXFxcXFxcIikubGF6eVJ1bGUobGF6eSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0VXJsID0gXFxcXFxcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGF6eS5zdGFydHNXaXRoKFxcXFxcXFwiKFxcXFxcXFwiKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgbGF6eSlcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdyZXN1bHRVcmwgPSAnICsgJygoKSA9PiB7JyArIGxhenkgKyAnfSkoKScpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0VXJsXFxcXHJcXFxcbiAgICAgICAgICAgIH0sIGxhenkpXFxcXHJcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogZS50aXRsZSArIChlLmVwaXNvZGVzX2luZm8gPyBcXFxcXFxcIuKAolxcXFxcXFwiICsgZS5lcGlzb2Rlc19pbmZvIDogXFxcXFxcXCJcXFxcXFxcIiksXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGUuaWNvbixcXFxcclxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xbMV0gfHwgXFxcXFxcXCJpY29uX3NtYWxsXzRcXFxcXFxcIixcXFxcclxcXFxuICAgICAgICAgICAgICAgIHVybDogbUxhenkgPyBlLnVybCArIG1MYXp5IDogZS51cmwsXFxcXHJcXFxcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXFxcclxcXFxuICAgICAgICAgICAgfSlcXFxcclxcXFxuICAgICAgICB9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cXG4gICAgICAgICAgICBsZXQgc2NyaXB0X2xpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiZzY3JpcHRbc3JjXScpO1xcXFxyXFxcXG4gICAgICAgICAgICBsZXQgc291cmNlc191cmwgPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHNjcmlwdF9saXN0KSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gcGFyc2VEb21Gb3JIdG1sKHNjcmlwdF9saXN0W2ldLCAnc2NyaXB0JiZzcmMnKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmICh1cmwuaW5kZXhPZignbWl4ZWRfc3RhdGljJykgIT09IC0xKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlc191cmwgPSB1cmw7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgbGV0IHNvdXJjZXNfbGlzdCA9IHJlcXVlc3Qoc291cmNlc191cmwpLm1hdGNoKC9zb3VyY2VzXFxcXFxcXFxbWzEtOV17MSwyfVxcXFxcXFxcXVtcXFxcXFxcXHNcXFxcXFxcXFNdKj9cXFxcXFxcXF0vZyk7XFxcXHJcXFxcbiAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc291cmNlc19saXN0KSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBldmFsKHNvdXJjZXNfbGlzdFtpXSk7XFxcXHJcXFxcbiAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcblxcXFxyXFxcXG4gICAgICAgIGxldCByZW4gPSBzb3VyY2VzW251bV07XFxcXHJcXFxcbiAgICAgICAgaWYgKHJlbiAmJiByZW4ubGVuZ3RoID4gMCkge1xcXFxyXFxcXG4gICAgICAgICAgICAvKnZhciByID0gcmVuLm1hcChlID0+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lOiBcXFxcXFxcInJpY2hfdGV4dFxcXFxcXFwiXFxcXG4gICAgfSlcXFxcbiAgICBmb3IgKGxldCBjb25maWdLZXkgb2YgT2JqZWN0LmtleXMoZGV0YWlsc1ZpZXdDb25maWdzKSkge1xcXFxuICAgICAgICBpZiAoY29uZmlnS2V5ID09PSAndXNlJykgY29udGludWU7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogY29uZmlnS2V5ID09PSBkZXRhaWxzVmlld0NvbmZpZ3MudXNlID8gXFxcXFxcXCLigJzigJxcXFxcXFxcIiArIGNvbmZpZ0tleSArIFxcXFxcXFwi4oCd4oCdXFxcXFxcXCIgOiBjb25maWdLZXksXFxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoY29uZmlnS2V5ID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldE15VmFyKCdxZGJfY29uZmlnJykpKVxcXFxuICAgICAgICAgICAgICAgIGlmIChjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzLnVzZSA9PT0gY29uZmlnS2V5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vcHV0TXlWYXIoXFxcXFxcXCJpbnB1dF9jb25maWdfdHlwZVxcXFxcXFwiLCAn5b2x54mH6K+m5oOF6aG16Z2i6YWN572uJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJpbnB1dF9uYW1lXFxcXFxcXCIsIGNvbmZpZ0tleSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaW5wdXRfY29kZVxcXFxcXFwiLCBjb25maWcuZGV0YWlsc1ZpZXdDb25maWdzW2NvbmZpZ0tleV0uY29uZmlnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAg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FxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3NldHRpbmctZWRpdG9yP3J1bGU96Z2S6LGGJnZpZXc9YW5hbHlzaXNNb2RlRWRpdFBhZ2UnO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjb25maWcuYW5hbHlzaXNDb25maWdzLnVzZSA9IGNvbmZpZ0tleVxcXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5oiQ5YqfJ1xcXFxuICAgICAgICAgICAgfSwgY29uZmlnS2V5KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxcXG4gICAgfSlcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ+KelScsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2Uvc2V0dGluZy1lZGl0b3I/cnVsZT3pnZLosYYmdmlldz1hbmFseXNpc01vZGVFZGl0UGFnZSdcXFxcbiAgICB9KTtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ+KelicsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQoT2JqZWN0LmtleXMoYW5hbHlzaXNDb25maWdzKS5maWx0ZXIoY29uZmlnS2V5ID0+IGNvbmZpZ0tleSAhPT0gJ3VzZScgJiYgY29uZmlnS2V5ICE9PSAn5LiN6Kej5p6QJyAmJiBjb25maWdLZXkgIT09ICfmlq3mj5InKSwgMilcXFxcbiAgICAgICAgICAgIC5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gJ+S4jeino+aekCcgJiYgaW5wdXQgPT09ICfmlq3mj5InKSByZXR1cm4gJ3RvYXN0Oi8v6buY6K6k6Kej5p6Q5peg5rOV5Yig6Zmk77yBJ1xcXFxuICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBjb25maWcuYW5hbHlzaXNDb25maWdzLnVzZSkgcmV0dXJuICd0b2FzdDovL+ivpeino+aekOato+WcqOS9v+eUqO+8jOaXoOazleWIoOmZpO+8gSdcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJCgn56Gu6K6k5Yig6ZmkXFxcXFxcXCInICsgaW5wdXQgKyAnXFxcXFxcXCLvvJ8nKS5jb25maXJtKChjb25maWcsIGNvbmZpZ0tleSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLmFuYWx5c2lzQ29uZmlnc1tjb25maWdLZXldXFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liKDpmaQnICsgY29uZmlnS2V5ICsgJ+aIkOWKnydcXFxcbiAgICAgICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICB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oiQ5YqfJztcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9KTtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogJ+KelicsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQocXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLCAyKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSlcXFxcbiAgICAgICAgICAgIHJldHVybiAkKCfnoa7orqTliKDpmaRcXFxcXFxcIicgKyBpbnB1dCArICdcXFxcXFxcIu+8nycpLmNvbmZpcm0oKGNvbmZpZywgY29uZmlnS2V5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGNvbmZpZ0tleSk7XFxcXG4gICAgICAgICAgICAgICAgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5zcGxpY2UoaW5kZXgsIDEpO1xcXFxuICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2NvbmZpZ0tleV1cXFxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSlcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIoOmZpCcgKyBjb25maWdLZXkgKyAn5oiQ5YqfJ1xcXFxuICAgICAgICAgICAgfSwgY29uZmlnLCBpbnB1dClcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9KVxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn8J+TnScsXFxcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcXFxuICAgICAgICB1cmw6ICQocXVpY2tTZWFyY2hDb25maWdzLm9yZGVyLCAyKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBsZXQgcXVpY2tTZWFyY2hDb25maWdzID0gY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncztcXFxcbiAgICAgICAgICAgIGxldCBkdGV4dCA9IGlucHV0ICsgJ0BAJyArIHF1aWNrU2VhcmNoQ29uZmlnc1tpbnB1dF0ubmFtZSArICdAQCcgKyBxdWlja1NlYXJjaENvbmZpZ3NbaW5wdXRdLnBpYztcXFxcbiAgICAgICAgICAgIHJldHVybiAkKGR0ZXh0LCAn6K+35L+u5pS5JykuaW5wdXQoKGNvbmZpZywgcmF3KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zcGxpdCgnQEAnKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmF3ICE9IGlucHV0WzBdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3Mub3JkZXIuaW5kZXhPZihyYXcpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzLm9yZGVyW2luZGV4XSA9IGlucHV0WzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlnc1tyYXddO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5pbmRleE9mKGlucHV0WzBdKSA9PSAtMSkgY29uZmlnLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlci5wdXNoKGlucHV0WzBdKTtcXFxcbiAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzW2lucHV0WzBdXSA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRbMV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHBpYzogaW5wdXRbMl1cXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnyc7XFxcXG4gICAgICAgICAgICB9LCBjb25maWcsIGlucHV0KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfwn5SBJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjJykucnVsZSgoKSA9PiB7XFxcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2pzb24nKTtcXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdvcCcpO1xcXFxuICAgICAgICAgICAgfSkpXFxcXG4gICAgICAgICAgICBpZiAoZ2V0TXlWYXIoJ2pzb24nKSA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHF1aWNrU2VhcmNoQ29uZmlncyA9IGNvbmZpZy5xdWlja1NlYXJjaENvbmZpZ3M7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShxdWlja1NlYXJjaENvbmZpZ3MpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgbGV0IG9sZCA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ2pzb24nKSk7XFxcXG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuWIq+eCueWHu+S4pOmhueS7peS6pOaNoumhuuW6j1xcXFxcXFxcbuKAmOKAmOaOkuW6j+WujOavleWQjueCueaIkeS/neWtmOaOkuW6jyzlkKbliJnmjpLluo/kuI3nlJ/mlYjigJnigJknLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0TXlWYXIoJ3FkYl9jb25maWcnKSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdzID0gSlNPTi5wYXJzZShnZXRNeVZhcignanNvbicpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKGdldE15VmFyKCdxZGJfY29uZmlnJyksIEpTT04uc3RyaW5naWZ5KGNvbmZpZykpO1xcXFxuICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJ1xcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgb2xkLm9yZGVyLmZvckVhY2goKHZhbHVlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcignb3AnKSA9PSB2YWx1ZSA/IHZhbHVlICsgJ+KAmOKAmCjlvZPliY3pgInkuK0p4oCZ4oCZJyA6IHZhbHVlLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChrZXksIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3AgPSBnZXRNeVZhcignb3AnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcCA9PSAnJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdvcCcsIGtleSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9wID09IGtleSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ29wJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvbGQgPSBKU09OLnBhcnNlKGdldE15VmFyKCdqc29uJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdhID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlOiBvbGQubW9kZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6IG9sZC5vcmRlclxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG9waW5kZXggPSBuZXdhLm9yZGVyLmluZGV4T2Yob3ApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNYXRoLmFicyhvcGluZGV4IC0gaW5kZXgpID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltvcGluZGV4XSA9IGtleTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlcltpbmRleF0gPSBvcDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG9waW5kZXggPiBpbmRleCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXgsIDAsIG9wKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdhLm9yZGVyLnNwbGljZShvcGluZGV4LCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3YS5vcmRlci5zcGxpY2UoaW5kZXggLSAxLCAwLCBvcCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld2Eub3JkZXIuZm9yRWFjaCh2YWx1ZSA9PiBuZXdhW3ZhbHVlXSA9IG9sZFt2YWx1ZV0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2pzb24nLCBKU09OLnN0cmluZ2lmeShuZXdhKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignb3AnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdmFsdWUsIGluZGV4KVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfimpnvuI8nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiAkKHF1aWNrU2VhcmNoQ29uZmlnc1snbW9kZSddIHx8IFxcXFxcXFwiXFxcXFxcXCIsICfor7fmraPnoa7ovpPlhaXnu4Tku7bmoLflvI9cXFxcXFxcXG7lu7rorq7lgLw6ZmxleF9idXR0b24gc2Nyb2xsX2J1dHRvbiBpY29uX3JvdW5kX3NtYWxsXzQgaWNvbl9zbWFsbF80JykuaW5wdXQoKCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBjb25maWcucXVpY2tTZWFyY2hDb25maWdz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AgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXFxcXFwiO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG4gICAgbGV0IGNob29zZUNvbG9yID0gY29uZi5jaG9vc2VDb2xvciB8fCAnI0ZBNzI5OCc7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgJ+iHquWumuS5iemAieS4reagh+etvuminOiJsicuYm9sZCgpLFxcXFxuICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9JyArIGNob29zZUNvbG9yICsgJz4nICsgJ+aIkeaYr+mihOiniOaViOaenDwvZm9udD4nLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgIHVybDogJChjaG9vc2VDb2xvciwgJ+WIq+W/mOS6hiMnKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgY29uZmlnID0gSlNPTi5wYXJzZShmZXRjaChnZXRNeVZhcigncWRiX2NvbmZpZycpKSk7XFxcXG4gICAgICAgICAgICBjb25maWcuY2hvb3NlQ29sb3IgPSBpbnB1dDtcXFxcbiAgICAgICAgICAgIHdyaXRlRmlsZShnZXRNeVZhcigncWRiX2NvbmZpZycpLCBKU09OLnN0cmluZ2lmeShjb25maWcpKTtcXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruabtOaUueW3suS/neWtmFxcXFxcXFwiO1xcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG5cXFxcbiAgICBob21lUGFnZVNldHRpbmdNb2R1bGUoZCk7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxuICAgIH0pXFxcXG5cXFxcbiAgICBxdWlja1NlYXJjaERJWU1vZHVsZShkLCBjb25mKTtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXG4gICAgfSlcXFxcblxcXFxuICAgIGRldGFpbFZpZXdTZXR0aW5nTW9kdWxlKGQpO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcbiAgICB9KVxcXFxuXFxcXG4gICAgaWYgKHRydWUvKmdldEl0ZW0oJ3Bhc3N3b3JkJykgPT0gJ3RydWUnKi8pIHtcXFxcbiAgICAgICAgYW5hbHlzaXNTZXR0aW5nTW9kdWxlKGQpO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcblxcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArICfmgaLlpI3pu5jorqTorr7nva4nLmJvbGQoKSxcXFxcbiAgICAgICAgZGVzYzogJ+mHjeeUnycsXFxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXFxcbiAgICAgICAgdXJsOiAkKFsn6YeN572u5pif5pif6aKc6ImyJywgJ+mHjee9rumAieS4reagh+etvuminOiJsicsICfph43nva7lv6vpgJ/mkJzntKInLCAn6YeN572u6aaW6aG15Li66buY6K6kJywgJ+mHjee9ruivpuaDhemhtScgLCAn5riF6Zmk5YWo6YOo6K6+572uJ10sIDEpLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuehruWumuimgVxcXFxcXFwiICsgaW5wdXQgKyBcXFxcXFxcIu+8n1xcXFxcXFwiKS5jb25maXJtKChzZWwpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgaXRlbSA9ICcnO1xcXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoc2VsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruaYn+aYn+minOiJsic6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3N0YXJDb2xvcic7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6YCJ5Lit5qCH562+6aKc6ImyJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnY2hvb3NlQ29sb3InO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mHjee9ruW/q+mAn+aQnOe0oic6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtID0gJ3F1aWNrU2VhcmNoQ29uZmlncyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YeN572u6aaW6aG15Li66buY6K6kJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnaG9tZVBhZ2VDb25maWdzJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfph43nva7or6bmg4XpobUnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9ICdkZXRhaWxWaWV3Q29uZmlncyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5riF6Zmk5YWo6YOo6K6+572uJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSAnYWxsJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAg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FxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGUgPSBcXFxcXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvRHVhbk5pYW4vTXlQYXJzZS5qc29uXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgb2xkZmlsZSA9IFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIjtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoZmlsZSkpIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKCdqc29uPScgKyBmZXRjaChmaWxlKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzVXJsID0ganNvbi5zZXR0aW5ncy5jajtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGpzVXJsKSk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShpbnB1dCk7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZpbGVFeGlzdChvbGRmaWxlKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKGlucHV0KTtcXFxcclxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ayoeaJvuWIsOaWreaPkumFjee9ruaWh+S7tic7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgIH0pLFxcXFxyXFxcXG4gICAgICAgICAgICBzZXR0aW5nOiAkLnRvU3RyaW5nKCgpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlID0gXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL0R1YW5OaWFuL015UGFyc2UuanNvblxcXFxcXFwiO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgbGV0IG9sZGZpbGUgPSBcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCI7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KGZpbGUpKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbCgnanNvbj0nICsgZmV0Y2goZmlsZSkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IGpzb24uc2V0dGluZ3MuY2o7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRVcmw7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZpbGVFeGlzdChvbGRmaWxlKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBqc1VybCA9IEpTT04ucGFyc2UoZmV0Y2gob2xkZmlsZSkpLmNqO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goanNVcmwpKTtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2V0VXJsO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2UvUm91dGU/cnVsZT1NeUZpZWxk4bSw4oG/JnR5cGU96K6+572uXFxcXFxcXCI7XFxcXHJcXFx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FxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZUludChnZXRNeVZhcih0aGlzLmtleSwgXFxcXFxcXCIwXFxcXFxcXCIpKVxcXFxyXFxcXG4gICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxcXHJcXFxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSBMWlN0cmluZy5jb21wcmVzc1RvRW5jb2RlZFVSSUNvbXBvbmVudChpbnB1dClcXFxcclxcXFxuICAgICAgICAgICAgICAgIC8vIFppcFRvb2wuY29tcHJlc3Muc2l6ZS5zZXQocmVzdWx0Lmxlbmd0aCAqIDIpXFxcXHJcXFxcbiAgICAgICAgICAgIHJldHVybiByZXN1bHRcXFxcclxcXFxuICAgICAgICB9XFxcXHJcXFxcbiAgICB9LFxcXFxyXFxcXG4gICAgZGVjb21wcmVzczoge1xcXFxyXFxcXG4gICAgICAgIHNpemU6IHtcXFxcclxcXFxuICAgICAgICAgICAgZ2V0OiAoKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZ2V0TXlWYXIoXFxcXFxcXCJ0ZXh0LWRlY29tcHJlc3NcXFxcXFxcIiwgXFxcXFxcXCIwXFxcXFxcXCIpXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgLmxlbmd0aFxcXFxyXFxcXG4gICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgfSxcXFxcclxcXFxuICAgICAgICBleGVjOiAoaW5wdXQpID0+IHtcXFxcclxcXFxuICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFppcFRvb2wuZGVwZW5kZW5jZSkpXFxcXHJcXFxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSBMWlN0cmluZy5kZWNvbXByZXNzRnJvbUVuY29kZWRVUkl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gWmlwVG9vbC5jb21wcmVzcy5leGVjKHJlc3VsdClcXFxcclxcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxyXFxcXG4gICAgICAgICAgICBkZWZhdWx0IDpcXFxcclxcXFxuICAgICAgICAgICAgICAgIGlmIChnZXRBcHBWZXJzaW9uKCkgPiAyMDcwKSB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gXFxcXFxcXCLpnZLosYblj6Pku6Tvv6VcXFxcXFxcIiArIHJlbWFyayArIFxcXFxcXFwi77+lXFxcXFxcXCIgKyBuYW1lXFxcXHJcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gc2hhcmVQYXN0ZShDb25maWdUb29sLmV4cG9ydChuYW1lLCBjb25maWcsIHJlbWFyaywgJ1ppcHBlcicpLGVuY1R5cGUpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKyAnXFxcXFxcXFxuXFxcXFxcXFxuJyArIHN5bWJvbFxcXFxyXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6K+35pu05paw6KeG55WM54mI5pys6IezIEMyMDcwIOS7peS4iidcXFxcclxcXFxuICAgICAgICAgICAgICAgIH1cXFxcclxcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxyXFxcXG4gICAgICAgIH1cXFxcclxcXFxuICAgICAgICByZXN1bHQgPSBzeW1ib2wgKyByZXN1bHRcXFxcclxcXFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcXFxyXFxcXG4gICAgfSxcXFxcclxcXFxuICAgIGltcG9ydDogKGNvbmZpZ0NvbW1hbmQpID0+IHtcXFxcclxcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gJydcXFxcclxcXFxuICAgICAgICBpZiAoY29uZmlnQ29tbWFuZC5zdGFydHNXaXRoKCfkupEnKSkge1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5leGVjKHJlc3VsdClcXFxcclxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcclxcXFxuICAgICAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxcXHJcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxyXFxcXG4gICAgICAgICAgICBsb2coZS5tZXNzYWdlKVxcXFxyXFxcXG4gICAgICAgICAgICB0aHJvdyBcXFxcXFxcIuWvvOWFpeaVsOaNruS4jeWQiOazlVxcXFxcXFwiXFxcXHJcXFxcbiAgICAgICAgfVxcXFxyXFxcXG4gICAgICAgIHJldHVybiByZXN1bHQ7XFxcXHJcXFxcbiAgICB9XFxcXHJcXFxcbn1cXFwifV1cIn0iLCJwaWNVcmwiOiJodHRwczovL2dpdGNvZGUubmV0L3FxXzQxODQ2NzU2L2hpa2VyLy0vcmF3L21hc3Rlci9pbWcv54Ot6ZeoLmpwZyIsInRpdGxlIjoi54Ot6ZeoIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement