Hydraulic Seal

Best Benchtop CNC Mills in 2022 for Machining Metal

Best Benchtop CNC Mills in 2022 for Machining Metal

If you're looking for a benchtop CNC Mill that can machine hard metals and is affordable to a hobbyist, then this guide will walk you through all the best options available on the market.

A benchtop mill is used primarily for machining metals such as aluminum, steel, and titanium.

Unlike desktop CNC routers which are used on soft (comparatively) materials like wood, a benchtop mill is much more powerful and has a lot more torque.

If you are looking for Desktop CNC router machines that can mill wood, plastic, aluminum, and other soft materials instead of steel then this is what you need to read-Best Desktop CNC Router Machines [2022].

To write this guide I studied the different types of benchtop CNC mills available on the market in various price ranges.

I drew from my experience and feedback from people in the industry to choose the ideal mill for every type of user.

During my research, I considered various important parameters of a benchtop CNC mill like travel lengths (X and Y), cutting speeds, RPM, accuracy, drive system (ball vs screw), rigidity, and customer support among others.

With this data, I chose the best benchtop mills under $5,000 (small CNC mills) and also the best in the range $5,000-$10,000.

I have specifically avoided Chinese CNC mills from brands with low reputation in this guide.

All the mills in this guide are CNC mills with steel milling capability and they fit on a desk.

MellowPine is reader-supported. When you buy through links on my site, I may earn an affiliate commission at no extra cost to you.

Here are the best Benchtop CNC Mills available today [2022]:

Benchtop CNC Mill Category
1 Sherline 12″ Deluxe CNC Mill Under $5,000
2 TAIG 2019 CNC MILL Under $5,000
3 Tormach PCNC 440 $5,000-$10,000
4 Precision Matthews PM-728VT CNC Mill (Converted) $5,000-$10,000

Best Benchtop CNC Mills [2022]

These mills are excellent metal CNC machines and should be your top choice if your stock size is not too large.

Best Benchtop CNC Mills under $5,000 (Small CNC Mills)

1. Sherline 14 Inch Deluxe CNC Mill System

Sherline 14 inch Deluxe CNC System

Costing just less than $4,000, the Sherline 14" CNC Mill is a good option for metal milling at low speeds for hobbyists.

The Sherline benchtop mill has been the starter mill for many hobbyists since the 80s. Many of those mills are still in operation with their owners.

Sherline calls it the deluxe CNC Mill. This mill is also called a Sherline 5400.

For the price, you get a 14" base benchtop mill, a full CNC control system, and a computer.

This is an affordable CNC mill that g

The display monitor for the computer is not part of the package.

This benchtop milling machine is ideal for small hobbyists jobs with the stock small enough to fit on the table.

This mill can do excellent milling on Aluminum as expected.

A common question everyone has is if a Sherline CNC mill can cut steel or titanium. The short answer is yes.

Sherline can be used to mill titanium, stainless steel, and cast iron, but you need to go slow, take light passes and use a coolant.

You will need to keep the depth of cut to around 0.030", RPM of around 500 and use a coolant like Kool Mist.

If you are a beginner, it will take some practice to get excellent results using a Sherline.

But know that it is possible to do very good work on the Sherline. Just that the feed rates might be a bit low for professional machinists.

Tryally Tech is a Youtuber who does amazing work using Sherline mills.

Sherline CNC Milling by Tryally Tech

This machine is rigid enough to work on even a 1" thick stock of steel, provided the feed rate is slow.

The maximum travel speed of this CNC mill is 22 ipm in the X, Y, and Z axes.

The 14" Sherline CNC mill has a 2.75″ (70 mm) x 13.0″ (330 mm) table.

Note that the travel length on X-axis is 8.65", 7" on Y-axis, and 5.38" on Z-axis. This actually determines how big a piece you can mill on this benchtop CNC machine.

The weight of this mill is 40 lb., which means you can easily carry it around.

Thus the Sherline is an excellent small CNC mill for metal milling at a very affordable price.

What's the electronics set up in the Sherline CNC Mill?

Well, the Sherline uses a custom 4 axis stepper driver box, that's fitted inside the computer, three stepper motors for each axis, and the LinuxCNC (EMC2) control software.

The stepper drivers have a 4A peak current rating and the NEMA 23 stepper motors having a maximum holding torque of 136 oz.in.

