cask "smart-converter-pro" do
  version "3.1.6"
  sha256 "11dd10462c6823a63e46f935817f86e8e263c1e9a6a43c64a8dca56344b45b66"

  url "https://download.shedworx.com/scp#{version.major}/SmartConverterPro-#{version}.dmg"
  name "Smart Converter Pro"
  desc "Video converter"
  homepage "https://shedworx.com/smart-converter-pro"

  livecheck do
    url "https://shedworx.com/download/?product=scp3",
        user_agent: :browser
    regex(/href=.*?SmartConverterPro[._-]v?(\d+(?:\.\d+)+)\.dmg/i)
  end

  depends_on :macos

  app "Smart Converter Pro #{version.major}.app"

  zap trash: [
    "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.shedworx.smartconverter.sfl*",
    "~/Library/Containers/com.shedworx.smartconverter",
  ]
end
