 			return currentSlot?.state == .validCard
 		}
 	}
-	
+
 	func createDocumentFromCurrentCard() -> Document {
 		let document = Document()
 		document.address = currentAddress

		}
		slotManager?.getSlot(withName: slot) {
			self.currentSlot = $0
			self.addObserver(self, forKeyPath: #keyPath(currentSlot.state), options: [.new, .initial], context: nil)
		}
	}

	func applicationWillTerminate(_ aNotification: Notification) {
		removeObserver(self, forKeyPath: #keyPath(slotManager.slotNames), context: nil)
	}

	func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
		return true
	}
}

extension Data {
	func hexEncodedString() -> String {
		return map { String(format: "%02hhx", $0) }.joined()
	}
}

			}
		}
		
		return true
	}

	@objc func discardDocumentUnless(document: Document, didSave: Bool, with context: Any?) {
		if !didSave {
			document.close()
		}
	}

	@IBAction open func duplicateDocument(_ sender: Any?) {
		_ = createDocumentFromCurrentCard()
	}

	func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
		return false
	}

	override func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
		if (menuItem.tag == 2) {
			return true