If you wish, you can use any other stepper motor of your choice provided it is NEMA 23 as it has to fit the motor mount.

This mill uses lead screws for the drive, which is not ideal for backlash, but it will do fine for most tasks.

It's also possible in linuxCNC to compensate for the backlash to reduce the backlash effect you might have due to the lead screw system.

In the hands of a good machinist, the Sherline mini CNC mill can be used to make parts with a tolerance of 0.001".

The lubrication on this Sherline mini CNC mill is achieved through a mill oiler that sits in the corner of the mill saddle. This reservoir distributes lubricant to the X and Y leadscrews.

The spindle on this mill can run between 70-2800 RPM speed. The speed can be controlled using the electronic controller knob on the headstock.

If you looking to choose a spindle for your CNC, then check out this guide- Best CNC Spindles in 2022 for a Smooth Cutting Experience

In terms of accessories and upgrades, I can point out some bang for the buck upgrades.

If you don't have a milling vise, you can get the milling vise, Step block hold-down set, and an end mill holder as a bundle which they call package A.

They also sell a tooling plate accessory, which is really useful for tramming, holding down odd parts, and also protects the work table.

The accordion way cover set is a useful accessory to collect the milling chips and prevent them from falling on the lead screws. This can help substantially improve the life of the lead screws.

Sherline Accordion way cover set

Sherline also has an optional 18" long mill table that adds 5" of extra X travel at a cost of $200 more.

A key aspect of Sherline in my opinion is customizability. Sherline sells all their products to have backward compatibility.

This means an accessory that's released in the future will mostly be compatible with the mill you have right now. This lets you upgrade without replacing the entire mill.

If you want to build the CNC electronics and control on your own, Sherline sells "CNC ready" mills which have the handwheels removed and replaced with stepper motors.

You can install custom controls to this "CNC ready" mill quite easily.

If you already have a Sherline benchtop mill, then Sherline also sells the mechanical and electronic components to convert into a benchtop CNC mill.

This CNC mill comes as a kit and needs to be assembled before you can use it. Of course, the manual for Sherline is as detailed as they come.

If you want to mill softer materials as well in addition to metals, then a desktop CNC mill might be a better choice than a benchtop mill.

The company Sherline products inc is based in Vista, CA, and has been in operation since 1974 and all their products are designed, manufactured, and assembled in their factory in California.

Sherline offers a 1-year warranty on their product, provided it's not used for production work.

Sherline has a reputation for excellent customer service and prompt communication.

All in all, this Sherline mill is an excellent, affordable, and reliable option for hobbyists who want to do metal milling for their personal projects and are not looking for quick milling work.

Sherline 14 Inch Deluxe CNC Mill System
  • Includes Sherline's 2000 Mill with a 14" base
  • Mill goes in 8 directions

You might be interested in these:

2. TAIG 2019 CNC MILL

TAIG 2019CNC

TAIG tools is a company based in Chandler, Arizona that makes benchtop CNC mills in the hobbyist category similar to Sherline.

The number 2019 is just a model number and has nothing to do with the year 2019.

This benchtop mill, which TAIG calls a "micro mill" is priced at $2,495.00.

TAIG is the cheapest CNC mill that you can buy unless you convert a mini mill to CNC one.

Weighing in at 105 lbs, this mill is significantly heavier than the Sherline mill which is only 33 lbs.

The travel length of this mill is 12" on X-axis and 5.5" on the Y axis, which is higher than the Sherline mill.

TAIG is a tabletop mill with size 3-½ x 18.4 inches, which is larger compared to the 2.75″ x 13.0″ table size on the Sherline.

Unlike the Sherline, this mill does not ship with a computer, so you need to factor that into the price.

But this also means you can use a computer of your choice to run this tabletop mill.

Like the Sherline, the TAIG 2019 uses lead screws on X, Y, and Z axes. TAIG does sell a ball screw version called TAIG 5019 CNC which costs around $500 more.

You can minimize the backlash a lot more with the ballscrew version, however even with the TAIG 2019 CNC, you can compensate for the backlash by adjusting the software.

Mach3 control software is used by the TAIG 2019 CNC, unlike the Sherline mill above which uses LinuxCNC.

