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GZhY3Rvcmllc1tiYXNlX2NsYXNzXSA9IE9GRmFjdG9yeShwYWNrYWdlPSIlcy4lcyIgJSAocHJlZml4LCBwYWNrYWdlKSwKKyAgICAgICAgICAgICAgICAgICAgbmFtZT1iYXNlX2NsYXNzICsgInMiLCBtZW1iZXJzPVtdLCByZW1vdmVfcHJlZml4PXJlbW92ZV9wcmVmaXgsIGJhc2VfY2xhc3M9YW5ub3RhdGVkX2Jhc2VfY2xhc3MsIHN1Yl9mYWN0b3JpZXM9e30pCisKKyAgICAgICAgZmFjdG9yaWVzWyIiXSA9IE9GRmFjdG9yeSgKKyAgICAgICAgICAgICAgICAgICAgcGFja2FnZT1wcmVmaXgsCiAgICAgICAgICAgICAgICAgICAgIG5hbWU9Ik9GRmFjdG9yeSIsCi0gICAgICAgICAgICAgICAgICAgIG1lbWJlcnM9c2VsZi5pbnRlcmZhY2VzKQorICAgICAgICAgICAgICAgICAgICByZW1vdmVfcHJlZml4PSIiLAorICAgICAgICAgICAgICAgICAgICBtZW1iZXJzPVtdLCBiYXNlX2NsYXNzPSJPRk1lc3NhZ2UiLCBzdWJfZmFjdG9yaWVzPU9yZGVyZWREaWN0KAorICAgICAgICAgICAgICAgICAgICAgICAgKCJ7fXt9cyIuZm9ybWF0KG5bMl0ubG93ZXIoKSwgblszOl0pLCAie31zIi5mb3JtYXQobikpIGZvciBuIGluIHN1Yl9mYWN0b3J5X2NsYXNzZXMgKSkKKworICAgICAgICBmb3IgaSBpbiBzZWxmLmludGVyZmFjZXM6CisgICAgICAgICAgICBmb3IgbiwgZmFjdG9yeSBpbiBmYWN0b3JpZXMuaXRlbXMoKToKKyAgICAgICAgICAgICAgICBpZiBuID09ICIiOgorICAgICAgICAgICAgICAgICAgICBmYWN0b3J5Lm1lbWJlcnMuYXBwZW5kKGkpCisgICAgICAgICAgICAgICAgICAgIGJyZWFrCisgICAgICAgICAgICAgICAgZWxzZToKKyAgICAgICAgICAgICAgICAgICAgc3VwZXJfY2xhc3MgPSBzZW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Ci0gICAgICAgIHBja19zdWZmaXgsIHBhcmVudF9pbnRlcmZhY2UgPSBzZWxmLmNsYXNzX2luZm8oKQorICAgICAgICBwY2tfc3VmZml4LCBwYXJlbnRfaW50ZXJmYWNlLCBzZWxmLnR5cGVfYW5ub3RhdGlvbiA9IHNlbGYuY2xhc3NfaW5mbygpCiAgICAgICAgIHNlbGYucGFja2FnZSA9ICJvcmcub3BlbmZsb3cucHJvdG9jb2wuJXMiICUgcGNrX3N1ZmZpeCBpZiBwY2tfc3VmZml4IGVsc2UgIm9yZy5vcGVuZmxvdy5wcm90b2NvbCIKICAgICAgICAgaWYgc2VsZi5uYW1lICE9IHBhcmVudF9pbnRlcmZhY2U6CiAgICAgICAgICAgICBzZWxmLnBhcmVudF9pbnRlcmZhY2UgPSBwYXJlbnRfaW50ZXJmYWNlCiAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICBzZWxmLnBhcmVudF9pbnRlcmZhY2UgPSBOb25lCi0gICAgICAgICAgICAKKworICAgIGRlZiBpc19pbnN0YW5jZV9vZihzZWxmLCBvdGhlcl9jbGFzcyk6CisgICAgICAgIGlmIHNlbGYgPT0gb3RoZXJfY2xhc3M6CisgICAgICAgICAgICByZXR1cm4gVHJ1ZQorICAgICAgICBwYXJlbnQgPSBzZWxmLnN1cGVyX2NsYXNzCisgICAgICAgIGlmIHBhcmVudCBpcyBOb25lOgorICAgICAgICAgICAgcmV0dXJuIEZhbHNlCisgICAgICAgIGVsc2U6CisgICAgICAgICAgICByZXR1cm4gcGFyZW50LmlzX2luc3RhbmNlX29mKG90aGVyX2NsYXNzKQorCisgICAgQHByb3BlcnR5CisgICAgZGVmIHN1cGVyX2NsYXNzKHNlbGYpOgorICAgICAgICBpZiBub3Qgc2VsZi5wYXJlbnRfaW50ZXJmYWNlOgorICAgICAgICAgICAgcmV0dXJuIE5vbmUKKyAgICAgICAgZWxzZToKKyAgICAgICAgICAgIHJldHVybiBtb2RlbC5pbnRlcmZhY2VfYnlfbmFtZShzZ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Vlc3QiKQorICAgICAgICAgICAgcmV0dXJuICgiIiwgIk9GU3RhdHNSZXF1ZXN0IiwgTm9uZSkKICAgICAgICAgZWxpZiByZS5tYXRjaChyJ09GLitTdGF0c1JlcGx5JCcsIHNlbGYubmFtZSk6Ci0gICAgICAgICAgICByZXR1cm4gKCIiLCAiT0ZTdGF0c1JlcGx5IikKKyAgICAgICAgICAgIHJldHVybiAoIiIsICJPRlN0YXRzUmVwbHkiLCBOb25lKQogICAgICAgICBlbGlmIHJlLm1hdGNoKHInT0ZGbG93KEFkZHxNb2RpZnkoU3RyaWN0KT98RGVsZXRlKFN0cmljdCk/KSQnLCBzZWxmLm5hbWUpOgotICAgICAgICAgICAgcmV0dXJuICgiIiwgIk9GRmxvd01vZCIpCisgICAgICAgICAgICByZXR1cm4gKCIiLCAiT0ZGbG93TW9kIiwgTm9uZSkKICAgICAgICAgZWxpZiBsb3hpX3V0aWxzLmNsYXNzX2lzX21lc3NhZ2Uoc2VsZi5jX25hbWUpIGFuZCByZS5tYXRjaChyJ09GQnNuLiskJywgc2VsZi5uYW1lKToKLSAgICAgICAgICAgIHJldHVybiAoIiIsICJPRkJzbkhlYWRlciIpCisgICAgICAgICAgICByZXR1cm4gKCIiLCAiT0ZCc25IZWFkZXIiLCBOb25lKQogICAgICAgICBlbGlmIGxveGlfdXRpbHMuY2xhc3NfaXNfbWVzc2FnZShzZWxmLmNfbmFtZSkgYW5kIHJlLm1hdGNoKHInT0ZOaWNpcmEuKyQnLCBzZWxmLm5hbWUpOgotICAgICAgICAgICAgcmV0dXJuICgiIiwgIk9GTmljaXJhSGVhZGVyIikKKyAgICAgICAgICAgIHJldHVybiAoIiIsICJPRk5pY2lyYUhlYWRlciIsIE5vbmUpCiAgICAgICAgIGVsaWYgcmUubWF0Y2gocidPRk1hdGNoLionLCBzZWxmLm5hbWUpOgotICAgICAgICAgICAgcmV0dXJuICgiIiwgIk1hdGNoIikKKyAgICAgICAgICAgIHJldHVybiAoIiIsICJNYXRjaCIsIE5vbmUpCiAgICAgICAgIGVsaWYgbG94aV91dGlscy5jbGFzc19pc19tZXNzYWdlKHNlbGYuY19uYW1lKToKLSAgICAgICAgICAgIHJldHVybiAoIiIsICJPRk1lc3NhZ2UiKQorICAgICAgICAgICAgcmV0dXJuICgiIiwgIk9GTWVzc2FnZSIsIE5vbmUpCiAgICAgICAgIGVsaWYgbG94aV91dGlscy5jbGFzc19pc19hY3Rpb24oc2VsZi5jX25hbWUpOgotICAgICAgICAgICAgaWYgcmUubWF0Y2gocidPRkFjdGlvbkJzbi4qJywgc2VsZi5uYW1lKToKLSAgICAgICAgICAgICAgICByZXR1cm4gKCJhY3Rpb24iLCAiT0ZBY3Rpb25Cc24iKQotICAgICAgICAgICAgZWxpZiByZS5tYXRjaChyJ09GQWN0aW9uTmljaXJhLionLCBzZWxmLm5hbWUpOgotICAgICAgICAgICAgICAgIHJldHVybiAoImFjdGlvbiIsICJPRkFjdGlvbk5pY2lyYSIpCisgICAgICAgICAgICBpZiByZS5tYXRjaChyJ09GQWN0aW9uQnNuLisnLCBzZWxmLm5hbWUpOgorICAgICAgICAgICAgICAgIHJldHVybiAoImFjdGlvbiIsICJPRkFjdGlvbkJzbiIsIE5vbmUpCisgICAgICAgICAgICBlbGlmIHJlLm1hdGNoKHInT0ZBY3Rpb25OaWNpcmEuKycsIHNlbGYubmFtZSk6CisgICAgICAgICAgICAgICAgcmV0dXJuICgiYWN0aW9uIiwgIk9GQWN0aW9uTmljaXJhIiwgTm9uZSkKICAgICAgICAgICAgIGVsc2U6Ci0gICAgICAgICAgICAgICAgcmV0dXJuICgiYWN0aW9uIiwgIk9GQWN0aW9uIikKKyAgICAgICAgICAgICAgICByZXR1cm4gKCJhY3Rpb24iLCAiT0ZBY3Rpb24iLCBOb25lKQogICAgICAgICBlbGlmIHJlLm1hdGNoKHInT0ZCc25WcG9ydC4rJCcsIHNlbGYubmFtZSk6Ci0gICAgICAgICAgICByZXR1cm4gKCIiLCAiT0ZCc25WcG9ydCIpCisgICAgICAgICAgICByZXR1cm4gKCIiLCAiT0ZCc25WcG9ydCIsIE5vbmUpCisgICAgICAgIGVsaWYgc2VsZi5uYW1lID09ICJPRk94bSI6CisgICAgICAgICAgICByZXR1cm4gKCJveG0iLCBOb25lLCAiVCBleHRlbmRzIE9GVmFsdWVUeXBlPFQ+IikKICAgICAgICAgZWxpZiBsb3hpX3V0aWxzLmNsYXNzX2lzX294bShzZWxmLmNfbmFtZSk6Ci0gICAgICAgICAgICByZXR1cm4gKCJveG0iLCAiT0ZPeG0iKQorICAgICAgICAgICAgaWYgc2VsZi5uYW1lIGluIG1vZGVsLm94bV9tYXA6CisgICAgICAgICAgICAgICAgcmV0dXJuICgib3htIiwgIk9GT3htPCVzPiIgJSBtb2RlbC5veG1fbWFwW3NlbGYubmFtZV0udHlwZV9uYW1lLCBOb25lKQorICAgICAgICAgICAgZWxzZToKKyAgICAgICAgICAgICAgICByZXR1cm4gKCJveG0iLCAiT0ZPeG0iLCBOb25lKQogICAgICAgICBlbGlmIGxveGlfdXRpbHMuY2xhc3NfaXNfaW5zdHJ1Y3Rpb24oc2VsZi5jX25hbWUpOgotICAgICAgICAgICAgcmV0dXJuICgiaW5zdHJ1Y3Rpb24iLCAiT0ZJbnN0cnVjdGlvbiIpCisgICAgICAgICAgICByZXR1cm4gKCJpbnN0cnVjdGlvbiIsICJPRkluc3RydWN0aW9uIiwgTm9uZSkKICAgICAgICAgZWxpZiBsb3hpX3V0aWxzLmNsYXNzX2lzX21ldGVyX2JhbmQoc2VsZi5jX25hbWUpOgotICAgICAgICAgICAgcmV0dXJuICgibWV0ZXJiYW5kIiwgIk9GTWV0ZXJCYW5kIikKKyAgICAgICAgICAgIHJldHVybiAoIm1ldGVyYmFuZCIsICJPRk1ldGVyQmFuZCIsIE5vbmUpCiAgICAgICAgIGVsaWYgbG94aV91dGlscy5jbGFzc19pc19xdWV1ZV9wcm9wKHNlbGYuY19uYW1lKToKLSAgICAgICAgICAgIHJldHVybiAoInF1ZXV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NhbGx5IGR1cmluZyAoZGUpc2VyaWFsaXphdGlvbiBhbmQgbm90IGV4cG9zZWQiIiIKQEAgLTI3NSw3ICszNzgsMzMgQEAKICAgICAgICAgICAgICAgICBpZiBvZl9tZW1iZXIubmFtZSBub3QgaW4gbWVtYmVyX21hcDoKICAgICAgICAgICAgICAgICAgICAgbWVtYmVyX21hcFtvZl9tZW1iZXIubmFtZV0gPSBKYXZhTWVtYmVyLmZvcl9vZl9tZW1iZXIoc2VsZiwgb2ZfbWVtYmVyKQogCi0gICAgICAgIHJldHVybiBtZW1iZXJfbWFwLnZhbHVlcygpCisgICAgICAgIHJldHVybiB0dXBsZShtZW1iZXJfbWFwLnZhbHVlcygpKQorCisgICAgQHByb3BlcnR5CisgICAgZGVmIHZpcnR1YWxfbWVtYmVycyhzZWxmKToKKyAgICAgICAgaWYgc2VsZi5uYW1lID09ICJPRk94bSI6CisgICAgICAgICAgICByZXR1cm4gKAorICAgICAgICAgICAgICAgICAgICBKYXZhVmlydHVhbE1lbWJlcihzZWxmLCAidmFsdWUiLCBqYXZhX3R5cGUuZ2VuZXJpY190KSwKKyAgICAgICAgICAgICAgICAgICAgSmF2YVZpcnR1YWxNZW1iZXIoc2VsZiwgIm1hc2siLCBqYXZhX3R5cGUuZ2VuZXJpY190KSwKKyAgICAgICAgICAgICAgICAgICAgSmF2YVZpcnR1YWxNZW1iZXIoc2VsZiwgIm1hdGNoRmllbGQiLCBqYXZhX3R5cGUubWFrZV9tYXRjaF9maWVsZF9qdHlwZSgiVCIpKSwKKyAgICAgICAgICAgICAgICAgICAgSmF2YVZpcnR1YWxNZW1iZXIoc2VsZiwgIm1hc2tlZCIsIGphdmFfdHlwZS5ib29sZWFuKSwKKyAgICAgICAgICAgICAgICAgICApCisgICAgICAgIGVsaWYgc2VsZi5wYXJlbnRfaW50ZXJmYWNlIGFuZCBzZWxmLnBhcmVudF9pbnRlcmZhY2Uuc3RhcnRzd2l0aCgiT0ZPeG0iKToKKyAgICAgICAgICAgIGZpZWxkX3R5cGUgPSBqYXZhX3R5cGUubWFrZV9tYXRjaF9maWVsZF9qdHlwZShtb2RlbC5veG1fbWFwW3NlbGYubmFtZV0udHlwZV9uYW1lKSBcCisgICAgICAgICAgICAgICAgaWYgc2VsZi5uYW1lIGluIG1vZGVsLm94bV9tYXAgXAorICAgICAgICAgICAgICAgIGVsc2UgamF2YV90eXBlLm1ha2VfbWF0Y2hfZmllbGRfanR5cGUoKQorCisgICAgICAgICAgICByZXR1cm4gKAorICAgICAgICAgICAgICAgICAgICBKYXZhVmlydHVhbE1lbWJlcihzZWxmLCAibWF0Y2hGaWVsZCIsIGZpZWxkX3R5cGUpLAorICAgICAgICAgICAgICAgICAgICBKYXZhVmlydHVhbE1lbWJlcihzZWxmLCAibWFza2VkIiwgamF2YV90eXBlLmJvb2xlYW4pLAorICAgICAgICAgICAgICAgICAgICkgXAorICAgICAgICAgICAgICAgICAgICsgXAorICAgICAgICAgICAgICAgICAgICgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICggSmF2YVZpcnR1YWxNZW1iZXIoc2VsZiwgIm1hc2siLCBmaW5kKGxhbWJkYSB4OiB4Lm5hbWUgPT0gInZhbHVlIiwgc2VsZi5pcl9tb2RlbF9tZW1iZXJzKS5qYXZhX3R5cGUpLCApIGlmIG5vdCBmaW5kKGxhbWJkYSB4OiB4Lm5hbWUgPT0gIm1hc2siLCBzZWxmLmlyX21vZGVsX21lbWJlcnMpIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgKCkKKyAgICAgICAgICAgICAgICAgICApCisgICAgICAgIGVsc2U6CisgICAgICAgICAgICByZXR1cm4gKCkKIAogICAgIEBwcm9wZXJ0eQogICAgIEBtZW1vaXplCkBAIC0zODQsOCArNTEzLDI5IEBACiAgICAgQHByb3BlcnR5CiAgICAgQG1lbW9pemUKICAgICBkZWYgbWVtYmVycyhzZWxmKToKKyAgICAgICAgcmV0dXJuIHNlbGYuaXJfbW9kZWxfbWVtYmVycyArIHNlbGYudml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0dXJuICgKKyAgICAgICAgICAgICAgICAgICAgSmF2YVZpcnR1YWxNZW1iZXIoc2VsZiwgIm1hdGNoRmllbGQiLCBqYXZhX3R5cGUubWFrZV9tYXRjaF9maWVsZF9qdHlwZSgpLCAibnVsbCIpLAorICAgICAgICAgICAgICAgICAgICBKYXZhVmlydHVhbE1lbWJlcihzZWxmLCAibWFza2VkIiwgamF2YV90eXBlLmJvb2xlYW4sICJmYWxzZSIpLAorICAgICAgICAgICAgICAgICAgICkKKyAgICAgICAgZWxzZToKKyAgICAgICAgICAgIHJldHVybiAoKQogCiAgICAgZGVmIGFsbF92ZXJzaW9ucyhzZWxmKToKICAgICAgICAgcmV0dXJuIFsgSmF2YU9GVmVyc2lvbihpbnRfdmVyc2lvbikKQEAgLTQ0Nyw2ICs1OTcsMTQgQEAKICAgICAgICAgcmV0dXJuIHNlbGYuY19uYW1lLnVwcGVyKCkKIAogICAgIEBwcm9wZXJ0eQorICAgIGRlZiBnZXR0ZXJfbmFtZShzZWxmKToKKyAgICAgICAgcmV0dXJuICgiaXMiIGlmIHNlbGYuamF2YV90eXBlLnB1YmxpY190eXBlID09ICJib29sZWFuIiBlbHNlICJnZXQiKSArIHNlbGYudGl0bGVfbmFtZQorCisgICAgQHByb3BlcnR5CisgICAgZGVmIHNldHRlcl9uYW1lKHNlbGYpOgorICAgICAgICByZXR1cm4gInNldCIgKyBzZWxmLnRpdGxlX25hbWUKKworICAgIEBwcm9wZXJ0eQogICAgIGRlZiBkZWZhdWx0X25hbWUoc2VsZik6CiAgICAgICAgIGlmIHNlbGYuaXNfZml4ZWRfdmFsdWU6CiAgICAgICAgICAgICByZXR1cm4gc2VsZi5jb25zdGFudF9uYW1lCkBAIC00NTksMTAgKzYxNywxNCBAQAogCiAgICAgICAgIGlmIHNlbGYuaXNfZml4ZWRfdmFsdWU6CiAgICAgICAgICAgICByZXR1cm4gc2VsZi5lbnVtX3ZhbHVlCisgICAgICAgIGVsaWYgamF2YV90eXBlID09ICJPRk94bUxpc3QiOgorICAgICAgICAgICAgcmV0dXJuICJPRk94bUxpc3QuRU1QVFkiCiAgICAgICAgIGVsaWYgcmUubWF0Y2gocidMaXN0LionLCBqYXZhX3R5cGUpOgogICAgICAgICAgICAgcmV0dXJuICJDb2xsZWN0aW9ucy5lbXB0eUxpc3QoKSIKICAgICAgICAgZWxpZiBqYXZhX3R5cGUgPT0gImJvb2xlYW4iOgogICAgICAgICAgICAgcmV0dXJuICJmYWxzZSI7CisgICAgICAgIGVsaWYgc2VsZi5qYXZhX3R5cGUuaXNfYXJyYXk6CisgICAgICAgICAgICByZXR1cm4gIm5ldyAlc1swXSIgJSBqYXZhX3R5cGVbOi0yXQogICAgICAgICBlbGlmIGphdmFfdHlwZSBpbiAoImJ5dGUiLCAiY2hhciIsICJzaG9ydCIsICJpbnQiLCAibG9uZyIpOgogICAgICAgICAgICAgcmV0dXJuICIoezB9KSAwIi5mb3JtYXQoamF2YV90eXBlKTsKICAgICAgICAgZWxzZToKQEAgLTU2Miw2ICs3MjQsOCBAQAogICAgICAgICBlbHNlOgogICAgICAgICAgICAgaWYgbWVtYmVyLm5hbWUgPT0gJ2xlbic6CiAgICAgICAgICAgICAgICAgbmFtZSA9ICdsZW5ndGgnCisgICAgICAgICAgICBlbGlmIG1lbWJlci5uYW1lID09ICd2YWx1ZV9tYXNrJzoKKyAgICAgICAgICAgICAgICBuYW1lID0gJ21hc2snCiAgICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgIG5hbWUgPSBqYXZhX3R5cGUubmFtZV9jX3RvX2NhbWVsKG1lbWJlci5uYW1lKQogICAgICAgICAgICAgal90eXBlID0gamF2YV90eXBlLmNvbnZlcnRfdG9fanR5cGUoamF2YV9jbGFzcy5jX25hbWUsIG1lbWJlci5uYW1lLCBtZW1iZXIub2Z0eXBlKQpAQCAtNTgyLDYgKzc0NiwxMCBAQAogICAgICAgICAgICAgICAgIHJldHVybiBGYWxzZQogICAgICAgICByZXR1cm4gVHJ1ZQogCisgIC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BPRk94bTw/Pj4oTWF0Y2hGaWVsZHMuY2xhc3MpOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEJ1aWxkZXIoRW51bU1hcDxNYXRjaEZpZWxkcywgT0ZPeG08Pz4+IG94bU1hcCkgeworICAgICAgICAgICAgdGhpcy5veG1NYXAgPSBveG1NYXA7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgPFQgZXh0ZW5kcyBPRlZhbHVlVHlwZTxUPj4gdm9pZCBzZXQoT0ZPeG08VD4gb3htKSB7CisgICAgICAgICAgICBveG1NYXAucHV0KG94bS5nZXRNYXRjaEZpZWxkKCkuaWQsIG94bSk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgPFQgZXh0ZW5kcyBPRlZhbHVlVHlwZTxUPj4gdm9pZCB1bnNldChNYXRjaEZpZWxkPFQ+IG1hdGNoRmllbGQpIHsKKyAgICAgICAgICAgIG94bU1hcC5yZW1vdmUobWF0Y2hGaWVsZC5pZCk7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgT0ZPeG1MaXN0IGJ1aWxkKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBPRk94bUxpc3Qob3htTWFwKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBJdGVyYXRvcjxPRk94bTw/Pj4gaXRlcmF0b3IoKSB7CisgICAgICAgIHJldHVybiBveG1NYXAudmFsdWVzKCkuaXRlcmF0b3IoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIE9GT3htTGlzdCBvZkxpc3QoTGlzdDxPRk94bTw/Pj4gb3htTGlzdCkgeworICAgICAgICBNYXA8TWF0Y2hGaWVsZHMsIE9GT3htPD8+PiBtYXAgPSBuZXcgRW51bU1hcDxNYXRjaEZpZWxkcywgT0ZPeG08Pz4+KAorICAgICAgICAgICAgICAgIE1hdGNoRmllbGRzLmNsYXNzKTsKKyAgICAgICAgZm9yIChPRk94bTw/PiBvIDogb3htTGlzdCkgeworICAgICAgICAgICAgLy8gVE9ETzogaWYgZnVsbHkgbWFza2VkLCBpZ25vcmUgb3htLgorICAgICAgICAgICAgbWFwLnB1dChvLmdldE1hdGNoRmllbGQoKS5pZCwgbyk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5ldyBPRk94bUxpc3QobWFwKTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIE9GT3htTGlzdCBvZihPRk94bTw/Pi4uLiBveG1zKSB7CisgICAgICAgIE1hcDxNYXRjaEZpZWxkcywgT0ZPeG08Pz4+IG1hcCA9IG5ldyBFbnVtTWFwPE1hdGNoRmllbGRzLCBPRk94bTw/Pj4oCisgICAgICAgICAgICAgICAgTWF0Y2hGaWVsZHMuY2xhc3MpOworICAgICAgICBmb3IgKE9GT3htPD8+IG8gOiBveG1zKSB7CisgICAgICAgICAgICAvLyBUT0RPOiBpZiBmdWxseSBtYXNrZWQsIGlnbm9yZSBveG0uCisgICAgICAgICAgICBtYXAucHV0KG8uZ2V0TWF0Y2hGaWVsZCgpLmlkLCBvKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbmV3IE9GT3htTGlzdChtYXApOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgT0ZPeG1MaXN0IHJlYWRGcm9tKENoYW5uZWxCdWZmZXIgYmIsIGludCBsZW5ndGgsCisgICAgICAgICAgICBPRk1lc3NhZ2VSZWFkZXI8T0ZPeG08Pz4+IHJlYWRlcikgdGhyb3dzIE9GUGFyc2VFcnJvciB7CisgICAgICAgIHJldHVybiBvZkxpc3QoQ2hhbm5lbFV0aWxzLnJlYWRMaXN0KGJiLCBsZW5ndGgsIHJlYWRlcikpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHdyaXRlVG8oQ2hhbm5lbEJ1ZmZlciBiYikgeworICAgICAgICBmb3IgKE9GT3htPD8+IG8gOiB0aGlzKSB7CisgICAgICAgICAgICBvLndyaXRlVG8oYmIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIG9yZy5vcGVuZmxvdy5wcm90b2NvbC5PRk94bUxpc3QuQnVpbGRlciBjcmVhdGVCdWlsZGVyKCkgeworICAgICAgICByZXR1cm4gbmV3IE9GT3htTGlzdC5CdWlsZGVyKG5ldyBFbnVtTWFwPE1hdGNoRmllbGRzLCBPRk94bTw/Pj4ob3htTWFwKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgZmluYWwgaW50IHByaW1lID0gMzE7CisgICAgICAgIGludCByZXN1bHQgPSAxOworICAgICAgICByZXN1bHQgPSBwcmltZSAqIHJlc3VsdCArICgob3htTWFwID09IG51bGwpID8gMCA6IG94bU1hcC5oYXNoQ29kZSgpKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgeworICAgICAgICBpZiAodGhpcyA9PSBvYmopCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgaWYgKG9iaiA9PSBudWxsKQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICBpZiAoZ2V0Q2xhc3MoKSAhPSBvYmouZ2V0Q2xhc3MoKSkKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgT0ZPeG1MaXN0IG90aGVyID0gKE9GT3htTGlzdCkgb2JqOworICAgICAgICBpZiAob3htTWFwID09IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChvdGhlci5veG1NYXAgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAoIW94bU1hcC5lcXVhbHMob3RoZXIub3htTWFwKSkKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgcmV0dXJ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ZXR1cm4gKHNob3J0KSBsOwogICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgc2hvcnQgcmF3OworCisgICAgcHJpdmF0ZSBVMTYoc2hvcnQgcmF3KSB7CisgICAgICAgIHRoaXMucmF3ID0gcmF3OworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgZmluYWwgVTE2IG9mKGludCB2YWx1ZSkgeworICAgICAgICByZXR1cm4gbmV3IFUxNih0KHZhbHVlKSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBmaW5hbCBVMTYgb2ZSYXcoc2hvcnQgdmFsdWUpIHsKKyAgICAgICAgcmV0dXJuIG5ldyBVMTYodmFsdWUpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0VmFsdWUoKSB7CisgICAgICAgIHJldHVybiBmKHJhdyk7CisgICAgfQorCisgICAgcHVibGljIHNob3J0IGdldFJhdygpIHsKKyAgICAgICAgcmV0dXJuIHJhdzsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICByZXR1cm4gIiIgKyBmKHJhdyk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGludCBoYXNoQ29kZSgpIHsKKyAgICAgICAgZmluYWwgaW50IHByaW1lID0gMzE7CisgICAgICAgIGludCByZXN1bHQgPSAxOworICAgICAgICByZXN1bHQgPSBwcmltZSAqIHJlc3VsdCArIHJhdzsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgYm9vbGVhbiBlcXVhbHMoT2JqZWN0IG9iaikgeworICAgICAgICBpZiAodGhpcyA9PSBvYmopCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgaWYgKG9iaiA9PSBudWxsKQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICBpZiAoZ2V0Q2xhc3MoKSAhPSBvYmouZ2V0Q2xhc3MoKSkKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgVTE2IG90aGVyID0gKFUxNikgb2JqOworICAgICAgICBpZiAocmF3ICE9IG90aGVyLnJhdykKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorCisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCB3cml0ZVRvKENoYW5uZWxCdWZmZXIgYmIpIHsKKyAgICAgICAgYmIud3JpdGVTaG9ydChyYXcpOworICAgIH0KKworCisgICAgcHVibGljIGZpbmFsIHN0YXRpYyBSZWFkZXIgUkVBREVSID0gbmV3IFJlYWRlcigpOworCisgICAgcHJpdmF0ZSBzdGF0aWMgY2xhc3MgUmVhZGVyIGltcGxlbWVudHMgT0ZNZXNzYWdlUmVhZGVyPFUxNj4geworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIFUxNiByZWFkRnJvbShDaGFubmVsQnVmZmVyIGJiKSB0aHJvd3MgT0ZQYXJzZUVycm9yIHsKKyAgICAgICAgICAgIHJldHVybiBvZlJhdyhiYi5yZWFkU2hvcnQoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgaW50IGdldExlbmd0aCgpIHsKKyAgICAgICAgcmV0dXJuIDI7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFUxNiBhcHBseU1hc2soVTE2IG1hc2spIHsKKyAgICAgICAgcmV0dXJuIG9mUmF3KCAoc2hvcnQpIChyYXcgJiBtYXNrLnJhdykpOworICAgIH0KIH0KZGlmZiAtLWdpdCBhL2phdmFfZ2VuL3ByZS13cml0dGVuL3NyYy9tYWluL2phdmEvb3JnL29wZW5mbG93L3R5cGVzL1UzMi5qYXZhIGIvamF2YV9nZW4vcHJlLXdyaXR0ZW4vc3JjL21haW4vamF2YS9vcmcv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vcnMuamF2YSIsIG1zZz1tc2csIGdlbmVyYXRlX3NldHRlcnM9VHJ1ZSwgYnVpbGRlcj1UcnVlKQogCiAgICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgJHttc2cuaW50ZXJmYWNlLm5hbWV9IGdldE1lc3NhZ2UoKSB7CisgICAgICAgIHB1YmxpYyAke21zZy5pbnRlcmZhY2UubmFtZX0gYnVpbGQoKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyAke2ltcGxfY2xhc3N9KAogICAgICAgICAgICAgICAgICAgICAkeyIsXG4gICAgICAgICAgICAgICAgICAgICAgIi5qb2luKAogICAgICAgICAgICAgICAgICAgICAgICAgIFsgInRoaXMuezB9U2V0ID8gdGhpcy57MH0gOiBwYXJlbnRNZXNzYWdlLnswfSIuZm9ybWF0KHByb3AubmFtZSkKQEAgLTExMiw3ICsxMjEsNyBAQAogLy86OiBpbmNsdWRlKCJfZmllbGRfYWNjZXNzb3JzLmphdmEiLCBtc2c9bXNnLCBnZW5lcmF0ZV9zZXR0ZXJzPVRydWUsIGJ1aWxkZXI9VHJ1ZSkKIC8vCiAgICAgICAgIEBPdmVycmlkZQotICAgICAgICBwdWJsaWMgJHttc2cuaW50ZXJmYWNlLm5hbWV9IGdldE1lc3NhZ2UoKSB7CisgICAgICAgIHB1YmxpYyAke21zZy5pbnRlcmZhY2UubmFtZX0gYnVpbGQoKSB7CiAgICAgICAgICAgICByZXR1cm4gbmV3ICR7aW1wbF9jbGFzc30oCiAgICAgICAgICAgICAgICAgJHsiLFxuICAgICAgICAgICAgICAgICAgICAgICIuam9pbigKICAgICAgICAgICAgICAgICAgICAgIFsgInRoaXMuezB9U2V0ID8gdGhpcy57MH0gOiB7MX0uezJ9Ii5mb3JtYXQocHJvcC5uYW1lLCBpbXBsX2NsYXNzLCBwcm9wLmRlZmF1bHRfbmFtZSkKQEAgLTEyNCw2ICsxMzMsMTMgQEAKICAgICAgICAgLy86OiAjZW5kaWYKIAogICAg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GhfbWVtYmVyIGVsc2UgTm9uZSl9OwogLy86OiBlbGlmIHByb3AuaXNfcGFkOgpAQCAtMTU5LDEwICsxNzcsMTQgQEAKICAgICAgICAgICAgIGJiLnNraXBCeXRlcygoKGxlbmd0aCArICR7bXNnLmFsaWduLTF9KS8ke21zZy5hbGlnbn0gKiAke21zZy5hbGlnbn0gKSAtIGxlbmd0aCApOwogICAgICAgICAgICAgLy86OiAjZW5kaWYKIAorICAgICAgICAgICAgLy86OiBpZiBtc2cuZGF0YV9tZW1iZXJzOgogICAgICAgICAgICAgcmV0dXJuIG5ldyAke2ltcGxfY2xhc3N9KAogICAgICAgICAgICAgICAgICAgICAkeyIsXG4gICAgICAgICAgICAgICAgICAgICAgIi5qb2luKAogICAgICAgICAgICAgICAgICAgICAgICAgIFsgcHJvcC5uYW1lIGZvciBwcm9wIGluIG1zZy5kYXRhX21lbWJlcnNdKX0KICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgIC8vOjogZWxzZToKKyAgICAgICAgICAgIHJldHVybiBJTlNUQU5DRTsKKyAgICAgICAgICAgIC8vOjogI2VuZGlmCiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE4MCw3ICsyMDIsOSBAQAogLy86OiBpZiBwcm9wLmNfbmFtZSBpbiBmaWVsZHNfd2l0aF9sZW5ndGhfbWVtYmVyOgogICAgICAgICAgICAgaW50ICR7cHJvcC5uYW1lfVN0YXJ0SW5kZXggPSBiYi53cml0ZXJJbmRleCgpOwogLy86OiAjZW5kaWYKLS8vOjogaWYgcHJvcC5pc19kYXRhOgorLy86OiBpZiBwcm9wLmlzX3ZpcnR1YWw6CisvLzo6ICAgIGNvbnRpbnVlCisvLzo6IGVsaWYgcHJvcC5pc19kYXRhOgogICAgICAgICAgICAgJHtwcm9wLmphdmFfdHlwZS53cml0ZV9vcCh2ZXJzaW9uLCAibWVzc2FnZS4iICsgcHJvcC5uYW1lLCBwdWJfdHlwZT1UcnVlKX07CiAvLzo6IGVsaWYg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