Javascript Function: Formula for book dimensions from online calculator (some reverse engineering needed)

Job ID: 31583420

Budget: $30 – $250 USD

Amazon allows users to create books. They have this calculator tool to determine book dimensions.
https://kdp.amazon.com/en_US/cover-calculator

The user provides the paper type, page count and a few other parameters and the tool returns the various dimension for a book cover (spine size, hinge, margin etc.)

We need you to figure out the formulas they are using to generate hardcover dimensions and build it into a javascript function. Ideally, your function will take the parameters from the user and return the dimensions as a JSON object. Looking for a quick start and job if possible.