Some people prefer LinuxCNC over Mach3. The best option, in that case, is to buy the "CNC ready" version of the TAIG 2019 mill and use your custom control system.

I talk in detail about CNC software choices here-Best CNC Software [2022] for Hobbyists and Pros [Free and Paid]

Just like the Sherline, with some experience, you can mill metal with a 0.001" tolerance on the TAIG mill.

The NEMA 23 stepper motors on the TAIG have a 200 oz.in holding torque compared to 130 oz.in on the Sherline.

The traverse speed on the TAIG is 30 ipm, whereas the Sherline has a speed of 22 ipm on the X, Y, and Z axes.

This is again not significant as you are generally going to operate the machine at a low speed.

TAIG offers a 2019 DSLS version of this CNC mill, which costs $500 more.

What you get with the extra $500 is closed-loop stepper motors instead of open-loop stepper motors as in the cheaper version.

The closed-loop version alerts you in case there are missed steps and you can start over.

Also, the DSLS version has a higher rapid traverse speed of 60 ipm compared to 30 ipm on the normal version.

In my view, this upgrade is unnecessary as you are probably going to run the mill very slowly and the stepper motors that are used these days have excellent mid-band compensation minimizing missed steps significantly.

If you are doing critical work with expensive stock materials, then the DSLS version might be worth it to you. Also, make sure to maintain the ways of the mill with proper lubrication.

If you have the extra budget, I suggest you choose the ball screw version, i.e, TAIG 5019 CNC mill which costs $500 more than the TAIG 2019 CNC mill.

The TAIG 2019 can cut aluminum, steel, and titanium among other materials.

Milling on the TAIG 2019 CNC MIll

A typical safe depth of cut you can use on steel would be 0.030" although TAIG claims you can do a 0.125" single pass cut in mild steel using this machine.

With small benchtop mills like TAIG and Sherline, if you are a beginner, you should start with a shallow depth of cut and increase the depth slowly.

This mill comes as a kit and needs to be assembled. Although TAIG sends a manual with the kit, documentation on the Sherline is magnitudes better.

TAIG offers a 2-year warranty on its machine. Similar to Sherline, TAIG is also known for providing good support to their customers.

Overall, the TAIG is a machine with bigger travel lengths and lower cost compared to Sherline mills with similar specs.

Sherline 12" CNC Mill v/s TAIG 2019 CNC Mill

I'd still give a slight edge to the Sherline mill due to the better customer support, documentation, and continued compatibility with even old models of theirs.

The larger X travel on the TAIG can be matched by buying the extended 18" mill table from Sherline.

Both are highly affordable CNC mills targeted primarily at hobbyists.

Sherline and TAIG sell highly popular small CNC lathes as well. I have talked about them here-Best CNC lathes in 2022 for Machining Metal.

Best Benchtop CNC Mills between $5,000-$10,000

At this price range, you have the option of either opting for a big brand CNC benchtop mill like the Tormach PCNC 440 or a retrofitted benchtop mill from Precision Matthews or Grizzly.

Although a big brand, the Tormach is really only an entry-level mill among the CNCs used for commercial production. I talk more about it here- How much do CNC machines cost?

1. Tormach PCNC 440- Best High Precision Benchtop CNC Mill with Tool Changer

Tormach PCNC 440 Mill with Stand

The Tormach PCNC 440 is the entry-level benchtop mill of the well-known brand Tormach Inc, based in Waunakee, WI.

There are several packages offered within the PCNC 440 by Tormach, and the starter package for $9745 + Shipping is a good choice for many.

Although you can get the entry-level package which is cheaper by around $3,750, you miss out on the high-quality mill stand, the chip tray, tooling, and vise from Tormach.

This benchtop mill weighs almost 600 pounds and you do need a strong cast iron stand for operating it.

Cast Iron is especially helpful for dampening vibrations which can affect the cut quality.

If you decide to skip the stand, you could probably get a strong enough stand from any local shop for under $500 or buy a stand like this one from amazon.

The PCNC 440 mill ships pre-assembled and you only need to place it on the stand after putting the chip tray on the stand.

Since this weighs 600 pounds, you definitely need an engine hoist or something similar to place this machine on the stand.

You need a space of at least 42 in. × 36 in. for this mill in your shop and a bit more for accessing the mill from the back and the front.

