Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@樱花动漫@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5qix6Iqx5Yqo5ryrIiwiYXV0aG9yIjoiemV0YWxwaGEiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNodHRwOi8veWhkbTgxLmNvbS8jI2Z5cGFnZSIsInZlcnNpb24iOjAsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW11cblxudmFyIGVkaXRpb24gPSAnbmV3JyAvL25ldyDmlrDniYggb2xkIOaXp+eJiFxuXG5pZiAoZWRpdGlvbiA9PSAnb2xkJykgeyBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL29sZCcpKS5ydWxlKVxufVxuXG5NWV9VUkwgPSBNWV9VUkwuc3BsaXQoJyMjJylbMV1cblxuXG52YXIgdGl0bGVzID0gWyfpppbpobUnLCAn562b6YCJJywgJ+aOkuihjCcsICfmkJzntKInXVxuXG52YXIgdGluZGV4ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ3RpbmRleCcsIDApXG5cbnRpdGxlcyA9IHRpdGxlcy5tYXAoKHgsIGkpID0+IHtcbiAgICB2YXIgdGl0bGUgPSBpID09IHRpbmRleCA/IGDigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj1cIiMxRTkwRkZcIj4ke3h9PC9mb250PjwvYj5gIDogeFxuICAgIHJldHVybiB0aXRsZVxufSlcblxuaWYgKE1ZX1BBR0UgPT0gMSkge1xuICAgIGQucHVzaCh7XG4gICAgICAgIHRpdGxlOiB0aXRsZXNbMF0sXG4gICAgICAgIGltZzogJ2h0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tb3JlLzQ3LnBuZ0BSZWZlcmVyPScsXG4gICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF80JyxcbiAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XG4gICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGNvbmZpZy7pppbpobUpXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcigndGluZGV4JywgMClcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgfSksXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICflvLrliLbmm7TmlrAnLFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShjb25maWcudWkpXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WujOaIkCdcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfV1cbiAgICAgICAgfVxuICAgIH0pXG5cbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTogdGl0bGVzWzFdLFxuICAgICAgICBpbWc6ICdodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8xMDQucG5nQFJlZmVyZXI9JyxcbiAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnLFxuICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgICAgIHN0b3JhZ2UwLnB1d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biAgICAgICAgICAgICAgICAnUmVmZXJlcic6ICdodHRwOi8veWhkbTE2LmNvbS8nLFxuICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogTU9CSUxFX1VBXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICAgIHZhciBzcmMgPSBkZWNvZGVVUklDb21wb25lbnQocGRmaChoMiwgJyNwbGF5aWZyYW1lJiZzcmMnKSlcbiAgICAgICAgc3JjID0gJ3ZpZGVvOi8vJyArIHNyYyArICc7Z2V0O1VURi04O3tSZWZlcmVyQGh0dHA6Ly95aGRtMTYuY29tL30nXG4gICAgICAgIC8vbG9nKHNyYylcbiAgICAgICAgbG9nKHNyYykqL1xuXG4gICAgICAgIGNvbnN0IG0gPSAkLnJlcXVpcmUoXCJoaWtlcjovL3BhZ2UveWhsaW5rXCIpO1xuICAgICAgICB2YXIgaXVybHMgPSBtLmdjKGxpbmsxKVxuXG5cbiAgICAgICAgLy9pdXJscy51bnNoaWZ0KCfkuLvnur87JytsaW5rMSlcblxuICAgICAgICAvL2xvZyhpdXJscylcblxuICAgICAgICAvKnZhciB1cmxzID0gcGRmaChoMiwgJ0h0bWwmJnNjcmlwdCwxJiZIdG1sJylcbiAgICAgICAgZXZhbCh1cmxzKVxuICAgICAgICBsb2codXJscykqL1xuXG4gICAgICAgIHZhciBsYXp5ID0gJCgnJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgcmV0dXJuICd2aWRlbzovLycgKyBpbnB1dFxuICAgICAgICB9KVxuXG4gICAgICAgIHZhciB0dXJscyA9IFtdXG4gICAgICAgIHZhciB0anggPSBbXVxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGl1cmxzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICB2YXIgbmFtZSA9IGl1cmxzW2ldLnNwbGl0KCc7JylbMF1cbiAgICAgICAgICAgIHZhciBsaW5rID0gJ3ZpZGVvOi8vJyArIGl1cmxzW2ldLnNwbGl0KCc7JylbMV1cbiAgICAgICAgICAgIHRqeC5wdXNoKG5hbWUpXG4gICAgICAgICAgICB0dXJscy5wdXNoKGxpbmspXG4gICAgICAgIH1cblxuICAgICAgICAvL2lucHV0ID0gbGluazFcbiAgICAgICAgLy9sb2coaW5wdXQpXG4gICAgICAgIC8vdmFyIGp4ID0gc3JjLnJlcGxhY2UoL3VybD0uKy9nbSwgJ3VybD0nKVxuICAgICAgICB2YXIgdmlwVXJsID0gbGluazJcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHZhciBiZnVybCA9IHR1cmxzO1xuICAgICAgICAgICAgdmFyIGp4cyA9IHRqeFxuICAgICAgICAgICAgLy9sb2coYmZ1cmwpXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIHZhciBiZnVybCA9IFtdO1xuICAgICAgICB9XG4gICAgICAgIC8qbG9nKCdkZWJ1ZycpXG4gICAgICAgIGxvZyh2aXBVcmwpXG4gICAgICAgIGxvZyhwYXJzZSlcbiAgICAgICAgbG9nKGJmdXJsKSovXG5cbiAgICAgICAgcmV0dXJuICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9tdWxQYXJzZT9ydWxlPemFjee9ruWKqeaJi1wiKS5tdWxQYXJzZSh2aXBVcmwsIGJmdXJsLCBqeHMsIFt7XG4gICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogTU9CSUxFX1VBXG4gICAgICAgIH1dKTtcbiAgICB9KVxuICAgIFxuICAgIFxuICAgIFxuICAgIHZhciBsYXp5eCA9ICQoJycpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgY29uc3QgbSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS95aGxpbmtcIik7XG4gICAgICAgIHZhciBpdXJscyA9IG0uZ2MoaW5wdXQpXG4gICAgICAgIGxvZyhpdXJscylcbiAgICAgICAgbmFtZXMgPSBpdXJscy5tYXAoeCA9PiB4LnNwbGl0KCc7JylbMF0pXG4gICAgICAgIHVybHM9IGl1cmxzLm1hcCh4ID0+IHguc3BsaXQoJzsnKVsxXSlcbiAgICAgICAgdXJscyA9IGl1cmxzLm1hcCh4ID0+IHtcbiAgICAgICAgICAgIHZhciB1cmwgPSB4LnNwbGl0KCc7JylbMV1cbiAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoJ3NoZW5qdycpKSB7XG4gICAgICAgICAgICAgICAgdXJsID0gdXJsICsgJy5tM3U4J1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYodXJsLmluY2x1ZGVzKCc/dXJsPScpKXtcbiAgICAgICAgICAgICAgICB1cmw9J3ZpZGVvOi8vJyt1cmwrJ0BSZWZlcmVyPSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB1cmxcbiAgICAgICAgfSlcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdXJsczogdXJscyxcbiAgICAgICAgICAgIG5hbWVzOiBuYW1lc1xuICAgICAgICB9XG4gICAgfSlcbn1cblxuXG4vL2xvZyhwbGF5bGlzdClcbi8vIGxvZyhzbylcblxuZm9yIChsZXQgcGxheSBvZiBwbGF5bGlzdCkge1xuICAgIHZhciBwID0gZXZhbChwbGF5KS5maWx0ZXIoeCA9PiB4ICE9IG51bGwpXG4gICAgaWYgKCFwWzBdLmluY2x1ZGVzKCdodHRwJykpIHtcbiAgICAgICAgLy90YWJzLnNoaWZ0KClcbiAgICAgICAgLy9jb250aW51ZVxuICAgIH1cbiAgICB2YXIgcGwgPSBwLm1hcCgoeCwgaSkgPT4ge1xuICAgICAgICB2YXIgdCA9IHVuZXNjYXBlKHguc3BsaXQoJywnKVsyXSk7XG4gICAgICAgIHZhciB1ID0geC5zcGxpdCgnLCcpWzBdO1xuICAgICAgICBpZiAoaXNvZmZpY2lhbCh1KSkge1xuICAgICAgICAgICAgaWYgKGxhenkgIT0gJycpIHtcbiAgICAgICAgICAgICAgICAvL3UgPSB1ICsgbGF6eVxuICAgICAgICAgICAgICAgIHUgPSBNWV9VUkwgKyAoaSArIDEpICsgJy5odG1sOycgKyB1ICsgbGF6eWRtXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHUgPSAndmlkZW86Ly8nICsgTVlfVVJMICsgKGkgKyAxKSArICcuaHRtbCdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICh1LmluY2x1ZGVzKCdodHRwJykpIHtcbiAgICAgICAgICAgIGlmICghdS5lbmRzV2l0aCgnbTN1OCcpKSB7XG4gICAgICAgICAgICAgICAgdSA9IHUgKyAnLm0zdTgnXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1ID0gJ3ZpZGVvOi8vJysgTVlfVVJMICsgKGkgKyAxKSArICcuaHRtbCdcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgdGl0bGU6IHQsXG4gICAgICAgICAgICB1cmw6IHVcbiAgICAgICAgfVxuICAgIH0pXG4gICAgbGlzdHMucHVzaChwbClcbn1cblxudmFyIG0gPSB0YWJzLmluZGV4T2YoJ+S4u+e6vycpXG5cbmlmIChtICE9IC0xKSB7XG4gICAgdGFicyA9IHN3YXBBcnIodGFicywgbSwgMClcbiAgICBsaXN0cyA9IHN3YXBBcnIobGlzdHMsIG0sIDApXG59XG5cblxudmFyIGZmID0gSlNPTi5wYXJzZShKU09OLnN0cmluZ2lmeShNWV9QQVJBTVMpKTtcblxudmFyIOeKtuaAgSA9ICfnirbmgIE6ICcgKyBwZGZoKGh0bWwsICcubmFtZSYmc3BhbiYmVGV4dCcpXG52YXIg5a+85ryUID0gZXZhbChjb25maWcu5a+85ryUKVxudmFyIOS4u+a8lCA9IGV2YWwoY29uZmlnLuS4u+a8lClcbnZhciDnroDku4sgPSBldmFsKGNvbmZpZy7nroDku4spXG52YXIg57G75Z6LID0gZXZhbChjb25maWcu57G75Z6LKVxuaWYgKOS4u+a8lCA9PSAnJykge1xuICAgIOS4u+a8l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YXN0ZW1lLnR5cmFudGcuY29tL3h4eHh4eC92a3ZoYnFvcHY1dTZ1Nm9wXFxcIlxcbiAgICAgICAgfVxcbiAgICB9XFxufVxcblxcbnZhciBqc29uID0gcnVsZXM7XFxudmFyIGxpc3QgPSBqc29uLnF1aWNrU2VhcmNoQ29uZmlncy5vcmRlcjtcXG5cXG5mb3IgKGwgaW4gbGlzdCkge1xcbiAgICB2YXIgb2JqID0ganNvbi5xdWlja1NlYXJjaENvbmZpZ3NbbGlzdFtsXV07XFxuICAgIC8vbG9nKG9iai5uYW1lKVxcblxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGxpc3RbbF0sXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9iaiwgaG9tZSwgdGl0bGUpID0+IHtcXG4gICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlcXVlc3QoaG9tZSkpO1xcbiAgICAgICAgICAgIGxldCBoYXNSdWxlID0gcnVsZUxpc3Quc29tZShpdGVtID0+IGl0ZW0udGl0bGUgPT09IG9iai5uYW1lKTtcXG4gICAgICAgICAgICBpZiAoaGFzUnVsZSB8fCBvYmoubmFtZSA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXCLor7fphY3nva7lv6vpgJ/mkJzntKJcXFwiKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3M9JyArIHRpdGxlICsgJyZydWxlPScgKyBvYmoubmFtZTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcblxcbiAgICAgICAgICAgICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KFxcXCJydWxlXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChvYmoucnVsZS5pbmRleE9mKCdjb3B5JykhPS0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuW3sue7j+WkjeWItuivt+WvvOWFpeinhOWImVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb2JqLnJ1bGVcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7flronoo4VcXFwiICsgb2JqLm5hbWUgKyBcXFwi5bCP56iL5bqPXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIG9iaiwgXFxcImhpa2VyOi8vaG9tZVxcXCIsIHRpdGxlKSxcXG4gICAgICAgIHBpY191cmw6IG9iai5waWMsXFxuICAgICAgICBjb2xfdHlwZToganNvbi5xdWlja1NlYXJjaENvbmZpZ3MubW9kZSxcXG4gICAgICAgIGV4dHJhOntpZDoncXNlYXJjaCd9XFxuICAgIH0pXFxufVxcblxcblxcbi8qICAgICQoKS5sYXp5UnVsZSgob2JqLCBob21lLCB0aXRsZSkgPT4ge1xcbiAgICAgICAgbGV0IHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGhvbWUpKTtcXG4gICAgICAgIGxldCBoYXNSdWxlID0gcnVsZUxpc3Quc29tZShpdGVtID0+IGl0ZW0udGl0bGUgPT09IG9iai5uYW1lKTtcXG4gICAgICAgIGlmIChoYXNSdWxlKSB7XFxuXFxuICAgICAgICAgICAgLy90b2FzdChcXFwi6K+36YWN572u5b+r6YCf5pCc57SiXFxcIilcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3M9JyArIHRpdGxlICsgJyZydWxlPScgKyBvYmoubmFtZSxcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgLy90b2FzdChcXFwi6K+35a6J6KOF6Z2S6LGG5bCP56iL5bqPXFxcIilcXG4gICAgICAgICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KFxcXCJydWxlXFxcIikpIHtcXG4gICA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wgcGxheWppKTtcXG4gICAgICAgICAgICBpZiAodHQgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHR0O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgY2Fyc196eXcubGVuZ3RoOyBrKyspIHtcXG5cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBnZXRfcGxheV9hcnJheShjYXJzX3p5d1trXSk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgaWYgKHJlYWxfcGxheWFyciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0dCA9IENoZWNrUGxheVR5cGVPa19wbGF5YXJyYXkocmVhbF9wbGF5YXJyLCBwbGF5amkpO1xcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgaWYgKHR0ICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICBtYWluX2xpbmVfbnVsbF9xcF9oYXMgPSBjYXJzX3p5d1trXTtcXG4gICAgICAgICAgICAgICAgICAgIG1haW5fbGluZV9udWxsX3FwX2hhc19xcF9zdHJpbmcgPSB0dDtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0dDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiAnJztcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBDaGVja1BsYXlUeXBlT2tfcGxheWFycmF5KHBsYXlhcnJfb3JkZXJfMSwgcGxheWppKSB7XFxuICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfb3JkZXJfMSkgPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICByZXR1cm4gJyc7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfb3JkZXJfMVtwbGF5amldKSA9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgIHJldHVybiAnJztcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBwbGF5YXJyX29yZGVyXzFbcGxheWppXTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRfb19sKHBsYXlhcnJfNTY3LCBuLCByZWFsX2ppKSB7XFxuICAgICAgICB5Yl92aWRfcmV0ID0gJyc7XFxuICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfNTY3KSAhPSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgIGlmIChwbGF5YXJyXzU2NyA9PSBudWxsKSByZXR1cm4gJyc7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyXzU2N1tuXSkgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGFycl90ZW1wID0gcGxheWFycl81Njdbbl0uc3BsaXQoJywnKTtcXG4gICAgICAgICAgICAgICAgLy9sb2coYXJyX3RlbXApXFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBpZiAoYXJyX3RlbXAubGVuZ3RoID49IDMpIHtcXG5cXG4gICAgICAgICAgICAgICAgICAgIC8vaWYgKGFycl90ZW1wWzJdID09IHJlYWxfamkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB5Yl92aWRfcmV0ID0gYXJyX3RlbXBbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgeWJfdmlkX3JldCA9IHliX3ZpZF9yZXQucmVwbGFjZShcXFwiLmNvbVxcXCIsIFxcXCIuY29tNDk3XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAvL31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL2xvZyh5Yl92aWRfcmV0KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoeWJfdmlkX3JldCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgcGxheWFycl81NjcubGVuZ3RoOyBrKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl81Njdba10pICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyX3RlbXAgPSBwbGF5YXJyXzU2N1trXS5zcGxpdCgnLCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcnJfdGVtcC5sZW5ndGggPj0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyX3RlbXBbMl0gPT0gcmVhbF9qaSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWJfdmlkX3JldCA9IGFycl90ZW1wWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWJfdmlkX3JldCA9IHliX3ZpZF9yZXQucmVwbGFjZShcXFwiLmNvbVxcXCIsIFxcXCIuY29tNDk3XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIC8vYWxlcnQoJ3liX3ZpZF9yZXQnK3liX3ZpZF9yZXQpO1xcbiAgICAgICAgcmV0dXJuIHliX3ZpZF9yZXQ7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gZ2V0X290aF9saW5lKF9xaWVwXzM2NSwgbiwgcmVhbF9qaSkge1xcbiAgICAgICAgLy/lvqrnjq/mr48gXFx0XFxuICAgICAgICB5Yl9hbGxfcmV0ID0gJyc7XFxuICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IGNhcnNfenl3Lmxlbmd0aDsgaysrKSB7XFxuICAgICAgICAgICAgdmFyIHFwX25hbWUgPSBjYXJzX3p5d1trXTsgLy9pZihfcWllcF8zNjUgPT0gcXBfbmFtZSkgY29udGludWU7IFxcdFxcdFxcbiAgICAgICAgICAgIHBsYXlhcnJfNTY3ID0gZ2V0X3BsYXlfYXJyYXkocXBfbmFtZSk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAvL2xvZyhxcF9uYW1lKyc6JytwbGF5YXJyXzU2Nyk7IFxcdFxcdFxcbiAgICAgICAgICAgIHliX3ZpZF9yZXQgPSBnZXRfb19sKHBsYXlhcnJfNTY3LCBuLCByZWFsX2ppKTtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICAvL2xvZyh5Yl92aWRfcmV0KVxcbiAgICAgICAgICAgIGlmICh5Yl92aWRfcmV0ICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmxfMzEgPSBxcF9uYW1lICsgJ3x8fCcgKyB5Yl92aWRfcmV0O1xcbiAgICAgICAgICAgICAgICBpZiAoeWJfYWxsX3JldCA9PSAnJykgeWJfYWxsX3JldCA9IHVybF8zMTtcXG4gICAgICAgICAgICAgICAgZWxzZSB5Yl9hbGxfcmV0ID0geWJfYWxsX3JldCArICckJCQnICsgdXJsXzMxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB5Yl9hbGxfcmV0O1xcbiAgICB9XFxuXFxuXFxuXFxuICAgIGZ1bmN0aW9uIGdldF9tYWluXzAobikge1xcbiAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyKSA9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgIHJldHVybiAnJztcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBnZXRfcGxpc3RfanMocGxfZHksIG4sIHBsYXlhcnIpO1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGdldF9yX3VybChwbGF5YXJyX3IsIG4pIHtcXG4gICAgICAgIHZhciB1cmxfcmV0ID0gJyc7XFxuICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfcikgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfcltuXSkgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGFycl90ZW1wID0gcGxheWFycl9yW25dLnNwbGl0KCcsJyk7XFxuICAgICAgICAgICAgICAgIHVybF9yZXQgPSBhcnJfdGVtcFswXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdXJsX3JldDtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRRdWVyeVZhcmlhYmxlKHZhcmlhYmxlKSB7XFxuICAgICAgICB2YXIgcXVlcnkgPSAnJztcXG4gICAgICAgIGlmICh2YXJpYWJsZS5pbmNsdWRlcygnPycpKSB7XFxuICAgICAgICAgICAgcXVlcnkgPSB2YXJpYWJsZS5yZXBsYWNlKC8uKlxcXFw/L2dtLCAnJylcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB2YXJzID0gcXVlcnkuc3BsaXQoXFxcIiZcXFwiKTtcXG5cXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdmFycy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIHZhciBwYWlyID0gdmFyc1tpXS5zcGxpdChcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChwYWlyWzBdID09IHZhcmlhYmxlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBwYWlyWzFdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiAoZmFsc2UpO1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGdldF9wbGlzdF9qcyhwbF9keSwgbiwgcmVhbF9wbGF5YXJyKSB7XFxuICAgICAgICB2YXIgc3RyID0gJyc7XFxuICAgICAgICB2YXIgc3RybGlfc3R5bGUgPSAnJztcXG4gICAgICAgIC8vaWYocGxfZHk9PTMpICBzdHJsaV9zdHlsZSA9JyBzdHlsZT1cXFwid2lkdGg6MTAwJTt0ZXh0LWFsaWduOmxlZnRcXFwiJztcXG4gICAgICAgIGZvciAoaSBpbiByZWFsX3BsYXlhcnIpIHtcXG4gICAgICAgICAgICB2YXIgYXJyMSA9IHJlYWxfcGxheWFycltpXS5zcGxpdCgnLCcpO1xcbiAgICAgICAgICAgIGlmIChhcnIxLmxlbmd0aCA8IDMpIHtcXG4gICAgICAgICAgICAgICAgb2sgPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIHQgPSB1bmVzY2FwZShhcnIxWzJdKTtcXG4gICAgICAgICAgICBpZiAodCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICBpZiAocGxfZHkgPT0gMSkgdCA9ICfmraPniYcnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgY3N0ciA9IChpID09IG4pID8gJyBjdXJyZW50JyA6ICcnO1xcblxcbiAgICAgICAgICAgIGlmIChwbF9keSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIHN0ciArPSAnPGxpPjxhIGNsYXNzPVxcXCJ0d2lkdGgnICsgY3N0ciArICdcXFwiIGhyZWY9XFxcIicgKyBpICsgJy5odG1sXFxcIj4nICsgdCArICc8L2E+PC9saT4nO1xcblxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHN0ciA9ICc8bGknICsgc3RybGlfc3R5bGUgKyAnPjxhIGNsYXNzPVxcXCJ0d2lkdGgnICsgY3N0ciArICdcXFwiIGhyZWY9XFxcIicgKyBpICsgJy5odG1sXFxcIj4nICsgdCArICc8L2E+PC9saT4nICsgc3RyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBzdHI7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gZ2V0X2xhc3RfdHlwZShxcF90eXBlKSB7XFxuICAgICAgICByZWFsX3BsYXlhcnIgPSBudWxsO1xcbiAgICAgICAgaWYgKHFwX3R5cGUgPT0gJ2ZzJykge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl9mcykgPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlYWxfcGxheWFyciA9IHBsYXlhcnJfZnM7XFxuICAgICAgICB9IGVsc2UgaWYgKHFwX3R5cGUgPT0gJ2p5Jykge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl9qeSkgPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlYWxfcGxheWFyciA9IHBsYXlhcnJfank7XFxuICAgICAgICB9IFxcbiAgICAgICAgcmV0dXJuIHJlYWxfcGxheWFycjtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRfcGxheV9hcnJheShxcF90eXBlKSB7XFxuICAgICAgICBcXG4gICAgICAgIHJlYWxfcGxheWFyciA9IG51bGw7XFxuICAgICAgICByZWFsX3BsYXlhcnIgPSBnZXRfbGFzdF90eXBlKHFwX3R5cGUpO1xcbiAgICAgICAgXFxuICAgICAgICBpZiAocmVhbF9wbGF5YXJyICE9IG51bGwpIHJldHVybiByZWFsX3BsYXlhcnI7XFxuICAgICAgICBpZiAocXBfdHlwZSA9PSAnemQnKSB7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyXzEpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyXzE7XFxuICAgICAgICB9IGVsc2UgaWYgKHFwX3R5cGUgPT0gJ3lqJykge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl8yKSA9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVhbF9wbGF5YXJyID0gcGxheWFycl8yO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdncycpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfZ3MpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2dzO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdzbicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfc24pID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3NuO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdobicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfaG4pID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2huO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICd3bCcpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfd2wpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3dsO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdseicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfbHopID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2x6O1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICd3aicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfd2opID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3dqO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICd1aycpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfdWspID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3VrO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdiaicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfYmopID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2JqO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdiZCcpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfYmQpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2JkO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICd4aycpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfeGspID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3hrO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdrYicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfa2IpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2tiO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdzZCcpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfc2QpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3NkO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICd0aycpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfdGspID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3RrO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdzcycpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfc3MpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX3NzO1xcbiAgICAgICAgfSBlbHNlIGlmIChxcF90eXBlID09ICdmZicpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfZmYpID09ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWFsX3BsYXlhcnIgPSBwbGF5YXJyX2ZmO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHJlYWxfcGxheWFycjtcXG4gICAgfVxcblxcblxcbiAgICBmdW5jdGlvbiBnb3BsYXkoaXNjb20sIG4pIHtcXG5cXG4gICAgICAgIHZhciBzbCA9ICcwJztcXG4gICAgICAgIHZhciBkZWZfc2VydmVyID0gMDtcXG4gICAgICAgIHZhciBhaXFpID0gMTtcXG4gICAgICAgIHZhciBxaXlpX3VybCA9ICcnO1xcbiAgICAgICAgdmFyIHNlcmluZGV4ID0gMDtcXG4gICAgICAgIHZhciB6dWlkYSA9IDA7XFxuXFxuICAgICAgICB2YXIgX3FpZXBfMzY1ID0gZ2V0UXVlcnlWYXJpYWJsZSgncXAnKTtcXG4gICAgICAgIGlmIChfcWllcF8zNjUgPT0gZmFsc2UpIF9xaWVwXzM2NSA9ICcnO1xcblxcbiAgICAgICAgdmFyIF9xcF9nZXQgPSAwO1xcbiAgICAgICAgdmFyIHJlYWxfcGxheWFycl9nZXQgPSBudWxsO1xcbiAgICAgICAgdmFyIG9rID0gMDtcXG4gICAgICAgIHZhciBzdHIgPSAnJztcXG5cXG4gICAgICAgIGlmIChfcWllcF8zNjUgIT0gJycpIHtcXG4gICAgICAgICAgICBzZXJpbmRleCA9IDE7XFxuICAgICAgICAgICAgX3FwX2dldCA9IDE7XFxuICAgICAgICAgICAgcmVhbF9wbGF5YXJyX2dldCA9IGdldF9wbGF5X2FycmF5KF9xaWVwXzM2NSk7XFxuXFxuICAgICAgICAgICAgaWYgKHJlYWxfcGxheWFycl9nZXQgIT0gbnVsbCAmJiByZWFsX3BsYXlhcnJfZ2V0ICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIHNlcmluZGV4ID0gMTtcXG4gICAgICAgICAgICAgICAgX3FwX2dldCA9IDE7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKDAgPT0gX3FwX2dldCkge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YobGlhbnphaWpzKSA9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICBsaWFuemFpanMgPSAwO1xcbiAgICAgICAgICAgICAgICBhaXFpID0gMDtcXG4gICAgICAgICAgICAgICAgc2VyaW5kZXggPSAtMTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyXzIpICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIGlmIChzZXJpbmRleCA9PSAtMSkgc2VyaW5kZXggPSAyO1xcbiAgICAgICAgICAgICAgICBpZiAobGlhbnphaWpzXzIgPiBsaWFuemFpanMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxpYW56YWlqcyA9IGxpYW56YWlqc18yO1xcbiAgICAgICAgICAgICAgICAgICAgenVpZGEgPSAyO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl8xKSAhPSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICBpZiAoc2VyaW5kZXggPT0gLTEpIHNlcmluZGV4ID0gMTtcXG4gICAgICAgICAgICAgICAgaWYgKGxpYW56YWlqc18xID4gbGlhbnphaWpzKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaWFuemFpanMgPSBsaWFuemFpanNfMTtcXG4gICAgICAgICAgICAgICAgICAgIHp1aWRhID0gMTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBpZiAodHlwZW9mKHBsX2R5KSA9PSAndW5kZWZpbmVkJykge1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciByZWFsX3BsYXlhcnIgPSBudWxsO1xcbiAgICAgICAgaWYgKF9xcF9nZXQgPT0gMSkge1xcbiAgICAgICAgICAgIHJlYWxfcGxheWFyciA9IHJlYWxfcGxheWFycl9nZXQ7XFxuXFxuICAgICAgICB9IGVsc2Uge1xcblxcbiAgICAgICAgICAgIGlmIChwbF9keSA9PSAzIHx8IHBsX2R5ID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHNlcmluZGV4ID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycikgIT0gJ3VuZGVmaW5lZCcpIHJlYWxfcGxheWFyciA9IHBsYXlhcnI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VyaW5kZXggPT0gMikge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyXzIpICE9ICd1bmRlZmluZWQnKSByZWFsX3BsYXlhcnIgPSBwbGF5YXJyXzI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VyaW5kZXggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyXzEpICE9ICd1bmRlZmluZWQnKSByZWFsX3BsYXlhcnIgPSBwbGF5YXJyXzE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoenVpZGEgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyKSAhPSAndW5kZWZpbmVkJykgcmVhbF9wbGF5YXJyID0gcGxheWFycjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh6dWlkYSA9PSAyKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfMikgIT0gJ3VuZGVmaW5lZCcpIHJlYWxfcGxheWFyciA9IHBsYXlhcnJfMjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh6dWlkYSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfMSkgIT0gJ3VuZGVmaW5lZCcpIHJlYWxfcGxheWFyciA9IHBsYXlhcnJfMTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmIChyZWFsX3BsYXlhcnIgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHN0ciA9IGdldF9wbGlzdF9qcyhwbF9keSwgbiwgcmVhbF9wbGF5YXJyKTtcXG4gICAgICAgIH1cXG5cXG5cXG4gICAgICAgIHZhciB5dW5fYm8gPSAnJztcXG4gICAgICAgIHZhciBhbGxfYm8gPSAnJztcXG4gICAgICAgIHZhciB5Yl91cmwgPSAnJztcXG4gICAgICAgIHZhciBwbGF5dHlwZSA9IDA7XFxuICAgICAgICBpZiAoX3FwX2dldCA9PSAxKSB7XFxuICAgICAgICAgICAgdmFyIHVybF9xcCA9IGdldF9yX3VybChyZWFsX3BsYXlhcnJfZ2V0LCBuKTsgLy/mmK/kuLvnur9cXG5cXG4gICAgICAgICAgICBpZiAoMSA9PSBpc19tX2xpbmUodXJsX3FwKSB8fCAxID09IGlzX21fbGluZV8yKHVybF9xcCkpIHtcXG4gICAgICAgICAgICAgICAgcGxheXR5cGUgPSAwO1xcbiAgICAgICAgICAgICAgICBzbCA9ICcxJ1xcbiAgICAgICAgICAgICAgICBxaXlpX3VybCA9IHVybF9xcDtcXG4gICAgICAgICAgICB9IGVsc2UgLy/mmK/liIfniYdcXG4gICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgIHBsYXl0eXBlID0gMjtcXG4gICAgICAgICAgICAgICAgeXVuX2JvICs9ICcxJztcXG4gICAgICAgICAgICAgICAgeWJfdmlkID0gdXJsX3FwO1xcbiAgICAgICAgICAgICAgICB5Yl92aWQgPSB5Yl92aWQucmVwbGFjZShcXFwiLmNvbVxcXCIsIFxcXCIuY29tNDk3XFxcIik7XFxuICAgICAgICAgICAgICAgIHliX3VybCA9IHliX3VybCArIHliX3ZpZDtcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycikgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZihwbGF5YXJyW25dKSAhPSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICAgICAgc2wgPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYXJyX3RlbXAgPSBwbGF5YXJyW25dLnNwbGl0KCcsJyk7XFxuICAgICAgICAgICAgICAgICAgICBxaXlpX3VybCA9IGFycl90ZW1wWzBdO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl8yKSAhPSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfMltuXSkgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHl1bl9ibyArPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYXJyX3RlbXAgPSBwbGF5YXJyXzJbbl0uc3BsaXQoJywnKTtcXG4gICAgICAgICAgICAgICAgICAgIHliX3ZpZCA9IGFycl90ZW1wWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgeWJfdmlkID0geWJfdmlkLnJlcGxhY2UoXFxcIi5jb21cXFwiLCBcXFwiLmNvbTQ5N1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgeWJfdXJsID0geWJfdXJsICsgeWJfdmlkO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2YocGxheWFycl8xKSAhPSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKHBsYXlhcnJfMVtuXSkgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHl1bl9ibyArPSAnMic7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgYXJyX3RlbXAgPSBwbGF5YXJyXzFbbl0uc3BsaXQoJywnKTtcXG4gICAgICAgICAgICAgICAgICAgIHliX3ZpZCA9IGFycl90ZW1wWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgeWJfdmlkID0geWJfdmlkLnJlcGxhY2UoXFxcIi5jb21cXFwiLCBcXFwiLmNvbTQ5N1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHliX3VybCA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHliX3VybCA9IHliX3ZpZDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgeWJfdXJsID0geWJfdXJsICsgJyQkJCcgKyB5Yl92aWQ7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICAvL2FsZXJ0KGFsbF95Yik7XFxuICAgICAgICB2YXIgdmlkID0gJyc7XFxuICAgICAgICB2YXIgZGVmYXVsdF9saW5lID0gMDtcXG5cXG4gICAgICAgIHZhciB1cmxfc3RyaW5nID0gJyc7XFxuICAgICAgICBtYWluX2xpbmVfbnVsbF9xcF9oYXMgPSAnJztcXG5cXG4gICAgICAgIGlmIChfcXBfZ2V0ID09IDApIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mKGRlZl9saW5lKSAhPSAndW5kZWZpbmVkJykgLy/mmK/lkKbmnInpu5jorqTnur9cXG4gICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHRfbGluZSA9IGRlZl9saW5lO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwZW9mKGxpbmVfYXJyYXkpICE9ICd1bmRlZmluZWQnKSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YobGluZV9hcnJheVtuXSkgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRfbGluZSA9IGxpbmVfYXJyYXlbbl07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICBpZiAoX3FwX2dldCA9PSAxKSB7XFxuICAgICAgICAgICAgdXJsX3N0cmluZyA9IENoZWNrUGxheVR5cGVPa19wbGF5YXJyYXkocmVhbF9wbGF5YXJyX2dldCwgbik7XFxuICAgICAgICAgICAgaWYgKHVybF9zdHJpbmcgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgb2sgPSAxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSAvL+S4u+e6v+S4jeW4puWPguaVsOeahFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHVybF9zdHJpbmcgPSBDaGVja1BsYXlUeXBlT2socGxheXR5cGUsIG4pO1xcbiAgICAgICAgICAgIGlmIChtYWluX2xpbmVfbnVsbF9xcF9oYXMgIT0gJycpIHtcXG4gICAgICAgICAgICAgICAgcGxheXR5cGUgPSAyO1xcbiAgICAgICAgICAgICAgICBfcWllcF8zNjUgPSBtYWluX2xpbmVfbnVsbF9xcF9oYXM7XFxuICAgICAgICAgICAgICAgIHZhciBhcnJfdGVtcCA9IG1haW5fbGluZV9udWxsX3FwX2hhc19xcF9zdHJpbmcuc3BsaXQoJywnKTtcXG4gICAgICAgICAgICAgICAgdXJsX3FwID0gYXJyX3RlbXBbMF07XFxuICAgICAgICAgICAgICAgIHl1bl9ibyA9ICcxJztcXG4gICAgICAgICAgICAgICAgeWJfdmlkID0gdXJsX3FwO1xcbiAgICAgICAgICAgICAgICB5Yl92aWQgPSB5Yl92aWQucmVwbGFjZShcXFwiLmNvbVxcXCIsIFxcXCIuY29tNDk3XFxcIik7XFxuICAgICAgICAgICAgICAgIHliX3VybCA9IHliX3VybCArIHliX3ZpZDtcXG5cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICB9XFxuXFxuXFxuICAgICAgICB2YXIgdHlwZTExID0gJyc7XFxuICAgICAgICB2YXIgcmVhbF9qaV9zdHJpbmcgPSAnJztcXG4gICAgICAgIGlmICh1cmxfc3RyaW5nICE9ICcnKSB7XFxuICAgICAgICAgICAgdmFyIGFyciA9IHVybF9zdHJpbmcuc3BsaXQoJywnKTtcXG4gICAgICAgICAgICB2aWQgPSBhcnJbMF07XFxuICAgICAgICAgICAgdHlwZTExID0gYXJyWzFdO1xcbiAgICAgICAgICAgIHJlYWxfamlfc3RyaW5nID0gYXJyWzJdO1xcbiAgICAgICAgfVxcblxcblxcbiAgICAgICAgdmFyIGFsbF95YiA9IGdldF9vdGhfbGluZShfcWllcF8zNjUsIG4sIHJlYWxfamlfc3RyaW5nKTtcXG4gICAgICAgIHZhciBub3dfamlfMCA9IG47XFxuICAgICAgICBpZiAoX3FwX2dldCA9PSAxKSB7XFxuICAgICAgICAgICAgbm93X2ppXzAgPSAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBzdHJfbWFpbjAgPSBnZXRfbWFpbl8wKG5vd19qaV8wKTtcXG4gICAgICAgIC8vbG9nKHN0cl9tYWluMClcXG4gICAgICAgIC8qaWYgKHN0cl9tYWluMCA9PSAnJykge1xcbiAgICAgICAgICAgIGxvZygnaGlkZSgpJylcXG4gICAgICAgICAgICAvLyAkKCcjdGFiMTEnKS5oaWRlKCk7XFxuICAgICAgICB9Ki9cXG5cXG4gICAgICAgIC8vaWYgKCQoJy5kcmFtYU51bUxpc3QnKS5sZW5ndGgg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A9IDEwO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChxaXlpX3VybC5pbmRleE9mKCd0Y3BzcGMuY29tJykgPiAwKSB7XFxuICAgICAgICAgICAgICAgIGlmIChxaXlpX3VybC5pbmRleE9mKCdzaGFyZScpID4gMCkgZGVmYXVsdF9saW5lID0gOTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHFpeWlfdXJsLmluZGV4T2YoJ2d1aWppMzY1LmNvbS9zaGFyZScpID4gMCkge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0X2xpbmUgPSA5O1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocWl5aV91cmwuaW5kZXhPZignLmpwZycpID4gMCkge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0X2xpbmUgPSAxMDtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHFpeWlfdXJsLmluZGV4T2YoJ3BsYXllci5zMTkwNS5jb20nKSA+IDApIHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdF9saW5lID0gOTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHFpeWlfdXJsLmluZGV4T2YoJ3FpZ2FpdHVhbi5jb20nKSA+IDApIHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdF9saW5lID0gOTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHFpeWlfdXJsLmluZGV4T2YoJzc0NHp5LmNvbS9zaGFyZScpID4gMCkge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0X2xpbmUgPSA5O1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocWl5aV91cmwuaW5kZXhPZigncGFuLmppbmluZ3dhbmp1bi5jb20nKSA+IDApIHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdF9saW5lID0gOTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgaWYgKHBsYXl0eXBlID09IDEgfHwgcGxheXR5cGUgPT0gMikge1xcbiAgICAgICAgICAgIC8vJChcXFwiI3Nob3d5dWJvXFxcIikudGV4dChcXFwi5LqR5pKt5Yqg6L295oWiLOWkmueCueWHu+WHoOasoeWQjueojeetiVxcXCIpO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKHR5cGVvZihoX290aGVyXykgPT0gJ3VuZGVmaW5lZCcpIGhfb3RoZXJfID0gJyc7XFxuXFxuICAgICAgICAvL25hdmlnYXRvci51c2VyQWdlbnQudG9Mb3dlckNhc2UoKTtcXG5cXG4gICAgICAgIHZhciBpc19hbF9wID0gMDtcXG4gICAgICAgIHZhciBzVXNlckFnZW50ID0gTU9CSUxFX1VBO1xcbiAgICAgICAgaWYgKHNVc2VyQWdlbnQuaW5kZXhPZignbXFxYnJvd3NlcicpID4gMCB8fCBzVXNlckFnZW50LmluZGV4T2YoJ3VjYnJvd3NlcicpID4gMCB8fCBzVXNlckFnZW50LmluZGV4T2YoJ21pdWlicm93c2VyJykgPiAwKSB7XFxuICAgICAgICAgICAgaXNfYWxfcCA9IDE7XFxuICAgICAgICB9XFxuXFxuXFxuICAgICAgICAvL3ZhciBtb2JpbGVfc3R5bGUgPSAnIHN0eWxlPVxcXCJwb3NpdGlvbjphYnNvbHV0ZTt6LWluZGV4OjM7XFxcIic7XFxuICAgICAgICB2YXIgY3BfdGV4dCA9ICcmY3A9MCc7XFxuICAgICAgICBfczJfZHBsYXllcl8yID0gdW5lc2NhcGUoX3MyX2RwbGF5ZXJfMik7XFxuICAgICAgICBfczJfZHBsYXllcl8yX21iID0gdW5lc2NhcGUoX3MyX2RwbGF5ZXJfMl9tYik7XFxuICAgICAgICB2YXIgZHBmaWxlID0gX3MyX2RwbGF5ZXJfMl9tYjtcXG4gICAgICAgIGlmIChpc2NvbSA9PSAxKSB7XFxuICAgICAgICAgICAgZHBmaWxlID0gX3MyX2RwbGF5ZXJfMjtcXG4gICAgICAgICAgICByX2hlaWdodCA9ICcxMDAlJztcXG4gICAgICAgICAgICAvL21vYmlsZV9zdHlsZS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wuaW5kZXhPZignZ3VpamkzNjUuY29tJykgPiAwKSB7XFxuICAgICAgICAgICAgaWYgKGxpbmt1cmwuaW5kZXhPZignc2hhcmUnKSA+IDApIHJldHVybiBodG1sXzlfbGluZSArIGxpbmt1cmw7XFxuICAgICAgICB9IGVsc2UgaWYgKGxpbmt1cmwuaW5kZXhPZignY3JlYXRpdmVtYXMuY24vc2hhcmUnKSA+IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gaHRtbF85X2xpbmUgKyBsaW5rdXJsO1xcbiAgICAgICAgfSBlbHNlIGlmIChsaW5rdXJsLmluZGV4T2YoJ3Bhbi5qaW5pbmd3YW5qdW4uY29tJykgPiAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGh0bWxfOV9saW5lICsgbGlua3VybDtcXG4gICAgICAgIH0gZWxzZSBpZiAobGlua3VybC5pbmRleE9mKCdxaWdhaXR1YW4uY29tJykgPiAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGh0bWxfOV9saW5lICsgbGlua3VybDtcXG4gICAgICAgIH0gZWxzZSBpZiAobGlua3VybC5pbmRleE9mKCc3NDR6eS5jb20nKSA+IDApIHtcXG4gICAgICAgICAgICBpZiAobGlua3VybC5pbmRleE9mKCdzaGFyZScpID4gMCkgcmV0dXJuIGh0bWxfOV9saW5lICsgbGlua3VybDtcXG4gICAgICAgIH0gZWxzZSBpZiAobGlua3VybC5pbmRleE9mKCcubTN1OCcpIDw9IDAgJiYgbGlua3VybC5pbmRleE9mKCcubXA0JykgPD0gMCkge1xcbiAgICAgICAgICAgIGlmIChsaW5rdXJsLmluZGV4T2YoJyUyRnNoYXJlJTJGJykgPiAwKSByZXR1cm4gaHRtbF85X2xpbmUgKyBsaW5rdXJsO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuICcnO1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGdldF91cmxfcGFyc2UobGlua3VyKSB7XFxuICAgICAgICB2YXIgaGogPSBsaW5rdXIu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5kZXhPZignLnNzZG0uY2MnKSAhPSAtMSkge1xcbiAgICAgICAgICAgIHJldHVybiBodG1sX2FsaXBsYXllcmVfMiArIGxpbmt1cjtcXG4gICAgICAgIH0gZWxzZSBpZiAobGlua3VyLmluZGV4T2YoJ3YyLnlpeml5eS5jb20nKSAhPSAtMSkge1xcbiAgICAgICAgICAgIHJldHVybiBodG1sX2FsaXBsYXllcmVfMiArIGxpbmt1cjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaWYgKGlzX2FsX3AgPT0gMSkgcmV0dXJuIHBhcnNldXJsX3VybCArIGxpbmt1cjtcXG4gICAgICAgICAgICBlbHNlIHJldHVybiBodG1sX2FsaXBsYXllcmVfMiArIGxpbmt1cjtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBnZXRfcXBfbmFtZTQ0KHFwX3R5cGUpIHtcXG4gICAgICAgIGlmIChxcF90eXBlID09ICd6ZCcpIHJldHVybiAn5pyA5aSnJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICd5aicpIHJldHVybiAn5rC45LmFJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICdobicpIHJldHVybiAn54mb54mbJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICdncycpIHJldHVybiAn5YWJ5rOiJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICdzbicpIHJldHVybiAn5paw5pyXJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICd3bCcpIHJldHVybiAn5rah6L2uJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICdseicpIHJldHVybiAn6Imv5a2QJztcXG4gICAgICAgIGlmIChxcF90eXBlID09ICdmcycpIHJldHVybiAnRumAnyc7XFxuICAgICAgICBpZiAocXBfdHlwZSA9PSAnYmQnKSByZXR1cm4gJ+eZvuW6pic7XFxuICAgICAgICBpZiAocXBfdHlwZSA9PSAndWsnKSByZXR1cm4gJ+mFt1UnO1xcbiAgICAgICAgaWYgKH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SgpLmdldERheSgpXFxuICAgICAgICB2YXIgd2VlayA9IGdldE15VmFyKCd3ZWVrJywgZGF5ICsgJycpXFxuICAgICAgICB3ZSA9IOekvOaLnFt3ZWVrXVxcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCDnpLzmi5wubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogd2VlayA9PSBpID8gJ+KAnOKAnOKAneKAnScgKyBkYXluaWdodCArIGA8Zm9udCBjb2xvcj1cXFwiJHt3Y29sb3J9XFxcIj48Yj5gICsgd3N0ciArIHdlICsgJzwvYj48L2ZvbnQ+JyA6IOekvOaLnFtpXSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIndlZWtcXFwiLCBOdW1iZXIoaXQpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnd2VlaycgKyBpLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBwaWM6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBcXFwiZ29vZFxcXCJcXG4gICAgICA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zLmRlc2NcXG4gICAgdmFyIHVybCA9IHNlbGVjdHMudXJsXFxuICAgIHZhciBjb2xfdHlwZSA9IHNlbGVjdHMuY29sX3R5cGVcXG4gICAgXFxuXFxuICAgIHZhciBsaXN0ID0gZXZhbChsaXN0KVxcbiAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBsaW5lID09IHRydWUpIHtcXG4gICAgICAgIHRocm93ICdFcnJvcjrmsqHmnInkuoYnXFxuICAgICAgICByZXR1cm5cXG4gICAgfVxcblxcblxcbiAgICBsaXN0LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICB2YXIgaW1nID0gZXZhbChpbWd4KVxcbiAgICAgICAgLy9sb2coaXRlbSlcXG4gICAgICAgIHZhciBhcnIgPSB7XFxuICAgICAgICAgICAgdGl0bGU6IGV2YWwodGl0bGUpLFxcbiAgICAgICAgICAgIGRlc2M6IGV2YWwoZGVzYyksXFxuICAgICAgICAgICAgLy9pbWc6IChpbWcuZW5kc1dpdGgoJzAnKSA/IGltZyArICcvJyA6IGltZykgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICBpbWc6IGltZyArICdAUmVmZXJlcj0nLFxcbiAgICAgICAgICAgIHVybDogZXZhbCh1cmwpICsgJyNpbW1lcnNpdmVUaGVtZSMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBjb2xfdHlwZSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZXZhbCh0aXRsZSksXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBzdGF0ZTogZXZhbChkZXNjKSxcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoZHljKSB7XFxuICAgICAgICAgICAgaWYgKGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgYXJyLmV4dHJhLmlkID0gJ3ZpZGVvMSdcXG4gICAgICAgICAgICAgICAgZC5wdXNoKGFycilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyLmV4dHJhLmlkID0gJ3ZpZGVvMidcXG4gICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ3ZpZGVvMScsIGFycik7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGQucHVzaChhcnIpXFxuICAgICAgICB9XFxuICAgIH0pXFxuICAgIGlmIChsaW5lKSB7XFxuICAgICAgICBpKytcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ2FsaW5lJyArIGkudG9TdHJpbmcoKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBwdXRNeVZhcignaScsIGkpXFxuICAgIH1cXG4gICAgXFxufVxcblxcbmZ1bmN0aW9uIGp1bXBNb3JlKGQsIGh0bWwsIG9iaikge1xcblxcbiAgICB2YXIgbmFtZSA9IG9iai5uYW1lXFxuICAgIHZhciB0aXRsZSA9IG9iai50aXRsZVxcbiAgICB2YXIgaW1nID0gb2JqLmltZ1xcbiAgICB2YXIgdXJsID0gb2JqLnVybFxcbiAgICB2YXIgc2VsZXMgPSBvYmouc2VsZXNcXG4gICAgc2VsZXMubGlzdCA9IG9iai5ubGlzdFxcblxcbiAgICBpZiAobmFtZSAhPSB1bmRlZmluZWQpIHtcXG5cXG4gICAgICAgIGxldCBkbSA9IDA7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB2YXIgYiA9IChuZXcgUmVnRXhwKGBeJHtuYW1lfSRgKS50ZXN0KGRbaV0udGl0bGUpKVxcbiAgICAgICAgICAgIGlmIChiKSB7XFxuICAgICAgICAgICAgICAgIGRtID0gaTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiA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mFtZSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBhcnIucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgdXJsOiAnXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIiArIGlucHV0ICsgXFxcIiZydWxlPVxcXCIrTVlfUlVMRS50aXRsZSAnLFxcbiAgICAgICAgZGVzYzogXFxcIuaQnOeCueS7gOS5iC4uLlxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKHJ1bGVfbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgc3VnID0gY29uZmlnLnN1ZyB8fCBbXTtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBzdWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oc3VnW2ldKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gJycpIGRlbGV0ZUl0ZW1CeUNscyhcXFwiI3NcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gJ+a4hemZpOaQnOe0ouiusOW9lScpIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS/mkJzntKLorrDlvZUuanNvbicsICcnKTtcXG4gICAgICAgICAgICAgICAgICAgIGluaXRDb25maWcoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1ZzogW2lucHV0XVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBodHRwLmZldGNoKGBodHRwczovL20uZG91YmFuLmNvbS9zZWFyY2gvP3F1ZXJ5PSR7aW5wdXR9JnR5cGU9MTAwMmAsIHt9KS5zdWNjZXNzKGRhdGEgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGdnID0gSlNPTi5wYXJzZShkYXRhLnNwbGl0KCdmblxcXFwoJylbMV0ucmVwbGFjZSgnXFxcXH1cXFxcKScsICdcXFxcfScpKS5pdGVtO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShkYXRhLCAnYm9keSYmLnNlYXJjaC1tb2R1bGUmJmxpJiZhOm5vdChbaHJlZio9XFxcImphdmFzY3JpcHRcXFwiXSknKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnZyA9IGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKHgsICcuc3ViamVjdC10aXRsZSYmVGV4dCcpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbWcgPSBwZGZoKHgsICdpbWcmJnNyYycpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3JkOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRjOiBpbWdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZ2cpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCflu7rorq7mlbDmja4nLCBnZylcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGQgPSBnZy5zbGljZSgwLCAzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0ocnVsZV9uYW1lICsgJ+W7uuiurua1t+aKpScsIGRkLm1hcCh4ID0+IHguZGMpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKHJ1bGVfbmFtZSArICflu7rorq7niYflkI0nLCBkZC5tYXAoeCA9PiB4LndvcmQpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGQubWFwKCh4LCBpKSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKCdpbWcnICsgaSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogeC5kYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3NlYXJjaD9zPScgKyB4LndvcmQgKyAnJnJ1bGU9JyArIHJ1bGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogJ2ltZycgKyBpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KS5lcnJvcihtc2cgPT4gbG9nKG1zZy50b1N0cmluZygpKSkuc3RhcnQobG9nKDIpKVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGdnID0gSlNPTi5wYXJzZShnZXRWYXIoJ+W7uuiuruaVsOaNricpKTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiI3NcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gZ2cpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbm4gPSBnZ1tpXS53b3JkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihcXFwiMTJpbnB1dFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG5uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKG5uLCBydWxlX25hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsb2NhbERhdGEgPSByZXF1ZXN0KCdoaWtlcjovL2ZpbGVzL2NhY2hlL+aQnOe0ouiusOW9lS5qc29uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxvY2FsRGF0YSkgbG9jYWxEYXRhID0gXFxcIltdXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXNoaSA9IEpTT04ucGFyc2UobG9jYWxEYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjY2MgPSBsaXNoaS5pbmRleE9mKG5uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjY2MgPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc2hpLnNwbGljZShjY2MsIDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzaGkucHVzaChubik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXNoaSA9IGxpc2hpLnNsaWNlKC0zKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS/mkJzntKLorrDlvZUuanNvbicsIEpTT04uc3RyaW5naWZ5KGxpc2hpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3M9JyArIG5uICsgJyZydWxlPScgKyBydWxlX25hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbm4sIHJ1bGVfbmFtZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcIiNzXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+m7mOiupFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvY2FsRGF0YSA9IHJlcXVlc3QoJ2hpa2VyOi8vZmlsZXMvY2FjaGUv5pCc57Si6K6w5b2VLmpzb24nKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghbG9jYWxEYXRhKSBsb2NhbERhdGEgPSBcXFwiW11cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc2hpID0gSlNPTi5wYXJzZShsb2NhbERhdGEpLnNsaWNlKC0zKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zdWcgPSBsaXNoaTtcXG4gICAgICAgICAgICAgICAgICAgIGluaXRDb25maWcoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1ZzogY29uZmlnLnN1Z1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBjb25maWcuc3VnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCIxMmlucHV0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vc2VhcmNoP3M9JyArIGl0ICsgJyZydWxlPScgKyBydWxlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcIiNzXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBydWxlX25hbWUpLFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgaWQ6IFxcXCIxMmlucHV0XFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7XFxuICAgICAgICBhcnIucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgLy9zZXRSZXN1bHQoZClcXG59XFxuXFxuaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICDmkJzntKLlu7rorq4oZCwgJ+a1t+aKpeW8gCcpXFxufVxcblxcbnNldEhvbWVSZXN1bHQoZClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaXp+e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OiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIndlZWtcXFwiLCBOdW1iZXIoaXQpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnd2VlaycgKyBpLFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBwaWM6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBcXFwiZ29vZFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcblxcbiAgICAgICAgZGF0YVt3ZWVrXS5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICAgICAgdmFyIHQgPSBwZGZoKHgsICdhJiZ0aXRsZScpXFxuICAgICAgICAgICAgdmFyIHMgPSBwZGZoKHgsICdzcGFuJiZUZXh0JylcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogYOKAnOKAnOKAneKAnTxzbWFsbD5bPGZvbnQgY29sb3I9XFxcIiM5OTlcXFwiPiR7c308L2ZvbnQ+XSR7dH08L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgIHVybDogcGQoeCwgJ2EmJmhyZWYnKSArICcjaW1tZXJzaXZlVGhlb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xcXG4gICAgICAgICAgICAvL2ltZzogKGltZy5lbmRzV2l0aCgnMCcpID8gaW1nICsgJy8nIDogaW1nKSArICdAUmVmZXJlcj0nLFxcbiAgICAgICAgICAgIGltZzppbWcrJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiBldmFsKHVybCkgKyAnI2ltbWVyc2l2ZVRoZW1lIycsXFxuICAgICAgICAgICAgY29sX3R5cGU6IGNvbF90eXBlLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBldmFsKHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIHN0YXRlOiBldmFsKGRlc2MpLFxcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChkeWMpIHtcXG4gICAgICAgICAgICBpZiAoaWkgPT0gMSkge1xcbiAgICAgICAgICAgICAgICBhcnIuZXh0cmEuaWQgPSAndmlkZW8xJ1xcbiAgICAgICAgICAgICAgICBkLnB1c2goYXJyKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIuZXh0cmEuaWQgPSAndmlkZW8yJ1xcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigndmlkZW8xJywgYXJyKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKGFycilcXG4gICAgICAgIH1cXG4gICAgfSlcXG4gICAgaWYgKGxpbmUpIHtcXG4gICAgICAgIGkrK1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiAnYWxpbmUnICsgaS50b1N0cmluZygpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHB1dE15VmFyKCdpJywgaSlcXG4gICAgfVxcbn1cXG5c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gICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnc2hvdycsICfmlLbotbcnKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBzaG93KSxcXG4gICAgICAgICAgICBzaG93OiBzaG93LFxcbiAgICAgICAgICAgIHdjb2xvcjogZ2V0UmFuZ2VDb2xvcnMoKSxcXG4gICAgICAgICAgICB3c3RyOiAn5pif5pyfJyxcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHdlZWtBcHBlbmQoZCwgb2JqKVxcblxcblxcbiAgICAgICAgdmFyIGFjZyA9IHtcXG4gICAgICAgICAgICBuYW1lOiAn5Yqo5ryrJyxcXG4gICAgICAgICAgICBzZWxlczogc2VsZWN0cyxcXG4gICAgICAgICAgICBubGlzdDogXFxcInBkZmEoaHRtbCwnYm9keSYmLm1iOmhhcyhbaHJlZio9YWNnXSknKVxcXCIsXFxuICAgICAgICAgICAgdGl0bGU6IGDliqjmvKske3N0clJlcGVhdCgnXFxcXHQnLDM3KX1b5pu05aSaXWAsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZycsXFxuICAgICAgICB9XFxuICAgICAgICBqdW1wTW9yZShkLCBodG1sLCBhY2cpXFxuXFxuICAgICAgICB2YXIgdHYgPSB7XFxuICAgICAgICAgICAgbmFtZTogJ+eUteinhuWJpycsXFxuICAgICAgICAgICAgc2VsZXM6IHNlbGVjdHMsXFxuICAgICAgICAgICAgbmxpc3Q6IFxcXCJwZGZhKGh0bWwsJ2JvZHkmJi5tYjpoYXMoW2hyZWYqPXR2XSknKVxcXCIsXFxuICAgICAgICAgICAgdGl0bGU6IGDnlLXop4bliacke3N0clJlcGVhdCgnXFxcXHQnLDM1KX1b5pu05aSaXWAsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZycsXFxuICAgICAgICB9XFxuICAgICAgICBqdW1wTW9yZShkLCBodG1sLCB0dilcXG5cXG4gICAgICAgIHZhciBtdiA9IHtcXG4gICAgICAgICAgICBuYW1lOiAn55S15b2xJyxcXG4gICAgICAgICAgICBzZWxlczogc2VsZWN0cyxcXG4gICAgICAgICAgICBubGlzdDogXFxcInBkZmEoaHRtbCwnYm9keSYmLm1iOmhhcyhbaHJlZio9bW92XSknKVxcXCIsXFxuICAgICAgICAgICAgdGl0bGU6IGDnlLXlvbEke3N0clJlcGVhdCgnXFxcXHQnLDM3KX1b5pu05aSaXWAsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZycsXFxuICAgICAgICB9XFxuICAgICAgICBqdW1wTW9yZShkLCBodG1sLCBtdilcXG5cXG4gICAgICAgIHZhciB6eSA9IHtcXG4gICAgICAgICAgICBuYW1lOiAn57u86Im6JyxcXG4gICAgICAgICAgICBzZWxlczogc2VsZWN0cyxcXG4gICAgICAgICAgICBubGlzdDogXFxcInBkZmEoaHRtbCwnYm9keSYmLm1iOmhhcyhbaHJlZio9em9uZ3lpXSknKVxcXCIsXFxuICAgICAgICAgICAgdGl0bGU6IGDnu7zoiboke3N0clJlcGVhdCgnXFxcXHQnLDM3KX1b5pu05aSaXWAsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZycsXFxuICAgICAgICB9XFxuICAgICAgICBqdW1wTW9yZShkLCBodG1sLCB6eSlcXG5cXG4gICAgfVxcblxcbiAgICAvL2FwcGVkRGF0YShkLCBodG1sLCBzZWxlY3RzMSlcXG5cXG5cX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ZvbnQgY29sb3I9J2dyYXknPuWIsOW6leS6hjxmb250PlxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICdsYXN0aWQnXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbn1cXG5cXG5cXG5zZXRSZXN1bHQoZCk7XCJ9XSIsImljb24iOiJodHRwOi8veWhkbTgxLmNvbS9mYXZpY29uLmljbyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment