xiaomianao666

小程序:厂长

May 18th, 2024
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@厂长@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IuWOgumVvyIsImF1dGhvciI6IuW/g+mtlCIsInVybCI6Imhpa2VyOi8vZW1wdHkjI2h0dHBzOi8vd3d3LmN6eXMudG9wL2RidG9wMjUwL3BhZ2UvZnlwYWdlIiwidmVyc2lvbiI6NiwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXTtcbnZhciBnZXRSYW5nZUNvbG9ycyA9IGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiAnIycgKyAoJzAwMDAwJyArIChNYXRoLnJhbmRvbSgpICogMHgxMDAwMDAwIDw8IDApLnRvU3RyaW5nKDE2KSkuc3Vic3RyKC02KTtcbn1cblxuY29uc3Qg5YiG57G76aKc6ImyID0gZ2V0UmFuZ2VDb2xvcnMoKVxuY29uc3Qg5aSn57G75a6a5L2NID0gJ2JvZHkmJi5uYXZsaXN0J1xuLy9jb25zdCDmi7zmjqXliIbnsbsgPSAnYm9keSYmLmN0LmZvbGxvdy1hbGlnbidcbmNvbnN0IOWwj+exu+WumuS9jSA9ICdib2R5JiZhOm5vdCg6bWF0Y2hlcyjpppbpobV85LuK5pel5pu05pawfOeDreamnHxBUFB856aP5YipfOeDremXqHzmjpLooYx85YWsfOWumHzlnLDlnYApKSdcbmNvbnN0IOWIhuexu+agh+mimCA9ICd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W9kdWxlLXNlYXJjaC1pdGVtJyk7XHJcbmZvciAodmFyIGogaW4gbGlzdCkge1xyXG4gIGQucHVzaCh7XHJcbiAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdpbWcmJmFsdCcpLFxyXG4gICAgICAgZGVzYzogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICcudmlkZW8taW5mby1tYWluJiYudmlkZW8taW5mby1pdGVtczpjb250YWlucyjkuLvmvJTvvJopJiZUZXh0JyksXG4gICAgICAgY29udGVudDogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICcudmlkZW8taW5mby1tYWluJiYudmlkZW8taW5mby1pdGVtczpjb250YWlucyjliafmg4XvvJopJiZUZXh0JyksXG4gICAgICAgaW1nOiBwYXJzZURvbShsaXN0W2pdLCAnLmxhenlsb2FkJiZkYXRhLXNyYycpKydAUmVmZXJlcj0nLFxuICAgICAgIGV4dHJhOiB7ICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICBteXRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2ltZyYmYWx0JykgICAgICAgICAgICAgICBcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdoMyYmYSYmaHJlZicpK1wiI2ltbWVyc2l2ZVRoZW1lI1wiXG4gIH0pO1xyXG59XHJcbnNldFJlc3VsdChkKTtcbmlmICgv57O757uf5a6J5YWo6aqM6K+BLy50ZXN0KGh0bWwpKSB7XG4gICAgc2hvd0xvYWRpbmcoXCLpqozor4HnoIHor4bliKvkuK3vvIzor7fnqI3nrYlcIik7XG4gICAgbGV0IHZjb2RlID0g6I635Y+W6aqM6K+B56CBKCdodHRwczovL3d3dy42MDgweXkxLmNvbS9pbmRleC5waHAvYWpheC92ZXJpZnlfY2hlY2s/dHlwZT1zZWFyY2gmdmVyaWZ5PScgKyBNYXRoLnJvdW5kKCkpO1xuICAgIGxvZygn6I635Y+W6aqM6K+B56CBOicgKyB2Y29kZSk7XG4gICAgbGV0IHJldCA9IOaPkOS6pOmqjOivgeeggSgnaHR0cHM6Ly93d3cuNjA4MHl5MS5jb20vaW5kZXgucGhwL2FqYXgvdmVyaWZ5X2NoZWNrP3R5cGU9c2VhcmNoJnZlcmlmeT0nICsgdmNvZGUsIGZhbHNlLCBmYWxzZSwge30pO1xuICAgIGhpZGVMb2FkaW5nKCk7XG4gICAgLy9sb2cocmV0KVxuICAgIGlmICgvXCJtc2dcIi8udGVzdChyZXQpICYmIC9cIm9rXCIvLnRlc3QocmV0KSkge1xuICAgICAgICAvLyByZWZyZXNoUGFnZSh0cnVlKTtcbiAgICAgICAgaHRtbCA9IOiOt+WPlua6kOeggShNWV9VUkwpO1xuICAgICAgICAvL2xvZyhodG1sKTtcbiAgICAgICAgaWYgKC/or7fkuI3opoHpopHnuYHmk43kvZwvLnRlc3QoaHRtbCkpIHtcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pCc57Si6Ze06ZqUNeenkicsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxuICAgICAgICAgICAgICAgIHVybDogJ3RvYXN0Oi8v55a877yB5Yir54K577yBJ1xuICAgICAgICAgICAgfV0pO1xuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgLy9sb2coJ+mqjOivgeacqumAmui/hzonK3JldCk7XG4gICAgICAgIHNldFJlc3VsdChbe1xuICAgICAgICAgICAgdGl0bGU6ICfpqozor4HmnKrpgJrov4fvvIzor7flsJ3or5Xph43mlrDmkJzntKInLFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxuICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/nlrzvvIHliKvngrnvvIEnXG4gICAgICAgIH1dKTtcbiAgICB9XG59IiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG52YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcblxudmFyIGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XG4gICAgdHJ5IHtcbiAgICAgICAgZnVuY3Rpb24gdG9VcmwocGxheVVybCkge1xuICAgICAgICAgICAgaWYgKC9tZ3R2fHNvaHUvLnRlc3QocGxheVVybCkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybCArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApfVwiO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvYmlsaS8udGVzdChwbGF5VXJsKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBwbGF5VXJsICsgXCI7e1VzZXItQWdlbnRATW96aWxsYS81LjAmJlJlZmVyZXJAaHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tfVwiO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgvaXhpZ3VhLy50ZXN0KHBsYXlVcmwpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmwgKyBcIiNpc1ZpZGVvPXRydWUjXCIgKyBcIiMubXA0O3tSZWZlcmVyQGh0dHBzOi8vd3d3Lml4aWd1YS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVwiO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dCwge30pO1xuICAgICAgICB2YXIgcGxheWVyX2RhdGEgPSBKU09OLnBhcnNlKGh0bWwubWF0Y2goL3IgcGxheWVyXy4qPz0oLio/KTwvKVsxXSk7XG4gICAgICAgIHZhciBmcm8gPSBwbGF5ZXJfZGF0YS5mcm9tO1xuICAgICAgICB2YXIgcGxheVVybCA9IHBsYXllcl9kYXRhLnVybDtcblxuXG4gICAgICAgIGlmIChwbGF5ZXJfZGF0YS5lbmNyeXB0ID09ICcxJykge1xuICAgICAgICAgICAgcGxheVVybCA9IHVuZXNjYXBlKHBsYXllcl9kYXRhLnVybCk7XG4gICAgICAgIH0gZWxzZSBpZiAocGxheWVyX2RhdGEuZW5jcnlwdCA9PSAnMicpIHtcbiAgICAgICAgICAgIHBsYXlVcmwgPSB1bmVzY2FwZShiYXNlNjREZWNvZGUocGxheWVyX2RhdGEudXJsKSk7XG4gICAgICAgIH07XG4gICAgICAgIHZhciBleGNsdWRlID0gL3BsYXltM3U4fG0zdThcXC50dnxtaW5cXC5jc3N8NDA0XFwubTN1OHxcXC5jc3MvO1xuICAgICAgICB2YXIgY29udGFpbiA9IC9cXC5tcDR8XFwubTN1OHxcXC5mbHZ8XFwuYXZpfFxcLm1wZWd8XFwud212fFxcLm1vdnxcXC5ybXZifFxcLmRhdHxxcUJGZG93bmxvYWR8bWltZT12aWRlbyUyRnx2aWRlb19tcDQvO1xuICAgICAgICBpZiAoIWV4Y2x1ZGUudGVzdChwbGF5VXJsKSAmJiBjb250YWluLnRlc3QocGxheVVybCkpIHtcbiAgICAgICAgICAgIHJldHVybiB0b1VybChwbGF5VXJsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBqeFVybCA9ICcnO1xuICAgICAgICB2YXIganhIdG1sID0gcmVxdWVzdChqeFVybCwge1xuICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIk1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApXCJcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtZXRob2Q6IFwiR0VUXCJcbiAgICAgICAgfSk7XG4gICAgICAgIGV2YWwoanhIdG1sLm1hdGNoKC92YXIgY29uZmlnID0ge1tcXHNcXFNdKj99LylbMF0gKyBcIlwiKTtcbiAgICAgICAgdmFyIGFwaVVybCA9ICcnO1xuICAgICAgICB2YXIgYXBpSHRtbCA9IHJlcXVlc3QoYXBpVXJsLCB7XG4gICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgXCJVc2VyLUFnZW50XCI6IFwiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMClcIlxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJvZHk6IFwidXJsPVwiICsgY29uZmlnLnVybCArIFwiJnRpbWU9XCIgKyBjb25maWcudGltZSArIFwiJmtleT1cIiArIGNvbmZpZy5rZXksXG4gICAgICAgICAgICBtZXRob2Q6IFwiUE9TVFwiXG4gICAgICAgIH0pO1xuICAgICAgICB2YXIganNvbiA9IEpTT04ucGFyc2UoYXBpSHRtbCk7XG4gICAgICAgIGlmIChqc29uLmNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBwbGF5VXJsID0ganNvbi51cmw7XG4gICAgICAgICAgICByZXR1cm4gdG9VcmwocGxheVVybCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJyArIGpzb24ubXNnO1xuICAgICAgICB9XG5cbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIC8vc2V0RXJyb3IoZSk7XG4gICAgICAgIHNob3dMb2FkaW5nKFwi5q2j5Zyo6L+b6KGM5qOA57Si77yM6K+356iN5YCZLi4uXCIpO1xuICAgICAgICB2YXIgdmlkZW8gPSAneDVSdWxlOi8vJyArIGlucHV0ICsgJ0AnICsgJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICAvL2ZiYS5sb2coZmJhLmdldFVybHMoKSlcbiAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKVxuICAgICAgICAgICAgdmFyIGV4Y2x1ZGUgPSAvcGxheW0zdTh8bTN1OFxcLnR2fG1pblxcLmNzc3w0MDRcXC5tM3U4fFxcLmNzcy87XG4gICAgICAgICAgICB2YXIgY29udGFpbiA9IC9cXC5tcDR8XFwubTN1OHxcXC5mbHZ8XFwuYXZpfFxcLm1wZWd8XFwud212fFxcLm1vdnxcXC5ybXZifFxcLmRhdHxxcUJGZG93bmxvYWR8bWltZT12aWRlbyUyRnx2aWRlb19tcDQvO1xuICAgICAgICAgICAgZm9yICh2YXIgaSBpbiB1cmxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFleGNsdWRlLnRlc3QodXJsc1tpXSkgJiYgY29udGFpbi50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIGZ5X2JyaWRnZV9hcHAubG9nKHVybHNbaV0pXG4gICAgICAgICAgICAgICAgICAgIGlmICgvbWd0dnxzb2h1Ly50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApfVwiO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9iaWxpLy50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wJiZSZWZlcmVyQGh0dHBzOi8vd3d3LmJpbGliaWxpLmNvbX1cIjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvaXhpZ3VhLy50ZXN0KHVybHNbaV0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXSArIFwiI2lzVmlkZW89dHJ1ZSNcIiArIFwiIy5tcDQ7e1JlZmVyZXJAaHR0cHM6Ly93d3cuaXhpZ3VhLmNvbS8mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XCI7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsc1tpXVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAg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AgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JykucmVwbGFjZSgv56ysfOmbhnzor5185pyfL2csICcnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb20obGlzdFtqXSwgJ2EmJmhyZWYnKSArIGxhenksXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogbGlzdC5sZW5ndGggPiA0ID8gJ3RleHRfNScgOiAndGV4dF8yJ1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdXJseCA9ICdoaWtlcjovL3BhZ2UvcHVzaD9wdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgXCJuYW1lXCI6IGdldFBhZ2VUaXRsZSgpICsgcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcInBpY1wiOiBwYXJzZURvbShodG1sLCAnLmxhenlsb2FkJiZkYXRhLXNyY3x8ZGF0YS1vcmlnaW5hbCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJjb250ZW50XCI6IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnLnZpZGVvLWluZm8tY29udGVudCYmVGV4dCcpLnJlcGxhY2UoJ+aUtui1tycsICcnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiZnJvbVwiOiBnZXRQYWdlVGl0bGUoKSArIHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJ1cmxcIjogcGFyc2VEb20obGlzdFtqXSwgJ2EmJmhyZWYnKVxuICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFyc2VEb20obGlzdFtqXSwgJ2EmJmhyZWYnKVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybHgsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogbGlzdC5sZW5ndGggPiA0ID8gJ3RleHRfNScgOiAndGV4dF8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYXhcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICfmsqHmnInpgInpm4blk5/vvIzkuI3kv6Hngrnlm77niYfljrvnnIvnnIvwn5GAJyxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGxpc3QubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodGZwdXNoID09ICcwJykge1xuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykgKyBsYXp5LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMidcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwibmFtZVwiOiBnZXRQYWdlVGl0bGUoKSArIHBhcnNlRG9tRm9ySHRtbChsaXN0W2pdLCAnYSYmVGV4dCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJwaWNcIjogcGFyc2VEb20oaHRtbCwgJy5sYXp5bG9hZCYmZGF0YS1zcmN8fGRhdGEtb3JpZ2luYWwnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiY29udGVudFwiOiBwYXJzZURvbUZvckh0bWwoaHRtbCwgJy52aWRlby1pbmZvLWNvbnRlbnQmJlRleHQnKS5yZXBsYWNlKCfmlLbotbcnLCAnJyksXG4gICAgICAgICAgICAgICAgICAgICAgICBcImZyb21cIjogZ2V0UGFnZVRpdGxlKCkgKyBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIFwidXJsXCI6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJylcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ2EmJlRleHQnKS5yZXBsYWNlKC/nrKx86ZuGfOivnXzmnJ8vZywgJycpLFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpc3QubGVuZ3RoID4gNCA/ICd0ZXh0XzUnIDogJ3RleHRfMicsXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmF4XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+ayoeaciemAiembhuWTn++8jOS4jeS/oeeCueWbvueJh+WOu+eci+eci/CfkYAnLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICB9XG59XG5zZXRUYWJzKHRhYnMsIE1ZX1VSTCk7XG5zZXRMaXN0cyhsaXN0cywgZ2V0VmFyKE1ZX1VSTCwgJzAnKSk7XG5kLnB1c2goe1xuICAgIHRpdGxlOiAnPGJyPicsXG4gICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXG59KTtcbnNldFJlc3VsdChkKTsiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiKiIsInVhIjoibW9iaWxlIiwicHJlUnVsZSI6IiIsInBhZ2VzIjoiW3tcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJ0c1wiLFwicGF0aFwiOlwicHVzaFwiLFwicn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ICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjogJyArIOWIhuexu+minOiJsiArICdcXFwiPicgKyB0aXRsZSArICc8L3NwYW4+PC9iPicgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChwZChpdGVtLCDliIbnsbvpk77mjqUpICsgJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSAnMScpIHtcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAnICsg5YiG57G76aKc6ImyICsgJ1xcXCI+JyArIHRpdGxlICsgJzwvc3Bhbj48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn1cXG5cIn1dIiwiaWNvbiI6Imh0dHBzOi8vaW1nLnB5MTA4MHAuY29tLy8yMDIxLzEwLzVjN2E2NzM1NmNlYzI4LmljbyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment