Interestingly, I'm finding it hard to shake that initial visual image, even though I know it's wrong. Brains are weird.
https://news.ycombinator.com/item?id=7494093
https://news.ycombinator.com/item?id=7494440
bonus credit to DonHopkins https://news.ycombinator.com/item?id=18513120
For the philologist, from around 1780, The chapter of accidents: a comedy by Sophia Lee.
> Jacob: Dang it, doan't I zeay, I'll tell thee present...
> dang it, I thought at first I ha' zwounded...
https://archive.org/details/chapteraccident00leegoog/page/n4...
...But I also immediately think of Gary Larson.
My friend, have you noticed in these few years that I believe in particular attention to words? :)
It was pretty easy: Etymonline, which is part of my few core references as "dictionary of meaning" (as opposed to "dictionary of use"), gives the first clues at https://www.etymonline.com/search?q=dang . Then I looked for the original text and checked the details.