xiaomianao666

小程序:阅读轻合集

Nov 6th, 2022
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@阅读轻合集@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6ZiF6K+76L275ZCI6ZuGIiwiYXV0aG9yIjoi5bCP5qOJ6KKE8J+MnibmsLjov5zjga7mmI7ml6UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6OTIsImNvbF90eXBlIjoiaWNvbl9yb3VuZF9zbWFsbF80IiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJhbGwiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmFkZExpc3RlbmVyKFwib25DbG9zZVwiLCAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICBKU09OLnBhcnNlKHJlYWRGaWxlKFwiX3J1bGVIYXNoQ2FjaGVcIikgfHwgXCJbXVwiKS5mb3JFYWNoKCh2KSA9PiBkZWxldGVGaWxlKHYpKVxuICAgIGRlbGV0ZUZpbGUoJ19ydWxlSGFzaENhY2hlJylcbn0pKVxuY29uc3QgUUlOR19USVRMRSA9IGdldE15VmFyKCdteUNvbGxlY3Rpb24nKSxcbiAgICBuZXdXaW5kb3cgPSByZWFkRmlsZSgnbmV3V2luZG93JyksXG4gICAgdHlwZVNob3cgPSBnZXRNeVZhcigndHlwZVNob3cnLCAnJyksXG4gICAgdHlwZXMgPSB7ICcnOiAn5YWo6YOoJywgJ2FsbCc6ICfogZrlkIgnLCAndmlkZW8nOiAn6KeG6aKRJywgJ211c2ljJzogJ+mfs+mikScsICdsaXZlJzogJ+ebtOaSrScsICdjYXJ0b29uJzogJ+a8q+eUuycsICdyZWFkJzogJ+mYheivuycsICdwaWN0dXJlJzogJ+WbvumbhicsICduZXdzJzogJ+i1hOiurycsICd0b29sJzogJ+W3peWFtycsICdvdGhlcic6ICflhbblroMnIH1cbmxldCBlbCA9IFt7XG4gICAgICAgIHRpdGxlOiAnICcgKyBRSU5HX1RJVExFLmJvbGQoKSArICcgJm5ic3AgJm5ic3AgJyArICfimpkg6L275ZCI6ZuG6K6+572uIOKamScuc21hbGwoKSxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9wYWdlL0NvbmZpZz9ydWxlPScgKyBRSU5HX1RJVExFICsgJyYjbm9SZWNvcmRIaXN0b3J5IycsXG4gICAgICAgIGltZzogTVlfUlVMRS5pY29uIHx8ICdoaWtlcjovL2ltYWdlcy9pY29uMScsXG4gICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xuICAgIH0sIHtcbiAgICAgICAgdXJsOiAnXCJoaWtlcjovL3NlYXJjaD9zPVwiK2lucHV0JyxcbiAgICAgICAgZGVzYzogJ+aQnOS9oOaDs+imgeeahC4uLicsXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygoUUlOR19USVRMRSwgdHlwZVNob3cpID0+IHtcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFKSgpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVTaG93KSBydWxlcyA9IHJ1bGVzLmZpbHRlcigodikgPT4gdi50eXBlID09IHR5cGVTaG93KVxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgICAgIH0sIFFJTkdfVElUTEUsIHR5cGVTaG93KSxcbiAgICAgICAgICAgIGRlZmF1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gICBRSU5HX1RJVExFOiBnZXRNeVZhcignbXlDb2xsZWN0aW9uJylcbiAgICAgICAgICAgICAgICB9KSArICcuanM6ZXZhbChKU09OLnBhcnNlKGZldGNoKFwiaGlrZXI6Ly9wYWdlL3VybFBhcnNl77yf77yfcnVsZT0nICsgUUlOR19USVRMRSArICdcIikpLnJ1bGUp77yb77ybaW5kZXhVcmwoaW5wdXQpOycgKyBwYXJhbUhhbmRsZSh1cmxQYXJhbSwgdi51YSkgKyAnI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IycsXG4gICAgICAgICAgICAgICAgUlVMRTogeyB0aXRsZTogdi50aXRsZSB9LFxuICAgICAgICAgICAgICAgIGlzSW5kZXg6IHRydWVcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIGlmIChuZXdXaW5kb3cpIE9iamVjdC5hc3NpZ24oZC5leHRyYSwge1xuICAgICAgICBuZXdXaW5kb3c6IHRydWUsXG4gICAgICAgIHdpbmRvd0lkOiBRSU5HX1RJVExFICsgJ18nICsgZC50aXRsZVxuICAgIH0pXG4gICAgZWwucHVzaChkKVxufSlcbnNldFJlc3VsdChlbClcbiIsInNlYXJjaF91cmwiOiJoaWtlcjovL2VtcHR5P2tleXdvcmQ9KioiLCJncm91cCI6IuKRoOi9u+WQiOmbhiIsInNlYXJjaEZpbmQiOiJqczpcbnNldFJlc3VsdChbe1xuICAgIHRpdGxlOiBcIueCueaIkeW8gOWni+i9u+WQiOmbhuKAouinhueVjOiBmuaQnFwiLFxuICAgIHVybDogXCJoaWtlcjovL3NlYXJjaD9zPVwiICsgZ2V0UGFyYW0oXCJrZXl3b3JkXCIpLFxuICAgIGV4dHJhOiB7XG4gICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IFFJTkdfVElUTEUgPSBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksXG4gICAgICAgICAgICAgICAgdHlwZVNob3cgPSBnZXRNeV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gICAgIGxldCBhcnIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXG4gICAgICAgIGFyci5mb3JFYWNoKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXG4gICAgICAgICAgICBzZWxlY3RlZCA9IEpTT04uc3RyaW5naWZ5KHRoaXMuZ2V0Q2xhc3MoaWQpKVxcbiAgICAgICAgICAgIGNsYXNzX25hbWUuZm9yRWFjaCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gY2xhc3NfdXJsW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgbm93ID0gSlNPTi5zdHJpbmdpZnkoeyBuYW1lOiBuYW1lLCB1cmw6IHVybCB9KVxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBzZWxlY3RlZCA9PSBub3cgPyAn4oCc4oCc4oCd4oCdJyArIG5hbWUuZm9udGNvbG9yKHRoaXMuY29sb3IpLmJvbGQoKSA6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHNlbGVjdGVkID09IG5vdyA/ICdoaWtlcjovL2VtcHR5JyA6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNpZ24sIGlkLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiArIGlkLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBpZCwgbm93KSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICAgICAgfS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URhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxuICAgICAgICAgICAgZC51cmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpX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QUdFID09IDEpIHtcXG4gICAgICAgIC8vIOWKoOi9vUNsYXNzVGFi57uE5Lu2XFxuICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9DbGFzc1RhYj9ydWxlPScgKyBRSU5HX1RJVExFKSkucnVsZSlcXG4gICAgICAgIHRhYkhlYWRlci5sb2FkKG15Q29sbGVjdGlvbl9lbClcXG4gICAgICAgIGlmIChSVUxFLnNlYXJjaF91cmwpIG15Q29sbGVjdGlvbl9lbC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahC4uLlxcXCIsXFxuICAgICAgICAgICAgdXJsOiAnXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIitpbnB1dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKFFJTkdfVElUTEUsIHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFKSgpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcyA9IFtydWxlcy5maW5kKCh2KSA9PiB2LnRpdGxlID09IHRpdGxlKV1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcXG4gICAgICAgICAgICAgICAgfSwgUUlOR19USVRMRSwgUlVMRS50aXRsZSksXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAg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gICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXHNcXFxcU10qPylAcnVsZT0oW1xcXFxzXFxcXFNdKikkLylcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHJ1bGVcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2NvbF90eXBlID0gTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuc3RhcnRzV2l0aCgnaGlrZXI6Ly9wYWdlLycpKSB7XFxuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIGxldCBbXywgcGF0aCwgZmxhZywgcGFyYW1zXSA9IHYudXJsLm1hdGNoKC9eaGlrZXI6XFxcXC9cXFxcL3BhZ2VcXFxcLyguKz8pKCMuKj8pPyg/OlxcXFw/KC4qKSk/JC8pLFxcbiAgICAgICAgICAgICAgICAgICAgc3ViUGFnZSA9IE1ZX1JVTEUucGFnZUxpc3QuZmluZCgodikgPT4gdi5wYXRoID09IHBhdGgpLFxcbiAgICAgICAgICAgICAgICAgICAgc3ViVXJsID0gKHBhcmFtcyB8fCAnJykuc3BsaXQoJyYnKS5maW5kKCh2KSA9PiB2LnN0YXJ0c1dpdGgoJ3VybD0nKSlcXG4gICAgICAgICAgICAgICAgdi51cmwgPSBzdWJVcmwgPyBzdWJVcmwuc2xpY2UoNCkucmVwbGFjZSgv77yf77yfL2csICc/JykucmVwbGFjZSgv77yG77yGL2csICcmJykgOiAodi5leHRyYSB8fCB7fSkudXJsIHx8ICdoaWtlcjovL2VtcHR5JyArIGZsYWcgKyAnPycgKyAocGFyYW1zIHx8ICcnKVxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gc3ViUGFnZS5ydWxlXFxuICAgICAgICAgICAgICAgIE1ZX19SVUxFLmRldGFpbF9jb2xfdHlwZSA9IHN1YlBhZ2UuY29sX3R5cGVcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUucGFyYW1zID0gdi5leHRyYSB8fCB7fVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuaW5jbHVkZXMoJ0BsYXp5UnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVJbmRleCA9IHYudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSB2LnVybCA9IHYudXJsLnNsaWNlKDAsIHJlSW5kZXgpICsgJy5qczpcXFxcbmlmKE1ZX1JVTEUpT2JqZWN0LmFzc2lnbihNWV9SVUxFLCBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCInICsgcnVsZUhhc2ggKyAnXFxcIikpKTsnICsgdi51cmwuc2xpY2UocmVJbmRleCArIDQpXFxuICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0luZGV4KSB7XFxuICAgICAgICAgICAgICAgIGlmICghTVlfUlVMRS5kZXRhaWxfZmluZF9ydWxlIHx8IC9oaWtlcjpcXFxcL1xcXFwvKD8hZW1wdHkuKyQpLy50ZXN0KHYudXJsKSkgcmV0dXJuIHZcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2LmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICB1cmw6IChmdW5jdGlvbih1cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHVybC5zcGxpdCgnOycpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsLnNoaW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YXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwgSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiJyArIHJ1bGVIYXNoICsgJ1xcXCIpKSk7JyArIHJlcy51cmwuc2xpY2UocmVJbmRleCArIDQpXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IChmdW5jdGlvbih1cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwuc3BsaXQoJzsnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwuc2hpZnQoKSArICc7JyArIHBhcmFtSGFuZGxlKHVybCwgTVlfUlVMRS51YSwgTVlfUlVMRS51cmwuc3BsaXQoJzsnKVsyXSlcXG4gICAgICAgICAgICAgICAgICAgIH0pKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiB7IGRldGFpbF9maW5kX3J1bGU6IGRldGFpbEZpbmRSdWxlIH0sXFxuICAgICAgICAgICAgICAgICAgICBIQVNIOiBydWxlSGFzaCxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogaXNJbmRleCAmJiB0aXRsZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlcy51cmwgPSAnaGlrZXI6Ly9wYWdlL2ZyYW1lTG9hZD9ydWxlPScgKyBRSU5HX1RJVExFXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChNWV9SVUxFLmRldGFpbF9maW5kX3J1bGUpIHtcXG4gICAgICAgICAgICAgICAgcmVzLmV4dHJhID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAoZnVuY3Rpb24odXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsLnNwbGl0KCc7JylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsLnNoaWZ0KCkgKyAnOycgKyBwYXJhbUhhbmRsZSh1cmwsIE1ZX1JVTEUudWEsIE1ZX1JVTEUudXJsLnNwbGl0KCc7JylbMl0pXFxuICAgICAgICAgICAgICAgICAgICB9KSh1cmwpLFxcbiAgICAgICAgIC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GQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiAnYmlnX2JsYW5rX2Jsb2NrJ1xcXFxuICAgIH0pO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiAnYmlnX2JsYW5rX2Jsb2NrJ1xcXFxuICAgIH0pO1xcXFxuICAgIGlmIChnZXRWYXIoJ3Noc29ydCcpID09ICcxJykge1xcXFxuICAgICAgICBmb3IgKHZhciBqID0gbGlzdC5sZW5ndGggLSAxOyBqID49IDA7IGotLSkge1xcXFxuICAgICAgICAgICAgdmFyIGptID0gcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdUZXh0Jyk7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBqbSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykgKyBcXFxcXFxcIiNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXFxcXFwiICsgYEBydWxlPWpzOmAgKyAkLnRvU3RyaW5nKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRlc190aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChnZXRSZXNDb2RlKCksICcjYzEmJmgxJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxiaWc+JyArIGRlc190aXRsZSArICc8L2JpZz4nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvbnQgPSBwYXJzZURvbUZvckFycmF5KGdldFJlc0NvZGUoKSwgJyNjb250ZW50JiZwJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gY29udC5tYXAoaXQgPT4gJ+OAgOOAgCcgKyBwYXJzZURvbUZvckh0bWwoaXQsICdwJiZIdG1sJykpLmpvaW4oXFxcXFxcXCI8YnI+PGJyPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBodG1sLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwicmljaF90ZXh0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHRTaXplOiAxOCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGljazogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcXFxuICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBqbS5sZW5ndGggPiA1ID8gJ3RleHRfMScgOiAndGV4dF8xJyxcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4gICAgICAgICAgICB2YXIgam0gPSBwYXJzZURvbUZvckh0bWwobGlzdFtqXSwgJ1RleHQnKTtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGptLFxcXFxuICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb20obGlzdFtqXSwgJ2EmJmhyZWYnKSArIFxcXFxcXFwiI2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcXFxcXCIgKyBgQHJ1bGU9anM6YCArICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZGVzX3RpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGdldFJlc0NvZGUoKSwgJyNjMSYmaDEmJlRleHQnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPGJpZz4nICsgZGVzX3RpdGxlICsgJzwvYmlnPicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgY29udCA9IHBhcnNlRG9tRm9yQXJyYXkoZ2V0UmVzQ29kZSgpLCAnI2NvbnRlbnQmJnAnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBjb250Lm1hcChpdCA9PiAn44CA44CAJyArIHBhcnNlRG9tRm9ySHRtbChpdCwgJ3AmJkh0bWwnKSkuam9pbihcXFxcXFxcIjxicj48YnI+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGh0bWwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE4LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsaWNrOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IGptLmxlbmd0aCA+IDUgPyAndGV4dF8xJyA6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG59XFxcXG5zZXRMaXN0cyhsaXN0cywgZ2V0VmFyKE1ZX1VSTCwgJzAnKSk7XFxcXG5kLnB1c2goe1xcXFxuICAgIHRpdGxlOiAnPGJyPicsXFxcXG4gICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxcXG59KTtcXFxcbnNldFJlc3VsdChkKTtcXFwiLFxcbiAgICAgICAgXFxcInNkZXRhaWxfY29sX3R5cGVcXFwiOiBcXFwibW92aWVfMVxcXCIsXFxuICAgICAgICBcXFwic2RldGFpbF9maW5kX3J1bGVcXFwiOiBcXFwiKlxcXCIsXFxuICAgICAgICBcXFwidWFcXFwiOiBcXFwicGNcXFwiLFxcbiAgICAgICAgXFxcInByZVJ1bGVcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgIFxcXCJwYWdlc1xcXCI6IFxcXCJbXVxcXCIsXFxuICAgICAgICBcXFwiaWNvblxcXCI6IFxcXCJcXFwiXFxuICAgIH1cXG5dXCJ9XSIsImljb24iOiJodHRwczovL2dpbWcyLmJhaWR1LmNvbS9pbWFnZV9zZWFyY2gvc3JjPWh0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