However, it is a tabletop CNC mill, and not so large that it can be placed only on the floor.

The PCNC 440 uses ball screws for all three axes, which prevents backlash and improves accuracy.

Like most machines at this price level, the Tormach uses dovetail ways for slides which make for easy movement provided lubrication is done properly.

The cutting area or the work envelope that you get with this mill is 10" x 6.25", which is actually a bit lesser than the TAIG mill.

The Z-axis travel that you get is 10" which is quite good.

This Tormach mill has a sophisticated lubrication system with metal braided oil lines running to each axis for lubricating the ball screws and a manual oil pump as well.

The Accordion way covers on this mill help protect the ball screws from chips.

So how do the electronics of this machine look?

All the electronics (except the controller) of this mill are placed on the top right of the mill in a safe and classy metallic enclosure.

The PCNC 440 uses NEMA 34 stepper motors for all three axes, unlike the TAIG and Sherline mills which use NEMA 23 stepper motors. This makes this machine much more powerful.

Of course, the TAIG and Sherline cannot use the NEMA 34 as the frame is not rigid enough to sustain that kind of torque. This also speaks to how powerful the frame of the Tormach is.

The spindle motors on this mill can reach up to 10,000 RPM at a power of 0.75 HP. The spindles use an R8 collet.

The pathpilot controller is what the Tormach uses for all its entry-level mills and the PCNC 440 uses it as well.

Pathpilot Controller Interface

Pathpilot software is loved by most of its users due to its ease of use, safety stop buttons, and excellent integration with Tormach machines.

Pathpilot is also compatible with most CAD/CAM programs as well.

The PCNC 440 mill is capable of cutting almost anything be it steel, titanium, stainless steel, cast iron or aluminum.

The premium package of the Tormach PCNC 440 ships with an enclosure and a power drawbar but at an additional cost of around $3,000.

The enclosure is made of steel and well designed. There are openable transparent windows on the enclosure to give easy access to the mill.

The power drawbar is a nifty tool changer add-on that allows quick change of tools by pressing a power button instead of changing it manually using two wrenches.

Tormach Power Drawbar helps change tooling with the push of a button

If you want to mix features from various packages, Tormach allows that using their "build your own" package option.

Although this machine is manufactured by Tormach in China, the quality control at Tormach is good enough to ensure a quality mill.

Tormach offers a one-year repair or replacement warranty on all its machines and accessories.

Tormach also has a reputation for next-day spare part deliveries, being very responsive to customer queries, and overall excellent customer support.

The Tormach PCNC 440 is overall a much bigger, heavier, and rigid machine compared to the Sherlines and the TAIGs.

Tormach is bought by hobbyists looking for high performance even for their personal projects without having to tinker with their machine too much for metal milling.

Also, note that the Tormach comes pre-assembled and not as a kit like the Sherline or TAIG.

It is also for professionals who want to get started with entry-level commercial work without risking too much money into a big mill.

A much more detailed review of this CNC mill- Tormach PCNC 440 CNC Mill Review [2022]

2. Converted Precision Matthews PM-728VT CNC Mill

Procut CNC PM-728VT Converted CNC Mill

Costing $5,695.00, this CNC converted Precision Matthews mill from Procut CNC is a good option for those who prefer the bulk and rigidity of a good old benchtop mill.

The PM-728VT mill without the CNC conversion costs $3,500 to buy from Precision Matthews.

The extra $3,285 you pay will get you a converted CNC mill with ball screw drives instead of the lead screw drives on the original machine and a plexiglass enclosure.

You also get the complete electronics to run the CNC mill except for the computer.

Firstly, the PM-728VT weighs 350 lbs., and is a highly popular mill by Precision Matthews.

Although this mill is manufactured in Taiwan, the quality was always there.

It has a table size of 7" x 28". The Travel length with full way support is 8.5" (Y-axis) x 17-¾" (X-axis). This is much larger than the PCNC 440 mill.

The vertical travel height is 16", which is almost double that of the other mills on this list.

This mill uses a brushless DC motor for the spindle with a smooth belt drive system that's much quieter than other converted benchtop CNC mills like the Grizzly G0704 CNC Mill.

The spindle has an R8 taper with a 75-4000 RPM speed. There is a control knob for varying the RPM of the spindle on this benchtop mill.

