Medau Therapy Services GmbH | Schloss Hohenfels | 96450 Coburg
Medau Therapy Services GmbH | Schloss Hohenfels | 96450 Coburg
MEDAUtherapie Hygiene neu

MEDAUlogo Praxen für Logopädie

Ihr Partner für die Behandlung von Sprach-, Sprech-, Stimm- und Schluckstörungen an verschiedenen Standorten in Bayern

In den MEDAUlogo Praxen werden Sie von erfahrenen Lehrkräften und Therapeutinnen behandelt, die Expertinnen in ihrem jeweiligen Fachgebiet sind. Hiermit garantieren wir Ihnen eine optimale Behandlung nach aktuellen wissenschaftlichen Leitlinien.

MEDAUlogo ist ein Unternehmenszweig der Medau Therapy Services GmbH.

MEDAUlogo Praxen für Logopädie

Ihr Partner für die Behandlung von Sprach-, Sprech-, Stimm- und Schluckstörungen an verschiedenen Standorten in Bayern

In den MEDAUlogo Praxen werden Sie von erfahrenen Lehrkräften und Therapeutinnen behandelt, die Expertinnen in ihrem jeweiligen Fachgebiet sind. Hiermit garantieren wir Ihnen eine optimale Behandlung nach aktuellen wissenschaftlichen Leitlinien.

MEDAUlogo ist ein Unternehmenszweig der Medau Therapy Services GmbH.

BAMBERG

COBURG

NÜRNBERG

MÜNCHEN

OpenStreetMap

Mit dem Laden der Karte akzeptieren Sie die Datenschutzerklärung von OpenStreetMap Foundation.
Mehr erfahren

Karte laden