Note that the RPM is much less than the 10,000 on the Tormach PCNC 400 mill.

So what are the parts used for converting this benchtop mill to a CNC benchtop mill?

On the hardware end, the lead screws have been replaced with double ball screw nuts.

Procut CNC PM-728VT Ball Screw Drive

The double ball nuts result in steadier torques, lesser friction, and longer life cycle compared to single ball nut systems.

On the electronics end, the Z-axis handles on the manual mill have been replaced by NEMA 34 stepper motors while the X and Y axes have NEMA 23 stepper motors.

In the standard version of the CNC benchtop mill supplied by procutCNC for $6,285.00, the Ethernet SmoothStepper controller for Mach3 software has been used.

However, you can choose to have the Acorn CNC controller (from centroid CNC) which runs on the Acorn software at an added cost of around $390.

The accuracy promised by procut CNC on this converted mill is .0015".

You can cut almost anything on this CNC including aluminum, stainless steel and titanium.

Procut CNC is based in Minneapolis, MN and they offer a 1 year repair or replace warranty on all their supplied parts.

If you find this price too steep, you can opt for a DIY CNC retrofit kit instead and do the conversion yourself.

But you need to consider if the extra time that you spend on it would be worth the difference in cost between buying this readymade CNC v/s DIY conversion.

If the conversion is not successful, expect perpetual tinkering with the machine instead of doing milling.

If you wish to do the conversion yourself, this might be useful to you- Mini Mill CNC Conversion using a kit for Your Garage Shop.

In that case, you can purchase the hardware components and electronic components from either Procut CNC or Arizona CNC kits.

Procut CNC currently sells conversion kits for Precision Matthews PM-728VT, PM-25MV, PM-30MV, and the Grizzly G0704 CNC benchtop mills.

Arizona CNC currently offers kits for Precision Matthews PM-25MV, PM-30MV and PM-940 CNC mills.

Note that Procut CNC also sells converted, ready-to-use PM-25MV (~$4795), PM-30MV (~$5195), and Grizzly G0704 benchtop CNC mills but if you can afford it, I recommend you choose the PM-728VT CNC mill.

Tormach PCNC 440 v/s PM-728VT Converted CNC

Overall, if you need the much larger workspace offered by the PM-728VT compared to the PCNC 440, you should opt for PM-728VT.

However, you miss out on the excellent customer support, the much higher RPM which you need if you do detailed parts, and future upgrades (in case you want) such as auto tool changers and power drawbars available for Tormach if you choose the converted mill.

Also, the Tormach has a much better resale value if you ever decide to buy a better mill. The converted CNC, not so much.

If you are someone who can find your way around things, then this converted mill will be a good choice, if you are a beginner, then probably not as you won't get much hand-holding.

Buyers Guide: Things to Consider When Choosing a Benchtop CNC Mill

1. Table Size and Travel Distance

You need to choose a table that's large enough to place your intended stock on it.

However, the X and Y travel distance is the most important factor that determines how big a piece you can mill on the CNC.

2. Rigidity

For any CNC machine, the rigidity could be a major limiting factor in terms of what it can mill.

For milling steel, you need your mill to have the required rigidity. The heavier the better in a way.

3. RPM and Drive on the Spindle System

For milling small detailed parts on steel, you generally need an RPM of 6,000 or higher.

It is possible to manage with less, but it will slow you down.

A brushless DC motor and belt drive are the best options for the Spindle system.

4. Ball Screw v/s Lead Screw

A good quality ball screw drive can eliminate backlash that could be present in screw drive systems.

5. Software

Make sure the software that you choose has good support, documentation and a community around it. LinuxCNC, Pathpilot and Mach3 are good choices here.

6. Upgrades

Choose the upgrades carefully considering your future requirements as well. Power drawbars and Tool changers are highly useful upgrades while servos might not really be necessary.

Also enclosures and chip trays save a lot of time in cleanup.

7. Precision

A 0.001 precision is considered standard for most benchtop CNC mills used on metals.

If the manufacturer promises accuracy higher than that, take it with a grain of salt as there too many factors involved in determining this number on a machine.

8. New CNC mill v/s Retrofitted CNC Mill

Retrofitted mills typically come with larger work area compared to new CNC mills.