PGRpdiBjbGFzcz0ibGVhZmxldC1tYXAgV1BMZWFmbGV0TWFwIiBzdHlsZT0iaGVpZ2h0OjUwMHB4OyB3aWR0aDoxMDAlOyI+PC9kaXY+PHNjcmlwdD4Kd2luZG93LldQTGVhZmxldE1hcFBsdWdpbiA9IHdpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4gfHwgW107CndpbmRvdy5XUExlYWZsZXRNYXBQbHVnaW4ucHVzaChmdW5jdGlvbiAoKSB7Lyo8c2NyaXB0PiovCnZhciBiYXNlVXJsID0gJ2h0dHBzOi8ve3N9LnRpbGUub3BlbnN0cmVldG1hcC5vcmcve3p9L3t4fS97eX0ucG5nJzsKdmFyIGJhc2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nZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgfQogICAgICA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ob3InCiAgICBdOwogICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldOwogICAgICAgICAgICB2YXIgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgfQogICAgICAgIF9vcHRpb25zLmljb24gPSBuZXcgTC5JY29uKCBfb3B0aW9ucyApOwogICAgfQogICAgcmV0dXJuIF9vcHRpb25zOwp9KSgpOwp2YXIgbWFya2VyID0gTC5tYXJrZXIoCiAgICBbNDguMTI2MzU0MiwxMS41NTE1NzU4MDAwMDAwMjNdLCAKICAgIG1hcmtlcl9vcHRpb25zCik7CnZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CmlmIChtYXJrZXJfb3B0aW9ucy5kcmFnZ2FibGUpIHsKICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKTsKICAgICAgICB2YXIgbGF0ID0gbGF0bG5nLmxhdDsKICAgICAgICB2YXIgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgY29uc29sZS5sb2coJ2xlYWZsZXQtbWFya2VyIHk9JyArIGxhdCArICcgeD0nICsgbG5nKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBjb25zb2xlLmxvZygnbGVhZmxldC1tYXJrZXIgbGF0PScgKyBsYXQgKyAnIGx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lbnRHcm91cCgpOwp2YXIgbWFya2VyX29wdGlvbnMgPSAoZnVuY3Rpb24gKCkgewogICAgdmFyIF9vcHRpb25zID0geyJpY29uVXJsIjoiXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDE3XC8wOFwvbWFya2VyLnBuZyIsImljb25TaXplIjpbIjUxLDU4Il0sImljb25BbmNob3IiOlsiMjUuNSw1OCJdfTsKICAgIHZhciBpY29uQXJyYXlzID0gWwogICAgICAgICdpY29uU2l6ZScsIAogICAgICAgICdpY29uQW5jaG9yJywgCiAgICAgICAgJ3NoYWRvd1NpemUnLCAKICAgICAgICAnc2hhZG93QW5jaG9yJywKICAgICAgICAncG9wdXBBbmNob3InCiAgICBdOwogICAgdmFyIGRlZmF1bHRfaWNvbiA9IEwuSWNvbi5EZWZhdWx0LnByb3RvdHlwZS5vcHRpb25zOwogICAgaWYgKF9vcHRpb25zLmljb25VcmwpIHsKICAgICAgICAvLyBhcnJheXMgYXJlIHN0cmluZ3MsIHVuZm9ydHVuYXRlbHkuLi4KICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gaWNvbkFycmF5cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgewogICAgICAgICAgICB2YXIgb3B0aW9uX25hbWUgPSBpY29uQXJyYXlzW2ldOwogICAgICAgICAgICB2YXIgb3B0aW9uID0gX29wdGlvbnNbIG9wdGlvbl9uYW1lIF07CiAgICAgICAgICAgIC8vIGNvbnZlcnQgIjEsMiIgdG8gWzEsIDJdOwogICAgICAgICAgICBpZiAob3B0aW9uKSB7CiAgICAgICAgICAgICAgICB2YXIgYXJyID0gb3B0aW9uLmpvaW4oJycpLnNwbGl0KCcsJyk7CiAgICAgICAgICAgICAgICAvLyBhcnJheS5tYXAgZm9yIGllPDkKICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwLCBsZW5KID0gYXJyLmxlbmd0aDsgaiA8IGxlbko7IGorKykgewogICAgICAgICAgICAgICAgICAgIGFycltqXSA9IE51bWJlcihhcnJbal0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgX29wdGlvbnNbIG9wdGlvbl9uYW1lIF0gPSBhcnI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy8gZGVmYXVsdCBwb3B1cEFuY2hvcgogICAgICAgIGlmICghX29wdGlvbnMucG9wdXBBbmNob3IpIHsKICAgICAgICAgICAgLy8gc2V0IChyb3VnaGx5KSB0byBzaXplIG9mIGljb24KICAgICAgICAgICAgX29wdGlvbnMucG9wdXBBbmNob3IgPSAoZnVuY3Rpb24gKGlfc2l6ZSkgewogICAgICAgICAgICAgICAgLy8gY29weSBhcnJheQogICAgICAgICAgICAgICAgaV9zaXplID0gaV9zaXplLnNsaWNlKCk7CiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIC8vIGludmVyc2UgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIGlfc2l6ZVswXSA9IDA7CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gKj0gLTE7CiAgICAgICAgICAgICAgICAvLyBib3R0b20gcG9zaXRpb24gb24gcG9wdXAgaXMgN3B4CiAgICAgICAgICAgICAgICBpX3NpemVbMV0gLT0gMzsKICAgICAgICAgICAgICAgIHJldHVybiBpX3NpemU7CiAgICAgICAgICAgIH0pKF9vcHRpb25zLmljb25TaXplIHx8IGRlZmF1bHRfaWNvbi5pY29uU2l6ZSk7CiAgICAgICAgfQogICAgICAgIF9vcHRpb25zLmljb24gPSBuZXcgTC5JY29uKCBfb3B0aW9ucyApOwogICAgfQogICAgcmV0dXJuIF9vcHRpb25zOwp9KSgpOwp2YXIgbWFya2VyID0gTC5tYXJrZXIoCiAgICBbNDkuNDY4NTYsMTEuMDgxMTA5OTk5OTk5OTY3XSwgCiAgICBtYXJrZXJfb3B0aW9ucwopOwp2YXIgaXNfaW1hZ2UgPSBtYXAuaXNfaW1hZ2VfbWFwOwppZiAobWFya2VyX29wdGlvbnMuZHJhZ2dhYmxlKSB7CiAgICB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SsrKSB7CiAgICAgICAgICAgIHZhciBvcHRpb25fbmFtZSA9IGljb25BcnJheXNbaV07CiAgICAgICAgICAgIHZhciBvcHRpb24gPSBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXTsKICAgICAgICAgICAgLy8gY29udmVydCAiMSwyIiB0byBbMSwgMl07CiAgICAgICAgICAgIGlmIChvcHRpb24pIHsKICAgICAgICAgICAgICAgIHZhciBhcnIgPSBvcHRpb24uam9pbignJykuc3BsaXQoJywnKTsKICAgICAgICAgICAgICAgIC8vIGFycmF5Lm1hcCBmb3IgaWU8OQogICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbkogPSBhcnIubGVuZ3RoOyBqIDwgbGVuSjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyW2pdID0gTnVtYmVyKGFycltqXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXSA9IGFycjsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAvLyBkZWZhdWx0IHBvcHVwQW5jaG9yCiAgICAgICAgaWYgKCFfb3B0aW9ucy5wb3B1cEFuY2hvcikgewogICAgICAgICAgICAvLyBzZXQgKHJvdWdobHkpIHRvIHNpemUgb2YgaWNvbgogICAgICAgICAgICBfb3B0aW9ucy5wb3B1cEFuY2hvciA9IChmdW5jdGlvbiAoaV9zaXplKSB7CiAgICAgICAgICAgICAgICAvLyBjb3B5IGFycmF5CiAgICAgICAgICAgICAgICBpX3NpemUgPSBpX3NpemUuc2xpY2UoKTsKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgLy8gaW52ZXJzZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgaV9zaXplWzBdID0gMDsKICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAqPSAtMTsKICAgICAgICAgICAgICAgIC8vIGJvdHRvbSBwb3NpdGlvbiBvbiBwb3B1cCBpcyA3cHgKICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAtPSAzOwogICAgICAgICAgICAgICAgcmV0dXJuIGlfc2l6ZTsKICAgICAgICAgICAgfSkoX29wdGlvbnMuaWNvblNpemUgfHwgZGVmYXVsdF9pY29uLmljb25TaXplKTsKICAgICAgICB9CiAgICAgICAgX29wdGlvbnMuaWNvbiA9IG5ldyBMLkljb24oIF9vcHRpb25zICk7CiAgICB9CiAgICByZXR1cm4gX29wdGlvbnM7Cn0pKCk7CnZhciBtYXJrZXIgPSBMLm1hcmtlcigKICAgIFs0OS44OTA4MDExLDEwLjg5MzIwNDQwMDAwMDA1OV0sIAogICAgbWFya2VyX29wdGlvbnMKKTsKdmFyIGlzX2ltYWdlID0gbWFwLmlzX2ltYWdlX21hcDsKaWYgKG1hcmtlcl9vcHRpb25zLmRyYWdnYWJsZSkgewogICAgbWFya2VyLm9uKCdkcmFnZW5kJywgZnVuY3Rpb24gKCkgewogICAgICAgIHZhciBsYXRsbmcgPSB0aGlzLmdldExhdExuZygpOwogICAgICAgIHZhciBsYXQgPSBsYXRsbmcubGF0OwogICAgICAgIHZhciBsbmcgPSBsYXRsbmcubG5nOwogICAgICAgIGlmIChpc19pbWFnZSkgewogICAgICAgICAgICBjb25zb2xlLmxvZygnbGVhZmxldC1tYXJrZXIgeT0nICsgbGF0ICsgJyB4PScgKyBsbmcpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKCdsZWFmbGV0LW1hcmtlciBsYXQ9JyArIGxhdCArICcgbG5nPScgKyBsbmcpOwogICAgICAgIH0KICAgIH0pOwp9Cm1hcmtlci5hZGRUbyggZ3JvdXAgKTsKbWFya2VyLmJpbmRQb3B1cCh3aW5kb3cuV1BMZWFmbGV0TWFwUGx1Z2luLnVuZXNjYXBlKCcmbHQ7c3Ryb25nJmd0O01FREFVbG9nbyBIYWluc3RyYcOfZSZsdDsvc3Ryb25nJmd0OyZsdDticiAvJmd0OyZsdDticiZndDtIYWluc3RyYcOfZS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yIGljb25BcnJheXMgPSBbCiAgICAgICAgJ2ljb25TaXplJywgCiAgICAgICAgJ2ljb25BbmNob3InLCAKICAgICAgICAnc2hhZG93U2l6ZScsIAogICAgICAgICdzaGFkb3dBbmNob3InLAogICAgICAgICdwb3B1cEFuY2hvcicKICAgIF07CiAgICB2YXIgZGVmYXVsdF9pY29uID0gTC5JY29uLkRlZmF1bHQucHJvdG90eXBlLm9wdGlvbnM7CiAgICBpZiAoX29wdGlvbnMuaWNvblVybCkgewogICAgICAgIC8vIGFycmF5cyBhcmUgc3RyaW5ncywgdW5mb3J0dW5hdGVseS4uLgogICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBpY29uQXJyYXlzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7CiAgICAgICAgICAgIHZhciBvcHRpb25fbmFtZSA9IGljb25BcnJheXNbaV07CiAgICAgICAgICAgIHZhciBvcHRpb24gPSBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXTsKICAgICAgICAgICAgLy8gY29udmVydCAiMSwyIiB0byBbMSwgMl07CiAgICAgICAgICAgIGlmIChvcHRpb24pIHsKICAgICAgICAgICAgICAgIHZhciBhcnIgPSBvcHRpb24uam9pbignJykuc3BsaXQoJywnKTsKICAgICAgICAgICAgICAgIC8vIGFycmF5Lm1hcCBmb3IgaWU8OQogICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGxlbkogPSBhcnIubGVuZ3RoOyBqIDwgbGVuSjsgaisrKSB7CiAgICAgICAgICAgICAgICAgICAgYXJyW2pdID0gTnVtYmVyKGFycltqXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBfb3B0aW9uc1sgb3B0aW9uX25hbWUgXSA9IGFycjsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAvLyBkZWZhdWx0IHBvcHVwQW5jaG9yCiAgICAgICAgaWYgKCFfb3B0aW9ucy5wb3B1cEFuY2hvcikgewogICAgICAgICAgICAvLyBzZXQgKHJvdWdobHkpIHRvIHNpemUgb2YgaWNvbgogICAgICAgICAgICBfb3B0aW9ucy5wb3B1cEFuY2hvciA9IChmdW5jdGlvbiAoaV9zaXplKSB7CiAgICAgICAgICAgICAgICAvLyBjb3B5IGFycmF5CiAgICAgICAgICAgICAgICBpX3NpemUgPSBpX3NpemUuc2xpY2UoKTsKICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgLy8gaW52ZXJzZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgaV9zaXplWzBdID0gMDsKICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAqPSAtMTsKICAgICAgICAgICAgICAgIC8vIGJvdHRvbSBwb3NpdGlvbiBvbiBwb3B1cCBpcyA3cHgKICAgICAgICAgICAgICAgIGlfc2l6ZVsxXSAtPSAzOwogICAgICAgICAgICAgICAgcmV0dXJuIGlfc2l6ZTsKICAgICAgICAgICAgfSkoX29wdGlvbnMuaWNvblNpemUgfHwgZGVmYXVsdF9pY29uLmljb25TaXplKTsKICAgICAgICB9CiAgICAgICAgX29wdGlvbnMuaWNvbiA9IG5ldyBMLkljb24oIF9vcHRpb25zICk7CiAgICB9CiAgICByZXR1cm4gX29wdGlvbnM7Cn0pKCk7CnZhciBtYXJrZXIgPSBMLm1hcmtlcigKICAgIFs1MC4yMTc3NDgxLDExLjE0MTU5NThdLCAKICAgIG1hcmtlcl9vcHRpb25zCik7CnZhciBpc19pbWFnZSA9IG1hcC5pc19pbWFnZV9tYXA7CmlmIChtYXJrZXJfb3B0aW9ucy5kcmFnZ2FibGUpIHsKICAgIG1hcmtlci5vbignZHJhZ2VuZCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgbGF0bG5nID0gdGhpcy5nZXRMYXRMbmcoKTsKICAgICAgICB2YXIgbGF0ID0gbGF0bG5nLmxhdDsKICAgICAgICB2YXIgbG5nID0gbGF0bG5nLmxuZzsKICAgICAgICBpZiAoaXNfaW1hZ2UpIHsKICAgICAgICAgICAgY29uc29sZ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