However Retrofit mills can lack in customer support and have little resale value.

About John

Hey I'm John. I talk about CNCs and Power Tools at Mellowpine. I'm a CNC hobbyist who has been making CNCs and writing about CNCs for a while. I currently also work as a consultant for business owners and hobbyists setting up their own CNCs. If you have any questions related to CNC, I'd be happy to answer them. Reach me at john@mellowpine.com
John

Hey I'm John. I talk about CNCs and Power Tools at Mellowpine. I'm a CNC hobbyist who has been making CNCs and writing about CNCs for a while. I currently also work as a consultant for business owners and hobbyists setting up their own CNCs. If you have any questions related to CNC, I'd be happy to answer them. Reach me at john@mellowpine.com

Thanks for signing up.
Some error occured. Please try again.

Comments

The comments are closed.

',dialog:'',content:'',header:'',headerClose:'',body:'',footer:'',backdrop:''},k=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));if(n.id=a(),n.el=null,n._html={},n._events={},n._visible=!1,n._options=f({},t.options,e),n._templates=f({},t.templates,e.templates||{}),n._html.appendTo=document.querySelector(n._options.appendTo),n._scrollbarWidth=c(),null===n._options.buttons&&(n._options.buttons=t.buttons.dialog),n._options.el){var s=n._options.el;if("string"==typeof n._options.el&&!(s=document.querySelector(n._options.el)))throw new Error("Selector: DOM Element "+n._options.el+" not found.");l(s,"modal",n),n.el=s}else n._options.construct=!0;return n._options.construct?n._render():n._mapDom(),n}return s(t,e),u(t,null,[{key:"alert",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new t(f({},y,{title:e,content:!1,construct:!0,headerClose:!1,buttons:t.buttons.alert},n))}},{key:"confirm",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new t(f({},y,{title:e,content:!1,construct:!0,headerClose:!1,buttons:t.buttons.confirm},n))}},{key:"templates",set:function(e){this._baseTemplates=e},get:function(){return f({},g,t._baseTemplates||{})}},{key:"buttons",set:function(e){this._baseButtons=e},get:function(){return f({},b,t._baseButtons||{})}},{key:"options",set:function(e){this._baseOptions=e},get:function(){return f({},y,t._baseOptions||{})}},{key:"version",get:function(){return"0.9.0"}}]),u(t,[{key:"_render",value:function(){var e=this._html,t=this._options,n=this._templates,i=!!t.animate&&t.animateClass;return e.container=d(n.container),e.dialog=d(n.dialog),e.content=d(n.content),e.header=d(n.header),e.headerClose=d(n.headerClose),e.body=d(n.body),e.footer=d(n.footer),i&&e.container.classList.add(i),this._setHeader(),this._setContent(),this._setFooter(),this.el=e.container,e.dialog.appendChild(e.content),e.container.appendChild(e.dialog),this}},{key:"_mapDom",value:function(){var e=this._html,t=this._options;return this.el.classList.contains(t.animateClass)&&(t.animate=!0),e.container=this.el,e.dialog=this.el.querySelector(".modal-dialog"),e.content=this.el.querySelector(".modal-content"),e.header=this.el.querySelector(".modal-header"),e.headerClose=this.el.querySelector(".modal-header .close"),e.body=this.el.querySelector(".modal-body"),e.footer=this.el.querySelector(".modal-footer"),this._setHeader(),this._setContent(),this._setFooter(),this}},{key:"_setHeader",value:function(){var e=this._html,t=this._options;t.header&&e.header&&(t.title.nodeName?e.header.innerHTML=t.title.outerHTML:"string"==typeof t.title&&(e.header.innerHTML='"),null===this.el&&e.headerClose&&t.headerClose&&e.header.appendChild(e.headerClose),t.construct&&e.content.appendChild(e.header))}},{key:"_setContent",value:function(){var e=this._html,t=this._options;t.content&&e.body&&("string"==typeof t.content?e.body.innerHTML=t.content:e.body.innerHTML=t.content.outerHTML,t.construct&&e.content.appendChild(e.body))}},{key:"_setFooter",value:function(){var e=this._html,t=this._options;t.footer&&e.footer&&(t.footer.nodeName?e.footer.ineerHTML=t.footer.outerHTML:"string"==typeof t.footer?e.footer.innerHTML=t.footer:e.footer.children.length||t.buttons.forEach(function(t){var n=document.createElement("button");l(n,"button",t),n.innerHTML=t.text,n.setAttribute("type","button");for(var i in t.attr)n.setAttribute(i,t.attr[i]);e.footer.appendChild(n)}),t.construct&&e.content.appendChild(e.footer))}},{key:"_setEvents",value:function(){var e=(this._options,this._html);this._events.keydownHandler=this._handleKeydownEvent.bind(this),document.body.addEventListener("keydown",this._events.keydownHandler),this._events.clickHandler=this._handleClickEvent.bind(this),e.container.addEventListener("click",this._events.clickHandler),this._events.resizeHandler=this._handleResizeEvent.bind(this),window.addEventListener("resize",this._events.resizeHandler)}},{key:"_handleClickEvent",value:function(e){var t=this;h(e.target).every(function(n){return!("HTML"===n.tagName||!0!==t._options.backdrop&&n.classList.contains("modal")||n.classList.contains("modal-content")||("modal"===n.getAttribute("data-dismiss")?(t.emit("dismiss",t,e,l(e.target,"button")),t.hide(),1):n.classList.contains("modal")&&(t.emit("dismiss",t,e,null),t.hide(),1)))})}},{key:"_handleKeydownEvent",value:function(e){27===e.which&&this._options.keyboard&&(this.emit("dismiss",this,e,null),this.hide())}},{key:"_handleResizeEvent",value:function(e){this._resize()}},{key:"show",value:function(){var e=this,t=this._options,n=this._html;return this.emit("show",this),this._checkScrollbar(),this._setScrollbar(),document.body.classList.add("modal-open"),t.construct&&n.appendTo.appendChild(n.container),n.container.style.display="flex",n.container.scrollTop=0,!1!==t.backdrop?(this.once("showBackdrop",function(){e._setEvents(),t.animate&&n.container.offsetWidth,n.container.classList.add(t.animateInClass),setTimeout(function(){e._visible=!0,e.emit("shown",e)},t.transition)}),this._backdrop()):(this._setEvents(),t.animate&&n.container.offsetWidth,n.container.classList.add(t.animateInClass),setTimeout(function(){e._visible=!0,e.emit("shown",e)},t.transition)),this._resize(),this}},{key:"toggle",value:function(){this._visible?this.hide():this.show()}},{key:"_resize",value:function(){var e=this._html.container.scrollHeight>document.documentElement.clientHeight;this._html.container.style.paddingLeft=!this.bodyIsOverflowing&&e?this._scrollbarWidth+"px":"",this._html.container.style.paddingRight=this.bodyIsOverflowing&&!e?this._scrollbarWidth+"px":""}},{key:"_backdrop",value:function(){var e=this,t=this._html,n=this._templates,i=this._options,o=!!i.animate&&i.animateClass;t.backdrop=d(n.backdrop),o&&t.backdrop.classList.add(o),t.appendTo.appendChild(t.backdrop),o&&t.backdrop.offsetWidth,t.backdrop.classList.add(i.animateInClass),setTimeout(function(){e.emit("showBackdrop",e)},this._options.backdropTransition)}},{key:"hide",value:function(){var e=this,t=this._html,n=this._options,i=t.container.classList;if(this.emit("hide",this),i.remove(n.animateInClass),n.backdrop){t.backdrop.classList.remove(n.animateInClass)}return this._removeEvents(),setTimeout(function(){document.body.classList.remove("modal-open"),document.body.style.paddingRight=e.originalBodyPad},n.backdropTransition),setTimeout(function(){n.backdrop&&t.backdrop.parentNode.removeChild(t.backdrop),t.container.style.display="none",n.construct&&t.container.parentNode.removeChild(t.container),e._visible=!1,e.emit("hidden",e)},n.transition),this}},{key:"_removeEvents",value:function(){this._events.keydownHandler&&document.body.removeEventListener("keydown",this._events.keydownHandler),this._html.container.removeEventListener("click",this._events.clickHandler),window.removeEventListener("resize",this._events.resizeHandler)}},{key:"_checkScrollbar",value:function(){this.bodyIsOverflowing=document.body.clientWidth0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,r,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],r=n.length,o=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=r;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=a;break}if(o