[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "content": "name: Bug Report\ndescription: Report a reproducible bug in Jottre.\nlabels:\n  - bug\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for taking the time to file a bug report! Please fill out the sections below so we can reproduce and address the issue quickly.\n\n  - type: input\n    id: app_version\n    attributes:\n      label: App version\n      description: The version of Jottre where you observed the bug.\n      placeholder: e.g. 2.6.8\n    validations:\n      required: true\n\n  - type: dropdown\n    id: platform\n    attributes:\n      label: Platform\n      description: The platform where the bug occurred.\n      options:\n        - iOS\n        - iPadOS\n        - macOS\n    validations:\n      required: true\n\n  - type: input\n    id: platform_version\n    attributes:\n      label: Platform version\n      description: The version of the platform where the bug occurred.\n      placeholder: e.g. 17.4\n    validations:\n      required: true\n\n  - type: textarea\n    id: given\n    attributes:\n      label: Given\n      description: What is the precondition for this bug to occur? Include any additional context not covered by the fields above.\n      placeholder: Describe the state of the app and any relevant setup before the bug occurs.\n    validations:\n      required: true\n\n  - type: textarea\n    id: when\n    attributes:\n      label: When\n      description: What interactions take place for this bug to occur? List the steps as precisely as possible.\n      placeholder: |\n        1. Open ...\n        2. Tap ...\n        3. ...\n    validations:\n      required: true\n\n  - type: textarea\n    id: then\n    attributes:\n      label: Then\n      description: What is the outcome of the described precondition and interaction?\n      placeholder: Describe the actual behaviour, including any error messages, crashes, or visual glitches.\n    validations:\n      required: true\n\n  - type: textarea\n    id: expected\n    attributes:\n      label: Expected\n      description: What is the wanted behaviour of the precondition and interaction?\n      placeholder: Describe what you expected to happen instead.\n    validations:\n      required: true\n\n  - type: textarea\n    id: impact\n    attributes:\n      label: Impact\n      description: How does this negatively impact your work with Jottre?\n      placeholder: e.g. blocks note-taking entirely, causes data loss, minor inconvenience, ...\n    validations:\n      required: true\n\n  - type: textarea\n    id: media\n    attributes:\n      label: Logs, screenshots, or video\n      description: Attach any logs, screenshots, or screen recordings that help illustrate the bug.\n      placeholder: Drag and drop files here, or paste logs as text.\n    validations:\n      required: false\n\n  - type: checkboxes\n    id: acknowledgements\n    attributes:\n      label: Acknowledgements\n      options:\n        - label: I have read and accept the [code of conduct](../../CODE_OF_CONDUCT.md)\n          required: true\n        - label: I have read and accept the [contribution guidelines](../../CONTRIBUTING.md)\n          required: true\n        - label: I have already looked at existing issues related to this bug\n          required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.yml",
    "content": "name: Feature Request\ndescription: Suggest a new feature or improvement for Jottre.\nlabels:\n  - feature\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for suggesting a new feature! Please describe the problem it solves, your proposed solution, and the value it brings to users.\n\n  - type: textarea\n    id: problem\n    attributes:\n      label: Problem\n      description: What is missing in the current app/project creating a problem for the user?\n      placeholder: Describe the gap or pain point you are experiencing today.\n    validations:\n      required: true\n\n  - type: textarea\n    id: solution\n    attributes:\n      label: Solution\n      description: What is the proposed change to solve the described problem?\n      placeholder: Describe the feature, behaviour, or change you would like to see.\n    validations:\n      required: true\n\n  - type: textarea\n    id: alternatives\n    attributes:\n      label: Alternatives considered\n      description: What other approaches did you consider, and why is the proposed solution preferred?\n      placeholder: Describe any workarounds or alternative designs you have thought about.\n    validations:\n      required: false\n\n  - type: textarea\n    id: value\n    attributes:\n      label: Value\n      description: What value does this bring to the user?\n      placeholder: Describe how users will benefit from this change.\n    validations:\n      required: true\n\n  - type: checkboxes\n    id: platforms\n    attributes:\n      label: Platforms\n      description: Which platforms should this feature target?\n      options:\n        - label: iOS\n        - label: iPadOS\n        - label: macOS\n    validations:\n      required: true\n\n  - type: checkboxes\n    id: acknowledgements\n    attributes:\n      label: Acknowledgements\n      options:\n        - label: I have read and accept the [code of conduct](../../CODE_OF_CONDUCT.md)\n          required: true\n        - label: I have read and accept the [contribution guidelines](../../CONTRIBUTING.md)\n          required: true\n        - label: I have already looked at existing issues related to this feature\n          required: true\n"
  },
  {
    "path": ".github/workflows/pull_request.yml",
    "content": "name: Pull Request\n\non:\n  pull_request:\n    branches:\n      - master\n    types: [opened, reopened, synchronize, ready_for_review]\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  soundness:\n    name: Soundness\n    uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main\n    with:\n      api_breakage_check_enabled: false\n      broken_symlink_check_enabled: false\n      docs_check_enabled: false\n      python_lint_check_enabled: false\n      shell_check_enabled: false\n      unacceptable_language_check_enabled: false\n      yamllint_check_enabled: false\n\n  lint-ruby:\n    name: Lint Ruby\n    runs-on: ubuntu-latest\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - run: bundle exec rubocop\n\n  test:\n    name: Test\n    runs-on: macos-26\n    timeout-minutes: 10\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - run: bundle exec fastlane ios test\n\n  build-ios-debug:\n    name: Build iOS/iPadOS Debug\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - run: bundle exec fastlane ios build_debug\n\n  build-ios-release:\n    name: Build iOS/iPadOS Release\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - run: bundle exec fastlane ios build_release\n\n  build-macos-debug:\n    name: Build macOS Debug\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - run: bundle exec fastlane mac build_debug\n\n  build-macos-release:\n    name: Build macOS Release\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - run: bundle exec fastlane mac build_release\n"
  },
  {
    "path": ".github/workflows/push_on_master.yml",
    "content": "name: Push on master\n\non:\n  push:\n    branches:\n      - master\n\npermissions:\n  contents: write\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  bump-version:\n    name: Bump version\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n          token: ${{ secrets.GITHUB_TOKEN }}\n      - name: Configure Git\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - run: bundle exec fastlane bump_version\n\n  distribute-ios:\n    name: Distribute iOS/iPadOS\n    environment: release\n    needs: bump-version\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: master\n          fetch-depth: 0\n      - name: Configure Git\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - env:\n          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}\n          MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}\n          APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}\n          APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}\n          APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}\n        run: bundle exec fastlane ios distribute\n\n  distribute-macos:\n    name: Distribute macOS\n    environment: release\n    needs: bump-version\n    runs-on: macos-26\n    timeout-minutes: 5\n    steps:\n      - uses: actions/checkout@v4\n        with:\n          ref: master\n          fetch-depth: 0\n      - name: Configure Git\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n      - uses: ruby/setup-ruby@v1\n        with:\n          bundler-cache: true\n      - name: Install XcodeGen\n        run: brew install xcodegen\n      - env:\n          MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}\n          MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}\n          APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}\n          APP_STORE_CONNECT_API_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_ISSUER_ID }}\n          APP_STORE_CONNECT_API_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_API_KEY_CONTENT }}\n        run: bundle exec fastlane mac distribute\n"
  },
  {
    "path": ".gitignore",
    "content": "Jottre.xcodeproj\nJottre.entitlements\nResources/Info.plist\n**/.DS_Store\n"
  },
  {
    "path": ".license_header_template",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) YEARS Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n"
  },
  {
    "path": ".licenseignore",
    "content": ".github\nREADME.md\n.gitignore\n*.md\n*.json\n*.yml\n*.yaml\n*.rb\n*.jpg\nJottre.xcodeproj\nResources\nTests/Resources\nhooks\nfastlane\nGemfile\nGemfile.lock\nBrewfile\nLICENSE\n.ruby-version\n.xcode-version\n"
  },
  {
    "path": ".rubocop.yml",
    "content": "Layout/IndentationWidth:\n  Width: 4\n\nplugins:\n  - rubocop-performance\n\nAllCops:\n  NewCops: enable\n  TargetRubyVersion: 3.0\n  Exclude:\n    - 'vendor/**/*'\n\nMetrics:\n  Enabled: false\n\nNaming:\n  Enabled: false\n\nStyle:\n  Enabled: false\n\nLint:\n  Enabled: false\n\nSecurity:\n  Enabled: true\n\nSecurity/Open:\n  Enabled: false\n\nPerformance:\n  Enabled: false\n"
  },
  {
    "path": ".ruby-version",
    "content": "4.0.1\n"
  },
  {
    "path": ".swift-format",
    "content": "{\n  \"version\": 1,\n  \"indentation\": {\n    \"spaces\": 4\n  },\n  \"tabWidth\": 4,\n  \"fileScopedDeclarationPrivacy\": {\n    \"accessLevel\": \"private\"\n  },\n  \"spacesAroundRangeFormationOperators\": false,\n  \"indentConditionalCompilationBlocks\": false,\n  \"indentSwitchCaseLabels\": false,\n  \"lineBreakAroundMultilineExpressionChainComponents\": false,\n  \"lineBreakBeforeControlFlowKeywords\": false,\n  \"lineBreakBeforeEachArgument\": true,\n  \"lineBreakBeforeEachGenericRequirement\": true,\n  \"lineLength\": 120,\n  \"maximumBlankLines\": 1,\n  \"respectsExistingLineBreaks\": true,\n  \"prioritizeKeepingFunctionOutputTogether\": true,\n  \"rules\": {\n    \"AllPublicDeclarationsHaveDocumentation\": false,\n    \"AlwaysUseLiteralForEmptyCollectionInit\": false,\n    \"AlwaysUseLowerCamelCase\": false,\n    \"AmbiguousTrailingClosureOverload\": false,\n    \"BeginDocumentationCommentWithOneLineSummary\": false,\n    \"DoNotUseSemicolons\": true,\n    \"DontRepeatTypeInStaticProperties\": true,\n    \"FileScopedDeclarationPrivacy\": true,\n    \"FullyIndirectEnum\": true,\n    \"GroupNumericLiterals\": true,\n    \"IdentifiersMustBeASCII\": true,\n    \"NeverForceUnwrap\": true,\n    \"NeverUseForceTry\": true,\n    \"NeverUseImplicitlyUnwrappedOptionals\": false,\n    \"NoAccessLevelOnExtensionDeclaration\": true,\n    \"NoAssignmentInExpressions\": true,\n    \"NoBlockComments\": false,\n    \"NoCasesWithOnlyFallthrough\": true,\n    \"NoEmptyTrailingClosureParentheses\": true,\n    \"NoLabelsInCasePatterns\": true,\n    \"NoLeadingUnderscores\": false,\n    \"NoParensAroundConditions\": true,\n    \"NoVoidReturnOnFunctionSignature\": true,\n    \"OmitExplicitReturns\": true,\n    \"OneCasePerLine\": true,\n    \"OneVariableDeclarationPerLine\": true,\n    \"OnlyOneTrailingClosureArgument\": true,\n    \"OrderedImports\": true,\n    \"ReplaceForEachWithForLoop\": true,\n    \"ReturnVoidInsteadOfEmptyTuple\": true,\n    \"UseEarlyExits\": true,\n    \"UseExplicitNilCheckInConditions\": true,\n    \"UseLetInEveryBoundCaseVariable\": false,\n    \"UseShorthandTypeNames\": true,\n    \"UseSingleLinePropertyGetter\": true,\n    \"UseSynthesizedInitializer\": false,\n    \"UseTripleSlashForDocumentationComments\": true,\n    \"UseWhereClausesInForLoops\": true,\n    \"ValidateDocumentationComments\": false\n  }\n}\n"
  },
  {
    "path": ".xcode-version",
    "content": "26.4.1\n"
  },
  {
    "path": "AppKitPlugin/AppKitPlugin.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport AppKit\n\n@objc(AppKitPlugin)\npublic final class AppKitPlugin: NSObject {\n\n    @MainActor\n    @objc\n    public static func terminate() {\n        NSApplication.shared.terminate(nil)\n    }\n}\n"
  },
  {
    "path": "AppKitPlugin/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>AppKitPlugin</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>com.antonlorani.jottre.AppKitPlugin</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>AppKitPlugin</string>\n\t<key>CFBundlePackageType</key>\n\t<string>BNDL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<real>1</real>\n\t<key>CFBundleVersion</key>\n\t<integer>1</integer>\n</dict>\n</plist>\n"
  },
  {
    "path": "Brewfile",
    "content": "# frozen_string_literal: true\n\nbrew 'rbenv'\nbrew 'xcodegen'\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Code of Conduct\n\n## Pledge\n\nParticipation in this project should be welcoming, respectful, and harassment-free for everyone, regardless of age, body size, disability, ethnicity, gender identity, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Expected Behavior\n\nExamples of behavior that contributes to a positive environment include:\n\n- Being respectful and inclusive\n- Accepting constructive feedback gracefully\n- Showing empathy toward other community members\n- Focusing on collaboration and learning\n- Using welcoming and professional language\n\n## Unacceptable Behavior\n\nExamples of unacceptable behavior include:\n\n- Harassment, discrimination, or hateful conduct\n- Trolling, insulting, or derogatory comments\n- Personal or political attacks\n- Publishing private information without permission\n- Any conduct that could reasonably be considered inappropriate in a professional setting\n\n## Enforcement Responsibilities\n\nProject maintainers are responsible for clarifying and enforcing standards of acceptable behavior. Maintainers may remove, edit, or reject comments, commits, issues, and other contributions that violate this Code of Conduct.\n\n## Scope\n\nThis Code of Conduct applies within all project spaces, including:\n\n- GitHub issues and pull requests\n- Discussions and community forums\n- Chat platforms and social media related to the project\n- Public or private interactions representing the project\n\n## Reporting\n\nIf unacceptable behavior is experienced or witnessed, report it to the project maintainers through the repository’s contact channels.\n\nAll reports will be reviewed and investigated promptly and fairly.\n\n## Enforcement\n\nProject maintainers may take any action deemed appropriate, including:\n\n- Warning the offender\n- Temporary suspension\n- Permanent ban from the community\n\n## Attribution\n\nInspired by the Contributor Covenant, version 2.1.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing Guidelines\n\nPull requests, bug reports, and all other forms of contributions to make Jottre even better are welcomed and highly encouraged!\n\n## Installation\n\nContributions occur on the premise that getting the project working with little effort.  Initially there are a few tools to install that make recurring contributions much simpler.\n\nSee [README.md](README.md#installation) for installation details.\n\n## Creating an issue\n\nTake a look at the [existing issues](https://github.com/antonlorani/jottre/issues), maybe your concern is already addressed.  If not, use the provided issue templates for [feature requests](https://github.com/antonlorani/jottre/issues/new?template=feature_request.yml) or [bug reports](https://github.com/antonlorani/jottre/issues/new?template=bug_report.yml).\n\n> [!IMPORTANT]\n> For security related issues, see [Security Policy](SECURITY_POLICY.md) first!\n\n## Working on an issue\n\nAny form of active contribution requires an associated Github issue. See [Creating an issue](#creating-an-issue).  \n\nIssues that are in the *todo* status and have no assignee yet can be freely taken.  If no contribution occurs for the issue, the issue assignee MAY be reset. \n\nDo ONLY work on things that are part of the issue's scope. \n\nCreate your working branch by branching from `master`, ensure that the working branch is prefixed with the issue-key.\n\n```\n42-zoom-state-not-restored\n```\n\nCommit messages SHOULD be suffixed the issue keys as well.\n\n```\nAdds zoom scale to scene restoration (#42)\n```\n\nOther than making sure that the commit messages communicates the intent clearly, no specific guidelines exist onto how to write a commit message.\n\nBefore raising a pull request, run the [test verification](README.md#validation):\n\n```\nbundle exec fastlane test\n```\n\n## Finalizing your contribution\n\n### Certificate of origin\n\nBY OPENING A PULL REQUEST, YOU CERTIFY THAT:\n\n1. THE CONTRIBUTION WAS WRITTEN IN WHOLE OR IN PART BY YOU, AND YOU HAVE THE RIGHT TO SUBMIT IT UNDER THE [PROJECT'S LICENSE](LICENSE).\n2. THE CONTRIBUTION IS BASED ON PREVIOUS WORK THAT, TO THE BEST OF YOUR KNOWLEDGE, IS COVERED UNDER AN APPROPRIATE OPEN SOURCE LICENSE - AND YOU HAVE THE RIGHT TO SUBMIT IT WITH MODIFICATIONS UNDER THE SAME LICENSE.\n3. THE CONTRIBUTION WAS PROVIDED DIRECTLY TO YOU BY SOME OTHER PERSON WHO CERTIFIED (1) OR (2), AND YOU HAVE NOT MODIFIED IT.\n\n### Raise a pull request\n\nOnce your work is ready, raise a pull request.  Every pull request undergoes a formal code review.  Code reviews fall under the [Code of Conduct](CODE_OF_CONDUCT.md).\n\nOnce your pull request is approved, the owner of this project takes care of merging your contribution into upstream `master` and schedule the changes into the next app store release.\n\n## Policy on coding agents\n\nContributions via coding agents are accepted and expected.  Your coding agent SHOULD adopt the projects conventions and retain the projects code quality.  It's the operators responsibility to align their coding agent with those.\n"
  },
  {
    "path": "Gemfile",
    "content": "# frozen_string_literal: true\n\nsource 'https://rubygems.org'\n\ngem 'fastlane'\ngem 'rubocop', require: false\ngem 'rubocop-performance', require: false\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "PRIVACY_POLICY.md",
    "content": "# Privacy Policy\n\n_Last updated: 2026-05-01_\n\nJottre (\"the app\") is designed to keep your notes private. This policy explains what data the app handles and how.\n\n## Data the app collects\n\n**None.** Jottre does not collect, transmit, or share any personal data with the developer or any third party. There are no analytics, no tracking, no advertising SDKs, and no developer-operated servers.\n\n## Data stored on your device\n\nJottre stores the notes and sketches you create as files on your device. These files never leave your device except through the mechanisms you choose (see below).\n\n## iCloud sync\n\nIf you enable iCloud sync, your notes are stored in your personal iCloud account and synchronized across your Apple devices by Apple. The developer has no access to this data. iCloud's handling of your data is governed by [Apple's Privacy Policy](https://www.apple.com/legal/privacy/).\n\n## Sharing and export\n\nWhen you export a note as PDF, JPG, or PNG, or share it through the iOS share sheet, the resulting file is handled by the app or service you choose. Jottre itself does not transmit the file anywhere.\n\n## Permissions\n\nJottre may request access to:\n\n- **Files and folders** you select, so it can open and save notes.\n- **iCloud Drive**, if you choose to sync notes across devices.\n\nNo other permissions are requested.\n\n## Changes to this policy\n\nIf this policy changes, the updated version will be published in this repository with a new \"Last updated\" date.\n\n## Contact\n\nQuestions or concerns: [open an issue](https://github.com/antonlorani/jottre/issues).\n"
  },
  {
    "path": "README.md",
    "content": "<p style=\"text-align: center; max-width: 500px; height: auto;\">\n<p align=\"center\" >\n  <img src=\"Resources/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png\" style=\"border-radius: 50px; overflow: hidden;\" width=300 height=auto>\n</p>\n\n# Jottre\n\nSimple and minimalistic handwriting app across Apple platforms.\n\n**Available on the [App Store](https://apps.apple.com/us/app/jottre/id1550272319)**\n\n![Jottre on iPad App Preview](jottre_ipad_app_preview.jpg)\n\n## Contributing\n\nContributions are welcome. Before opening an issue or pull request, please review the following documents:\n\n- [Contributing guidelines](CONTRIBUTING.md)\n- [Code of conduct](CODE_OF_CONDUCT.md)\n- [Security policy](SECURITY_POLICY.md)\n\n## Development\n\n### Installation\n\nConfigure the Ruby toolchain with [rbenv](https://github.com/rbenv/rbenv):\n\n```sh\ncurl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash\nrbenv install $(cat .ruby-version)\nrbenv local $(cat .ruby-version)\n```\n\nInstall Bundler and the project's Ruby dependencies:\n\n```sh\ngem install bundler\nbundle install\n```\n\nInstall Xcode at the pinned version using [xcodes](https://github.com/XcodesOrg/xcodes):\n\n```sh\nbrew install xcodesorg/made/xcodes\nbrew install aria2\nxcodes install $(cat .xcode-version) --experimental-unxip\nxcodes select $(cat .xcode-version)\n```\n\nGenerate the Xcode project:\n\n```sh\nbundle exec fastlane generate_project\n```\n\n### Validation\n\nVerify the setup by running the test suite:\n\n```sh\nbundle exec fastlane test\n```\n\n## License\n\nCopyright (C) 2021-2026 Anton Lorani\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "Resources/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"icon_20x20@2x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"filename\" : \"icon_20x20@3x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"filename\" : \"icon_29x29@2x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"filename\" : \"icon_29x29@3x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"filename\" : \"icon_40x40@2x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"filename\" : \"icon_40x40@3x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"filename\" : \"icon_60x60@2x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"2x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"filename\" : \"icon_60x60@3x.png\",\n      \"idiom\" : \"iphone\",\n      \"scale\" : \"3x\",\n      \"size\" : \"60x60\"\n    },\n    {\n      \"filename\" : \"icon_20x20.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"filename\" : \"icon_20x20@2x-1.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"20x20\"\n    },\n    {\n      \"filename\" : \"icon_29x29.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"filename\" : \"icon_29x29@2x-1.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"29x29\"\n    },\n    {\n      \"filename\" : \"icon_40x40.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"filename\" : \"icon_40x40@2x-1.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"40x40\"\n    },\n    {\n      \"filename\" : \"icon_76x76.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"1x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"filename\" : \"icon_76x76@2x.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"76x76\"\n    },\n    {\n      \"filename\" : \"icon_83.5x83.5@2x.png\",\n      \"idiom\" : \"ipad\",\n      \"scale\" : \"2x\",\n      \"size\" : \"83.5x83.5\"\n    },\n    {\n      \"filename\" : \"icon_1024x1024.png\",\n      \"idiom\" : \"ios-marketing\",\n      \"scale\" : \"1x\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Resources/Localizable.xcstrings",
    "content": "{\n  \"sourceLanguage\": \"en\",\n  \"strings\": {\n    \"action.cancel\": {\n      \"comment\": \"Generic cancel action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cancel\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Abbrechen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kanselleer\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"إلغاء\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cancelar\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Annuler\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"रद्द करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Batal\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Annulla\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"キャンセル\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"취소\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Batal\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Annuleren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Anuluj\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cancelar\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cancelar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Отмена\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Avbryt\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ยกเลิก\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"İptal\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Скасувати\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hủy\" } }\n      }\n    },\n    \"action.create\": {\n      \"comment\": \"Generic create action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Create\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Erstellen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Skep\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"إنشاء\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Crear\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Créer\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"बनाएं\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Buat\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Crea\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"作成\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"만들기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cipta\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aanmaken\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Utwórz\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Criar\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Criar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Создать\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Skapa\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"สร้าง\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Oluştur\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Створити\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tạo\" } }\n      }\n    },\n    \"action.delete\": {\n      \"comment\": \"Generic delete action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Delete\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Löschen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Verwyder\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"حذف\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Eliminar\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Supprimer\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"हटाएं\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hapus\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Elimina\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"削除\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"삭제\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Padam\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Verwijderen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Usuń\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Excluir\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Eliminar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Удалить\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Radera\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ลบ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sil\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Видалити\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Xóa\" } }\n      }\n    },\n    \"action.done\": {\n      \"comment\": \"Generic done/confirm action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Done\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Fertig\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Klaar\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تم\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Listo\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Terminé\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"हो गया\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Selesai\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Fine\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"完了\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"완료\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Selesai\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Gereed\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Gotowe\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Concluído\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Concluído\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Готово\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Klar\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เสร็จสิ้น\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bitti\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Готово\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Xong\" } }\n      }\n    },\n    \"action.duplicate\": {\n      \"comment\": \"Generic duplicate action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplicate\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplizieren\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dupliseer\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تكرار\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplicar\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dupliquer\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"डुप्लीकेट करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplikat\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplica\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"複製\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"복제\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplikasi\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dupliceren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplikuj\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplicar\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplicar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Дублировать\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Duplicera\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ทำซ้ำ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Çoğalt\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Дублювати\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nhân đôi\" } }\n      }\n    },\n    \"action.ok\": {\n      \"comment\": \"Generic ok/acknowledge action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"حسنًا\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ठीक है\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"확인\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ОК\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ตกลง\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tamam\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"OK\" } }\n      }\n    },\n    \"action.rename\": {\n      \"comment\": \"Generic rename action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Rename\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Umbenennen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hernoem\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"إعادة تسمية\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renombrar\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renommer\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"नाम बदलें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ganti Nama\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Rinomina\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"名前を変更\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이름 변경\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Namakan Semula\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hernoemen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Zmień nazwę\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renomear\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renomear\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Переименовать\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Byt namn\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เปลี่ยนชื่อ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Yeniden Adlandır\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Перейменувати\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Đổi tên\" } }\n      }\n    },\n    \"action.share\": {\n      \"comment\": \"Generic share action label\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Share\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Teilen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Deel\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"مشاركة\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Compartir\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Partager\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"साझा करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bagikan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Condividi\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"共有\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"공유\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kongsi\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Delen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Udostępnij\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Compartilhar\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Partilhar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Поделиться\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dela\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"แชร์\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Paylaş\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Поділитися\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Chia sẻ\" } }\n      }\n    },\n    \"app.title\": {\n      \"comment\": \"Application name displayed in the navigation bar on iOS\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jottre\" } }\n      }\n    },\n    \"cloudMigration.errorAlert.title\": {\n      \"comment\": \"The title of the error alert when migrating a Jot between the local file-system and iCloud failed.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Unable to migrate \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Migration von \\\"%@\\\" nicht möglich\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" nie migreer nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر ترحيل \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se puede migrar \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de migrer \\\"%@\\\"\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" को माइग्रेट नहीं किया जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat memigrasikan \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile migrare \\\"%@\\\"\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」を移行できません\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"을(를) 마이그레이션할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat memigrasikan \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet migreren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można zmigrować \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível migrar \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível migrar \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось перенести «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan inte migrera \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถย้าย \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" taşınamıyor\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося перенести «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể di chuyển \\\"%@\\\"\" } }\n      }\n    },\n    \"cloudMigration.nothingToMigrate.subtitle\": {\n      \"comment\": \"Subtitle on the iCloud migration screen when there are no Jots to migrate\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Newly created Jots are now automatically synchronized with iCloud and accessible across all your iCloud-compatible devices.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Neu erstellte Jots werden jetzt automatisch mit iCloud synchronisiert und sind auf all deinen iCloud-kompatiblen Geräten verfügbar.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nuutgeskepte Jots word nou outomaties met iCloud gesinkroniseer en is op al jou iCloud-versoenbare toestelle beskikbaar.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"يتم الآن مزامنة Jots المنشأة حديثًا تلقائيًا مع iCloud ويمكن الوصول إليها عبر جميع أجهزتك المتوافقة مع iCloud.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Los Jots recién creados ahora se sincronizan automáticamente con iCloud y son accesibles en todos tus dispositivos compatibles con iCloud.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Les Jots nouvellement créés sont désormais automatiquement synchronisés avec iCloud et accessibles sur tous vos appareils compatibles iCloud.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"नए बनाए गए Jots अब स्वचालित रूप से iCloud के साथ सिंक्रनाइज़ होते हैं और आपके सभी iCloud-संगत डिवाइसों पर उपलब्ध हैं।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots yang baru dibuat kini disinkronkan secara otomatis dengan iCloud dan dapat diakses di semua perangkat yang kompatibel dengan iCloud.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"I Jots appena creati vengono ora sincronizzati automaticamente con iCloud e sono accessibili su tutti i tuoi dispositivi compatibili con iCloud.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"新しく作成されたJotは自動的にiCloudと同期され、すべてのiCloud対応デバイスからアクセスできます。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"새로 만든 Jot은 이제 iCloud와 자동으로 동기화되며 모든 iCloud 호환 기기에서 접근할 수 있습니다.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots yang baru dibuat kini disegerakkan secara automatik dengan iCloud dan boleh diakses pada semua peranti serasi iCloud anda.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nieuw aangemaakte Jots worden nu automatisch gesynchroniseerd met iCloud en zijn toegankelijk op al je iCloud-compatibele apparaten.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nowo utworzone Jots są teraz automatycznie synchronizowane z iCloud i dostępne na wszystkich urządzeniach kompatybilnych z iCloud.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Os Jots recém-criados agora são sincronizados automaticamente com o iCloud e acessíveis em todos os seus dispositivos compatíveis com o iCloud.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Os Jots recém-criados são agora automaticamente sincronizados com o iCloud e acessíveis em todos os seus dispositivos compatíveis com o iCloud.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Новые Jots теперь автоматически синхронизируются с iCloud и доступны на всех ваших устройствах, совместимых с iCloud.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nyskapade Jots synkroniseras nu automatiskt med iCloud och är tillgängliga på alla dina iCloud-kompatibla enheter.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots ที่สร้างใหม่จะซิงค์กับ iCloud โดยอัตโนมัติและเข้าถึงได้จากอุปกรณ์ที่รองรับ iCloud ทั้งหมดของคุณ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Yeni oluşturulan Jots artık iCloud ile otomatik olarak senkronize ediliyor ve tüm iCloud uyumlu cihazlarınızdan erişilebilir.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Щойно створені Jots тепер автоматично синхронізуються з iCloud і доступні на всіх ваших пристроях, сумісних з iCloud.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Các Jots mới tạo giờ đây được tự động đồng bộ với iCloud và có thể truy cập trên tất cả các thiết bị tương thích iCloud của bạn.\" } }\n      }\n    },\n    \"cloudMigration.subtitle\": {\n      \"comment\": \"Subtitle on the iCloud migration screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Your Jots can now sync across all your devices. Choose which ones to bring along.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Deine Jots können jetzt auf all deinen Geräten synchronisiert werden. Wähle aus, welche du mitnehmen möchtest.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jou Jots kan nou oor al jou toestelle sinkroniseer. Kies watter jy wil saamneem.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"يمكن الآن مزامنة Jots عبر جميع أجهزتك. اختر أيّها تريد نقله.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tus Jots ya pueden sincronizarse en todos tus dispositivos. Elige cuáles quieres llevar contigo.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Vos Jots peuvent désormais se synchroniser sur tous vos appareils. Choisissez lesquels emporter.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"आपके Jots अब आपके सभी डिवाइस पर सिंक हो सकते हैं। चुनें कि कौन से लाने हैं।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots Anda kini dapat disinkronkan di semua perangkat. Pilih mana yang ingin dibawa.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"I tuoi Jots ora si sincronizzano su tutti i tuoi dispositivi. Scegli quali portare con te.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jotがすべてのデバイスで同期できるようになりました。持ち込むものを選んでください。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이제 모든 기기에서 Jot을 동기화할 수 있습니다. 가져올 항목을 선택하세요.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots anda kini boleh disegerakkan di semua peranti. Pilih yang mana hendak dibawa.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Je Jots kunnen nu synchroniseren op al je apparaten. Kies welke je wilt meenemen.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Twoje Jots mogą teraz synchronizować się na wszystkich urządzeniach. Wybierz, które chcesz przenieść.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Seus Jots agora podem sincronizar em todos os seus dispositivos. Escolha quais deseja trazer.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Os seus Jots podem agora sincronizar em todos os seus dispositivos. Escolha quais pretende trazer.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Теперь ваши Jots можно синхронизировать на всех устройствах. Выберите, какие перенести.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dina Jots kan nu synkroniseras på alla dina enheter. Välj vilka du vill ta med.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots ของคุณสามารถซิงค์ข้ามอุปกรณ์ทั้งหมดได้แล้ว เลือกรายการที่ต้องการนำมาด้วย\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots'larınız artık tüm cihazlarınızda eşitlenebilir. Hangilerini getireceğinizi seçin.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Тепер ваші Jots можна синхронізувати на всіх пристроях. Виберіть, які перенести.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots của bạn giờ có thể đồng bộ trên tất cả thiết bị. Hãy chọn những mục muốn mang theo.\" } }\n      }\n    },\n    \"cloudMigration.title\": {\n      \"comment\": \"Headline on the iCloud migration screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud is ready\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud ist bereit\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud is gereed\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud جاهز\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud está listo\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud est prêt\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud तैयार है\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud siap\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud è pronto\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloudの準備ができました\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud 준비 완료\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud sedia\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud is klaar\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud jest gotowy\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud está pronto\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud está pronto\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud готов\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud är redo\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud พร้อมแล้ว\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud hazır\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud готовий\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud đã sẵn sàng\" } }\n      }\n    },\n    \"enableCloud.action.learnHowToEnable\": {\n      \"comment\": \"Call-to-action button on the Enable iCloud screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Learn How To Enable\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"So aktivierst du iCloud\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Leer hoe om te aktiveer\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعرّف على كيفية التفعيل\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aprende cómo activarlo\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Apprendre comment activer\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"सक्षम करना सीखें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pelajari Cara Mengaktifkan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Scopri come abilitarlo\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"有効にする方法を見る\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"활성화 방법 알아보기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ketahui Cara Mengaktifkan\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Leer hoe je het inschakelt\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dowiedz się, jak włączyć\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Saiba como ativar\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Saiba como ativar\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Как включить\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Lär dig hur du aktiverar\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เรียนรู้วิธีเปิดใช้งาน\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nasıl Etkinleştirileceğini Öğren\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Дізнатися, як увімкнути\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tìm hiểu cách bật\" } }\n      }\n    },\n    \"enableCloud.feature.share\": {\n      \"comment\": \"Feature row describing the sharing capability on the Enable iCloud screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Share Jots with others\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots mit anderen teilen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Deel Jots met ander mense\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"مشاركة Jots مع الآخرين\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Comparte Jots con otros\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Partagez des Jots avec d'autres\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots दूसरों के साथ साझा करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bagikan Jots dengan orang lain\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Condividi Jots con altri\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jotを他の人と共有\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"다른 사람과 Jot 공유\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kongsi Jots dengan orang lain\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Deel Jots met anderen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Udostępniaj Jots innym\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Compartilhe Jots com outras pessoas\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Partilhe Jots com outras pessoas\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Делитесь Jots с другими\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dela Jots med andra\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"แชร์ Jots กับผู้อื่น\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots'ları başkalarıyla paylaş\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Діліться Jots з іншими\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Chia sẻ Jots với người khác\" } }\n      }\n    },\n    \"enableCloud.feature.sync\": {\n      \"comment\": \"Feature row describing cross-device sync on the Enable iCloud screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchronize Jots across all your Apple devices\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots auf all deinen Apple-Geräten synchronisieren\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sinkroniseer Jots oor al jou Apple-toestelle\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"مزامنة Jots عبر جميع أجهزة Apple الخاصة بك\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincroniza Jots en todos tus dispositivos Apple\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchronisez les Jots sur tous vos appareils Apple\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"अपने सभी Apple डिवाइस पर Jots सिंक करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sinkronkan Jots di semua perangkat Apple Anda\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronizza i Jots su tutti i tuoi dispositivi Apple\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"すべてのAppleデバイスでJotを同期\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"모든 Apple 기기에서 Jot 동기화\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Segerakkan Jots di semua peranti Apple anda\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchroniseer Jots op al je Apple-apparaten\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchronizuj Jots na wszystkich urządzeniach Apple\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronize Jots em todos os seus dispositivos Apple\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronize Jots em todos os seus dispositivos Apple\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Синхронизируйте Jots на всех устройствах Apple\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synkronisera Jots på alla dina Apple-enheter\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ซิงค์ Jots ข้ามอุปกรณ์ Apple ทั้งหมดของคุณ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jots'ları tüm Apple cihazlarında eşitle\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Синхронізуйте Jots на всіх пристроях Apple\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Đồng bộ Jots trên tất cả thiết bị Apple của bạn\" } }\n      }\n    },\n    \"enableCloud.subtitle\": {\n      \"comment\": \"Subtitle explaining why iCloud should be enabled\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"It looks like iCloud is disabled on this device. Turn on iCloud to get the most out of Jottre.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud scheint auf diesem Gerät deaktiviert zu sein. Aktiviere iCloud, um Jottre optimal zu nutzen.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dit lyk asof iCloud op hierdie toestel gedeaktiveer is. Skakel iCloud aan om die meeste uit Jottre te kry.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"يبدو أن iCloud معطّل على هذا الجهاز. شغّل iCloud للاستفادة الكاملة من Jottre.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Parece que iCloud está desactivado en este dispositivo. Activa iCloud para sacar el máximo partido a Jottre.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Il semble qu'iCloud soit désactivé sur cet appareil. Activez iCloud pour profiter pleinement de Jottre.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"लगता है इस डिवाइस पर iCloud बंद है। Jottre का पूरा लाभ उठाने के लिए iCloud चालू करें।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sepertinya iCloud dinonaktifkan di perangkat ini. Aktifkan iCloud untuk memaksimalkan Jottre.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sembra che iCloud sia disattivato su questo dispositivo. Attiva iCloud per sfruttare al meglio Jottre.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"このデバイスではiCloudが無効になっているようです。Jottreを最大限に活用するにはiCloudをオンにしてください。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이 기기에서 iCloud가 비활성화된 것 같습니다. Jottre를 최대한 활용하려면 iCloud를 켜세요.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nampaknya iCloud dilumpuhkan pada peranti ini. Hidupkan iCloud untuk mendapatkan manfaat penuh daripada Jottre.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Het lijkt erop dat iCloud op dit apparaat is uitgeschakeld. Schakel iCloud in om het meeste uit Jottre te halen.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wygląda na to, że iCloud jest wyłączony na tym urządzeniu. Włącz iCloud, aby w pełni korzystać z Jottre.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Parece que o iCloud está desativado neste dispositivo. Ative o iCloud para aproveitar ao máximo o Jottre.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Parece que o iCloud está desativado neste dispositivo. Ative o iCloud para tirar o máximo partido do Jottre.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Похоже, iCloud отключён на этом устройстве. Включите iCloud, чтобы использовать все возможности Jottre.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Det verkar som att iCloud är inaktiverat på den här enheten. Slå på iCloud för att få ut det mesta av Jottre.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ดูเหมือนว่า iCloud จะถูกปิดใช้งานบนอุปกรณ์นี้ เปิด iCloud เพื่อใช้ Jottre ได้อย่างเต็มที่\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bu cihazda iCloud'un devre dışı bırakıldığı görünüyor. Jottre'den en iyi şekilde yararlanmak için iCloud'u açın.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Схоже, iCloud вимкнено на цьому пристрої. Увімкніть iCloud, щоб отримати максимум від Jottre.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Có vẻ iCloud đang bị tắt trên thiết bị này. Hãy bật iCloud để tận dụng tối đa Jottre.\" } }\n      }\n    },\n    \"enableCloud.title\": {\n      \"comment\": \"Headline on the Enable iCloud screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Enable iCloud\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud aktivieren\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aktiveer iCloud\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تفعيل iCloud\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Activar iCloud\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Activer iCloud\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud सक्षम करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aktifkan iCloud\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Abilita iCloud\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloudを有効にする\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud 활성화\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aktifkan iCloud\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud inschakelen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Włącz iCloud\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ativar iCloud\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ativar iCloud\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Включить iCloud\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aktivera iCloud\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เปิดใช้งาน iCloud\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud'u Etkinleştir\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Увімкнути iCloud\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bật iCloud\" } }\n      }\n    },\n    \"filesystem.duplicate.filename.multi\": {\n      \"comment\": \"The suffix added to a duplicated file name.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copy %d\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ Kopie %d\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopie %d\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ نسخة %d\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copia %d\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copie %d\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ प्रति %d\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ salinan %d\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copia %d\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ のコピー %d\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ 사본 %d\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ salinan %d\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopie %d\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopia %d\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ cópia %d\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ cópia %d\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ копия %d\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopia %d\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ สำเนา %d\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopya %d\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ копія %d\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ bản sao %d\" } }\n      }\n    },\n    \"filesystem.duplicate.filename.plain\": {\n      \"comment\": \"A suffix added to a duplicated file name with a number in case of name conflicts.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copy\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ Kopie\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ نسخة\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copia\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copie\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ प्रति\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ salinan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ copia\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ のコピー\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ 사본\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ salinan\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopie\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopia\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ cópia\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ cópia\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ копия\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopia\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ สำเนา\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ kopya\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ копія\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ bản sao\" } }\n      }\n    },\n    \"jotConflict.action.keepAll\": {\n      \"comment\": \"Action to keep all conflicting versions of a Jot\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Keep All\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Alle behalten\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hou almal\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"احتفظ بالكل\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conservar todos\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tout conserver\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"सभी रखें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Simpan Semua\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tieni tutto\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"すべて保持\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"모두 유지\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Simpan Semua\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Alles bewaren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Zachowaj wszystko\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Manter todos\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Manter todos\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Оставить все\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Behåll alla\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เก็บทั้งหมด\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tümünü Tut\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Зберегти всі\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Giữ tất cả\" } }\n      }\n    },\n    \"jotConflict.action.keepVersion\": {\n      \"comment\": \"Action to keep version A of a conflicting jot\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Keep Version %@\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version %@ behalten\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hou weergawe %@\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"احتفظ بالإصدار %@\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conservar versión %@\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conserver la version %@\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"संस्करण %@ रखें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Simpan Versi %@\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tieni la versione %@\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"バージョン %@ を保持\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"버전 %@ 유지\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Simpan Versi %@\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versie %@ bewaren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Zachowaj wersję %@\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Manter versão %@\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Manter versão %@\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Оставить версию %@\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Behåll version %@\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เก็บเวอร์ชัน %@\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"%@ sürümünü tut\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Зберегти версію %@\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Giữ phiên bản %@\" } }\n      }\n    },\n    \"jotConflict.deviceLabel\": {\n      \"comment\": \"Label for the current device in conflict resolution\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"This Device\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dieses Gerät\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hierdie toestel\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"هذا الجهاز\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Este dispositivo\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cet appareil\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"यह डिवाइस\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Perangkat Ini\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Questo dispositivo\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"このデバイス\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이 기기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Peranti Ini\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dit apparaat\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"To urządzenie\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Este dispositivo\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Este dispositivo\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Это устройство\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Den här enheten\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"อุปกรณ์นี้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bu Cihaz\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Цей пристрій\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Thiết bị này\" } }\n      }\n    },\n    \"jotConflict.error.generic\": {\n      \"comment\": \"The error title displayed in the alert shown when a version resolution failed.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not resolve conflicts\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Konflikte konnten nicht gelöst werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon nie konflikte oplos nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر حل التعارضات\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudieron resolver los conflictos\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de résoudre les conflits\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"विरोधों को हल नहीं किया जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menyelesaikan konflik\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile risolvere i conflitti\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"競合を解決できませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"충돌을 해결할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menyelesaikan konflik\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon conflicten niet oplossen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można rozwiązać konfliktów\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível resolver os conflitos\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível resolver os conflitos\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось разрешить конфликты\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte lösa konflikter\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถแก้ไขข้อขัดแย้งได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Çakışmalar çözülemedi\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося вирішити конфлікти\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể giải quyết xung đột\" } }\n      }\n    },\n    \"jotConflict.subtitle\": {\n      \"comment\": \"Subtitle explaining the conflict; %@ is the name of the jot\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" was edited on two devices at the same time. Choose a version to keep.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" wurde gleichzeitig auf zwei Geräten bearbeitet. Wähle eine Version aus, die du behalten möchtest.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" is gelyktydig op twee toestelle gewysig. Kies 'n weergawe om te behou.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تم تعديل \\\"%@\\\" على جهازين في الوقت نفسه. اختر إصدارًا للاحتفاظ به.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" fue editado en dos dispositivos al mismo tiempo. Elige una versión para conservar.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"« %@ » a été modifié sur deux appareils en même temps. Choisissez une version à conserver.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" को एक साथ दो डिवाइस पर संपादित किया गया। रखने के लिए एक संस्करण चुनें।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" diedit di dua perangkat secara bersamaan. Pilih versi yang ingin disimpan.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» è stato modificato su due dispositivi contemporaneamente. Scegli la versione da conservare.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」が2つのデバイスで同時に編集されました。保持するバージョンを選んでください。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"이(가) 두 기기에서 동시에 편집되었습니다. 유지할 버전을 선택하세요.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" telah diedit pada dua peranti pada masa yang sama. Pilih versi yang hendak disimpan.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" is tegelijkertijd op twee apparaten bewerkt. Kies een versie om te bewaren.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" zostało edytowane na dwóch urządzeniach jednocześnie. Wybierz wersję do zachowania.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" foi editado em dois dispositivos ao mesmo tempo. Escolha uma versão para manter.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" foi editado em dois dispositivos ao mesmo tempo. Escolha uma versão para manter.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» было отредактировано на двух устройствах одновременно. Выберите версию для сохранения.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" redigerades på två enheter samtidigt. Välj en version att behålla.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" ถูกแก้ไขบนสองอุปกรณ์พร้อมกัน เลือกเวอร์ชันที่ต้องการเก็บไว้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" aynı anda iki cihazda düzenlendi. Saklamak istediğiniz sürümü seçin.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» було відредаговано на двох пристроях одночасно. Виберіть версію для збереження.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" đã được chỉnh sửa trên hai thiết bị cùng lúc. Hãy chọn phiên bản muốn giữ lại.\" } }\n      }\n    },\n    \"jotConflict.title\": {\n      \"comment\": \"Headline on the jot conflict resolution screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version Conflict\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versionskonflikt\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Weergawekonflikt\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعارض الإصدارات\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conflicto de versiones\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conflit de versions\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"संस्करण विरोध\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Konflik Versi\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conflitto di versioni\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"バージョンの競合\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"버전 충돌\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Konflik Versi\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versieconflict\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Konflikt wersji\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conflito de versões\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Conflito de versões\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Конфликт версий\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versionskonflikt\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ความขัดแย้งของเวอร์ชัน\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sürüm Çakışması\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Конфлікт версій\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Xung đột phiên bản\" } }\n      }\n    },\n    \"jotConflict.versionName\": {\n      \"comment\": \"Label for conflict version (displays as 'Version A', 'Version B', etc.)\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version %@\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version %@\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Weergawe %@\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الإصدار %@\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versión %@\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version %@\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"संस्करण %@\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versi %@\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versione %@\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"バージョン %@\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"버전 %@\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versi %@\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versie %@\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wersja %@\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versão %@\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versão %@\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Версия %@\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version %@\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เวอร์ชัน %@\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sürüm %@\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Версія %@\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Phiên bản %@\" } }\n      }\n    },\n    \"jots.create.error.fileExists\": {\n      \"comment\": \"The error message when a Jot already exists.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" already exists\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" ist bereits vorhanden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" bestaan reeds\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" موجود بالفعل\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" ya existe\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"« %@ » existe déjà\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" पहले से मौजूद है\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" sudah ada\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» esiste già\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」はすでに存在します\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"이(가) 이미 존재합니다\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" sudah wujud\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" bestaat al\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" już istnieje\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" já existe\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" já existe\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» уже существует\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" finns redan\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" มีอยู่แล้ว\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" zaten mevcut\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"«%@» вже існує\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" đã tồn tại\" } }\n      }\n    },\n    \"jots.create.error.generic\": {\n      \"comment\": \"A generic error message during Jot creation.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Something went wrong\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Etwas ist schiefgelaufen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Iets het verkeerd geloop\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"حدث خطأ ما\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Algo salió mal\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Une erreur s'est produite\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"कुछ गलत हो गया\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Terjadi kesalahan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Qualcosa è andato storto\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"問題が発生しました\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"문제가 발생했습니다\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sesuatu telah berlaku\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Er is iets misgegaan\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Coś poszło nie tak\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Algo deu errado\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Algo correu mal\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Что-то пошло не так\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Något gick fel\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เกิดข้อผิดพลาดบางอย่าง\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bir şeyler ters gitti\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Щось пішло не так\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Đã xảy ra lỗi\" } }\n      }\n    },\n    \"jots.create.namePlaceholder\": {\n      \"comment\": \"Placeholder text in the name text field of the Create Jot alert\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Name\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Name\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Naam\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الاسم\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nombre\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nom\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"नाम\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nama\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nome\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"名前\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이름\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nama\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Naam\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nazwa\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nome\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nome\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Название\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Namn\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ชื่อ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ad\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Назва\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tên\" } }\n      }\n    },\n    \"jots.create.title\": {\n      \"comment\": \"Title of the Create Jot alert\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"New Jot\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Neues Jot\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nuwe Jot\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot جديد\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nuevo Jot\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nouveau Jot\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"नया Jot\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot Baru\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nuovo Jot\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"新しいJot\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"새 Jot\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot Baharu\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nieuwe Jot\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nowy Jot\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Novo Jot\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Novo Jot\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Новый Jot\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ny Jot\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot ใหม่\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Yeni Jot\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Новий Jot\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot mới\" } }\n      }\n    },\n    \"jots.delete.error.generic\": {\n      \"comment\": \"The error message when a Jot couldn't be deleted.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not delete \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" konnte nicht gelöscht werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon \\\"%@\\\" nie verwyder nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر حذف \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudo eliminar \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de supprimer « %@ »\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" को हटाया नहीं जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menghapus \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile eliminare «%@»\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」を削除できませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"을(를) 삭제할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat memadam \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet verwijderen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można usunąć \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível excluir \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível eliminar \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось удалить «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte radera \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถลบ \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" silinemedi\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося видалити «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể xóa \\\"%@\\\"\" } }\n      }\n    },\n    \"jots.delete.message\": {\n      \"comment\": \"Confirmation message in the Delete Jot alert\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Are you sure you want to delete this Jot? This action cannot be undone.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Möchtest du dieses Jot wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Is jy seker jy wil hierdie Jot verwyder? Hierdie aksie kan nie ongedaan gemaak word nie.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"هل أنت متأكد أنك تريد حذف هذا Jot؟ لا يمكن التراجع عن هذا الإجراء.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"¿Seguro que quieres eliminar este Jot? Esta acción no se puede deshacer.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Voulez-vous vraiment supprimer ce Jot ? Cette action est irréversible.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"क्या आप वाकई इस Jot को हटाना चाहते हैं? यह क्रिया पूर्ववत नहीं की जा सकती।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Yakin ingin menghapus Jot ini? Tindakan ini tidak dapat dibatalkan.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sei sicuro di voler eliminare questo Jot? L'operazione non può essere annullata.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"このJotを削除してもよいですか？この操作は元に戻せません。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이 Jot을 삭제하시겠습니까? 이 작업은 취소할 수 없습니다.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Adakah anda pasti ingin memadam Jot ini? Tindakan ini tidak boleh dibuat asal.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Weet je zeker dat je deze Jot wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Czy na pewno chcesz usunąć ten Jot? Tej operacji nie można cofnąć.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tem certeza de que deseja excluir este Jot? Esta ação não pode ser desfeita.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tem a certeza de que pretende eliminar este Jot? Esta ação não pode ser anulada.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Вы уверены, что хотите удалить этот Jot? Это действие нельзя отменить.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Är du säker på att du vill radera den här Jot? Den här åtgärden kan inte ångras.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"คุณแน่ใจว่าต้องการลบ Jot นี้ใช่ไหม? การดำเนินการนี้ไม่สามารถย้อนกลับได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bu Jot'u silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ви впевнені, що хочете видалити цей Jot? Цю дію неможливо скасувати.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bạn có chắc muốn xóa Jot này không? Hành động này không thể hoàn tác.\" } }\n      }\n    },\n    \"jots.delete.title\": {\n      \"comment\": \"Title of the Delete Jot confirmation alert\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Delete Jot\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot löschen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Verwyder Jot\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"حذف Jot\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Eliminar Jot\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Supprimer le Jot\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot हटाएं\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hapus Jot\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Elimina Jot\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jotを削除\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot 삭제\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Padam Jot\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot verwijderen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Usuń Jot\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Excluir Jot\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Eliminar Jot\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Удалить Jot\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Radera Jot\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ลบ Jot\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot'u Sil\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Видалити Jot\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Xóa Jot\" } }\n      }\n    },\n    \"jots.download.error.generic\": {\n      \"comment\": \"The error message displayed when a Jot couldn't be downloaded.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not download \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" konnte nicht heruntergeladen werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon \\\"%@\\\" nie aflaai nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر تنزيل \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudo descargar \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de télécharger « %@ »\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" डाउनलोड नहीं हो सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat mengunduh \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile scaricare «%@»\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」をダウンロードできませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"을(를) 다운로드할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat memuat turun \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet downloaden\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można pobrać \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível baixar \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível transferir \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось загрузить «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte ladda ned \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถดาวน์โหลด \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" indirilemedi\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося завантажити «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể tải xuống \\\"%@\\\"\" } }\n      }\n    },\n    \"jots.duplicate.error.generic\": {\n      \"comment\": \"The error message displayed when a Jot couldn't be duplicated.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not duplicate \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" konnte nicht dupliziert werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon \\\"%@\\\" nie dupliseer nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر تكرار \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudo duplicar \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de dupliquer « %@ »\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" को डुप्लीकेट नहीं किया जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menduplikasi \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile duplicare «%@»\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」を複製できませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"을(를) 복제할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menduplikasi \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet dupliceren\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można zduplikować \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível duplicar \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível duplicar \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось дублировать «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte duplicera \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถทำซ้ำ \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" çoğaltılamadı\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося дублювати «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể nhân đôi \\\"%@\\\"\" } }\n      }\n    },\n    \"jots.empty.title\": {\n      \"comment\": \"Empty state message when there are no jots\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"A blank page full of possibilities. Go ahead, jot something insanely great!\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Eine leere Seite voller Möglichkeiten. Los geht's, schreib etwas Großartiges!\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"'n Leë bladsy vol moontlikhede. Gaan voort, skryf iets ongelooflik wonderlik neer!\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"صفحة بيضاء مليئة بالإمكانيات. هيّا، دوّن شيئًا رائعًا!\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Una página en blanco llena de posibilidades. ¡Adelante, escribe algo increíble!\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Une page blanche pleine de possibilités. Allez, notez quelque chose d'extraordinaire !\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"संभावनाओं से भरा एक खाली पन्ना। आगे बढ़ें, कुछ शानदार लिखें!\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Halaman kosong penuh kemungkinan. Ayo, tuliskan sesuatu yang luar biasa!\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Una pagina bianca piena di possibilità. Dai, annota qualcosa di straordinario!\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"可能性に満ちた白紙のページ。さあ、素晴らしいことを書き留めましょう！\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"가능성으로 가득 찬 빈 페이지. 지금 바로 멋진 것을 적어 보세요!\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Halaman kosong penuh kemungkinan. Ayuh, catat sesuatu yang luar biasa!\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Een blanco pagina vol mogelijkheden. Ga je gang en schrijf iets geweldigs!\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pusta strona pełna możliwości. No dalej, zapisz coś niesamowitego!\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Uma página em branco cheia de possibilidades. Vá em frente, anote algo incrível!\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Uma página em branco cheia de possibilidades. Avance, escreva algo incrivelmente fantástico!\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Чистая страница, полная возможностей. Вперёд — запишите что-нибудь грандиозное!\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"En tom sida full av möjligheter. Sätt igång och anteckna något fantastiskt!\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"หน้ากระดาษเปล่าเต็มไปด้วยความเป็นไปได้ ลองจดบางอย่างที่ยอดเยี่ยมดูสิ!\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Olasılıklarla dolu boş bir sayfa. Haydi, harika bir şeyler jot edin!\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Чиста сторінка, сповнена можливостей. Сміливо — занотуйте щось неймовірне!\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Một trang trắng đầy khả năng. Hãy mạnh dạn ghi lại điều gì đó thật tuyệt vời!\" } }\n      }\n    },\n    \"jots.menu.openInNewWindow\": {\n      \"comment\": \"Context menu item to open a jot in a new window\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Open In New Window\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"In neuem Fenster öffnen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Maak oop in nuwe venster\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"فتح في نافذة جديدة\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Abrir en nueva ventana\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ouvrir dans une nouvelle fenêtre\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"नई विंडो में खोलें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Buka di Jendela Baru\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Apri in una nuova finestra\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"新しいウインドウで開く\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"새 윈도우에서 열기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Buka dalam Tetingkap Baharu\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Open in nieuw venster\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Otwórz w nowym oknie\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Abrir em nova janela\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Abrir em nova janela\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Открыть в новом окне\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Öppna i nytt fönster\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เปิดในหน้าต่างใหม่\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Yeni Pencerede Aç\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Відкрити в новому вікні\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mở trong cửa sổ mới\" } }\n      }\n    },\n    \"jots.menu.revealInFiles\": {\n      \"comment\": \"Context menu item to reveal the jot in the Files app (iOS only)\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Reveal in Files\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"In Dateien anzeigen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wys in Lêers\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الكشف في الملفات\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar en Archivos\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Afficher dans Fichiers\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Files में दिखाएं\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tampilkan di Files\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostra in File\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ファイルで表示\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"파일에서 보기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tunjukkan dalam Fail\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tonen in Bestanden\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pokaż w Plikach\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar em Arquivos\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar em Ficheiros\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Показать в Файлах\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Visa i Filer\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"แสดงใน Files\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dosyalar'da Göster\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Показати у Файлах\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hiện trong Files\" } }\n      }\n    },\n    \"jots.menu.revealInFinder\": {\n      \"comment\": \"Context menu item to reveal the jot in Finder (macOS Catalyst only)\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Reveal in Finder\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Im Finder anzeigen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wys in Finder\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الكشف في Finder\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar en el Finder\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Afficher dans le Finder\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Finder में दिखाएं\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tampilkan di Finder\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostra nel Finder\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Finderで表示\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Finder에서 보기\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tunjukkan dalam Finder\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tonen in Finder\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pokaż w Finderze\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar no Finder\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mostrar no Finder\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Показать в Finder\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Visa i Finder\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"แสดงใน Finder\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Finder'da Göster\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Показати у Finder\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hiện trong Finder\" } }\n      }\n    },\n    \"jots.rename.error.generic\": {\n      \"comment\": \"The error message displayed when a Jot couldn't be renamed.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not rename \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" konnte nicht umbenannt werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon \\\"%@\\\" nie hernoem nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر إعادة تسمية \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudo renombrar \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de renommer « %@ »\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" का नाम नहीं बदला जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat mengganti nama \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile rinominare «%@»\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」の名前を変更できませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"의 이름을 변경할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat menamakan semula \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet hernoemen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można zmienić nazwy \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível renomear \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível renomear \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось переименовать «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte byta namn på \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถเปลี่ยนชื่อ \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" yeniden adlandırılamadı\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося перейменувати «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể đổi tên \\\"%@\\\"\" } }\n      }\n    },\n    \"jots.share.error.generic\": {\n      \"comment\": \"The error message displayed when a Jot couldn't be shared.\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Could not share \\\"%@\\\"\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" konnte nicht geteilt werden\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kon \\\"%@\\\" nie deel nie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعذّر مشاركة \\\"%@\\\"\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"No se pudo compartir \\\"%@\\\"\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossible de partager « %@ »\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" को साझा नहीं किया जा सका\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat membagikan \\\"%@\\\"\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impossibile condividere «%@»\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"「%@」を共有できませんでした\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\"을(를) 공유할 수 없음\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tidak dapat berkongsi \\\"%@\\\"\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kan \\\"%@\\\" niet delen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Nie można udostępnić \\\"%@\\\"\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível compartilhar \\\"%@\\\"\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Não foi possível partilhar \\\"%@\\\"\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не удалось поделиться «%@»\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Kunde inte dela \\\"%@\\\"\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ไม่สามารถแชร์ \\\"%@\\\" ได้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"\\\"%@\\\" paylaşılamadı\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Не вдалося поділитися «%@»\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Không thể chia sẻ \\\"%@\\\"\" } }\n      }\n    },\n    \"jots.rename.title\": {\n      \"comment\": \"Title of the Rename Jot alert\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Rename Jot\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot umbenennen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hernoem Jot\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"إعادة تسمية Jot\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renombrar Jot\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renommer le Jot\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot का नाम बदलें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ganti Nama Jot\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Rinomina Jot\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jotの名前を変更\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot 이름 변경\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Namakan Semula Jot\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot hernoemen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Zmień nazwę Jot\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renomear Jot\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Renomear Jot\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Переименовать Jot\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Byt namn på Jot\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เปลี่ยนชื่อ Jot\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jot'u Yeniden Adlandır\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Перейменувати Jot\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Đổi tên Jot\" } }\n      }\n    },\n    \"settings.appearance.dark\": {\n      \"comment\": \"Appearance option label for dark mode\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dark\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dunkel\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Donker\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"داكن\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Oscuro\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sombre\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"डार्क\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Gelap\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Scuro\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ダーク\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"어둡게\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Gelap\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Donker\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ciemny\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Escuro\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Escuro\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Тёмная\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mörkt\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"มืด\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Koyu\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Темна\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tối\" } }\n      }\n    },\n    \"settings.appearance.light\": {\n      \"comment\": \"Appearance option label for light mode\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Light\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hell\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Lig\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"فاتح\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Claro\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Clair\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"लाइट\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Terang\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Chiaro\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ライト\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"밝게\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cerah\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Licht\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Jasny\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Claro\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Claro\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Светлая\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ljust\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"สว่าง\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Açık\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Світла\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sáng\" } }\n      }\n    },\n    \"settings.appearance.system\": {\n      \"comment\": \"Appearance option label for following the system setting\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"System\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"System\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Stelsel\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"النظام\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistema\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Système\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"सिस्टम\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistem\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistema\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"システム\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"시스템\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistem\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Systeem\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Systemowy\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistema\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistema\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Системная\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"System\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ระบบ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sistem\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Системна\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Hệ thống\" } }\n      }\n    },\n    \"settings.appearance.title\": {\n      \"comment\": \"Label for the appearance dropdown in Settings\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Appearance\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Erscheinungsbild\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Voorkoms\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"المظهر\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Apariencia\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Apparence\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"रूप-रंग\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tampilan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aspetto\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"外観\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"모양\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Penampilan\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Weergave\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wygląd\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aparência\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aparência\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Внешний вид\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Utseende\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"ลักษณะที่ปรากฏ\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Görünüm\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Зовнішній вигляд\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Giao diện\" } }\n      }\n    },\n    \"settings.github.title\": {\n      \"comment\": \"Label for the GitHub external link row in Settings\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Stargaze on GitHub\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Auf GitHub mit einem Stern markieren\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Stergaze op GitHub\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"أضف نجمة على GitHub\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dar una estrella en GitHub\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Mettre une étoile sur GitHub\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"GitHub पर स्टार करें\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Beri bintang di GitHub\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Metti una stella su GitHub\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"GitHubでスターをつける\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"GitHub에서 별표 추가\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Beri bintang di GitHub\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ster geven op GitHub\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dodaj gwiazdkę na GitHub\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dar uma estrela no GitHub\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dar uma estrela no GitHub\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Поставить звезду на GitHub\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Stjärnmärk på GitHub\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"กดดาวบน GitHub\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"GitHub'da yıldız ver\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Поставити зірку на GitHub\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Gắn sao trên GitHub\" } }\n      }\n    },\n    \"settings.icloud.info\": {\n      \"comment\": \"Caption text below the iCloud Synchronization row in Settings\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Learn how to enable iCloud on this device.\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Erfahre, wie du iCloud auf diesem Gerät aktivierst.\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Leer hoe om iCloud op hierdie toestel te aktiveer.\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"تعرّف على كيفية تفعيل iCloud على هذا الجهاز.\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Aprende cómo activar iCloud en este dispositivo.\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Découvrez comment activer iCloud sur cet appareil.\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"इस डिवाइस पर iCloud कैसे सक्षम करें, यह जानें।\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pelajari cara mengaktifkan iCloud di perangkat ini.\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Scopri come abilitare iCloud su questo dispositivo.\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"このデバイスでiCloudを有効にする方法を確認する。\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"이 기기에서 iCloud를 활성화하는 방법을 알아보세요.\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ketahui cara mengaktifkan iCloud pada peranti ini.\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Lees hoe je iCloud inschakelt op dit apparaat.\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Dowiedz się, jak włączyć iCloud na tym urządzeniu.\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Saiba como ativar o iCloud neste dispositivo.\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Saiba como ativar o iCloud neste dispositivo.\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Узнайте, как включить iCloud на этом устройстве.\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Lär dig hur du aktiverar iCloud på den här enheten.\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เรียนรู้วิธีเปิดใช้งาน iCloud บนอุปกรณ์นี้\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Bu cihazda iCloud'u nasıl etkinleştireceğinizi öğrenin.\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Дізнайтеся, як увімкнути iCloud на цьому пристрої.\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tìm hiểu cách bật iCloud trên thiết bị này.\" } }\n      }\n    },\n    \"settings.icloud.title\": {\n      \"comment\": \"Label for the iCloud synchronization row in Settings\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud Synchronization\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud-Synchronisierung\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud-sinkronisasie\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"مزامنة iCloud\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronización con iCloud\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchronisation iCloud\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud सिंक्रनाइज़ेशन\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sinkronisasi iCloud\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronizzazione iCloud\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud同期\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud 동기화\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Penyegerakan iCloud\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud-synchronisatie\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Synchronizacja iCloud\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronização com iCloud\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sincronização com iCloud\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Синхронизация iCloud\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud-synkronisering\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"การซิงค์ iCloud\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"iCloud Eşzamanlaması\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Синхронізація iCloud\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Đồng bộ iCloud\" } }\n      }\n    },\n    \"settings.title\": {\n      \"comment\": \"Navigation bar title of the Settings screen\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Settings\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Einstellungen\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Instellings\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الإعدادات\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ajustes\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Réglages\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"सेटिंग्स\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Pengaturan\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Impostazioni\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"設定\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"설정\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Tetapan\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Instellingen\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ustawienia\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Configurações\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Definições\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Настройки\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Inställningar\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"การตั้งค่า\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Ayarlar\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Налаштування\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Cài đặt\" } }\n      }\n    },\n    \"settings.version.title\": {\n      \"comment\": \"Label for the app version row in Settings\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Weergawe\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"الإصدار\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versión\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"संस्करण\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versi\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versione\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"バージョン\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"버전\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versi\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versie\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Wersja\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versão\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Versão\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Версия\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Version\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"เวอร์ชัน\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Sürüm\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Версія\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"Phiên bản\" } }\n      }\n    },\n    \"share.format.jpg\": {\n      \"comment\": \"Share format option label for JPEG\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"JPG\" } }\n      }\n    },\n    \"share.format.pdf\": {\n      \"comment\": \"Share format option label for PDF\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PDF\" } }\n      }\n    },\n    \"share.format.png\": {\n      \"comment\": \"Share format option label for PNG\",\n      \"extractionState\": \"manual\",\n      \"localizations\": {\n        \"en\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"de\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"af\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"ar\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"es\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"fr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"hi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"id\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"it\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"ja\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"ko\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"ms\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"nl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"pl\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"pt-BR\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"pt-PT\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"ru\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"sv\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"th\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"tr\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"uk\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } },\n        \"vi\": { \"stringUnit\": { \"state\": \"translated\", \"value\": \"PNG\" } }\n      }\n    }\n  },\n  \"version\": \"1.0\"\n}\n"
  },
  {
    "path": "Resources/PrivacyInfo.xcprivacy",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n    <key>NSPrivacyTracking</key>\n    <false/>\n    <key>NSPrivacyTrackingDomains</key>\n    <array/>\n    <key>NSPrivacyCollectedDataTypes</key>\n    <array/>\n    <key>NSPrivacyAccessedAPITypes</key>\n    <array>\n        <dict>\n            <key>NSPrivacyAccessedAPIType</key>\n            <string>NSPrivacyAccessedAPICategoryUserDefaults</string>\n            <key>NSPrivacyAccessedAPITypeReasons</key>\n            <array>\n                <string>CA92.1</string>\n            </array>\n        </dict>\n        <dict>\n            <key>NSPrivacyAccessedAPIType</key>\n            <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>\n            <key>NSPrivacyAccessedAPITypeReasons</key>\n            <array>\n                <string>C617.1</string>\n            </array>\n        </dict>\n    </array>\n</dict>\n</plist>\n"
  },
  {
    "path": "SECURITY_POLICY.md",
    "content": "# Security Policy\n\n## Reporting a Vulnerability\n\nIf you believe you have found a security vulnerability in Jottre, please report it privately. **Do not open a public GitHub issue.**\n\nUse [GitHub's private vulnerability reporting](https://github.com/antonlorani/jottre/security/advisories/new) to submit your report. This keeps the details confidential between you and the maintainer until a fix is available.\n\nWhen reporting, please include:\n\n- A description of the vulnerability and its potential impact.\n- Steps to reproduce the issue, including any proof-of-concept code if applicable.\n- The affected app version, platform (iOS, iPadOS, macOS), and platform version.\n- Any suggested mitigations or fixes, if you have them.\n\n## What to expect\n\n- You will receive an acknowledgement of your report as soon as possible.\n- The maintainer will investigate and keep you informed of the progress.\n- Once a fix is ready, it will be released and you will be credited in the advisory unless you prefer to remain anonymous.\n\n## Scope\n\nThis policy covers the Jottre application and any code in this repository. Vulnerabilities in third-party dependencies should be reported to their respective maintainers, but you are welcome to also notify us so we can update or mitigate.\n\n## Out of scope\n\n- Issues that require physical access to an unlocked device.\n- Social engineering of users or maintainers.\n- Vulnerabilities in outdated app versions that have already been fixed in a newer release.\n\nThank you for helping keep Jottre and its users safe.\n"
  },
  {
    "path": "Sources/AppDelegate.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@main\nfinal class AppDelegate: UIResponder, UIApplicationDelegate {\n\n    func application(\n        _ application: UIApplication,\n        configurationForConnecting connectingSceneSession: UISceneSession,\n        options: UIScene.ConnectionOptions\n    ) -> UISceneConfiguration {\n        UISceneConfiguration(\n            name: \"Default Configuration\",\n            sessionRole: connectingSceneSession.role\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/ApplicationService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol ApplicationServiceProtocol: Sendable {\n\n    func supportsMultipleScenes() -> Bool\n\n    func open(url: URL)\n\n    func canOpen(url: URL) -> Bool\n}\n\nstruct ApplicationService: ApplicationServiceProtocol {\n\n    private let application: UIApplication\n\n    init(application: UIApplication) {\n        self.application = application\n    }\n\n    func supportsMultipleScenes() -> Bool {\n        application.supportsMultipleScenes\n    }\n\n    func open(url: URL) {\n        application.open(url)\n    }\n\n    func canOpen(url: URL) -> Bool {\n        application.canOpenURL(url)\n    }\n}\n"
  },
  {
    "path": "Sources/BundleService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nprotocol BundleServiceProtocol: Sendable {\n\n    func shortVersionString() -> String?\n}\n\nstruct BundleService: BundleServiceProtocol {\n\n    private let bundle: Bundle\n\n    init(bundle: Bundle) {\n        self.bundle = bundle\n    }\n\n    func shortVersionString() -> String? {\n        bundle.infoDictionary?[\"CFBundleShortVersionString\"] as? String\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudImageCell/CloudImageCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class CloudImageCell: UICollectionViewCell, PageCell {\n    static let reuseIdentifier = \"CloudImageCell\"\n\n    private enum Constants {\n\n        static let height = CGFloat(80)\n    }\n\n    private let cloudImageView: UIImageView = {\n        let imageView = UIImageView(image: UIImage(systemName: \"checkmark.icloud.fill\"))\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.contentMode = .scaleAspectFit\n        imageView.clipsToBounds = true\n        imageView.tintColor = .label\n        return imageView\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    private func setUpViews() {\n        contentView.addSubview(cloudImageView)\n\n        NSLayoutConstraint.activate([\n            contentView.heightAnchor.constraint(equalToConstant: Constants.height),\n\n            cloudImageView.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),\n            cloudImageView.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n            cloudImageView.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),\n            cloudImageView.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n        ])\n    }\n\n    func configure(\n        viewModel: CloudImageCellViewModel\n    ) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudImageCell/CloudImageCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class CloudImageCellViewModel: PageCellViewModel {\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudImageCell/PageCellItem+cloudImage.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func cloudImage() -> PageCellItem {\n        PageCellItem(\n            id: #function,\n            cellType: CloudImageCell.self,\n            sizing: .fullWidth(estimatedHeight: 80),\n            viewModel: CloudImageCellViewModel()\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol CloudMigrationCoordinatorProtocol: Coordinator {\n\n    func shouldStart() -> Bool\n\n    func showInfoAlert(title: String, message: String)\n\n    func dismiss()\n}\n\nfinal class CloudMigrationCoordinator: CloudMigrationCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    private let repository: CloudMigrationRepositoryProtocol\n    private let navigation: Navigation\n    private let cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryProtocol\n    private let logger: LoggerProtocol\n\n    init(\n        repository: CloudMigrationRepositoryProtocol,\n        navigation: Navigation,\n        cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryProtocol,\n        logger: LoggerProtocol\n    ) {\n        self.repository = repository\n        self.navigation = navigation\n        self.cloudMigrationViewControllerFactory = cloudMigrationViewControllerFactory\n        self.logger = logger\n    }\n\n    func shouldStart() -> Bool {\n        repository.getShouldShowCloudMigration()\n    }\n\n    func start() {\n        let navigationController = UINavigationController(\n            rootViewController: cloudMigrationViewControllerFactory.make(\n                viewModel: CloudMigrationViewModel(\n                    repository: repository,\n                    coordinator: self,\n                    logger: logger\n                )\n            )\n        )\n        navigation.present(navigationController, animated: true)\n    }\n\n    func showInfoAlert(\n        title: String,\n        message: String\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n        }\n        infoAlertCoordinator.start()\n    }\n\n    func dismiss() {\n        navigation.dismiss(animated: true) { [weak self] in\n            Task { @MainActor in\n                self?.onEnd?()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol CloudMigrationCoordinatorFactoryProtocol: Sendable {\n\n    func make(navigation: Navigation) -> CloudMigrationCoordinatorProtocol\n}\n\nstruct CloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactoryProtocol {\n\n    let repository: CloudMigrationRepositoryProtocol\n    let cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryProtocol\n    let logger: LoggerProtocol\n\n    func make(navigation: Navigation) -> CloudMigrationCoordinatorProtocol {\n        CloudMigrationCoordinator(\n            repository: repository,\n            navigation: navigation,\n            cloudMigrationViewControllerFactory: cloudMigrationViewControllerFactory,\n            logger: logger\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationJotBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nstruct CloudMigrationJotBusinessModel: Sendable, Hashable {\n    let name: String\n    let lastModifiedText: String\n    let isUbiquitous: Bool\n    let isDownloaded: Bool\n    let isDownloading: Bool\n\n    private let jotFileInfo: JotFile.Info\n\n    init(jotFileInfo: JotFile.Info) {\n        name = jotFileInfo.name\n        lastModifiedText =\n            jotFileInfo.modificationDate.map {\n                DateFormatter.localizedString(\n                    from: $0,\n                    dateStyle: .long,\n                    timeStyle: .short\n                )\n            } ?? String()\n        self.isUbiquitous = jotFileInfo.ubiquitousInfo != nil\n        self.isDownloaded = jotFileInfo.ubiquitousInfo?.downloadStatus != .notDownloaded\n        self.isDownloading = jotFileInfo.ubiquitousInfo?.isDownloading ?? false\n        self.jotFileInfo = jotFileInfo\n    }\n\n    func toJotFileInfo() -> JotFile.Info {\n        jotFileInfo\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationJotCell/CloudMigrationJotCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class CloudMigrationJotCell: UICollectionViewCell, PageCell {\n    static let reuseIdentifier = \"CloudMigrationJotCell\"\n\n    private enum Constants {\n\n        static let height = CGFloat(56)\n\n        enum Preview {\n            static let width = CGFloat(70)\n        }\n\n        enum Checbox {\n            static let size = CGFloat(30)\n\n            static func image(isOn: Bool) -> UIImage? {\n                isOn ? UIImage(systemName: \"checkmark.circle.fill\") : UIImage(systemName: \"circle\")\n            }\n        }\n    }\n\n    private let previewImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.contentMode = .scaleAspectFit\n        imageView.clipsToBounds = true\n        return imageView\n    }()\n\n    private let separatorLine: UIView = {\n        let view = UIView()\n        view.translatesAutoresizingMaskIntoConstraints = false\n        view.backgroundColor = .separator\n        return view\n    }()\n\n    private let labelContainer: UIView = {\n        let view = UIView()\n        view.translatesAutoresizingMaskIntoConstraints = false\n        return view\n    }()\n\n    private let nameLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .body)\n        label.numberOfLines = 1\n        return label\n    }()\n\n    private let infoTextLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .caption1)\n        label.textColor = .secondaryLabel\n        label.numberOfLines = 1\n        return label\n    }()\n\n    private let checkboxImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.tintColor = .label\n        imageView.contentMode = .scaleAspectFit\n        return imageView\n    }()\n\n    private lazy var downloadActivityIndicator: UIActivityIndicatorView = {\n        let indicator = UIActivityIndicatorView(style: .medium)\n        indicator.translatesAutoresizingMaskIntoConstraints = false\n        return indicator\n    }()\n\n    private let trailingSlotGuide = UILayoutGuide()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {\n        super.traitCollectionDidChange(previousTraitCollection)\n\n        if traitCollection.hasRenderingChange(comparedTo: previousTraitCollection) {\n            loadPreviewImage()\n        }\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemGroupedBackground\n        contentView.layer.cornerRadius = DesignTokens.CornerRadius.cell\n        contentView.clipsToBounds = true\n        contentView.layoutMargins = UIEdgeInsets(\n            top: DesignTokens.Spacing.xs,\n            left: DesignTokens.Spacing.xs,\n            bottom: DesignTokens.Spacing.xs,\n            right: DesignTokens.Spacing.md\n        )\n\n        contentView.addLayoutGuide(trailingSlotGuide)\n        contentView.addSubview(previewImageView)\n        contentView.addSubview(separatorLine)\n        contentView.addSubview(labelContainer)\n        labelContainer.addSubview(nameLabel)\n        labelContainer.addSubview(infoTextLabel)\n\n        NSLayoutConstraint.activate([\n            contentView.heightAnchor.constraint(equalToConstant: Constants.height),\n\n            previewImageView.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n            previewImageView.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),\n            previewImageView.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),\n            previewImageView.widthAnchor.constraint(equalToConstant: Constants.Preview.width),\n\n            separatorLine.leadingAnchor.constraint(equalTo: previewImageView.trailingAnchor),\n            separatorLine.topAnchor.constraint(equalTo: contentView.topAnchor),\n            separatorLine.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),\n            separatorLine.widthAnchor.constraint(equalToConstant: DesignTokens.Length.separator),\n\n            trailingSlotGuide.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n            trailingSlotGuide.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n            trailingSlotGuide.widthAnchor.constraint(equalToConstant: Constants.Checbox.size),\n            trailingSlotGuide.heightAnchor.constraint(equalToConstant: Constants.Checbox.size),\n\n            labelContainer.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n            labelContainer.leadingAnchor.constraint(\n                equalTo: separatorLine.trailingAnchor,\n                constant: DesignTokens.Spacing.md\n            ),\n            labelContainer.trailingAnchor.constraint(\n                lessThanOrEqualTo: trailingSlotGuide.leadingAnchor,\n                constant: -DesignTokens.Spacing.xs\n            ),\n\n            nameLabel.topAnchor.constraint(equalTo: labelContainer.topAnchor),\n            nameLabel.leadingAnchor.constraint(equalTo: labelContainer.leadingAnchor),\n            nameLabel.trailingAnchor.constraint(equalTo: labelContainer.trailingAnchor),\n\n            infoTextLabel.topAnchor.constraint(equalTo: nameLabel.bottomAnchor),\n            infoTextLabel.leadingAnchor.constraint(equalTo: labelContainer.leadingAnchor),\n            infoTextLabel.trailingAnchor.constraint(equalTo: labelContainer.trailingAnchor),\n            infoTextLabel.bottomAnchor.constraint(equalTo: labelContainer.bottomAnchor),\n        ])\n    }\n\n    private var viewModel: CloudMigrationJotCellViewModel?\n    private var previewImageTask: Task<Void, Never>?\n\n    override func prepareForReuse() {\n        super.prepareForReuse()\n        previewImageView.image = nil\n        checkboxImageView.removeFromSuperview()\n        downloadActivityIndicator.removeFromSuperview()\n        downloadActivityIndicator.stopAnimating()\n    }\n\n    func configure(\n        viewModel: CloudMigrationJotCellViewModel\n    ) {\n        self.viewModel = viewModel\n        nameLabel.text = viewModel.name\n        infoTextLabel.text = viewModel.infoText\n        if viewModel.isDownloading {\n            contentView.addSubview(downloadActivityIndicator)\n            NSLayoutConstraint.activate([\n                downloadActivityIndicator.centerXAnchor.constraint(equalTo: trailingSlotGuide.centerXAnchor),\n                downloadActivityIndicator.centerYAnchor.constraint(equalTo: trailingSlotGuide.centerYAnchor),\n            ])\n            downloadActivityIndicator.startAnimating()\n        } else {\n            contentView.addSubview(checkboxImageView)\n            NSLayoutConstraint.activate([\n                checkboxImageView.centerXAnchor.constraint(equalTo: trailingSlotGuide.centerXAnchor),\n                checkboxImageView.centerYAnchor.constraint(equalTo: trailingSlotGuide.centerYAnchor),\n                checkboxImageView.widthAnchor.constraint(equalToConstant: Constants.Checbox.size),\n                checkboxImageView.heightAnchor.constraint(equalToConstant: Constants.Checbox.size),\n            ])\n            checkboxImageView.image = Constants.Checbox.image(isOn: viewModel.isCloudCheckboxOn)\n        }\n        loadPreviewImage()\n    }\n\n    private func loadPreviewImage() {\n        guard let viewModel else {\n            return\n        }\n        previewImageTask?.cancel()\n        previewImageTask = Task { [weak self] in\n            guard let self else {\n                return\n            }\n            previewImageView.image = await viewModel.getPreviewImage(\n                userInterfaceStyle: traitCollection.userInterfaceStyle,\n                displayScale: traitCollection.displayScale\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationJotCell/CloudMigrationJotCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class CloudMigrationJotCellViewModel: PageCellViewModel {\n\n    let name: String\n    let infoText: String\n    let isCloudCheckboxOn: Bool\n    let isDownloading: Bool\n    let onTap: @Sendable () -> Void\n\n    private let cloudMigrationJot: CloudMigrationJotBusinessModel\n    private let repository: CloudMigrationRepositoryProtocol\n\n    init(\n        cloudMigrationJot: CloudMigrationJotBusinessModel,\n        repository: CloudMigrationRepositoryProtocol,\n        onTap: @Sendable @escaping () -> Void\n    ) {\n        name = cloudMigrationJot.name\n        infoText = cloudMigrationJot.lastModifiedText\n        isCloudCheckboxOn = cloudMigrationJot.isUbiquitous\n        isDownloading = cloudMigrationJot.isDownloading\n        self.cloudMigrationJot = cloudMigrationJot\n        self.repository = repository\n        self.onTap = onTap\n    }\n\n    func handle(action: PageCellAction) {\n        switch action {\n        case .tap:\n            onTap()\n        }\n    }\n\n    func getPreviewImage(\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await repository.getPreviewImage(\n            jotFileInfo: cloudMigrationJot.toJotFileInfo(),\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationJotCell/PageCellItem+cloudMigrationJot.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func cloudMigrationJot(\n        cloudMigrationJot: CloudMigrationJotBusinessModel,\n        repository: CloudMigrationRepositoryProtocol,\n        onTap: @Sendable @escaping () -> Void\n    ) -> PageCellItem {\n        PageCellItem(\n            id: cloudMigrationJot,\n            cellType: CloudMigrationJotCell.self,\n            sizing: .fullWidth(estimatedHeight: 56),\n            viewModel: CloudMigrationJotCellViewModel(\n                cloudMigrationJot: cloudMigrationJot,\n                repository: repository,\n                onTap: onTap\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\nprotocol CloudMigrationRepositoryProtocol: Sendable {\n\n    func getJotFiles() -> AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error>\n\n    func moveJotFile(\n        jotFileInfo: JotFile.Info,\n        shouldBecomeUbiquitous: Bool\n    ) async throws\n\n    func getShouldShowCloudMigration() -> Bool\n\n    func markCloudMigrationPageDone()\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage?\n}\n\nstruct CloudMigrationRepository: CloudMigrationRepositoryProtocol {\n\n    private let ubiquitousFileService: FileServiceProtocol\n    private let jotFileService: JotFileServiceProtocol\n    private let jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n    private let defaultsService: DefaultsServiceProtocol\n\n    init(\n        ubiquitousFileService: FileServiceProtocol,\n        jotFileService: JotFileServiceProtocol,\n        jotFilePreviewImageService: JotFilePreviewImageServiceProtocol,\n        defaultsService: DefaultsServiceProtocol\n    ) {\n        self.ubiquitousFileService = ubiquitousFileService\n        self.jotFileService = jotFileService\n        self.jotFilePreviewImageService = jotFilePreviewImageService\n        self.defaultsService = defaultsService\n    }\n\n    func getJotFiles() -> AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> {\n        jotFileService\n            .documentsDirectoryContents()\n            .map { jotFileInfos in\n                jotFileInfos\n                    .sorted { lhs, rhs in\n                        if (lhs.ubiquitousInfo != nil) != (rhs.ubiquitousInfo != nil) {\n                            return lhs.ubiquitousInfo == nil\n                        }\n                        return lhs.modificationDate ?? .distantPast > rhs.modificationDate ?? .distantPast\n                    }\n                    .map(CloudMigrationJotBusinessModel.init)\n            }\n            .toAsyncThrowingStream()\n    }\n\n    func moveJotFile(\n        jotFileInfo: JotFile.Info,\n        shouldBecomeUbiquitous: Bool\n    ) async throws {\n        try await jotFileService.move(\n            jotFileInfo: jotFileInfo,\n            shouldBecomeUbiquitous: shouldBecomeUbiquitous\n        )\n    }\n\n    func getShouldShowCloudMigration() -> Bool {\n        if defaultsService.getValue(.hasDoneCloudMigration) == true {\n            return false\n        }\n\n        let isUbiquitousFileServiceEnabled = ubiquitousFileService.isEnabled()\n        if let wasICloudEnabled = defaultsService.getValue(.isICloudEnabled) {\n            return wasICloudEnabled != isUbiquitousFileServiceEnabled\n        }\n\n        if !isUbiquitousFileServiceEnabled {\n            defaultsService.set(.isICloudEnabled, value: false)\n        }\n\n        return false\n    }\n\n    func markCloudMigrationPageDone() {\n        defaultsService.set(.hasDoneCloudMigration, value: true)\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        do {\n            let imageData = try await jotFilePreviewImageService.getPreviewImageData(\n                jotFileInfo: jotFileInfo,\n                userInterfaceStyle: userInterfaceStyle,\n                displayScale: displayScale\n            )\n            return UIImage(data: imageData)\n        } catch {\n            return nil\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol CloudMigrationViewControllerFactoryProtocol: Sendable {\n\n    func make(viewModel: CloudMigrationViewModel) -> UIViewController\n}\n\nstruct CloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryProtocol {\n\n    let textBarButtonItemFactory: TextBarButtonItemFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    func make(viewModel: CloudMigrationViewModel) -> UIViewController {\n        PageViewController(\n            viewModel: viewModel,\n            textBarButtonItemFactory: textBarButtonItemFactory,\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/CloudMigrationViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@MainActor\nfinal class CloudMigrationViewModel: PageViewModel, Sendable {\n\n    let items: AsyncStream<[PageCellItem]>\n    private let itemsContinuation: AsyncStream<[PageCellItem]>.Continuation\n\n    private let repository: CloudMigrationRepositoryProtocol\n    private weak var coordinator: CloudMigrationCoordinatorProtocol?\n    private let logger: LoggerProtocol\n\n    private(set) lazy var actions = [\n        PageCallToActionView.ActionConfiguration(\n            style: .primary,\n            title: L10n.Action.done,\n            icon: nil\n        ) { [weak self] in\n            self?.didTapDoneButton()\n        }\n    ]\n\n    private var jotsTask: Task<Void, Never>?\n\n    init(\n        repository: CloudMigrationRepositoryProtocol,\n        coordinator: CloudMigrationCoordinatorProtocol,\n        logger: LoggerProtocol\n    ) {\n        self.repository = repository\n        self.coordinator = coordinator\n        self.logger = logger\n\n        (items, itemsContinuation) = AsyncStream.makeStream(\n            of: [PageCellItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n    }\n\n    func didLoad() {\n        jotsTask = Task { [weak self] in\n            guard let self else {\n                return\n            }\n            do {\n                for try await cloudMigrationJots in repository.getJotFiles() {\n                    handleJots(cloudMigrationJots: cloudMigrationJots)\n                }\n            } catch {\n                logger.error(\"Failed to observe migration jot files: \\(error)\")\n            }\n        }\n    }\n\n    private func handleJots(cloudMigrationJots: [CloudMigrationJotBusinessModel]) {\n        var items = [PageCellItem]()\n\n        if cloudMigrationJots.isEmpty {\n            items.append(\n                contentsOf: [\n                    PageCellItem.cloudImage(),\n                    PageCellItem.pageHeader(\n                        headline: L10n.CloudMigration.title,\n                        subheadline: L10n.CloudMigration.NothingToMigrate.subtitle\n                    ),\n                ]\n            )\n        } else {\n            items.append(\n                PageCellItem.pageHeader(\n                    headline: L10n.CloudMigration.title,\n                    subheadline: L10n.CloudMigration.subtitle\n                )\n            )\n            items.append(\n                contentsOf: cloudMigrationJots.map { cloudMigrationJot in\n                    PageCellItem.cloudMigrationJot(\n                        cloudMigrationJot: cloudMigrationJot,\n                        repository: repository,\n                    ) { [weak self] in\n                        Task { @MainActor in\n                            self?.didTapCloudMigrationJot(cloudMigrationJot: cloudMigrationJot)\n                        }\n                    }\n                }\n            )\n        }\n\n        itemsContinuation.yield(items)\n    }\n\n    private func didTapCloudMigrationJot(\n        cloudMigrationJot: CloudMigrationJotBusinessModel\n    ) {\n        Task { [weak self] in\n            do {\n                try await self?.repository.moveJotFile(\n                    jotFileInfo: cloudMigrationJot.toJotFileInfo(),\n                    shouldBecomeUbiquitous: !cloudMigrationJot.isUbiquitous\n                )\n            } catch {\n                self?.coordinator?.showInfoAlert(\n                    title: L10n.CloudMigration.ErrorAlert.title(cloudMigrationJot.name),\n                    message: error.localizedDescription\n                )\n            }\n        }\n    }\n\n    private func didTapDoneButton() {\n        repository.markCloudMigrationPageDone()\n        coordinator?.dismiss()\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/DefaultsKey+hasDoneCloudMigration.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension DefaultsKey {\n\n    static var hasDoneCloudMigration: DefaultsKey<Bool> {\n        #function\n    }\n}\n"
  },
  {
    "path": "Sources/CloudMigrationPage/DefaultsKey+isICloudEnabled.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension DefaultsKey {\n\n    static var isICloudEnabled: DefaultsKey<Bool> {\n        #function\n    }\n}\n"
  },
  {
    "path": "Sources/Defaults/DefaultsContinuationStorage.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nfinal class DefaultsContinuationStorage: @unchecked Sendable {\n    private let lock = NSLock()\n    private var continuations: [String: [Any]] = [:]\n\n    func add<T: LosslessStringConvertible & Sendable>(\n        _ continuation: AsyncStream<T?>.Continuation,\n        defaultsKey: DefaultsKey<T>\n    ) {\n        lock.withLock {\n            continuations[defaultsKey.description, default: []].append(continuation)\n        }\n    }\n\n    func remove<T: LosslessStringConvertible & Sendable>(\n        _ continuation: AsyncStream<T?>.Continuation,\n        defaultsKey: DefaultsKey<T>\n    ) {\n        lock.withLock {\n            continuations[defaultsKey.description]?.removeAll {\n                ($0 as AnyObject) === (continuation as AnyObject)\n            }\n        }\n    }\n\n    func continuations<T: LosslessStringConvertible & Sendable>(\n        defaultsKey: DefaultsKey<T>\n    ) -> [AsyncStream<T?>.Continuation]? {\n        lock.withLock {\n            continuations[defaultsKey.description]?\n                .compactMap { continuation in\n                    continuation as? AsyncStream<T?>.Continuation\n                }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/Defaults/DefaultsKey.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct DefaultsKey<T: LosslessStringConvertible & Sendable>: Sendable, CustomStringConvertible,\n    ExpressibleByStringLiteral\n{\n\n    let description: String\n\n    init(_ key: String) {\n        description = key\n    }\n\n    init(stringLiteral value: StringLiteralType) {\n        description = value\n    }\n}\n"
  },
  {
    "path": "Sources/Defaults/DefaultsService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nprotocol DefaultsServiceProtocol: Sendable {\n\n    func getValue<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>) -> T?\n\n    func set<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>, value: T?)\n\n    func getValueStream<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>) -> AsyncStream<T?>\n}\n\nfinal class DefaultsService: DefaultsServiceProtocol, @unchecked Sendable {\n\n    private let userDefaults: UserDefaults\n    private let continuationStorage = DefaultsContinuationStorage()\n\n    init(userDefaults: UserDefaults) {\n        self.userDefaults = userDefaults\n    }\n\n    func getValue<T: LosslessStringConvertible & Sendable>(\n        _ defaultsKey: DefaultsKey<T>\n    ) -> T? {\n        guard let value = userDefaults.value(forKey: defaultsKey.description) as? String else {\n            return nil\n        }\n        return T(value)\n    }\n\n    func set<T: LosslessStringConvertible & Sendable>(\n        _ defaultsKey: DefaultsKey<T>,\n        value: T?\n    ) {\n        let key = defaultsKey.description\n        userDefaults.setValue(value?.description, forKey: key)\n\n        if let continuations = continuationStorage.continuations(defaultsKey: defaultsKey) {\n            for continuation in continuations {\n                continuation.yield(value)\n            }\n        }\n    }\n\n    func getValueStream<T: LosslessStringConvertible & Sendable>(\n        _ defaultsKey: DefaultsKey<T>\n    ) -> AsyncStream<T?> {\n        AsyncStream { [weak self] continuation in\n            continuation.yield(self?.getValue(defaultsKey))\n\n            self?.continuationStorage.add(\n                continuation,\n                defaultsKey: defaultsKey\n            )\n\n            continuation.onTermination = { [weak self] _ in\n                self?.continuationStorage.remove(\n                    continuation,\n                    defaultsKey: defaultsKey\n                )\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/DesignTokens.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nenum DesignTokens {\n\n    enum Spacing {\n        static let xs = CGFloat(8)\n        static let sm = CGFloat(12)\n        static let md = CGFloat(16)\n    }\n\n    enum CornerRadius {\n        static let cell = CGFloat(20)\n    }\n\n    enum Length {\n        static let separator = CGFloat(1)\n    }\n}\n"
  },
  {
    "path": "Sources/DeviceService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol DeviceServiceProtocol: Sendable {\n\n    func isIPadOS() -> Bool\n}\n\nstruct DeviceService: DeviceServiceProtocol {\n\n    private let device: UIDevice\n\n    init(device: UIDevice) {\n        self.device = device\n    }\n\n    func isIPadOS() -> Bool {\n        #if os(iOS)\n        device.userInterfaceIdiom == .pad\n        #else\n        false\n        #endif\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol EditJotCoordinatorProtocol: NavigationCoordinator {\n\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    )\n    func showRenameAlert(jotFileInfo: JotFile.Info)\n    func openDeleteJot(jotFileInfo: JotFile.Info)\n    func openJot(jotFileInfo: JotFile.Info)\n    func showInFiles(jotFileInfo: JotFile.Info)\n    func showJotConflictPage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    )\n    func canGoBack() -> Bool\n    func goBack()\n    func showInfoAlert(title: String, message: String)\n}\n\nfinal class EditJotCoordinator: NavigationCoordinator, EditJotCoordinatorProtocol {\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    private var retainedJotConflictCoordinator: Coordinator?\n    private var retainedShareJotCoordinator: Coordinator?\n    private var retainedRenameJotCoordinator: Coordinator?\n    private var retainedDeleteJotCoordinator: Coordinator?\n    private var retainedRevealFileCoordinator: Coordinator?\n\n    private let navigation: Navigation\n    private let repository: EditJotRepositoryProtocol\n    private let editJotViewControllerFactory: EditJotViewControllerFactoryProtocol\n    private let jotConflictCoordinatorFactory: JotConflictCoordinatorFactoryProtocol\n    private let renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol\n    private let deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol\n    private let shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol\n    private let revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n\n    init(\n        navigation: Navigation,\n        repository: EditJotRepositoryProtocol,\n        editJotViewControllerFactory: EditJotViewControllerFactoryProtocol,\n        jotConflictCoordinatorFactory: JotConflictCoordinatorFactoryProtocol,\n        renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol,\n        deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol,\n        shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol,\n        revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n    ) {\n        self.navigation = navigation\n        self.repository = repository\n        self.editJotViewControllerFactory = editJotViewControllerFactory\n        self.jotConflictCoordinatorFactory = jotConflictCoordinatorFactory\n        self.renameJotCoordinatorFactory = renameJotCoordinatorFactory\n        self.deleteJotCoordinatorFactory = deleteJotCoordinatorFactory\n        self.shareJotCoordinatorFactory = shareJotCoordinatorFactory\n        self.revealFileCoordinatorFactory = revealFileCoordinatorFactory\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        guard EditJotURL(url: url) != nil else {\n            return false\n        }\n        return true\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        guard\n            let editJotURL = EditJotURL(url: url),\n            let jotFileInfo = JotFile.Info(\n                url: editJotURL.fileURL,\n                modificationDate: nil,\n                ubiquitousInfo: repository.ubiquitousInfo(url: editJotURL.fileURL)\n            )\n        else {\n            return []\n        }\n\n        return [\n            editJotViewControllerFactory.make(\n                jotFileInfo: jotFileInfo,\n                coordinator: self\n            )\n        ]\n    }\n\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    ) {\n        let coordinator = shareJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            format: format,\n            navigation: navigation,\n            configurePopoverAnchor: configurePopoverAnchor\n        )\n        retainedShareJotCoordinator = coordinator\n        coordinator.onEnd = { [weak self] in\n            self?.retainedShareJotCoordinator = nil\n        }\n        coordinator.start()\n    }\n\n    func showRenameAlert(jotFileInfo: JotFile.Info) {\n        let coordinator = renameJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        ) { [weak self] renameJotFileInfo in\n            Task { @MainActor in\n                self?.openJot(jotFileInfo: renameJotFileInfo)\n            }\n        }\n        retainedRenameJotCoordinator = coordinator\n        coordinator.onEnd = { [weak self] in\n            self?.retainedRenameJotCoordinator = nil\n        }\n        coordinator.start()\n    }\n\n    func openDeleteJot(jotFileInfo: JotFile.Info) {\n        let deleteJotCoordinator = deleteJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        )\n        retainedDeleteJotCoordinator = deleteJotCoordinator\n        deleteJotCoordinator.onEnd = { [weak self] in\n            self?.retainedDeleteJotCoordinator = nil\n            self?.goBack()\n        }\n        deleteJotCoordinator.start()\n    }\n\n    func openJot(jotFileInfo: JotFile.Info) {\n        navigation.open(url: EditJotURL(jotFileInfo: jotFileInfo))\n    }\n\n    func showInFiles(jotFileInfo: JotFile.Info) {\n        let revealFileCoordinator = revealFileCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        )\n        retainedRevealFileCoordinator = revealFileCoordinator\n        revealFileCoordinator.onEnd = { [weak self] in\n            self?.retainedRevealFileCoordinator = nil\n        }\n        revealFileCoordinator.start()\n    }\n\n    func showJotConflictPage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) {\n        let jotConflictCoordinator = jotConflictCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            jotFileVersions: jotFileVersions,\n            navigation: navigation,\n            onResult: onResult\n        )\n        retainedJotConflictCoordinator = jotConflictCoordinator\n        jotConflictCoordinator.onEnd = { [weak self] in\n            self?.retainedJotConflictCoordinator = nil\n        }\n        jotConflictCoordinator.start()\n    }\n\n    func canGoBack() -> Bool {\n        navigation.getViewControllers().count > 1\n    }\n\n    func goBack() {\n        navigation.popViewController(animated: true)\n    }\n\n    func showInfoAlert(\n        title: String,\n        message: String\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n        }\n        infoAlertCoordinator.start()\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol EditJotCoordinatorFactoryProtocol {\n\n    func make(navigation: Navigation) -> NavigationCoordinator\n}\n\nstruct EditJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol {\n\n    let repository: EditJotRepositoryProtocol\n    let editJotViewControllerFactory: EditJotViewControllerFactoryProtocol\n    let jotConflictCoordinatorFactory: JotConflictCoordinatorFactory\n    let renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol\n    let deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol\n    let shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol\n    let revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n\n    func make(navigation: Navigation) -> NavigationCoordinator {\n        EditJotCoordinator(\n            navigation: navigation,\n            repository: repository,\n            editJotViewControllerFactory: editJotViewControllerFactory,\n            jotConflictCoordinatorFactory: jotConflictCoordinatorFactory,\n            renameJotCoordinatorFactory: renameJotCoordinatorFactory,\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\n\nprotocol EditJotRepositoryProtocol: Sendable {\n\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo?\n    func readDrawing(jotFileInfo: JotFile.Info) async throws -> (drawing: PKDrawing, width: CGFloat)\n    func writeDrawing(jotFileInfo: JotFile.Info, drawing: PKDrawing) async throws\n    func getConflictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]?\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info\n}\n\nstruct EditJotRepository: EditJotRepositoryProtocol {\n\n    private let ubiquitousFileService: FileServiceProtocol\n    private let jotFileService: JotFileServiceProtocol\n    private let jotFileConflictService: JotFileConflictServiceProtocol\n\n    init(\n        ubiquitousFileService: FileServiceProtocol,\n        jotFileService: JotFileServiceProtocol,\n        jotFileConflictService: JotFileConflictServiceProtocol\n    ) {\n        self.ubiquitousFileService = ubiquitousFileService\n        self.jotFileService = jotFileService\n        self.jotFileConflictService = jotFileConflictService\n    }\n\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo? {\n        ubiquitousFileService.ubiquitousInfo(url: url)\n    }\n\n    func readDrawing(jotFileInfo: JotFile.Info) async throws -> (drawing: PKDrawing, width: CGFloat) {\n        try? FileManager.default.startDownloadingUbiquitousItem(at: jotFileInfo.url)\n\n        let file = try jotFileService.readJotFile(jotFileInfo: jotFileInfo)\n        let drawing = try PKDrawing(data: file.jot.drawing)\n        return (\n            drawing: drawing,\n            width: file.jot.width\n        )\n    }\n\n    func writeDrawing(jotFileInfo: JotFile.Info, drawing: PKDrawing) async throws {\n        let jot = Jot.makeEmpty()\n        let jotFile = JotFile(\n            info: jotFileInfo,\n            jot: Jot(\n                version: jot.version,\n                drawing: drawing.dataRepresentation(),\n                width: jot.width\n            )\n        )\n        try jotFileService.write(jotFile: jotFile)\n    }\n\n    func getConflictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]? {\n        jotFileConflictService.getConfictingVersions(jotFileInfo: jotFileInfo)\n    }\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        try jotFileService.duplicate(jotFileInfo: jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotURL.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nstruct EditJotURL: URLConvertible {\n    static let path = \"/jots/edit\"\n\n    let path: String = Self.path\n    var queryItems: [URLQueryItem] {\n        [\n            URLQueryItem(\n                name: \"fileURL\",\n                value: fileURL.absoluteString\n            )\n        ]\n    }\n\n    let fileURL: URL\n\n    init(jotFileInfo: JotFile.Info) {\n        fileURL = jotFileInfo.url\n    }\n\n    init?(url: URL) {\n        guard\n            url.path.hasPrefix(EditJotURL.path),\n            let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false),\n            let fileURLValue = urlComponents.queryItems?.first(where: { $0.name == \"fileURL\" })?.value,\n            let fileURL = URL(string: fileURLValue)\n        else {\n            return nil\n        }\n\n        self.fileURL = fileURL\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotViewController.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\nimport UIKit\n\nfinal class EditJotViewController: UIViewController {\n\n    private enum Constants {\n\n        enum CanvasView {\n            static let maximumZoomScale = CGFloat(3)\n            static let bottomFreespace = CGFloat(500)\n        }\n    }\n\n    #if !targetEnvironment(macCatalyst)\n    private lazy var toolPicker = PKToolPicker()\n    #endif\n\n    private lazy var canvasView: PKCanvasView = {\n        let canvasView = PKCanvasView()\n        canvasView.delegate = self\n        canvasView.translatesAutoresizingMaskIntoConstraints = false\n        canvasView.drawingPolicy = .default\n        canvasView.maximumZoomScale = Constants.CanvasView.maximumZoomScale\n        canvasView.bounces = false\n        canvasView.contentInsetAdjustmentBehavior = .always\n        return canvasView\n    }()\n\n    private var drawingWidth = CGFloat.zero\n\n    private lazy var swipeBackGesture: UIScreenEdgePanGestureRecognizer = {\n        let gesture = UIScreenEdgePanGestureRecognizer(\n            target: self,\n            action: #selector(handleSwipeBack)\n        )\n        gesture.edges = .left\n        gesture.isEnabled = false\n        return gesture\n    }()\n\n    private var isEditingTask: Task<Void, Never>?\n    private var drawingTask: Task<Void, Never>?\n    private var backButtonTask: Task<Void, Never>?\n\n    private let viewModel: EditJotViewModel\n    private let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    init(\n        viewModel: EditJotViewModel,\n        symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n    ) {\n        self.viewModel = viewModel\n        self.symbolBarButtonItemFactory = symbolBarButtonItemFactory\n        super.init(nibName: nil, bundle: nil)\n\n        isEditingTask = Task { @MainActor [weak self] in\n            for await isEditing in viewModel.isEditing {\n                self?.handleEditing(isEditing: isEditing)\n            }\n        }\n        drawingTask = Task { @MainActor [weak self] in\n            for await drawing in viewModel.drawing {\n                guard let self else {\n                    return\n                }\n                drawingWidth = drawing.width\n                canvasView.drawing = drawing.value\n\n                if canvasView.superview == nil {\n                    setUpCanvasView()\n                }\n            }\n        }\n        backButtonTask = Task { @MainActor [weak self] in\n            for await showsBackButton in viewModel.showsBackButton {\n                self?.handleBackButton(showsBackButton: showsBackButton)\n            }\n        }\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    deinit {\n        isEditingTask?.cancel()\n        drawingTask?.cancel()\n        backButtonTask?.cancel()\n    }\n\n    override func viewDidLoad() {\n        setUpNavigationBar()\n        setUpViews()\n\n        super.viewDidLoad()\n\n        viewModel.didLoad()\n    }\n\n    override func viewDidLayoutSubviews() {\n        super.viewDidLayoutSubviews()\n\n        layoutCanvasContent()\n    }\n\n    private func setUpNavigationBar() {\n        navigationItem.largeTitleDisplayMode = .never\n        navigationItem.title = viewModel.title\n    }\n\n    private func handleBackButton(showsBackButton: Bool) {\n        guard showsBackButton else {\n            return\n        }\n        navigationItem.leftBarButtonItem = symbolBarButtonItemFactory.make(\n            symbolName: \"chevron.left\",\n            primaryAction: .action(\n                UIAction { [weak self] _ in\n                    self?.viewModel.didTapBackButton()\n                }\n            )\n        )\n    }\n\n    private func setUpViews() {\n        view.backgroundColor = .adaptiveBlackWhite\n        view.addGestureRecognizer(swipeBackGesture)\n\n        #if !targetEnvironment(macCatalyst)\n        toolPicker.addObserver(canvasView)\n        toolPicker.setVisible(true, forFirstResponder: canvasView)\n        #endif\n    }\n\n    @objc\n    private func handleSwipeBack(_ gesture: UIScreenEdgePanGestureRecognizer) {\n        guard gesture.state == .ended else {\n            return\n        }\n        viewModel.didTapBackButton()\n    }\n\n    private func layoutCanvasContent() {\n        guard drawingWidth > 0 else {\n            return\n        }\n\n        let scale = canvasView.bounds.width / drawingWidth\n        canvasView.minimumZoomScale = scale\n        canvasView.zoomScale = scale\n\n        let drawingMaxY =\n            if canvasView.drawing.bounds.isNull {\n                CGFloat.zero\n            } else {\n                canvasView.drawing.bounds.maxY + Constants.CanvasView.bottomFreespace\n            }\n\n        canvasView.contentSize = CGSize(\n            width: canvasView.bounds.width,\n            height: max(canvasView.bounds.height, drawingMaxY * scale)\n        )\n    }\n\n    private func setUpCanvasView() {\n        view.addSubview(canvasView)\n        NSLayoutConstraint.activate([\n            canvasView.topAnchor.constraint(equalTo: view.topAnchor),\n            canvasView.leadingAnchor.constraint(equalTo: view.leadingAnchor),\n            canvasView.trailingAnchor.constraint(equalTo: view.trailingAnchor),\n            canvasView.bottomAnchor.constraint(equalTo: view.bottomAnchor),\n        ])\n    }\n\n    private func handleEditing(isEditing: Bool?) {\n        let rightNavigationBarButtonItems = makeRightNavigationBarButtonItems(isEditing: isEditing)\n\n        if let isEditing, isEditing {\n            canvasView.becomeFirstResponder()\n            swipeBackGesture.isEnabled = false\n\n            if #available(iOS 18.0, *) {\n                canvasView.isDrawingEnabled = true\n            } else {\n                canvasView.isUserInteractionEnabled = true\n            }\n        } else {\n            canvasView.resignFirstResponder()\n            swipeBackGesture.isEnabled = true\n\n            if #available(iOS 18.0, *) {\n                canvasView.isDrawingEnabled = false\n            } else {\n                canvasView.isUserInteractionEnabled = false\n            }\n        }\n\n        // There's a bug in the stack layouting of ``UINavigationItem`` which, if placing a single item,\n        // causes this single item to stretch across the entire navigation bar.\n        if let firstNavigationBarItem = rightNavigationBarButtonItems.first, rightNavigationBarButtonItems.count == 1 {\n            navigationItem.setRightBarButton(firstNavigationBarItem, animated: false)\n        } else {\n            navigationItem.setRightBarButtonItems(rightNavigationBarButtonItems, animated: false)\n        }\n    }\n\n    private func makeRightNavigationBarButtonItems(isEditing: Bool?) -> [UIBarButtonItem] {\n        var barButtonItems = [UIBarButtonItem]()\n\n        weak var moreBarButtonItemRef: UIBarButtonItem?\n\n        let moreBarButtonItem = symbolBarButtonItemFactory.make(\n            symbolName: \"ellipsis\",\n            primaryAction: .menu(\n                .make(\n                    jotMenuConfigurations: viewModel.menuConfigurations.make(popoverAnchorProvider: {\n                        guard let barButtonItem = moreBarButtonItemRef else {\n                            return nil\n                        }\n                        return { $0.barButtonItem = barButtonItem }\n                    })\n                )\n            )\n        )\n        moreBarButtonItemRef = moreBarButtonItem\n        barButtonItems.append(moreBarButtonItem)\n\n        if let isEditing {\n            barButtonItems.append(\n                symbolBarButtonItemFactory\n                    .make(\n                        symbolName: isEditing ? \"pencil.tip.crop.circle.fill\" : \"pencil.tip.crop.circle\",\n                        primaryAction: .action(\n                            UIAction { [weak self] _ in\n                                self?.viewModel.didTapToggleEditingButton(isEditing: isEditing)\n                            }\n                        )\n                    )\n            )\n        }\n\n        return barButtonItems\n    }\n}\n\nextension EditJotViewController: PKCanvasViewDelegate {\n\n    func canvasViewDrawingDidChange(_ canvasView: PKCanvasView) {\n        viewModel.didChangeDrawing(canvasView.drawing)\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol EditJotViewControllerFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        coordinator: EditJotCoordinatorProtocol\n    ) -> UIViewController\n}\n\nstruct EditJotViewControllerFactory: EditJotViewControllerFactoryProtocol {\n\n    let repository: EditJotRepositoryProtocol\n    let menuConfigurationFactory: JotMenuConfigurationFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n    let logger: LoggerProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        coordinator: EditJotCoordinatorProtocol,\n    ) -> UIViewController {\n        EditJotViewController(\n            viewModel: EditJotViewModel(\n                jotFileInfo: jotFileInfo,\n                repository: repository,\n                coordinator: coordinator,\n                menuConfigurationFactory: menuConfigurationFactory,\n                logger: logger\n            ),\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/EditJotPage/EditJotViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\n\n@MainActor\nfinal class EditJotViewModel: Sendable {\n\n    struct Drawing: Sendable {\n        let value: PKDrawing\n        let width: CGFloat\n    }\n\n    private(set) lazy var menuConfigurations = menuConfigurationFactory.make(\n        onShare: { [weak self] format, configurePopoverAnchor in\n            Task { @MainActor [weak self] in\n                guard let self else {\n                    return\n                }\n                self.coordinator?.showShareJot(\n                    jotFileInfo: self.jotFileInfo,\n                    format: format,\n                    configurePopoverAnchor: configurePopoverAnchor\n                )\n            }\n        },\n        onRename: { [weak self] in\n            Task { @MainActor [weak self] in\n                guard let self else {\n                    return\n                }\n                self.coordinator?.showRenameAlert(jotFileInfo: self.jotFileInfo)\n            }\n        },\n        onDuplicate: { [weak self] in\n            Task { @MainActor [weak self] in\n                guard let self else {\n                    return\n                }\n                self.didTapDuplicateJot(jotFileInfo: self.jotFileInfo)\n            }\n        },\n        onDelete: { [weak self] in\n            Task { @MainActor [weak self] in\n                guard let self else {\n                    return\n                }\n                self.coordinator?.openDeleteJot(jotFileInfo: self.jotFileInfo)\n            }\n        },\n        onShowInFiles: { [weak self] in\n            Task { @MainActor [weak self] in\n                guard let self else {\n                    return\n                }\n                self.coordinator?.showInFiles(jotFileInfo: self.jotFileInfo)\n            }\n        }\n    )\n\n    var title: String {\n        jotFileInfo.name\n    }\n\n    let drawing: AsyncStream<Drawing>\n    private let drawingContinuation: AsyncStream<Drawing>.Continuation\n\n    let isEditing: AsyncStream<Bool?>\n    private let isEditingContinuation: AsyncStream<Bool?>.Continuation\n\n    let showsBackButton: AsyncStream<Bool>\n    private let showsBackButtonContinuation: AsyncStream<Bool>.Continuation\n\n    private var drawingUpdateTask: Task<Void, Never>?\n    private let drawingUpdateContinuation: AsyncStream<PKDrawing>.Continuation\n\n    private var loadingTask: Task<Void, Never>?\n\n    private let jotFileInfo: JotFile.Info\n    private let repository: EditJotRepositoryProtocol\n    private weak var coordinator: EditJotCoordinatorProtocol?\n    private let menuConfigurationFactory: JotMenuConfigurationFactory\n    private let logger: LoggerProtocol\n\n    init(\n        jotFileInfo: JotFile.Info,\n        repository: EditJotRepositoryProtocol,\n        coordinator: EditJotCoordinatorProtocol,\n        menuConfigurationFactory: JotMenuConfigurationFactory,\n        logger: LoggerProtocol\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.coordinator = coordinator\n        self.repository = repository\n        self.menuConfigurationFactory = menuConfigurationFactory\n        self.logger = logger\n        (isEditing, isEditingContinuation) = AsyncStream.makeStream(\n            of: Bool?.self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        (drawing, drawingContinuation) = AsyncStream.makeStream(\n            of: Drawing.self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        (showsBackButton, showsBackButtonContinuation) = AsyncStream.makeStream(\n            of: Bool.self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n\n        #if targetEnvironment(macCatalyst)\n        isEditingContinuation.yield(nil)\n        #else\n        isEditingContinuation.yield(false)\n        #endif\n\n        let (drawingUpdate, drawingUpdateContinuation) = AsyncStream.makeStream(\n            of: PKDrawing.self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        self.drawingUpdateContinuation = drawingUpdateContinuation\n\n        drawingUpdateTask = Task { [logger] in\n            for await drawing in drawingUpdate.dropFirst().debounce(for: 0.3) {\n                do {\n                    try await repository.writeDrawing(jotFileInfo: jotFileInfo, drawing: drawing)\n                } catch {\n                    logger.error(\"Failed to write drawing: \\(error)\")\n                }\n            }\n        }\n    }\n\n    func didLoad() {\n        showsBackButtonContinuation.yield(coordinator?.canGoBack() ?? false)\n\n        if let jotFileVersions = repository.getConflictingVersions(jotFileInfo: jotFileInfo) {\n            coordinator?.showJotConflictPage(\n                jotFileInfo: jotFileInfo,\n                jotFileVersions: jotFileVersions\n            ) { [weak self] result in\n                Task { @MainActor in\n                    switch result {\n                    case .keepAll:\n                        self?.coordinator?.goBack()\n                    case let .keep(jotFileInfo):\n                        self?.coordinator?.openJot(jotFileInfo: jotFileInfo)\n                    }\n                }\n            }\n        } else {\n            loadingTask = Task { [weak self] in\n                guard let self else {\n                    return\n                }\n                do {\n                    let (drawing, width) = try await repository.readDrawing(jotFileInfo: jotFileInfo)\n                    drawingContinuation.yield(Drawing(value: drawing, width: width))\n                } catch {\n                    logger.error(\"Failed to read drawing: \\(error)\")\n                }\n            }\n        }\n    }\n\n    func didTapToggleEditingButton(isEditing: Bool) {\n        isEditingContinuation.yield(!isEditing)\n    }\n\n    func didChangeDrawing(_ drawing: PKDrawing) {\n        drawingUpdateContinuation.yield(drawing)\n    }\n\n    func didTapBackButton() {\n        if let jotFileVersions = repository.getConflictingVersions(jotFileInfo: jotFileInfo) {\n            coordinator?.showJotConflictPage(\n                jotFileInfo: jotFileInfo,\n                jotFileVersions: jotFileVersions\n            ) { [weak self] _ in\n                Task { @MainActor in\n                    self?.coordinator?.goBack()\n                }\n            }\n        } else {\n            coordinator?.goBack()\n        }\n    }\n\n    private func didTapDuplicateJot(jotFileInfo: JotFile.Info) {\n        do {\n            let duplicatedJotFileInfo = try repository.duplicate(jotFileInfo: jotFileInfo)\n            coordinator?.openJot(jotFileInfo: duplicatedJotFileInfo)\n        } catch {\n            coordinator?.showInfoAlert(\n                title: L10n.Jots.Duplicate.Error.generic(jotFileInfo.name),\n                message: error.localizedDescription\n            )\n        }\n    }\n\n    deinit {\n        drawingUpdateTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/EnableCloudCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol EnableCloudCoordinatorProtocol: Coordinator {\n\n    func openLearnHowToEnable()\n    func dismiss()\n}\n\nfinal class EnableCloudCoordinator: Coordinator, EnableCloudCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let navigation: Navigation\n    private let enableCloudViewControllerFactory: EnableCloudViewControllerFactoryProtocol\n\n    init(\n        navigation: Navigation,\n        enableCloudViewControllerFactory: EnableCloudViewControllerFactoryProtocol\n    ) {\n        self.navigation = navigation\n        self.enableCloudViewControllerFactory = enableCloudViewControllerFactory\n    }\n\n    func start() {\n        let navigationController = UINavigationController(\n            rootViewController: enableCloudViewControllerFactory.make(coordinator: self)\n        )\n        navigation.present(navigationController, animated: true)\n    }\n\n    func openLearnHowToEnable() {\n        navigation.openExternal(url: EnableICloudSupportURL().toURL())\n    }\n\n    func dismiss() {\n        navigation.dismiss(\n            animated: true,\n            completion: { [weak self] in\n                Task { @MainActor in\n                    self?.onEnd?()\n                }\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/EnableCloudCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol EnableCloudCoordinatorFactoryProtocol: Sendable {\n\n    func make(navigation: Navigation) -> Coordinator\n}\n\nstruct EnableCloudCoordinatorFactory: EnableCloudCoordinatorFactoryProtocol {\n\n    let enableCloudViewControllerFactory: EnableCloudViewControllerFactoryProtocol\n\n    func make(navigation: Navigation) -> Coordinator {\n        EnableCloudCoordinator(\n            navigation: navigation,\n            enableCloudViewControllerFactory: enableCloudViewControllerFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/EnableCloudViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol EnableCloudViewControllerFactoryProtocol: Sendable {\n\n    func make(coordinator: EnableCloudCoordinatorProtocol) -> UIViewController\n}\n\nstruct EnableCloudViewControllerFactory: EnableCloudViewControllerFactoryProtocol {\n\n    let textBarButtonItemFactory: TextBarButtonItemFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    func make(coordinator: EnableCloudCoordinatorProtocol) -> UIViewController {\n        PageViewController(\n            viewModel: EnableCloudViewModel(\n                coordinator: coordinator\n            ),\n            textBarButtonItemFactory: textBarButtonItemFactory,\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/EnableCloudViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nfinal class EnableCloudViewModel: PageViewModel, Sendable {\n\n    let rightNavigationItems: AsyncStream<[PageNavigationItem]>\n    private let rightNavigationItemsContinuation: AsyncStream<[PageNavigationItem]>.Continuation\n\n    let items: AsyncStream<[PageCellItem]>\n    private let itemsContinuation: AsyncStream<[PageCellItem]>.Continuation\n\n    private weak var coordinator: EnableCloudCoordinatorProtocol?\n\n    private(set) lazy var actions = [\n        PageCallToActionView.ActionConfiguration(\n            style: .primary,\n            title: L10n.EnableCloud.Action.learnHowToEnable,\n            icon: \"arrow.up.forward\"\n        ) { [weak self] in\n            self?.didTapLearnHowToEnable()\n        }\n    ]\n\n    init(coordinator: EnableCloudCoordinatorProtocol) {\n        self.coordinator = coordinator\n\n        (items, itemsContinuation) = AsyncStream.makeStream(\n            of: [PageCellItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        itemsContinuation.yield([\n            PageCellItem.pageHeader(\n                headline: L10n.EnableCloud.title,\n                subheadline: L10n.EnableCloud.subtitle\n            ),\n            PageCellItem.featureRow(\n                systemImageName: \"macbook.and.iphone\",\n                text: L10n.EnableCloud.Feature.sync\n            ),\n            PageCellItem.featureRow(\n                systemImageName: \"person.3.fill\",\n                text: L10n.EnableCloud.Feature.share\n            ),\n        ])\n\n        (rightNavigationItems, rightNavigationItemsContinuation) = AsyncStream.makeStream(\n            of: [PageNavigationItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        rightNavigationItemsContinuation.yield([\n            PageNavigationItem.symbol(\n                systemImageName: \"xmark\"\n            ) { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.dismiss()\n                }\n            }\n        ])\n    }\n\n    private func didTapCloseButton() {\n        coordinator?.dismiss()\n    }\n\n    private func didTapLearnHowToEnable() {\n        coordinator?.openLearnHowToEnable()\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/FeatureRow/FeatureRowCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class FeatureRowCell: UICollectionViewCell, PageCell {\n    static let reuseIdentifier = \"FeatureRowCell\"\n\n    private enum Constants {\n\n        enum Icon {\n            static let size = CGFloat(28)\n        }\n    }\n\n    private let iconImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.tintColor = .label\n        imageView.contentMode = .scaleAspectFit\n        return imageView\n    }()\n\n    private let textLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .body)\n        label.numberOfLines = 0\n        return label\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemGroupedBackground\n        contentView.layer.cornerRadius = DesignTokens.CornerRadius.cell\n        contentView.clipsToBounds = true\n\n        contentView.addSubview(iconImageView)\n        contentView.addSubview(textLabel)\n\n        NSLayoutConstraint.activate([\n            iconImageView.leadingAnchor.constraint(\n                equalTo: contentView.leadingAnchor,\n                constant: DesignTokens.Spacing.md\n            ),\n            iconImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n            iconImageView.widthAnchor.constraint(equalToConstant: Constants.Icon.size),\n            iconImageView.heightAnchor.constraint(equalToConstant: Constants.Icon.size),\n\n            textLabel.leadingAnchor.constraint(\n                equalTo: iconImageView.trailingAnchor,\n                constant: DesignTokens.Spacing.md\n            ),\n            textLabel.trailingAnchor.constraint(\n                equalTo: contentView.trailingAnchor,\n                constant: -DesignTokens.Spacing.md\n            ),\n            textLabel.topAnchor.constraint(\n                equalTo: contentView.topAnchor,\n                constant: DesignTokens.Spacing.md\n            ),\n            textLabel.bottomAnchor.constraint(\n                equalTo: contentView.bottomAnchor,\n                constant: -DesignTokens.Spacing.md\n            ),\n        ])\n    }\n\n    override func preferredLayoutAttributesFitting(\n        _ layoutAttributes: UICollectionViewLayoutAttributes\n    ) -> UICollectionViewLayoutAttributes {\n        let attributes = super.preferredLayoutAttributesFitting(layoutAttributes)\n        let size = contentView.systemLayoutSizeFitting(\n            CGSize(width: attributes.frame.width, height: UIView.layoutFittingCompressedSize.height),\n            withHorizontalFittingPriority: .required,\n            verticalFittingPriority: .fittingSizeLevel\n        )\n        attributes.frame.size.height = size.height\n        return attributes\n    }\n\n    func configure(viewModel: FeatureRowCellViewModel) {\n        iconImageView.image = UIImage(systemName: viewModel.systemImageName)\n        textLabel.text = viewModel.text\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/FeatureRow/FeatureRowCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class FeatureRowCellViewModel: PageCellViewModel {\n    let systemImageName: String\n    let text: String\n\n    init(\n        systemImageName: String,\n        text: String\n    ) {\n        self.systemImageName = systemImageName\n        self.text = text\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/EnableCloudPage/FeatureRow/PageCellItem+featureRow.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func featureRow(\n        systemImageName: String,\n        text: String\n    ) -> PageCellItem {\n        PageCellItem(\n            id: systemImageName + text,\n            cellType: FeatureRowCell.self,\n            sizing: .fullWidth(estimatedHeight: 44),\n            viewModel: FeatureRowCellViewModel(\n                systemImageName: systemImageName,\n                text: text\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/FileConflictService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nprotocol FileConflictServiceProtocol: Sendable {\n\n    func getConflictingVersions(fileURL: URL) -> [NSFileVersion]?\n\n    func resolveVersionConflicts(\n        fileURL: URL,\n        resolvedVersions: [URL]\n    ) throws\n\n    func copyVersionToTemporary(\n        fileURL: URL,\n        versionURL: URL\n    ) throws -> URL?\n}\n\nstruct FileConflictService: FileConflictServiceProtocol {\n\n    enum Failure: Error {\n        case couldNotCoordinateWrite\n    }\n\n    nonisolated(unsafe) private let fileManager: FileManager\n\n    init(fileManager: FileManager) {\n        self.fileManager = fileManager\n    }\n\n    func getConflictingVersions(fileURL: URL) -> [NSFileVersion]? {\n        NSFileVersion.unresolvedConflictVersionsOfItem(at: fileURL)\n    }\n\n    func resolveVersionConflicts(\n        fileURL: URL,\n        resolvedVersions: [URL]\n    ) throws {\n        guard\n            let unresolvedConflicts = getConflictingVersions(fileURL: fileURL),\n            !resolvedVersions.isEmpty\n        else {\n            return\n        }\n\n        let directory = fileURL.deletingLastPathComponent()\n        let name = fileURL.deletingPathExtension().lastPathComponent\n\n        for (index, versionURL) in resolvedVersions.dropFirst().enumerated() {\n            guard let version = unresolvedConflicts.first(where: { $0.url == versionURL }) else {\n                continue\n            }\n\n            let copyName = \"\\(name) (\\(index + 2))\"\n            let copyURL =\n                directory\n                .appendingPathComponent(copyName, isDirectory: false)\n                .appendingPathExtension(fileURL.pathExtension)\n\n            try coordinateWrite(fileURL: copyURL) { url in\n                try version.replaceItem(at: url, options: [])\n            }\n        }\n\n        try coordinateWrite(fileURL: fileURL) { url in\n            if let first = resolvedVersions.first, first != fileURL,\n                let version = unresolvedConflicts.first(where: { $0.url == first })\n            {\n                try version.replaceItem(at: url, options: [])\n            }\n\n            for conflictingVersion in unresolvedConflicts {\n                conflictingVersion.isResolved = true\n            }\n\n            try NSFileVersion.removeOtherVersionsOfItem(at: url)\n        }\n    }\n\n    func copyVersionToTemporary(\n        fileURL: URL,\n        versionURL: URL\n    ) throws -> URL? {\n        guard\n            let versions = NSFileVersion.unresolvedConflictVersionsOfItem(at: fileURL),\n            let version = versions.first(where: { $0.url == versionURL })\n        else {\n            return nil\n        }\n        let tmpURL = fileManager.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString)\n            .appendingPathExtension(fileURL.pathExtension)\n\n        try coordinateWrite(fileURL: tmpURL) { url in\n            try version.replaceItem(at: url, options: [])\n        }\n\n        return tmpURL\n    }\n\n    private func coordinateWrite(\n        fileURL: URL,\n        accessor: (URL) throws -> Void\n    ) throws {\n        let coordinator = NSFileCoordinator()\n        var coordinatorError: NSError?\n        var result: Result<Void, Error>?\n\n        coordinator.coordinate(\n            writingItemAt: fileURL,\n            options: .forReplacing,\n            error: &coordinatorError\n        ) { url in\n            result = Result(catching: {\n                try accessor(url)\n            })\n        }\n\n        if let coordinatorError {\n            throw coordinatorError\n        }\n\n        guard let result else {\n            throw Failure.couldNotCoordinateWrite\n        }\n\n        try result.get()\n    }\n}\n"
  },
  {
    "path": "Sources/FileService/FileServiceProtocol.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nprotocol FileServiceProtocol: Sendable {\n\n    /// Whether the ``FileService`` is available for file-system interaction.\n    func isEnabled() -> Bool\n\n    /// Materializes the documents directory so it is visible to the user.\n    func initializeDocumentsDirectory() async throws\n\n    /// Returns the path to the apps documents directory.\n    func documentsDirectory() async throws -> URL?\n\n    /// A temporary directory, suitable for loosy file persistence.\n    func temporaryDirectory() -> URL\n\n    /// Returns the contents of the given directories.\n    func listContents(\n        directory: URL,\n        properties: [URLResourceKey]\n    ) throws -> [URL]\n\n    /// The ubiquitous info of the given file path if applicable.\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo?\n\n    /// Triggers a download of the ubiquitous item at the given URL.\n    func startDownload(fileURL: URL) throws\n\n    /// A stream that fires once the contents within the specified directory changes.\n    ///\n    ///  - NOTE: Only recognizes file changes at the first level depth.\n    ///\n    func directoryChanges(directory: URL) -> AsyncStream<Void>\n\n    /// Returns the contents of a file.\n    func readFile(fileURL: URL) throws -> Data\n\n    /// Writes the contents of a file.\n    func writeFile(fileURL: URL, data: Data) throws\n\n    /// Whether the file is present on the file system.\n    func fileExists(fileURL: URL) -> Bool\n\n    /// Removes a file from the file-system.\n    func removeFile(fileURL: URL) throws\n\n    /// Moves a file from its current place to a new place.\n    func moveFile(fileURL: URL, newFileURL: URL) throws\n\n    /// Creates a copy of a file at a given destination.\n    func duplicateFile(fileURL: URL) throws -> URL\n}\n"
  },
  {
    "path": "Sources/FileService/LocalFileService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nstruct LocalFileService: FileServiceProtocol {\n\n    enum Failure: Error {\n        case couldNotReadFileContents\n        case couldNotWriteFileContents\n    }\n\n    nonisolated(unsafe) private let fileManager: FileManager\n\n    init(fileManager: FileManager) {\n        self.fileManager = fileManager\n    }\n\n    func isEnabled() -> Bool {\n        true\n    }\n\n    func initializeDocumentsDirectory() async throws {\n        guard let directory = try await documentsDirectory() else {\n            return\n        }\n\n        let placeholder = directory.appendingPathComponent(\".jottre\", isDirectory: false)\n        guard !fileExists(fileURL: placeholder) else {\n            return\n        }\n\n        try writeFile(fileURL: placeholder, data: Data(\"Hello, World!\".utf8))\n    }\n\n    func documentsDirectory() async throws -> URL? {\n        guard let directory = fileManager.urls(for: .documentDirectory, in: .userDomainMask).first else {\n            return nil\n        }\n\n        var isDirectory = ObjCBool(true)\n        if !fileManager.fileExists(atPath: directory.path, isDirectory: &isDirectory) {\n            try fileManager.createDirectory(at: directory, withIntermediateDirectories: true)\n        }\n        return directory\n    }\n\n    func temporaryDirectory() -> URL {\n        fileManager.temporaryDirectory\n    }\n\n    func listContents(\n        directory: URL,\n        properties: [URLResourceKey]\n    ) throws -> [URL] {\n        try fileManager.contentsOfDirectory(\n            at: directory,\n            includingPropertiesForKeys: properties\n        )\n    }\n\n    func startDownload(fileURL: URL) throws {\n        assertionFailure(\"Shouldn't have called \\(#function) in \\(Self.self)\")\n    }\n\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo? {\n        assertionFailure(\"Shouldn't have called \\(#function) in \\(Self.self)\")\n        return nil\n    }\n\n    func directoryChanges(directory: URL) -> AsyncStream<Void> {\n        AsyncStream { continuation in\n            continuation.yield()\n\n            let fd = open(directory.path, O_EVTONLY)\n            guard fd >= 0 else {\n                continuation.finish()\n                return\n            }\n\n            let source = DispatchSource.makeFileSystemObjectSource(\n                fileDescriptor: fd,\n                eventMask: [.write, .rename, .delete, .extend],\n                queue: .global()\n            )\n\n            source.setEventHandler {\n                continuation.yield()\n            }\n\n            source.setCancelHandler {\n                close(fd)\n            }\n\n            continuation.onTermination = { _ in\n                source.cancel()\n            }\n\n            source.resume()\n        }\n    }\n\n    func readFile(fileURL: URL) throws -> Data {\n        let coordinator = NSFileCoordinator()\n        var error: NSError?\n        var result: Result<Data, Error>?\n\n        coordinator.coordinate(\n            readingItemAt: fileURL,\n            options: [],\n            error: &error\n        ) { url in\n            result = Result(catching: {\n                try Data(contentsOf: url)\n            })\n        }\n\n        if let error {\n            throw error\n        }\n\n        guard let result else {\n            throw Failure.couldNotReadFileContents\n        }\n\n        return try result.get()\n    }\n\n    func writeFile(fileURL: URL, data: Data) throws {\n        let coordinator = NSFileCoordinator()\n        var error: NSError?\n        var result: Result<Void, Error>?\n\n        coordinator.coordinate(\n            writingItemAt: fileURL,\n            options: .forReplacing,\n            error: &error\n        ) { url in\n            result = Result(catching: {\n                try data.write(to: url, options: .atomic)\n            })\n        }\n\n        if let error {\n            throw error\n        }\n\n        guard let result else {\n            throw Failure.couldNotWriteFileContents\n        }\n\n        try result.get()\n    }\n\n    func fileExists(fileURL: URL) -> Bool {\n        var isDirectory = ObjCBool(false)\n        return fileManager.fileExists(atPath: fileURL.path, isDirectory: &isDirectory)\n    }\n\n    func removeFile(fileURL: URL) throws {\n        try fileManager.removeItem(at: fileURL)\n    }\n\n    func moveFile(fileURL: URL, newFileURL: URL) throws {\n        try fileManager.moveItem(at: fileURL, to: newFileURL)\n    }\n\n    func duplicateFile(fileURL: URL) throws -> URL {\n        var duplicateCount = 0\n        let fileName = fileURL.deletingPathExtension().lastPathComponent\n\n        while true {\n            let destinationFileName =\n                if duplicateCount == 0 {\n                    L10n.FileSystem.Duplicate.FileName.plain(fileName)\n                } else {\n                    L10n.FileSystem.Duplicate.FileName.multi(fileName, duplicateCount)\n                }\n            duplicateCount += 1\n\n            let destinationFileURL =\n                fileURL\n                .deletingPathExtension()\n                .deletingLastPathComponent()\n                .appendingPathComponent(destinationFileName)\n                .appendingPathExtension(fileURL.pathExtension)\n\n            do {\n                try fileManager.copyItem(at: fileURL, to: destinationFileURL)\n                return destinationFileURL\n            } catch CocoaError.fileWriteFileExists {\n                continue\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/FileService/UbiquitousFileService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nstruct UbiquitousFileService: FileServiceProtocol {\n\n    nonisolated(unsafe) private let fileManager: FileManager\n    private let localFileService: FileServiceProtocol\n\n    init(\n        fileManager: FileManager,\n        localFileService: FileServiceProtocol\n    ) {\n        self.fileManager = fileManager\n        self.localFileService = localFileService\n    }\n\n    func isEnabled() -> Bool {\n        fileManager.ubiquityIdentityToken != nil\n    }\n\n    func initializeDocumentsDirectory() async throws {\n        guard\n            isEnabled(),\n            let directory = try await documentsDirectory()\n        else {\n            return\n        }\n\n        let placeholder = directory.appendingPathComponent(\".jottre\", isDirectory: false)\n        guard !fileExists(fileURL: placeholder) else {\n            return\n        }\n\n        try writeFile(fileURL: placeholder, data: Data())\n    }\n\n    func documentsDirectory() async throws -> URL? {\n        guard\n            let directory = fileManager.url(forUbiquityContainerIdentifier: nil)?.appendingPathComponent(\"Documents\")\n        else {\n            return nil\n        }\n\n        var isDirectory = ObjCBool(true)\n        if !fileManager.fileExists(atPath: directory.path, isDirectory: &isDirectory) {\n            try fileManager.createDirectory(at: directory, withIntermediateDirectories: true)\n        }\n        return directory\n    }\n\n    func temporaryDirectory() -> URL {\n        localFileService.temporaryDirectory()\n    }\n\n    func listContents(\n        directory: URL,\n        properties: [URLResourceKey]\n    ) throws -> [URL] {\n        try localFileService.listContents(\n            directory: directory,\n            properties: properties\n        )\n    }\n\n    func startDownload(fileURL: URL) throws {\n        try fileManager.startDownloadingUbiquitousItem(at: fileURL)\n    }\n\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo? {\n        guard fileManager.isUbiquitousItem(at: url) else {\n            return nil\n        }\n\n        let resourceValues = try? url.resourceValues(\n            forKeys: [.ubiquitousItemDownloadingStatusKey, .ubiquitousItemIsDownloadingKey]\n        )\n\n        let downloadStatus: UbiquitousInfo.DownloadStatus? =\n            switch resourceValues?.ubiquitousItemDownloadingStatus {\n            case .current:\n                UbiquitousInfo.DownloadStatus.current\n            case .downloaded:\n                UbiquitousInfo.DownloadStatus.downloaded\n            case .notDownloaded:\n                UbiquitousInfo.DownloadStatus.notDownloaded\n            default:\n                nil\n            }\n\n        return UbiquitousInfo(\n            downloadStatus: downloadStatus,\n            isDownloading: resourceValues?.ubiquitousItemIsDownloading ?? false\n        )\n    }\n\n    func directoryChanges(directory: URL) -> AsyncStream<Void> {\n        assert(\n            fileManager.isUbiquitousItem(at: directory),\n            \"Cannot listen to directory changes of a non ubiquitous directory.\"\n        )\n        return AsyncStream { continuation in\n            continuation.yield()\n            let observer = UbiquitousDirectoryObserver {\n                continuation.yield()\n            }\n            continuation.onTermination = { _ in\n                observer.stop()\n            }\n        }\n    }\n\n    func readFile(fileURL: URL) throws -> Data {\n        try localFileService.readFile(fileURL: fileURL)\n    }\n\n    func writeFile(\n        fileURL: URL,\n        data: Data\n    ) throws {\n        try localFileService.writeFile(\n            fileURL: fileURL,\n            data: data\n        )\n    }\n\n    func fileExists(fileURL: URL) -> Bool {\n        localFileService.fileExists(fileURL: fileURL)\n    }\n\n    func removeFile(fileURL: URL) throws {\n        try localFileService.removeFile(fileURL: fileURL)\n    }\n\n    func moveFile(fileURL: URL, newFileURL: URL) throws {\n        try localFileService.moveFile(\n            fileURL: fileURL,\n            newFileURL: newFileURL\n        )\n    }\n\n    func duplicateFile(fileURL: URL) throws -> URL {\n        try localFileService.duplicateFile(fileURL: fileURL)\n    }\n}\n\nprivate final class UbiquitousDirectoryObserver: @unchecked Sendable {\n\n    private let queue: OperationQueue = {\n        let queue = OperationQueue()\n        queue.maxConcurrentOperationCount = 1\n        return queue\n    }()\n\n    private let query = NSMetadataQuery()\n    private var observers = [Any]()\n\n    init(onUpdate: @Sendable @escaping () -> Void) {\n        query.searchScopes = [NSMetadataQueryUbiquitousDocumentsScope]\n        query.predicate = NSPredicate(format: \"%K LIKE '*.\\(JotFile.Info.fileExtension)'\", NSMetadataItemFSNameKey)\n        query.operationQueue = queue\n\n        for name: NSNotification.Name in [.NSMetadataQueryDidFinishGathering, .NSMetadataQueryDidUpdate] {\n            observers.append(\n                NotificationCenter.default.addObserver(forName: name, object: query, queue: queue) { _ in\n                    onUpdate()\n                }\n            )\n        }\n\n        queue.addOperation { [self] in\n            query.start()\n        }\n    }\n\n    func stop() {\n        queue.addOperation { [self] in\n            query.stop()\n\n            for observer in observers {\n                NotificationCenter.default.removeObserver(observer)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/FileService/UbiquitousInfo.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct UbiquitousInfo: Sendable, Hashable {\n    enum DownloadStatus: Sendable, Hashable {\n        case downloaded\n        case current\n        case notDownloaded\n    }\n\n    let downloadStatus: DownloadStatus?\n    let isDownloading: Bool\n}\n"
  },
  {
    "path": "Sources/InfoAlertCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class InfoAlertCoordinator: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private let navigation: Navigation\n    private let title: String\n    private let message: String?\n\n    init(\n        navigation: Navigation,\n        title: String,\n        message: String?\n    ) {\n        self.navigation = navigation\n        self.title = title\n        self.message = message\n    }\n\n    func start() {\n        let alertController = UIAlertController(\n            title: title,\n            message: message,\n            preferredStyle: .alert\n        )\n\n        let okAction = UIAlertAction(\n            title: L10n.Action.ok,\n            style: .cancel,\n            handler: { [weak self] _ in\n                self?.onEnd?()\n            }\n        )\n        alertController.addAction(okAction)\n        navigation.present(alertController, animated: true)\n    }\n}\n"
  },
  {
    "path": "Sources/Jot/Jot.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n@preconcurrency import PencilKit\n\nstruct Jot: Codable, Sendable {\n\n    static func makeEmpty() -> Jot {\n        Jot(\n            version: 3,\n            drawing: PKDrawing().dataRepresentation(),\n            width: 1200\n        )\n    }\n\n    var version = Int(3)\n    let drawing: Data\n    let width: CGFloat\n    // NOTE: Kept for backwards compatibility.\n    var lastModified: Double? = Double.zero\n}\n"
  },
  {
    "path": "Sources/Jot/JotFile.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nstruct JotFile: Sendable {\n\n    struct Info: Sendable, Hashable {\n        static let fileExtension = \"jot\"\n\n        let url: URL\n        let name: String\n        let modificationDate: Date?\n        let ubiquitousInfo: UbiquitousInfo?\n\n        init(\n            url: URL,\n            name: String,\n            modificationDate: Date?,\n            ubiquitousInfo: UbiquitousInfo?\n        ) {\n            self.url = url\n            self.name = name\n            self.modificationDate = modificationDate\n            self.ubiquitousInfo = ubiquitousInfo\n        }\n\n        init?(\n            url: URL,\n            modificationDate: Date?,\n            ubiquitousInfo: UbiquitousInfo?\n        ) {\n            guard url.pathExtension == Info.fileExtension else {\n                return nil\n            }\n            self.init(\n                url: url,\n                name: url.deletingPathExtension().lastPathComponent,\n                modificationDate: modificationDate,\n                ubiquitousInfo: ubiquitousInfo\n            )\n        }\n    }\n\n    let info: Info\n    let jot: Jot\n}\n"
  },
  {
    "path": "Sources/Jot/JotFileService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nprotocol JotFileServiceProtocol: Sendable {\n    func documentsDirectoryContents() -> AsyncThrowingStream<[JotFile.Info], Error>\n\n    func readJotFile(jotFileInfo: JotFile.Info) throws -> JotFile\n\n    func write(jotFile: JotFile) throws\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info\n\n    func rename(jotFileInfo: JotFile.Info, newName: String) throws -> JotFile.Info\n\n    func remove(jotFileInfo: JotFile.Info) throws\n\n    func move(\n        jotFileInfo: JotFile.Info,\n        shouldBecomeUbiquitous: Bool\n    ) async throws\n}\n\nstruct JotFileService: JotFileServiceProtocol {\n\n    private enum Constants {\n\n        static func fileProperties(isUbiquitous: Bool) -> [URLResourceKey] {\n            var fileProperties: [URLResourceKey] = [\n                .contentModificationDateKey,\n                .isWritableKey,\n                .isReadableKey,\n                .isRegularFileKey,\n            ]\n\n            if isUbiquitous {\n                fileProperties.append(.ubiquitousItemDownloadingStatusKey)\n                fileProperties.append(.ubiquitousItemIsDownloadingKey)\n            }\n\n            return fileProperties\n        }\n    }\n\n    enum Failure: Error {\n        case couldNotResolveDocumentsDirectory\n    }\n\n    private let propertyListDecoder = PropertyListDecoder()\n    private let propertyListEncoder = PropertyListEncoder()\n\n    private let localFileService: FileServiceProtocol\n    private let ubiquitousFileService: FileServiceProtocol\n\n    init(\n        localFileService: FileServiceProtocol,\n        ubiquitousFileService: FileServiceProtocol\n    ) {\n        self.localFileService = localFileService\n        self.ubiquitousFileService = ubiquitousFileService\n    }\n\n    func documentsDirectoryContents() -> AsyncThrowingStream<[JotFile.Info], Error> {\n        AsyncThrowingStream { continuation in\n            let task = Task {\n                do {\n                    let ubiquitousDocumentsDirectory = try await ubiquitousFileService.documentsDirectory()\n                    let localDocumentsDirectory = try await localFileService.documentsDirectory()\n\n                    let documentsDirectories: [(isUbiquitous: Bool, directory: URL)] = [\n                        (isUbiquitous: true, directory: ubiquitousDocumentsDirectory),\n                        (isUbiquitous: false, directory: localDocumentsDirectory),\n                    ]\n                    .compactMap { isUbiquitous, directory in\n                        guard let directory else {\n                            return nil\n                        }\n                        return (isUbiquitous: isUbiquitous, directory: directory)\n                    }\n\n                    try await withThrowingTaskGroup(of: Void.self) { group in\n                        for (isUbiquitous, documentsDirectory) in documentsDirectories {\n                            let fileService =\n                                if isUbiquitous {\n                                    ubiquitousFileService\n                                } else {\n                                    localFileService\n                                }\n\n                            group.addTask {\n                                for try await _ in fileService.directoryChanges(directory: documentsDirectory) {\n                                    try continuation.yield(\n                                        documentsDirectories\n                                            .flatMap { (isUbiquitous: Bool, directory: URL) in\n                                                try listContents(\n                                                    directory: directory,\n                                                    isUbiquitous: isUbiquitous\n                                                )\n                                            }\n                                    )\n                                }\n                            }\n                        }\n                        try await group.waitForAll()\n                    }\n                } catch {\n                    continuation.finish(throwing: error)\n                }\n                continuation.finish()\n            }\n            continuation.onTermination = { _ in task.cancel() }\n        }\n    }\n\n    private func listContents(\n        directory: URL,\n        isUbiquitous: Bool\n    ) throws -> [JotFile.Info] {\n        let fileService =\n            if isUbiquitous {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        let contents = try fileService.listContents(\n            directory: directory,\n            properties: Constants.fileProperties(isUbiquitous: isUbiquitous)\n        )\n\n        return\n            try contents\n            .map { content in\n                try (\n                    content: content,\n                    properties:\n                        content\n                        .resourceValues(forKeys: Set(Constants.fileProperties(isUbiquitous: isUbiquitous)))\n                )\n            }\n            .filter { (fileURL: URL, properties: URLResourceValues) in\n                properties.isRegularFile == true\n                    && properties.isReadable == true\n                    && properties.isWritable == true\n                    && fileURL.pathExtension == JotFile.Info.fileExtension\n            }\n            .map { (fileURL: URL, properties: URLResourceValues) in\n                lazy var downloadStatus: UbiquitousInfo.DownloadStatus? =\n                    switch properties.ubiquitousItemDownloadingStatus {\n                    case .current:\n                        UbiquitousInfo.DownloadStatus.current\n                    case .downloaded:\n                        UbiquitousInfo.DownloadStatus.downloaded\n                    case .notDownloaded:\n                        UbiquitousInfo.DownloadStatus.notDownloaded\n                    default:\n                        nil\n                    }\n\n                let ubiqitousInfo =\n                    isUbiquitous\n                    ? UbiquitousInfo(\n                        downloadStatus: downloadStatus,\n                        isDownloading: properties.ubiquitousItemIsDownloading ?? false\n                    )\n                    : nil\n\n                return JotFile.Info(\n                    url: fileURL,\n                    name: fileURL.deletingPathExtension().lastPathComponent,\n                    modificationDate: properties.contentModificationDate,\n                    ubiquitousInfo: ubiqitousInfo\n                )\n            }\n    }\n\n    func readJotFile(jotFileInfo: JotFile.Info) throws -> JotFile {\n        let fileService =\n            if jotFileInfo.ubiquitousInfo != nil {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        let data = try fileService.readFile(fileURL: jotFileInfo.url)\n        let jot = try propertyListDecoder.decode(Jot.self, from: data)\n\n        return JotFile(\n            info: jotFileInfo,\n            jot: jot\n        )\n    }\n\n    func write(jotFile: JotFile) throws {\n        let fileService =\n            if jotFile.info.ubiquitousInfo != nil {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        let data = try propertyListEncoder.encode(jotFile.jot)\n\n        try fileService.writeFile(\n            fileURL: jotFile.info.url,\n            data: data\n        )\n    }\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        let fileService =\n            if jotFileInfo.ubiquitousInfo != nil {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n        let duplicatedFileURL = try fileService.duplicateFile(fileURL: jotFileInfo.url)\n\n        return JotFile.Info(\n            url: duplicatedFileURL,\n            name: duplicatedFileURL.deletingPathExtension().lastPathComponent,\n            modificationDate: jotFileInfo.modificationDate,\n            ubiquitousInfo: jotFileInfo.ubiquitousInfo\n        )\n    }\n\n    func rename(\n        jotFileInfo: JotFile.Info,\n        newName: String\n    ) throws -> JotFile.Info {\n        let newFileURL = jotFileInfo.url\n            .deletingPathExtension()\n            .deletingLastPathComponent()\n            .appendingPathComponent(newName)\n            .appendingPathExtension(jotFileInfo.url.pathExtension)\n\n        let fileService =\n            if jotFileInfo.ubiquitousInfo != nil {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        try fileService.moveFile(\n            fileURL: jotFileInfo.url,\n            newFileURL: newFileURL\n        )\n\n        return JotFile.Info(\n            url: newFileURL,\n            name: newName,\n            modificationDate: jotFileInfo.modificationDate,\n            ubiquitousInfo: jotFileInfo.ubiquitousInfo\n        )\n    }\n\n    func remove(jotFileInfo: JotFile.Info) throws {\n        let fileService =\n            if jotFileInfo.ubiquitousInfo != nil {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        try fileService.removeFile(fileURL: jotFileInfo.url)\n    }\n\n    func move(\n        jotFileInfo: JotFile.Info,\n        shouldBecomeUbiquitous: Bool\n    ) async throws {\n        let fileService =\n            if shouldBecomeUbiquitous {\n                ubiquitousFileService\n            } else {\n                localFileService\n            }\n\n        guard let documentsDirectory = try await fileService.documentsDirectory() else {\n            throw Failure.couldNotResolveDocumentsDirectory\n        }\n\n        try fileService.moveFile(\n            fileURL: jotFileInfo.url,\n            newFileURL: documentsDirectory.appendingPathComponent(jotFileInfo.url.lastPathComponent, isDirectory: false)\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/Jot/JotFileVersion.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct JotFileVersion: Sendable, Hashable {\n    let localizedNameOfSavingComputer: String?\n    let info: JotFile.Info\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCell/JotConflictBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nstruct JotConflictBusinessModel: Sendable, Hashable {\n\n    let name: String\n    let lastEditedDateString: String\n    let jotFileInfo: JotFile.Info\n\n    private let jotFileVersion: JotFileVersion\n\n    init(\n        name: String,\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion\n    ) {\n        self.name = name\n        lastEditedDateString = jotFileVersion.localizedNameOfSavingComputer ?? \"n/a\"\n        self.jotFileInfo = jotFileInfo\n        self.jotFileVersion = jotFileVersion\n    }\n\n    func toJotFileVersion() -> JotFileVersion {\n        jotFileVersion\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCell/JotConflictCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class JotConflictCell: UICollectionViewCell, PageCell {\n    static let reuseIdentifier = \"JotConflictCell\"\n\n    private let previewImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.contentMode = .scaleAspectFit\n        imageView.clipsToBounds = true\n        return imageView\n    }()\n\n    private let separatorLine: UIView = {\n        let view = UIView()\n        view.translatesAutoresizingMaskIntoConstraints = false\n        view.backgroundColor = UIColor.separator\n        return view\n    }()\n\n    private let nameLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .body, weight: .semibold)\n        return label\n    }()\n\n    private let infoLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .caption1, weight: .semibold)\n        label.textColor = .secondaryLabel\n        return label\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {\n        super.traitCollectionDidChange(previousTraitCollection)\n\n        if traitCollection.hasRenderingChange(comparedTo: previousTraitCollection) {\n            loadPreviewImage()\n        }\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemGroupedBackground\n        contentView.layer.cornerRadius = DesignTokens.CornerRadius.cell\n        contentView.clipsToBounds = true\n        contentView.layoutMargins = UIEdgeInsets(\n            top: DesignTokens.Spacing.xs,\n            left: DesignTokens.Spacing.xs,\n            bottom: DesignTokens.Spacing.sm,\n            right: DesignTokens.Spacing.xs\n        )\n\n        contentView.addSubview(previewImageView)\n        contentView.addSubview(separatorLine)\n        contentView.addSubview(nameLabel)\n        contentView.addSubview(infoLabel)\n\n        NSLayoutConstraint.activate(\n            [\n                previewImageView.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),\n                previewImageView.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n                previewImageView.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n                previewImageView.bottomAnchor.constraint(equalTo: separatorLine.topAnchor),\n\n                separatorLine.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),\n                separatorLine.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),\n                separatorLine.heightAnchor.constraint(equalToConstant: DesignTokens.Length.separator),\n\n                nameLabel.topAnchor.constraint(equalTo: separatorLine.bottomAnchor, constant: DesignTokens.Spacing.sm),\n                nameLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n                nameLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n\n                infoLabel.topAnchor.constraint(equalTo: nameLabel.bottomAnchor),\n                infoLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n                infoLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n                infoLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),\n            ]\n        )\n    }\n\n    private var viewModel: JotConflictCellViewModel?\n    private var previewImageTask: Task<Void, Never>?\n\n    override func prepareForReuse() {\n        super.prepareForReuse()\n        previewImageView.image = nil\n    }\n\n    func configure(\n        viewModel: JotConflictCellViewModel\n    ) {\n        self.viewModel = viewModel\n        nameLabel.text = viewModel.name\n        infoLabel.text = viewModel.infoText\n        loadPreviewImage()\n    }\n\n    private func loadPreviewImage() {\n        guard let viewModel else {\n            return\n        }\n        previewImageTask?.cancel()\n        previewImageTask = Task { [weak self] in\n            guard let self else {\n                return\n            }\n            previewImageView.image = await viewModel.getPreviewImage(\n                userInterfaceStyle: traitCollection.userInterfaceStyle,\n                displayScale: traitCollection.displayScale\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCell/JotConflictCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class JotConflictCellViewModel: PageCellViewModel {\n\n    let name: String\n    let infoText: String\n\n    private let jotConflict: JotConflictBusinessModel\n    private let repository: JotConflictRepositoryProtocol\n\n    init(\n        jotConflict: JotConflictBusinessModel,\n        repository: JotConflictRepositoryProtocol\n    ) {\n        name = jotConflict.name\n        infoText = jotConflict.lastEditedDateString\n        self.jotConflict = jotConflict\n        self.repository = repository\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n\n    func getPreviewImage(\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await repository.getPreviewImage(\n            jotFileInfo: jotConflict.jotFileInfo,\n            jotFileVersion: jotConflict.toJotFileVersion(),\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCell/PageCellItem+jotConflict.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func jotConflict(\n        jotConflict: JotConflictBusinessModel,\n        sizing: PageCellSizingStrategy,\n        repository: JotConflictRepositoryProtocol\n    ) -> PageCellItem {\n        PageCellItem(\n            id: jotConflict,\n            cellType: JotConflictCell.self,\n            sizing: sizing,\n            viewModel: JotConflictCellViewModel(\n                jotConflict: jotConflict,\n                repository: repository\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol JotConflictCoordinatorProtocol: Coordinator {\n\n    func showInfoAlert(title: String, message: String)\n    func dismiss(completion: @Sendable @escaping () -> Void)\n}\n\nfinal class JotConflictCoordinator: Coordinator, JotConflictCoordinatorProtocol {\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    var onEnd: (() -> Void)?\n\n    private let jotFileInfo: JotFile.Info\n    private let jotFileVersions: [JotFileVersion]\n    private let repository: JotConflictRepositoryProtocol\n    private let navigation: Navigation\n    private let jotConflictViewControllerFactory: JotConflictViewControllerFactoryProtocol\n    private let onResult: @Sendable (_ result: JotConflictResult) -> Void\n\n    init(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        repository: JotConflictRepositoryProtocol,\n        navigation: Navigation,\n        jotConflictViewControllerFactory: JotConflictViewControllerFactoryProtocol,\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.jotFileVersions = jotFileVersions\n        self.repository = repository\n        self.navigation = navigation\n        self.jotConflictViewControllerFactory = jotConflictViewControllerFactory\n        self.onResult = onResult\n    }\n\n    func start() {\n        let viewController = jotConflictViewControllerFactory.make(\n            viewModel: JotConflictViewModel(\n                jotFileInfo: jotFileInfo,\n                jotFileVersions: jotFileVersions,\n                repository: repository,\n                coordinator: self,\n                onResult: onResult\n            )\n        )\n        viewController.isModalInPresentation = true\n\n        let navigationController = UINavigationController(\n            rootViewController: viewController\n        )\n        navigationController.navigationBar.prefersLargeTitles = false\n        navigation.present(navigationController, animated: true)\n    }\n\n    func showInfoAlert(\n        title: String,\n        message: String\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n        }\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.start()\n    }\n\n    func dismiss(completion: @Sendable @escaping () -> Void) {\n        navigation.dismiss(animated: true) { [weak self] in\n            completion()\n            Task { @MainActor in\n                self?.onEnd?()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol JotConflictCoordinatorFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        navigation: Navigation,\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) -> Coordinator\n}\n\nstruct JotConflictCoordinatorFactory: JotConflictCoordinatorFactoryProtocol {\n\n    let jotConflictViewControllerFactory: JotConflictViewControllerFactoryProtocol\n    let repository: JotConflictRepositoryProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        navigation: Navigation,\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) -> Coordinator {\n        JotConflictCoordinator(\n            jotFileInfo: jotFileInfo,\n            jotFileVersions: jotFileVersions,\n            repository: repository,\n            navigation: navigation,\n            jotConflictViewControllerFactory: jotConflictViewControllerFactory,\n            onResult: onResult\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol JotConflictRepositoryProtocol: Sendable {\n\n    func resolveVersionConflicts(\n        jotFileInfo: JotFile.Info,\n        resolvedVersions: [JotFileVersion]\n    ) throws\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage?\n}\n\nstruct JotConflictRepository: JotConflictRepositoryProtocol {\n\n    private let jotFileConflictService: JotFileConflictServiceProtocol\n    private let jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n    private let logger: LoggerProtocol\n\n    init(\n        jotFileConflictService: JotFileConflictServiceProtocol,\n        jotFilePreviewImageService: JotFilePreviewImageServiceProtocol,\n        logger: LoggerProtocol\n    ) {\n        self.jotFileConflictService = jotFileConflictService\n        self.jotFilePreviewImageService = jotFilePreviewImageService\n        self.logger = logger\n    }\n\n    func resolveVersionConflicts(\n        jotFileInfo: JotFile.Info,\n        resolvedVersions: [JotFileVersion]\n    ) throws {\n        try jotFileConflictService.resolveVersionConflicts(\n            jotFileInfo: jotFileInfo,\n            resolvedVersions: resolvedVersions\n        )\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        do {\n            let readableVersionFileInfo: JotFile.Info\n            let tmpURL: URL?\n\n            if let tmpInfo = try jotFileConflictService.copyVersionToTemporary(\n                jotFileInfo: jotFileInfo,\n                jotFileVersion: jotFileVersion\n            ) {\n                readableVersionFileInfo = tmpInfo\n                tmpURL = tmpInfo.url\n            } else {\n                readableVersionFileInfo = jotFileInfo\n                tmpURL = nil\n            }\n\n            defer {\n                if let tmpURL {\n                    try? FileManager.default.removeItem(at: tmpURL)\n                }\n            }\n\n            let imageData = try await jotFilePreviewImageService.getPreviewImageData(\n                jotFileInfo: readableVersionFileInfo,\n                userInterfaceStyle: userInterfaceStyle,\n                displayScale: displayScale\n            )\n            return UIImage(data: imageData)\n        } catch {\n            logger.error(\"Failed to load conflict preview image: \\(error)\")\n            return nil\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictResult.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nenum JotConflictResult: Sendable {\n    case keepAll\n    case keep(JotFile.Info)\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol JotConflictViewControllerFactoryProtocol: Sendable {\n\n    func make(\n        viewModel: JotConflictViewModel\n    ) -> UIViewController\n}\n\nstruct JotConflictViewControllerFactory: JotConflictViewControllerFactoryProtocol {\n\n    let textBarButtonItemFactory: TextBarButtonItemFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    func make(\n        viewModel: JotConflictViewModel\n    ) -> UIViewController {\n        PageViewController(\n            viewModel: viewModel,\n            textBarButtonItemFactory: textBarButtonItemFactory,\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotConflictViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@MainActor\nfinal class JotConflictViewModel: PageViewModel, Sendable {\n\n    private enum Constants {\n\n        static func character(offset: Int) -> String {\n            UnicodeScalar(65 + offset)?.description ?? String()\n        }\n    }\n\n    private(set) lazy var items: AsyncStream<[PageCellItem]> = AsyncStream<[PageCellItem]>(\n        [PageCellItem].self,\n        bufferingPolicy: .bufferingNewest(1)\n    ) { continuation in\n        var pageCellItems = [\n            PageCellItem.pageHeader(\n                headline: L10n.JotConflict.title,\n                subheadline: jotFileVersions.first.map { L10n.JotConflict.subtitle($0.info.name) } ?? String()\n            )\n        ]\n        pageCellItems.append(\n            contentsOf:\n                jotFileVersions\n                .enumerated()\n                .map { offset, jotFileVersion in\n                    PageCellItem.jotConflict(\n                        jotConflict: JotConflictBusinessModel(\n                            name: L10n.JotConflict.versionName(Constants.character(offset: offset)),\n                            jotFileInfo: jotFileInfo,\n                            jotFileVersion: jotFileVersion\n                        ),\n                        sizing: .equalSplit(\n                            perRow: jotFileVersions.count,\n                            itemHeight: 200\n                        ),\n                        repository: repository\n                    )\n                }\n        )\n        continuation.yield(pageCellItems)\n        continuation.finish()\n    }\n\n    private(set) lazy var actions =\n        jotFileVersions\n        .enumerated()\n        .map { (offset, jotFileVersion) in\n            PageCallToActionView.ActionConfiguration(\n                style: .primary,\n                title: L10n.JotConflict.Action.keepVersion(Constants.character(offset: offset)),\n                icon: nil\n            ) { [weak self] in\n                self?.didTapKeepVersion(jotFileVersion: jotFileVersion)\n            }\n        } + [\n            PageCallToActionView.ActionConfiguration(\n                style: .secondary,\n                title: L10n.JotConflict.Action.keepAll,\n                icon: nil\n            ) { [weak self] in\n                self?.didTapKeepAll()\n            }\n        ]\n\n    private let jotFileInfo: JotFile.Info\n    private let jotFileVersions: [JotFileVersion]\n    private let repository: JotConflictRepositoryProtocol\n    private weak var coordinator: JotConflictCoordinatorProtocol?\n    private let onResult: @Sendable (_ result: JotConflictResult) -> Void\n\n    init(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        repository: JotConflictRepositoryProtocol,\n        coordinator: JotConflictCoordinatorProtocol,\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) {\n        assert(jotFileVersions.count >= 1, \"Resolving a version conflict between less than two files is not logical.\")\n        self.jotFileInfo = jotFileInfo\n        self.jotFileVersions =\n            [\n                JotFileVersion(\n                    localizedNameOfSavingComputer: L10n.JotConflict.deviceLabel,\n                    info: jotFileInfo\n                )\n            ] + jotFileVersions\n        self.repository = repository\n        self.coordinator = coordinator\n        self.onResult = onResult\n    }\n\n    private func didTapKeepVersion(jotFileVersion: JotFileVersion) {\n        do {\n            try repository.resolveVersionConflicts(\n                jotFileInfo: jotFileInfo,\n                resolvedVersions: [jotFileVersion]\n            )\n            coordinator?.dismiss(completion: { [weak self] in\n                guard let self else {\n                    return\n                }\n                onResult(.keep(jotFileInfo))\n            })\n        } catch {\n            coordinator?.showInfoAlert(\n                title: L10n.JotConflict.Error.generic,\n                message: error.localizedDescription\n            )\n        }\n    }\n\n    private func didTapKeepAll() {\n        do {\n            try repository.resolveVersionConflicts(\n                jotFileInfo: jotFileInfo,\n                resolvedVersions: jotFileVersions\n            )\n            coordinator?.dismiss(completion: { [weak self] in\n                self?.onResult(.keepAll)\n            })\n        } catch {\n            coordinator?.showInfoAlert(\n                title: L10n.JotConflict.Error.generic,\n                message: error.localizedDescription\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotConflictPage/JotFileConflictService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nprotocol JotFileConflictServiceProtocol: Sendable {\n\n    func getConfictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]?\n\n    func resolveVersionConflicts(\n        jotFileInfo: JotFile.Info,\n        resolvedVersions: [JotFileVersion]\n    ) throws\n\n    func copyVersionToTemporary(\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion\n    ) throws -> JotFile.Info?\n}\n\nstruct JotFileConflictService: JotFileConflictServiceProtocol {\n\n    private let fileConflictService: FileConflictServiceProtocol\n\n    init(fileConflictService: FileConflictServiceProtocol) {\n        self.fileConflictService = fileConflictService\n    }\n\n    func getConfictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]? {\n        guard let fileVersions = fileConflictService.getConflictingVersions(fileURL: jotFileInfo.url),\n            !fileVersions.isEmpty\n        else {\n            return nil\n        }\n        return\n            fileVersions\n            .map { fileVersion in\n                JotFileVersion(\n                    localizedNameOfSavingComputer: fileVersion.localizedNameOfSavingComputer,\n                    info: JotFile.Info(\n                        url: fileVersion.url,\n                        name: fileVersion.localizedName ?? fileVersion.url.deletingPathExtension().lastPathComponent,\n                        modificationDate: fileVersion.modificationDate,\n                        ubiquitousInfo: UbiquitousInfo(downloadStatus: nil, isDownloading: false)\n                    )\n                )\n            }\n    }\n\n    func resolveVersionConflicts(\n        jotFileInfo: JotFile.Info,\n        resolvedVersions: [JotFileVersion]\n    ) throws {\n        try fileConflictService.resolveVersionConflicts(\n            fileURL: jotFileInfo.url,\n            resolvedVersions: resolvedVersions.map(\\.info.url)\n        )\n    }\n\n    func copyVersionToTemporary(\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion\n    ) throws -> JotFile.Info? {\n        guard\n            let tmpURL = try fileConflictService.copyVersionToTemporary(\n                fileURL: jotFileInfo.url,\n                versionURL: jotFileVersion.info.url\n            )\n        else {\n            return nil\n        }\n        return JotFile.Info(\n            url: tmpURL,\n            name: jotFileVersion.info.name,\n            modificationDate: jotFileVersion.info.modificationDate,\n            ubiquitousInfo: jotFileVersion.info.ubiquitousInfo\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotFilePreview/CachedJotFilePreviewImageService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport CryptoKit\nimport UIKit\n\nactor CachedJotFilePreviewImageService: JotFilePreviewImageServiceProtocol {\n\n    private enum Constants {\n        static let diskCacheDirectoryName = \"JotFilePreviewCache\"\n        static let memoryCacheSizeLimit = 20 * 1024 * 1024  // 20 MB\n    }\n\n    private struct CacheKey: CustomStringConvertible {\n        let jotFilePath: String\n        let modificationDate: Date?\n        let userInterfaceStyle: UIUserInterfaceStyle\n        let displayScale: CGFloat\n\n        var description: String {\n            [\n                jotFilePath.description,\n                modificationDate.map(\\.timeIntervalSince1970.description),\n                userInterfaceStyle.rawValue.description,\n                displayScale.description,\n            ]\n            .compactMap { $0 }\n            .joined(separator: \"|\")\n        }\n    }\n\n    private let localFileService: FileServiceProtocol\n    private let jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n    private let memoryCache: NSCache<NSString, NSData>\n    private let temporaryDirectory: URL\n\n    init(\n        localFileService: FileServiceProtocol,\n        jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n    ) {\n        self.localFileService = localFileService\n        self.jotFilePreviewImageService = jotFilePreviewImageService\n\n        let cache = NSCache<NSString, NSData>()\n        cache.totalCostLimit = Constants.memoryCacheSizeLimit\n        self.memoryCache = cache\n\n        temporaryDirectory =\n            localFileService\n            .temporaryDirectory()\n            .appendingPathComponent(Constants.diskCacheDirectoryName, isDirectory: true)\n\n        try? FileManager.default.createDirectory(\n            at: temporaryDirectory,\n            withIntermediateDirectories: true\n        )\n    }\n\n    func getPreviewImageData(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async throws -> Data {\n        let memoryCacheKey = makeMemoryCacheKey(\n            jotFileInfo: jotFileInfo,\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n\n        if let cached = memoryCache.object(forKey: memoryCacheKey) {\n            return cached as Data\n        }\n\n        let diskCacheFileURL = makeDiskCacheFileURL(\n            jotFileInfo: jotFileInfo,\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n\n        if let diskCacheFileURL,\n            let cachedPreviewImageData = try? localFileService.readFile(fileURL: diskCacheFileURL)\n        {\n            memoryCache.setObject(\n                cachedPreviewImageData as NSData,\n                forKey: memoryCacheKey,\n                cost: cachedPreviewImageData.count\n            )\n            return cachedPreviewImageData\n        }\n\n        let previewImageData = try await jotFilePreviewImageService.getPreviewImageData(\n            jotFileInfo: jotFileInfo,\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n\n        memoryCache.setObject(\n            previewImageData as NSData,\n            forKey: memoryCacheKey,\n            cost: previewImageData.count\n        )\n\n        if let diskCacheFileURL {\n            try? localFileService.writeFile(fileURL: diskCacheFileURL, data: previewImageData)\n        }\n\n        return previewImageData\n    }\n\n    private func makeMemoryCacheKey(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) -> NSString {\n        makeCacheKey(\n            jotFilePath: jotFileInfo.url.path,\n            modificationDate: jotFileInfo.modificationDate,\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        ) as NSString\n    }\n\n    private func makeDiskCacheFileURL(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) -> URL? {\n        guard let modificationDate = jotFileInfo.modificationDate else {\n            return nil\n        }\n\n        let cacheKey = makeCacheKey(\n            jotFilePath: jotFileInfo.url.path,\n            modificationDate: modificationDate,\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n\n        return temporaryDirectory.appendingPathComponent(cacheKey, isDirectory: false)\n    }\n\n    private func makeCacheKey(\n        jotFilePath: String,\n        modificationDate: Date?,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) -> String {\n        SHA256.hash(\n            data: Data(\n                CacheKey(\n                    jotFilePath: jotFilePath,\n                    modificationDate: modificationDate,\n                    userInterfaceStyle: userInterfaceStyle,\n                    displayScale: displayScale\n                ).description.utf8\n            )\n        )\n        .map { String(format: \"%02x\", $0) }\n        .joined()\n    }\n}\n"
  },
  {
    "path": "Sources/JotFilePreview/JotFilePreviewImageService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport PencilKit\nimport UIKit\n\nstruct JotFilePreviewImageService: JotFilePreviewImageServiceProtocol {\n\n    enum Constants {\n\n        static let size = CGSize(width: 160, height: 160)\n    }\n\n    enum Failure: Error {\n        case couldNotRenderImage\n        case fileNotDownloaded\n    }\n\n    private let jotFileService: JotFileServiceProtocol\n\n    init(jotFileService: JotFileServiceProtocol) {\n        self.jotFileService = jotFileService\n    }\n\n    func getPreviewImageData(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async throws -> Data {\n        guard jotFileInfo.ubiquitousInfo?.downloadStatus != .notDownloaded else {\n            throw Failure.fileNotDownloaded\n        }\n\n        let jotFile = try jotFileService.readJotFile(jotFileInfo: jotFileInfo)\n        let drawing = try PKDrawing(data: jotFile.jot.drawing)\n\n        let aspectRatio = Constants.size.width / Constants.size.height\n        let rect = CGRect(\n            x: .zero,\n            y: .zero,\n            width: jotFile.jot.width,\n            height: jotFile.jot.width / aspectRatio\n        )\n        let scale = displayScale * Constants.size.width / jotFile.jot.width\n\n        let traitCollection = UITraitCollection(userInterfaceStyle: userInterfaceStyle)\n\n        let image = await MainActor.run {\n            var image: UIImage?\n            traitCollection.performAsCurrent {\n                image = drawing.image(from: rect, scale: scale)\n            }\n            return image\n        }\n\n        guard let imageData = image?.pngData() else {\n            throw Failure.couldNotRenderImage\n        }\n\n        return imageData\n    }\n}\n"
  },
  {
    "path": "Sources/JotFilePreview/JotFilePreviewImageServiceProtocol.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol JotFilePreviewImageServiceProtocol: Sendable {\n\n    func getPreviewImageData(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async throws -> Data\n}\n"
  },
  {
    "path": "Sources/JotsPage/CreateJot/CreateJotCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nfinal class CreateJotCoordinator: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    private let navigation: Navigation\n    private let repository: CreateJotRepositoryProtocol\n\n    init(\n        navigation: Navigation,\n        repository: CreateJotRepositoryProtocol\n    ) {\n        self.navigation = navigation\n        self.repository = repository\n    }\n\n    func start() {\n        let alertController = UIAlertController(\n            title: L10n.Jots.Create.title,\n            message: nil,\n            preferredStyle: .alert\n        )\n        alertController.addTextField { textField in\n            textField.placeholder = L10n.Jots.Create.namePlaceholder\n            textField.autocapitalizationType = .sentences\n            textField.returnKeyType = .done\n        }\n\n        let createAction = UIAlertAction(\n            title: L10n.Action.create,\n            style: .default\n        ) { [weak self] _ in\n            guard\n                let self,\n                let name = alertController.textFields?.first?.text,\n                !name.isEmpty\n            else {\n                return\n            }\n\n            handleCreateJot(name: name)\n        }\n        alertController.addAction(createAction)\n\n        let cancelAction = UIAlertAction(\n            title: L10n.Action.cancel,\n            style: .cancel,\n            handler: { [weak self] _ in\n                self?.onEnd?()\n            }\n        )\n        alertController.addAction(cancelAction)\n\n        navigation.present(alertController, animated: true)\n    }\n\n    private func handleCreateJot(name: String) {\n        Task { [weak self] in\n            guard let self else {\n                return\n            }\n            do {\n                try await handleCreateJot(name: name)\n            } catch CreateJotRepository.Failure.fileExists {\n                showInfoAlert(\n                    title: L10n.Jots.Create.Error.fileExists(name),\n                    message: nil\n                )\n            } catch {\n                showInfoAlert(\n                    title: L10n.Jots.Create.Error.generic,\n                    message: error.localizedDescription\n                )\n            }\n        }\n    }\n\n    private func handleCreateJot(name: String) async throws {\n        let jotFileInfo = try await repository.createJot(name: name)\n        navigation.open(url: EditJotURL(jotFileInfo: jotFileInfo))\n        onEnd?()\n    }\n\n    private func showInfoAlert(\n        title: String,\n        message: String?\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n            self?.onEnd?()\n        }\n        infoAlertCoordinator.start()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/CreateJot/CreateJotCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol CreateJotCoordinatorFactoryProtocol: Sendable {\n\n    func make(navigation: Navigation) -> Coordinator\n}\n\nstruct CreateJotCoordinatorFactory: CreateJotCoordinatorFactoryProtocol {\n\n    let repository: CreateJotRepositoryProtocol\n\n    func make(navigation: Navigation) -> Coordinator {\n        CreateJotCoordinator(\n            navigation: navigation,\n            repository: repository\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/CreateJot/CreateJotRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol CreateJotRepositoryProtocol: Sendable {\n\n    func createJot(name: String) async throws -> JotFile.Info\n}\n\nstruct CreateJotRepository: CreateJotRepositoryProtocol {\n\n    enum Failure: Error {\n        case couldNotCreateFile\n        case fileExists\n    }\n\n    private let localFileService: FileServiceProtocol\n    private let ubiquitousFileService: FileServiceProtocol\n    private let jotFileService: JotFileServiceProtocol\n\n    init(\n        localFileService: FileServiceProtocol,\n        ubiquitousFileService: FileServiceProtocol,\n        jotFileService: JotFileServiceProtocol\n    ) {\n        self.localFileService = localFileService\n        self.ubiquitousFileService = ubiquitousFileService\n        self.jotFileService = jotFileService\n    }\n\n    func createJot(name: String) async throws -> JotFile.Info {\n        let fileService: FileServiceProtocol\n        let directory: URL\n        let isUbiquitous: Bool\n\n        if let ubiquitousDirectory = try await ubiquitousFileService.documentsDirectory() {\n            fileService = ubiquitousFileService\n            directory = ubiquitousDirectory\n            isUbiquitous = true\n        } else if let localDirectory = try await localFileService.documentsDirectory() {\n            fileService = localFileService\n            directory = localDirectory\n            isUbiquitous = false\n        } else {\n            throw Failure.couldNotCreateFile\n        }\n\n        let fileURL =\n            directory\n            .appendingPathComponent(name, isDirectory: false)\n            .appendingPathExtension(JotFile.Info.fileExtension)\n\n        guard !fileService.fileExists(fileURL: fileURL) else {\n            throw Failure.fileExists\n        }\n\n        let jotFile = JotFile(\n            info: JotFile.Info(\n                url: fileURL,\n                name: name,\n                modificationDate: nil,\n                ubiquitousInfo: isUbiquitous ? UbiquitousInfo(downloadStatus: .current, isDownloading: false) : nil\n            ),\n            jot: .makeEmpty()\n        )\n        try jotFileService.write(jotFile: jotFile)\n        return jotFile.info\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/DeleteJot/DeleteJotCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class DeleteJotCoordinator: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    private let jotFileInfo: JotFile.Info\n    private let navigation: Navigation\n    private let repository: DeleteJotRepositoryProtocol\n\n    init(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation,\n        repository: DeleteJotRepositoryProtocol\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.navigation = navigation\n        self.repository = repository\n    }\n\n    func start() {\n        let alertController = UIAlertController(\n            title: L10n.Jots.Delete.title,\n            message: L10n.Jots.Delete.message,\n            preferredStyle: .alert\n        )\n        alertController.addAction(\n            UIAlertAction(\n                title: L10n.Action.cancel,\n                style: .cancel\n            )\n        )\n        alertController.addAction(\n            UIAlertAction(\n                title: L10n.Action.delete,\n                style: .destructive\n            ) { [weak self] _ in\n                guard let self else {\n                    return\n                }\n                handleDeleteJot(jotFileInfo: jotFileInfo)\n                navigation.dismiss(animated: true) { [weak self] in\n                    Task { @MainActor in\n                        self?.onEnd?()\n                    }\n                }\n            }\n        )\n        navigation.present(alertController, animated: true)\n\n    }\n\n    private func handleDeleteJot(jotFileInfo: JotFile.Info) {\n        do {\n            try repository.deleteJot(jotFileInfo: jotFileInfo)\n        } catch {\n            showInfoAlert(\n                title: L10n.Jots.Delete.Error.generic(jotFileInfo.name),\n                message: error.localizedDescription\n            )\n        }\n    }\n\n    private func showInfoAlert(\n        title: String,\n        message: String?\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n        }\n        infoAlertCoordinator.start()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/DeleteJot/DeleteJotCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol DeleteJotCoordinatorFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation\n    ) -> Coordinator\n}\n\nstruct DeleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol {\n\n    let repository: DeleteJotRepositoryProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation\n    ) -> Coordinator {\n        DeleteJotCoordinator(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation,\n            repository: repository\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/DeleteJot/DeleteJotRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol DeleteJotRepositoryProtocol: Sendable {\n\n    func deleteJot(jotFileInfo: JotFile.Info) throws\n}\n\nstruct DeleteJotRepository: DeleteJotRepositoryProtocol {\n\n    private let jotFileService: JotFileServiceProtocol\n\n    init(jotFileService: JotFileServiceProtocol) {\n        self.jotFileService = jotFileService\n    }\n\n    func deleteJot(jotFileInfo: JotFile.Info) throws {\n        try jotFileService.remove(jotFileInfo: jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/EmptyStateCell/EmptyStateCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class EmptyStateCell: UICollectionViewCell, PageCell {\n    static let reuseIdentifier = \"EmptyStateCell\"\n\n    private let titleLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.textColor = .secondaryLabel\n        label.numberOfLines = 0\n        label.textAlignment = .center\n        return label\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemBackground\n        contentView.addSubview(titleLabel)\n\n        NSLayoutConstraint.activate([\n            titleLabel.centerXAnchor.constraint(equalTo: contentView.centerXAnchor),\n            titleLabel.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n            titleLabel.widthAnchor.constraint(lessThanOrEqualTo: contentView.widthAnchor),\n            titleLabel.widthAnchor.constraint(lessThanOrEqualToConstant: 300),\n        ])\n    }\n\n    func configure(\n        viewModel: EmptyStateCellViewModel\n    ) {\n        titleLabel.text = viewModel.title\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/EmptyStateCell/EmptyStateViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class EmptyStateCellViewModel: PageCellViewModel {\n\n    let title: String\n\n    init(title: String) {\n        self.title = title\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/EmptyStateCell/PageCellItem+jotsEmptyState.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func jotsEmptyState(title: String) -> PageCellItem {\n        PageCellItem(\n            id: title,\n            cellType: EmptyStateCell.self,\n            sizing: .fullWidth(estimatedHeight: 100),\n            viewModel: EmptyStateCellViewModel(title: title)\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotCell/JotBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nstruct JotBusinessModel: Sendable, Hashable {\n    let name: String\n    let isDownloaded: Bool\n    let isDownloading: Bool\n\n    private let jotFileInfo: JotFile.Info\n\n    init(jotFileInfo: JotFile.Info) {\n        name = jotFileInfo.name\n        isDownloaded = jotFileInfo.ubiquitousInfo?.downloadStatus != .notDownloaded\n        isDownloading = jotFileInfo.ubiquitousInfo?.isDownloading ?? false\n        self.jotFileInfo = jotFileInfo\n    }\n\n    func toJotFileInfo() -> JotFile.Info {\n        jotFileInfo\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotCell/JotCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class JotCell: UICollectionViewCell, PageCell {\n\n    private enum Constants {\n\n        enum CloudIconImage {\n            static let size = CGFloat(60)\n        }\n    }\n\n    static let reuseIdentifier = \"JotCell\"\n\n    private let previewLayoutGuide = UILayoutGuide()\n\n    private lazy var previewImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.contentMode = .scaleAspectFit\n        imageView.clipsToBounds = true\n        return imageView\n    }()\n\n    private lazy var cloudIconImageView: UIImageView = {\n        let imageView = UIImageView()\n        imageView.translatesAutoresizingMaskIntoConstraints = false\n        imageView.image = UIImage(systemName: \"icloud.and.arrow.down.fill\")\n        imageView.contentMode = .scaleAspectFit\n        imageView.tintColor = .secondaryLabel\n        return imageView\n    }()\n\n    private lazy var downloadActivityIndicator: UIActivityIndicatorView = {\n        let indicator = UIActivityIndicatorView(style: .medium)\n        indicator.translatesAutoresizingMaskIntoConstraints = false\n        indicator.hidesWhenStopped = true\n        return indicator\n    }()\n\n    private let separatorLine: UIView = {\n        let view = UIView()\n        view.translatesAutoresizingMaskIntoConstraints = false\n        view.backgroundColor = UIColor.separator\n        return view\n    }()\n\n    private let nameLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.textAlignment = .center\n        #if targetEnvironment(macCatalyst)\n        label.font = .preferredFont(forTextStyle: .body, weight: .semibold)\n        #else\n        label.font = .preferredFont(forTextStyle: .caption1, weight: .semibold)\n        #endif\n        return label\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {\n        super.traitCollectionDidChange(previousTraitCollection)\n\n        if traitCollection.hasRenderingChange(comparedTo: previousTraitCollection) {\n            loadPreviewImage()\n        }\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemGroupedBackground\n        contentView.layer.cornerRadius = DesignTokens.CornerRadius.cell\n        contentView.clipsToBounds = true\n        contentView.layoutMargins = UIEdgeInsets(\n            top: DesignTokens.Spacing.xs,\n            left: DesignTokens.Spacing.xs,\n            bottom: DesignTokens.Spacing.sm,\n            right: DesignTokens.Spacing.xs\n        )\n\n        contentView.addLayoutGuide(previewLayoutGuide)\n        contentView.addSubview(separatorLine)\n        contentView.addSubview(nameLabel)\n\n        NSLayoutConstraint.activate(\n            [\n                previewLayoutGuide.topAnchor.constraint(equalTo: contentView.layoutMarginsGuide.topAnchor),\n                previewLayoutGuide.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n                previewLayoutGuide.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n                previewLayoutGuide.bottomAnchor.constraint(equalTo: separatorLine.topAnchor),\n\n                separatorLine.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),\n                separatorLine.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),\n                separatorLine.heightAnchor.constraint(equalToConstant: DesignTokens.Length.separator),\n\n                nameLabel.topAnchor.constraint(equalTo: separatorLine.bottomAnchor, constant: DesignTokens.Spacing.sm),\n                nameLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n                nameLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n                nameLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),\n            ]\n        )\n    }\n\n    private var viewModel: JotCellViewModel?\n    private var previewImageTask: Task<Void, Never>?\n\n    override func prepareForReuse() {\n        super.prepareForReuse()\n        viewModel = nil\n        previewImageTask?.cancel()\n        previewImageView.image = nil\n        previewImageView.removeFromSuperview()\n        cloudIconImageView.removeFromSuperview()\n        downloadActivityIndicator.stopAnimating()\n        downloadActivityIndicator.removeFromSuperview()\n    }\n\n    func configure(\n        viewModel: JotCellViewModel\n    ) {\n        self.viewModel = viewModel\n        nameLabel.text = viewModel.name\n\n        loadPreviewImage()\n    }\n\n    private func loadPreviewImage() {\n        previewImageTask?.cancel()\n        previewImageView.image = nil\n        previewImageView.removeFromSuperview()\n        cloudIconImageView.removeFromSuperview()\n        downloadActivityIndicator.stopAnimating()\n        downloadActivityIndicator.removeFromSuperview()\n\n        guard let viewModel else {\n            return\n        }\n\n        switch viewModel.preview {\n        case .thumbnail:\n            contentView.addSubview(previewImageView)\n            NSLayoutConstraint.activate([\n                previewImageView.topAnchor.constraint(equalTo: previewLayoutGuide.topAnchor),\n                previewImageView.leadingAnchor.constraint(equalTo: previewLayoutGuide.leadingAnchor),\n                previewImageView.trailingAnchor.constraint(equalTo: previewLayoutGuide.trailingAnchor),\n                previewImageView.bottomAnchor.constraint(equalTo: previewLayoutGuide.bottomAnchor),\n            ])\n            previewImageTask = Task { [weak self] in\n                guard let self else {\n                    return\n                }\n                previewImageView.image = await viewModel.getPreviewImage(\n                    userInterfaceStyle: traitCollection.userInterfaceStyle,\n                    displayScale: traitCollection.displayScale\n                )\n            }\n        case .cloudImage:\n            contentView.addSubview(cloudIconImageView)\n            NSLayoutConstraint.activate([\n                cloudIconImageView.centerXAnchor.constraint(equalTo: previewLayoutGuide.centerXAnchor),\n                cloudIconImageView.centerYAnchor.constraint(equalTo: previewLayoutGuide.centerYAnchor),\n                cloudIconImageView.widthAnchor.constraint(equalToConstant: Constants.CloudIconImage.size),\n                cloudIconImageView.heightAnchor.constraint(equalToConstant: Constants.CloudIconImage.size),\n            ])\n        case .loadingIndicator:\n            contentView.addSubview(cloudIconImageView)\n            NSLayoutConstraint.activate([\n                cloudIconImageView.centerXAnchor.constraint(equalTo: previewLayoutGuide.centerXAnchor),\n                cloudIconImageView.centerYAnchor.constraint(equalTo: previewLayoutGuide.centerYAnchor),\n                cloudIconImageView.widthAnchor.constraint(equalToConstant: Constants.CloudIconImage.size),\n                cloudIconImageView.heightAnchor.constraint(equalToConstant: Constants.CloudIconImage.size),\n            ])\n            contentView.addSubview(downloadActivityIndicator)\n            NSLayoutConstraint.activate([\n                downloadActivityIndicator.centerXAnchor.constraint(equalTo: previewLayoutGuide.centerXAnchor),\n                downloadActivityIndicator.topAnchor.constraint(\n                    equalTo: cloudIconImageView.bottomAnchor,\n                    constant: DesignTokens.Spacing.sm\n                ),\n            ])\n            downloadActivityIndicator.startAnimating()\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotCell/JotCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class JotCellViewModel: PageCellViewModel {\n\n    enum Preview {\n        case thumbnail\n        case cloudImage\n        case loadingIndicator\n    }\n\n    let name: String\n    let preview: Preview\n    let jotMenuConfigurations: JotMenuConfigurations\n    let onAction: @Sendable () -> Void\n\n    private let jot: JotBusinessModel\n    private let repository: JotsRepositoryProtocol\n\n    init(\n        jot: JotBusinessModel,\n        jotMenuConfigurations: JotMenuConfigurations,\n        repository: JotsRepositoryProtocol,\n        onAction: @Sendable @escaping () -> Void\n    ) {\n        self.name = jot.name\n        self.preview =\n            if jot.isDownloading {\n                .loadingIndicator\n            } else if jot.isDownloaded {\n                .thumbnail\n            } else {\n                .cloudImage\n            }\n        self.jotMenuConfigurations = jotMenuConfigurations\n        self.onAction = onAction\n        self.jot = jot\n        self.repository = repository\n    }\n\n    func handle(action: PageCellAction) {\n        switch action {\n        case .tap: onAction()\n        }\n    }\n\n    func getPreviewImage(\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await repository.getPreviewImage(\n            jotFileInfo: jot.toJotFileInfo(),\n            userInterfaceStyle: userInterfaceStyle,\n            displayScale: displayScale\n        )\n    }\n\n    func handleContextMenuConfiguration(\n        point: CGPoint,\n        sourceView: UIView\n    ) -> UIContextMenuConfiguration? {\n        UIContextMenuConfiguration(\n            identifier: nil,\n            previewProvider: nil\n        ) { [weak self, weak sourceView] _ in\n            guard let self else {\n                return nil\n            }\n            return UIMenu.make(\n                jotMenuConfigurations: self.jotMenuConfigurations.make(popoverAnchorProvider: {\n                    [weak sourceView] in\n                    guard let sourceView else {\n                        return nil\n                    }\n                    return { popover in\n                        popover.sourceView = sourceView\n                        popover.sourceRect = CGRect(origin: point, size: .zero)\n                    }\n                })\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotCell/PageCellItem+jot.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func jot(\n        jot: JotBusinessModel,\n        jotMenuConfigurations: JotMenuConfigurations,\n        sizing: PageCellSizingStrategy,\n        repository: JotsRepositoryProtocol,\n        onAction: @Sendable @escaping () -> Void\n    ) -> PageCellItem {\n        PageCellItem(\n            id: jot,\n            cellType: JotCell.self,\n            sizing: sizing,\n            viewModel: JotCellViewModel(\n                jot: jot,\n                jotMenuConfigurations: jotMenuConfigurations,\n                repository: repository,\n                onAction: onAction\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotMenuConfiguration.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nenum JotMenuConfiguration {\n\n    struct Action {\n        let title: String\n        let systemImageName: String\n        var isDestructive: Bool = false\n        let handler: @MainActor @Sendable () -> Void\n    }\n\n    struct Group {\n        let title: String\n        let systemImageName: String\n        let actions: [Action]\n    }\n\n    case action(Action)\n    case group(Group)\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotMenuConfigurationFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct JotMenuConfigurations {\n\n    private let makeProvider:\n        @Sendable (_ popoverAnchorProvider: @MainActor @Sendable @escaping () -> PopoverAnchor?) ->\n            [JotMenuConfiguration]\n\n    init(\n        makeProvider:\n            @Sendable @escaping (_ popoverAnchorProvider: @MainActor @Sendable @escaping () -> PopoverAnchor?) ->\n            [JotMenuConfiguration]\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(popoverAnchorProvider: @MainActor @Sendable @escaping () -> PopoverAnchor?) -> [JotMenuConfiguration] {\n        makeProvider(popoverAnchorProvider)\n    }\n}\n\nstruct JotMenuConfigurationFactory: Sendable {\n\n    func make(\n        onShare: @Sendable @escaping (ShareFormat, PopoverAnchor?) -> Void,\n        onRename: @Sendable @escaping () -> Void,\n        onDuplicate: @Sendable @escaping () -> Void,\n        onDelete: @Sendable @escaping () -> Void,\n        onShowInFiles: @Sendable @escaping () -> Void,\n        onOpenInNewWindow: (@Sendable () -> Void)? = nil\n    ) -> JotMenuConfigurations {\n        JotMenuConfigurations { popoverAnchorProvider in\n            var menuConfiguration = [JotMenuConfiguration]()\n\n            if let onOpenInNewWindow {\n                menuConfiguration.append(\n                    .action(\n                        JotMenuConfiguration.Action(\n                            title: L10n.Jots.Menu.openInNewWindow,\n                            systemImageName: \"plus.app\"\n                        ) {\n                            onOpenInNewWindow()\n                        }\n                    )\n                )\n            }\n\n            menuConfiguration.append(contentsOf: [\n                .action(\n                    JotMenuConfiguration.Action(\n                        title: L10n.Action.rename,\n                        systemImageName: \"pencil\"\n                    ) {\n                        onRename()\n                    }\n                ),\n                .action(\n                    JotMenuConfiguration.Action(\n                        title: L10n.Action.duplicate,\n                        systemImageName: \"plus.square.on.square\"\n                    ) {\n                        onDuplicate()\n                    }\n                ),\n                .action(\n                    JotMenuConfiguration.Action(\n                        title: L10n.Action.delete,\n                        systemImageName: \"trash\",\n                        isDestructive: true\n                    ) {\n                        onDelete()\n                    }\n                ),\n                .action(\n                    JotMenuConfiguration.Action(\n                        title: {\n                            #if targetEnvironment(macCatalyst)\n                            L10n.Jots.Menu.revealInFinder\n                            #else\n                            L10n.Jots.Menu.revealInFiles\n                            #endif\n                        }(),\n                        systemImageName: \"folder\"\n                    ) {\n                        onShowInFiles()\n                    }\n                ),\n                .group(\n                    JotMenuConfiguration.Group(\n                        title: L10n.Action.share,\n                        systemImageName: \"square.and.arrow.up\",\n                        actions: [\n                            JotMenuConfiguration.Action(\n                                title: L10n.Share.Format.pdf,\n                                systemImageName: \"doc.fill\"\n                            ) {\n                                onShare(.pdf, popoverAnchorProvider())\n                            },\n                            JotMenuConfiguration.Action(\n                                title: L10n.Share.Format.jpg,\n                                systemImageName: \"photo.fill\"\n                            ) {\n                                onShare(.jpg, popoverAnchorProvider())\n                            },\n                            JotMenuConfiguration.Action(\n                                title: L10n.Share.Format.png,\n                                systemImageName: \"photo\"\n                            ) {\n                                onShare(.png, popoverAnchorProvider())\n                            },\n                        ]\n                    )\n                ),\n            ])\n\n            return menuConfiguration\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol JotsCoordinatorProtocol: NavigationCoordinator {\n\n    func openSettings()\n    func openCreateJot()\n    func openJot(jotFileInfo: JotFile.Info, prefersNewWindow: Bool)\n    func openEnableCloudPage()\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    )\n    func showRenameAlert(jotFileInfo: JotFile.Info)\n    func openDeleteJot(jotFileInfo: JotFile.Info)\n    func showInfoAlert(title: String, message: String)\n    func showInFiles(jotFileInfo: JotFile.Info)\n}\n\n@MainActor\nfinal class JotsCoordinator: NavigationCoordinator, JotsCoordinatorProtocol {\n\n    private var cloudMigrationTask: Task<Void, Never>?\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n    private var retainedShareJotCoordinator: Coordinator?\n    private var retainedRenameJotCoordinator: Coordinator?\n    private var retainedDeleteJotCoordinator: Coordinator?\n    private var retainedCreateJotCoordinator: Coordinator?\n    private var retainedCloudMigrationCoordinator: Coordinator?\n    private var retainedRevealFileCoordinator: Coordinator?\n    private var retainedSettingsCoordinator: Coordinator?\n    private var retainedEnableCloudCoordinator: Coordinator?\n\n    private var retainedJotsViewController: UIViewController?\n\n    private lazy var childCoordinators: [NavigationCoordinator] = [\n        editJotCoordinatorFactory.make(navigation: navigation)\n    ]\n\n    private let navigation: Navigation\n    private let jotsViewControllerFactory: JotsViewControllerFactoryProtocol\n    private let settingsCoordinatorFactory: SettingsCoordinatorFactoryProtocol\n    private let enableCloudCoordinatorFactory: EnableCloudCoordinatorFactoryProtocol\n    private let editJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol\n    private let cloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactoryProtocol\n    private let createJotCoordinatorFactory: CreateJotCoordinatorFactoryProtocol\n    private let deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol\n    private let renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol\n    private let shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol\n    private let revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n\n    init(\n        navigation: Navigation,\n        jotsViewControllerFactory: JotsViewControllerFactoryProtocol,\n        settingsCoordinatorFactory: SettingsCoordinatorFactoryProtocol,\n        enableCloudCoordinatorFactory: EnableCloudCoordinatorFactoryProtocol,\n        editJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol,\n        cloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactoryProtocol,\n        createJotCoordinatorFactory: CreateJotCoordinatorFactoryProtocol,\n        deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol,\n        renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol,\n        shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol,\n        revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n    ) {\n        self.navigation = navigation\n        self.jotsViewControllerFactory = jotsViewControllerFactory\n        self.settingsCoordinatorFactory = settingsCoordinatorFactory\n        self.enableCloudCoordinatorFactory = enableCloudCoordinatorFactory\n        self.editJotCoordinatorFactory = editJotCoordinatorFactory\n        self.cloudMigrationCoordinatorFactory = cloudMigrationCoordinatorFactory\n        self.createJotCoordinatorFactory = createJotCoordinatorFactory\n        self.deleteJotCoordinatorFactory = deleteJotCoordinatorFactory\n        self.renameJotCoordinatorFactory = renameJotCoordinatorFactory\n        self.shareJotCoordinatorFactory = shareJotCoordinatorFactory\n        self.revealFileCoordinatorFactory = revealFileCoordinatorFactory\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        true\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        var viewControllers: [UIViewController]\n\n        if let retainedJotsViewController {\n            viewControllers = [retainedJotsViewController]\n        } else {\n            let jotsViewController = jotsViewControllerFactory.make(coordinator: self)\n            self.retainedJotsViewController = jotsViewController\n            viewControllers = [jotsViewController]\n        }\n\n        if let childCoordinator = childCoordinators.first(where: { $0.shouldHandle(url: url) }) {\n            viewControllers.append(contentsOf: childCoordinator.handle(url: url))\n            return viewControllers\n        }\n\n        showCloudMigrationPageIfNeeded()\n\n        return viewControllers\n    }\n\n    func openSettings() {\n        let settingsCoordinator = settingsCoordinatorFactory.make(navigation: navigation)\n        retainedSettingsCoordinator = settingsCoordinator\n        settingsCoordinator.onEnd = { [weak self] in\n            self?.retainedSettingsCoordinator = nil\n        }\n        settingsCoordinator.start()\n    }\n\n    func openCreateJot() {\n        let createJotCoordinator = createJotCoordinatorFactory.make(navigation: navigation)\n        retainedCreateJotCoordinator = createJotCoordinator\n        createJotCoordinator.onEnd = { [weak self] in\n            self?.retainedCreateJotCoordinator = nil\n        }\n        createJotCoordinator.start()\n    }\n\n    func openJot(\n        jotFileInfo: JotFile.Info,\n        prefersNewWindow: Bool\n    ) {\n        let url = EditJotURL(jotFileInfo: jotFileInfo)\n        #if targetEnvironment(macCatalyst)\n        navigation.openScene(url: url)\n        #else\n        if prefersNewWindow {\n            navigation.openScene(url: url)\n        } else {\n            navigation.open(url: url)\n        }\n        #endif\n    }\n\n    func openEnableCloudPage() {\n        let enableCloudCoordinator = enableCloudCoordinatorFactory.make(navigation: navigation)\n        retainedEnableCloudCoordinator = enableCloudCoordinator\n        enableCloudCoordinator.onEnd = { [weak self] in\n            self?.retainedEnableCloudCoordinator = nil\n        }\n        enableCloudCoordinator.start()\n    }\n\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    ) {\n        let coordinator = shareJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            format: format,\n            navigation: navigation,\n            configurePopoverAnchor: configurePopoverAnchor\n        )\n        retainedShareJotCoordinator = coordinator\n        coordinator.onEnd = { [weak self] in\n            self?.retainedShareJotCoordinator = nil\n        }\n        coordinator.start()\n    }\n\n    func showRenameAlert(jotFileInfo: JotFile.Info) {\n        let coordinator = renameJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        ) { _ in\n            /* no-op */\n        }\n        retainedRenameJotCoordinator = coordinator\n        coordinator.onEnd = { [weak self] in\n            self?.retainedRenameJotCoordinator = nil\n        }\n        coordinator.start()\n    }\n\n    func openDeleteJot(jotFileInfo: JotFile.Info) {\n        let deleteJotCoordinator = deleteJotCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        )\n        retainedDeleteJotCoordinator = deleteJotCoordinator\n        deleteJotCoordinator.onEnd = { [weak self] in\n            self?.retainedDeleteJotCoordinator = nil\n        }\n        deleteJotCoordinator.start()\n    }\n\n    func showInfoAlert(\n        title: String,\n        message: String\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n        }\n        infoAlertCoordinator.start()\n    }\n\n    func showInFiles(jotFileInfo: JotFile.Info) {\n        let revealFileCoordinator = revealFileCoordinatorFactory.make(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation\n        )\n        retainedRevealFileCoordinator = revealFileCoordinator\n        revealFileCoordinator.onEnd = { [weak self] in\n            self?.retainedRevealFileCoordinator = nil\n        }\n        revealFileCoordinator.start()\n    }\n\n    private func showCloudMigrationPageIfNeeded() {\n        let cloudMigrationCoordinator = cloudMigrationCoordinatorFactory.make(navigation: navigation)\n        guard cloudMigrationCoordinator.shouldStart() else {\n            return\n        }\n\n        retainedCloudMigrationCoordinator = cloudMigrationCoordinator\n        cloudMigrationCoordinator.onEnd = { [weak self] in\n            self?.retainedCloudMigrationCoordinator = nil\n        }\n        cloudMigrationCoordinator.start()\n    }\n\n    deinit {\n        cloudMigrationTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol JotsCoordinatorFactoryProtocol: Sendable {\n\n    func make(navigation: Navigation) -> NavigationCoordinator\n}\n\nstruct JotsCoordinatorFactory: JotsCoordinatorFactoryProtocol {\n\n    let jotsViewControllerFactory: JotsViewControllerFactory\n\n    let settingsCoordinatorFactory: SettingsCoordinatorFactory\n    let enableCloudCoordinatorFactory: EnableCloudCoordinatorFactory\n    let editJotCoordinatorFactory: EditJotCoordinatorFactory\n    let cloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactory\n    let createJotCoordinatorFactory: CreateJotCoordinatorFactoryProtocol\n    let deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol\n    let renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol\n    let shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol\n    let revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol\n\n    func make(navigation: Navigation) -> NavigationCoordinator {\n        JotsCoordinator(\n            navigation: navigation,\n            jotsViewControllerFactory: jotsViewControllerFactory,\n            settingsCoordinatorFactory: settingsCoordinatorFactory,\n            enableCloudCoordinatorFactory: enableCloudCoordinatorFactory,\n            editJotCoordinatorFactory: editJotCoordinatorFactory,\n            cloudMigrationCoordinatorFactory: cloudMigrationCoordinatorFactory,\n            createJotCoordinatorFactory: createJotCoordinatorFactory,\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            renameJotCoordinatorFactory: renameJotCoordinatorFactory,\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsPageURL.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nstruct JotsPageURL: URLConvertible {\n    let path = \"/\"\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\nprotocol JotsRepositoryProtocol: Sendable {\n\n    func getJotFiles() -> AsyncThrowingStream<[JotFile.Info], Error>\n\n    func shouldShowEnableICloudButton() -> Bool\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info\n\n    func download(jotFileInfo: JotFile.Info) throws\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage?\n\n    @MainActor\n    func supportsMultipleScenes() -> Bool\n\n    @MainActor\n    func isIPadOS() -> Bool\n}\n\nstruct JotsRepository: JotsRepositoryProtocol {\n\n    private let ubiquitousFileService: FileServiceProtocol\n    private let applicationService: ApplicationServiceProtocol\n    private let deviceService: DeviceServiceProtocol\n    private let jotFileService: JotFileServiceProtocol\n    private let jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n\n    init(\n        ubiquitousFileService: FileServiceProtocol,\n        applicationService: ApplicationServiceProtocol,\n        deviceService: DeviceServiceProtocol,\n        jotFileService: JotFileServiceProtocol,\n        jotFilePreviewImageService: JotFilePreviewImageServiceProtocol\n    ) {\n        self.ubiquitousFileService = ubiquitousFileService\n        self.applicationService = applicationService\n        self.deviceService = deviceService\n        self.jotFileService = jotFileService\n        self.jotFilePreviewImageService = jotFilePreviewImageService\n    }\n\n    func getJotFiles() -> AsyncThrowingStream<[JotFile.Info], Error> {\n        jotFileService\n            .documentsDirectoryContents()\n            .map { jotFileInfos in\n                jotFileInfos.sorted { a, b in\n                    (a.modificationDate ?? .distantPast) > (b.modificationDate ?? .distantPast)\n                }\n            }\n            .toAsyncThrowingStream()\n    }\n\n    func shouldShowEnableICloudButton() -> Bool {\n        !ubiquitousFileService.isEnabled()\n    }\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        try jotFileService.duplicate(jotFileInfo: jotFileInfo)\n    }\n\n    func download(jotFileInfo: JotFile.Info) throws {\n        try ubiquitousFileService.startDownload(fileURL: jotFileInfo.url)\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        do {\n            let imageData = try await jotFilePreviewImageService.getPreviewImageData(\n                jotFileInfo: jotFileInfo,\n                userInterfaceStyle: userInterfaceStyle,\n                displayScale: displayScale\n            )\n            return UIImage(data: imageData)\n        } catch {\n            return nil\n        }\n    }\n\n    func supportsMultipleScenes() -> Bool {\n        applicationService.supportsMultipleScenes()\n    }\n\n    func isIPadOS() -> Bool {\n        deviceService.isIPadOS()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol JotsViewControllerFactoryProtocol: Sendable {\n\n    func make(coordinator: JotsCoordinatorProtocol) -> UIViewController\n}\n\nstruct JotsViewControllerFactory: JotsViewControllerFactoryProtocol {\n\n    let repository: JotsRepositoryProtocol\n    let menuConfigurationFactory: JotMenuConfigurationFactory\n    let textBarButtonItemFactory: TextBarButtonItemFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n    let logger: LoggerProtocol\n\n    func make(coordinator: JotsCoordinatorProtocol) -> UIViewController {\n        let viewController = PageViewController(\n            viewModel: JotsViewModel(\n                coordinator: coordinator,\n                repository: repository,\n                menuConfigurationFactory: menuConfigurationFactory,\n                logger: logger\n            ),\n            textBarButtonItemFactory: textBarButtonItemFactory,\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n        #if targetEnvironment(macCatalyst)\n        viewController.navigationItem.largeTitleDisplayMode = .never\n        #else\n        viewController.navigationItem.largeTitleDisplayMode = .always\n        #endif\n        return viewController\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/JotsViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nfinal class JotsViewModel: PageViewModel {\n\n    var title: String? {\n        #if targetEnvironment(macCatalyst)\n        nil\n        #else\n        L10n.App.title\n        #endif\n    }\n\n    let leftNavigationItems: AsyncStream<[PageNavigationItem]>\n    private let leftNavigationItemsContinuation: AsyncStream<[PageNavigationItem]>.Continuation\n\n    let rightNavigationItems: AsyncStream<[PageNavigationItem]>\n    private let rightNavigationItemsContinuation: AsyncStream<[PageNavigationItem]>.Continuation\n\n    let items: AsyncStream<[PageCellItem]>\n    private let itemsContinuation: AsyncStream<[PageCellItem]>.Continuation\n\n    let actions = [PageCallToActionView.ActionConfiguration]()\n\n    private var jotsTask: Task<Void, Never>?\n\n    private weak var coordinator: JotsCoordinatorProtocol?\n\n    private let repository: JotsRepositoryProtocol\n    private let menuConfigurationFactory: JotMenuConfigurationFactory\n    private let logger: LoggerProtocol\n\n    init(\n        coordinator: JotsCoordinatorProtocol,\n        repository: JotsRepositoryProtocol,\n        menuConfigurationFactory: JotMenuConfigurationFactory,\n        logger: LoggerProtocol\n    ) {\n        self.coordinator = coordinator\n        self.repository = repository\n        self.menuConfigurationFactory = menuConfigurationFactory\n        self.logger = logger\n\n        (items, itemsContinuation) = AsyncStream.makeStream(\n            of: [PageCellItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        (leftNavigationItems, leftNavigationItemsContinuation) = AsyncStream.makeStream(\n            of: [PageNavigationItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n\n        var leftNavigationItems = [\n            PageNavigationItem.symbol(\n                systemImageName: \"gear\",\n            ) { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.openSettings()\n                }\n            }\n        ]\n\n        if repository.shouldShowEnableICloudButton() {\n            leftNavigationItems.append(\n                .symbol(\n                    systemImageName: \"icloud.slash\",\n                ) { [weak coordinator] in\n                    Task { @MainActor in\n                        coordinator?.openEnableCloudPage()\n                    }\n                }\n            )\n        }\n\n        leftNavigationItemsContinuation.yield(leftNavigationItems)\n\n        (rightNavigationItems, rightNavigationItemsContinuation) = AsyncStream.makeStream(\n            of: [PageNavigationItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n        #if !targetEnvironment(macCatalyst)\n        rightNavigationItemsContinuation.yield([\n            .text(\n                title: L10n.Action.create\n            ) { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.openCreateJot()\n                }\n            }\n        ])\n        #endif\n    }\n\n    func didLoad() {\n        jotsTask = Task { [weak self] in\n            guard let self else {\n                return\n            }\n            do {\n                for try await jotFileInfos in repository.getJotFiles() {\n                    handleJots(jotFileInfos: jotFileInfos)\n                }\n            } catch {\n                logger.error(\"Failed to observe jot files: \\(error)\")\n            }\n        }\n    }\n\n    private func handleJots(jotFileInfos: [JotFile.Info]) {\n        guard !jotFileInfos.isEmpty else {\n            itemsContinuation.yield([\n                .jotsEmptyState(title: L10n.Jots.Empty.title)\n            ])\n            return\n        }\n        let supportsMultipleScenes = repository.supportsMultipleScenes()\n\n        itemsContinuation.yield(\n            jotFileInfos.map { jotFileInfo in\n                let jot = JotBusinessModel(jotFileInfo: jotFileInfo)\n                return .jot(\n                    jot: jot,\n                    jotMenuConfigurations: makeMenuConfigurations(\n                        jotFileInfo: jotFileInfo,\n                        supportsMultipleScenes: supportsMultipleScenes\n                    ),\n                    sizing: .adaptiveGrid(\n                        minColumns: 2,\n                        maxColumns: 8,\n                        minItemWidth: 160,\n                        maxItemWidth: 200,\n                        columnSpacing: DesignTokens.Spacing.md,\n                        rowSpacing: DesignTokens.Spacing.md,\n                        aspectRatio: CGSize(\n                            width: 7,\n                            height: 8\n                        )\n                    ),\n                    repository: repository,\n                    onAction: { [weak coordinator, weak self] in\n                        Task { @MainActor in\n                            guard let self else {\n                                return\n                            }\n                            if jot.isDownloaded {\n                                coordinator?.openJot(\n                                    jotFileInfo: jotFileInfo,\n                                    prefersNewWindow: !self.repository.isIPadOS()\n                                )\n                            } else {\n                                do {\n                                    try self.repository.download(jotFileInfo: jotFileInfo)\n                                } catch {\n                                    coordinator?.showInfoAlert(\n                                        title: L10n.Jots.Download.Error.generic(jotFileInfo.name),\n                                        message: error.localizedDescription\n                                    )\n                                }\n                            }\n                        }\n                    }\n                )\n            }\n        )\n    }\n\n    private func makeMenuConfigurations(\n        jotFileInfo: JotFile.Info,\n        supportsMultipleScenes: Bool\n    ) -> JotMenuConfigurations {\n        menuConfigurationFactory.make(\n            onShare: { [weak coordinator] format, configurePopoverAnchor in\n                Task { @MainActor in\n                    coordinator?.showShareJot(\n                        jotFileInfo: jotFileInfo,\n                        format: format,\n                        configurePopoverAnchor: configurePopoverAnchor\n                    )\n                }\n            },\n            onRename: { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.showRenameAlert(jotFileInfo: jotFileInfo)\n                }\n            },\n            onDuplicate: { [weak self] in\n                Task { @MainActor in\n                    self?.didTapDuplicateJot(jotFileInfo: jotFileInfo)\n                }\n            },\n            onDelete: { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.openDeleteJot(jotFileInfo: jotFileInfo)\n                }\n            },\n            onShowInFiles: { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.showInFiles(jotFileInfo: jotFileInfo)\n                }\n            },\n            onOpenInNewWindow: supportsMultipleScenes\n                ? { @Sendable [weak coordinator] in\n                    Task { @MainActor in\n                        coordinator?.openJot(\n                            jotFileInfo: jotFileInfo,\n                            prefersNewWindow: true\n                        )\n                    }\n                } : nil\n        )\n    }\n\n    private func didTapDuplicateJot(jotFileInfo: JotFile.Info) {\n        do {\n            _ = try repository.duplicate(jotFileInfo: jotFileInfo)\n        } catch {\n            coordinator?.showInfoAlert(\n                title: L10n.Jots.Duplicate.Error.generic(jotFileInfo.name),\n                message: error.localizedDescription\n            )\n        }\n    }\n\n    deinit {\n        jotsTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/RenameJot/RenameJotCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class RenameJotCoordinator: Coordinator {\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n\n    var onEnd: (() -> Void)?\n\n    private let jotFileInfo: JotFile.Info\n    private let navigation: Navigation\n    private let repository: RenameJotRepositoryProtocol\n    private let onRename: @Sendable (_ info: JotFile.Info) -> Void\n\n    init(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation,\n        repository: RenameJotRepositoryProtocol,\n        onRename: @Sendable @escaping (_ info: JotFile.Info) -> Void\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.navigation = navigation\n        self.repository = repository\n        self.onRename = onRename\n    }\n\n    func start() {\n        let alertController = UIAlertController(\n            title: L10n.Jots.Rename.title,\n            message: nil,\n            preferredStyle: .alert\n        )\n        alertController.addTextField { [weak self] textField in\n            textField.clearButtonMode = .whileEditing\n            textField.placeholder = self?.jotFileInfo.name\n        }\n        alertController.addAction(\n            UIAlertAction(\n                title: L10n.Action.cancel,\n                style: .cancel,\n                handler: { [weak self] _ in\n                    self?.onEnd?()\n                }\n            )\n        )\n        alertController.addAction(\n            UIAlertAction(\n                title: L10n.Action.rename,\n                style: .default\n            ) { [weak self] _ in\n                guard\n                    let self,\n                    let newName = alertController.textFields?.first?.text\n                else {\n                    self?.onEnd?()\n                    return\n                }\n                handleRename(newName: newName)\n            }\n        )\n        navigation.present(alertController, animated: true)\n    }\n\n    private func handleRename(\n        newName: String\n    ) {\n        do {\n            let renamedJotFileInfo = try repository.rename(\n                jotFileInfo: jotFileInfo,\n                newName: newName\n            )\n            onRename(renamedJotFileInfo)\n            onEnd?()\n        } catch {\n            showInfoAlert(\n                title: L10n.Jots.Rename.Error.generic(newName),\n                message: error.localizedDescription\n            )\n        }\n    }\n\n    private func showInfoAlert(\n        title: String,\n        message: String\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n            self?.onEnd?()\n        }\n        infoAlertCoordinator.start()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/RenameJot/RenameJotCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol RenameJotCoordinatorFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation,\n        onRename: @Sendable @escaping (_ renameJotFileInfo: JotFile.Info) -> Void\n    ) -> Coordinator\n}\n\nstruct RenameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol {\n\n    let repository: RenameJotRepositoryProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation,\n        onRename: @Sendable @escaping (_ renameJotFileInfo: JotFile.Info) -> Void\n    ) -> Coordinator {\n        RenameJotCoordinator(\n            jotFileInfo: jotFileInfo,\n            navigation: navigation,\n            repository: repository,\n            onRename: onRename\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/RenameJot/RenameJotRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nprotocol RenameJotRepositoryProtocol {\n\n    func rename(jotFileInfo: JotFile.Info, newName: String) throws -> JotFile.Info\n}\n\nstruct RenameJotRepository: RenameJotRepositoryProtocol {\n\n    private let jotFileService: JotFileServiceProtocol\n\n    init(jotFileService: JotFileServiceProtocol) {\n        self.jotFileService = jotFileService\n    }\n\n    func rename(jotFileInfo: JotFile.Info, newName: String) throws -> JotFile.Info {\n        try jotFileService.rename(\n            jotFileInfo: jotFileInfo,\n            newName: newName\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/ShareJot/ShareJotCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nenum ShareFormat: Sendable {\n    case pdf, jpg, png\n}\n\ntypealias PopoverAnchor = @MainActor @Sendable (UIPopoverPresentationController) -> Void\n\nfinal class ShareJotCoordinator: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private var retainedInfoAlertCoordinator: Coordinator?\n    private var exportTask: Task<Void, Never>?\n\n    private let jotFileInfo: JotFile.Info\n    private let format: ShareFormat\n    private let navigation: Navigation\n    private let repository: ShareJotRepositoryProtocol\n    private let configurePopoverAnchor: PopoverAnchor?\n\n    init(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        navigation: Navigation,\n        repository: ShareJotRepositoryProtocol,\n        configurePopoverAnchor: PopoverAnchor?\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.format = format\n        self.navigation = navigation\n        self.repository = repository\n        self.configurePopoverAnchor = configurePopoverAnchor\n    }\n\n    func start() {\n        exportTask = Task { [weak self] in\n            guard let self else {\n                return\n            }\n            do {\n                let fileURL = try await repository.exportJot(\n                    jotFileInfo: jotFileInfo,\n                    format: format\n                )\n                presentActivityViewController(fileURL: fileURL)\n            } catch {\n                showInfoAlert(\n                    title: L10n.Jots.Share.Error.generic(jotFileInfo.name),\n                    message: error.localizedDescription\n                )\n            }\n        }\n    }\n\n    private func presentActivityViewController(fileURL: URL) {\n        let activityViewController = UIActivityViewController(\n            activityItems: [fileURL],\n            applicationActivities: nil\n        )\n        if let popoverPresentationController = activityViewController.popoverPresentationController {\n            guard let configurePopoverAnchor else {\n                assertionFailure(\"PopoverAnchor must be provided.\")\n                onEnd?()\n                return\n            }\n            configurePopoverAnchor(popoverPresentationController)\n        }\n        activityViewController.completionWithItemsHandler = { [weak self] _, _, _, _ in\n            self?.onEnd?()\n        }\n        navigation.present(activityViewController, animated: true)\n    }\n\n    private func showInfoAlert(\n        title: String,\n        message: String?\n    ) {\n        let infoAlertCoordinator = InfoAlertCoordinator(\n            navigation: navigation,\n            title: title,\n            message: message\n        )\n        retainedInfoAlertCoordinator = infoAlertCoordinator\n        infoAlertCoordinator.onEnd = { [weak self] in\n            self?.retainedInfoAlertCoordinator = nil\n            self?.onEnd?()\n        }\n        infoAlertCoordinator.start()\n    }\n\n    deinit {\n        exportTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/ShareJot/ShareJotCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol ShareJotCoordinatorFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        navigation: Navigation,\n        configurePopoverAnchor: PopoverAnchor?\n    ) -> Coordinator\n}\n\nstruct ShareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol {\n\n    let repository: ShareJotRepositoryProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        navigation: Navigation,\n        configurePopoverAnchor: PopoverAnchor?\n    ) -> Coordinator {\n        ShareJotCoordinator(\n            jotFileInfo: jotFileInfo,\n            format: format,\n            navigation: navigation,\n            repository: repository,\n            configurePopoverAnchor: configurePopoverAnchor\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/ShareJot/ShareJotRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\nimport UIKit\n\nprotocol ShareJotRepositoryProtocol: Sendable {\n\n    func exportJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat\n    ) async throws -> URL\n}\n\nstruct ShareJotRepository: ShareJotRepositoryProtocol {\n\n    private enum Constants {\n\n        enum Rendering {\n            static let scale = CGFloat(2)\n        }\n\n        enum JpegEncoding {\n            static let compressionQuality = CGFloat(0.9)\n        }\n    }\n\n    enum Failure: Error {\n        case couldNotRenderImage\n    }\n\n    private let jotFileService: JotFileServiceProtocol\n    private let fileService: FileServiceProtocol\n\n    init(\n        jotFileService: JotFileServiceProtocol,\n        fileService: FileServiceProtocol\n    ) {\n        self.jotFileService = jotFileService\n        self.fileService = fileService\n    }\n\n    func exportJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat\n    ) async throws -> URL {\n        let jotFile = try jotFileService.readJotFile(jotFileInfo: jotFileInfo)\n        let drawing = try PKDrawing(data: jotFile.jot.drawing)\n\n        let width = jotFile.jot.width\n        let contentHeight = max(drawing.bounds.maxY, width * sqrt(2))\n        let rect = CGRect(x: 0, y: 0, width: width, height: contentHeight)\n\n        let temporaryDirectory = fileService.temporaryDirectory()\n        let fileName = jotFileInfo.name\n\n        switch format {\n        case .pdf:\n            return try await exportPDF(\n                drawing: drawing,\n                rect: rect,\n                url: temporaryDirectory.appendingPathComponent(\"\\(fileName).pdf\")\n            )\n        case .jpg:\n            return try await exportJPG(\n                drawing: drawing,\n                rect: rect,\n                url: temporaryDirectory.appendingPathComponent(\"\\(fileName).jpg\")\n            )\n        case .png:\n            return try await exportPNG(\n                drawing: drawing,\n                rect: rect,\n                url: temporaryDirectory.appendingPathComponent(\"\\(fileName).png\")\n            )\n        }\n    }\n\n    private func exportPDF(\n        drawing: PKDrawing,\n        rect: CGRect,\n        url: URL\n    ) async throws -> URL {\n        let data = await MainActor.run {\n            let renderer = UIGraphicsPDFRenderer(bounds: rect)\n            return renderer.pdfData { context in\n                context.beginPage()\n                let image = renderDrawing(drawing: drawing, rect: rect)\n                image.draw(in: rect)\n            }\n        }\n        try data.write(to: url)\n        return url\n    }\n\n    private func exportJPG(\n        drawing: PKDrawing,\n        rect: CGRect,\n        url: URL\n    ) async throws -> URL {\n        let data: Data = try await MainActor.run {\n            let renderer = UIGraphicsImageRenderer(bounds: rect)\n            let image = renderer.image { context in\n                UIColor.white.setFill()\n                context.fill(rect)\n                renderDrawing(drawing: drawing, rect: rect).draw(in: rect)\n            }\n            guard let jpegData = image.jpegData(compressionQuality: Constants.JpegEncoding.compressionQuality) else {\n                throw Failure.couldNotRenderImage\n            }\n            return jpegData\n        }\n        try data.write(to: url)\n        return url\n    }\n\n    private func exportPNG(\n        drawing: PKDrawing,\n        rect: CGRect,\n        url: URL\n    ) async throws -> URL {\n        let data: Data = try await MainActor.run {\n            let image = renderDrawing(drawing: drawing, rect: rect)\n            guard let pngData = image.pngData() else {\n                throw Failure.couldNotRenderImage\n            }\n            return pngData\n        }\n        try data.write(to: url)\n        return url\n    }\n\n    @MainActor\n    private func renderDrawing(drawing: PKDrawing, rect: CGRect) -> UIImage {\n        var image = UIImage()\n        UITraitCollection(userInterfaceStyle: .light).performAsCurrent {\n            image = drawing.image(from: rect, scale: Constants.Rendering.scale)\n        }\n        return image\n    }\n}\n"
  },
  {
    "path": "Sources/JotsPage/UIMenu+makeJotMenuConfiguration.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension UIMenu {\n\n    static func make(jotMenuConfigurations: [JotMenuConfiguration]) -> UIMenu {\n        UIMenu(\n            children: jotMenuConfigurations.map { configuration in\n                switch configuration {\n                case let .action(action):\n                    return UIAction(\n                        title: action.title,\n                        image: UIImage(systemName: action.systemImageName),\n                        attributes: action.isDestructive ? .destructive : []\n                    ) { _ in action.handler() }\n                case let .group(group):\n                    return UIMenu(\n                        title: group.title,\n                        image: UIImage(systemName: group.systemImageName),\n                        children: group.actions.map { action in\n                            UIAction(\n                                title: action.title,\n                                image: UIImage(systemName: action.systemImageName),\n                                attributes: action.isDestructive ? .destructive : []\n                            ) { _ in action.handler() }\n                        }\n                    )\n                }\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/L10n.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nenum L10n {\n\n    enum Action {\n        static let cancel = String(localized: \"action.cancel\")\n        static let create = String(localized: \"action.create\")\n        static let delete = String(localized: \"action.delete\")\n        static let done = String(localized: \"action.done\")\n        static let duplicate = String(localized: \"action.duplicate\")\n        static let ok = String(localized: \"action.ok\")\n        static let rename = String(localized: \"action.rename\")\n        static let share = String(localized: \"action.share\")\n    }\n\n    enum App {\n        static let title = String(localized: \"app.title\")\n    }\n\n    enum CloudMigration {\n        static let subtitle = String(localized: \"cloudMigration.subtitle\")\n        static let title = String(localized: \"cloudMigration.title\")\n\n        enum NothingToMigrate {\n            static let subtitle = String(localized: \"cloudMigration.nothingToMigrate.subtitle\")\n        }\n\n        enum ErrorAlert {\n\n            static func title(_ jotName: String) -> String {\n                String(format: String(localized: \"cloudMigration.errorAlert.title\"), jotName)\n            }\n        }\n    }\n\n    enum EnableCloud {\n        static let subtitle = String(localized: \"enableCloud.subtitle\")\n        static let title = String(localized: \"enableCloud.title\")\n\n        enum Action {\n            static let learnHowToEnable = String(localized: \"enableCloud.action.learnHowToEnable\")\n        }\n\n        enum Feature {\n            static let share = String(localized: \"enableCloud.feature.share\")\n            static let sync = String(localized: \"enableCloud.feature.sync\")\n        }\n    }\n\n    enum JotConflict {\n        static let deviceLabel = String(localized: \"jotConflict.deviceLabel\")\n        static let title = String(localized: \"jotConflict.title\")\n\n        enum Error {\n            static let generic = String(localized: \"jotConflict.error.generic\")\n        }\n\n        static func subtitle(_ jotName: String) -> String {\n            String(format: String(localized: \"jotConflict.subtitle\"), jotName)\n        }\n\n        static func versionName(_ version: String) -> String {\n            String(format: String(localized: \"jotConflict.versionName\"), version)\n        }\n\n        enum Action {\n            static let keepAll = String(localized: \"jotConflict.action.keepAll\")\n\n            static func keepVersion(_ version: String) -> String {\n                String(format: String(localized: \"jotConflict.action.keepVersion\"), version)\n            }\n        }\n    }\n\n    enum Jots {\n\n        enum Empty {\n            static let title = String(localized: \"jots.empty.title\")\n        }\n\n        enum Create {\n            static let namePlaceholder = String(localized: \"jots.create.namePlaceholder\")\n            static let title = String(localized: \"jots.create.title\")\n\n            enum Error {\n                static let generic = String(localized: \"jots.create.error.generic\")\n\n                static func fileExists(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.create.error.fileExists\"), jotName)\n                }\n            }\n        }\n\n        enum Delete {\n            static let message = String(localized: \"jots.delete.message\")\n            static let title = String(localized: \"jots.delete.title\")\n\n            enum Error {\n                static func generic(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.delete.error.generic\"), jotName)\n                }\n            }\n        }\n\n        enum Menu {\n            static let openInNewWindow = String(localized: \"jots.menu.openInNewWindow\")\n            static let revealInFiles = String(localized: \"jots.menu.revealInFiles\")\n            static let revealInFinder = String(localized: \"jots.menu.revealInFinder\")\n        }\n\n        enum Download {\n\n            enum Error {\n                static func generic(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.download.error.generic\"), jotName)\n                }\n            }\n        }\n\n        enum Duplicate {\n\n            enum Error {\n                static func generic(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.duplicate.error.generic\"), jotName)\n                }\n            }\n        }\n\n        enum Rename {\n            static let title = String(localized: \"jots.rename.title\")\n\n            enum Error {\n                static func generic(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.rename.error.generic\"), jotName)\n                }\n            }\n        }\n\n        enum Share {\n\n            enum Error {\n                static func generic(_ jotName: String) -> String {\n                    String(format: String(localized: \"jots.share.error.generic\"), jotName)\n                }\n            }\n        }\n    }\n\n    enum Settings {\n        static let title = String(localized: \"settings.title\")\n\n        enum Appearance {\n            static let dark = String(localized: \"settings.appearance.dark\")\n            static let light = String(localized: \"settings.appearance.light\")\n            static let system = String(localized: \"settings.appearance.system\")\n            static let title = String(localized: \"settings.appearance.title\")\n        }\n\n        enum Github {\n            static let title = String(localized: \"settings.github.title\")\n        }\n\n        enum ICloud {\n            static let info = String(localized: \"settings.icloud.info\")\n            static let title = String(localized: \"settings.icloud.title\")\n        }\n\n        enum Version {\n            static let title = String(localized: \"settings.version.title\")\n        }\n    }\n\n    enum Share {\n\n        enum Format {\n            static let jpg = String(localized: \"share.format.jpg\")\n            static let pdf = String(localized: \"share.format.pdf\")\n            static let png = String(localized: \"share.format.png\")\n        }\n    }\n\n    enum FileSystem {\n\n        enum Duplicate {\n\n            enum FileName {\n                static func plain(_ jotName: String) -> String {\n                    String(format: String(localized: \"filesystem.duplicate.filename.plain\"), jotName)\n                }\n\n                static func multi(_ jotName: String, _ duplicateCount: Int) -> String {\n                    String(format: String(localized: \"filesystem.duplicate.filename.multi\"), jotName, duplicateCount)\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/MacCatalystAppKitPluginService.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n#if targetEnvironment(macCatalyst)\n@available(macCatalyst, introduced: 15.0)\nstruct MacCatalystAppKitPluginService: Sendable {\n\n    private let bridgeKlass: AnyClass\n\n    init?(bundle: Bundle) {\n        guard\n            let url = bundle.url(forResource: \"AppKitPlugin\", withExtension: \"bundle\"),\n            let bridge = Bundle(url: url),\n            bridge.load(),\n            let bridgeKlass = NSClassFromString(\"AppKitPlugin.AppKitPlugin\")\n        else {\n            return nil\n        }\n        self.bridgeKlass = bridgeKlass\n    }\n\n    func terminate() {\n        let selector = NSSelectorFromString(\"terminate\")\n        guard (bridgeKlass as AnyObject).responds(to: selector) else {\n            return\n        }\n        _ = (bridgeKlass as AnyObject).perform(selector)\n    }\n}\n#endif\n"
  },
  {
    "path": "Sources/Navigation/Coordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol Coordinator: Sendable, AnyObject {\n\n    var onEnd: (() -> Void)? { get set }\n\n    func start()\n}\n"
  },
  {
    "path": "Sources/Navigation/Navigation.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n/// Defines navigation actions.\nstruct Navigation: Sendable {\n\n    private let openURLProvider: @Sendable (_ url: URL) -> Void\n    private let openExternalURLProvider: @Sendable (_ url: URL) -> Void\n    private let openSceneProvider: @Sendable (_ url: URL) -> Void\n    private let presentViewControllerProvider:\n        @Sendable (\n            _ viewController: UIViewController,\n            _ animated: Bool\n        ) -> Void\n    private let dismissViewControllerProvider:\n        @Sendable (_ animated: Bool, _ completion: (@Sendable () -> Void)?) -> Void\n    private let popViewControllerProvider: @Sendable (_ animated: Bool) -> Void\n    private let getViewControllersProvider: @MainActor () -> [UIViewController]\n\n    init(\n        openURLProvider: @Sendable @escaping (_ url: URL) -> Void,\n        openExternalURLProvider: @Sendable @escaping (_ url: URL) -> Void,\n        openSceneProvider: @Sendable @escaping (_ url: URL) -> Void,\n        presentViewControllerProvider:\n            @Sendable @escaping (\n                _ viewController: UIViewController,\n                _ animated: Bool\n            ) -> Void,\n        dismissViewControllerProvider:\n            @Sendable @escaping (_ animated: Bool, _ completion: (@Sendable () -> Void)?) ->\n            Void,\n        popViewControllerProvider: @Sendable @escaping (_ animated: Bool) -> Void,\n        getViewControllersProvider: @MainActor @escaping () -> [UIViewController]\n    ) {\n        self.openURLProvider = openURLProvider\n        self.openExternalURLProvider = openExternalURLProvider\n        self.openSceneProvider = openSceneProvider\n        self.presentViewControllerProvider = presentViewControllerProvider\n        self.dismissViewControllerProvider = dismissViewControllerProvider\n        self.popViewControllerProvider = popViewControllerProvider\n        self.getViewControllersProvider = getViewControllersProvider\n    }\n\n    func open(url: URL) {\n        openURLProvider(url)\n    }\n\n    func open<T: URLConvertible>(url: T) {\n        openURLProvider(url.toURL())\n    }\n\n    func openExternal(url: URL) {\n        openExternalURLProvider(url)\n    }\n\n    func openScene(url: URL) {\n        openSceneProvider(url)\n    }\n\n    func openScene<T: URLConvertible>(url: T) {\n        openSceneProvider(url.toURL())\n    }\n\n    func present(_ viewController: UIViewController, animated: Bool) {\n        presentViewControllerProvider(viewController, animated)\n    }\n\n    func dismiss(animated: Bool, completion: (@Sendable () -> Void)? = nil) {\n        dismissViewControllerProvider(animated, completion)\n    }\n\n    func popViewController(animated: Bool) {\n        popViewControllerProvider(animated)\n    }\n\n    @MainActor\n    func getViewControllers() -> [UIViewController] {\n        getViewControllersProvider()\n    }\n}\n"
  },
  {
    "path": "Sources/Navigation/NavigationCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol NavigationCoordinator: Sendable, AnyObject {\n\n    /// Whether this coordinator is capable of navigating to the given ``URL``.\n    func shouldHandle(url: URL) -> Bool\n\n    /// Performs the navigation action this coordinator provides for the given ``URL``.\n    func handle(url: URL) -> [UIViewController]\n}\n"
  },
  {
    "path": "Sources/Navigation/URLConvertible.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n/// Allows conformances to be converted to a ``URL``.\nprotocol URLConvertible: Sendable {\n\n    var scheme: String? { get }\n    var host: String? { get }\n    var path: String { get }\n    var queryItems: [URLQueryItem] { get }\n\n    func toURL() -> URL\n}\n\nextension URLConvertible {\n\n    var scheme: String? {\n        nil\n    }\n\n    var host: String? {\n        nil\n    }\n\n    var queryItems: [URLQueryItem] {\n        []\n    }\n\n    func toURL() -> URL {\n        assert(path.starts(with: \"/\"))\n        var components = URLComponents()\n        components.scheme = scheme\n        components.host = host\n        components.path = path\n        if !queryItems.isEmpty {\n            components.queryItems = queryItems\n        }\n        guard let url = components.url else {\n            preconditionFailure()\n        }\n        return url\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/Cell/PageCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol PageCell: UICollectionViewCell {\n    static var reuseIdentifier: String { get }\n\n    associatedtype ViewModel: Sendable & AnyObject\n\n    func configure(viewModel: ViewModel)\n}\n"
  },
  {
    "path": "Sources/PageViewController/Cell/PageCellAction.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nenum PageCellAction: Sendable {\n    case tap\n}\n"
  },
  {
    "path": "Sources/PageViewController/Cell/PageCellItem.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nstruct PageCellItem: Sendable, Hashable {\n\n    static func == (lhs: Self, rhs: Self) -> Bool {\n        lhs.hashValue == rhs.hashValue\n    }\n\n    let id: any Hashable & Sendable\n    let cellType: any PageCell.Type\n    let sizing: PageCellSizingStrategy\n    let configure: @Sendable @MainActor (_ cell: Any) -> Void\n    let handleAction: @Sendable @MainActor (_ action: PageCellAction) -> Void\n    let contextMenuConfiguration:\n        @Sendable @MainActor (_ point: CGPoint, _ sourceView: UIView) -> UIContextMenuConfiguration?\n\n    init<\n        Cell: PageCell,\n        ViewModel: PageCellViewModel\n    >(\n        id: some Hashable & Sendable,\n        cellType: Cell.Type,\n        sizing: PageCellSizingStrategy,\n        viewModel: @MainActor @autoclosure @escaping () -> ViewModel\n    ) where Cell.ViewModel == ViewModel {\n        self.id = id\n        self.cellType = Cell.self\n        self.sizing = sizing\n\n        var retainedViewModel: ViewModel?\n        let getViewModel: @MainActor () -> ViewModel = {\n            guard let retainedViewModel else {\n                let viewModel = viewModel()\n                retainedViewModel = viewModel\n                return viewModel\n            }\n            return retainedViewModel\n        }\n\n        configure = { cell in\n            guard let cell = cell as? Cell else {\n                assertionFailure(\"Expected '\\(Cell.self)' but received '\\(type(of: cell))'.\")\n                return\n            }\n            cell.configure(viewModel: getViewModel())\n        }\n        handleAction = { getViewModel().handle(action: $0) }\n        contextMenuConfiguration = { point, sourceView in\n            getViewModel().handleContextMenuConfiguration(point: point, sourceView: sourceView)\n        }\n    }\n\n    func hash(into hasher: inout Hasher) {\n        hasher.combine(id.hashValue)\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/Cell/PageCellSizingStrategy.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nenum PageCellSizingStrategy: Sendable, Hashable {\n    case fullWidth(\n        estimatedHeight: CGFloat = 120,\n        rowSpacing: CGFloat = DesignTokens.Spacing.xs\n    )\n    case equalSplit(\n        perRow: Int,\n        itemHeight: CGFloat,\n        columnSpacing: CGFloat = DesignTokens.Spacing.sm,\n        rowSpacing: CGFloat = DesignTokens.Spacing.sm\n    )\n    case adaptiveGrid(\n        minColumns: Int,\n        maxColumns: Int,\n        minItemWidth: CGFloat,\n        maxItemWidth: CGFloat,\n        columnSpacing: CGFloat,\n        rowSpacing: CGFloat,\n        aspectRatio: CGSize\n    )\n\n    var columnSpacing: CGFloat {\n        switch self {\n        case .fullWidth:\n            return .zero\n        case let .equalSplit(_, _, columnSpacing, _):\n            return columnSpacing\n        case let .adaptiveGrid(_, _, _, _, columnSpacing, _, _):\n            return columnSpacing\n        }\n    }\n\n    var rowSpacing: CGFloat {\n        switch self {\n        case let .fullWidth(_, rowSpacing):\n            return rowSpacing\n        case let .equalSplit(_, _, _, rowSpacing):\n            return rowSpacing\n        case let .adaptiveGrid(_, _, _, _, _, rowSpacing, _):\n            return rowSpacing\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/Cell/PageCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol PageCellViewModel: Sendable {\n\n    func handle(action: PageCellAction)\n    func handleContextMenuConfiguration(\n        point: CGPoint,\n        sourceView: UIView\n    ) -> UIContextMenuConfiguration?\n}\n\nextension PageCellViewModel {\n\n    func handleContextMenuConfiguration(\n        point: CGPoint,\n        sourceView: UIView\n    ) -> UIContextMenuConfiguration? {\n        nil\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageCallToActionView.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class PageCallToActionView: UIStackView {\n\n    private enum Constants {\n\n        static let height = CGFloat(50)\n    }\n\n    struct ActionConfiguration {\n        enum Style {\n            case primary\n            case secondary\n        }\n\n        let style: Style\n        let title: String\n        let icon: String?\n        let action: () -> Void\n    }\n\n    init(actions: [ActionConfiguration]) {\n        super.init(frame: .zero)\n        axis = .vertical\n        spacing = DesignTokens.Spacing.xs\n        for action in actions {\n            addArrangedSubview(makeButton(action: action))\n        }\n    }\n\n    @available(*, unavailable)\n    required init(coder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n\n    override func layoutSubviews() {\n        if let windowBounds = window?.bounds, windowBounds.width > windowBounds.height {\n            axis = .horizontal\n            distribution = .fillEqually\n        } else {\n            axis = .vertical\n            distribution = .fill\n        }\n        super.layoutSubviews()\n    }\n\n    private func makeButton(action: ActionConfiguration) -> UIButton {\n        var configuration = UIButton.Configuration.filled()\n        switch action.style {\n        case .primary:\n            configuration.baseBackgroundColor = .label\n            configuration.baseForegroundColor = .systemBackground\n        case .secondary:\n            configuration.baseBackgroundColor = .secondarySystemGroupedBackground\n            configuration.baseForegroundColor = .label\n        }\n        configuration.title = action.title\n        if let iconName = action.icon {\n            configuration.image = UIImage(systemName: iconName)\n            configuration.imagePlacement = .trailing\n            configuration.imagePadding = DesignTokens.Spacing.xs\n        }\n        configuration.cornerStyle = .capsule\n        configuration.titleTextAttributesTransformer = UIConfigurationTextAttributesTransformer { incoming in\n            var outgoing = incoming\n            outgoing.font = UIFont.preferredFont(forTextStyle: .body, weight: .semibold)\n            return outgoing\n        }\n        let button = UIButton(\n            configuration: configuration,\n            primaryAction: UIAction { _ in\n                action.action()\n            }\n        )\n        button.translatesAutoresizingMaskIntoConstraints = false\n        button.heightAnchor.constraint(equalToConstant: Constants.height).isActive = true\n        return button\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageHeader/PageCellItem+pageHeader.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func pageHeader(\n        headline: String,\n        subheadline: String\n    ) -> PageCellItem {\n        PageCellItem(\n            id: headline + subheadline,\n            cellType: PageHeaderCell.self,\n            sizing: .fullWidth(estimatedHeight: 100),\n            viewModel: PageHeaderCellViewModel(\n                headline: headline,\n                subheadline: subheadline\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageHeader/PageHeaderCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class PageHeaderCell: UICollectionViewCell, PageCell {\n    private struct Constants {\n\n        struct Subheadline {\n            static let maxWidth = CGFloat(300)\n        }\n    }\n\n    static let reuseIdentifier = \"PageHeaderCell\"\n\n    private let headlineLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = UIFont.preferredFont(forTextStyle: .largeTitle, weight: .bold)\n        label.textAlignment = .center\n        label.numberOfLines = 0\n        return label\n    }()\n\n    private let subheadlineLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = UIFont.preferredFont(forTextStyle: .subheadline, weight: .medium)\n        label.textAlignment = .center\n        label.numberOfLines = 0\n        return label\n    }()\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n\n    private func setUpViews() {\n        contentView.addSubview(headlineLabel)\n        contentView.addSubview(subheadlineLabel)\n\n        NSLayoutConstraint.activate([\n            headlineLabel.topAnchor.constraint(equalTo: contentView.topAnchor),\n            headlineLabel.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n            headlineLabel.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n\n            subheadlineLabel.topAnchor.constraint(\n                equalTo: headlineLabel.bottomAnchor,\n                constant: DesignTokens.Spacing.xs\n            ),\n            subheadlineLabel.leadingAnchor.constraint(\n                greaterThanOrEqualTo: contentView.layoutMarginsGuide.leadingAnchor\n            ),\n            subheadlineLabel.centerXAnchor.constraint(equalTo: contentView.centerXAnchor).withPriority(.defaultHigh),\n            subheadlineLabel.widthAnchor.constraint(lessThanOrEqualToConstant: Constants.Subheadline.maxWidth),\n            subheadlineLabel.trailingAnchor.constraint(\n                lessThanOrEqualTo: contentView.layoutMarginsGuide.trailingAnchor\n            ),\n            subheadlineLabel.bottomAnchor.constraint(equalTo: contentView.layoutMarginsGuide.bottomAnchor),\n        ])\n    }\n\n    override func preferredLayoutAttributesFitting(\n        _ layoutAttributes: UICollectionViewLayoutAttributes\n    ) -> UICollectionViewLayoutAttributes {\n        let attributes = super.preferredLayoutAttributesFitting(layoutAttributes)\n        let size = contentView.systemLayoutSizeFitting(\n            CGSize(width: attributes.frame.width, height: UIView.layoutFittingCompressedSize.height),\n            withHorizontalFittingPriority: .required,\n            verticalFittingPriority: .fittingSizeLevel\n        )\n        attributes.frame.size.height = size.height\n        return attributes\n    }\n\n    func configure(viewModel: PageHeaderCellViewModel) {\n        headlineLabel.text = viewModel.headline\n        subheadlineLabel.text = viewModel.subheadline\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageHeader/PageHeaderViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class PageHeaderCellViewModel: PageCellViewModel {\n    let headline: String\n    let subheadline: String\n\n    init(\n        headline: String,\n        subheadline: String\n    ) {\n        self.headline = headline\n        self.subheadline = subheadline\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageNavigationItem.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nenum PageNavigationItem: Sendable {\n    case text(\n        title: String,\n        onAction: @Sendable () -> Void\n    )\n    case symbol(\n        systemImageName: String,\n        onAction: @Sendable () -> Void\n    )\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageNavigationSymbolBarButtonItemFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nenum PrimaryBarButtonAction: Sendable {\n    case action(UIAction)\n    case menu(UIMenu)\n}\n\n@MainActor\nprotocol SymbolBarButtonItemFactory: Sendable {\n\n    func make(\n        symbolName: String,\n        primaryAction: PrimaryBarButtonAction\n    ) -> UIBarButtonItem\n}\n\nstruct IOS18SymbolBarButtonItemFactory: SymbolBarButtonItemFactory {\n\n    func make(\n        symbolName: String,\n        primaryAction: PrimaryBarButtonAction\n    ) -> UIBarButtonItem {\n        var configuration = UIButton.Configuration.filled()\n        configuration.image = UIImage(systemName: symbolName)?\n            .withTintColor(.systemBackground, renderingMode: .alwaysOriginal)\n        configuration.baseBackgroundColor = .label\n        configuration.baseForegroundColor = .systemBackground\n        configuration.cornerStyle = .capsule\n        configuration.buttonSize = .medium\n\n        switch primaryAction {\n        case let .action(action):\n            return UIBarButtonItem(\n                customView: UIButton(\n                    configuration: configuration,\n                    primaryAction: action\n                )\n            )\n        case let .menu(menu):\n            let button = UIButton(configuration: configuration)\n            button.menu = menu\n            button.showsMenuAsPrimaryAction = true\n            return UIBarButtonItem(customView: button)\n        }\n    }\n}\n\n@available(iOS 26, *)\nstruct IOS26SymbolBarButtonItemFactory: SymbolBarButtonItemFactory {\n\n    func make(\n        symbolName: String,\n        primaryAction: PrimaryBarButtonAction\n    ) -> UIBarButtonItem {\n        let image = UIImage(systemName: symbolName)\n        return switch primaryAction {\n        case let .action(action):\n            UIBarButtonItem(image: image, primaryAction: action)\n        case let .menu(menu):\n            UIBarButtonItem(image: image, menu: menu)\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageNavigationTextBarButtonItemFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol TextBarButtonItemFactory: Sendable {\n\n    func make(\n        title: String,\n        primaryAction: UIAction\n    ) -> UIBarButtonItem\n}\n\nstruct IOS18TextBarButtonItemFactory: TextBarButtonItemFactory {\n\n    func make(\n        title: String,\n        primaryAction: UIAction\n    ) -> UIBarButtonItem {\n        var configuration = UIButton.Configuration.filled()\n        configuration.title = title\n        configuration.baseBackgroundColor = .label\n        configuration.baseForegroundColor = .systemBackground\n        configuration.cornerStyle = .capsule\n        configuration.buttonSize = .medium\n        return UIBarButtonItem(\n            customView: UIButton(\n                configuration: configuration,\n                primaryAction: primaryAction\n            )\n        )\n    }\n}\n\n@available(iOS 26, *)\nstruct IOS26TextBarButtonItemFactory: TextBarButtonItemFactory {\n\n    func make(\n        title: String,\n        primaryAction: UIAction\n    ) -> UIBarButtonItem {\n        UIBarButtonItem(\n            title: title,\n            primaryAction: primaryAction\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageViewController.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class PageViewController: UIViewController {\n\n    private lazy var collectionViewLayout: UICollectionViewCompositionalLayout = {\n        let configuration = UICollectionViewCompositionalLayoutConfiguration()\n        return UICollectionViewCompositionalLayout(\n            sectionProvider: { [weak self] _, environment in\n                guard let self else {\n                    return self?.makeDefaultLayoutSection()\n                }\n                return makeLayoutSection(\n                    items: self.dataSource.snapshot().itemIdentifiers,\n                    contentWidth: environment.container.effectiveContentSize.width\n                )\n            },\n            configuration: configuration\n        )\n    }()\n\n    private lazy var dataSource: UICollectionViewDiffableDataSource<Int, PageCellItem> = {\n        UICollectionViewDiffableDataSource(\n            collectionView: collectionView\n        ) { [weak self] collectionView, indexPath, item in\n            self?.registerIfNeeded(item.cellType)\n\n            let cell = collectionView.dequeueReusableCell(\n                withReuseIdentifier: item.cellType.reuseIdentifier,\n                for: indexPath\n            )\n            item.configure(cell)\n            return cell\n        }\n    }()\n\n    private lazy var collectionView: UICollectionView = {\n        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout)\n        collectionView.translatesAutoresizingMaskIntoConstraints = false\n        collectionView.backgroundColor = .systemGroupedBackground\n        collectionView.preservesSuperviewLayoutMargins = true\n        collectionView.contentInset.bottom = DesignTokens.Spacing.md\n        collectionView.delegate = self\n        return collectionView\n    }()\n\n    private lazy var callToActionView: PageCallToActionView = {\n        let view = PageCallToActionView(actions: viewModel.actions)\n        view.translatesAutoresizingMaskIntoConstraints = false\n        return view\n    }()\n\n    private lazy var withCallToActionViewConstraints = [\n        collectionView.bottomAnchor.constraint(equalTo: callToActionView.topAnchor),\n\n        callToActionView.leadingAnchor.constraint(equalTo: view.layoutMarginsGuide.leadingAnchor),\n        callToActionView.trailingAnchor.constraint(equalTo: view.layoutMarginsGuide.trailingAnchor),\n        callToActionView.bottomAnchor.constraint(equalTo: view.layoutMarginsGuide.bottomAnchor),\n    ]\n\n    private lazy var withoutCallToActionViewConstraints = [\n        collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor)\n    ]\n\n    private var registeredReuseIdentifiers = Set<String>()\n\n    private var leftNavigationItemsTask: Task<Void, Never>?\n    private var rightNavigationItemsTask: Task<Void, Never>?\n    private var itemsTask: Task<Void, Never>?\n\n    private let viewModel: PageViewModel\n    private let textBarButtonItemFactory: TextBarButtonItemFactory\n    private let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    init(\n        viewModel: PageViewModel,\n        textBarButtonItemFactory: TextBarButtonItemFactory,\n        symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n    ) {\n        self.viewModel = viewModel\n        self.textBarButtonItemFactory = textBarButtonItemFactory\n        self.symbolBarButtonItemFactory = symbolBarButtonItemFactory\n        super.init(nibName: nil, bundle: nil)\n\n        itemsTask = Task { [weak self] in\n            for await items in viewModel.items {\n                self?.handleItems(items)\n            }\n        }\n\n        leftNavigationItemsTask = Task { [weak self] in\n            for await navigationItems in viewModel.leftNavigationItems {\n                self?.handleLeftNavigationItems(navigationItems: navigationItems)\n            }\n        }\n\n        rightNavigationItemsTask = Task { [weak self] in\n            for await navigationItems in viewModel.rightNavigationItems {\n                self?.handleRightNavigationItems(navigationItems: navigationItems)\n            }\n        }\n\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n\n    deinit {\n        itemsTask?.cancel()\n        leftNavigationItemsTask?.cancel()\n        rightNavigationItemsTask?.cancel()\n    }\n\n    private func setUpViews() {\n        navigationItem.title = viewModel.title\n        view.backgroundColor = .systemGroupedBackground\n        view.directionalLayoutMargins.bottom = DesignTokens.Spacing.md\n        navigationItem.largeTitleDisplayMode = .never\n\n        view.addSubview(collectionView)\n\n        var constraints = [\n            collectionView.topAnchor.constraint(equalTo: view.topAnchor),\n            collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),\n            collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor),\n        ]\n\n        if viewModel.actions.isEmpty {\n            constraints.append(contentsOf: withoutCallToActionViewConstraints)\n        } else {\n            view.addSubview(callToActionView)\n            constraints.append(contentsOf: withCallToActionViewConstraints)\n        }\n\n        NSLayoutConstraint.activate(constraints)\n    }\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        viewModel.didLoad()\n    }\n\n    private func registerIfNeeded(_ cellType: any PageCell.Type) {\n        let identifier = cellType.reuseIdentifier\n        guard !registeredReuseIdentifiers.contains(identifier) else {\n            return\n        }\n        collectionView.register(cellType, forCellWithReuseIdentifier: identifier)\n        registeredReuseIdentifiers.insert(identifier)\n    }\n\n    private func handleItems(_ items: [PageCellItem]) {\n        var snapshot = NSDiffableDataSourceSnapshot<Int, PageCellItem>()\n        snapshot.appendSections([0])\n        snapshot.appendItems(items)\n        dataSource.apply(snapshot, animatingDifferences: true)\n        collectionViewLayout.invalidateLayout()\n    }\n\n    private func handleRightNavigationItems(navigationItems: [PageNavigationItem]) {\n        if let firstNavigationItem = navigationItems.first, navigationItems.count == 1 {\n            navigationItem.setRightBarButton(\n                makeNavigationItem(navigationItem: firstNavigationItem),\n                animated: true\n            )\n        } else {\n            navigationItem.setRightBarButtonItems(\n                navigationItems.map(makeNavigationItem),\n                animated: true\n            )\n        }\n    }\n\n    private func handleLeftNavigationItems(navigationItems: [PageNavigationItem]) {\n        if let firstNavigationItem = navigationItems.first, navigationItems.count == 1 {\n            navigationItem.setLeftBarButton(\n                makeNavigationItem(navigationItem: firstNavigationItem),\n                animated: true\n            )\n        } else {\n            navigationItem.setLeftBarButtonItems(\n                navigationItems.map(makeNavigationItem),\n                animated: true\n            )\n        }\n    }\n\n    private func makeNavigationItem(navigationItem: PageNavigationItem) -> UIBarButtonItem {\n        switch navigationItem {\n        case let .text(title, onAction):\n            textBarButtonItemFactory.make(\n                title: title,\n                primaryAction: UIAction { _ in\n                    onAction()\n                }\n            )\n        case let .symbol(symbolName, onAction):\n            symbolBarButtonItemFactory.make(\n                symbolName: symbolName,\n                primaryAction: .action(\n                    UIAction { _ in\n                        onAction()\n                    }\n                )\n            )\n        }\n    }\n\n    private func makeDefaultLayoutSection() -> NSCollectionLayoutSection {\n        let (group, _) = makeFullWidthRowLayoutGroup(estimatedHeight: 120)\n        let section = NSCollectionLayoutSection(group: group)\n        section.contentInsetsReference = .layoutMargins\n        return section\n    }\n\n    private func makeLayoutSection(\n        items: [PageCellItem],\n        contentWidth: CGFloat\n    ) -> NSCollectionLayoutSection {\n        let rowGroups = makeRowLayoutGroups(\n            items: items,\n            contentWidth: contentWidth\n        )\n        guard !rowGroups.isEmpty else {\n            return makeDefaultLayoutSection()\n        }\n\n        let group = NSCollectionLayoutGroup.vertical(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0),\n                heightDimension: .estimated(1000)\n            ),\n            subitems: rowGroups\n        )\n        group.interItemSpacing = .fixed(items.first?.sizing.rowSpacing ?? DesignTokens.Spacing.md)\n\n        let section = NSCollectionLayoutSection(group: group)\n        section.contentInsetsReference = .layoutMargins\n        return section\n    }\n\n    private func makeRowLayoutGroups(\n        items: [PageCellItem],\n        contentWidth: CGFloat\n    ) -> [NSCollectionLayoutGroup] {\n        var groups: [NSCollectionLayoutGroup] = []\n        var i = 0\n        while i < items.count {\n            let (group, consumed) = makeRowLayoutGroup(\n                sizing: items[i].sizing,\n                contentWidth: contentWidth\n            )\n            groups.append(group)\n            i += min(consumed, items.count - i)\n        }\n        return groups\n    }\n\n    private func makeRowLayoutGroup(\n        sizing: PageCellSizingStrategy,\n        contentWidth: CGFloat\n    ) -> (NSCollectionLayoutGroup, Int) {\n        switch sizing {\n        case let .fullWidth(estimatedHeight, _):\n            makeFullWidthRowLayoutGroup(\n                estimatedHeight: estimatedHeight\n            )\n        case let .equalSplit(perRow, height, columnSpacing, _):\n            makeEqualSplitRowLayoutGroup(\n                perRow: perRow,\n                height: height,\n                columnSpacing: columnSpacing\n            )\n        case let .adaptiveGrid(minColumns, maxColumns, minItemWidth, maxItemWidth, columnSpacing, _, aspectRatio):\n            makeAdaptiveGridRowLayoutGroup(\n                minColumns: minColumns,\n                maxColumns: maxColumns,\n                minItemWidth: minItemWidth,\n                maxItemWidth: maxItemWidth,\n                columnSpacing: columnSpacing,\n                aspectRatio: aspectRatio,\n                contentWidth: contentWidth\n            )\n        }\n    }\n\n    private func makeFullWidthRowLayoutGroup(\n        estimatedHeight: CGFloat\n    ) -> (NSCollectionLayoutGroup, Int) {\n        let item = NSCollectionLayoutItem(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0),\n                heightDimension: .estimated(estimatedHeight)\n            )\n        )\n        let group = NSCollectionLayoutGroup.horizontal(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0),\n                heightDimension: .estimated(estimatedHeight)\n            ),\n            subitems: [item]\n        )\n        return (group, 1)\n    }\n\n    private func makeEqualSplitRowLayoutGroup(\n        perRow: Int,\n        height: CGFloat,\n        columnSpacing: CGFloat\n    ) -> (NSCollectionLayoutGroup, Int) {\n        let item = NSCollectionLayoutItem(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0 / CGFloat(perRow)),\n                heightDimension: .absolute(height)\n            )\n        )\n        let group = NSCollectionLayoutGroup.horizontal(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0),\n                heightDimension: .absolute(height)\n            ),\n            subitem: item,\n            count: perRow\n        )\n        group.interItemSpacing = .fixed(columnSpacing)\n        return (group, perRow)\n    }\n\n    private func makeAdaptiveGridRowLayoutGroup(\n        minColumns: Int,\n        maxColumns: Int,\n        minItemWidth: CGFloat,\n        maxItemWidth: CGFloat,\n        columnSpacing: CGFloat,\n        aspectRatio: CGSize,\n        contentWidth: CGFloat\n    ) -> (NSCollectionLayoutGroup, Int) {\n        let columnsNeeded = Int(ceil((contentWidth + columnSpacing) / (maxItemWidth + columnSpacing)))\n        let columnsAllowed = Int((contentWidth + columnSpacing) / (minItemWidth + columnSpacing))\n        let columns = max(minColumns, min(maxColumns, min(columnsAllowed, max(columnsNeeded, minColumns))))\n        let itemWidth = (contentWidth - columnSpacing * CGFloat(columns - 1)) / CGFloat(columns)\n        let itemHeight = itemWidth * aspectRatio.height / aspectRatio.width\n\n        let item = NSCollectionLayoutItem(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0 / CGFloat(columns)),\n                heightDimension: .absolute(itemHeight)\n            )\n        )\n        let group = NSCollectionLayoutGroup.horizontal(\n            layoutSize: .init(\n                widthDimension: .fractionalWidth(1.0),\n                heightDimension: .absolute(itemHeight)\n            ),\n            subitem: item,\n            count: columns\n        )\n        group.interItemSpacing = .fixed(columnSpacing)\n        return (group, columns)\n    }\n}\n\nextension PageViewController: UICollectionViewDelegate {\n\n    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {\n        dataSource.itemIdentifier(for: indexPath)?.handleAction(.tap)\n    }\n\n    func collectionView(\n        _ collectionView: UICollectionView,\n        contextMenuConfigurationForItemAt indexPath: IndexPath,\n        point: CGPoint\n    ) -> UIContextMenuConfiguration? {\n        guard let cell = collectionView.cellForItem(at: indexPath) else {\n            return nil\n        }\n        let cellPoint = collectionView.convert(point, to: cell)\n        return dataSource.itemIdentifier(for: indexPath)?.contextMenuConfiguration(cellPoint, cell)\n    }\n}\n"
  },
  {
    "path": "Sources/PageViewController/PageViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol PageViewModel: AnyObject {\n    var title: String? { get }\n    var leftNavigationItems: AsyncStream<[PageNavigationItem]> { get }\n    var rightNavigationItems: AsyncStream<[PageNavigationItem]> { get }\n\n    var items: AsyncStream<[PageCellItem]> { get }\n    var actions: [PageCallToActionView.ActionConfiguration] { get }\n\n    func didLoad()\n}\n\nextension PageViewModel {\n\n    var title: String? {\n        nil\n    }\n\n    var actions: [PageCallToActionView.ActionConfiguration] {\n        []\n    }\n\n    var leftNavigationItems: AsyncStream<[PageNavigationItem]> {\n        AsyncStream { continuation in\n            continuation.finish()\n        }\n    }\n\n    var rightNavigationItems: AsyncStream<[PageNavigationItem]> {\n        AsyncStream { continuation in\n            continuation.finish()\n        }\n    }\n\n    func didLoad() {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/RevealFile/RevealFileCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class RevealFileCoordinator: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private let jotFileInfo: JotFile.Info\n    private let applicationService: ApplicationServiceProtocol\n\n    init(\n        jotFileInfo: JotFile.Info,\n        applicationService: ApplicationServiceProtocol\n    ) {\n        self.jotFileInfo = jotFileInfo\n        self.applicationService = applicationService\n    }\n\n    func start() {\n        defer {\n            onEnd?()\n        }\n\n        #if targetEnvironment(macCatalyst)\n        guard\n            let nsWorkspaceClass = NSClassFromString(\"NSWorkspace\"),\n            let workspace = nsWorkspaceClass.value(forKeyPath: \"sharedWorkspace\") as? NSObject\n        else {\n            return\n        }\n\n        workspace.perform(\n            NSSelectorFromString(\"selectFile:inFileViewerRootedAtPath:\"),\n            with: jotFileInfo.url.path,\n            with: \"\"\n        )\n        #else\n        let revealFileURL = RevealFileURL(jotFileInfo: jotFileInfo)\n        applicationService.open(url: revealFileURL.toURL())\n        #endif\n    }\n}\n"
  },
  {
    "path": "Sources/RevealFile/RevealFileCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol RevealFileCoordinatorFactoryProtocol: Sendable {\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation\n    ) -> Coordinator\n}\n\nstruct RevealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol {\n\n    let applicationService: ApplicationServiceProtocol\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation\n    ) -> Coordinator {\n        RevealFileCoordinator(\n            jotFileInfo: jotFileInfo,\n            applicationService: applicationService\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/RevealFile/RevealFileURL.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct RevealFileURL: URLConvertible {\n    let scheme: String? = \"shareddocuments\"\n    let host: String? = \"\"\n    let path: String\n\n    init(jotFileInfo: JotFile.Info) {\n        path = jotFileInfo.url.path\n    }\n}\n"
  },
  {
    "path": "Sources/RootCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class RootCoordinator: NavigationCoordinator {\n\n    private lazy var jotsCoordinator = jotsCoordinatorFactory.make(navigation: navigation)\n\n    private let navigation: Navigation\n    private let jotsCoordinatorFactory: JotsCoordinatorFactoryProtocol\n\n    init(\n        navigation: Navigation,\n        jotsCoordinatorFactory: JotsCoordinatorFactoryProtocol\n    ) {\n        self.navigation = navigation\n        self.jotsCoordinatorFactory = jotsCoordinatorFactory\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        true\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        var viewControllers = [UIViewController]()\n        viewControllers.append(contentsOf: jotsCoordinator.handle(url: url))\n        return viewControllers\n    }\n}\n"
  },
  {
    "path": "Sources/RootCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol RootCoordinatorFactoryProtocol {\n\n    func make(navigation: Navigation) -> NavigationCoordinator\n}\n\nstruct RootCoordinatorFactory: RootCoordinatorFactoryProtocol {\n\n    let jotsCoordinatorFactory: JotsCoordinatorFactoryProtocol\n\n    func make(navigation: Navigation) -> NavigationCoordinator {\n        RootCoordinator(\n            navigation: navigation,\n            jotsCoordinatorFactory: jotsCoordinatorFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SceneCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nfinal class SceneCoordinator {\n\n    enum Constants {\n        static let activityType = \"com.antonlorani.jottre.openJot\"\n        static let urlKey = \"url\"\n        static let fileBookmarkKey = \"fileBookmark\"\n    }\n\n    private var lastActiveURL: URL?\n    private var navigationController: UINavigationController?\n    private var retainedRootCoordinator: NavigationCoordinator?\n    private var userInterfaceStyleTask: Task<Void, Never>?\n    #if targetEnvironment(macCatalyst)\n    private var securityScopedURL: URL?\n    #endif\n\n    private let navigation: Navigation\n    private let defaultsService: DefaultsServiceProtocol\n    private let applicationService: ApplicationServiceProtocol\n    private let localFileService: FileServiceProtocol\n    private let ubiquitousFileService: FileServiceProtocol\n    private let logger: LoggerProtocol\n    private let rootCoordinatorFactory: RootCoordinatorFactoryProtocol\n    private let editJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol\n    private let onUpdateUserInterfaceStyle: @Sendable (_ userInterfaceStyle: UIUserInterfaceStyle) -> Void\n    private let requestSceneSessionActivationProvider: @Sendable (_ url: URL) -> Void\n\n    init(\n        navigation: Navigation,\n        defaultsService: DefaultsServiceProtocol,\n        applicationService: ApplicationServiceProtocol,\n        localFileService: FileServiceProtocol,\n        ubiquitousFileService: FileServiceProtocol,\n        logger: LoggerProtocol,\n        rootCoordinatorFactory: RootCoordinatorFactoryProtocol,\n        editJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol,\n        onUpdateUserInterfaceStyle: @Sendable @escaping (_ userInterfaceStyle: UIUserInterfaceStyle) -> Void,\n        requestSceneSessionActivationProvider: @Sendable @escaping (_ url: URL) -> Void\n    ) {\n        self.navigation = navigation\n        self.defaultsService = defaultsService\n        self.applicationService = applicationService\n        self.localFileService = localFileService\n        self.ubiquitousFileService = ubiquitousFileService\n        self.logger = logger\n        self.rootCoordinatorFactory = rootCoordinatorFactory\n        self.editJotCoordinatorFactory = editJotCoordinatorFactory\n        self.onUpdateUserInterfaceStyle = onUpdateUserInterfaceStyle\n        self.requestSceneSessionActivationProvider = requestSceneSessionActivationProvider\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        lastActiveURL = url\n        return retainedRootCoordinator?.handle(url: url) ?? []\n    }\n\n    func handle(\n        session: UISceneSession,\n        connectionOptions: UIScene.ConnectionOptions\n    ) -> [UIViewController] {\n        let url: URL\n        let coordinator: NavigationCoordinator\n\n        if let (activityURL, isRestored) = getActivityURL(session: session, connectionOptions: connectionOptions) {\n            lazy var editJotCoordinator = editJotCoordinatorFactory.make(navigation: navigation)\n            lazy var rootCoordinator = rootCoordinatorFactory.make(navigation: navigation)\n\n            let preferredCoordinator: NavigationCoordinator\n            if isEditJotURL(url: activityURL) {\n                preferredCoordinator = editJotCoordinator\n                url = activityURL\n            } else if let editJotURL = makeEditJotURL(fileURL: activityURL) {\n                preferredCoordinator = editJotCoordinator\n                url = editJotURL\n            } else {\n                preferredCoordinator = rootCoordinator\n                url = activityURL\n            }\n\n            if isRestored {\n                #if targetEnvironment(macCatalyst)\n                coordinator = preferredCoordinator\n                #else\n                // On iPadOS its more tedious for users to create a new fresh window. Therefore we prefer\n                // restoring a scene that allows navigating back to a jots overview (When the activityURL\n                // opens a nested hierarchy).\n                coordinator = rootCoordinator\n                #endif\n            } else {\n                if applicationService.supportsMultipleScenes() {\n                    coordinator = preferredCoordinator\n                } else {\n                    coordinator = rootCoordinator\n                }\n            }\n        } else {\n            url = JotsPageURL().toURL()\n            coordinator = rootCoordinatorFactory.make(navigation: navigation)\n        }\n\n        lastActiveURL = url\n        retainedRootCoordinator = coordinator\n\n        userInterfaceStyleTask?.cancel()\n        userInterfaceStyleTask = Task {\n            for await userInterfaceStyle in defaultsService.getValueStream(.userInterfaceStyle) {\n                let userInterfaceStyle =\n                    userInterfaceStyle\n                    .flatMap(UIUserInterfaceStyle.init(rawValue:)) ?? .unspecified\n                onUpdateUserInterfaceStyle(userInterfaceStyle)\n            }\n        }\n\n        Task { [weak self] in\n            guard let self else {\n                return\n            }\n            do {\n                try await localFileService.initializeDocumentsDirectory()\n                try await ubiquitousFileService.initializeDocumentsDirectory()\n                logger.info(\"Initialized documents directories.\")\n            } catch {\n                logger.error(\"Failed to initialize documents directory: \\(error)\")\n            }\n        }\n\n        return coordinator.handle(url: url)\n    }\n\n    func handleURLContexts(\n        urlContexts: Set<UIOpenURLContext>\n    ) {\n        guard let incomingURL = urlContexts.first?.url else {\n            return\n        }\n        guard incomingURL.pathExtension == JotFile.Info.fileExtension else {\n            navigation.open(url: incomingURL)\n            return\n        }\n        openScene(url: incomingURL)\n    }\n\n    func openScene(url: URL) {\n        if applicationService.supportsMultipleScenes() {\n            requestSceneSessionActivationProvider(url)\n        } else {\n            navigation.open(url: url)\n        }\n    }\n\n    func handlePop() {\n        lastActiveURL = nil\n    }\n\n    func makeStateRestorationActivity() -> NSUserActivity? {\n        guard\n            let lastActiveURL,\n            applicationService.supportsMultipleScenes()\n        else {\n            return nil\n        }\n        let activity = NSUserActivity(activityType: Constants.activityType)\n        activity.userInfo = makeUserInfo(lastActiveURL: lastActiveURL)\n        return activity\n    }\n\n    private func makeUserInfo(lastActiveURL: URL) -> [AnyHashable: Any] {\n        var userInfo: [AnyHashable: Any] = [Constants.urlKey: lastActiveURL.absoluteString]\n        guard let fileURL = EditJotURL(url: lastActiveURL)?.fileURL else {\n            return userInfo\n        }\n        #if targetEnvironment(macCatalyst)\n        let bookmarkOptions = URL.BookmarkCreationOptions.withSecurityScope\n        #else\n        let bookmarkOptions = URL.BookmarkCreationOptions()\n        #endif\n\n        if let bookmark = try? fileURL.bookmarkData(options: bookmarkOptions) {\n            userInfo[Constants.fileBookmarkKey] = bookmark\n        }\n        return userInfo\n    }\n\n    private func getActivityURL(\n        session: UISceneSession,\n        connectionOptions: UIScene.ConnectionOptions\n    ) -> (url: URL, isRestored: Bool)? {\n        if let activity = session.stateRestorationActivity,\n            let url = getURL(activity: activity)\n        {\n            return (url: url, isRestored: true)\n        }\n\n        if let activity = connectionOptions.userActivities.first(where: { $0.activityType == Constants.activityType }),\n            let url = getURL(activity: activity)\n        {\n            return (url: url, isRestored: false)\n        }\n\n        if let firstURLContextURL = connectionOptions.urlContexts.first?.url {\n            return (url: firstURLContextURL, isRestored: false)\n        }\n\n        return nil\n    }\n\n    private func getURL(activity: NSUserActivity) -> URL? {\n        guard\n            activity.activityType == Constants.activityType,\n            let urlString = activity.userInfo?[Constants.urlKey] as? String,\n            let url = URL(string: urlString)\n        else {\n            return nil\n        }\n\n        guard\n            let bookmark = activity.userInfo?[Constants.fileBookmarkKey] as? Data\n        else {\n            return url\n        }\n\n        var isStale = false\n\n        #if targetEnvironment(macCatalyst)\n        let bookmarkOptions = URL.BookmarkResolutionOptions.withSecurityScope\n        #else\n        let bookmarkOptions = URL.BookmarkResolutionOptions()\n        #endif\n\n        guard\n            let resolved = try? URL(\n                resolvingBookmarkData: bookmark,\n                options: bookmarkOptions,\n                bookmarkDataIsStale: &isStale\n            ),\n            EditJotURL(url: url) != nil,\n            let rebuilt = makeEditJotURL(fileURL: resolved)\n        else {\n            return url\n        }\n\n        #if targetEnvironment(macCatalyst)\n        if resolved.startAccessingSecurityScopedResource() {\n            securityScopedURL?.stopAccessingSecurityScopedResource()\n            securityScopedURL = resolved\n        }\n        #endif\n\n        return rebuilt\n    }\n\n    private func isEditJotURL(url: URL) -> Bool {\n        EditJotURL(url: url) != nil\n    }\n\n    private func makeEditJotURL(fileURL: URL) -> URL? {\n        guard\n            let jotFileInfo = JotFile.Info(\n                url: fileURL,\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        else {\n            return nil\n        }\n        return EditJotURL(jotFileInfo: jotFileInfo).toURL()\n    }\n\n    deinit {\n        #if targetEnvironment(macCatalyst)\n        securityScopedURL?.stopAccessingSecurityScopedResource()\n        #endif\n        userInterfaceStyleTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/SceneDelegate.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class SceneDelegate: UIResponder, UIWindowSceneDelegate {\n\n    private static let defaultsService = DefaultsService(userDefaults: .standard)\n\n    #if targetEnvironment(macCatalyst)\n    private lazy var appKitPluginService = MacCatalystAppKitPluginService(bundle: .main)\n    #endif\n\n    var window: UIWindow?\n\n    private var sceneCoordinator: SceneCoordinator?\n\n    func scene(\n        _ scene: UIScene,\n        willConnectTo session: UISceneSession,\n        options connectionOptions: UIScene.ConnectionOptions\n    ) {\n        guard let windowScene = scene as? UIWindowScene else {\n            return\n        }\n\n        #if targetEnvironment(macCatalyst)\n        windowScene.title = L10n.App.title\n        #endif\n\n        let fileManager = FileManager.default\n        let localFileService = LocalFileService(\n            fileManager: fileManager\n        )\n        let ubiquitousFileService = UbiquitousFileService(\n            fileManager: fileManager,\n            localFileService: localFileService\n        )\n        let fileConflictService = FileConflictService(\n            fileManager: fileManager\n        )\n        let bundleService = BundleService(\n            bundle: .main\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileService,\n            ubiquitousFileService: ubiquitousFileService\n        )\n        let jotFileConflictService = JotFileConflictService(\n            fileConflictService: fileConflictService\n        )\n        let jotFilePreviewImageService = CachedJotFilePreviewImageService(\n            localFileService: localFileService,\n            jotFilePreviewImageService: JotFilePreviewImageService(\n                jotFileService: jotFileService\n            )\n        )\n        let applicationService = ApplicationService(\n            application: .shared\n        )\n        let deviceService = DeviceService(\n            device: .current\n        )\n\n        let textBarButtonItemFactory: TextBarButtonItemFactory\n        let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n        if #available(iOS 26, *) {\n            textBarButtonItemFactory = IOS26TextBarButtonItemFactory()\n            symbolBarButtonItemFactory = IOS26SymbolBarButtonItemFactory()\n        } else {\n            textBarButtonItemFactory = IOS18TextBarButtonItemFactory()\n            symbolBarButtonItemFactory = IOS18SymbolBarButtonItemFactory()\n        }\n\n        let menuConfigurationFactory = JotMenuConfigurationFactory()\n\n        let deleteJotCoordinatorFactory = DeleteJotCoordinatorFactory(\n            repository: DeleteJotRepository(\n                jotFileService: jotFileService\n            )\n        )\n\n        let shareJotCoordinatorFactory = ShareJotCoordinatorFactory(\n            repository: ShareJotRepository(\n                jotFileService: jotFileService,\n                fileService: localFileService\n            )\n        )\n\n        let revealFileCoordinatorFactory = RevealFileCoordinatorFactory(\n            applicationService: applicationService\n        )\n\n        let editJotRepository = EditJotRepository(\n            ubiquitousFileService: ubiquitousFileService,\n            jotFileService: jotFileService,\n            jotFileConflictService: jotFileConflictService\n        )\n\n        let editJotCoordinatorFactory = EditJotCoordinatorFactory(\n            repository: editJotRepository,\n            editJotViewControllerFactory: EditJotViewControllerFactory(\n                repository: editJotRepository,\n                menuConfigurationFactory: menuConfigurationFactory,\n                symbolBarButtonItemFactory: symbolBarButtonItemFactory,\n                logger: OSLogLogger(category: \"EditJotViewModel\")\n            ),\n            jotConflictCoordinatorFactory: JotConflictCoordinatorFactory(\n                jotConflictViewControllerFactory: JotConflictViewControllerFactory(\n                    textBarButtonItemFactory: textBarButtonItemFactory,\n                    symbolBarButtonItemFactory: symbolBarButtonItemFactory\n                ),\n                repository: JotConflictRepository(\n                    jotFileConflictService: jotFileConflictService,\n                    jotFilePreviewImageService: jotFilePreviewImageService,\n                    logger: OSLogLogger(category: \"JotConflictRepository\")\n                )\n            ),\n            renameJotCoordinatorFactory: RenameJotCoordinatorFactory(\n                repository: RenameJotRepository(\n                    jotFileService: jotFileService\n                )\n            ),\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n\n        let jotsCoordinatorFactory: JotsCoordinatorFactoryProtocol = JotsCoordinatorFactory(\n            jotsViewControllerFactory: JotsViewControllerFactory(\n                repository: JotsRepository(\n                    ubiquitousFileService: ubiquitousFileService,\n                    applicationService: applicationService,\n                    deviceService: deviceService,\n                    jotFileService: jotFileService,\n                    jotFilePreviewImageService: jotFilePreviewImageService\n                ),\n                menuConfigurationFactory: menuConfigurationFactory,\n                textBarButtonItemFactory: textBarButtonItemFactory,\n                symbolBarButtonItemFactory: symbolBarButtonItemFactory,\n                logger: OSLogLogger(category: \"JotsViewModel\")\n            ),\n            settingsCoordinatorFactory: SettingsCoordinatorFactory(\n                settingsViewControllerFactory: SettingsViewControllerFactory(\n                    repository: SettingsRepository(\n                        ubiquitousFileService: ubiquitousFileService,\n                        bundleService: bundleService,\n                        defaultsService: Self.defaultsService\n                    ),\n                    textBarButtonItemFactory: textBarButtonItemFactory,\n                    symbolBarButtonItemFactory: symbolBarButtonItemFactory\n                )\n            ),\n            enableCloudCoordinatorFactory: EnableCloudCoordinatorFactory(\n                enableCloudViewControllerFactory: EnableCloudViewControllerFactory(\n                    textBarButtonItemFactory: textBarButtonItemFactory,\n                    symbolBarButtonItemFactory: symbolBarButtonItemFactory\n                )\n            ),\n            editJotCoordinatorFactory: editJotCoordinatorFactory,\n            cloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactory(\n                repository: CloudMigrationRepository(\n                    ubiquitousFileService: ubiquitousFileService,\n                    jotFileService: jotFileService,\n                    jotFilePreviewImageService: jotFilePreviewImageService,\n                    defaultsService: Self.defaultsService\n                ),\n                cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactory(\n                    textBarButtonItemFactory: textBarButtonItemFactory,\n                    symbolBarButtonItemFactory: symbolBarButtonItemFactory\n                ),\n                logger: OSLogLogger(category: \"CloudMigrationViewModel\")\n            ),\n            createJotCoordinatorFactory: CreateJotCoordinatorFactory(\n                repository: CreateJotRepository(\n                    localFileService: localFileService,\n                    ubiquitousFileService: ubiquitousFileService,\n                    jotFileService: jotFileService\n                )\n            ),\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            renameJotCoordinatorFactory: RenameJotCoordinatorFactory(\n                repository: RenameJotRepository(\n                    jotFileService: jotFileService\n                )\n            ),\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n\n        let rootCoordinatorFactory = RootCoordinatorFactory(\n            jotsCoordinatorFactory: jotsCoordinatorFactory\n        )\n\n        let navigationController = makeNavigationController()\n\n        let navigation = Navigation(\n            openURLProvider: { [weak self, weak navigationController] url in\n                Task { @MainActor in\n                    guard let viewControllers = self?.sceneCoordinator?.handle(url: url) else {\n                        return\n                    }\n                    navigationController?.setViewControllers(viewControllers, animated: true)\n                }\n            },\n            openExternalURLProvider: { url in\n                Task { @MainActor in\n                    guard applicationService.canOpen(url: url) else {\n                        return\n                    }\n                    applicationService.open(url: url)\n                }\n            },\n            openSceneProvider: { [weak self] url in\n                Task { @MainActor in\n                    self?.sceneCoordinator?.openScene(url: url)\n                }\n            },\n            presentViewControllerProvider: { [weak navigationController] viewController, animated in\n                Task { @MainActor in\n                    navigationController?.present(viewController, animated: animated)\n                }\n            },\n            dismissViewControllerProvider: { [weak navigationController] animated, completion in\n                Task { @MainActor in\n                    navigationController?.dismiss(animated: animated, completion: completion)\n                }\n            },\n            popViewControllerProvider: { [weak self, weak navigationController] animated in\n                Task { @MainActor in\n                    navigationController?.popViewController(animated: animated)\n                    self?.sceneCoordinator?.handlePop()\n                }\n            },\n            getViewControllersProvider: { [weak navigationController] in\n                navigationController?.viewControllers ?? []\n            }\n        )\n\n        let window = UIWindow(windowScene: windowScene)\n        window.rootViewController = navigationController\n        self.window = window\n\n        let sceneCoordinator = SceneCoordinator(\n            navigation: navigation,\n            defaultsService: Self.defaultsService,\n            applicationService: applicationService,\n            localFileService: localFileService,\n            ubiquitousFileService: ubiquitousFileService,\n            logger: OSLogLogger(category: \"SceneCoordinator\"),\n            rootCoordinatorFactory: rootCoordinatorFactory,\n            editJotCoordinatorFactory: editJotCoordinatorFactory,\n            onUpdateUserInterfaceStyle: { [weak window] userInterfaceStyle in\n                Task { @MainActor in\n                    window?.overrideUserInterfaceStyle = userInterfaceStyle\n                }\n            },\n            requestSceneSessionActivationProvider: { url in\n                Task { @MainActor in\n                    let activity = NSUserActivity(\n                        activityType: SceneCoordinator.Constants.activityType\n                    )\n                    activity.userInfo = [SceneCoordinator.Constants.urlKey: url.absoluteString]\n                    UIApplication.shared.requestSceneSessionActivation(\n                        nil,\n                        userActivity: activity,\n                        options: nil,\n                        errorHandler: nil\n                    )\n                }\n            }\n        )\n        self.sceneCoordinator = sceneCoordinator\n        navigationController.viewControllers = sceneCoordinator.handle(\n            session: session,\n            connectionOptions: connectionOptions\n        )\n\n        window.makeKeyAndVisible()\n    }\n\n    #if targetEnvironment(macCatalyst)\n    func sceneDidDisconnect(_ scene: UIScene) {\n        guard\n            UIApplication.shared.connectedScenes.isEmpty,\n            let appKitPluginService\n        else {\n            return\n        }\n        appKitPluginService.terminate()\n    }\n    #endif\n\n    func scene(\n        _ scene: UIScene,\n        openURLContexts URLContexts: Set<UIOpenURLContext>\n    ) {\n        sceneCoordinator?.handleURLContexts(urlContexts: URLContexts)\n    }\n\n    func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {\n        sceneCoordinator?.makeStateRestorationActivity()\n    }\n\n    private func makeNavigationController() -> UINavigationController {\n        let appearance = UINavigationBarAppearance()\n        appearance.configureWithTransparentBackground()\n\n        let navigationController = UINavigationController()\n        navigationController.navigationBar.prefersLargeTitles = true\n        navigationController.navigationBar.standardAppearance = appearance\n        navigationController.navigationBar.scrollEdgeAppearance = appearance\n        navigationController.navigationBar.tintColor = .label\n        return navigationController\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/DefaultsKey+userInterfaceStyle.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension DefaultsKey {\n\n    static var userInterfaceStyle: DefaultsKey<Int> {\n        #function\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/DropDownCell/PageCellItem+settingsDropdown.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func settingsDropdown(\n        settingsDropdown: SettingsDropdownBusinessModel,\n        onAction: @Sendable @escaping (SettingsDropdownBusinessModel.Option) -> Void\n    ) -> PageCellItem {\n        PageCellItem(\n            id: settingsDropdown,\n            cellType: SettingsDropdownCell.self,\n            sizing: .fullWidth(estimatedHeight: 56),\n            viewModel: SettingsDropdownCellViewModel(\n                settingsDropdown: settingsDropdown,\n                onAction: onAction\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/DropDownCell/SettingsDropdownBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct SettingsDropdownBusinessModel: Sendable, Hashable {\n\n    struct Option: Sendable, Hashable {\n\n        static func == (lhs: Self, rhs: Self) -> Bool {\n            lhs.hashValue == rhs.hashValue\n        }\n\n        let label: String\n        let value: any Hashable & Sendable\n\n        func hash(into hasher: inout Hasher) {\n            hasher.combine(label)\n            hasher.combine(value)\n        }\n    }\n\n    let name: String\n    let current: Option\n    let options: [Option]\n}\n"
  },
  {
    "path": "Sources/SettingsPage/DropDownCell/SettingsDropdownCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class SettingsDropdownCell: SettingsCell<UIButton>, PageCell {\n\n    override init(frame: CGRect) {\n        super.init(frame: frame, accessoryView: UIButton(type: .system))\n        accessoryView.showsMenuAsPrimaryAction = true\n        accessoryView.titleLabel?.font = .preferredFont(forTextStyle: .body, weight: .semibold)\n        accessoryView.setTitleColor(.label, for: .normal)\n    }\n\n    func configure(viewModel: SettingsDropdownCellViewModel) {\n        nameLabel.text = viewModel.name\n        accessoryView.setTitle(viewModel.current.label, for: .normal)\n        accessoryView.menu = UIMenu(\n            children: viewModel.options.map { option in\n                UIAction(\n                    title: option.label,\n                    state: AnyHashable(option.value.hashValue) == AnyHashable(viewModel.current.value) ? .on : .off\n                ) { _ in\n                    viewModel.onAction(option)\n                }\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/DropDownCell/SettingsDropdownCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class SettingsDropdownCellViewModel: PageCellViewModel {\n\n    let name: String\n    let current: SettingsDropdownBusinessModel.Option\n    let options: [SettingsDropdownBusinessModel.Option]\n    let onAction: @Sendable (SettingsDropdownBusinessModel.Option) -> Void\n\n    init(\n        settingsDropdown: SettingsDropdownBusinessModel,\n        onAction: @Sendable @escaping (SettingsDropdownBusinessModel.Option) -> Void\n    ) {\n        self.name = settingsDropdown.name\n        self.current = settingsDropdown.current\n        self.options = settingsDropdown.options\n        self.onAction = onAction\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/EnableICloudSupportURL.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nstruct EnableICloudSupportURL: URLConvertible {\n    let scheme: String? = \"https\"\n    let host: String? = \"support.apple.com\"\n    let path: String\n\n    init(locale: Locale = .current) {\n        if let language = locale.languageCode,\n            let region = locale.regionCode\n        {\n            path = \"/\\(language)-\\(region.lowercased())/guide/icloud/mmfc0f1e2a/icloud\"\n        } else {\n            path = \"/guide/icloud/mmfc0f1e2a/icloud\"\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ExternalLinkCell/PageCellItem+settingsExternalLink.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func settingsExternalLink(\n        settingsExternalLink: SettingsExternalLinkBusinessModel,\n        onAction: @Sendable @escaping () -> Void\n    ) -> PageCellItem {\n        PageCellItem(\n            id: settingsExternalLink,\n            cellType: SettingsExternalLinkCell.self,\n            sizing: .fullWidth(estimatedHeight: 56),\n            viewModel: SettingsExternalLinkCellViewModel(\n                settingsExternalLink: settingsExternalLink,\n                onAction: onAction\n            )\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ExternalLinkCell/SettingsExternalLinkBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct SettingsExternalLinkBusinessModel: Sendable, Hashable {\n    let name: String\n    let info: String?\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ExternalLinkCell/SettingsExternalLinkCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class SettingsExternalLinkCell: SettingsCell<UIImageView>, PageCell {\n\n    private enum Constants {\n\n        static let arrowSize = CGFloat(20)\n    }\n\n    private lazy var infoLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .caption1)\n        label.textColor = .secondaryLabel\n        return label\n    }()\n\n    private lazy var withInfoLabelConstraints = [\n        infoLabel.topAnchor.constraint(equalTo: nameLabel.bottomAnchor),\n        infoLabel.leadingAnchor.constraint(equalTo: labelContainer.leadingAnchor),\n        infoLabel.trailingAnchor.constraint(equalTo: labelContainer.trailingAnchor),\n        infoLabel.bottomAnchor.constraint(equalTo: labelContainer.bottomAnchor),\n    ]\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        accessoryView.image = UIImage(systemName: \"arrow.up.forward\")\n        accessoryView.tintColor = .label\n        accessoryView.contentMode = .scaleAspectFit\n\n        NSLayoutConstraint.activate([\n            accessoryView.widthAnchor.constraint(equalToConstant: Constants.arrowSize),\n            accessoryView.heightAnchor.constraint(equalToConstant: Constants.arrowSize),\n        ])\n    }\n\n    func configure(viewModel: SettingsExternalLinkCellViewModel) {\n        nameLabel.text = viewModel.name\n        infoLabel.removeFromSuperview()\n        NSLayoutConstraint.deactivate([nameLabelBottomConstraint] + withInfoLabelConstraints)\n\n        if let info = viewModel.info {\n            infoLabel.text = info\n            labelContainer.addSubview(infoLabel)\n            NSLayoutConstraint.activate(withInfoLabelConstraints)\n        } else {\n            NSLayoutConstraint.activate([nameLabelBottomConstraint])\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ExternalLinkCell/SettingsExternalLinkCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class SettingsExternalLinkCellViewModel: PageCellViewModel {\n\n    let name: String\n    let info: String?\n    let onAction: @Sendable () -> Void\n\n    init(\n        settingsExternalLink: SettingsExternalLinkBusinessModel,\n        onAction: @Sendable @escaping () -> Void\n    ) {\n        self.name = settingsExternalLink.name\n        self.info = settingsExternalLink.info\n        self.onAction = onAction\n    }\n\n    func handle(action: PageCellAction) {\n        switch action {\n        case .tap: onAction()\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/InfoCell/PageCellItem+settingsInfo.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func settingsInfo(\n        settingsInfo: SettingsInfoBusinessModel\n    ) -> PageCellItem {\n        PageCellItem(\n            id: settingsInfo,\n            cellType: SettingsInfoCell.self,\n            sizing: .fullWidth(estimatedHeight: 56),\n            viewModel: SettingsInfoCellViewModel(settingsInfo: settingsInfo)\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/InfoCell/SettingsInfoBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct SettingsInfoBusinessModel: Sendable, Hashable {\n    let name: String\n    let value: String\n}\n"
  },
  {
    "path": "Sources/SettingsPage/InfoCell/SettingsInfoCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class SettingsInfoCell: SettingsCell<UILabel>, PageCell {\n\n    override init(frame: CGRect) {\n        super.init(frame: frame)\n        accessoryView.font = .preferredFont(forTextStyle: .body)\n        accessoryView.textAlignment = .right\n        accessoryView.textColor = .secondaryLabel\n    }\n\n    func configure(viewModel: SettingsInfoCellViewModel) {\n        nameLabel.text = viewModel.name\n        accessoryView.text = viewModel.value\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/InfoCell/SettingsInfoCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class SettingsInfoCellViewModel: PageCellViewModel {\n\n    let name: String\n    let value: String\n\n    init(\n        settingsInfo: SettingsInfoBusinessModel\n    ) {\n        self.name = settingsInfo.name\n        self.value = settingsInfo.value\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/JottreGithubURL.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct JottreGithubURL: URLConvertible {\n    let scheme: String? = \"https\"\n    let host: String? = \"github.com\"\n    let path = \"/antonlorani/jottre\"\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsCell/SettingsCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nclass SettingsCell<T: UIView>: UICollectionViewCell {\n\n    static var reuseIdentifier: String {\n        \"SettingsCell<\\(T.self)>\"\n    }\n\n    let labelContainer: UIView = {\n        let view = UIView()\n        view.translatesAutoresizingMaskIntoConstraints = false\n        return view\n    }()\n\n    let nameLabel: UILabel = {\n        let label = UILabel()\n        label.translatesAutoresizingMaskIntoConstraints = false\n        label.font = .preferredFont(forTextStyle: .body)\n        return label\n    }()\n\n    let accessoryView: T\n\n    private(set) lazy var nameLabelBottomConstraint = nameLabel.bottomAnchor.constraint(\n        equalTo: labelContainer.bottomAnchor\n    )\n\n    override init(frame: CGRect) {\n        self.accessoryView = T(frame: .zero)\n        super.init(frame: frame)\n        setUpViews()\n    }\n\n    init(frame: CGRect, accessoryView: T) {\n        self.accessoryView = accessoryView\n        super.init(frame: frame)\n        setUpViews()\n    }\n\n    @available(*, unavailable)\n    required init?(coder: NSCoder) {\n        assertionFailure(\"\\(#function) has not been implemented\")\n        return nil\n    }\n\n    private func setUpViews() {\n        contentView.backgroundColor = .secondarySystemGroupedBackground\n        contentView.layer.cornerRadius = DesignTokens.CornerRadius.cell\n        contentView.clipsToBounds = true\n        contentView.layoutMargins = UIEdgeInsets(\n            top: .zero,\n            left: DesignTokens.Spacing.md,\n            bottom: .zero,\n            right: DesignTokens.Spacing.md\n        )\n\n        accessoryView.translatesAutoresizingMaskIntoConstraints = false\n\n        contentView.addSubview(labelContainer)\n        labelContainer.addSubview(nameLabel)\n        contentView.addSubview(accessoryView)\n\n        NSLayoutConstraint.activate([\n            labelContainer.leadingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.leadingAnchor),\n            labelContainer.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n            labelContainer.trailingAnchor.constraint(\n                lessThanOrEqualTo: accessoryView.leadingAnchor,\n                constant: -DesignTokens.Spacing.xs\n            ),\n\n            nameLabel.topAnchor.constraint(equalTo: labelContainer.topAnchor),\n            nameLabel.leadingAnchor.constraint(equalTo: labelContainer.leadingAnchor),\n            nameLabel.trailingAnchor.constraint(equalTo: labelContainer.trailingAnchor),\n            nameLabelBottomConstraint,\n\n            accessoryView.trailingAnchor.constraint(equalTo: contentView.layoutMarginsGuide.trailingAnchor),\n            accessoryView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),\n        ])\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsCoordinator.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol SettingsCoordinatorProtocol: Coordinator {\n\n    func openExternalLink(url: URL)\n    func dismiss()\n}\n\nfinal class SettingsCoordinator: Coordinator, SettingsCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let navigation: Navigation\n    private let settingsViewControllerFactory: SettingsViewControllerFactoryProtocol\n\n    init(\n        navigation: Navigation,\n        settingsViewControllerFactory: SettingsViewControllerFactoryProtocol\n    ) {\n        self.navigation = navigation\n        self.settingsViewControllerFactory = settingsViewControllerFactory\n    }\n\n    func start() {\n        let navigationController = UINavigationController(\n            rootViewController: settingsViewControllerFactory.make(coordinator: self)\n        )\n        navigationController.navigationBar.prefersLargeTitles = true\n        navigation.present(navigationController, animated: true)\n    }\n\n    func openExternalLink(url: URL) {\n        navigation.openExternal(url: url)\n    }\n\n    func dismiss() {\n        navigation.dismiss(\n            animated: true,\n            completion: { [weak self] in\n                Task { @MainActor in\n                    self?.onEnd?()\n                }\n            }\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsCoordinatorFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@MainActor\nprotocol SettingsCoordinatorFactoryProtocol {\n\n    func make(navigation: Navigation) -> Coordinator\n}\n\nstruct SettingsCoordinatorFactory: SettingsCoordinatorFactoryProtocol {\n\n    let settingsViewControllerFactory: SettingsViewControllerFactoryProtocol\n\n    func make(navigation: Navigation) -> Coordinator {\n        SettingsCoordinator(\n            navigation: navigation,\n            settingsViewControllerFactory: settingsViewControllerFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsRepository.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nprotocol SettingsRepositoryProtocol: Sendable {\n\n    func shouldShowEnableICloudButton() -> Bool\n\n    func appVersion() -> String\n\n    func userInterfaceStyle() -> AsyncStream<UIUserInterfaceStyle>\n\n    func updateUserInterfaceStyle(_ style: UIUserInterfaceStyle)\n}\n\nstruct SettingsRepository: SettingsRepositoryProtocol {\n\n    private let ubiquitousFileService: FileServiceProtocol\n    private let bundleService: BundleServiceProtocol\n    private let defaultsService: DefaultsServiceProtocol\n\n    init(\n        ubiquitousFileService: FileServiceProtocol,\n        bundleService: BundleServiceProtocol,\n        defaultsService: DefaultsServiceProtocol\n    ) {\n        self.ubiquitousFileService = ubiquitousFileService\n        self.bundleService = bundleService\n        self.defaultsService = defaultsService\n    }\n\n    func shouldShowEnableICloudButton() -> Bool {\n        !ubiquitousFileService.isEnabled()\n    }\n\n    func appVersion() -> String {\n        bundleService.shortVersionString() ?? \"-\"\n    }\n\n    func userInterfaceStyle() -> AsyncStream<UIUserInterfaceStyle> {\n        defaultsService.getValueStream(.userInterfaceStyle)\n            .map { value in\n                value\n                    .flatMap { UIUserInterfaceStyle(rawValue: $0) }\n                    ?? .unspecified\n            }\n            .toAsyncStream()\n    }\n\n    func updateUserInterfaceStyle(_ style: UIUserInterfaceStyle) {\n        defaultsService.set(.userInterfaceStyle, value: style.rawValue)\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsViewControllerFactory.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nprotocol SettingsViewControllerFactoryProtocol: Sendable {\n\n    func make(coordinator: SettingsCoordinatorProtocol) -> UIViewController\n}\n\nstruct SettingsViewControllerFactory: SettingsViewControllerFactoryProtocol {\n\n    let repository: SettingsRepositoryProtocol\n    let textBarButtonItemFactory: TextBarButtonItemFactory\n    let symbolBarButtonItemFactory: SymbolBarButtonItemFactory\n\n    func make(coordinator: SettingsCoordinatorProtocol) -> UIViewController {\n        let viewController = PageViewController(\n            viewModel: SettingsViewModel(\n                repository: repository,\n                coordinator: coordinator\n            ),\n            textBarButtonItemFactory: textBarButtonItemFactory,\n            symbolBarButtonItemFactory: symbolBarButtonItemFactory\n        )\n        viewController.navigationItem.largeTitleDisplayMode = .always\n        return viewController\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/SettingsViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@MainActor\nfinal class SettingsViewModel: PageViewModel {\n\n    private enum Constants {\n\n        static let userInterfaceStyleOptions: [UIUserInterfaceStyle] = [.unspecified, .dark, .light]\n    }\n\n    var title: String? {\n        L10n.Settings.title\n    }\n\n    let rightNavigationItems: AsyncStream<[PageNavigationItem]>\n    private let rightNavigationItemsContinuation: AsyncStream<[PageNavigationItem]>.Continuation\n\n    let items: AsyncStream<[PageCellItem]>\n    private let itemsContinuation: AsyncStream<[PageCellItem]>.Continuation\n\n    private let repository: SettingsRepositoryProtocol\n    private weak var coordinator: SettingsCoordinatorProtocol?\n\n    private var loadingTask: Task<Void, Never>?\n\n    init(\n        repository: SettingsRepositoryProtocol,\n        coordinator: SettingsCoordinatorProtocol\n    ) {\n        self.repository = repository\n        self.coordinator = coordinator\n        (items, itemsContinuation) = AsyncStream.makeStream(\n            of: [PageCellItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n\n        (rightNavigationItems, rightNavigationItemsContinuation) = AsyncStream.makeStream(\n            of: [PageNavigationItem].self,\n            bufferingPolicy: .bufferingNewest(1)\n        )\n\n        rightNavigationItemsContinuation.yield([\n            .symbol(systemImageName: \"xmark\") { [weak coordinator] in\n                Task { @MainActor in\n                    coordinator?.dismiss()\n                }\n            }\n        ])\n    }\n\n    func didLoad() {\n        loadingTask = Task { [weak self] in\n            guard let repository = self?.repository else {\n                return\n            }\n            let shouldShowEnableICloudButton = repository.shouldShowEnableICloudButton()\n            let appVersion = repository.appVersion()\n            for await userInterfaceStyle in repository.userInterfaceStyle() {\n                guard let self else {\n                    return\n                }\n                itemsContinuation.yield(\n                    makePageItems(\n                        userInterfaceStyle: userInterfaceStyle,\n                        shouldShowEnableICloudButton: shouldShowEnableICloudButton,\n                        appVersion: appVersion\n                    )\n                )\n            }\n        }\n    }\n\n    private func makePageItems(\n        userInterfaceStyle: UIUserInterfaceStyle,\n        shouldShowEnableICloudButton: Bool,\n        appVersion: String\n    ) -> [PageCellItem] {\n        var items = [\n            PageCellItem.settingsDropdown(\n                settingsDropdown: SettingsDropdownBusinessModel(\n                    name: L10n.Settings.Appearance.title,\n                    current: SettingsDropdownBusinessModel.Option(\n                        label: SettingsViewModel.makeLabel(userInterfaceStyle: userInterfaceStyle),\n                        value: userInterfaceStyle\n                    ),\n                    options: Constants.userInterfaceStyleOptions.map { userInterfaceStyleOption in\n                        SettingsDropdownBusinessModel.Option(\n                            label: SettingsViewModel.makeLabel(userInterfaceStyle: userInterfaceStyleOption),\n                            value: userInterfaceStyleOption\n                        )\n                    }\n                ),\n                onAction: { [weak self] option in\n                    guard let style = option.value as? UIUserInterfaceStyle else {\n                        return\n                    }\n                    self?.repository.updateUserInterfaceStyle(style)\n                }\n            )\n        ]\n\n        if shouldShowEnableICloudButton {\n            items.append(\n                .settingsExternalLink(\n                    settingsExternalLink: SettingsExternalLinkBusinessModel(\n                        name: L10n.Settings.ICloud.title,\n                        info: L10n.Settings.ICloud.info\n                    ),\n                    onAction: { [weak self] in\n                        Task { @MainActor [weak self] in\n                            self?.coordinator?.openExternalLink(url: EnableICloudSupportURL().toURL())\n                        }\n                    }\n                )\n            )\n        }\n\n        items.append(contentsOf: [\n            .settingsExternalLink(\n                settingsExternalLink: SettingsExternalLinkBusinessModel(\n                    name: L10n.Settings.Github.title,\n                    info: nil\n                ),\n                onAction: { [weak self] in\n                    Task { @MainActor [weak self] in\n                        self?.coordinator?.openExternalLink(url: JottreGithubURL().toURL())\n                    }\n                }\n            ),\n            .settingsInfo(\n                settingsInfo: SettingsInfoBusinessModel(\n                    name: L10n.Settings.Version.title,\n                    value: appVersion\n                )\n            ),\n        ])\n\n        return items\n    }\n\n    private static func makeLabel(userInterfaceStyle: UIUserInterfaceStyle) -> String {\n        switch userInterfaceStyle {\n        case .light:\n            L10n.Settings.Appearance.light\n        case .dark:\n            L10n.Settings.Appearance.dark\n        default:\n            L10n.Settings.Appearance.system\n        }\n    }\n\n    deinit {\n        loadingTask?.cancel()\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ToggleCell/PageCellItem+settingsToggle.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension PageCellItem {\n\n    @MainActor\n    static func settingsToggle(\n        settingsToggle: SettingsToggleBusinessModel\n    ) -> PageCellItem {\n        PageCellItem(\n            id: settingsToggle,\n            cellType: SettingsToggleCell.self,\n            sizing: .fullWidth(estimatedHeight: 56),\n            viewModel: SettingsToggleCellViewModel(settingsToggle: settingsToggle)\n        )\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ToggleCell/SettingsToggleBusinessModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nstruct SettingsToggleBusinessModel: Sendable, Hashable {\n    let name: String\n    let isOn: Bool\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ToggleCell/SettingsToggleCell.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nfinal class SettingsToggleCell: SettingsCell<UISwitch>, PageCell {\n\n    func configure(viewModel: SettingsToggleCellViewModel) {\n        nameLabel.text = viewModel.name\n        accessoryView.isOn = viewModel.isOn\n    }\n}\n"
  },
  {
    "path": "Sources/SettingsPage/ToggleCell/SettingsToggleCellViewModel.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nfinal class SettingsToggleCellViewModel: PageCellViewModel {\n\n    let name: String\n    let isOn: Bool\n\n    init(\n        settingsToggle: SettingsToggleBusinessModel\n    ) {\n        self.name = settingsToggle.name\n        self.isOn = settingsToggle.isOn\n    }\n\n    func handle(action: PageCellAction) {\n        /* no-op */\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/Array+safeIndex.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension Collection {\n\n    subscript(safe index: Index) -> Element? {\n        indices.contains(index) ? self[index] : nil\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/AsyncSequence+toAsyncThrowingStream.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nextension AsyncSequence where Self: Sendable, Element: Sendable {\n\n    func toAsyncThrowingStream() -> AsyncThrowingStream<Element, Error> {\n        AsyncThrowingStream { continuation in\n            let task = Task {\n                do {\n                    for try await element in self {\n                        continuation.yield(element)\n                    }\n                    continuation.finish()\n                } catch {\n                    continuation.finish(throwing: error)\n                }\n            }\n            continuation.onTermination = { _ in\n                task.cancel()\n            }\n        }\n    }\n\n    func toAsyncStream() -> AsyncStream<Element> {\n        AsyncStream { continuation in\n            let task = Task {\n                do {\n                    for try await element in self {\n                        continuation.yield(element)\n                    }\n                    continuation.finish()\n                } catch {\n                    continuation.finish()\n                }\n            }\n\n            continuation.onTermination = { _ in\n                task.cancel()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/AsyncStream+debounce.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nextension AsyncSequence where Self: Sendable, Element: Sendable {\n\n    func debounce(\n        for seconds: TimeInterval\n    ) -> AsyncStream<Element> {\n        AsyncStream<Element> { continuation in\n            let task = Task { [self] in\n                var currentTask: Task<Void, Never>?\n\n                do {\n                    for try await value in self {\n                        currentTask?.cancel()\n                        let captured = value\n                        currentTask = Task {\n                            do {\n                                try await Task.sleep(nanoseconds: UInt64(seconds * Double(NSEC_PER_SEC)))\n                                try Task.checkCancellation()\n                                continuation.yield(captured)\n                            } catch {\n                                /* no-op */\n                            }\n                        }\n                    }\n                } catch {\n                    /* Upstream sequence threw — finish gracefully */\n                }\n\n                await currentTask?.value\n                continuation.finish()\n            }\n\n            continuation.onTermination = { @Sendable _ in\n                task.cancel()\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/LoggerProtocol.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport OSLog\n\nprotocol LoggerProtocol: Sendable {\n\n    func debug(_ message: @autoclosure () -> String)\n    func info(_ message: @autoclosure () -> String)\n    func error(_ message: @autoclosure () -> String)\n}\n\nstruct OSLogLogger: LoggerProtocol {\n\n    private let logger: Logger\n\n    init(category: String) {\n        self.logger = Logger(\n            subsystem: Bundle.main.bundleIdentifier ?? \"\",\n            category: category\n        )\n    }\n\n    func debug(_ message: @autoclosure () -> String) {\n        #if DEBUG\n        let resolved = message()\n        logger.debug(\"\\(resolved)\")\n        #endif\n    }\n\n    func info(_ message: @autoclosure () -> String) {\n        let resolved = message()\n        logger.info(\"\\(resolved)\")\n    }\n\n    func error(_ message: @autoclosure () -> String) {\n        let resolved = message()\n        logger.error(\"\\(resolved)\")\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/NSLayoutConstraint+withPriority.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension NSLayoutConstraint {\n\n    @inline(__always)\n    func withPriority(_ priority: UILayoutPriority) -> Self {\n        self.priority = priority\n        return `self`\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/UIColor+adaptiveBlackWhite.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension UIColor {\n\n    static let adaptiveBlackWhite = UIColor { traits in\n        traits.userInterfaceStyle == .dark ? .black : .white\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/UIFont+systemStyle.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension UIFont {\n\n    static func preferredFont(\n        forTextStyle style: TextStyle,\n        weight: Weight\n    ) -> UIFont {\n        let size = UIFontDescriptor.preferredFontDescriptor(withTextStyle: style).pointSize\n        let base = UIFont.systemFont(ofSize: size, weight: weight)\n        return UIFontMetrics(forTextStyle: style).scaledFont(for: base)\n    }\n}\n"
  },
  {
    "path": "Sources/Utilities/UITraitCollection+hasRenderingChange.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension UITraitCollection {\n\n    func hasRenderingChange(comparedTo previous: UITraitCollection?) -> Bool {\n        userInterfaceStyle != previous?.userInterfaceStyle || displayScale != previous?.displayScale\n    }\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudImageCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudImageCellViewModelTests: XCTestCase {\n\n    func test_handleAction_givenTap_doesNothing() {\n        // Given\n        let viewModel = CloudImageCellViewModel()\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        XCTAssertNotNil(viewModel)\n    }\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudMigrationCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudMigrationCoordinatorTests: XCTestCase {\n\n    func test_shouldStart_givenRepositoryReturnsTrue_returnsTrue() {\n        // Given\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(getShouldShowCloudMigrationProvider: { true }),\n            navigation: Navigation.test(),\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(),\n            logger: LoggerMock()\n        )\n\n        // Then\n        XCTAssertTrue(coordinator.shouldStart())\n    }\n\n    func test_shouldStart_givenRepositoryReturnsFalse_returnsFalse() {\n        // Given\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(getShouldShowCloudMigrationProvider: { false }),\n            navigation: Navigation.test(),\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(),\n            logger: LoggerMock()\n        )\n\n        // Then\n        XCTAssertFalse(coordinator.shouldStart())\n    }\n\n    func test_start_givenInvoked_presentsNavigationControllerWithFactoryProducedRoot() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let madeViewController = UIViewController()\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    let navigationController = viewController as? UINavigationController\n                    XCTAssertEqual(navigationController?.viewControllers.first, madeViewController)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(),\n            navigation: navigation,\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(\n                makeProvider: { _ in madeViewController }\n            ),\n            logger: LoggerMock()\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenInvoked_invokesNavigationDismiss() {\n        // Given\n        let dismissExpectation = XCTestExpectation(description: \"Navigation.dismiss is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { _, _ in dismissExpectation.fulfill() }\n        )\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(),\n            navigation: navigation,\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(),\n            logger: LoggerMock()\n        )\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        wait(for: [dismissExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenCompletion_invokesOnEnd() async {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"CloudMigrationCoordinator.onEnd is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { _, completion in\n                completion?()\n            }\n        )\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(),\n            navigation: navigation,\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(),\n            logger: LoggerMock()\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        await fulfillment(of: [onEndExpectation], timeout: 1)\n    }\n\n    func test_showInfoAlert_givenInvoked_presentsAlertController() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    XCTAssertTrue(viewController is UIAlertController)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = CloudMigrationCoordinator(\n            repository: CloudMigrationRepositoryMock(),\n            navigation: navigation,\n            cloudMigrationViewControllerFactory: CloudMigrationViewControllerFactoryMock(),\n            logger: LoggerMock()\n        )\n\n        // When\n        coordinator.showInfoAlert(title: \"title\", message: \"message\")\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudMigrationJotBusinessModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class CloudMigrationJotBusinessModelTests: XCTestCase {\n\n    func test_init_givenLocalInfo_isUbiquitousFalseAndIsDownloadedTrue() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let model = CloudMigrationJotBusinessModel(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(model.name, \"note\")\n        XCTAssertFalse(model.isUbiquitous)\n        XCTAssertTrue(model.isDownloaded)\n        XCTAssertFalse(model.isDownloading)\n        XCTAssertEqual(model.lastModifiedText, \"\")\n    }\n\n    func test_init_givenUbiquitousInfoNotDownloaded_isUbiquitousTrueAndIsDownloadedFalse() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: true)\n        )\n\n        // When\n        let model = CloudMigrationJotBusinessModel(jotFileInfo: info)\n\n        // Then\n        XCTAssertTrue(model.isUbiquitous)\n        XCTAssertFalse(model.isDownloaded)\n        XCTAssertTrue(model.isDownloading)\n    }\n\n    func test_init_givenModificationDate_formatsLastModifiedText() {\n        // Given\n        let date = Date(timeIntervalSince1970: 0)\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: date,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let model = CloudMigrationJotBusinessModel(jotFileInfo: info)\n\n        // Then\n        XCTAssertFalse(model.lastModifiedText.isEmpty)\n        XCTAssertEqual(\n            model.lastModifiedText,\n            DateFormatter.localizedString(from: date, dateStyle: .long, timeStyle: .short)\n        )\n    }\n\n    func test_toJotFileInfo_returnsOriginalInfo() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let model = CloudMigrationJotBusinessModel(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(model.toJotFileInfo(), info)\n    }\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudMigrationJotCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudMigrationJotCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameInfoTextAndCloudFlagsFromBusinessModel() {\n        // Given\n        let date = Date(timeIntervalSince1970: 1_700_000_000)\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: date,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        )\n        let businessModel = CloudMigrationJotBusinessModel(jotFileInfo: jotFileInfo)\n        let expectedInfoText = DateFormatter.localizedString(\n            from: date,\n            dateStyle: .long,\n            timeStyle: .short\n        )\n\n        // When\n        let viewModel = CloudMigrationJotCellViewModel(\n            cloudMigrationJot: businessModel,\n            repository: CloudMigrationRepositoryMock(),\n            onTap: {}\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"note\")\n        XCTAssertEqual(viewModel.infoText, expectedInfoText)\n        XCTAssertTrue(viewModel.isCloudCheckboxOn)\n        XCTAssertFalse(viewModel.isDownloading)\n    }\n\n    func test_init_givenLocalJotFile_setsCloudCheckboxOff() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let viewModel = CloudMigrationJotCellViewModel(\n            cloudMigrationJot: CloudMigrationJotBusinessModel(jotFileInfo: jotFileInfo),\n            repository: CloudMigrationRepositoryMock(),\n            onTap: {}\n        )\n\n        // Then\n        XCTAssertFalse(viewModel.isCloudCheckboxOn)\n        XCTAssertEqual(viewModel.infoText, \"\")\n    }\n\n    func test_handleAction_givenTap_invokesOnTap() async {\n        // Given\n        let onTapExpectation = XCTestExpectation(description: \"onTap is called.\")\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = CloudMigrationJotCellViewModel(\n            cloudMigrationJot: CloudMigrationJotBusinessModel(jotFileInfo: jotFileInfo),\n            repository: CloudMigrationRepositoryMock(),\n            onTap: { onTapExpectation.fulfill() }\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        await fulfillment(of: [onTapExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_forwardsJotFileInfoToRepository() async throws {\n        // Given\n        let getPreviewImageExpectation = XCTestExpectation(\n            description: \"CloudMigrationRepositoryMock.getPreviewImageProvider is called.\"\n        )\n        let expectedImage = UIImage()\n        let expectedFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let jotFileInfo = JotFile.Info(\n            url: expectedFileURL,\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repositoryMock = CloudMigrationRepositoryMock(\n            getPreviewImageProvider: { receivedInfo, receivedStyle, receivedScale in\n                // Then\n                XCTAssertEqual(receivedInfo.url, expectedFileURL)\n                XCTAssertEqual(receivedStyle, .light)\n                XCTAssertEqual(receivedScale, 2.0)\n                getPreviewImageExpectation.fulfill()\n                return expectedImage\n            }\n        )\n        let viewModel = CloudMigrationJotCellViewModel(\n            cloudMigrationJot: CloudMigrationJotBusinessModel(jotFileInfo: jotFileInfo),\n            repository: repositoryMock,\n            onTap: {}\n        )\n\n        // When\n        let image = await viewModel.getPreviewImage(userInterfaceStyle: .light, displayScale: 2.0)\n\n        // Then\n        XCTAssertIdentical(image, expectedImage)\n        await fulfillment(of: [getPreviewImageExpectation], timeout: 0.2)\n    }\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudMigrationRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class CloudMigrationRepositoryTests: XCTestCase {\n\n    private static let localInfo = JotFile.Info(\n        url: URL(staticString: \"file:///tmp/local.jot\"),\n        name: \"local\",\n        modificationDate: Date(timeIntervalSince1970: 1_000),\n        ubiquitousInfo: nil\n    )\n    private static let ubiquitousNewer = JotFile.Info(\n        url: URL(staticString: \"file:///cloud/newer.jot\"),\n        name: \"newer\",\n        modificationDate: Date(timeIntervalSince1970: 3_000),\n        ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n    )\n    private static let ubiquitousOlder = JotFile.Info(\n        url: URL(staticString: \"file:///cloud/older.jot\"),\n        name: \"older\",\n        modificationDate: Date(timeIntervalSince1970: 2_000),\n        ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n    )\n\n    func test_getJotFiles_yieldsLocalsBeforeUbiquitousAndUbiquitousSortedNewestFirst() async throws {\n        // Given\n        let jotFileServiceMock = JotFileServiceMock(\n            documentsDirectoryContentsProvider: {\n                AsyncThrowingStream { continuation in\n                    continuation.yield([Self.ubiquitousNewer, Self.localInfo, Self.ubiquitousOlder])\n                    continuation.finish()\n                }\n            }\n        )\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: jotFileServiceMock,\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // When\n        var iterator = repository.getJotFiles().makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(try await iterator.next())\n\n        // Then\n        XCTAssertEqual(first.map(\\.name), [\"local\", \"newer\", \"older\"])\n    }\n\n    func test_moveJotFile_forwardsToJotFileService() async throws {\n        // Given\n        let moveProviderExpectation = XCTestExpectation(description: \"moveProvider is called.\")\n        let jotFileServiceMock = JotFileServiceMock(\n            moveProvider: { receivedInfo, receivedShouldBecomeUbiquitous in\n                // Then\n                XCTAssertEqual(receivedInfo, Self.localInfo)\n                XCTAssertTrue(receivedShouldBecomeUbiquitous)\n                moveProviderExpectation.fulfill()\n            }\n        )\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: jotFileServiceMock,\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // When\n        try await repository.moveJotFile(jotFileInfo: Self.localInfo, shouldBecomeUbiquitous: true)\n\n        // Then\n        await fulfillment(of: [moveProviderExpectation], timeout: 0.2)\n    }\n\n    func test_getShouldShowCloudMigration_givenAlreadyDone_returnsFalse() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock(\n            initialValues: [DefaultsKey<Bool>.hasDoneCloudMigration.description: true]\n        )\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { false }),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // Then\n        XCTAssertFalse(repository.getShouldShowCloudMigration())\n    }\n\n    func test_getShouldShowCloudMigration_givenStoredFlagDiffersFromCurrentUbiquitousState_returnsTrue() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock(\n            initialValues: [DefaultsKey<Bool>.isICloudEnabled.description: false]\n        )\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { true }),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // Then\n        XCTAssertTrue(repository.getShouldShowCloudMigration())\n    }\n\n    func test_getShouldShowCloudMigration_givenStoredFlagMatchesCurrentUbiquitousState_returnsFalse() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock(\n            initialValues: [DefaultsKey<Bool>.isICloudEnabled.description: true]\n        )\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { true }),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // Then\n        XCTAssertFalse(repository.getShouldShowCloudMigration())\n    }\n\n    func test_getShouldShowCloudMigration_givenNoStoredFlagAndUbiquitousDisabled_persistsFalseAndReturnsFalse() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock()\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { false }),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // When\n        let result = repository.getShouldShowCloudMigration()\n\n        // Then\n        XCTAssertFalse(result)\n        XCTAssertEqual(defaultsServiceMock.getValue(.isICloudEnabled), false)\n    }\n\n    func test_markCloudMigrationPageDone_setsHasDoneCloudMigrationToTrue() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock()\n        let repository = CloudMigrationRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // When\n        repository.markCloudMigrationPageDone()\n\n        // Then\n        XCTAssertEqual(defaultsServiceMock.getValue(.hasDoneCloudMigration), true)\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/CloudMigrationPage/CloudMigrationViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudMigrationViewModelTests: XCTestCase {\n\n    func test_didLoad_givenEmptyJotFiles_yieldsCloudImageAndHeader() async throws {\n        // Given\n        let stream = AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> { continuation in\n            continuation.yield([])\n            continuation.finish()\n        }\n        let viewModel = CloudMigrationViewModel(\n            repository: CloudMigrationRepositoryMock(getJotFilesProvider: { stream }),\n            coordinator: CloudMigrationCoordinatorMock(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 2)\n    }\n\n    func test_didLoad_givenOneJot_yieldsHeaderAndJotItem() async throws {\n        // Given\n        let businessModel = CloudMigrationJotBusinessModel(\n            jotFileInfo: JotFile.Info(\n                url: URL(staticString: \"file:///tmp/foo.jot\"),\n                name: \"foo\",\n                modificationDate: Date(timeIntervalSince1970: 0),\n                ubiquitousInfo: nil\n            )\n        )\n        let stream = AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> { continuation in\n            continuation.yield([businessModel])\n            continuation.finish()\n        }\n        let viewModel = CloudMigrationViewModel(\n            repository: CloudMigrationRepositoryMock(getJotFilesProvider: { stream }),\n            coordinator: CloudMigrationCoordinatorMock(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 2)\n    }\n\n    func test_didLoad_givenStreamThrows_logsError() async {\n        // Given\n        let errorExpectation = XCTestExpectation(description: \"LoggerMock.errorProvider is called.\")\n        let stream = AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> { continuation in\n            continuation.finish(throwing: NSError(domain: \"test\", code: 0))\n        }\n        let viewModel = CloudMigrationViewModel(\n            repository: CloudMigrationRepositoryMock(getJotFilesProvider: { stream }),\n            coordinator: CloudMigrationCoordinatorMock(),\n            logger: LoggerMock(\n                errorProvider: { message in\n                    if message.contains(\"Failed to observe migration jot files\") {\n                        errorExpectation.fulfill()\n                    }\n                }\n            )\n        )\n\n        // When\n        viewModel.didLoad()\n\n        // Then\n        await fulfillment(of: [errorExpectation], timeout: 1)\n    }\n\n    func test_actions_givenDoneTap_marksDoneAndDismissesViaCoordinator() async {\n        // Given\n        let markDoneExpectation = XCTestExpectation(description: \"Repository.markCloudMigrationPageDone is called.\")\n        let dismissExpectation =\n            XCTestExpectation(description: \"CloudMigrationCoordinatorMock.dismiss is called.\")\n        let coordinator = CloudMigrationCoordinatorMock(\n            dismissProvider: { dismissExpectation.fulfill() }\n        )\n        let viewModel = CloudMigrationViewModel(\n            repository: CloudMigrationRepositoryMock(\n                markCloudMigrationPageDoneProvider: { markDoneExpectation.fulfill() }\n            ),\n            coordinator: coordinator,\n            logger: LoggerMock()\n        )\n\n        // When\n        XCTAssertEqual(viewModel.actions.count, 1)\n        viewModel.actions[0].action()\n\n        // Then\n        await fulfillment(of: [markDoneExpectation, dismissExpectation], timeout: 1)\n    }\n}\n\n@MainActor\nprivate func firstValue<S: AsyncSequence & Sendable>(\n    of sequence: S\n) async throws -> S.Element where S.Element: Sendable {\n    var iterator = sequence.makeAsyncIterator()\n    guard let value = try await iterator.next() else {\n        throw NSError(domain: \"CloudMigrationViewModelTests\", code: 0)\n    }\n    return value\n}\n"
  },
  {
    "path": "Tests/Defaults/DefaultsContinuationStorageTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class DefaultsContinuationStorageTests: XCTestCase {\n\n    func test_continuations_givenNoRegistrations_returnsNil() {\n        // Given\n        let storage = DefaultsContinuationStorage()\n        let key = DefaultsKey<Int>(\"none\")\n\n        // When\n        let result = storage.continuations(defaultsKey: key)\n\n        // Then\n        XCTAssertNil(result)\n    }\n\n    func test_add_givenContinuationForKey_continuationsReturnsIt() throws {\n        // Given\n        let storage = DefaultsContinuationStorage()\n        let key = DefaultsKey<Int>(\"k\")\n        let stream = AsyncStream<Int?> { continuation in\n            storage.add(continuation, defaultsKey: key)\n        }\n        let iterator = stream.makeAsyncIterator()\n        _ = iterator\n\n        // When\n        let result = try XCTUnwrap(storage.continuations(defaultsKey: key))\n\n        // Then\n        XCTAssertEqual(result.count, 1)\n    }\n\n    func test_addMultiple_givenSameKey_continuationsReturnsAll() throws {\n        // Given\n        let storage = DefaultsContinuationStorage()\n        let key = DefaultsKey<Int>(\"k\")\n        let stream1 = AsyncStream<Int?> { continuation in\n            storage.add(continuation, defaultsKey: key)\n        }\n        let stream2 = AsyncStream<Int?> { continuation in\n            storage.add(continuation, defaultsKey: key)\n        }\n        let iterator1 = stream1.makeAsyncIterator()\n        let iterator2 = stream2.makeAsyncIterator()\n        _ = iterator1\n        _ = iterator2\n\n        // When\n        let result = try XCTUnwrap(storage.continuations(defaultsKey: key))\n\n        // Then\n        XCTAssertEqual(result.count, 2)\n    }\n\n    func test_continuations_givenDifferentKey_returnsNil() {\n        // Given\n        let storage = DefaultsContinuationStorage()\n        let registeredKey = DefaultsKey<Int>(\"k1\")\n        let otherKey = DefaultsKey<Int>(\"k2\")\n        let stream = AsyncStream<Int?> { continuation in\n            storage.add(continuation, defaultsKey: registeredKey)\n        }\n        let iterator = stream.makeAsyncIterator()\n        _ = iterator\n\n        // When\n        let result = storage.continuations(defaultsKey: otherKey)\n\n        // Then\n        XCTAssertNil(result)\n    }\n}\n"
  },
  {
    "path": "Tests/Defaults/DefaultsKeyTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class DefaultsKeyTests: XCTestCase {\n\n    func test_init_givenString_setsDescription() {\n        // When\n        let key = DefaultsKey<String>(\"someKey\")\n\n        // Then\n        XCTAssertEqual(key.description, \"someKey\")\n    }\n\n    func test_initStringLiteral_setsDescription() {\n        // When\n        let key: DefaultsKey<String> = \"literalKey\"\n\n        // Then\n        XCTAssertEqual(key.description, \"literalKey\")\n    }\n\n    func test_isICloudEnabled_returnsExpectedDescription() {\n        // When\n        let key = DefaultsKey<Bool>.isICloudEnabled\n\n        // Then\n        XCTAssertEqual(key.description, \"isICloudEnabled\")\n    }\n\n    func test_userInterfaceStyle_returnsExpectedDescription() {\n        // When\n        let key = DefaultsKey<Int>.userInterfaceStyle\n\n        // Then\n        XCTAssertEqual(key.description, \"userInterfaceStyle\")\n    }\n\n    func test_hasDoneCloudMigration_returnsExpectedDescription() {\n        // When\n        let key = DefaultsKey<Bool>.hasDoneCloudMigration\n\n        // Then\n        XCTAssertEqual(key.description, \"hasDoneCloudMigration\")\n    }\n}\n"
  },
  {
    "path": "Tests/Defaults/DefaultsServiceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class DefaultsServiceTests: XCTestCase {\n\n    private var userDefaults: UserDefaults!\n    private var suiteName: String!\n\n    override func setUp() {\n        super.setUp()\n        suiteName = \"DefaultsServiceTests-\\(UUID().uuidString)\"\n        userDefaults = try! XCTUnwrap(UserDefaults(suiteName: suiteName))\n    }\n\n    override func tearDown() {\n        userDefaults.removePersistentDomain(forName: suiteName)\n        userDefaults = nil\n        suiteName = nil\n        super.tearDown()\n    }\n\n    func test_getValue_givenNoStoredValue_returnsNil() {\n        // Given\n        let service = DefaultsService(userDefaults: userDefaults)\n\n        // When\n        let value: Bool? = service.getValue(DefaultsKey<Bool>(\"missing\"))\n\n        // Then\n        XCTAssertNil(value)\n    }\n\n    func test_set_givenBoolValue_persistsAsRoundTrippableString() throws {\n        // Given\n        let service = DefaultsService(userDefaults: userDefaults)\n        let key = DefaultsKey<Bool>(\"flag\")\n\n        // When\n        service.set(key, value: true)\n\n        // Then\n        let stored = try XCTUnwrap(service.getValue(key))\n        XCTAssertTrue(stored)\n    }\n\n    func test_set_givenNilValue_clearsValue() {\n        // Given\n        let service = DefaultsService(userDefaults: userDefaults)\n        let key = DefaultsKey<Int>(\"count\")\n        service.set(key, value: 42)\n\n        // When\n        service.set(key, value: nil)\n\n        // Then\n        XCTAssertNil(service.getValue(key))\n    }\n\n    func test_getValueStream_yieldsCurrentValueImmediately() async throws {\n        // Given\n        let service = DefaultsService(userDefaults: userDefaults)\n        let key = DefaultsKey<Int>(\"preset\")\n        service.set(key, value: 7)\n\n        // When\n        var iterator = service.getValueStream(key).makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(await iterator.next())\n\n        // Then\n        XCTAssertEqual(first, 7)\n    }\n\n    func test_getValueStream_yieldsValueOnSubsequentSet() async throws {\n        // Given\n        let service = DefaultsService(userDefaults: userDefaults)\n        let key = DefaultsKey<Int>(\"counter\")\n\n        var iterator = service.getValueStream(key).makeAsyncIterator()\n        _ = await iterator.next()\n\n        // When\n        service.set(key, value: 99)\n        let next = try await XCTUnwrapAsync(await iterator.next())\n\n        // Then\n        XCTAssertEqual(next, 99)\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/EditJotPage/EditJotCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class EditJotCoordinatorTests: XCTestCase {\n\n    func test_shouldHandle_givenEditJotURL_returnsTrue() {\n        // Given\n        let coordinator = makeCoordinator()\n        let url = EditJotURL(\n            jotFileInfo: JotFile.Info(\n                url: URL(staticString: \"file:///tmp/note.jot\"),\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        ).toURL()\n\n        // Then\n        XCTAssertTrue(coordinator.shouldHandle(url: url))\n    }\n\n    func test_shouldHandle_givenNonEditJotURL_returnsFalse() {\n        // Given\n        let coordinator = makeCoordinator()\n\n        // Then\n        XCTAssertFalse(coordinator.shouldHandle(url: URL(staticString: \"https://example.com\")))\n    }\n\n    func test_handle_givenValidURL_returnsViewControllerFromFactory() {\n        // Given\n        let madeViewController = UIViewController()\n        let coordinator = makeCoordinator(\n            editJotViewControllerFactory: EditJotViewControllerFactoryMock(\n                makeProvider: { _, _ in madeViewController }\n            )\n        )\n        let url = EditJotURL(\n            jotFileInfo: JotFile.Info(\n                url: URL(staticString: \"file:///tmp/note.jot\"),\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        ).toURL()\n\n        // When\n        let viewControllers = coordinator.handle(url: url)\n\n        // Then\n        XCTAssertEqual(viewControllers, [madeViewController])\n    }\n\n    func test_handle_givenUnparsableURL_returnsEmpty() {\n        // Given\n        let coordinator = makeCoordinator()\n\n        // When\n        let viewControllers = coordinator.handle(url: URL(staticString: \"https://example.com\"))\n\n        // Then\n        XCTAssertTrue(viewControllers.isEmpty)\n    }\n\n    func test_openJot_givenInvoked_invokesNavigationOpenWithEditJotURL() {\n        // Given\n        let openExpectation = XCTestExpectation(description: \"Navigation.open is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            openURLProvider: { receivedURL in\n                XCTAssertEqual(receivedURL, EditJotURL(jotFileInfo: info).toURL())\n                openExpectation.fulfill()\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.openJot(jotFileInfo: info)\n\n        // Then\n        wait(for: [openExpectation], timeout: 1)\n    }\n\n    func test_canGoBack_givenMultipleViewControllers_returnsTrue() {\n        // Given\n        let navigation = Navigation.test(\n            getViewControllersProvider: { [UIViewController(), UIViewController()] }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // Then\n        XCTAssertTrue(coordinator.canGoBack())\n    }\n\n    func test_canGoBack_givenSingleViewController_returnsFalse() {\n        // Given\n        let navigation = Navigation.test(\n            getViewControllersProvider: { [UIViewController()] }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // Then\n        XCTAssertFalse(coordinator.canGoBack())\n    }\n\n    func test_goBack_givenInvoked_invokesNavigationPop() {\n        // Given\n        let popExpectation = XCTestExpectation(description: \"Navigation.popViewController is called.\")\n        let navigation = Navigation.test(\n            popViewControllerProvider: { animated in\n                XCTAssertTrue(animated)\n                popExpectation.fulfill()\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.goBack()\n\n        // Then\n        wait(for: [popExpectation], timeout: 1)\n    }\n\n    func test_showShareJot_givenInvoked_startsShareCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"ShareJot Coordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            shareJotCoordinatorFactory: ShareJotCoordinatorFactoryMock(\n                makeProvider: { _, _, _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showShareJot(jotFileInfo: info, format: .pdf, configurePopoverAnchor: nil)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_openDeleteJot_givenInvoked_startsDeleteCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"DeleteJot Coordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryMock(\n                makeProvider: { _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.openDeleteJot(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showRenameAlert_givenInvoked_startsRenameCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"RenameJot Coordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            renameJotCoordinatorFactory: RenameJotCoordinatorFactoryMock(\n                makeProvider: { _, _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showRenameAlert(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showInFiles_givenInvoked_startsRevealFileCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"RevealFile Coordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            revealFileCoordinatorFactory: RevealFileCoordinatorFactoryMock(\n                makeProvider: { _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showInFiles(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showJotConflictPage_givenInvoked_startsJotConflictCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"JotConflict Coordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            jotConflictCoordinatorFactory: JotConflictCoordinatorFactoryMock(\n                makeProvider: { _, _, _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showJotConflictPage(jotFileInfo: info, jotFileVersions: []) { _ in }\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showInfoAlert_givenInvoked_presentsAlertController() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    XCTAssertTrue(viewController is UIAlertController)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.showInfoAlert(title: \"title\", message: \"message\")\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    private func makeCoordinator(\n        navigation: Navigation = .test(),\n        repository: EditJotRepositoryProtocol = EditJotRepositoryMock(),\n        editJotViewControllerFactory: EditJotViewControllerFactoryProtocol = EditJotViewControllerFactoryMock(),\n        jotConflictCoordinatorFactory: JotConflictCoordinatorFactoryProtocol = JotConflictCoordinatorFactoryMock(),\n        renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol = RenameJotCoordinatorFactoryMock(),\n        deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol = DeleteJotCoordinatorFactoryMock(),\n        shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol = ShareJotCoordinatorFactoryMock(),\n        revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol = RevealFileCoordinatorFactoryMock()\n    ) -> EditJotCoordinator {\n        EditJotCoordinator(\n            navigation: navigation,\n            repository: repository,\n            editJotViewControllerFactory: editJotViewControllerFactory,\n            jotConflictCoordinatorFactory: jotConflictCoordinatorFactory,\n            renameJotCoordinatorFactory: renameJotCoordinatorFactory,\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/EditJotPage/EditJotRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class EditJotRepositoryTests: XCTestCase {\n\n    func test_ubiquitousInfo_forwardsToUbiquitousFileService() {\n        // Given\n        let expectedInfo = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        let url = URL(staticString: \"file:///cloud/note.jot\")\n        let repository = EditJotRepository(\n            ubiquitousFileService: FileServiceMock(\n                ubiquitousInfoProvider: { receivedURL in\n                    XCTAssertEqual(receivedURL, url)\n                    return expectedInfo\n                }\n            ),\n            jotFileService: JotFileServiceMock(),\n            jotFileConflictService: JotFileConflictServiceMock()\n        )\n\n        // When\n        let result = repository.ubiquitousInfo(url: url)\n\n        // Then\n        XCTAssertEqual(result, expectedInfo)\n    }\n\n    func test_readDrawing_givenValidJotFile_returnsDrawingAndWidth() async throws {\n        // Given\n        let drawing = PKDrawing()\n        let drawingData = drawing.dataRepresentation()\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repository = EditJotRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: JotFileServiceMock(\n                readJotFileProvider: { _ in\n                    JotFile(\n                        info: info,\n                        jot: Jot(version: 3, drawing: drawingData, width: 800)\n                    )\n                }\n            ),\n            jotFileConflictService: JotFileConflictServiceMock()\n        )\n\n        // When\n        let result = try await repository.readDrawing(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(result.width, 800)\n        XCTAssertEqual(result.drawing.strokes.count, drawing.strokes.count)\n    }\n\n    func test_writeDrawing_writesEncodedDrawingViaJotFileService() async throws {\n        // Given\n        let writeProviderExpectation = XCTestExpectation(description: \"JotFileServiceMock.writeProvider is called.\")\n        let drawing = PKDrawing()\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repository = EditJotRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: JotFileServiceMock(\n                writeProvider: { jotFile in\n                    // Then\n                    XCTAssertEqual(jotFile.info, info)\n                    XCTAssertEqual(jotFile.jot.drawing, drawing.dataRepresentation())\n                    writeProviderExpectation.fulfill()\n                }\n            ),\n            jotFileConflictService: JotFileConflictServiceMock()\n        )\n\n        // When\n        try await repository.writeDrawing(jotFileInfo: info, drawing: drawing)\n\n        // Then\n        await fulfillment(of: [writeProviderExpectation], timeout: 0.2)\n    }\n\n    func test_getConflictingVersions_forwardsToConflictService() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let expected = [\n            JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info)\n        ]\n        let repository = EditJotRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFileConflictService: JotFileConflictServiceMock(\n                getConfictingVersionsProvider: { receivedInfo in\n                    XCTAssertEqual(receivedInfo, info)\n                    return expected\n                }\n            )\n        )\n\n        // When\n        let result = repository.getConflictingVersions(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(result, expected)\n    }\n\n    func test_duplicate_forwardsToJotFileService() throws {\n        // Given\n        let original = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let duplicated = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note-1.jot\"),\n            name: \"note-1\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repository = EditJotRepository(\n            ubiquitousFileService: FileServiceMock(),\n            jotFileService: JotFileServiceMock(\n                duplicateProvider: { receivedInfo in\n                    XCTAssertEqual(receivedInfo, original)\n                    return duplicated\n                }\n            ),\n            jotFileConflictService: JotFileConflictServiceMock()\n        )\n\n        // When\n        let result = try repository.duplicate(jotFileInfo: original)\n\n        // Then\n        XCTAssertEqual(result, duplicated)\n    }\n}\n"
  },
  {
    "path": "Tests/EditJotPage/EditJotViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class EditJotViewModelTests: XCTestCase {\n\n    func test_didLoad_givenNoConflictingVersions_yieldsDrawingFromRepository() async throws {\n        // Given\n        let drawing = PKDrawing()\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                readDrawingProvider: { _ in (drawing, 1024) }\n            ),\n            coordinator: EditJotCoordinatorMock(),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n\n        // Then\n        var iterator = viewModel.drawing.makeAsyncIterator()\n        let nextValue = await iterator.next()\n        let received = try XCTUnwrap(nextValue)\n        XCTAssertEqual(received.width, 1024)\n    }\n\n    func test_didLoad_givenReadDrawingThrows_logsError() async {\n        // Given\n        let errorExpectation = XCTestExpectation(description: \"LoggerMock.errorProvider is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                readDrawingProvider: { _ in throw NSError(domain: \"test\", code: 0) }\n            ),\n            coordinator: EditJotCoordinatorMock(),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock(\n                errorProvider: { message in\n                    if message.contains(\"Failed to read drawing\") {\n                        errorExpectation.fulfill()\n                    }\n                }\n            )\n        )\n\n        // When\n        viewModel.didLoad()\n\n        // Then\n        await fulfillment(of: [errorExpectation], timeout: 1)\n    }\n\n    func test_didLoad_givenConflictingVersions_invokesShowJotConflictPage() async {\n        // Given\n        let conflictExpectation = XCTestExpectation(description: \"Coordinator.showJotConflictPage is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            showJotConflictPageProvider: { _, _, _ in conflictExpectation.fulfill() }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                getConflictingVersionsProvider: { _ in\n                    [JotFileVersion(localizedNameOfSavingComputer: nil, info: info)]\n                }\n            ),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n\n        // Then\n        await fulfillment(of: [conflictExpectation], timeout: 1)\n    }\n\n    func test_didTapBackButton_givenNoConflicts_invokesGoBack() async {\n        // Given\n        let goBackExpectation = XCTestExpectation(description: \"Coordinator.goBack is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            goBackProvider: { goBackExpectation.fulfill() }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didTapBackButton()\n\n        // Then\n        await fulfillment(of: [goBackExpectation], timeout: 1)\n    }\n\n    func test_didTapBackButton_givenConflicts_invokesShowJotConflictPage() async {\n        // Given\n        let conflictExpectation = XCTestExpectation(description: \"Coordinator.showJotConflictPage is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            showJotConflictPageProvider: { _, _, _ in conflictExpectation.fulfill() }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                getConflictingVersionsProvider: { _ in\n                    [JotFileVersion(localizedNameOfSavingComputer: nil, info: info)]\n                }\n            ),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didTapBackButton()\n\n        // Then\n        await fulfillment(of: [conflictExpectation], timeout: 1)\n    }\n\n    func test_showsBackButton_givenDidLoadAndCanGoBack_yieldsTrue() async throws {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            canGoBackProvider: { true }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        var iterator = viewModel.showsBackButton.makeAsyncIterator()\n        let nextValue = await iterator.next()\n        let value = try XCTUnwrap(nextValue)\n\n        // Then\n        XCTAssertTrue(value)\n    }\n\n    func test_didTapToggleEditingButton_givenFalse_yieldsTrue() async throws {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(),\n            coordinator: EditJotCoordinatorMock(),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didTapToggleEditingButton(isEditing: false)\n\n        // Then\n        var iterator = viewModel.isEditing.makeAsyncIterator()\n        let nextValue = await iterator.next()\n        let firstValue = try XCTUnwrap(nextValue)\n        let value = try XCTUnwrap(firstValue)\n        XCTAssertTrue(value)\n    }\n\n    func test_menuConfigurations_givenDuplicateActionThrows_invokesShowInfoAlert() async {\n        // Given\n        let alertExpectation = XCTestExpectation(description: \"Coordinator.showInfoAlert is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            showInfoAlertProvider: { _, _ in alertExpectation.fulfill() }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                duplicateProvider: { _ in throw NSError(domain: \"test\", code: 0) }\n            ),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When (find duplicate action and invoke)\n        let configurations = viewModel.menuConfigurations.make(popoverAnchorProvider: { nil })\n        let duplicateAction = configurations.compactMap { configuration -> JotMenuConfiguration.Action? in\n            if case let .action(action) = configuration, action.systemImageName == \"plus.square.on.square\" {\n                return action\n            }\n            return nil\n        }.first\n        try? XCTUnwrap(duplicateAction).handler()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [alertExpectation], timeout: 1)\n    }\n\n    func test_menuConfigurations_givenDuplicateActionSucceeds_invokesOpenJot() async {\n        // Given\n        let openJotExpectation = XCTestExpectation(description: \"Coordinator.openJot is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let duplicatedInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note 1.jot\"),\n            name: \"note 1\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = EditJotCoordinatorMock(\n            openJotProvider: { received in\n                XCTAssertEqual(received, duplicatedInfo)\n                openJotExpectation.fulfill()\n            }\n        )\n        let viewModel = EditJotViewModel(\n            jotFileInfo: info,\n            repository: EditJotRepositoryMock(\n                duplicateProvider: { _ in duplicatedInfo }\n            ),\n            coordinator: coordinator,\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let configurations = viewModel.menuConfigurations.make(popoverAnchorProvider: { nil })\n        let duplicateAction = configurations.compactMap { configuration -> JotMenuConfiguration.Action? in\n            if case let .action(action) = configuration, action.systemImageName == \"plus.square.on.square\" {\n                return action\n            }\n            return nil\n        }.first\n        try? XCTUnwrap(duplicateAction).handler()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [openJotExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/EnableCloudPage/EnableCloudCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class EnableCloudCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsNavigationControllerWithFactoryProducedRoot() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let madeViewController = UIViewController()\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, animated in\n                MainActor.assumeIsolated {\n                    // Then\n                    XCTAssertTrue(viewController is UINavigationController)\n                    let navigationController = viewController as? UINavigationController\n                    XCTAssertEqual(navigationController?.viewControllers.first, madeViewController)\n                    XCTAssertTrue(animated)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = EnableCloudCoordinator(\n            navigation: navigation,\n            enableCloudViewControllerFactory: EnableCloudViewControllerFactoryMock(\n                makeProvider: { _ in madeViewController }\n            )\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_openLearnHowToEnable_givenInvoked_invokesNavigationOpenExternalWithSupportURL() {\n        // Given\n        let openExpectation = XCTestExpectation(description: \"Navigation.openExternal is called.\")\n        let navigation = Navigation.test(\n            openExternalURLProvider: { receivedURL in\n                // Then\n                XCTAssertEqual(receivedURL, EnableICloudSupportURL().toURL())\n                openExpectation.fulfill()\n            }\n        )\n        let coordinator = EnableCloudCoordinator(\n            navigation: navigation,\n            enableCloudViewControllerFactory: EnableCloudViewControllerFactoryMock()\n        )\n\n        // When\n        coordinator.openLearnHowToEnable()\n\n        // Then\n        wait(for: [openExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenInvoked_invokesNavigationDismissAnimated() {\n        // Given\n        let dismissExpectation = XCTestExpectation(description: \"Navigation.dismiss is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { animated, _ in\n                // Then\n                XCTAssertTrue(animated)\n                dismissExpectation.fulfill()\n            }\n        )\n        let coordinator = EnableCloudCoordinator(\n            navigation: navigation,\n            enableCloudViewControllerFactory: EnableCloudViewControllerFactoryMock()\n        )\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        wait(for: [dismissExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenCompletion_invokesOnEnd() async {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"EnableCloudCoordinator.onEnd is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { _, completion in\n                completion?()\n            }\n        )\n        let coordinator = EnableCloudCoordinator(\n            navigation: navigation,\n            enableCloudViewControllerFactory: EnableCloudViewControllerFactoryMock()\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        await fulfillment(of: [onEndExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/EnableCloudPage/EnableCloudViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class EnableCloudViewModelTests: XCTestCase {\n\n    func test_items_givenInit_yieldsHeaderAndTwoFeatureRows() async throws {\n        // Given\n        let viewModel = EnableCloudViewModel(coordinator: EnableCloudCoordinatorMock())\n\n        // When\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 3)\n    }\n\n    func test_rightNavigationItems_givenInit_yieldsXmarkSymbol() async throws {\n        // Given\n        let viewModel = EnableCloudViewModel(coordinator: EnableCloudCoordinatorMock())\n\n        // When\n        let items = try await firstValue(of: viewModel.rightNavigationItems)\n\n        // Then\n        XCTAssertEqual(items.count, 1)\n        guard case let .symbol(systemImageName, _) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        XCTAssertEqual(systemImageName, \"xmark\")\n    }\n\n    func test_rightNavigationItem_givenTap_invokesCoordinatorDismiss() async throws {\n        // Given\n        let dismissExpectation = XCTestExpectation(description: \"EnableCloudCoordinatorMock.dismiss is called.\")\n        let coordinator = EnableCloudCoordinatorMock(\n            dismissProvider: { dismissExpectation.fulfill() }\n        )\n        let viewModel = EnableCloudViewModel(coordinator: coordinator)\n\n        // When\n        let items = try await firstValue(of: viewModel.rightNavigationItems)\n        guard case let .symbol(_, onAction) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        onAction()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [dismissExpectation], timeout: 1)\n    }\n\n    func test_actions_givenLearnHowToEnableTap_invokesCoordinatorOpenLearnHowToEnable() async throws {\n        // Given\n        let openExpectation = XCTestExpectation(\n            description: \"EnableCloudCoordinatorMock.openLearnHowToEnable is called.\"\n        )\n        let coordinator = EnableCloudCoordinatorMock(\n            openLearnHowToEnableProvider: { openExpectation.fulfill() }\n        )\n        let viewModel = EnableCloudViewModel(coordinator: coordinator)\n\n        // When\n        XCTAssertEqual(viewModel.actions.count, 1)\n        viewModel.actions[0].action()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [openExpectation], timeout: 1)\n    }\n}\n\n@MainActor\nprivate func firstValue<S: AsyncSequence & Sendable>(\n    of sequence: S\n) async throws -> S.Element where S.Element: Sendable {\n    var iterator = sequence.makeAsyncIterator()\n    guard let value = try await iterator.next() else {\n        throw NSError(domain: \"EnableCloudViewModelTests\", code: 0)\n    }\n    return value\n}\n"
  },
  {
    "path": "Tests/EnableCloudPage/FeatureRowCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class FeatureRowCellViewModelTests: XCTestCase {\n\n    func test_init_storesSystemImageNameAndText() {\n        // When\n        let viewModel = FeatureRowCellViewModel(\n            systemImageName: \"icloud\",\n            text: \"Sync across devices\"\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.systemImageName, \"icloud\")\n        XCTAssertEqual(viewModel.text, \"Sync across devices\")\n    }\n}\n"
  },
  {
    "path": "Tests/FileService/LocalFileServiceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport XCTest\n\n@testable import Jottre\n\nfinal class LocalFileServiceTests: XCTestCase {\n\n    private var rootDirectory: URL!\n    private var fileService: LocalFileService!\n\n    override func setUpWithError() throws {\n        try super.setUpWithError()\n        rootDirectory = FileManager.default.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString, isDirectory: true)\n        try FileManager.default.createDirectory(at: rootDirectory, withIntermediateDirectories: true)\n        fileService = LocalFileService(fileManager: FileManager.default)\n    }\n\n    override func tearDownWithError() throws {\n        try? FileManager.default.removeItem(at: rootDirectory)\n        rootDirectory = nil\n        fileService = nil\n        try super.tearDownWithError()\n    }\n\n    func test_isEnabled_alwaysReturnsTrue() {\n        // Then\n        XCTAssertTrue(fileService.isEnabled())\n    }\n\n    func test_temporaryDirectory_returnsFileManagerTemporaryDirectory() {\n        // When\n        let url = fileService.temporaryDirectory()\n\n        // Then\n        XCTAssertEqual(url, FileManager.default.temporaryDirectory)\n    }\n\n    func test_writeFileThenReadFile_roundTripsBytes() throws {\n        // Given\n        let fileURL = rootDirectory.appendingPathComponent(\"note.jot\")\n        let payload = Data(\"Hello\".utf8)\n\n        // When\n        try fileService.writeFile(fileURL: fileURL, data: payload)\n        let readBack = try fileService.readFile(fileURL: fileURL)\n\n        // Then\n        XCTAssertEqual(readBack, payload)\n    }\n\n    func test_fileExists_givenWrittenFile_returnsTrue() throws {\n        // Given\n        let fileURL = rootDirectory.appendingPathComponent(\"note.jot\")\n        try Data().write(to: fileURL)\n\n        // Then\n        XCTAssertTrue(fileService.fileExists(fileURL: fileURL))\n    }\n\n    func test_fileExists_givenMissingFile_returnsFalse() {\n        // Given\n        let fileURL = rootDirectory.appendingPathComponent(\"missing.jot\")\n\n        // Then\n        XCTAssertFalse(fileService.fileExists(fileURL: fileURL))\n    }\n\n    func test_listContents_givenMixOfFiles_returnsAllURLs() throws {\n        // Given\n        let fileURL1 = rootDirectory.appendingPathComponent(\"a.jot\")\n        let fileURL2 = rootDirectory.appendingPathComponent(\"b.txt\")\n        try Data().write(to: fileURL1)\n        try Data().write(to: fileURL2)\n\n        // When\n        let urls = try fileService.listContents(directory: rootDirectory, properties: [])\n\n        // Then\n        let names = Set(urls.map(\\.lastPathComponent))\n        XCTAssertEqual(names, [\"a.jot\", \"b.txt\"])\n    }\n\n    func test_moveFile_movesFileToDestinationAndDeletesOriginal() throws {\n        // Given\n        let originalURL = rootDirectory.appendingPathComponent(\"original.jot\")\n        let destinationURL = rootDirectory.appendingPathComponent(\"destination.jot\")\n        try Data(\"payload\".utf8).write(to: originalURL)\n\n        // When\n        try fileService.moveFile(fileURL: originalURL, newFileURL: destinationURL)\n\n        // Then\n        XCTAssertFalse(FileManager.default.fileExists(atPath: originalURL.path))\n        XCTAssertTrue(FileManager.default.fileExists(atPath: destinationURL.path))\n        XCTAssertEqual(try Data(contentsOf: destinationURL), Data(\"payload\".utf8))\n    }\n\n    func test_removeFile_deletesFile() throws {\n        // Given\n        let fileURL = rootDirectory.appendingPathComponent(\"note.jot\")\n        try Data().write(to: fileURL)\n\n        // When\n        try fileService.removeFile(fileURL: fileURL)\n\n        // Then\n        XCTAssertFalse(FileManager.default.fileExists(atPath: fileURL.path))\n    }\n\n    func test_duplicateFile_givenNoExistingDuplicate_writesPlainNamedCopy() throws {\n        // Given\n        let originalURL = rootDirectory.appendingPathComponent(\"note.jot\")\n        try Data(\"payload\".utf8).write(to: originalURL)\n\n        // When\n        let duplicatedURL = try fileService.duplicateFile(fileURL: originalURL)\n\n        // Then\n        XCTAssertEqual(duplicatedURL.pathExtension, \"jot\")\n        XCTAssertNotEqual(duplicatedURL, originalURL)\n        XCTAssertTrue(FileManager.default.fileExists(atPath: duplicatedURL.path))\n        XCTAssertEqual(try Data(contentsOf: duplicatedURL), Data(\"payload\".utf8))\n    }\n\n    func test_duplicateFile_givenExistingDuplicate_writesIncrementedNamedCopy() throws {\n        // Given\n        let originalURL = rootDirectory.appendingPathComponent(\"note.jot\")\n        try Data(\"payload\".utf8).write(to: originalURL)\n\n        // When\n        let firstDuplicate = try fileService.duplicateFile(fileURL: originalURL)\n        let secondDuplicate = try fileService.duplicateFile(fileURL: originalURL)\n\n        // Then\n        XCTAssertNotEqual(firstDuplicate, secondDuplicate)\n        XCTAssertTrue(FileManager.default.fileExists(atPath: firstDuplicate.path))\n        XCTAssertTrue(FileManager.default.fileExists(atPath: secondDuplicate.path))\n    }\n\n    func test_directoryChanges_emitsInitialEventOnSubscribe() async throws {\n        // Given\n        let stream = fileService.directoryChanges(directory: rootDirectory)\n        var iterator = stream.makeAsyncIterator()\n\n        // When\n        let first: Void? = await iterator.next()\n\n        // Then\n        XCTAssertNotNil(first)\n    }\n}\n"
  },
  {
    "path": "Tests/FileService/UbiquitousInfoTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class UbiquitousInfoTests: XCTestCase {\n\n    func test_equality_givenSameValues_returnsEqual() {\n        // Given\n        let lhs = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        let rhs = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n\n        // Then\n        XCTAssertEqual(lhs, rhs)\n    }\n\n    func test_equality_givenDifferentDownloadStatus_returnsNotEqual() {\n        // Given\n        let lhs = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        let rhs = UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: false)\n\n        // Then\n        XCTAssertNotEqual(lhs, rhs)\n    }\n\n    func test_equality_givenDifferentIsDownloading_returnsNotEqual() {\n        // Given\n        let lhs = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        let rhs = UbiquitousInfo(downloadStatus: .current, isDownloading: true)\n\n        // Then\n        XCTAssertNotEqual(lhs, rhs)\n    }\n\n    func test_equality_givenNilDownloadStatusOnBoth_returnsEqual() {\n        // Given\n        let lhs = UbiquitousInfo(downloadStatus: nil, isDownloading: true)\n        let rhs = UbiquitousInfo(downloadStatus: nil, isDownloading: true)\n\n        // Then\n        XCTAssertEqual(lhs, rhs)\n    }\n}\n"
  },
  {
    "path": "Tests/Helpers/Navigation+test.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\nextension Navigation {\n\n    static func test(\n        openURLProvider: @Sendable @escaping (_ url: URL) -> Void = { _ in },\n        openExternalURLProvider: @Sendable @escaping (_ url: URL) -> Void = { _ in },\n        openSceneProvider: @Sendable @escaping (_ url: URL) -> Void = { _ in },\n        presentViewControllerProvider:\n            @Sendable @escaping (_ viewController: UIViewController, _ animated: Bool) -> Void = { _, _ in },\n        dismissViewControllerProvider:\n            @Sendable @escaping (_ animated: Bool, _ completion: (@Sendable () -> Void)?) -> Void = { _, _ in },\n        popViewControllerProvider: @Sendable @escaping (_ animated: Bool) -> Void = { _ in },\n        getViewControllersProvider: @MainActor @escaping () -> [UIViewController] = { [] }\n    ) -> Navigation {\n        Navigation(\n            openURLProvider: openURLProvider,\n            openExternalURLProvider: openExternalURLProvider,\n            openSceneProvider: openSceneProvider,\n            presentViewControllerProvider: presentViewControllerProvider,\n            dismissViewControllerProvider: dismissViewControllerProvider,\n            popViewControllerProvider: popViewControllerProvider,\n            getViewControllersProvider: getViewControllersProvider\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/Helpers/UIAlertAction+invoke.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\nextension UIAlertAction {\n\n    func invokeHandler() {\n        typealias Handler = @convention(block) (UIAlertAction) -> Void\n        guard let block = value(forKey: \"handler\") else {\n            return\n        }\n        let handler = unsafeBitCast(block as AnyObject, to: Handler.self)\n        handler(self)\n    }\n}\n"
  },
  {
    "path": "Tests/Helpers/URL+staticString.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\nextension URL {\n\n    init(staticString: StaticString) {\n        guard let url = URL(string: \"\\(staticString)\") else {\n            preconditionFailure(\"Invalid static URL string: \\(staticString)\")\n        }\n        self = url\n    }\n}\n"
  },
  {
    "path": "Tests/Jot/JotFileServiceDocumentsDirectoryContentsTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotFileServiceDocumentsDirectoryContentsTests: XCTestCase {\n\n    private var localDocumentsDirectory: URL!\n    private var ubiquitousDocumentsDirectory: URL!\n\n    override func setUpWithError() throws {\n        try super.setUpWithError()\n        localDocumentsDirectory = FileManager.default.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString, isDirectory: true)\n        ubiquitousDocumentsDirectory = FileManager.default.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString, isDirectory: true)\n        try FileManager.default.createDirectory(\n            at: localDocumentsDirectory,\n            withIntermediateDirectories: true\n        )\n        try FileManager.default.createDirectory(\n            at: ubiquitousDocumentsDirectory,\n            withIntermediateDirectories: true\n        )\n    }\n\n    override func tearDownWithError() throws {\n        try? FileManager.default.removeItem(at: localDocumentsDirectory)\n        try? FileManager.default.removeItem(at: ubiquitousDocumentsDirectory)\n        localDocumentsDirectory = nil\n        ubiquitousDocumentsDirectory = nil\n        try super.tearDownWithError()\n    }\n\n    func test_documentsDirectoryContents_givenLocalAndUbiquitousJotFiles_yieldsCombinedContents() async throws {\n        // Given\n        let localFileURL = localDocumentsDirectory.appendingPathComponent(\"local.jot\")\n        let ubiquitousFileURL = ubiquitousDocumentsDirectory.appendingPathComponent(\"cloud.jot\")\n        try Data().write(to: localFileURL)\n        try Data().write(to: ubiquitousFileURL)\n\n        let jotFileService = makeJotFileService()\n\n        // When\n        var iterator = jotFileService.documentsDirectoryContents().makeAsyncIterator()\n        let infos = try await XCTUnwrapAsync(try await iterator.next())\n\n        // Then\n        let names = Set(infos.map(\\.name))\n        XCTAssertEqual(names, [\"local\", \"cloud\"])\n        let cloudInfo = try XCTUnwrap(infos.first(where: { $0.name == \"cloud\" }))\n        XCTAssertNotNil(cloudInfo.ubiquitousInfo)\n        let localInfo = try XCTUnwrap(infos.first(where: { $0.name == \"local\" }))\n        XCTAssertNil(localInfo.ubiquitousInfo)\n    }\n\n    func test_documentsDirectoryContents_givenNonJotFileInDirectory_filtersItOut() async throws {\n        // Given\n        let jotFileURL = localDocumentsDirectory.appendingPathComponent(\"real.jot\")\n        let textFileURL = localDocumentsDirectory.appendingPathComponent(\"ignored.txt\")\n        try Data().write(to: jotFileURL)\n        try Data().write(to: textFileURL)\n\n        let jotFileService = makeJotFileService(includeUbiquitous: false)\n\n        // When\n        var iterator = jotFileService.documentsDirectoryContents().makeAsyncIterator()\n        let infos = try await XCTUnwrapAsync(try await iterator.next())\n\n        // Then\n        XCTAssertEqual(infos.map(\\.name), [\"real\"])\n    }\n\n    func test_documentsDirectoryContents_givenLocalDirectoryUnavailable_yieldsOnlyUbiquitousContents() async throws {\n        // Given\n        let ubiquitousFileURL = ubiquitousDocumentsDirectory.appendingPathComponent(\"cloud.jot\")\n        try Data().write(to: ubiquitousFileURL)\n\n        let localFileServiceMock = FileServiceMock(\n            documentsDirectoryProvider: { nil },\n            listContentsProvider: { _, _ in [] }\n        )\n        let ubiquitousFileServiceMock = FileServiceMock(\n            documentsDirectoryProvider: { [ubiquitousDocumentsDirectory] in ubiquitousDocumentsDirectory },\n            listContentsProvider: { directory, _ in\n                try FileManager.default.contentsOfDirectory(\n                    at: directory,\n                    includingPropertiesForKeys: nil\n                )\n            },\n            directoryChangesProvider: { _ in\n                AsyncStream { continuation in\n                    continuation.yield(())\n                    continuation.finish()\n                }\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        var iterator = jotFileService.documentsDirectoryContents().makeAsyncIterator()\n        let infos = try await XCTUnwrapAsync(try await iterator.next())\n\n        // Then\n        XCTAssertEqual(infos.map(\\.name), [\"cloud\"])\n    }\n\n    private func makeJotFileService(includeUbiquitous: Bool = true) -> JotFileService {\n        let localFileServiceMock = FileServiceMock(\n            documentsDirectoryProvider: { [localDocumentsDirectory] in localDocumentsDirectory },\n            listContentsProvider: { directory, _ in\n                try FileManager.default.contentsOfDirectory(\n                    at: directory,\n                    includingPropertiesForKeys: nil\n                )\n            },\n            directoryChangesProvider: { _ in\n                AsyncStream { continuation in\n                    continuation.yield(())\n                    continuation.finish()\n                }\n            }\n        )\n        let ubiquitousFileServiceMock: FileServiceMock\n        if includeUbiquitous {\n            ubiquitousFileServiceMock = FileServiceMock(\n                documentsDirectoryProvider: { [ubiquitousDocumentsDirectory] in ubiquitousDocumentsDirectory },\n                listContentsProvider: { directory, _ in\n                    try FileManager.default.contentsOfDirectory(\n                        at: directory,\n                        includingPropertiesForKeys: nil\n                    )\n                },\n                directoryChangesProvider: { _ in\n                    AsyncStream { continuation in\n                        continuation.yield(())\n                        continuation.finish()\n                    }\n                }\n            )\n        } else {\n            ubiquitousFileServiceMock = FileServiceMock(\n                documentsDirectoryProvider: { nil },\n                listContentsProvider: { _, _ in [] }\n            )\n        }\n        return JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/Jot/JotFileServiceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotFileServiceTests: XCTestCase {\n\n    func test_write_givenLocalJotFile_writesEncodedDataToLocalFileService() async throws {\n        // Given\n        let writeFileProviderExpectation = XCTestExpectation(\n            description: \"FileServiceMock.writeFileProvider is called.\"\n        )\n        let expectedFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let jot = Jot.makeEmpty()\n        let jotFile = JotFile(\n            info: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            ),\n            jot: jot\n        )\n        let expectedData = try PropertyListEncoder().encode(jot)\n        let localFileServiceMock = FileServiceMock(\n            writeFileProvider: { receivedFileURL, receivedData in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                XCTAssertEqual(receivedData, expectedData)\n                writeFileProviderExpectation.fulfill()\n            }\n        )\n        let ubiquitousFileServiceMock = FileServiceMock(\n            writeFileProvider: { _, _ in\n                XCTFail(\"Ubiquitous file service should not be used for local jot files.\")\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        try jotFileService.write(jotFile: jotFile)\n\n        // Then\n        await fulfillment(of: [writeFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_write_givenUbiquitousJotFile_writesEncodedDataToUbiquitousFileService() async throws {\n        // Given\n        let writeFileProviderExpectation = XCTestExpectation(description: \"Ubiquitous writeFileProvider is called.\")\n        let expectedFileURL = URL(staticString: \"file:///cloud/note.jot\")\n        let jot = Jot.makeEmpty()\n        let jotFile = JotFile(\n            info: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: UbiquitousInfo(\n                    downloadStatus: .current,\n                    isDownloading: false\n                )\n            ),\n            jot: jot\n        )\n        let localFileServiceMock = FileServiceMock(\n            writeFileProvider: { _, _ in\n                XCTFail(\"Local file service should not be used for ubiquitous jot files.\")\n            }\n        )\n        let ubiquitousFileServiceMock = FileServiceMock(\n            writeFileProvider: { receivedFileURL, _ in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                writeFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        try jotFileService.write(jotFile: jotFile)\n\n        // Then\n        await fulfillment(of: [writeFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_readJotFile_givenLocalJotFileInfo_decodesDataFromLocalFileService() async throws {\n        // Given\n        let readFileProviderExpectation = XCTestExpectation(description: \"Local readFileProvider is called.\")\n        let expectedFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let expectedJot = Jot.makeEmpty()\n        let encodedData = try PropertyListEncoder().encode(expectedJot)\n        let localFileServiceMock = FileServiceMock(\n            readFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                readFileProviderExpectation.fulfill()\n                return encodedData\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: FileServiceMock()\n        )\n\n        // When\n        let jotFile = try jotFileService.readJotFile(\n            jotFileInfo: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        )\n\n        // Then\n        XCTAssertEqual(jotFile.jot.drawing, expectedJot.drawing)\n        XCTAssertEqual(jotFile.jot.width, expectedJot.width)\n        XCTAssertEqual(jotFile.jot.version, expectedJot.version)\n        await fulfillment(of: [readFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_remove_givenLocalJotFileInfo_callsRemoveOnLocalFileService() async throws {\n        // Given\n        let removeFileProviderExpectation = XCTestExpectation(description: \"Local removeFileProvider is called.\")\n        let expectedFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let localFileServiceMock = FileServiceMock(\n            removeFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                removeFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: FileServiceMock()\n        )\n\n        // When\n        try jotFileService.remove(\n            jotFileInfo: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        )\n\n        // Then\n        await fulfillment(of: [removeFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_rename_givenLocalJotFileInfo_movesToNewURLAndReturnsUpdatedInfo() async throws {\n        // Given\n        let moveFileProviderExpectation = XCTestExpectation(description: \"Local moveFileProvider is called.\")\n        let originalFileURL = URL(staticString: \"file:///tmp/old.jot\")\n        let expectedNewFileURL = URL(staticString: \"file:///tmp/new.jot\")\n        let localFileServiceMock = FileServiceMock(\n            moveFileProvider: { receivedFileURL, receivedNewFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, originalFileURL)\n                XCTAssertEqual(receivedNewFileURL, expectedNewFileURL)\n                moveFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: FileServiceMock()\n        )\n\n        // When\n        let renamed = try jotFileService.rename(\n            jotFileInfo: JotFile.Info(\n                url: originalFileURL,\n                name: \"old\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            ),\n            newName: \"new\"\n        )\n\n        // Then\n        XCTAssertEqual(renamed.url, expectedNewFileURL)\n        XCTAssertEqual(renamed.name, \"new\")\n        await fulfillment(of: [moveFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_duplicate_givenLocalJotFileInfo_returnsDuplicatedInfo() async throws {\n        // Given\n        let duplicateFileProviderExpectation = XCTestExpectation(description: \"Local duplicateFileProvider is called.\")\n        let originalFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let duplicatedFileURL = URL(staticString: \"file:///tmp/note-1.jot\")\n        let localFileServiceMock = FileServiceMock(\n            duplicateFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, originalFileURL)\n                duplicateFileProviderExpectation.fulfill()\n                return duplicatedFileURL\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: FileServiceMock()\n        )\n\n        // When\n        let duplicated = try jotFileService.duplicate(\n            jotFileInfo: JotFile.Info(\n                url: originalFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        )\n\n        // Then\n        XCTAssertEqual(duplicated.url, duplicatedFileURL)\n        XCTAssertEqual(duplicated.name, \"note-1\")\n        await fulfillment(of: [duplicateFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_move_givenShouldBecomeUbiquitous_movesIntoUbiquitousDocumentsDirectory() async throws {\n        // Given\n        let moveFileProviderExpectation = XCTestExpectation(description: \"Ubiquitous moveFileProvider is called.\")\n        let originalFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let ubiquitousDocumentsDirectory = URL(staticString: \"file:///cloud/Documents/\")\n        let expectedNewFileURL = ubiquitousDocumentsDirectory.appendingPathComponent(\"note.jot\", isDirectory: false)\n        let ubiquitousFileServiceMock = FileServiceMock(\n            documentsDirectoryProvider: { ubiquitousDocumentsDirectory },\n            moveFileProvider: { receivedFileURL, receivedNewFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, originalFileURL)\n                XCTAssertEqual(receivedNewFileURL, expectedNewFileURL)\n                moveFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: FileServiceMock(),\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        try await jotFileService.move(\n            jotFileInfo: JotFile.Info(\n                url: originalFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            ),\n            shouldBecomeUbiquitous: true\n        )\n\n        // Then\n        await fulfillment(of: [moveFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_readJotFile_givenUbiquitousJotFileInfo_decodesDataFromUbiquitousFileService() async throws {\n        // Given\n        let readFileProviderExpectation = XCTestExpectation(description: \"Ubiquitous readFileProvider is called.\")\n        let expectedFileURL = URL(staticString: \"file:///cloud/note.jot\")\n        let expectedJot = Jot.makeEmpty()\n        let encodedData = try PropertyListEncoder().encode(expectedJot)\n        let ubiquitousFileServiceMock = FileServiceMock(\n            readFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                readFileProviderExpectation.fulfill()\n                return encodedData\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: FileServiceMock(\n                readFileProvider: { _ in\n                    XCTFail(\"Local file service should not be used for ubiquitous jot files.\")\n                    return Data()\n                }\n            ),\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        _ = try jotFileService.readJotFile(\n            jotFileInfo: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n            )\n        )\n\n        // Then\n        await fulfillment(of: [readFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_remove_givenUbiquitousJotFileInfo_callsRemoveOnUbiquitousFileService() async throws {\n        // Given\n        let removeFileProviderExpectation = XCTestExpectation(description: \"Ubiquitous removeFileProvider is called.\")\n        let expectedFileURL = URL(staticString: \"file:///cloud/note.jot\")\n        let ubiquitousFileServiceMock = FileServiceMock(\n            removeFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                removeFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: FileServiceMock(\n                removeFileProvider: { _ in\n                    XCTFail(\"Local file service should not be used for ubiquitous jot files.\")\n                }\n            ),\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        try jotFileService.remove(\n            jotFileInfo: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n            )\n        )\n\n        // Then\n        await fulfillment(of: [removeFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_rename_givenUbiquitousJotFileInfo_movesViaUbiquitousFileService() async throws {\n        // Given\n        let moveFileProviderExpectation = XCTestExpectation(description: \"Ubiquitous moveFileProvider is called.\")\n        let originalFileURL = URL(staticString: \"file:///cloud/old.jot\")\n        let expectedNewFileURL = URL(staticString: \"file:///cloud/new.jot\")\n        let ubiquitousFileServiceMock = FileServiceMock(\n            moveFileProvider: { receivedFileURL, receivedNewFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, originalFileURL)\n                XCTAssertEqual(receivedNewFileURL, expectedNewFileURL)\n                moveFileProviderExpectation.fulfill()\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: FileServiceMock(),\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        let renamed = try jotFileService.rename(\n            jotFileInfo: JotFile.Info(\n                url: originalFileURL,\n                name: \"old\",\n                modificationDate: nil,\n                ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n            ),\n            newName: \"new\"\n        )\n\n        // Then\n        XCTAssertEqual(renamed.url, expectedNewFileURL)\n        XCTAssertEqual(renamed.name, \"new\")\n        await fulfillment(of: [moveFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_duplicate_givenUbiquitousJotFileInfo_returnsDuplicatedInfoFromUbiquitousFileService() async throws {\n        // Given\n        let duplicateFileProviderExpectation = XCTestExpectation(\n            description: \"Ubiquitous duplicateFileProvider is called.\"\n        )\n        let originalFileURL = URL(staticString: \"file:///cloud/note.jot\")\n        let duplicatedFileURL = URL(staticString: \"file:///cloud/note-1.jot\")\n        let originalUbiquitousInfo = UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        let ubiquitousFileServiceMock = FileServiceMock(\n            duplicateFileProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, originalFileURL)\n                duplicateFileProviderExpectation.fulfill()\n                return duplicatedFileURL\n            }\n        )\n        let jotFileService = JotFileService(\n            localFileService: FileServiceMock(),\n            ubiquitousFileService: ubiquitousFileServiceMock\n        )\n\n        // When\n        let duplicated = try jotFileService.duplicate(\n            jotFileInfo: JotFile.Info(\n                url: originalFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: originalUbiquitousInfo\n            )\n        )\n\n        // Then\n        XCTAssertEqual(duplicated.url, duplicatedFileURL)\n        XCTAssertEqual(duplicated.name, \"note-1\")\n        XCTAssertEqual(duplicated.ubiquitousInfo, originalUbiquitousInfo)\n        await fulfillment(of: [duplicateFileProviderExpectation], timeout: 0.2)\n    }\n\n    func test_move_givenDocumentsDirectoryUnresolved_throwsCouldNotResolveFailure() async {\n        // Given\n        let localFileServiceMock = FileServiceMock(\n            documentsDirectoryProvider: { nil }\n        )\n        let jotFileService = JotFileService(\n            localFileService: localFileServiceMock,\n            ubiquitousFileService: FileServiceMock()\n        )\n\n        // When / Then\n        do {\n            try await jotFileService.move(\n                jotFileInfo: JotFile.Info(\n                    url: URL(staticString: \"file:///tmp/note.jot\"),\n                    name: \"note\",\n                    modificationDate: nil,\n                    ubiquitousInfo: nil\n                ),\n                shouldBecomeUbiquitous: false\n            )\n            XCTFail(\"Expected JotFileService.Failure.couldNotResolveDocumentsDirectory.\")\n        } catch JotFileService.Failure.couldNotResolveDocumentsDirectory {\n            // Expected\n        } catch {\n            XCTFail(\"Unexpected error: \\(error)\")\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Jot/JotFileTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotFileTests: XCTestCase {\n\n    func test_infoInit_givenURLWithJotExtension_succeedsAndDerivesNameFromURL() throws {\n        // Given\n        let url = URL(staticString: \"file:///tmp/note.jot\")\n\n        // When\n        let info = try XCTUnwrap(\n            JotFile.Info(\n                url: url,\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        )\n\n        // Then\n        XCTAssertEqual(info.name, \"note\")\n        XCTAssertEqual(info.url, url)\n    }\n\n    func test_infoInit_givenURLWithNonJotExtension_returnsNil() {\n        // Given\n        let url = URL(staticString: \"file:///tmp/note.txt\")\n\n        // When\n        let info = JotFile.Info(\n            url: url,\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // Then\n        XCTAssertNil(info)\n    }\n\n    func test_makeEmptyJot_returnsVersionThreeWithDefaultWidth() {\n        // When\n        let jot = Jot.makeEmpty()\n\n        // Then\n        XCTAssertEqual(jot.version, 3)\n        XCTAssertEqual(jot.width, 1200)\n        XCTAssertFalse(jot.drawing.isEmpty)\n    }\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotConflictBusinessModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotConflictBusinessModelTests: XCTestCase {\n\n    func test_init_givenSavingComputerName_usesAsLastEditedDateString() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let version = JotFileVersion(\n            localizedNameOfSavingComputer: \"Anton's Mac\",\n            info: info\n        )\n\n        // When\n        let model = JotConflictBusinessModel(\n            name: \"label\",\n            jotFileInfo: info,\n            jotFileVersion: version\n        )\n\n        // Then\n        XCTAssertEqual(model.name, \"label\")\n        XCTAssertEqual(model.lastEditedDateString, \"Anton's Mac\")\n        XCTAssertEqual(model.jotFileInfo, info)\n    }\n\n    func test_init_givenNilSavingComputerName_returnsNotApplicableString() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let version = JotFileVersion(\n            localizedNameOfSavingComputer: nil,\n            info: info\n        )\n\n        // When\n        let model = JotConflictBusinessModel(\n            name: \"label\",\n            jotFileInfo: info,\n            jotFileVersion: version\n        )\n\n        // Then\n        XCTAssertEqual(model.lastEditedDateString, \"n/a\")\n    }\n\n    func test_toJotFileVersion_returnsOriginalVersion() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let version = JotFileVersion(localizedNameOfSavingComputer: nil, info: info)\n\n        // When\n        let model = JotConflictBusinessModel(\n            name: \"label\",\n            jotFileInfo: info,\n            jotFileVersion: version\n        )\n\n        // Then\n        XCTAssertEqual(model.toJotFileVersion(), version)\n    }\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotConflictCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotConflictCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameAndInfoTextFromBusinessModel() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let businessModel = JotConflictBusinessModel(\n            name: \"note\",\n            jotFileInfo: jotFileInfo,\n            jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: jotFileInfo)\n        )\n\n        // When\n        let viewModel = JotConflictCellViewModel(\n            jotConflict: businessModel,\n            repository: JotConflictRepositoryMock()\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"note\")\n        XCTAssertEqual(viewModel.infoText, \"Mac\")\n    }\n\n    func test_init_givenJotFileVersionWithoutSavingComputer_setsInfoTextToNa() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let businessModel = JotConflictBusinessModel(\n            name: \"note\",\n            jotFileInfo: jotFileInfo,\n            jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: nil, info: jotFileInfo)\n        )\n\n        // When\n        let viewModel = JotConflictCellViewModel(\n            jotConflict: businessModel,\n            repository: JotConflictRepositoryMock()\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.infoText, \"n/a\")\n    }\n\n    func test_getPreviewImage_forwardsJotFileInfoAndVersionToRepository() async throws {\n        // Given\n        let getPreviewImageExpectation = XCTestExpectation(\n            description: \"JotConflictRepositoryMock.getPreviewImageProvider is called.\"\n        )\n        let expectedImage = UIImage()\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let jotFileVersion = JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: jotFileInfo)\n        let businessModel = JotConflictBusinessModel(\n            name: \"note\",\n            jotFileInfo: jotFileInfo,\n            jotFileVersion: jotFileVersion\n        )\n        let repositoryMock = JotConflictRepositoryMock(\n            getPreviewImageProvider: { receivedInfo, receivedVersion, receivedStyle, receivedScale in\n                // Then\n                XCTAssertEqual(receivedInfo, jotFileInfo)\n                XCTAssertEqual(receivedVersion, jotFileVersion)\n                XCTAssertEqual(receivedStyle, .dark)\n                XCTAssertEqual(receivedScale, 3.0)\n                getPreviewImageExpectation.fulfill()\n                return expectedImage\n            }\n        )\n        let viewModel = JotConflictCellViewModel(\n            jotConflict: businessModel,\n            repository: repositoryMock\n        )\n\n        // When\n        let image = await viewModel.getPreviewImage(userInterfaceStyle: .dark, displayScale: 3.0)\n\n        // Then\n        XCTAssertIdentical(image, expectedImage)\n        await fulfillment(of: [getPreviewImageExpectation], timeout: 0.2)\n    }\n\n    func test_handleAction_givenTap_doesNothing() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = JotConflictCellViewModel(\n            jotConflict: JotConflictBusinessModel(\n                name: \"note\",\n                jotFileInfo: jotFileInfo,\n                jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: nil, info: jotFileInfo)\n            ),\n            repository: JotConflictRepositoryMock()\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"note\")\n    }\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotConflictCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotConflictCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsModalNavigationController() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let madeViewController = UIViewController()\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    let navigationController = viewController as? UINavigationController\n                    XCTAssertEqual(navigationController?.viewControllers.first, madeViewController)\n                    XCTAssertTrue(madeViewController.isModalInPresentation)\n                    XCTAssertFalse(navigationController?.navigationBar.prefersLargeTitles ?? true)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = JotConflictCoordinator(\n            jotFileInfo: info,\n            jotFileVersions: [JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info)],\n            repository: JotConflictRepositoryMock(),\n            navigation: navigation,\n            jotConflictViewControllerFactory: JotConflictViewControllerFactoryMock(\n                makeProvider: { _ in madeViewController }\n            ),\n            onResult: { _ in }\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenCompletion_invokesNavigationDismissAndOnEnd() async {\n        // Given\n        let completionExpectation = XCTestExpectation(description: \"Completion is invoked.\")\n        let onEndExpectation = XCTestExpectation(description: \"JotConflictCoordinator.onEnd is invoked.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { _, completion in\n                completion?()\n            }\n        )\n        let coordinator = JotConflictCoordinator(\n            jotFileInfo: info,\n            jotFileVersions: [],\n            repository: JotConflictRepositoryMock(),\n            navigation: navigation,\n            jotConflictViewControllerFactory: JotConflictViewControllerFactoryMock(),\n            onResult: { _ in }\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.dismiss(completion: { completionExpectation.fulfill() })\n\n        // Then\n        await fulfillment(of: [completionExpectation, onEndExpectation], timeout: 1)\n    }\n\n    func test_showInfoAlert_givenInvoked_presentsAlertController() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    XCTAssertTrue(viewController is UIAlertController)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = JotConflictCoordinator(\n            jotFileInfo: info,\n            jotFileVersions: [],\n            repository: JotConflictRepositoryMock(),\n            navigation: navigation,\n            jotConflictViewControllerFactory: JotConflictViewControllerFactoryMock(),\n            onResult: { _ in }\n        )\n\n        // When\n        coordinator.showInfoAlert(title: \"title\", message: \"message\")\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotConflictRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotConflictRepositoryTests: XCTestCase {\n\n    func test_resolveVersionConflicts_forwardsToJotFileConflictService() async throws {\n        // Given\n        let resolveVersionConflictsExpectation = XCTestExpectation(\n            description: \"JotFileConflictServiceMock.resolveVersionConflictsProvider is called.\"\n        )\n        let inputInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let inputVersions = [\n            JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: inputInfo),\n            JotFileVersion(localizedNameOfSavingComputer: \"iPad\", info: inputInfo),\n        ]\n        let jotFileConflictServiceMock = JotFileConflictServiceMock(\n            resolveVersionConflictsProvider: { receivedInfo, receivedVersions in\n                // Then\n                XCTAssertEqual(receivedInfo, inputInfo)\n                XCTAssertEqual(receivedVersions, inputVersions)\n                resolveVersionConflictsExpectation.fulfill()\n            }\n        )\n        let repository = JotConflictRepository(\n            jotFileConflictService: jotFileConflictServiceMock,\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(),\n            logger: LoggerMock()\n        )\n\n        // When\n        try repository.resolveVersionConflicts(jotFileInfo: inputInfo, resolvedVersions: inputVersions)\n\n        // Then\n        await fulfillment(of: [resolveVersionConflictsExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_givenCopyVersionToTemporaryReturnsNil_usesOriginalInfo() async throws {\n        // Given\n        let getPreviewImageDataExpectation = XCTestExpectation(\n            description: \"JotFilePreviewImageServiceMock.getPreviewImageDataProvider is called with original info.\"\n        )\n        let originalInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let imageData = try XCTUnwrap(UIImage(systemName: \"doc\")?.pngData())\n        let jotFileConflictServiceMock = JotFileConflictServiceMock(\n            copyVersionToTemporaryProvider: { _, _ in nil }\n        )\n        let jotFilePreviewImageServiceMock = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { receivedInfo, receivedStyle, receivedScale in\n                // Then\n                XCTAssertEqual(receivedInfo, originalInfo)\n                XCTAssertEqual(receivedStyle, .light)\n                XCTAssertEqual(receivedScale, 2.0)\n                getPreviewImageDataExpectation.fulfill()\n                return imageData\n            }\n        )\n        let repository = JotConflictRepository(\n            jotFileConflictService: jotFileConflictServiceMock,\n            jotFilePreviewImageService: jotFilePreviewImageServiceMock,\n            logger: LoggerMock()\n        )\n\n        // When\n        let image = await repository.getPreviewImage(\n            jotFileInfo: originalInfo,\n            jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: originalInfo),\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertNotNil(image)\n        await fulfillment(of: [getPreviewImageDataExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_givenCopyVersionToTemporaryReturnsInfo_usesTemporaryInfoAndCleansUp() async throws {\n        // Given\n        let getPreviewImageDataExpectation = XCTestExpectation(\n            description: \"JotFilePreviewImageServiceMock.getPreviewImageDataProvider is called with temporary info.\"\n        )\n        let originalInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let temporaryURL = FileManager.default.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString)\n            .appendingPathExtension(\"jot\")\n        try Data().write(to: temporaryURL)\n        let temporaryInfo = JotFile.Info(\n            url: temporaryURL,\n            name: \"tmp\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let imageData = try XCTUnwrap(UIImage(systemName: \"doc\")?.pngData())\n        let jotFileConflictServiceMock = JotFileConflictServiceMock(\n            copyVersionToTemporaryProvider: { _, _ in temporaryInfo }\n        )\n        let jotFilePreviewImageServiceMock = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { receivedInfo, _, _ in\n                // Then\n                XCTAssertEqual(receivedInfo, temporaryInfo)\n                getPreviewImageDataExpectation.fulfill()\n                return imageData\n            }\n        )\n        let repository = JotConflictRepository(\n            jotFileConflictService: jotFileConflictServiceMock,\n            jotFilePreviewImageService: jotFilePreviewImageServiceMock,\n            logger: LoggerMock()\n        )\n\n        // When\n        let image = await repository.getPreviewImage(\n            jotFileInfo: originalInfo,\n            jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: originalInfo),\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertNotNil(image)\n        XCTAssertFalse(FileManager.default.fileExists(atPath: temporaryURL.path))\n        await fulfillment(of: [getPreviewImageDataExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_givenPreviewImageServiceThrows_returnsNilAndLogsError() async throws {\n        // Given\n        let errorExpectation = XCTestExpectation(description: \"LoggerMock.errorProvider is called.\")\n        let originalInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repository = JotConflictRepository(\n            jotFileConflictService: JotFileConflictServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(\n                getPreviewImageDataProvider: { _, _, _ in\n                    throw NSError(domain: \"test\", code: 0)\n                }\n            ),\n            logger: LoggerMock(\n                errorProvider: { message in\n                    if message.contains(\"Failed to load conflict preview image\") {\n                        errorExpectation.fulfill()\n                    }\n                }\n            )\n        )\n\n        // When\n        let image = await repository.getPreviewImage(\n            jotFileInfo: originalInfo,\n            jotFileVersion: JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: originalInfo),\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertNil(image)\n        await fulfillment(of: [errorExpectation], timeout: 0.2)\n    }\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotConflictViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotConflictViewModelTests: XCTestCase {\n\n    func test_items_givenOneVersion_yieldsHeaderAndDeviceVersionAndProvidedVersion() async throws {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let version = JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info)\n        let viewModel = JotConflictViewModel(\n            jotFileInfo: info,\n            jotFileVersions: [version],\n            repository: JotConflictRepositoryMock(),\n            coordinator: JotConflictCoordinatorMock(),\n            onResult: { _ in }\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 3)\n    }\n\n    func test_actions_givenTwoVersions_yieldsThreeActions() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = JotConflictViewModel(\n            jotFileInfo: info,\n            jotFileVersions: [\n                JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info),\n                JotFileVersion(localizedNameOfSavingComputer: \"iPad\", info: info),\n            ],\n            repository: JotConflictRepositoryMock(),\n            coordinator: JotConflictCoordinatorMock(),\n            onResult: { _ in }\n        )\n\n        // Then: 1 device version + 2 provided versions + keep-all = 4\n        XCTAssertEqual(viewModel.actions.count, 4)\n    }\n\n    func test_actions_givenKeepAllTap_resolvesAllAndDismissesWithKeepAllResult() {\n        // Given\n        let resolveExpectation = XCTestExpectation(description: \"Repository.resolveVersionConflicts is called.\")\n        let dismissExpectation = XCTestExpectation(description: \"Coordinator.dismiss is called.\")\n        let onResultExpectation = XCTestExpectation(description: \"onResult is called with .keepAll.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = JotConflictCoordinatorMock(\n            dismissProvider: { completion in\n                dismissExpectation.fulfill()\n                completion()\n            }\n        )\n        let viewModel = JotConflictViewModel(\n            jotFileInfo: info,\n            jotFileVersions: [\n                JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info)\n            ],\n            repository: JotConflictRepositoryMock(\n                resolveVersionConflictsProvider: { _, resolved in\n                    XCTAssertEqual(resolved.count, 2)\n                    resolveExpectation.fulfill()\n                }\n            ),\n            coordinator: coordinator,\n            onResult: { result in\n                if case .keepAll = result {\n                    onResultExpectation.fulfill()\n                }\n            }\n        )\n\n        // When (last action is keepAll)\n        viewModel.actions.last?.action()\n\n        // Then\n        wait(for: [resolveExpectation, dismissExpectation, onResultExpectation], timeout: 1)\n    }\n\n    func test_actions_givenKeepVersionThrows_invokesShowInfoAlert() async {\n        // Given\n        let alertExpectation = XCTestExpectation(description: \"Coordinator.showInfoAlert is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = JotConflictCoordinatorMock(\n            showInfoAlertProvider: { _, _ in alertExpectation.fulfill() }\n        )\n        let viewModel = JotConflictViewModel(\n            jotFileInfo: info,\n            jotFileVersions: [\n                JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: info)\n            ],\n            repository: JotConflictRepositoryMock(\n                resolveVersionConflictsProvider: { _, _ in\n                    throw NSError(domain: \"test\", code: 0)\n                }\n            ),\n            coordinator: coordinator,\n            onResult: { _ in }\n        )\n\n        // When (first action is keep version)\n        viewModel.actions.first?.action()\n\n        // Then\n        await fulfillment(of: [alertExpectation], timeout: 1)\n    }\n}\n\n@MainActor\nprivate func firstValue<S: AsyncSequence & Sendable>(\n    of sequence: S\n) async throws -> S.Element where S.Element: Sendable {\n    var iterator = sequence.makeAsyncIterator()\n    guard let value = try await iterator.next() else {\n        throw NSError(domain: \"JotConflictViewModelTests\", code: 0)\n    }\n    return value\n}\n"
  },
  {
    "path": "Tests/JotConflictPage/JotFileConflictServiceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotFileConflictServiceTests: XCTestCase {\n\n    func test_getConfictingVersions_givenNilFromUnderlyingService_returnsNil() {\n        // Given\n        let service = JotFileConflictService(\n            fileConflictService: FileConflictServiceMock(\n                getConflictingVersionsProvider: { _ in nil }\n            )\n        )\n\n        // When\n        let result = service.getConfictingVersions(jotFileInfo: makeJotFileInfo())\n\n        // Then\n        XCTAssertNil(result)\n    }\n\n    func test_getConfictingVersions_givenEmptyArrayFromUnderlyingService_returnsNil() {\n        // Given\n        let service = JotFileConflictService(\n            fileConflictService: FileConflictServiceMock(\n                getConflictingVersionsProvider: { _ in [] }\n            )\n        )\n\n        // When\n        let result = service.getConfictingVersions(jotFileInfo: makeJotFileInfo())\n\n        // Then\n        XCTAssertNil(result)\n    }\n\n    func test_resolveVersionConflicts_forwardsURLsToUnderlyingService() async throws {\n        // Given\n        let resolveVersionConflictsExpectation = XCTestExpectation(\n            description: \"FileConflictServiceMock.resolveVersionConflictsProvider is called.\"\n        )\n        let inputInfo = makeJotFileInfo()\n        let versionURLA = URL(staticString: \"file:///tmp/version-a.jot\")\n        let versionURLB = URL(staticString: \"file:///tmp/version-b.jot\")\n        let versionInfos = [\n            JotFileVersion(\n                localizedNameOfSavingComputer: \"A\",\n                info: JotFile.Info(url: versionURLA, name: \"a\", modificationDate: nil, ubiquitousInfo: nil)\n            ),\n            JotFileVersion(\n                localizedNameOfSavingComputer: \"B\",\n                info: JotFile.Info(url: versionURLB, name: \"b\", modificationDate: nil, ubiquitousInfo: nil)\n            ),\n        ]\n        let fileConflictServiceMock = FileConflictServiceMock(\n            resolveVersionConflictsProvider: { receivedFileURL, receivedResolvedVersions in\n                // Then\n                XCTAssertEqual(receivedFileURL, inputInfo.url)\n                XCTAssertEqual(receivedResolvedVersions, [versionURLA, versionURLB])\n                resolveVersionConflictsExpectation.fulfill()\n            }\n        )\n        let service = JotFileConflictService(fileConflictService: fileConflictServiceMock)\n\n        // When\n        try service.resolveVersionConflicts(jotFileInfo: inputInfo, resolvedVersions: versionInfos)\n\n        // Then\n        await fulfillment(of: [resolveVersionConflictsExpectation], timeout: 0.2)\n    }\n\n    func test_copyVersionToTemporary_givenUnderlyingReturnsURL_returnsInfoWithTemporaryURLAndOriginalMetadata() throws {\n        // Given\n        let temporaryURL = URL(staticString: \"file:///tmp/copy.jot\")\n        let fileConflictServiceMock = FileConflictServiceMock(\n            copyVersionToTemporaryProvider: { _, _ in temporaryURL }\n        )\n        let service = JotFileConflictService(fileConflictService: fileConflictServiceMock)\n        let modificationDate = Date(timeIntervalSince1970: 1_000)\n        let versionInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/version.jot\"),\n            name: \"version\",\n            modificationDate: modificationDate,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        )\n        let jotFileVersion = JotFileVersion(localizedNameOfSavingComputer: \"Mac\", info: versionInfo)\n\n        // When\n        let result = try service.copyVersionToTemporary(\n            jotFileInfo: makeJotFileInfo(),\n            jotFileVersion: jotFileVersion\n        )\n\n        // Then\n        let unwrapped = try XCTUnwrap(result)\n        XCTAssertEqual(unwrapped.url, temporaryURL)\n        XCTAssertEqual(unwrapped.name, versionInfo.name)\n        XCTAssertEqual(unwrapped.modificationDate, modificationDate)\n        XCTAssertEqual(unwrapped.ubiquitousInfo, versionInfo.ubiquitousInfo)\n    }\n\n    func test_copyVersionToTemporary_givenUnderlyingReturnsNil_returnsNil() throws {\n        // Given\n        let service = JotFileConflictService(\n            fileConflictService: FileConflictServiceMock(copyVersionToTemporaryProvider: { _, _ in nil })\n        )\n        let jotFileVersion = JotFileVersion(\n            localizedNameOfSavingComputer: nil,\n            info: makeJotFileInfo()\n        )\n\n        // When\n        let result = try service.copyVersionToTemporary(\n            jotFileInfo: makeJotFileInfo(),\n            jotFileVersion: jotFileVersion\n        )\n\n        // Then\n        XCTAssertNil(result)\n    }\n\n    private func makeJotFileInfo() -> JotFile.Info {\n        JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/JotFilePreview/CachedJotFilePreviewImageServiceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class CachedJotFilePreviewImageServiceTests: XCTestCase {\n\n    private let info = JotFile.Info(\n        url: URL(staticString: \"file:///tmp/note.jot\"),\n        name: \"note\",\n        modificationDate: Date(timeIntervalSince1970: 1_000),\n        ubiquitousInfo: nil\n    )\n\n    func test_getPreviewImageData_givenColdCache_callsUnderlyingServiceAndReturnsItsData() async throws {\n        // Given\n        let underlyingExpectation = XCTestExpectation(description: \"Underlying service is called.\")\n        let expectedData = Data([1, 2, 3])\n        let underlying = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { _, _, _ in\n                underlyingExpectation.fulfill()\n                return expectedData\n            }\n        )\n        let service = CachedJotFilePreviewImageService(\n            localFileService: FileServiceMock(\n                readFileProvider: { _ in throw NSError(domain: \"noDiskCache\", code: 0) }\n            ),\n            jotFilePreviewImageService: underlying\n        )\n\n        // When\n        let data = try await service.getPreviewImageData(\n            jotFileInfo: info,\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertEqual(data, expectedData)\n        await fulfillment(of: [underlyingExpectation], timeout: 0.5)\n    }\n\n    func test_getPreviewImageData_givenSecondCallWithSameKey_servesFromMemoryCache() async throws {\n        // Given\n        let underlyingCallCount = LockIsolated(0)\n        let expectedData = Data([9, 8, 7])\n        let underlying = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { _, _, _ in\n                underlyingCallCount.withValue { $0 += 1 }\n                return expectedData\n            }\n        )\n        let service = CachedJotFilePreviewImageService(\n            localFileService: FileServiceMock(\n                readFileProvider: { _ in throw NSError(domain: \"noDiskCache\", code: 0) }\n            ),\n            jotFilePreviewImageService: underlying\n        )\n\n        // When\n        _ = try await service.getPreviewImageData(jotFileInfo: info, userInterfaceStyle: .light, displayScale: 2.0)\n        let second = try await service.getPreviewImageData(\n            jotFileInfo: info,\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertEqual(second, expectedData)\n        XCTAssertEqual(underlyingCallCount.value, 1)\n    }\n\n    func test_getPreviewImageData_givenColdCache_writesThroughToDiskCache() async throws {\n        // Given\n        let writeFileExpectation = XCTestExpectation(description: \"FileServiceMock.writeFileProvider is called.\")\n        let producedData = Data([4, 5, 6])\n        let writtenURL = LockIsolated<URL?>(nil)\n        let writtenData = LockIsolated<Data?>(nil)\n        let service = CachedJotFilePreviewImageService(\n            localFileService: FileServiceMock(\n                temporaryDirectoryProvider: {\n                    FileManager.default.temporaryDirectory\n                        .appendingPathComponent(UUID().uuidString, isDirectory: true)\n                },\n                readFileProvider: { _ in throw NSError(domain: \"noDiskCache\", code: 0) },\n                writeFileProvider: { receivedURL, receivedData in\n                    writtenURL.withValue { $0 = receivedURL }\n                    writtenData.withValue { $0 = receivedData }\n                    writeFileExpectation.fulfill()\n                }\n            ),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(\n                getPreviewImageDataProvider: { _, _, _ in producedData }\n            )\n        )\n\n        // When\n        let data = try await service.getPreviewImageData(\n            jotFileInfo: info,\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertEqual(data, producedData)\n        await fulfillment(of: [writeFileExpectation], timeout: 0.5)\n        XCTAssertEqual(writtenData.value, producedData)\n        XCTAssertNotNil(writtenURL.value)\n    }\n\n    func test_getPreviewImageData_givenJotFileInfoWithoutModificationDate_skipsDiskCache() async throws {\n        // Given\n        let readFileExpectation = XCTestExpectation(description: \"FileServiceMock.readFileProvider is not called.\")\n        readFileExpectation.isInverted = true\n        let writeFileExpectation = XCTestExpectation(description: \"FileServiceMock.writeFileProvider is not called.\")\n        writeFileExpectation.isInverted = true\n        let undatedInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let service = CachedJotFilePreviewImageService(\n            localFileService: FileServiceMock(\n                readFileProvider: { _ in\n                    readFileExpectation.fulfill()\n                    return Data()\n                },\n                writeFileProvider: { _, _ in writeFileExpectation.fulfill() }\n            ),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock(\n                getPreviewImageDataProvider: { _, _, _ in Data([1]) }\n            )\n        )\n\n        // When\n        _ = try await service.getPreviewImageData(\n            jotFileInfo: undatedInfo,\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        await fulfillment(of: [readFileExpectation, writeFileExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImageData_givenDiskCacheHit_skipsUnderlyingService() async throws {\n        // Given\n        let cachedData = Data([42])\n        let underlying = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { _, _, _ in\n                XCTFail(\"Underlying service should not be called when the disk cache is warm.\")\n                return Data()\n            }\n        )\n        let service = CachedJotFilePreviewImageService(\n            localFileService: FileServiceMock(\n                readFileProvider: { _ in cachedData }\n            ),\n            jotFilePreviewImageService: underlying\n        )\n\n        // When\n        let data = try await service.getPreviewImageData(\n            jotFileInfo: info,\n            userInterfaceStyle: .dark,\n            displayScale: 3.0\n        )\n\n        // Then\n        XCTAssertEqual(data, cachedData)\n    }\n}\n\nfinal class LockIsolated<Value>: @unchecked Sendable {\n    private let lock = NSLock()\n    private var _value: Value\n\n    init(_ value: Value) { _value = value }\n\n    var value: Value {\n        lock.withLock { _value }\n    }\n\n    func withValue(_ work: (inout Value) -> Void) {\n        lock.withLock { work(&_value) }\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/CreateJotCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class CreateJotCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsAlertWithTitleAndCreateAndCancelActions() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    let alert = viewController as? UIAlertController\n                    XCTAssertNotNil(alert)\n                    XCTAssertEqual(alert?.actions.count, 2)\n                    XCTAssertEqual(alert?.actions.last?.style, .cancel)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = CreateJotCoordinator(\n            navigation: navigation,\n            repository: CreateJotRepositoryMock()\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_start_givenCancelTapped_invokesOnEnd() {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"CreateJotCoordinator.onEnd is invoked.\")\n        var alertController: UIAlertController?\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    alertController = viewController as? UIAlertController\n                }\n            }\n        )\n        let coordinator = CreateJotCoordinator(\n            navigation: navigation,\n            repository: CreateJotRepositoryMock()\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.start()\n        let cancelAction = alertController?.actions.first { $0.style == .cancel }\n        cancelAction?.invokeHandler()\n\n        // Then\n        wait(for: [onEndExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/CreateJotRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class CreateJotRepositoryTests: XCTestCase {\n\n    func test_createJot_givenUbiquitousDocumentsDirectoryAvailable_writesToUbiquitousService() async throws {\n        // Given\n        let writeProviderExpectation = XCTestExpectation(description: \"JotFileServiceMock.writeProvider is called.\")\n        let ubiquitousDocumentsDirectory = URL(staticString: \"file:///cloud/Documents/\")\n        let jotFileServiceMock = JotFileServiceMock(\n            writeProvider: { jotFile in\n                // Then\n                XCTAssertEqual(jotFile.info.name, \"note\")\n                XCTAssertNotNil(jotFile.info.ubiquitousInfo)\n                XCTAssertEqual(\n                    jotFile.info.url,\n                    ubiquitousDocumentsDirectory.appendingPathComponent(\"note\", isDirectory: false)\n                        .appendingPathExtension(\"jot\")\n                )\n                writeProviderExpectation.fulfill()\n            }\n        )\n        let repository = CreateJotRepository(\n            localFileService: FileServiceMock(\n                documentsDirectoryProvider: {\n                    XCTFail(\"Local file service should not be used when ubiquitous is available.\")\n                    return nil\n                }\n            ),\n            ubiquitousFileService: FileServiceMock(\n                documentsDirectoryProvider: { ubiquitousDocumentsDirectory }\n            ),\n            jotFileService: jotFileServiceMock\n        )\n\n        // When\n        let info = try await repository.createJot(name: \"note\")\n\n        // Then\n        XCTAssertNotNil(info.ubiquitousInfo)\n        await fulfillment(of: [writeProviderExpectation], timeout: 0.2)\n    }\n\n    func test_createJot_givenOnlyLocalDocumentsDirectoryAvailable_writesToLocalService() async throws {\n        // Given\n        let writeProviderExpectation = XCTestExpectation(description: \"JotFileServiceMock.writeProvider is called.\")\n        let localDocumentsDirectory = URL(staticString: \"file:///local/Documents/\")\n        let jotFileServiceMock = JotFileServiceMock(\n            writeProvider: { jotFile in\n                // Then\n                XCTAssertNil(jotFile.info.ubiquitousInfo)\n                XCTAssertEqual(\n                    jotFile.info.url,\n                    localDocumentsDirectory.appendingPathComponent(\"note\", isDirectory: false).appendingPathExtension(\n                        \"jot\"\n                    )\n                )\n                writeProviderExpectation.fulfill()\n            }\n        )\n        let repository = CreateJotRepository(\n            localFileService: FileServiceMock(\n                documentsDirectoryProvider: { localDocumentsDirectory }\n            ),\n            ubiquitousFileService: FileServiceMock(\n                documentsDirectoryProvider: { nil }\n            ),\n            jotFileService: jotFileServiceMock\n        )\n\n        // When\n        let info = try await repository.createJot(name: \"note\")\n\n        // Then\n        XCTAssertNil(info.ubiquitousInfo)\n        await fulfillment(of: [writeProviderExpectation], timeout: 0.2)\n    }\n\n    func test_createJot_givenNoDocumentsDirectoryAvailable_throwsCouldNotCreateFile() async {\n        // Given\n        let repository = CreateJotRepository(\n            localFileService: FileServiceMock(documentsDirectoryProvider: { nil }),\n            ubiquitousFileService: FileServiceMock(documentsDirectoryProvider: { nil }),\n            jotFileService: JotFileServiceMock()\n        )\n\n        // When / Then\n        do {\n            _ = try await repository.createJot(name: \"note\")\n            XCTFail(\"Expected CreateJotRepository.Failure.couldNotCreateFile.\")\n        } catch CreateJotRepository.Failure.couldNotCreateFile {\n            // Expected\n        } catch {\n            XCTFail(\"Unexpected error: \\(error)\")\n        }\n    }\n\n    func test_createJot_givenFileAlreadyExists_throwsFileExists() async {\n        // Given\n        let repository = CreateJotRepository(\n            localFileService: FileServiceMock(documentsDirectoryProvider: { nil }),\n            ubiquitousFileService: FileServiceMock(\n                documentsDirectoryProvider: { URL(staticString: \"file:///cloud/Documents/\") },\n                fileExistsProvider: { _ in true }\n            ),\n            jotFileService: JotFileServiceMock(\n                writeProvider: { _ in\n                    XCTFail(\"Should not write when file already exists.\")\n                }\n            )\n        )\n\n        // When / Then\n        do {\n            _ = try await repository.createJot(name: \"note\")\n            XCTFail(\"Expected CreateJotRepository.Failure.fileExists.\")\n        } catch CreateJotRepository.Failure.fileExists {\n            // Expected\n        } catch {\n            XCTFail(\"Unexpected error: \\(error)\")\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/DeleteJotCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class DeleteJotCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsAlertWithDestructiveDeleteAction() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    let alert = viewController as? UIAlertController\n                    XCTAssertNotNil(alert)\n                    XCTAssertEqual(alert?.actions.count, 2)\n                    XCTAssertEqual(alert?.actions.last?.style, .destructive)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = DeleteJotCoordinator(\n            jotFileInfo: info,\n            navigation: navigation,\n            repository: DeleteJotRepositoryMock()\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_start_givenDeleteActionTapped_invokesRepositoryDeleteAndDismisses() {\n        // Given\n        let deleteExpectation = XCTestExpectation(description: \"Repository.deleteJot is called.\")\n        let dismissExpectation = XCTestExpectation(description: \"Navigation.dismiss is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        var alertController: UIAlertController?\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    alertController = viewController as? UIAlertController\n                }\n            },\n            dismissViewControllerProvider: { _, _ in\n                dismissExpectation.fulfill()\n            }\n        )\n        let coordinator = DeleteJotCoordinator(\n            jotFileInfo: info,\n            navigation: navigation,\n            repository: DeleteJotRepositoryMock(\n                deleteJotProvider: { _ in deleteExpectation.fulfill() }\n            )\n        )\n\n        // When\n        coordinator.start()\n        let destructive = alertController?.actions.first { $0.style == .destructive }\n        destructive?.invokeHandler()\n\n        // Then\n        wait(for: [deleteExpectation, dismissExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/DeleteJotRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class DeleteJotRepositoryTests: XCTestCase {\n\n    func test_deleteJot_forwardsToJotFileServiceRemove() async throws {\n        // Given\n        let removeProviderExpectation = XCTestExpectation(description: \"JotFileServiceMock.removeProvider is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let jotFileServiceMock = JotFileServiceMock(\n            removeProvider: { receivedInfo in\n                // Then\n                XCTAssertEqual(receivedInfo, info)\n                removeProviderExpectation.fulfill()\n            }\n        )\n        let repository = DeleteJotRepository(jotFileService: jotFileServiceMock)\n\n        // When\n        try repository.deleteJot(jotFileInfo: info)\n\n        // Then\n        await fulfillment(of: [removeProviderExpectation], timeout: 0.2)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/EmptyStateCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class EmptyStateCellViewModelTests: XCTestCase {\n\n    func test_init_storesTitle() {\n        // When\n        let viewModel = EmptyStateCellViewModel(title: \"Nothing here yet\")\n\n        // Then\n        XCTAssertEqual(viewModel.title, \"Nothing here yet\")\n    }\n\n    func test_handleContextMenuConfiguration_returnsNilByDefault() {\n        // Given\n        let viewModel = EmptyStateCellViewModel(title: \"irrelevant\")\n\n        // When\n        let configuration = viewModel.handleContextMenuConfiguration(\n            point: .zero,\n            sourceView: UIView()\n        )\n\n        // Then\n        XCTAssertNil(configuration)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotBusinessModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotBusinessModelTests: XCTestCase {\n\n    func test_init_givenLocalJotFileInfo_isDownloadedTrueAndIsDownloadingFalse() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let model = JotBusinessModel(jotFileInfo: jotFileInfo)\n\n        // Then\n        XCTAssertEqual(model.name, \"note\")\n        XCTAssertTrue(model.isDownloaded)\n        XCTAssertFalse(model.isDownloading)\n    }\n\n    func test_init_givenUbiquitousInfoWithNotDownloaded_isDownloadedFalse() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: true)\n        )\n\n        // When\n        let model = JotBusinessModel(jotFileInfo: jotFileInfo)\n\n        // Then\n        XCTAssertFalse(model.isDownloaded)\n        XCTAssertTrue(model.isDownloading)\n    }\n\n    func test_init_givenUbiquitousInfoWithDownloaded_isDownloadedTrue() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .downloaded, isDownloading: false)\n        )\n\n        // When\n        let model = JotBusinessModel(jotFileInfo: jotFileInfo)\n\n        // Then\n        XCTAssertTrue(model.isDownloaded)\n        XCTAssertFalse(model.isDownloading)\n    }\n\n    func test_toJotFileInfo_returnsOriginalInfo() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let model = JotBusinessModel(jotFileInfo: jotFileInfo)\n\n        // When\n        let result = model.toJotFileInfo()\n\n        // Then\n        XCTAssertEqual(result, jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotCellViewModelTests: XCTestCase {\n\n    func test_init_givenIsDownloadingTrue_setsPreviewToLoadingIndicator() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: true)\n        )\n        let businessModel = JotBusinessModel(jotFileInfo: jotFileInfo)\n\n        // When\n        let viewModel = JotCellViewModel(\n            jot: businessModel,\n            jotMenuConfigurations: makeEmptyJotMenuConfigurations(),\n            repository: JotsRepositoryMock(),\n            onAction: {}\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.preview, .loadingIndicator)\n        XCTAssertEqual(viewModel.name, \"note\")\n    }\n\n    func test_init_givenDownloadedAndNotDownloading_setsPreviewToThumbnail() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .current, isDownloading: false)\n        )\n\n        // When\n        let viewModel = JotCellViewModel(\n            jot: JotBusinessModel(jotFileInfo: jotFileInfo),\n            jotMenuConfigurations: makeEmptyJotMenuConfigurations(),\n            repository: JotsRepositoryMock(),\n            onAction: {}\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.preview, .thumbnail)\n    }\n\n    func test_init_givenNotDownloadedAndNotDownloading_setsPreviewToCloudImage() {\n        // Given\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///cloud/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: false)\n        )\n\n        // When\n        let viewModel = JotCellViewModel(\n            jot: JotBusinessModel(jotFileInfo: jotFileInfo),\n            jotMenuConfigurations: makeEmptyJotMenuConfigurations(),\n            repository: JotsRepositoryMock(),\n            onAction: {}\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.preview, .cloudImage)\n    }\n\n    func test_handleAction_givenTap_invokesOnAction() async {\n        // Given\n        let onActionExpectation = XCTestExpectation(description: \"onAction is called.\")\n        let jotFileInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let viewModel = JotCellViewModel(\n            jot: JotBusinessModel(jotFileInfo: jotFileInfo),\n            jotMenuConfigurations: makeEmptyJotMenuConfigurations(),\n            repository: JotsRepositoryMock(),\n            onAction: { onActionExpectation.fulfill() }\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        await fulfillment(of: [onActionExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_forwardsToRepositoryWithJotFileInfo() async throws {\n        // Given\n        let getPreviewImageProviderExpectation = XCTestExpectation(\n            description: \"JotsRepositoryMock.getPreviewImageProvider is called.\"\n        )\n        let expectedImage = UIImage()\n        let expectedFileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let jotFileInfo = JotFile.Info(\n            url: expectedFileURL,\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let repositoryMock = JotsRepositoryMock(\n            getPreviewImageProvider: { receivedInfo, receivedStyle, receivedScale in\n                // Then\n                XCTAssertEqual(receivedInfo.url, expectedFileURL)\n                XCTAssertEqual(receivedStyle, .dark)\n                XCTAssertEqual(receivedScale, 3.0)\n                getPreviewImageProviderExpectation.fulfill()\n                return expectedImage\n            }\n        )\n        let viewModel = JotCellViewModel(\n            jot: JotBusinessModel(jotFileInfo: jotFileInfo),\n            jotMenuConfigurations: makeEmptyJotMenuConfigurations(),\n            repository: repositoryMock,\n            onAction: {}\n        )\n\n        // When\n        let image = await viewModel.getPreviewImage(userInterfaceStyle: .dark, displayScale: 3.0)\n\n        // Then\n        XCTAssertIdentical(image, expectedImage)\n        await fulfillment(of: [getPreviewImageProviderExpectation], timeout: 0.2)\n    }\n\n    private func makeEmptyJotMenuConfigurations() -> JotMenuConfigurations {\n        JotMenuConfigurations { _ in [] }\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotMenuConfigurationFactoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotMenuConfigurationFactoryTests: XCTestCase {\n\n    func test_make_givenNoOpenInNewWindow_producesRenameDuplicateDeleteRevealAndShareGroup() {\n        // Given\n        let factory = JotMenuConfigurationFactory()\n\n        // When\n        let configurations = factory.make(\n            onShare: { _, _ in },\n            onRename: {},\n            onDuplicate: {},\n            onDelete: {},\n            onShowInFiles: {}\n        )\n        let resolved = configurations.make(popoverAnchorProvider: { nil })\n\n        // Then\n        XCTAssertEqual(resolved.count, 5)\n        XCTAssertActionAt(resolved, index: 0, expectedSystemImage: \"pencil\")\n        XCTAssertActionAt(resolved, index: 1, expectedSystemImage: \"plus.square.on.square\")\n        XCTAssertActionAt(resolved, index: 2, expectedSystemImage: \"trash\", expectedDestructive: true)\n        XCTAssertActionAt(resolved, index: 3, expectedSystemImage: \"folder\")\n        XCTAssertGroupAt(resolved, index: 4, expectedActionCount: 3)\n    }\n\n    func test_make_givenOpenInNewWindow_prependsOpenInNewWindowAction() {\n        // Given\n        let factory = JotMenuConfigurationFactory()\n\n        // When\n        let configurations = factory.make(\n            onShare: { _, _ in },\n            onRename: {},\n            onDuplicate: {},\n            onDelete: {},\n            onShowInFiles: {},\n            onOpenInNewWindow: {}\n        )\n        let resolved = configurations.make(popoverAnchorProvider: { nil })\n\n        // Then\n        XCTAssertEqual(resolved.count, 6)\n        XCTAssertActionAt(resolved, index: 0, expectedSystemImage: \"plus.app\")\n        XCTAssertActionAt(resolved, index: 1, expectedSystemImage: \"pencil\")\n    }\n\n    func test_make_actionHandlers_invokeCorrespondingClosures() async {\n        // Given\n        let onRenameExpectation = XCTestExpectation(description: \"onRename is called.\")\n        let onDuplicateExpectation = XCTestExpectation(description: \"onDuplicate is called.\")\n        let onDeleteExpectation = XCTestExpectation(description: \"onDelete is called.\")\n        let onShowInFilesExpectation = XCTestExpectation(description: \"onShowInFiles is called.\")\n        let onShareExpectation = XCTestExpectation(description: \"onShare is called for each format.\")\n        onShareExpectation.expectedFulfillmentCount = 3\n\n        let factory = JotMenuConfigurationFactory()\n\n        // When\n        let configurations = factory.make(\n            onShare: { _, _ in onShareExpectation.fulfill() },\n            onRename: { onRenameExpectation.fulfill() },\n            onDuplicate: { onDuplicateExpectation.fulfill() },\n            onDelete: { onDeleteExpectation.fulfill() },\n            onShowInFiles: { onShowInFilesExpectation.fulfill() }\n        )\n        let resolved = configurations.make(popoverAnchorProvider: { nil })\n\n        invokeAction(resolved[0])\n        invokeAction(resolved[1])\n        invokeAction(resolved[2])\n        invokeAction(resolved[3])\n        if case let .group(group) = resolved[4] {\n            for action in group.actions {\n                action.handler()\n            }\n        }\n\n        // Then\n        await fulfillment(\n            of: [\n                onRenameExpectation,\n                onDuplicateExpectation,\n                onDeleteExpectation,\n                onShowInFilesExpectation,\n                onShareExpectation,\n            ],\n            timeout: 0.2\n        )\n    }\n\n    private func invokeAction(_ configuration: JotMenuConfiguration) {\n        if case let .action(action) = configuration {\n            action.handler()\n        } else {\n            XCTFail(\"Expected .action, got \\(configuration).\")\n        }\n    }\n\n    private func XCTAssertActionAt(\n        _ configurations: [JotMenuConfiguration],\n        index: Int,\n        expectedSystemImage: String,\n        expectedDestructive: Bool = false,\n        file: StaticString = #filePath,\n        line: UInt = #line\n    ) {\n        guard case let .action(action) = configurations[index] else {\n            XCTFail(\"Expected .action at index \\(index)\", file: file, line: line)\n            return\n        }\n        XCTAssertEqual(action.systemImageName, expectedSystemImage, file: file, line: line)\n        XCTAssertEqual(action.isDestructive, expectedDestructive, file: file, line: line)\n    }\n\n    private func XCTAssertGroupAt(\n        _ configurations: [JotMenuConfiguration],\n        index: Int,\n        expectedActionCount: Int,\n        file: StaticString = #filePath,\n        line: UInt = #line\n    ) {\n        guard case let .group(group) = configurations[index] else {\n            XCTFail(\"Expected .group at index \\(index)\", file: file, line: line)\n            return\n        }\n        XCTAssertEqual(group.actions.count, expectedActionCount, file: file, line: line)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotsCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotsCoordinatorTests: XCTestCase {\n\n    func test_shouldHandle_givenAnyURL_returnsTrue() {\n        // Given\n        let coordinator = makeCoordinator()\n\n        // Then\n        XCTAssertTrue(coordinator.shouldHandle(url: URL(staticString: \"https://example.com\")))\n    }\n\n    func test_handle_givenNonEditJotURL_returnsCachedJotsViewController() {\n        // Given\n        let madeViewController = UIViewController()\n        let coordinator = makeCoordinator(\n            jotsViewControllerFactory: JotsViewControllerFactoryMock(\n                makeProvider: { _ in madeViewController }\n            )\n        )\n\n        // When\n        let viewControllers = coordinator.handle(url: URL(staticString: \"https://example.com\"))\n\n        // Then\n        XCTAssertEqual(viewControllers, [madeViewController])\n    }\n\n    func test_handle_givenEditJotURL_returnsJotsAndChildViewControllers() {\n        // Given\n        let madeViewController = UIViewController()\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let editJotURL = EditJotURL(jotFileInfo: info).toURL()\n        let editJotViewController = UIViewController()\n        let coordinator = makeCoordinator(\n            jotsViewControllerFactory: JotsViewControllerFactoryMock(\n                makeProvider: { _ in madeViewController }\n            ),\n            editJotCoordinatorFactory: EditJotCoordinatorFactoryMock(\n                makeProvider: { _ in\n                    NavigationCoordinatorMock(\n                        shouldHandleProvider: { _ in true },\n                        handleProvider: { _ in [editJotViewController] }\n                    )\n                }\n            )\n        )\n\n        // When\n        let viewControllers = coordinator.handle(url: editJotURL)\n\n        // Then\n        XCTAssertEqual(viewControllers, [madeViewController, editJotViewController])\n    }\n\n    func test_openSettings_givenInvoked_startsSettingsCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"SettingsCoordinator.start is called.\")\n        let coordinator = makeCoordinator(\n            settingsCoordinatorFactory: SettingsCoordinatorFactoryMock(\n                makeProvider: { _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.openSettings()\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_openCreateJot_givenInvoked_startsCreateJotCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"CreateJotCoordinator.start is called.\")\n        let coordinator = makeCoordinator(\n            createJotCoordinatorFactory: CreateJotCoordinatorFactoryMock(\n                makeProvider: { _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.openCreateJot()\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_openEnableCloudPage_givenInvoked_startsEnableCloudCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"EnableCloudCoordinator.start is called.\")\n        let coordinator = makeCoordinator(\n            enableCloudCoordinatorFactory: EnableCloudCoordinatorFactoryMock(\n                makeProvider: { _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.openEnableCloudPage()\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    #if !targetEnvironment(macCatalyst)\n    func test_openJot_givenPrefersNewWindow_invokesNavigationOpenScene() {\n        // Given\n        let openSceneExpectation = XCTestExpectation(description: \"Navigation.openScene is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            openSceneProvider: { receivedURL in\n                XCTAssertEqual(receivedURL, EditJotURL(jotFileInfo: info).toURL())\n                openSceneExpectation.fulfill()\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.openJot(jotFileInfo: info, prefersNewWindow: true)\n\n        // Then\n        wait(for: [openSceneExpectation], timeout: 1)\n    }\n\n    func test_openJot_givenPrefersSameWindow_invokesNavigationOpen() {\n        // Given\n        let openExpectation = XCTestExpectation(description: \"Navigation.open is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            openURLProvider: { receivedURL in\n                XCTAssertEqual(receivedURL, EditJotURL(jotFileInfo: info).toURL())\n                openExpectation.fulfill()\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.openJot(jotFileInfo: info, prefersNewWindow: false)\n\n        // Then\n        wait(for: [openExpectation], timeout: 1)\n    }\n    #endif\n\n    func test_openDeleteJot_givenInvoked_startsDeleteJotCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"DeleteJotCoordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryMock(\n                makeProvider: { _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.openDeleteJot(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showRenameAlert_givenInvoked_startsRenameJotCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"RenameJotCoordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            renameJotCoordinatorFactory: RenameJotCoordinatorFactoryMock(\n                makeProvider: { _, _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showRenameAlert(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showShareJot_givenInvoked_startsShareJotCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"ShareJotCoordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            shareJotCoordinatorFactory: ShareJotCoordinatorFactoryMock(\n                makeProvider: { _, _, _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showShareJot(jotFileInfo: info, format: .pdf, configurePopoverAnchor: nil)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showInFiles_givenInvoked_startsRevealFileCoordinator() {\n        // Given\n        let startExpectation = XCTestExpectation(description: \"RevealFileCoordinator.start is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = makeCoordinator(\n            revealFileCoordinatorFactory: RevealFileCoordinatorFactoryMock(\n                makeProvider: { _, _ in\n                    CoordinatorMock(startProvider: { startExpectation.fulfill() })\n                }\n            )\n        )\n\n        // When\n        coordinator.showInFiles(jotFileInfo: info)\n\n        // Then\n        wait(for: [startExpectation], timeout: 1)\n    }\n\n    func test_showInfoAlert_givenInvoked_presentsAlertController() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    XCTAssertTrue(viewController is UIAlertController)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = makeCoordinator(navigation: navigation)\n\n        // When\n        coordinator.showInfoAlert(title: \"title\", message: \"message\")\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    private func makeCoordinator(\n        navigation: Navigation = .test(),\n        jotsViewControllerFactory: JotsViewControllerFactoryProtocol = JotsViewControllerFactoryMock(),\n        settingsCoordinatorFactory: SettingsCoordinatorFactoryProtocol = SettingsCoordinatorFactoryMock(),\n        enableCloudCoordinatorFactory: EnableCloudCoordinatorFactoryProtocol = EnableCloudCoordinatorFactoryMock(),\n        editJotCoordinatorFactory: EditJotCoordinatorFactoryProtocol = EditJotCoordinatorFactoryMock(),\n        cloudMigrationCoordinatorFactory: CloudMigrationCoordinatorFactoryProtocol =\n            CloudMigrationCoordinatorFactoryMock(),\n        createJotCoordinatorFactory: CreateJotCoordinatorFactoryProtocol = CreateJotCoordinatorFactoryMock(),\n        deleteJotCoordinatorFactory: DeleteJotCoordinatorFactoryProtocol = DeleteJotCoordinatorFactoryMock(),\n        renameJotCoordinatorFactory: RenameJotCoordinatorFactoryProtocol = RenameJotCoordinatorFactoryMock(),\n        shareJotCoordinatorFactory: ShareJotCoordinatorFactoryProtocol = ShareJotCoordinatorFactoryMock(),\n        revealFileCoordinatorFactory: RevealFileCoordinatorFactoryProtocol = RevealFileCoordinatorFactoryMock()\n    ) -> JotsCoordinator {\n        JotsCoordinator(\n            navigation: navigation,\n            jotsViewControllerFactory: jotsViewControllerFactory,\n            settingsCoordinatorFactory: settingsCoordinatorFactory,\n            enableCloudCoordinatorFactory: enableCloudCoordinatorFactory,\n            editJotCoordinatorFactory: editJotCoordinatorFactory,\n            cloudMigrationCoordinatorFactory: cloudMigrationCoordinatorFactory,\n            createJotCoordinatorFactory: createJotCoordinatorFactory,\n            deleteJotCoordinatorFactory: deleteJotCoordinatorFactory,\n            renameJotCoordinatorFactory: renameJotCoordinatorFactory,\n            shareJotCoordinatorFactory: shareJotCoordinatorFactory,\n            revealFileCoordinatorFactory: revealFileCoordinatorFactory\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotsRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotsRepositoryTests: XCTestCase {\n\n    func test_getJotFiles_givenJotFileInfos_emitsThemSortedByModificationDateDescending() async throws {\n        // Given\n        let older = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/older.jot\"),\n            name: \"older\",\n            modificationDate: Date(timeIntervalSince1970: 1_000),\n            ubiquitousInfo: nil\n        )\n        let newer = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/newer.jot\"),\n            name: \"newer\",\n            modificationDate: Date(timeIntervalSince1970: 2_000),\n            ubiquitousInfo: nil\n        )\n        let undated = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/undated.jot\"),\n            name: \"undated\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let jotFileServiceMock = JotFileServiceMock(\n            documentsDirectoryContentsProvider: {\n                AsyncThrowingStream { continuation in\n                    continuation.yield([older, newer, undated])\n                    continuation.finish()\n                }\n            }\n        )\n        let repository = JotsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: jotFileServiceMock,\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock()\n        )\n\n        // When\n        var iterator = repository.getJotFiles().makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(try await iterator.next())\n\n        // Then\n        XCTAssertEqual(first.map(\\.name), [\"newer\", \"older\", \"undated\"])\n    }\n\n    func test_shouldShowEnableICloudButton_givenUbiquitousServiceDisabled_returnsTrue() async {\n        // Given\n        let repository = JotsRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { false }),\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock()\n        )\n\n        // Then\n        XCTAssertTrue(repository.shouldShowEnableICloudButton())\n    }\n\n    func test_shouldShowEnableICloudButton_givenUbiquitousServiceEnabled_returnsFalse() async {\n        // Given\n        let repository = JotsRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { true }),\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock()\n        )\n\n        // Then\n        XCTAssertFalse(repository.shouldShowEnableICloudButton())\n    }\n\n    func test_duplicate_forwardsToJotFileService() async throws {\n        // Given\n        let duplicateProviderExpectation = XCTestExpectation(\n            description: \"JotFileServiceMock.duplicateProvider is called.\"\n        )\n        let inputInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let expectedDuplicatedInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note-1.jot\"),\n            name: \"note-1\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let jotFileServiceMock = JotFileServiceMock(\n            duplicateProvider: { receivedInfo in\n                // Then\n                XCTAssertEqual(receivedInfo, inputInfo)\n                duplicateProviderExpectation.fulfill()\n                return expectedDuplicatedInfo\n            }\n        )\n        let repository = JotsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: jotFileServiceMock,\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock()\n        )\n\n        // When\n        let result = try repository.duplicate(jotFileInfo: inputInfo)\n\n        // Then\n        XCTAssertEqual(result, expectedDuplicatedInfo)\n        await fulfillment(of: [duplicateProviderExpectation], timeout: 0.2)\n    }\n\n    func test_download_callsStartDownloadOnUbiquitousFileServiceWithJotFileURL() async throws {\n        // Given\n        let startDownloadProviderExpectation = XCTestExpectation(\n            description: \"Ubiquitous startDownloadProvider is called.\"\n        )\n        let expectedFileURL = URL(staticString: \"file:///cloud/note.jot\")\n        let ubiquitousFileServiceMock = FileServiceMock(\n            startDownloadProvider: { receivedFileURL in\n                // Then\n                XCTAssertEqual(receivedFileURL, expectedFileURL)\n                startDownloadProviderExpectation.fulfill()\n            }\n        )\n        let repository = JotsRepository(\n            ubiquitousFileService: ubiquitousFileServiceMock,\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: JotFilePreviewImageServiceMock()\n        )\n\n        // When\n        try repository.download(\n            jotFileInfo: JotFile.Info(\n                url: expectedFileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: UbiquitousInfo(downloadStatus: .notDownloaded, isDownloading: false)\n            )\n        )\n\n        // Then\n        await fulfillment(of: [startDownloadProviderExpectation], timeout: 0.2)\n    }\n\n    func test_getPreviewImage_givenServiceThrows_returnsNil() async throws {\n        // Given\n        let jotFilePreviewImageServiceMock = JotFilePreviewImageServiceMock(\n            getPreviewImageDataProvider: { _, _, _ in\n                throw NSError(domain: \"test\", code: 0)\n            }\n        )\n        let repository = JotsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            applicationService: await ApplicationServiceMock(),\n            deviceService: await DeviceServiceMock(),\n            jotFileService: JotFileServiceMock(),\n            jotFilePreviewImageService: jotFilePreviewImageServiceMock\n        )\n\n        // When\n        let image = await repository.getPreviewImage(\n            jotFileInfo: JotFile.Info(\n                url: URL(staticString: \"file:///tmp/note.jot\"),\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            ),\n            userInterfaceStyle: .light,\n            displayScale: 2.0\n        )\n\n        // Then\n        XCTAssertNil(image)\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/JotsPage/JotsViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class JotsViewModelTests: XCTestCase {\n\n    func test_leftNavigationItems_givenShouldNotShowICloudButton_yieldsOnlySettings() async throws {\n        // Given\n        let viewModel = JotsViewModel(\n            coordinator: JotsCoordinatorMock(),\n            repository: JotsRepositoryMock(shouldShowEnableICloudButtonProvider: { false }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.leftNavigationItems)\n\n        // Then\n        XCTAssertEqual(items.count, 1)\n        guard case let .symbol(systemImageName, _) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        XCTAssertEqual(systemImageName, \"gear\")\n    }\n\n    func test_leftNavigationItems_givenShouldShowICloudButton_yieldsSettingsAndICloudSlash() async throws {\n        // Given\n        let viewModel = JotsViewModel(\n            coordinator: JotsCoordinatorMock(),\n            repository: JotsRepositoryMock(shouldShowEnableICloudButtonProvider: { true }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.leftNavigationItems)\n\n        // Then\n        XCTAssertEqual(items.count, 2)\n        guard case let .symbol(secondImage, _) = items[1] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        XCTAssertEqual(secondImage, \"icloud.slash\")\n    }\n\n    func test_leftNavigationItem_givenSettingsTap_invokesOpenSettings() async throws {\n        // Given\n        let openSettingsExpectation = XCTestExpectation(description: \"Coordinator.openSettings is called.\")\n        let coordinator = JotsCoordinatorMock(\n            openSettingsProvider: { openSettingsExpectation.fulfill() }\n        )\n        let viewModel = JotsViewModel(\n            coordinator: coordinator,\n            repository: JotsRepositoryMock(),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.leftNavigationItems)\n        guard case let .symbol(_, onAction) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        onAction()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [openSettingsExpectation], timeout: 1)\n    }\n\n    func test_leftNavigationItem_givenICloudTap_invokesOpenEnableCloudPage() async throws {\n        // Given\n        let expectation = XCTestExpectation(description: \"Coordinator.openEnableCloudPage is called.\")\n        let coordinator = JotsCoordinatorMock(\n            openEnableCloudPageProvider: { expectation.fulfill() }\n        )\n        let viewModel = JotsViewModel(\n            coordinator: coordinator,\n            repository: JotsRepositoryMock(shouldShowEnableICloudButtonProvider: { true }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.leftNavigationItems)\n        guard case let .symbol(_, onAction) = items[1] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        onAction()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [expectation], timeout: 1)\n    }\n\n    #if !targetEnvironment(macCatalyst)\n    func test_rightNavigationItem_givenCreateTap_invokesOpenCreateJot() async throws {\n        // Given\n        let expectation = XCTestExpectation(description: \"Coordinator.openCreateJot is called.\")\n        let coordinator = JotsCoordinatorMock(\n            openCreateJotProvider: { expectation.fulfill() }\n        )\n        let viewModel = JotsViewModel(\n            coordinator: coordinator,\n            repository: JotsRepositoryMock(),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.rightNavigationItems)\n        XCTAssertEqual(items.count, 1)\n        guard case let .text(_, onAction) = items[0] else {\n            XCTFail(\"Expected .text\")\n            return\n        }\n        onAction()\n        await Task.yield()\n\n        // Then\n        await fulfillment(of: [expectation], timeout: 1)\n    }\n    #endif\n\n    func test_didLoad_givenEmptyJots_yieldsEmptyStateItem() async throws {\n        // Given\n        let stream = AsyncThrowingStream<[JotFile.Info], Error> { continuation in\n            continuation.yield([])\n            continuation.finish()\n        }\n        let viewModel = JotsViewModel(\n            coordinator: JotsCoordinatorMock(),\n            repository: JotsRepositoryMock(getJotFilesProvider: { stream }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 1)\n    }\n\n    func test_didLoad_givenStreamThrows_logsError() async throws {\n        // Given\n        let errorExpectation = XCTestExpectation(description: \"LoggerMock.errorProvider is called.\")\n        let stream = AsyncThrowingStream<[JotFile.Info], Error> { continuation in\n            continuation.finish(throwing: NSError(domain: \"test\", code: 0))\n        }\n        let viewModel = JotsViewModel(\n            coordinator: JotsCoordinatorMock(),\n            repository: JotsRepositoryMock(getJotFilesProvider: { stream }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock(\n                errorProvider: { message in\n                    if message.contains(\"Failed to observe jot files\") {\n                        errorExpectation.fulfill()\n                    }\n                }\n            )\n        )\n\n        // When\n        viewModel.didLoad()\n\n        // Then\n        await fulfillment(of: [errorExpectation], timeout: 1)\n    }\n\n    func test_didLoad_givenOneJot_yieldsOneJotItem() async throws {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let stream = AsyncThrowingStream<[JotFile.Info], Error> { continuation in\n            continuation.yield([info])\n            continuation.finish()\n        }\n        let viewModel = JotsViewModel(\n            coordinator: JotsCoordinatorMock(),\n            repository: JotsRepositoryMock(getJotFilesProvider: { stream }),\n            menuConfigurationFactory: JotMenuConfigurationFactory(),\n            logger: LoggerMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 1)\n    }\n}\n\n@MainActor\nprivate func firstValue<S: AsyncSequence & Sendable>(\n    of sequence: S\n) async throws -> S.Element where S.Element: Sendable {\n    var iterator = sequence.makeAsyncIterator()\n    guard let value = try await iterator.next() else {\n        throw NSError(domain: \"JotsViewModelTests\", code: 0)\n    }\n    return value\n}\n"
  },
  {
    "path": "Tests/JotsPage/RenameJotCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class RenameJotCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsAlertWithCancelAndRenameActions() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    let alert = viewController as? UIAlertController\n                    XCTAssertNotNil(alert)\n                    XCTAssertEqual(alert?.actions.count, 2)\n                    XCTAssertEqual(alert?.actions.first?.style, .cancel)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = RenameJotCoordinator(\n            jotFileInfo: info,\n            navigation: navigation,\n            repository: RenameJotRepositoryMock(),\n            onRename: { _ in }\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_start_givenCancelTapped_invokesOnEnd() {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"RenameJotCoordinator.onEnd is invoked.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        var alertController: UIAlertController?\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    alertController = viewController as? UIAlertController\n                }\n            }\n        )\n        let coordinator = RenameJotCoordinator(\n            jotFileInfo: info,\n            navigation: navigation,\n            repository: RenameJotRepositoryMock(),\n            onRename: { _ in }\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.start()\n        let cancelAction = alertController?.actions.first { $0.style == .cancel }\n        cancelAction?.invokeHandler()\n\n        // Then\n        wait(for: [onEndExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/RenameJotRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class RenameJotRepositoryTests: XCTestCase {\n\n    func test_rename_forwardsArgumentsToJotFileServiceAndReturnsResult() async throws {\n        // Given\n        let renameProviderExpectation = XCTestExpectation(description: \"JotFileServiceMock.renameProvider is called.\")\n        let inputInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/old.jot\"),\n            name: \"old\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let expectedRenamedInfo = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/new.jot\"),\n            name: \"new\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let jotFileServiceMock = JotFileServiceMock(\n            renameProvider: { receivedInfo, receivedName in\n                // Then\n                XCTAssertEqual(receivedInfo, inputInfo)\n                XCTAssertEqual(receivedName, \"new\")\n                renameProviderExpectation.fulfill()\n                return expectedRenamedInfo\n            }\n        )\n        let repository = RenameJotRepository(jotFileService: jotFileServiceMock)\n\n        // When\n        let result = try repository.rename(jotFileInfo: inputInfo, newName: \"new\")\n\n        // Then\n        XCTAssertEqual(result, expectedRenamedInfo)\n        await fulfillment(of: [renameProviderExpectation], timeout: 0.2)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/ShareJotCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class ShareJotCoordinatorTests: XCTestCase {\n\n    func test_start_givenSuccessfulExport_presentsActivityViewController() async {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present(activity) is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    if viewController is UIActivityViewController {\n                        presentExpectation.fulfill()\n                    }\n                }\n            }\n        )\n        let coordinator = ShareJotCoordinator(\n            jotFileInfo: info,\n            format: .pdf,\n            navigation: navigation,\n            repository: ShareJotRepositoryMock(\n                exportJotProvider: { _, _ in URL(fileURLWithPath: \"/tmp/share.pdf\") }\n            ),\n            configurePopoverAnchor: { _ in }\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        await fulfillment(of: [presentExpectation], timeout: 5)\n    }\n\n    func test_start_givenExportThrows_presentsAlertController() async {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present(alert) is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, _ in\n                MainActor.assumeIsolated {\n                    if viewController is UIAlertController {\n                        presentExpectation.fulfill()\n                    }\n                }\n            }\n        )\n        let coordinator = ShareJotCoordinator(\n            jotFileInfo: info,\n            format: .pdf,\n            navigation: navigation,\n            repository: ShareJotRepositoryMock(\n                exportJotProvider: { _, _ in throw NSError(domain: \"test\", code: 0) }\n            ),\n            configurePopoverAnchor: { _ in }\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        await fulfillment(of: [presentExpectation], timeout: 5)\n    }\n}\n"
  },
  {
    "path": "Tests/JotsPage/ShareJotRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@preconcurrency import PencilKit\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class ShareJotRepositoryTests: XCTestCase {\n\n    private var temporaryDirectory: URL!\n\n    override func setUpWithError() throws {\n        try super.setUpWithError()\n        temporaryDirectory = FileManager.default.temporaryDirectory\n            .appendingPathComponent(UUID().uuidString, isDirectory: true)\n        try FileManager.default.createDirectory(\n            at: temporaryDirectory,\n            withIntermediateDirectories: true\n        )\n    }\n\n    override func tearDownWithError() throws {\n        try? FileManager.default.removeItem(at: temporaryDirectory)\n        temporaryDirectory = nil\n        try super.tearDownWithError()\n    }\n\n    func test_exportJot_givenPDFFormat_writesPDFFileToTemporaryDirectoryAndReturnsItsURL() async throws {\n        // Given\n        let repository = try makeRepository()\n\n        // When\n        let resultURL = try await repository.exportJot(jotFileInfo: makeJotFileInfo(), format: .pdf)\n\n        // Then\n        XCTAssertEqual(resultURL.lastPathComponent, \"note.pdf\")\n        XCTAssertEqual(resultURL.deletingLastPathComponent(), temporaryDirectory)\n        XCTAssertTrue(FileManager.default.fileExists(atPath: resultURL.path))\n        let header = try Data(contentsOf: resultURL).prefix(4)\n        XCTAssertEqual(Array(header), Array(\"%PDF\".utf8))\n    }\n\n    func test_exportJot_givenJPGFormat_writesJPGFileToTemporaryDirectoryAndReturnsItsURL() async throws {\n        // Given\n        let repository = try makeRepository()\n\n        // When\n        let resultURL = try await repository.exportJot(jotFileInfo: makeJotFileInfo(), format: .jpg)\n\n        // Then\n        XCTAssertEqual(resultURL.lastPathComponent, \"note.jpg\")\n        XCTAssertTrue(FileManager.default.fileExists(atPath: resultURL.path))\n        let bytes = try Data(contentsOf: resultURL).prefix(3)\n        XCTAssertEqual(Array(bytes), [0xFF, 0xD8, 0xFF])\n    }\n\n    func test_exportJot_givenPNGFormat_writesPNGFileToTemporaryDirectoryAndReturnsItsURL() async throws {\n        // Given\n        let repository = try makeRepository()\n\n        // When\n        let resultURL = try await repository.exportJot(jotFileInfo: makeJotFileInfo(), format: .png)\n\n        // Then\n        XCTAssertEqual(resultURL.lastPathComponent, \"note.png\")\n        XCTAssertTrue(FileManager.default.fileExists(atPath: resultURL.path))\n        let bytes = try Data(contentsOf: resultURL).prefix(8)\n        XCTAssertEqual(Array(bytes), [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])\n    }\n\n    func test_exportJot_givenJotFileServiceThrows_propagatesError() async {\n        // Given\n        struct UnexpectedError: Error {}\n        let repository = ShareJotRepository(\n            jotFileService: JotFileServiceMock(\n                readJotFileProvider: { _ in throw UnexpectedError() }\n            ),\n            fileService: FileServiceMock(\n                temporaryDirectoryProvider: { [temporaryDirectory] in temporaryDirectory! }\n            )\n        )\n\n        // When + Then\n        do {\n            _ = try await repository.exportJot(jotFileInfo: makeJotFileInfo(), format: .pdf)\n            XCTFail(\"Expected exportJot to throw\")\n        } catch is UnexpectedError {\n            // Expected\n        } catch {\n            XCTFail(\"Unexpected error: \\(error)\")\n        }\n    }\n\n    private func makeRepository() throws -> ShareJotRepository {\n        let fixtureJot = try loadFixtureJot()\n        return ShareJotRepository(\n            jotFileService: JotFileServiceMock(\n                readJotFileProvider: { jotFileInfo in\n                    JotFile(info: jotFileInfo, jot: fixtureJot)\n                }\n            ),\n            fileService: FileServiceMock(\n                temporaryDirectoryProvider: { [temporaryDirectory] in temporaryDirectory! }\n            )\n        )\n    }\n\n    private func loadFixtureJot() throws -> Jot {\n        let bundle = Bundle(for: ShareJotRepositoryTests.self)\n        let fixtureURL = try XCTUnwrap(\n            bundle.url(forResource: \"Calculator Pro\", withExtension: \"jot\"),\n            \"Missing 'Calculator Pro.jot' fixture in test bundle resources.\"\n        )\n        let data = try Data(contentsOf: fixtureURL)\n        return try PropertyListDecoder().decode(Jot.self, from: data)\n    }\n\n    private func makeJotFileInfo() -> JotFile.Info {\n        JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/ApplicationServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\n@MainActor\nfinal class ApplicationServiceMock: ApplicationServiceProtocol {\n\n    private let supportsMultipleScenesProvider: @MainActor () -> Bool\n    private let openProvider: @MainActor (_ url: URL) -> Void\n    private let canOpenProvider: @MainActor (_ url: URL) -> Bool\n\n    init(\n        supportsMultipleScenesProvider: @MainActor @escaping () -> Bool = { false },\n        openProvider: @MainActor @escaping (_ url: URL) -> Void = { _ in },\n        canOpenProvider: @MainActor @escaping (_ url: URL) -> Bool = { _ in true }\n    ) {\n        self.supportsMultipleScenesProvider = supportsMultipleScenesProvider\n        self.openProvider = openProvider\n        self.canOpenProvider = canOpenProvider\n    }\n\n    func supportsMultipleScenes() -> Bool { supportsMultipleScenesProvider() }\n    func open(url: URL) { openProvider(url) }\n    func canOpen(url: URL) -> Bool { canOpenProvider(url) }\n}\n"
  },
  {
    "path": "Tests/Mocks/BundleServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\nfinal class BundleServiceMock: BundleServiceProtocol {\n\n    private let shortVersionStringProvider: @Sendable () -> String?\n\n    init(shortVersionStringProvider: @Sendable @escaping () -> String? = { nil }) {\n        self.shortVersionStringProvider = shortVersionStringProvider\n    }\n\n    func shortVersionString() -> String? { shortVersionStringProvider() }\n}\n"
  },
  {
    "path": "Tests/Mocks/CloudMigrationCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudMigrationCoordinatorMock: CloudMigrationCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let shouldStartProvider: () -> Bool\n    private let startProvider: () -> Void\n    private let showInfoAlertProvider: (_ title: String, _ message: String) -> Void\n    private let dismissProvider: () -> Void\n\n    init(\n        shouldStartProvider: @escaping () -> Bool = { false },\n        startProvider: @escaping () -> Void = {},\n        showInfoAlertProvider: @escaping (_ title: String, _ message: String) -> Void = { _, _ in },\n        dismissProvider: @escaping () -> Void = {}\n    ) {\n        self.shouldStartProvider = shouldStartProvider\n        self.startProvider = startProvider\n        self.showInfoAlertProvider = showInfoAlertProvider\n        self.dismissProvider = dismissProvider\n    }\n\n    func shouldStart() -> Bool {\n        shouldStartProvider()\n    }\n\n    func start() {\n        startProvider()\n    }\n\n    func showInfoAlert(title: String, message: String) {\n        showInfoAlertProvider(title, message)\n    }\n\n    func dismiss() {\n        dismissProvider()\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/CloudMigrationRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\n@testable import Jottre\n\nfinal class CloudMigrationRepositoryMock: CloudMigrationRepositoryProtocol {\n\n    private let getJotFilesProvider: @Sendable () -> AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error>\n    private let moveJotFileProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info, _ shouldBecomeUbiquitous: Bool) async throws -> Void\n    private let getShouldShowCloudMigrationProvider: @Sendable () -> Bool\n    private let markCloudMigrationPageDoneProvider: @Sendable () -> Void\n    private let getPreviewImageProvider:\n        @Sendable (\n            _ jotFileInfo: JotFile.Info,\n            _ userInterfaceStyle: UIUserInterfaceStyle,\n            _ displayScale: CGFloat\n        ) async -> UIImage?\n\n    init(\n        getJotFilesProvider:\n            @Sendable @escaping () -> AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> = {\n                AsyncThrowingStream { $0.finish() }\n            },\n        moveJotFileProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ shouldBecomeUbiquitous: Bool) async throws -> Void = {\n                _,\n                _ in\n            },\n        getShouldShowCloudMigrationProvider: @Sendable @escaping () -> Bool = { false },\n        markCloudMigrationPageDoneProvider: @Sendable @escaping () -> Void = {},\n        getPreviewImageProvider:\n            @Sendable @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ userInterfaceStyle: UIUserInterfaceStyle,\n                _ displayScale: CGFloat\n            ) async -> UIImage? = { _, _, _ in nil }\n    ) {\n        self.getJotFilesProvider = getJotFilesProvider\n        self.moveJotFileProvider = moveJotFileProvider\n        self.getShouldShowCloudMigrationProvider = getShouldShowCloudMigrationProvider\n        self.markCloudMigrationPageDoneProvider = markCloudMigrationPageDoneProvider\n        self.getPreviewImageProvider = getPreviewImageProvider\n    }\n\n    func getJotFiles() -> AsyncThrowingStream<[CloudMigrationJotBusinessModel], Error> {\n        getJotFilesProvider()\n    }\n\n    func moveJotFile(jotFileInfo: JotFile.Info, shouldBecomeUbiquitous: Bool) async throws {\n        try await moveJotFileProvider(jotFileInfo, shouldBecomeUbiquitous)\n    }\n\n    func getShouldShowCloudMigration() -> Bool {\n        getShouldShowCloudMigrationProvider()\n    }\n\n    func markCloudMigrationPageDone() {\n        markCloudMigrationPageDoneProvider()\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await getPreviewImageProvider(jotFileInfo, userInterfaceStyle, displayScale)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/CloudMigrationViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class CloudMigrationViewControllerFactoryMock: CloudMigrationViewControllerFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ viewModel: CloudMigrationViewModel) -> UIViewController\n\n    init(\n        makeProvider: @MainActor @escaping (_ viewModel: CloudMigrationViewModel) -> UIViewController = { _ in\n            UIViewController()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(viewModel: CloudMigrationViewModel) -> UIViewController {\n        makeProvider(viewModel)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/CoordinatorFactoryMocks.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\n@MainActor\nfinal class CreateJotCoordinatorFactoryMock: CreateJotCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ navigation: Navigation) -> Coordinator\n\n    init(\n        makeProvider: @MainActor @escaping (_ navigation: Navigation) -> Coordinator = { _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(navigation: Navigation) -> Coordinator {\n        makeProvider(navigation)\n    }\n}\n\n@MainActor\nfinal class DeleteJotCoordinatorFactoryMock: DeleteJotCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ jotFileInfo: JotFile.Info, _ navigation: Navigation) -> Coordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (_ jotFileInfo: JotFile.Info, _ navigation: Navigation) -> Coordinator = { _, _ in\n                CoordinatorMock()\n            }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(jotFileInfo: JotFile.Info, navigation: Navigation) -> Coordinator {\n        makeProvider(jotFileInfo, navigation)\n    }\n}\n\n@MainActor\nfinal class RenameJotCoordinatorFactoryMock: RenameJotCoordinatorFactoryProtocol {\n\n    private let makeProvider:\n        @MainActor (\n            _ jotFileInfo: JotFile.Info,\n            _ navigation: Navigation,\n            _ onRename: @Sendable (_ renameJotFileInfo: JotFile.Info) -> Void\n        ) -> Coordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ navigation: Navigation,\n                _ onRename: @Sendable (_ renameJotFileInfo: JotFile.Info) -> Void\n            ) -> Coordinator = { _, _, _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        navigation: Navigation,\n        onRename: @Sendable @escaping (_ renameJotFileInfo: JotFile.Info) -> Void\n    ) -> Coordinator {\n        makeProvider(jotFileInfo, navigation, onRename)\n    }\n}\n\n@MainActor\nfinal class ShareJotCoordinatorFactoryMock: ShareJotCoordinatorFactoryProtocol {\n\n    private let makeProvider:\n        @MainActor (\n            _ jotFileInfo: JotFile.Info,\n            _ format: ShareFormat,\n            _ navigation: Navigation,\n            _ configurePopoverAnchor: PopoverAnchor?\n        ) -> Coordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ format: ShareFormat,\n                _ navigation: Navigation,\n                _ configurePopoverAnchor: PopoverAnchor?\n            ) -> Coordinator = { _, _, _, _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        navigation: Navigation,\n        configurePopoverAnchor: PopoverAnchor?\n    ) -> Coordinator {\n        makeProvider(jotFileInfo, format, navigation, configurePopoverAnchor)\n    }\n}\n\n@MainActor\nfinal class RevealFileCoordinatorFactoryMock: RevealFileCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ jotFileInfo: JotFile.Info, _ navigation: Navigation) -> Coordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (_ jotFileInfo: JotFile.Info, _ navigation: Navigation) -> Coordinator = { _, _ in\n                CoordinatorMock()\n            }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(jotFileInfo: JotFile.Info, navigation: Navigation) -> Coordinator {\n        makeProvider(jotFileInfo, navigation)\n    }\n}\n\n@MainActor\nfinal class JotConflictCoordinatorFactoryMock: JotConflictCoordinatorFactoryProtocol {\n\n    private let makeProvider:\n        @MainActor (\n            _ jotFileInfo: JotFile.Info,\n            _ jotFileVersions: [JotFileVersion],\n            _ navigation: Navigation,\n            _ onResult: @Sendable (_ result: JotConflictResult) -> Void\n        ) -> Coordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ jotFileVersions: [JotFileVersion],\n                _ navigation: Navigation,\n                _ onResult: @Sendable (_ result: JotConflictResult) -> Void\n            ) -> Coordinator = { _, _, _, _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        navigation: Navigation,\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) -> Coordinator {\n        makeProvider(jotFileInfo, jotFileVersions, navigation, onResult)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/CoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\n@MainActor\nfinal class CoordinatorMock: Coordinator {\n\n    var onEnd: (() -> Void)?\n\n    private let startProvider: () -> Void\n\n    init(\n        startProvider: @escaping () -> Void = {}\n    ) {\n        self.startProvider = startProvider\n    }\n\n    func start() {\n        startProvider()\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/CreateJotRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class CreateJotRepositoryMock: CreateJotRepositoryProtocol {\n\n    private let createJotProvider: @Sendable (_ name: String) async throws -> JotFile.Info\n\n    init(\n        createJotProvider:\n            @Sendable @escaping (_ name: String) async throws -> JotFile.Info = { name in\n                JotFile.Info(\n                    url: URL(fileURLWithPath: \"/tmp/\\(name).jot\"),\n                    name: name,\n                    modificationDate: nil,\n                    ubiquitousInfo: nil\n                )\n            }\n    ) {\n        self.createJotProvider = createJotProvider\n    }\n\n    func createJot(name: String) async throws -> JotFile.Info {\n        try await createJotProvider(name)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/DefaultsServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class DefaultsServiceMock: DefaultsServiceProtocol, @unchecked Sendable {\n\n    private let lock = NSLock()\n    private var storage: [String: Any] = [:]\n    private var continuations: [String: [Any]] = [:]\n\n    init(initialValues: [String: any LosslessStringConvertible & Sendable] = [:]) {\n        storage = initialValues\n    }\n\n    func getValue<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>) -> T? {\n        lock.withLock {\n            storage[defaultsKey.description] as? T\n        }\n    }\n\n    func set<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>, value: T?) {\n        let listeners: [AsyncStream<T?>.Continuation] = lock.withLock {\n            if let value {\n                storage[defaultsKey.description] = value\n            } else {\n                storage.removeValue(forKey: defaultsKey.description)\n            }\n            return (continuations[defaultsKey.description] ?? [])\n                .compactMap { $0 as? AsyncStream<T?>.Continuation }\n        }\n        for continuation in listeners {\n            continuation.yield(value)\n        }\n    }\n\n    func getValueStream<T: LosslessStringConvertible & Sendable>(_ defaultsKey: DefaultsKey<T>) -> AsyncStream<T?> {\n        AsyncStream { [weak self] continuation in\n            guard let self else {\n                continuation.finish()\n                return\n            }\n            continuation.yield(self.getValue(defaultsKey))\n            self.lock.withLock {\n                self.continuations[defaultsKey.description, default: []].append(continuation)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/DeleteJotRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class DeleteJotRepositoryMock: DeleteJotRepositoryProtocol {\n\n    private let deleteJotProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> Void\n\n    init(\n        deleteJotProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> Void = { _ in }\n    ) {\n        self.deleteJotProvider = deleteJotProvider\n    }\n\n    func deleteJot(jotFileInfo: JotFile.Info) throws {\n        try deleteJotProvider(jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/DeviceServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\n@MainActor\nfinal class DeviceServiceMock: DeviceServiceProtocol {\n\n    private let isIPadOSProvider: @MainActor () -> Bool\n\n    init(isIPadOSProvider: @MainActor @escaping () -> Bool = { false }) {\n        self.isIPadOSProvider = isIPadOSProvider\n    }\n\n    func isIPadOS() -> Bool { isIPadOSProvider() }\n}\n"
  },
  {
    "path": "Tests/Mocks/EditJotCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class EditJotCoordinatorMock: EditJotCoordinatorProtocol {\n\n    private let shouldHandleProvider: (_ url: URL) -> Bool\n    private let handleProvider: (_ url: URL) -> [UIViewController]\n    private let showShareJotProvider:\n        (_ jotFileInfo: JotFile.Info, _ format: ShareFormat, _ configurePopoverAnchor: PopoverAnchor?) -> Void\n    private let showRenameAlertProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let openDeleteJotProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let openJotProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let showInFilesProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let showJotConflictPageProvider:\n        (\n            _ jotFileInfo: JotFile.Info,\n            _ jotFileVersions: [JotFileVersion],\n            _ onResult: @Sendable (_ result: JotConflictResult) -> Void\n        ) -> Void\n    private let canGoBackProvider: () -> Bool\n    private let goBackProvider: () -> Void\n    private let showInfoAlertProvider: (_ title: String, _ message: String) -> Void\n\n    init(\n        shouldHandleProvider: @escaping (_ url: URL) -> Bool = { _ in false },\n        handleProvider: @escaping (_ url: URL) -> [UIViewController] = { _ in [] },\n        showShareJotProvider:\n            @escaping (_ jotFileInfo: JotFile.Info, _ format: ShareFormat, _ configurePopoverAnchor: PopoverAnchor?) ->\n            Void = { _, _, _ in },\n        showRenameAlertProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        openDeleteJotProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        openJotProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        showInFilesProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        showJotConflictPageProvider:\n            @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ jotFileVersions: [JotFileVersion],\n                _ onResult: @Sendable (_ result: JotConflictResult) -> Void\n            ) -> Void = { _, _, _ in },\n        canGoBackProvider: @escaping () -> Bool = { false },\n        goBackProvider: @escaping () -> Void = {},\n        showInfoAlertProvider: @escaping (_ title: String, _ message: String) -> Void = { _, _ in }\n    ) {\n        self.shouldHandleProvider = shouldHandleProvider\n        self.handleProvider = handleProvider\n        self.showShareJotProvider = showShareJotProvider\n        self.showRenameAlertProvider = showRenameAlertProvider\n        self.openDeleteJotProvider = openDeleteJotProvider\n        self.openJotProvider = openJotProvider\n        self.showInFilesProvider = showInFilesProvider\n        self.showJotConflictPageProvider = showJotConflictPageProvider\n        self.canGoBackProvider = canGoBackProvider\n        self.goBackProvider = goBackProvider\n        self.showInfoAlertProvider = showInfoAlertProvider\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        shouldHandleProvider(url)\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        handleProvider(url)\n    }\n\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    ) {\n        showShareJotProvider(jotFileInfo, format, configurePopoverAnchor)\n    }\n\n    func showRenameAlert(jotFileInfo: JotFile.Info) {\n        showRenameAlertProvider(jotFileInfo)\n    }\n\n    func openDeleteJot(jotFileInfo: JotFile.Info) {\n        openDeleteJotProvider(jotFileInfo)\n    }\n\n    func openJot(jotFileInfo: JotFile.Info) {\n        openJotProvider(jotFileInfo)\n    }\n\n    func showInFiles(jotFileInfo: JotFile.Info) {\n        showInFilesProvider(jotFileInfo)\n    }\n\n    func showJotConflictPage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersions: [JotFileVersion],\n        onResult: @Sendable @escaping (_ result: JotConflictResult) -> Void\n    ) {\n        showJotConflictPageProvider(jotFileInfo, jotFileVersions, onResult)\n    }\n\n    func canGoBack() -> Bool {\n        canGoBackProvider()\n    }\n\n    func goBack() {\n        goBackProvider()\n    }\n\n    func showInfoAlert(title: String, message: String) {\n        showInfoAlertProvider(title, message)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/EditJotRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport CoreGraphics\nimport Foundation\n@preconcurrency import PencilKit\n\n@testable import Jottre\n\nfinal class EditJotRepositoryMock: EditJotRepositoryProtocol {\n\n    private let ubiquitousInfoProvider: @Sendable (_ url: URL) -> UbiquitousInfo?\n    private let readDrawingProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info) async throws -> (drawing: PKDrawing, width: CGFloat)\n    private let writeDrawingProvider: @Sendable (_ jotFileInfo: JotFile.Info, _ drawing: PKDrawing) async throws -> Void\n    private let getConflictingVersionsProvider: @Sendable (_ jotFileInfo: JotFile.Info) -> [JotFileVersion]?\n    private let duplicateProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info\n\n    init(\n        ubiquitousInfoProvider: @Sendable @escaping (_ url: URL) -> UbiquitousInfo? = { _ in nil },\n        readDrawingProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info) async throws -> (drawing: PKDrawing, width: CGFloat) = {\n                _ in (PKDrawing(), 800)\n            },\n        writeDrawingProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ drawing: PKDrawing) async throws -> Void = { _, _ in },\n        getConflictingVersionsProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) -> [JotFileVersion]? = { _ in\n            nil\n        },\n        duplicateProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info = { jotFileInfo in\n            jotFileInfo\n        }\n    ) {\n        self.ubiquitousInfoProvider = ubiquitousInfoProvider\n        self.readDrawingProvider = readDrawingProvider\n        self.writeDrawingProvider = writeDrawingProvider\n        self.getConflictingVersionsProvider = getConflictingVersionsProvider\n        self.duplicateProvider = duplicateProvider\n    }\n\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo? {\n        ubiquitousInfoProvider(url)\n    }\n\n    func readDrawing(jotFileInfo: JotFile.Info) async throws -> (drawing: PKDrawing, width: CGFloat) {\n        try await readDrawingProvider(jotFileInfo)\n    }\n\n    func writeDrawing(jotFileInfo: JotFile.Info, drawing: PKDrawing) async throws {\n        try await writeDrawingProvider(jotFileInfo, drawing)\n    }\n\n    func getConflictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]? {\n        getConflictingVersionsProvider(jotFileInfo)\n    }\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        try duplicateProvider(jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/EditJotViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class EditJotViewControllerFactoryMock: EditJotViewControllerFactoryProtocol {\n\n    private let makeProvider:\n        @MainActor (_ jotFileInfo: JotFile.Info, _ coordinator: EditJotCoordinatorProtocol) -> UIViewController\n\n    init(\n        makeProvider:\n            @MainActor @escaping (_ jotFileInfo: JotFile.Info, _ coordinator: EditJotCoordinatorProtocol) ->\n            UIViewController = { _, _ in UIViewController() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(jotFileInfo: JotFile.Info, coordinator: EditJotCoordinatorProtocol) -> UIViewController {\n        makeProvider(jotFileInfo, coordinator)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/EnableCloudCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\n@MainActor\nfinal class EnableCloudCoordinatorMock: EnableCloudCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let startProvider: () -> Void\n    private let openLearnHowToEnableProvider: () -> Void\n    private let dismissProvider: () -> Void\n\n    init(\n        startProvider: @escaping () -> Void = {},\n        openLearnHowToEnableProvider: @escaping () -> Void = {},\n        dismissProvider: @escaping () -> Void = {}\n    ) {\n        self.startProvider = startProvider\n        self.openLearnHowToEnableProvider = openLearnHowToEnableProvider\n        self.dismissProvider = dismissProvider\n    }\n\n    func start() {\n        startProvider()\n    }\n\n    func openLearnHowToEnable() {\n        openLearnHowToEnableProvider()\n    }\n\n    func dismiss() {\n        dismissProvider()\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/EnableCloudViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class EnableCloudViewControllerFactoryMock: EnableCloudViewControllerFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ coordinator: EnableCloudCoordinatorProtocol) -> UIViewController\n\n    init(\n        makeProvider: @MainActor @escaping (_ coordinator: EnableCloudCoordinatorProtocol) -> UIViewController = { _ in\n            UIViewController()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(coordinator: EnableCloudCoordinatorProtocol) -> UIViewController {\n        makeProvider(coordinator)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/FileConflictServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class FileConflictServiceMock: FileConflictServiceProtocol {\n\n    private let getConflictingVersionsProvider: @Sendable (_ fileURL: URL) -> [NSFileVersion]?\n    private let resolveVersionConflictsProvider: @Sendable (_ fileURL: URL, _ resolvedVersions: [URL]) throws -> Void\n    private let copyVersionToTemporaryProvider: @Sendable (_ fileURL: URL, _ versionURL: URL) throws -> URL?\n\n    init(\n        getConflictingVersionsProvider: @Sendable @escaping (_ fileURL: URL) -> [NSFileVersion]? = { _ in nil },\n        resolveVersionConflictsProvider:\n            @Sendable @escaping (_ fileURL: URL, _ resolvedVersions: [URL]) throws -> Void = { _, _ in },\n        copyVersionToTemporaryProvider:\n            @Sendable @escaping (_ fileURL: URL, _ versionURL: URL) throws -> URL? = { _, _ in nil }\n    ) {\n        self.getConflictingVersionsProvider = getConflictingVersionsProvider\n        self.resolveVersionConflictsProvider = resolveVersionConflictsProvider\n        self.copyVersionToTemporaryProvider = copyVersionToTemporaryProvider\n    }\n\n    func getConflictingVersions(fileURL: URL) -> [NSFileVersion]? {\n        getConflictingVersionsProvider(fileURL)\n    }\n\n    func resolveVersionConflicts(fileURL: URL, resolvedVersions: [URL]) throws {\n        try resolveVersionConflictsProvider(fileURL, resolvedVersions)\n    }\n\n    func copyVersionToTemporary(fileURL: URL, versionURL: URL) throws -> URL? {\n        try copyVersionToTemporaryProvider(fileURL, versionURL)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/FileServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class FileServiceMock: FileServiceProtocol {\n\n    private let isEnabledProvider: @Sendable () -> Bool\n    private let initializeDocumentsDirectoryProvider: @Sendable () async throws -> Void\n    private let documentsDirectoryProvider: @Sendable () async throws -> URL?\n    private let temporaryDirectoryProvider: @Sendable () -> URL\n    private let listContentsProvider: @Sendable (_ directory: URL, _ properties: [URLResourceKey]) throws -> [URL]\n    private let ubiquitousInfoProvider: @Sendable (_ url: URL) -> UbiquitousInfo?\n    private let startDownloadProvider: @Sendable (_ fileURL: URL) throws -> Void\n    private let directoryChangesProvider: @Sendable (_ directory: URL) -> AsyncStream<Void>\n    private let readFileProvider: @Sendable (_ fileURL: URL) throws -> Data\n    private let writeFileProvider: @Sendable (_ fileURL: URL, _ data: Data) throws -> Void\n    private let fileExistsProvider: @Sendable (_ fileURL: URL) -> Bool\n    private let removeFileProvider: @Sendable (_ fileURL: URL) throws -> Void\n    private let moveFileProvider: @Sendable (_ fileURL: URL, _ newFileURL: URL) throws -> Void\n    private let duplicateFileProvider: @Sendable (_ fileURL: URL) throws -> URL\n\n    init(\n        isEnabledProvider: @Sendable @escaping () -> Bool = { true },\n        initializeDocumentsDirectoryProvider: @Sendable @escaping () async throws -> Void = {},\n        documentsDirectoryProvider: @Sendable @escaping () async throws -> URL? = { nil },\n        temporaryDirectoryProvider: @Sendable @escaping () -> URL = { URL(fileURLWithPath: NSTemporaryDirectory()) },\n        listContentsProvider: @Sendable @escaping (_ directory: URL, _ properties: [URLResourceKey]) throws -> [URL] = {\n            _,\n            _ in []\n        },\n        ubiquitousInfoProvider: @Sendable @escaping (_ url: URL) -> UbiquitousInfo? = { _ in nil },\n        startDownloadProvider: @Sendable @escaping (_ fileURL: URL) throws -> Void = { _ in },\n        directoryChangesProvider: @Sendable @escaping (_ directory: URL) -> AsyncStream<Void> = { _ in\n            AsyncStream { $0.finish() }\n        },\n        readFileProvider: @Sendable @escaping (_ fileURL: URL) throws -> Data = { _ in Data() },\n        writeFileProvider: @Sendable @escaping (_ fileURL: URL, _ data: Data) throws -> Void = { _, _ in },\n        fileExistsProvider: @Sendable @escaping (_ fileURL: URL) -> Bool = { _ in false },\n        removeFileProvider: @Sendable @escaping (_ fileURL: URL) throws -> Void = { _ in },\n        moveFileProvider: @Sendable @escaping (_ fileURL: URL, _ newFileURL: URL) throws -> Void = { _, _ in },\n        duplicateFileProvider: @Sendable @escaping (_ fileURL: URL) throws -> URL = { $0 }\n    ) {\n        self.isEnabledProvider = isEnabledProvider\n        self.initializeDocumentsDirectoryProvider = initializeDocumentsDirectoryProvider\n        self.documentsDirectoryProvider = documentsDirectoryProvider\n        self.temporaryDirectoryProvider = temporaryDirectoryProvider\n        self.listContentsProvider = listContentsProvider\n        self.ubiquitousInfoProvider = ubiquitousInfoProvider\n        self.startDownloadProvider = startDownloadProvider\n        self.directoryChangesProvider = directoryChangesProvider\n        self.readFileProvider = readFileProvider\n        self.writeFileProvider = writeFileProvider\n        self.fileExistsProvider = fileExistsProvider\n        self.removeFileProvider = removeFileProvider\n        self.moveFileProvider = moveFileProvider\n        self.duplicateFileProvider = duplicateFileProvider\n    }\n\n    func isEnabled() -> Bool { isEnabledProvider() }\n    func initializeDocumentsDirectory() async throws { try await initializeDocumentsDirectoryProvider() }\n    func documentsDirectory() async throws -> URL? { try await documentsDirectoryProvider() }\n    func temporaryDirectory() -> URL { temporaryDirectoryProvider() }\n    func listContents(directory: URL, properties: [URLResourceKey]) throws -> [URL] {\n        try listContentsProvider(directory, properties)\n    }\n    func ubiquitousInfo(url: URL) -> UbiquitousInfo? { ubiquitousInfoProvider(url) }\n    func startDownload(fileURL: URL) throws { try startDownloadProvider(fileURL) }\n    func directoryChanges(directory: URL) -> AsyncStream<Void> { directoryChangesProvider(directory) }\n    func readFile(fileURL: URL) throws -> Data { try readFileProvider(fileURL) }\n    func writeFile(fileURL: URL, data: Data) throws { try writeFileProvider(fileURL, data) }\n    func fileExists(fileURL: URL) -> Bool { fileExistsProvider(fileURL) }\n    func removeFile(fileURL: URL) throws { try removeFileProvider(fileURL) }\n    func moveFile(fileURL: URL, newFileURL: URL) throws { try moveFileProvider(fileURL, newFileURL) }\n    func duplicateFile(fileURL: URL) throws -> URL { try duplicateFileProvider(fileURL) }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotConflictCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\n@MainActor\nfinal class JotConflictCoordinatorMock: JotConflictCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let startProvider: () -> Void\n    private let showInfoAlertProvider: (_ title: String, _ message: String) -> Void\n    private let dismissProvider: (_ completion: @Sendable () -> Void) -> Void\n\n    init(\n        startProvider: @escaping () -> Void = {},\n        showInfoAlertProvider: @escaping (_ title: String, _ message: String) -> Void = { _, _ in },\n        dismissProvider: @escaping (_ completion: @Sendable () -> Void) -> Void = { _ in }\n    ) {\n        self.startProvider = startProvider\n        self.showInfoAlertProvider = showInfoAlertProvider\n        self.dismissProvider = dismissProvider\n    }\n\n    func start() {\n        startProvider()\n    }\n\n    func showInfoAlert(title: String, message: String) {\n        showInfoAlertProvider(title, message)\n    }\n\n    func dismiss(completion: @Sendable @escaping () -> Void) {\n        dismissProvider(completion)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotConflictRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\n@testable import Jottre\n\nfinal class JotConflictRepositoryMock: JotConflictRepositoryProtocol {\n\n    private let resolveVersionConflictsProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info, _ resolvedVersions: [JotFileVersion]) throws -> Void\n    private let getPreviewImageProvider:\n        @Sendable (\n            _ jotFileInfo: JotFile.Info,\n            _ jotFileVersion: JotFileVersion,\n            _ userInterfaceStyle: UIUserInterfaceStyle,\n            _ displayScale: CGFloat\n        ) async -> UIImage?\n\n    init(\n        resolveVersionConflictsProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ resolvedVersions: [JotFileVersion]) throws -> Void = {\n                _,\n                _ in\n            },\n        getPreviewImageProvider:\n            @Sendable @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ jotFileVersion: JotFileVersion,\n                _ userInterfaceStyle: UIUserInterfaceStyle,\n                _ displayScale: CGFloat\n            ) async -> UIImage? = { _, _, _, _ in nil }\n    ) {\n        self.resolveVersionConflictsProvider = resolveVersionConflictsProvider\n        self.getPreviewImageProvider = getPreviewImageProvider\n    }\n\n    func resolveVersionConflicts(\n        jotFileInfo: JotFile.Info,\n        resolvedVersions: [JotFileVersion]\n    ) throws {\n        try resolveVersionConflictsProvider(jotFileInfo, resolvedVersions)\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        jotFileVersion: JotFileVersion,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await getPreviewImageProvider(jotFileInfo, jotFileVersion, userInterfaceStyle, displayScale)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotConflictViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class JotConflictViewControllerFactoryMock: JotConflictViewControllerFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ viewModel: JotConflictViewModel) -> UIViewController\n\n    init(\n        makeProvider: @MainActor @escaping (_ viewModel: JotConflictViewModel) -> UIViewController = { _ in\n            UIViewController()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(viewModel: JotConflictViewModel) -> UIViewController {\n        makeProvider(viewModel)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotFileConflictServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\n@testable import Jottre\n\nfinal class JotFileConflictServiceMock: JotFileConflictServiceProtocol {\n\n    private let getConfictingVersionsProvider: @Sendable (_ jotFileInfo: JotFile.Info) -> [JotFileVersion]?\n    private let resolveVersionConflictsProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info, _ resolvedVersions: [JotFileVersion]) throws -> Void\n    private let copyVersionToTemporaryProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info, _ jotFileVersion: JotFileVersion) throws -> JotFile.Info?\n\n    init(\n        getConfictingVersionsProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) -> [JotFileVersion]? = { _ in\n            nil\n        },\n        resolveVersionConflictsProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ resolvedVersions: [JotFileVersion]) throws -> Void = {\n                _,\n                _ in\n            },\n        copyVersionToTemporaryProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ jotFileVersion: JotFileVersion) throws -> JotFile.Info? =\n            { _, _ in nil }\n    ) {\n        self.getConfictingVersionsProvider = getConfictingVersionsProvider\n        self.resolveVersionConflictsProvider = resolveVersionConflictsProvider\n        self.copyVersionToTemporaryProvider = copyVersionToTemporaryProvider\n    }\n\n    func getConfictingVersions(jotFileInfo: JotFile.Info) -> [JotFileVersion]? {\n        getConfictingVersionsProvider(jotFileInfo)\n    }\n    func resolveVersionConflicts(jotFileInfo: JotFile.Info, resolvedVersions: [JotFileVersion]) throws {\n        try resolveVersionConflictsProvider(jotFileInfo, resolvedVersions)\n    }\n    func copyVersionToTemporary(jotFileInfo: JotFile.Info, jotFileVersion: JotFileVersion) throws -> JotFile.Info? {\n        try copyVersionToTemporaryProvider(jotFileInfo, jotFileVersion)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotFilePreviewImageServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\n@testable import Jottre\n\nfinal class JotFilePreviewImageServiceMock: JotFilePreviewImageServiceProtocol {\n\n    private let getPreviewImageDataProvider:\n        @Sendable (\n            _ jotFileInfo: JotFile.Info,\n            _ userInterfaceStyle: UIUserInterfaceStyle,\n            _ displayScale: CGFloat\n        ) async throws -> Data\n\n    init(\n        getPreviewImageDataProvider:\n            @Sendable @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ userInterfaceStyle: UIUserInterfaceStyle,\n                _ displayScale: CGFloat\n            ) async throws -> Data = { _, _, _ in Data() }\n    ) {\n        self.getPreviewImageDataProvider = getPreviewImageDataProvider\n    }\n\n    func getPreviewImageData(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async throws -> Data {\n        try await getPreviewImageDataProvider(jotFileInfo, userInterfaceStyle, displayScale)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotFileServiceMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class JotFileServiceMock: JotFileServiceProtocol {\n\n    private let documentsDirectoryContentsProvider: @Sendable () -> AsyncThrowingStream<[JotFile.Info], Error>\n    private let readJotFileProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> JotFile\n    private let writeProvider: @Sendable (_ jotFile: JotFile) throws -> Void\n    private let duplicateProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info\n    private let renameProvider: @Sendable (_ jotFileInfo: JotFile.Info, _ newName: String) throws -> JotFile.Info\n    private let removeProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> Void\n    private let moveProvider:\n        @Sendable (_ jotFileInfo: JotFile.Info, _ shouldBecomeUbiquitous: Bool) async throws -> Void\n\n    init(\n        documentsDirectoryContentsProvider: @Sendable @escaping () -> AsyncThrowingStream<[JotFile.Info], Error> = {\n            AsyncThrowingStream { $0.finish() }\n        },\n        readJotFileProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> JotFile = { info in\n            JotFile(info: info, jot: Jot.makeEmpty())\n        },\n        writeProvider: @Sendable @escaping (_ jotFile: JotFile) throws -> Void = { _ in },\n        duplicateProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info = { $0 },\n        renameProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ newName: String) throws -> JotFile.Info = {\n            info,\n            _ in info\n        },\n        removeProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> Void = { _ in },\n        moveProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ shouldBecomeUbiquitous: Bool) async throws -> Void = {\n                _,\n                _ in\n            }\n    ) {\n        self.documentsDirectoryContentsProvider = documentsDirectoryContentsProvider\n        self.readJotFileProvider = readJotFileProvider\n        self.writeProvider = writeProvider\n        self.duplicateProvider = duplicateProvider\n        self.renameProvider = renameProvider\n        self.removeProvider = removeProvider\n        self.moveProvider = moveProvider\n    }\n\n    func documentsDirectoryContents() -> AsyncThrowingStream<[JotFile.Info], Error> {\n        documentsDirectoryContentsProvider()\n    }\n    func readJotFile(jotFileInfo: JotFile.Info) throws -> JotFile {\n        try readJotFileProvider(jotFileInfo)\n    }\n    func write(jotFile: JotFile) throws {\n        try writeProvider(jotFile)\n    }\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        try duplicateProvider(jotFileInfo)\n    }\n    func rename(jotFileInfo: JotFile.Info, newName: String) throws -> JotFile.Info {\n        try renameProvider(jotFileInfo, newName)\n    }\n    func remove(jotFileInfo: JotFile.Info) throws {\n        try removeProvider(jotFileInfo)\n    }\n    func move(jotFileInfo: JotFile.Info, shouldBecomeUbiquitous: Bool) async throws {\n        try await moveProvider(jotFileInfo, shouldBecomeUbiquitous)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotsCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class JotsCoordinatorMock: JotsCoordinatorProtocol {\n\n    private let shouldHandleProvider: (_ url: URL) -> Bool\n    private let handleProvider: (_ url: URL) -> [UIViewController]\n    private let openSettingsProvider: () -> Void\n    private let openCreateJotProvider: () -> Void\n    private let openJotProvider: (_ jotFileInfo: JotFile.Info, _ prefersNewWindow: Bool) -> Void\n    private let openEnableCloudPageProvider: () -> Void\n    private let showShareJotProvider:\n        (_ jotFileInfo: JotFile.Info, _ format: ShareFormat, _ configurePopoverAnchor: PopoverAnchor?) -> Void\n    private let showRenameAlertProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let openDeleteJotProvider: (_ jotFileInfo: JotFile.Info) -> Void\n    private let showInfoAlertProvider: (_ title: String, _ message: String) -> Void\n    private let showInFilesProvider: (_ jotFileInfo: JotFile.Info) -> Void\n\n    init(\n        shouldHandleProvider: @escaping (_ url: URL) -> Bool = { _ in false },\n        handleProvider: @escaping (_ url: URL) -> [UIViewController] = { _ in [] },\n        openSettingsProvider: @escaping () -> Void = {},\n        openCreateJotProvider: @escaping () -> Void = {},\n        openJotProvider: @escaping (_ jotFileInfo: JotFile.Info, _ prefersNewWindow: Bool) -> Void = { _, _ in },\n        openEnableCloudPageProvider: @escaping () -> Void = {},\n        showShareJotProvider:\n            @escaping (_ jotFileInfo: JotFile.Info, _ format: ShareFormat, _ configurePopoverAnchor: PopoverAnchor?) ->\n            Void = { _, _, _ in },\n        showRenameAlertProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        openDeleteJotProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in },\n        showInfoAlertProvider: @escaping (_ title: String, _ message: String) -> Void = { _, _ in },\n        showInFilesProvider: @escaping (_ jotFileInfo: JotFile.Info) -> Void = { _ in }\n    ) {\n        self.shouldHandleProvider = shouldHandleProvider\n        self.handleProvider = handleProvider\n        self.openSettingsProvider = openSettingsProvider\n        self.openCreateJotProvider = openCreateJotProvider\n        self.openJotProvider = openJotProvider\n        self.openEnableCloudPageProvider = openEnableCloudPageProvider\n        self.showShareJotProvider = showShareJotProvider\n        self.showRenameAlertProvider = showRenameAlertProvider\n        self.openDeleteJotProvider = openDeleteJotProvider\n        self.showInfoAlertProvider = showInfoAlertProvider\n        self.showInFilesProvider = showInFilesProvider\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        shouldHandleProvider(url)\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        handleProvider(url)\n    }\n\n    func openSettings() { openSettingsProvider() }\n    func openCreateJot() { openCreateJotProvider() }\n    func openJot(jotFileInfo: JotFile.Info, prefersNewWindow: Bool) {\n        openJotProvider(jotFileInfo, prefersNewWindow)\n    }\n    func openEnableCloudPage() { openEnableCloudPageProvider() }\n    func showShareJot(\n        jotFileInfo: JotFile.Info,\n        format: ShareFormat,\n        configurePopoverAnchor: PopoverAnchor?\n    ) {\n        showShareJotProvider(jotFileInfo, format, configurePopoverAnchor)\n    }\n    func showRenameAlert(jotFileInfo: JotFile.Info) {\n        showRenameAlertProvider(jotFileInfo)\n    }\n    func openDeleteJot(jotFileInfo: JotFile.Info) {\n        openDeleteJotProvider(jotFileInfo)\n    }\n    func showInfoAlert(title: String, message: String) {\n        showInfoAlertProvider(title, message)\n    }\n    func showInFiles(jotFileInfo: JotFile.Info) {\n        showInFilesProvider(jotFileInfo)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotsRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\nimport UIKit\n\n@testable import Jottre\n\nfinal class JotsRepositoryMock: JotsRepositoryProtocol {\n\n    private let getJotFilesProvider: @Sendable () -> AsyncThrowingStream<[JotFile.Info], Error>\n    private let shouldShowEnableICloudButtonProvider: @Sendable () -> Bool\n    private let duplicateProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info\n    private let downloadProvider: @Sendable (_ jotFileInfo: JotFile.Info) throws -> Void\n    private let getPreviewImageProvider:\n        @Sendable (\n            _ jotFileInfo: JotFile.Info,\n            _ userInterfaceStyle: UIUserInterfaceStyle,\n            _ displayScale: CGFloat\n        ) async -> UIImage?\n    private let supportsMultipleScenesProvider: @MainActor @Sendable () -> Bool\n    private let isIPadOSProvider: @MainActor @Sendable () -> Bool\n\n    init(\n        getJotFilesProvider: @Sendable @escaping () -> AsyncThrowingStream<[JotFile.Info], Error> = {\n            AsyncThrowingStream { $0.finish() }\n        },\n        shouldShowEnableICloudButtonProvider: @Sendable @escaping () -> Bool = { false },\n        duplicateProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> JotFile.Info = { $0 },\n        downloadProvider: @Sendable @escaping (_ jotFileInfo: JotFile.Info) throws -> Void = { _ in },\n        getPreviewImageProvider:\n            @Sendable @escaping (\n                _ jotFileInfo: JotFile.Info,\n                _ userInterfaceStyle: UIUserInterfaceStyle,\n                _ displayScale: CGFloat\n            ) async -> UIImage? = { _, _, _ in nil },\n        supportsMultipleScenesProvider: @MainActor @Sendable @escaping () -> Bool = { false },\n        isIPadOSProvider: @MainActor @Sendable @escaping () -> Bool = { false }\n    ) {\n        self.getJotFilesProvider = getJotFilesProvider\n        self.shouldShowEnableICloudButtonProvider = shouldShowEnableICloudButtonProvider\n        self.duplicateProvider = duplicateProvider\n        self.downloadProvider = downloadProvider\n        self.getPreviewImageProvider = getPreviewImageProvider\n        self.supportsMultipleScenesProvider = supportsMultipleScenesProvider\n        self.isIPadOSProvider = isIPadOSProvider\n    }\n\n    func getJotFiles() -> AsyncThrowingStream<[JotFile.Info], Error> {\n        getJotFilesProvider()\n    }\n\n    func shouldShowEnableICloudButton() -> Bool {\n        shouldShowEnableICloudButtonProvider()\n    }\n\n    func duplicate(jotFileInfo: JotFile.Info) throws -> JotFile.Info {\n        try duplicateProvider(jotFileInfo)\n    }\n\n    func download(jotFileInfo: JotFile.Info) throws {\n        try downloadProvider(jotFileInfo)\n    }\n\n    func getPreviewImage(\n        jotFileInfo: JotFile.Info,\n        userInterfaceStyle: UIUserInterfaceStyle,\n        displayScale: CGFloat\n    ) async -> UIImage? {\n        await getPreviewImageProvider(jotFileInfo, userInterfaceStyle, displayScale)\n    }\n\n    @MainActor\n    func supportsMultipleScenes() -> Bool {\n        supportsMultipleScenesProvider()\n    }\n\n    @MainActor\n    func isIPadOS() -> Bool {\n        isIPadOSProvider()\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/JotsViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class JotsViewControllerFactoryMock: JotsViewControllerFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ coordinator: JotsCoordinatorProtocol) -> UIViewController\n\n    init(\n        makeProvider: @MainActor @escaping (_ coordinator: JotsCoordinatorProtocol) -> UIViewController = { _ in\n            UIViewController()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(coordinator: JotsCoordinatorProtocol) -> UIViewController {\n        makeProvider(coordinator)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/LoggerMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class LoggerMock: LoggerProtocol, @unchecked Sendable {\n\n    private let debugProvider: @Sendable (_ message: String) -> Void\n    private let infoProvider: @Sendable (_ message: String) -> Void\n    private let errorProvider: @Sendable (_ message: String) -> Void\n\n    init(\n        debugProvider: @Sendable @escaping (_ message: String) -> Void = { _ in },\n        infoProvider: @Sendable @escaping (_ message: String) -> Void = { _ in },\n        errorProvider: @Sendable @escaping (_ message: String) -> Void = { _ in }\n    ) {\n        self.debugProvider = debugProvider\n        self.infoProvider = infoProvider\n        self.errorProvider = errorProvider\n    }\n\n    func debug(_ message: @autoclosure () -> String) { debugProvider(message()) }\n    func info(_ message: @autoclosure () -> String) { infoProvider(message()) }\n    func error(_ message: @autoclosure () -> String) { errorProvider(message()) }\n}\n"
  },
  {
    "path": "Tests/Mocks/PageCoordinatorFactoryMocks.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsCoordinatorFactoryMock: SettingsCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ navigation: Navigation) -> Coordinator\n\n    init(\n        makeProvider: @MainActor @escaping (_ navigation: Navigation) -> Coordinator = { _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(navigation: Navigation) -> Coordinator {\n        makeProvider(navigation)\n    }\n}\n\n@MainActor\nfinal class EnableCloudCoordinatorFactoryMock: EnableCloudCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ navigation: Navigation) -> Coordinator\n\n    init(\n        makeProvider: @MainActor @escaping (_ navigation: Navigation) -> Coordinator = { _ in CoordinatorMock() }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(navigation: Navigation) -> Coordinator {\n        makeProvider(navigation)\n    }\n}\n\n@MainActor\nfinal class EditJotCoordinatorFactoryMock: EditJotCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ navigation: Navigation) -> NavigationCoordinator\n\n    init(\n        makeProvider:\n            @MainActor @escaping (_ navigation: Navigation) -> NavigationCoordinator = { _ in\n                NavigationCoordinatorMock()\n            }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(navigation: Navigation) -> NavigationCoordinator {\n        makeProvider(navigation)\n    }\n}\n\n@MainActor\nfinal class CloudMigrationCoordinatorFactoryMock: CloudMigrationCoordinatorFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ navigation: Navigation) -> CloudMigrationCoordinatorProtocol\n\n    init(\n        makeProvider: @MainActor @escaping (_ navigation: Navigation) -> CloudMigrationCoordinatorProtocol = { _ in\n            CloudMigrationCoordinatorMock()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(navigation: Navigation) -> CloudMigrationCoordinatorProtocol {\n        makeProvider(navigation)\n    }\n}\n\n@MainActor\nfinal class NavigationCoordinatorMock: NavigationCoordinator {\n\n    private let shouldHandleProvider: (_ url: URL) -> Bool\n    private let handleProvider: (_ url: URL) -> [UIViewController]\n\n    init(\n        shouldHandleProvider: @escaping (_ url: URL) -> Bool = { _ in false },\n        handleProvider: @escaping (_ url: URL) -> [UIViewController] = { _ in [] }\n    ) {\n        self.shouldHandleProvider = shouldHandleProvider\n        self.handleProvider = handleProvider\n    }\n\n    func shouldHandle(url: URL) -> Bool {\n        shouldHandleProvider(url)\n    }\n\n    func handle(url: URL) -> [UIViewController] {\n        handleProvider(url)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/RenameJotRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class RenameJotRepositoryMock: RenameJotRepositoryProtocol {\n\n    private let renameProvider: (_ jotFileInfo: JotFile.Info, _ newName: String) throws -> JotFile.Info\n\n    init(\n        renameProvider:\n            @escaping (_ jotFileInfo: JotFile.Info, _ newName: String) throws -> JotFile.Info = { jotFileInfo, name in\n                JotFile.Info(\n                    url: jotFileInfo.url.deletingLastPathComponent().appendingPathComponent(\"\\(name).jot\"),\n                    name: name,\n                    modificationDate: nil,\n                    ubiquitousInfo: nil\n                )\n            }\n    ) {\n        self.renameProvider = renameProvider\n    }\n\n    func rename(jotFileInfo: JotFile.Info, newName: String) throws -> JotFile.Info {\n        try renameProvider(jotFileInfo, newName)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/SettingsCoordinatorMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsCoordinatorMock: SettingsCoordinatorProtocol {\n\n    var onEnd: (() -> Void)?\n\n    private let startProvider: () -> Void\n    private let openExternalLinkProvider: (_ url: URL) -> Void\n    private let dismissProvider: () -> Void\n\n    init(\n        startProvider: @escaping () -> Void = {},\n        openExternalLinkProvider: @escaping (_ url: URL) -> Void = { _ in },\n        dismissProvider: @escaping () -> Void = {}\n    ) {\n        self.startProvider = startProvider\n        self.openExternalLinkProvider = openExternalLinkProvider\n        self.dismissProvider = dismissProvider\n    }\n\n    func start() {\n        startProvider()\n    }\n\n    func openExternalLink(url: URL) {\n        openExternalLinkProvider(url)\n    }\n\n    func dismiss() {\n        dismissProvider()\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/SettingsRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\nfinal class SettingsRepositoryMock: SettingsRepositoryProtocol {\n\n    private let shouldShowEnableICloudButtonProvider: @Sendable () -> Bool\n    private let appVersionProvider: @Sendable () -> String\n    private let userInterfaceStyleProvider: @Sendable () -> AsyncStream<UIUserInterfaceStyle>\n    private let updateUserInterfaceStyleProvider: @Sendable (_ style: UIUserInterfaceStyle) -> Void\n\n    init(\n        shouldShowEnableICloudButtonProvider: @Sendable @escaping () -> Bool = { false },\n        appVersionProvider: @Sendable @escaping () -> String = { \"\" },\n        userInterfaceStyleProvider: @Sendable @escaping () -> AsyncStream<UIUserInterfaceStyle> = {\n            AsyncStream { $0.finish() }\n        },\n        updateUserInterfaceStyleProvider: @Sendable @escaping (_ style: UIUserInterfaceStyle) -> Void = { _ in }\n    ) {\n        self.shouldShowEnableICloudButtonProvider = shouldShowEnableICloudButtonProvider\n        self.appVersionProvider = appVersionProvider\n        self.userInterfaceStyleProvider = userInterfaceStyleProvider\n        self.updateUserInterfaceStyleProvider = updateUserInterfaceStyleProvider\n    }\n\n    func shouldShowEnableICloudButton() -> Bool {\n        shouldShowEnableICloudButtonProvider()\n    }\n\n    func appVersion() -> String {\n        appVersionProvider()\n    }\n\n    func userInterfaceStyle() -> AsyncStream<UIUserInterfaceStyle> {\n        userInterfaceStyleProvider()\n    }\n\n    func updateUserInterfaceStyle(_ style: UIUserInterfaceStyle) {\n        updateUserInterfaceStyleProvider(style)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/SettingsViewControllerFactoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsViewControllerFactoryMock: SettingsViewControllerFactoryProtocol {\n\n    private let makeProvider: @MainActor (_ coordinator: SettingsCoordinatorProtocol) -> UIViewController\n\n    init(\n        makeProvider: @MainActor @escaping (_ coordinator: SettingsCoordinatorProtocol) -> UIViewController = { _ in\n            UIViewController()\n        }\n    ) {\n        self.makeProvider = makeProvider\n    }\n\n    func make(coordinator: SettingsCoordinatorProtocol) -> UIViewController {\n        makeProvider(coordinator)\n    }\n}\n"
  },
  {
    "path": "Tests/Mocks/ShareJotRepositoryMock.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport Foundation\n\n@testable import Jottre\n\nfinal class ShareJotRepositoryMock: ShareJotRepositoryProtocol {\n\n    private let exportJotProvider: @Sendable (_ jotFileInfo: JotFile.Info, _ format: ShareFormat) async throws -> URL\n\n    init(\n        exportJotProvider:\n            @Sendable @escaping (_ jotFileInfo: JotFile.Info, _ format: ShareFormat) async throws -> URL = { _, _ in\n                URL(fileURLWithPath: \"/tmp/share\")\n            }\n    ) {\n        self.exportJotProvider = exportJotProvider\n    }\n\n    func exportJot(jotFileInfo: JotFile.Info, format: ShareFormat) async throws -> URL {\n        try await exportJotProvider(jotFileInfo, format)\n    }\n}\n"
  },
  {
    "path": "Tests/Navigation/EditJotURLTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class EditJotURLTests: XCTestCase {\n\n    func test_init_givenJotFileInfo_setsFileURLFromInfo() {\n        // Given\n        let fileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let info = JotFile.Info(\n            url: fileURL,\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let editJotURL = EditJotURL(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(editJotURL.fileURL, fileURL)\n        XCTAssertEqual(editJotURL.path, \"/jots/edit\")\n    }\n\n    func test_initFromURL_givenMatchingPathAndQueryItem_succeeds() throws {\n        // Given\n        let url = URL(staticString: \"scheme:///jots/edit?fileURL=file:///tmp/note.jot\")\n\n        // When\n        let editJotURL = try XCTUnwrap(EditJotURL(url: url))\n\n        // Then\n        XCTAssertEqual(editJotURL.fileURL, URL(staticString: \"file:///tmp/note.jot\"))\n    }\n\n    func test_initFromURL_givenWrongPath_returnsNil() {\n        // Given\n        let url = URL(staticString: \"scheme:///not/the/right/path?fileURL=file:///tmp/note.jot\")\n\n        // When\n        let editJotURL = EditJotURL(url: url)\n\n        // Then\n        XCTAssertNil(editJotURL)\n    }\n\n    func test_initFromURL_givenMissingFileURLQueryItem_returnsNil() {\n        // Given\n        let url = URL(staticString: \"scheme:///jots/edit\")\n\n        // When\n        let editJotURL = EditJotURL(url: url)\n\n        // Then\n        XCTAssertNil(editJotURL)\n    }\n\n    func test_toURL_roundTripsFileURL() throws {\n        // Given\n        let fileURL = URL(staticString: \"file:///tmp/note.jot\")\n        let original = EditJotURL(\n            jotFileInfo: JotFile.Info(\n                url: fileURL,\n                name: \"note\",\n                modificationDate: nil,\n                ubiquitousInfo: nil\n            )\n        )\n\n        // When\n        let roundTripped = try XCTUnwrap(EditJotURL(url: original.toURL()))\n\n        // Then\n        XCTAssertEqual(roundTripped.fileURL, fileURL)\n    }\n}\n"
  },
  {
    "path": "Tests/Navigation/EnableICloudSupportURLTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class EnableICloudSupportURLTests: XCTestCase {\n\n    func test_init_givenLocaleWithLanguageAndRegion_buildsLocalizedSupportPath() {\n        // Given\n        let locale = Locale(identifier: \"en_US\")\n\n        // When\n        let url = EnableICloudSupportURL(locale: locale)\n\n        // Then\n        XCTAssertEqual(url.scheme, \"https\")\n        XCTAssertEqual(url.host, \"support.apple.com\")\n        XCTAssertEqual(url.path, \"/en-us/guide/icloud/mmfc0f1e2a/icloud\")\n    }\n\n    func test_init_givenLocaleWithoutRegion_buildsGenericSupportPath() {\n        // Given\n        let locale = Locale(identifier: \"en\")\n\n        // When\n        let url = EnableICloudSupportURL(locale: locale)\n\n        // Then\n        XCTAssertEqual(url.path, \"/guide/icloud/mmfc0f1e2a/icloud\")\n    }\n\n    func test_toURL_producesAppleSupportURL() {\n        // Given\n        let url = EnableICloudSupportURL(locale: Locale(identifier: \"de_DE\"))\n\n        // When\n        let resolved = url.toURL()\n\n        // Then\n        XCTAssertEqual(resolved.scheme, \"https\")\n        XCTAssertEqual(resolved.host, \"support.apple.com\")\n    }\n}\n"
  },
  {
    "path": "Tests/Navigation/JotsPageURLTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JotsPageURLTests: XCTestCase {\n\n    func test_path_isRoot() {\n        // Given / When\n        let url = JotsPageURL()\n\n        // Then\n        XCTAssertEqual(url.path, \"/\")\n    }\n\n    func test_toURL_producesURLWithRootPath() {\n        // Given\n        let url = JotsPageURL()\n\n        // When\n        let result = url.toURL()\n\n        // Then\n        XCTAssertEqual(result.path, \"/\")\n    }\n}\n"
  },
  {
    "path": "Tests/Navigation/JottreGithubURLTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class JottreGithubURLTests: XCTestCase {\n\n    func test_components_pointToProjectGithubRepository() {\n        // Given / When\n        let url = JottreGithubURL()\n\n        // Then\n        XCTAssertEqual(url.scheme, \"https\")\n        XCTAssertEqual(url.host, \"github.com\")\n        XCTAssertEqual(url.path, \"/antonlorani/jottre\")\n    }\n\n    func test_toURL_producesAbsoluteURL() {\n        // When\n        let resolved = JottreGithubURL().toURL()\n\n        // Then\n        XCTAssertEqual(resolved.absoluteString, \"https://github.com/antonlorani/jottre\")\n    }\n}\n"
  },
  {
    "path": "Tests/Navigation/RevealFileURLTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class RevealFileURLTests: XCTestCase {\n\n    func test_init_givenJotFileInfo_extractsPathFromInfoURL() {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/dir/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let revealFileURL = RevealFileURL(jotFileInfo: info)\n\n        // Then\n        XCTAssertEqual(revealFileURL.scheme, \"shareddocuments\")\n        XCTAssertEqual(revealFileURL.host, \"\")\n        XCTAssertEqual(revealFileURL.path, \"/tmp/dir/note.jot\")\n    }\n\n    func test_toURL_producesSharedDocumentsURL() throws {\n        // Given\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/dir/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n\n        // When\n        let result = RevealFileURL(jotFileInfo: info).toURL()\n\n        // Then\n        XCTAssertEqual(result.scheme, \"shareddocuments\")\n        XCTAssertEqual(result.path, \"/tmp/dir/note.jot\")\n    }\n}\n"
  },
  {
    "path": "Tests/PageViewController/IOS18SymbolBarButtonItemFactoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class IOS18SymbolBarButtonItemFactoryTests: XCTestCase {\n\n    func test_make_givenActionPrimary_returnsBarButtonItemWrappingButtonWithAction() {\n        // Given\n        let factory = IOS18SymbolBarButtonItemFactory()\n        let action = UIAction { _ in }\n\n        // When\n        let barButtonItem = factory.make(symbolName: \"plus\", primaryAction: .action(action))\n\n        // Then\n        let button = try? XCTUnwrap(barButtonItem.customView as? UIButton)\n        XCTAssertNotNil(button)\n        XCTAssertFalse(button?.showsMenuAsPrimaryAction ?? true)\n    }\n\n    func test_make_givenMenuPrimary_returnsBarButtonItemWrappingButtonWithMenu() throws {\n        // Given\n        let factory = IOS18SymbolBarButtonItemFactory()\n        let menu = UIMenu(title: \"Menu\", children: [])\n\n        // When\n        let barButtonItem = factory.make(symbolName: \"ellipsis\", primaryAction: .menu(menu))\n\n        // Then\n        let button = try XCTUnwrap(barButtonItem.customView as? UIButton)\n        XCTAssertTrue(button.showsMenuAsPrimaryAction)\n        XCTAssertNotNil(button.menu)\n    }\n}\n"
  },
  {
    "path": "Tests/PageViewController/IOS18TextBarButtonItemFactoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class IOS18TextBarButtonItemFactoryTests: XCTestCase {\n\n    func test_make_returnsBarButtonItemWrappingButtonConfiguredWithTitle() throws {\n        // Given\n        let factory = IOS18TextBarButtonItemFactory()\n        let action = UIAction { _ in }\n\n        // When\n        let barButtonItem = factory.make(title: \"Save\", primaryAction: action)\n\n        // Then\n        let button = try XCTUnwrap(barButtonItem.customView as? UIButton)\n        XCTAssertEqual(button.configuration?.title, \"Save\")\n    }\n}\n"
  },
  {
    "path": "Tests/PageViewController/PageCellSizingStrategyTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class PageCellSizingStrategyTests: XCTestCase {\n\n    func test_columnSpacing_givenFullWidth_isZero() {\n        // Given\n        let strategy = PageCellSizingStrategy.fullWidth()\n\n        // Then\n        XCTAssertEqual(strategy.columnSpacing, .zero)\n    }\n\n    func test_columnSpacing_givenEqualSplit_returnsConfiguredColumnSpacing() {\n        // Given\n        let strategy = PageCellSizingStrategy.equalSplit(\n            perRow: 2,\n            itemHeight: 100,\n            columnSpacing: 12,\n            rowSpacing: 8\n        )\n\n        // Then\n        XCTAssertEqual(strategy.columnSpacing, 12)\n    }\n\n    func test_rowSpacing_givenEqualSplit_returnsConfiguredRowSpacing() {\n        // Given\n        let strategy = PageCellSizingStrategy.equalSplit(\n            perRow: 2,\n            itemHeight: 100,\n            columnSpacing: 12,\n            rowSpacing: 8\n        )\n\n        // Then\n        XCTAssertEqual(strategy.rowSpacing, 8)\n    }\n\n    func test_columnAndRowSpacing_givenAdaptiveGrid_returnsConfiguredSpacings() {\n        // Given\n        let strategy = PageCellSizingStrategy.adaptiveGrid(\n            minColumns: 2,\n            maxColumns: 8,\n            minItemWidth: 100,\n            maxItemWidth: 200,\n            columnSpacing: 16,\n            rowSpacing: 24,\n            aspectRatio: CGSize(width: 1, height: 1)\n        )\n\n        // Then\n        XCTAssertEqual(strategy.columnSpacing, 16)\n        XCTAssertEqual(strategy.rowSpacing, 24)\n    }\n\n    func test_rowSpacing_givenFullWidthWithDefaultRowSpacing_returnsDefault() {\n        // Given\n        let strategy = PageCellSizingStrategy.fullWidth(estimatedHeight: 120, rowSpacing: 7)\n\n        // Then\n        XCTAssertEqual(strategy.rowSpacing, 7)\n    }\n}\n"
  },
  {
    "path": "Tests/PageViewController/PageHeaderCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class PageHeaderCellViewModelTests: XCTestCase {\n\n    func test_init_storesHeadlineAndSubheadline() {\n        // When\n        let viewModel = PageHeaderCellViewModel(\n            headline: \"Headline\",\n            subheadline: \"Subheadline\"\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.headline, \"Headline\")\n        XCTAssertEqual(viewModel.subheadline, \"Subheadline\")\n    }\n}\n"
  },
  {
    "path": "Tests/RevealFile/RevealFileCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class RevealFileCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_invokesApplicationServiceOpenWithRevealFileURL() {\n        // Given\n        let openExpectation = XCTestExpectation(description: \"ApplicationService.open is called.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = RevealFileCoordinator(\n            jotFileInfo: info,\n            applicationService: ApplicationServiceMock(\n                openProvider: { receivedURL in\n                    XCTAssertEqual(receivedURL, RevealFileURL(jotFileInfo: info).toURL())\n                    openExpectation.fulfill()\n                }\n            )\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [openExpectation], timeout: 1)\n    }\n\n    func test_start_givenInvoked_invokesOnEnd() {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"RevealFileCoordinator.onEnd is invoked.\")\n        let info = JotFile.Info(\n            url: URL(staticString: \"file:///tmp/note.jot\"),\n            name: \"note\",\n            modificationDate: nil,\n            ubiquitousInfo: nil\n        )\n        let coordinator = RevealFileCoordinator(\n            jotFileInfo: info,\n            applicationService: ApplicationServiceMock()\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [onEndExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsCoordinatorTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsCoordinatorTests: XCTestCase {\n\n    func test_start_givenInvoked_presentsNavigationControllerWithFactoryProducedRoot() {\n        // Given\n        let presentExpectation = XCTestExpectation(description: \"Navigation.present is called.\")\n        let madeViewController = UIViewController()\n        let navigation = Navigation.test(\n            presentViewControllerProvider: { viewController, animated in\n                MainActor.assumeIsolated {\n                    // Then\n                    XCTAssertTrue(viewController is UINavigationController)\n                    let navigationController = viewController as? UINavigationController\n                    XCTAssertEqual(navigationController?.viewControllers.first, madeViewController)\n                    XCTAssertTrue(navigationController?.navigationBar.prefersLargeTitles ?? false)\n                    XCTAssertTrue(animated)\n                    presentExpectation.fulfill()\n                }\n            }\n        )\n        let coordinator = SettingsCoordinator(\n            navigation: navigation,\n            settingsViewControllerFactory: SettingsViewControllerFactoryMock(\n                makeProvider: { receivedCoordinator in\n                    XCTAssertTrue(receivedCoordinator is SettingsCoordinator)\n                    return madeViewController\n                }\n            )\n        )\n\n        // When\n        coordinator.start()\n\n        // Then\n        wait(for: [presentExpectation], timeout: 1)\n    }\n\n    func test_openExternalLink_givenURL_invokesNavigationOpenExternal() {\n        // Given\n        let openExternalExpectation = XCTestExpectation(description: \"Navigation.openExternal is called.\")\n        let expectedURL = URL(staticString: \"https://example.com\")\n        let navigation = Navigation.test(\n            openExternalURLProvider: { receivedURL in\n                // Then\n                XCTAssertEqual(receivedURL, expectedURL)\n                openExternalExpectation.fulfill()\n            }\n        )\n        let coordinator = SettingsCoordinator(\n            navigation: navigation,\n            settingsViewControllerFactory: SettingsViewControllerFactoryMock()\n        )\n\n        // When\n        coordinator.openExternalLink(url: expectedURL)\n\n        // Then\n        wait(for: [openExternalExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenInvoked_invokesNavigationDismissAnimated() {\n        // Given\n        let dismissExpectation = XCTestExpectation(description: \"Navigation.dismiss is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { animated, _ in\n                // Then\n                XCTAssertTrue(animated)\n                dismissExpectation.fulfill()\n            }\n        )\n        let coordinator = SettingsCoordinator(\n            navigation: navigation,\n            settingsViewControllerFactory: SettingsViewControllerFactoryMock()\n        )\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        wait(for: [dismissExpectation], timeout: 1)\n    }\n\n    func test_dismiss_givenCompletion_invokesOnEnd() async {\n        // Given\n        let onEndExpectation = XCTestExpectation(description: \"SettingsCoordinator.onEnd is called.\")\n        let navigation = Navigation.test(\n            dismissViewControllerProvider: { _, completion in\n                completion?()\n            }\n        )\n        let coordinator = SettingsCoordinator(\n            navigation: navigation,\n            settingsViewControllerFactory: SettingsViewControllerFactoryMock()\n        )\n        coordinator.onEnd = { onEndExpectation.fulfill() }\n\n        // When\n        coordinator.dismiss()\n\n        // Then\n        await fulfillment(of: [onEndExpectation], timeout: 1)\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsDropdownCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsDropdownCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameCurrentAndOptionsFromBusinessModel() {\n        // Given\n        let light = SettingsDropdownBusinessModel.Option(label: \"Light\", value: \"light\")\n        let dark = SettingsDropdownBusinessModel.Option(label: \"Dark\", value: \"dark\")\n        let businessModel = SettingsDropdownBusinessModel(\n            name: \"Appearance\",\n            current: light,\n            options: [light, dark]\n        )\n\n        // When\n        let viewModel = SettingsDropdownCellViewModel(\n            settingsDropdown: businessModel,\n            onAction: { _ in }\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"Appearance\")\n        XCTAssertEqual(viewModel.current, light)\n        XCTAssertEqual(viewModel.options, [light, dark])\n    }\n\n    func test_handleAction_givenTap_doesNotInvokeOnAction() async {\n        // Given\n        let onActionExpectation = XCTestExpectation(description: \"onAction is not called for .tap\")\n        onActionExpectation.isInverted = true\n        let option = SettingsDropdownBusinessModel.Option(label: \"Light\", value: \"light\")\n        let viewModel = SettingsDropdownCellViewModel(\n            settingsDropdown: SettingsDropdownBusinessModel(\n                name: \"Appearance\",\n                current: option,\n                options: [option]\n            ),\n            onAction: { _ in onActionExpectation.fulfill() }\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        await fulfillment(of: [onActionExpectation], timeout: 0.05)\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsExternalLinkCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsExternalLinkCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameAndInfoFromBusinessModel() {\n        // Given\n        let businessModel = SettingsExternalLinkBusinessModel(name: \"GitHub\", info: \"Open repository\")\n\n        // When\n        let viewModel = SettingsExternalLinkCellViewModel(\n            settingsExternalLink: businessModel,\n            onAction: {}\n        )\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"GitHub\")\n        XCTAssertEqual(viewModel.info, \"Open repository\")\n    }\n\n    func test_init_givenNilInfoBusinessModel_storesNilInfo() {\n        // Given\n        let businessModel = SettingsExternalLinkBusinessModel(name: \"GitHub\", info: nil)\n\n        // When\n        let viewModel = SettingsExternalLinkCellViewModel(\n            settingsExternalLink: businessModel,\n            onAction: {}\n        )\n\n        // Then\n        XCTAssertNil(viewModel.info)\n    }\n\n    func test_handleAction_givenTap_invokesOnAction() async {\n        // Given\n        let onActionExpectation = XCTestExpectation(description: \"onAction is called.\")\n        let viewModel = SettingsExternalLinkCellViewModel(\n            settingsExternalLink: SettingsExternalLinkBusinessModel(name: \"GitHub\", info: nil),\n            onAction: { onActionExpectation.fulfill() }\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        await fulfillment(of: [onActionExpectation], timeout: 0.2)\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsInfoCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsInfoCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameAndValueFromBusinessModel() {\n        // Given\n        let businessModel = SettingsInfoBusinessModel(name: \"Version\", value: \"1.0.0\")\n\n        // When\n        let viewModel = SettingsInfoCellViewModel(settingsInfo: businessModel)\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"Version\")\n        XCTAssertEqual(viewModel.value, \"1.0.0\")\n    }\n\n    func test_handleAction_givenTap_doesNothing() {\n        // Given\n        let viewModel = SettingsInfoCellViewModel(\n            settingsInfo: SettingsInfoBusinessModel(name: \"Version\", value: \"1.0.0\")\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        XCTAssertEqual(viewModel.value, \"1.0.0\")\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsRepositoryTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class SettingsRepositoryTests: XCTestCase {\n\n    func test_shouldShowEnableICloudButton_givenUbiquitousServiceDisabled_returnsTrue() {\n        // Given\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { false }),\n            bundleService: BundleServiceMock(),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // Then\n        XCTAssertTrue(repository.shouldShowEnableICloudButton())\n    }\n\n    func test_shouldShowEnableICloudButton_givenUbiquitousServiceEnabled_returnsFalse() {\n        // Given\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(isEnabledProvider: { true }),\n            bundleService: BundleServiceMock(),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // Then\n        XCTAssertFalse(repository.shouldShowEnableICloudButton())\n    }\n\n    func test_appVersion_givenBundleProvidesValue_returnsValue() {\n        // Given\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            bundleService: BundleServiceMock(shortVersionStringProvider: { \"1.2.3\" }),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // Then\n        XCTAssertEqual(repository.appVersion(), \"1.2.3\")\n    }\n\n    func test_appVersion_givenBundleReturnsNil_returnsDash() {\n        // Given\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            bundleService: BundleServiceMock(shortVersionStringProvider: { nil }),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // Then\n        XCTAssertEqual(repository.appVersion(), \"-\")\n    }\n\n    func test_userInterfaceStyle_givenStoredRawValue_emitsMatchingStyle() async throws {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock(\n            initialValues: [DefaultsKey<Int>.userInterfaceStyle.description: UIUserInterfaceStyle.dark.rawValue]\n        )\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            bundleService: BundleServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // When\n        var iterator = repository.userInterfaceStyle().makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(await iterator.next())\n\n        // Then\n        XCTAssertEqual(first, .dark)\n    }\n\n    func test_userInterfaceStyle_givenNoStoredValue_emitsUnspecified() async throws {\n        // Given\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            bundleService: BundleServiceMock(),\n            defaultsService: DefaultsServiceMock()\n        )\n\n        // When\n        var iterator = repository.userInterfaceStyle().makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(await iterator.next())\n\n        // Then\n        XCTAssertEqual(first, .unspecified)\n    }\n\n    func test_updateUserInterfaceStyle_persistsRawValueInDefaults() {\n        // Given\n        let defaultsServiceMock = DefaultsServiceMock()\n        let repository = SettingsRepository(\n            ubiquitousFileService: FileServiceMock(),\n            bundleService: BundleServiceMock(),\n            defaultsService: defaultsServiceMock\n        )\n\n        // When\n        repository.updateUserInterfaceStyle(.light)\n\n        // Then\n        XCTAssertEqual(defaultsServiceMock.getValue(.userInterfaceStyle), UIUserInterfaceStyle.light.rawValue)\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsToggleCellViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsToggleCellViewModelTests: XCTestCase {\n\n    func test_init_storesNameAndIsOnFromBusinessModel() {\n        // Given\n        let businessModel = SettingsToggleBusinessModel(name: \"iCloud\", isOn: true)\n\n        // When\n        let viewModel = SettingsToggleCellViewModel(settingsToggle: businessModel)\n\n        // Then\n        XCTAssertEqual(viewModel.name, \"iCloud\")\n        XCTAssertTrue(viewModel.isOn)\n    }\n\n    func test_handleAction_givenTap_doesNothing() {\n        // Given\n        let viewModel = SettingsToggleCellViewModel(\n            settingsToggle: SettingsToggleBusinessModel(name: \"iCloud\", isOn: false)\n        )\n\n        // When\n        viewModel.handle(action: .tap)\n\n        // Then\n        XCTAssertFalse(viewModel.isOn)\n    }\n}\n"
  },
  {
    "path": "Tests/SettingsPage/SettingsViewModelTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class SettingsViewModelTests: XCTestCase {\n\n    func test_rightNavigationItems_givenInit_yieldsDismissSymbol() async throws {\n        // Given\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(),\n            coordinator: SettingsCoordinatorMock()\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.rightNavigationItems)\n\n        // Then\n        XCTAssertEqual(items.count, 1)\n        guard case let .symbol(systemImageName, _) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        XCTAssertEqual(systemImageName, \"xmark\")\n    }\n\n    func test_rightNavigationItem_givenTap_invokesCoordinatorDismiss() async throws {\n        // Given\n        let dismissExpectation = XCTestExpectation(description: \"SettingsCoordinatorMock.dismiss is called.\")\n        let coordinatorMock = SettingsCoordinatorMock(\n            dismissProvider: { dismissExpectation.fulfill() }\n        )\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(),\n            coordinator: coordinatorMock\n        )\n\n        // When\n        let items = try await firstValue(of: viewModel.rightNavigationItems)\n        guard case let .symbol(_, onAction) = items[0] else {\n            XCTFail(\"Expected .symbol\")\n            return\n        }\n        onAction()\n\n        // Then\n        await fulfillment(of: [dismissExpectation], timeout: 1)\n    }\n\n    func test_didLoad_givenShouldNotShowICloud_yieldsThreeItems() async throws {\n        // Given\n        let userInterfaceStyleStream = AsyncStream<UIUserInterfaceStyle> { continuation in\n            continuation.yield(.unspecified)\n            continuation.finish()\n        }\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(\n                shouldShowEnableICloudButtonProvider: { false },\n                appVersionProvider: { \"1.2.3\" },\n                userInterfaceStyleProvider: { userInterfaceStyleStream }\n            ),\n            coordinator: SettingsCoordinatorMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 3)\n        XCTAssertNotNil(items[0].id as? SettingsDropdownBusinessModel)\n        XCTAssertNotNil(items[1].id as? SettingsExternalLinkBusinessModel)\n        XCTAssertNotNil(items[2].id as? SettingsInfoBusinessModel)\n        let info = try XCTUnwrap(items[2].id as? SettingsInfoBusinessModel)\n        XCTAssertEqual(info.value, \"1.2.3\")\n    }\n\n    func test_didLoad_givenShouldShowICloud_yieldsFourItemsWithICloudLink() async throws {\n        // Given\n        let userInterfaceStyleStream = AsyncStream<UIUserInterfaceStyle> { continuation in\n            continuation.yield(.dark)\n            continuation.finish()\n        }\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(\n                shouldShowEnableICloudButtonProvider: { true },\n                userInterfaceStyleProvider: { userInterfaceStyleStream }\n            ),\n            coordinator: SettingsCoordinatorMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        XCTAssertEqual(items.count, 4)\n        XCTAssertNotNil(items[1].id as? SettingsExternalLinkBusinessModel)\n        XCTAssertNotNil(items[2].id as? SettingsExternalLinkBusinessModel)\n    }\n\n    func test_didLoad_givenDarkStyle_yieldsDropdownWithDarkAsCurrent() async throws {\n        // Given\n        let userInterfaceStyleStream = AsyncStream<UIUserInterfaceStyle> { continuation in\n            continuation.yield(.dark)\n            continuation.finish()\n        }\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(\n                userInterfaceStyleProvider: { userInterfaceStyleStream }\n            ),\n            coordinator: SettingsCoordinatorMock()\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n\n        // Then\n        let dropdown = try XCTUnwrap(items[0].id as? SettingsDropdownBusinessModel)\n        XCTAssertEqual(dropdown.current.value as? UIUserInterfaceStyle, .dark)\n        XCTAssertEqual(dropdown.options.count, 3)\n    }\n\n    func test_didLoadExternalLinkTap_givenICloudVisible_invokesOpenExternalLinkWithICloudURL() async throws {\n        // Given\n        let openExternalLinkExpectation =\n            XCTestExpectation(description: \"SettingsCoordinatorMock.openExternalLink is called.\")\n        let userInterfaceStyleStream = AsyncStream<UIUserInterfaceStyle> { continuation in\n            continuation.yield(.unspecified)\n            continuation.finish()\n        }\n        let coordinatorMock = SettingsCoordinatorMock(\n            openExternalLinkProvider: { receivedURL in\n                // Then\n                XCTAssertEqual(receivedURL, EnableICloudSupportURL().toURL())\n                openExternalLinkExpectation.fulfill()\n            }\n        )\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(\n                shouldShowEnableICloudButtonProvider: { true },\n                userInterfaceStyleProvider: { userInterfaceStyleStream }\n            ),\n            coordinator: coordinatorMock\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n        items[1].handleAction(.tap)\n\n        // Then\n        await fulfillment(of: [openExternalLinkExpectation], timeout: 1)\n    }\n\n    func test_didLoadExternalLinkTap_givenGithubLink_invokesOpenExternalLinkWithGithubURL() async throws {\n        // Given\n        let openExternalLinkExpectation =\n            XCTestExpectation(description: \"SettingsCoordinatorMock.openExternalLink is called.\")\n        let userInterfaceStyleStream = AsyncStream<UIUserInterfaceStyle> { continuation in\n            continuation.yield(.unspecified)\n            continuation.finish()\n        }\n        let coordinatorMock = SettingsCoordinatorMock(\n            openExternalLinkProvider: { receivedURL in\n                // Then\n                XCTAssertEqual(receivedURL, JottreGithubURL().toURL())\n                openExternalLinkExpectation.fulfill()\n            }\n        )\n        let viewModel = SettingsViewModel(\n            repository: SettingsRepositoryMock(\n                shouldShowEnableICloudButtonProvider: { false },\n                userInterfaceStyleProvider: { userInterfaceStyleStream }\n            ),\n            coordinator: coordinatorMock\n        )\n\n        // When\n        viewModel.didLoad()\n        let items = try await firstValue(of: viewModel.items)\n        items[1].handleAction(.tap)\n\n        // Then\n        await fulfillment(of: [openExternalLinkExpectation], timeout: 1)\n    }\n}\n\n@MainActor\nprivate func firstValue<S: AsyncSequence & Sendable>(\n    of sequence: S\n) async throws -> S.Element where S.Element: Sendable {\n    var iterator = sequence.makeAsyncIterator()\n    guard let value = try await iterator.next() else {\n        throw NSError(domain: \"SettingsViewModelTests\", code: 0)\n    }\n    return value\n}\n"
  },
  {
    "path": "Tests/Utilities/Array+safeIndexTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class ArraySafeIndexTests: XCTestCase {\n\n    func test_safeSubscript_givenIndexInBounds_returnsElement() {\n        // Given\n        let array = [10, 20, 30]\n\n        // When\n        let element = array[safe: 1]\n\n        // Then\n        XCTAssertEqual(element, 20)\n    }\n\n    func test_safeSubscript_givenIndexOutOfBounds_returnsNil() {\n        // Given\n        let array = [10, 20, 30]\n\n        // When\n        let element = array[safe: 5]\n\n        // Then\n        XCTAssertNil(element)\n    }\n\n    func test_safeSubscript_givenEmptyArray_returnsNil() {\n        // Given\n        let array: [Int] = []\n\n        // When\n        let element = array[safe: 0]\n\n        // Then\n        XCTAssertNil(element)\n    }\n}\n"
  },
  {
    "path": "Tests/Utilities/AsyncSequenceDebounceTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class AsyncSequenceDebounceTests: XCTestCase {\n\n    func test_debounce_givenSingleValue_yieldsValueAfterInterval() async throws {\n        // Given\n        let stream = AsyncStream<Int> { continuation in\n            continuation.yield(1)\n            continuation.finish()\n        }\n\n        // When\n        var iterator = stream.debounce(for: 0.05).makeAsyncIterator()\n        let first = try await XCTUnwrapAsync(await iterator.next())\n        let second = await iterator.next()\n\n        // Then\n        XCTAssertEqual(first, 1)\n        XCTAssertNil(second)\n    }\n\n    func test_debounce_givenBurstOfValues_yieldsOnlyLastValue() async throws {\n        // Given\n        let stream = AsyncStream<Int> { continuation in\n            continuation.yield(1)\n            continuation.yield(2)\n            continuation.yield(3)\n            continuation.finish()\n        }\n\n        // When\n        var values: [Int] = []\n        for await value in stream.debounce(for: 0.05) {\n            values.append(value)\n        }\n\n        // Then\n        XCTAssertEqual(values, [3])\n    }\n}\n\nprivate func XCTUnwrapAsync<T>(\n    _ expression: @autoclosure () async throws -> T?,\n    file: StaticString = #filePath,\n    line: UInt = #line\n) async throws -> T {\n    let value = try await expression()\n    return try XCTUnwrap(value, file: file, line: line)\n}\n"
  },
  {
    "path": "Tests/Utilities/AsyncSequenceToAsyncThrowingStreamTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport XCTest\n\n@testable import Jottre\n\nfinal class AsyncSequenceToAsyncThrowingStreamTests: XCTestCase {\n\n    func test_toAsyncThrowingStream_givenFiniteSequence_yieldsAllElementsThenFinishes() async throws {\n        // Given\n        let source = AsyncStream<Int> { continuation in\n            continuation.yield(1)\n            continuation.yield(2)\n            continuation.yield(3)\n            continuation.finish()\n        }\n\n        // When\n        var collected: [Int] = []\n        for try await value in source.toAsyncThrowingStream() {\n            collected.append(value)\n        }\n\n        // Then\n        XCTAssertEqual(collected, [1, 2, 3])\n    }\n\n    func test_toAsyncStream_givenFiniteSequence_yieldsAllElementsThenFinishes() async {\n        // Given\n        let source = AsyncStream<Int> { continuation in\n            continuation.yield(10)\n            continuation.yield(20)\n            continuation.finish()\n        }\n\n        // When\n        var collected: [Int] = []\n        for await value in source.toAsyncStream() {\n            collected.append(value)\n        }\n\n        // Then\n        XCTAssertEqual(collected, [10, 20])\n    }\n\n    func test_toAsyncThrowingStream_givenThrowingUpstream_propagatesError() async {\n        // Given\n        struct DummyError: Error, Equatable {}\n        let source = AsyncThrowingStream<Int, Error> { continuation in\n            continuation.yield(1)\n            continuation.finish(throwing: DummyError())\n        }\n\n        // When / Then\n        do {\n            for try await _ in source.toAsyncThrowingStream() {\n                /* no-op */\n            }\n            XCTFail(\"Expected the upstream error to propagate.\")\n        } catch is DummyError {\n            // Expected\n        } catch {\n            XCTFail(\"Unexpected error: \\(error)\")\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/Utilities/NSLayoutConstraintWithPriorityTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\n@MainActor\nfinal class NSLayoutConstraintWithPriorityTests: XCTestCase {\n\n    func test_withPriority_setsPriorityAndReturnsSameConstraint() {\n        // Given\n        let view = UIView()\n        let constraint = view.widthAnchor.constraint(equalToConstant: 100)\n\n        // When\n        let returned = constraint.withPriority(.defaultLow)\n\n        // Then\n        XCTAssertEqual(constraint.priority, .defaultLow)\n        XCTAssertTrue(returned === constraint)\n    }\n\n    func test_withPriority_givenChainedCalls_appliesLastValue() {\n        // Given\n        let view = UIView()\n        let constraint = view.widthAnchor.constraint(equalToConstant: 100)\n\n        // When\n        _ = constraint.withPriority(.defaultLow).withPriority(.required)\n\n        // Then\n        XCTAssertEqual(constraint.priority, .required)\n    }\n}\n"
  },
  {
    "path": "Tests/Utilities/UIColorAdaptiveBlackWhiteTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class UIColorAdaptiveBlackWhiteTests: XCTestCase {\n\n    func test_adaptiveBlackWhite_givenLightUserInterfaceStyle_resolvesToWhite() {\n        // Given\n        let lightTraits = UITraitCollection(userInterfaceStyle: .light)\n\n        // When\n        let resolved = UIColor.adaptiveBlackWhite.resolvedColor(with: lightTraits)\n\n        // Then\n        XCTAssertEqual(resolved, UIColor.white)\n    }\n\n    func test_adaptiveBlackWhite_givenDarkUserInterfaceStyle_resolvesToBlack() {\n        // Given\n        let darkTraits = UITraitCollection(userInterfaceStyle: .dark)\n\n        // When\n        let resolved = UIColor.adaptiveBlackWhite.resolvedColor(with: darkTraits)\n\n        // Then\n        XCTAssertEqual(resolved, UIColor.black)\n    }\n}\n"
  },
  {
    "path": "Tests/Utilities/UIFontPreferredFontTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class UIFontPreferredFontTests: XCTestCase {\n\n    func test_preferredFont_givenBodyTextStyleAndBoldWeight_returnsScaledBoldFont() {\n        // When\n        let font = UIFont.preferredFont(forTextStyle: .body, weight: .bold)\n\n        // Then\n        let traits = font.fontDescriptor.symbolicTraits\n        XCTAssertTrue(traits.contains(.traitBold))\n        XCTAssertGreaterThan(font.pointSize, 0)\n    }\n\n    func test_preferredFont_givenLargerTextStyle_producesLargerOrEqualPointSize() {\n        // When\n        let captionFont = UIFont.preferredFont(forTextStyle: .caption2, weight: .regular)\n        let titleFont = UIFont.preferredFont(forTextStyle: .title1, weight: .regular)\n\n        // Then\n        XCTAssertGreaterThan(titleFont.pointSize, captionFont.pointSize)\n    }\n}\n"
  },
  {
    "path": "Tests/Utilities/UITraitCollectionHasRenderingChangeTests.swift",
    "content": "/*\n Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n Copyright (C) 2021-2026 Anton Lorani\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program.  If not, see <https://www.gnu.org/licenses/>.\n*/\n\nimport UIKit\nimport XCTest\n\n@testable import Jottre\n\nfinal class UITraitCollectionHasRenderingChangeTests: XCTestCase {\n\n    func test_hasRenderingChange_givenIdenticalTraits_returnsFalse() {\n        // Given\n        let traits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .light),\n            UITraitCollection(displayScale: 2.0),\n        ])\n\n        // When\n        let result = traits.hasRenderingChange(comparedTo: traits)\n\n        // Then\n        XCTAssertFalse(result)\n    }\n\n    func test_hasRenderingChange_givenNilPrevious_returnsTrue() {\n        // Given\n        let traits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .light),\n            UITraitCollection(displayScale: 2.0),\n        ])\n\n        // When\n        let result = traits.hasRenderingChange(comparedTo: nil)\n\n        // Then\n        XCTAssertTrue(result)\n    }\n\n    func test_hasRenderingChange_givenDifferingUserInterfaceStyle_returnsTrue() {\n        // Given\n        let lightTraits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .light),\n            UITraitCollection(displayScale: 2.0),\n        ])\n        let darkTraits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .dark),\n            UITraitCollection(displayScale: 2.0),\n        ])\n\n        // When\n        let result = lightTraits.hasRenderingChange(comparedTo: darkTraits)\n\n        // Then\n        XCTAssertTrue(result)\n    }\n\n    func test_hasRenderingChange_givenDifferingDisplayScale_returnsTrue() {\n        // Given\n        let twoXTraits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .light),\n            UITraitCollection(displayScale: 2.0),\n        ])\n        let threeXTraits = UITraitCollection(traitsFrom: [\n            UITraitCollection(userInterfaceStyle: .light),\n            UITraitCollection(displayScale: 3.0),\n        ])\n\n        // When\n        let result = twoXTraits.hasRenderingChange(comparedTo: threeXTraits)\n\n        // Then\n        XCTAssertTrue(result)\n    }\n}\n"
  },
  {
    "path": "fastlane/.gitignore",
    "content": "report.xml\nbuild/\n"
  },
  {
    "path": "fastlane/Appfile",
    "content": "# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\napp_identifier(\"com.antonlorani.jottre\")\n"
  },
  {
    "path": "fastlane/Fastfile",
    "content": "# frozen_string_literal: true\n\n# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nrequire_relative 'versioning'\nrequire_relative 'appstore_metadata'\nrequire_relative 'export_screenshots'\n\nDEFAULT_SCREENSHOTS_DIR = File.expand_path('appstoreconnect/screenshots', __dir__)\n\ndefault_platform(:ios)\n\nSCHEME = 'Jottre'\nINFO_PLIST = 'Resources/Info.plist'\nAPP_IDENTIFIER = 'com.antonlorani.jottre'\nTEAM_ID = 'Y78RPE9KK3'\nAPPLE_DISTRIBUTION_IDENTITY = 'Apple Distribution'\nAPP_STORE_PROFILE = \"match AppStore #{APP_IDENTIFIER}\"\nCATALYST_APP_STORE_PROFILE = \"match AppStore #{APP_IDENTIFIER} catalyst\"\n\nNO_SIGN_XCARGS = \"CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO\"\n\ndef make_options(options = {})\n    api_key = app_store_connect_api_key(\n        key_id: ENV.fetch('APP_STORE_CONNECT_API_KEY_ID'),\n        issuer_id: ENV.fetch('APP_STORE_CONNECT_API_ISSUER_ID'),\n        key_content: ENV.fetch('APP_STORE_CONNECT_API_KEY_CONTENT'),\n        is_key_content_base64: true\n    )\n\n    {\n        api_key: api_key\n    }.merge(options)\nend\n\ndef release_build_number(platform:)\n    platform_suffix = platform == 'osx' ? '2' : '1'\n    build_number = \"#{Time.now.utc.strftime('%Y%m%d%H%M%S%L')}#{platform_suffix}\"\n\n    UI.message(\"Using timestamp build number #{build_number}\")\n    build_number\nend\n\ndef configure_manual_signing(identity:, provisioning_profile:)\n    update_code_signing_settings(\n        use_automatic_signing: false,\n        path: 'Jottre.xcodeproj',\n        targets: ['Jottre'],\n        team_id: TEAM_ID,\n        code_sign_identity: identity,\n        profile_name: provisioning_profile\n    )\nend\n\ndef manual_signing_export_options(provisioning_profile:, bundle_id: APP_IDENTIFIER)\n    {\n        signingStyle: 'manual',\n        teamID: TEAM_ID,\n        provisioningProfiles: {\n            bundle_id => provisioning_profile\n        }\n    }\nend\n\ndef upload_app_store_metadata(platform:, api_key:)\n    output_dir = File.expand_path(\"build/asc-metadata-#{platform}\", __dir__)\n    metadata_path, screenshots_path = AppStoreMetadata.stage(\n        platform: platform,\n        output_dir: output_dir\n    )\n\n    upload_to_app_store(\n        api_key: api_key,\n        platform: platform == :mac ? 'osx' : 'ios',\n        metadata_path: metadata_path,\n        screenshots_path: screenshots_path,\n        skip_binary_upload: true,\n        overwrite_screenshots: true,\n        submit_for_review: false,\n        automatic_release: false,\n        precheck_include_in_app_purchases: false,\n        force: true\n    )\nend\n\ndesc 'Export App Store screenshots from a Sketch file'\nlane :export_screenshots do |options|\n    unless options[:sketch_file]\n        UI.user_error!('sketch_file is required (e.g. fastlane export_screenshots sketch_file:path/to/file.sketch)')\n    end\n\n    sketch_file = File.expand_path(options[:sketch_file])\n    output_dir = options[:output_dir] ? File.expand_path(options[:output_dir]) : DEFAULT_SCREENSHOTS_DIR\n\n    ExportScreenshots.export(\n        sketch_file: sketch_file,\n        output_dir: output_dir\n    )\nend\n\ndesc 'Bump version from merge commit and push tag'\nlane :bump_version do\n    tag = Versioning.latest_tag\n\n    UI.user_error!(\"HEAD is already tagged as #{tag}.\") if tag && Versioning.head_tagged?(tag)\n\n    bump_strategy = Versioning.bump_strategy(since_tag: tag)\n    if bump_strategy\n        current = tag || get_info_plist_value(path: INFO_PLIST, key: 'CFBundleShortVersionString')\n        new_version = Versioning.bump_version(\n            current: current,\n            bump_strategy: bump_strategy\n        )\n\n        UI.message(\"#{current} → #{new_version} (#{bump_strategy} version bump)\")\n\n        add_git_tag(tag: new_version)\n        push_git_tags\n    else\n        UI.message('No version marker found; keeping the current marketing version.')\n    end\nend\n\nplatform :ios do\n    desc 'Generate the Xcode project using XcodeGen'\n    lane :generate_project do\n        sh('xcodegen generate --spec ../project.yml')\n    end\n\n    desc 'Run unit tests'\n    lane :test do\n        generate_project\n\n        run_tests(\n            scheme: SCHEME,\n            destination: 'platform=iOS Simulator,name=iPhone 17',\n            xcargs: NO_SIGN_XCARGS,\n            output_directory: 'build'\n        )\n    end\n\n    desc 'Verify iOS/iPadOS debug build'\n    lane :build_debug do\n        generate_project\n\n        gym(\n            scheme: SCHEME,\n            configuration: 'Debug',\n            destination: 'generic/platform=iOS',\n            xcargs: NO_SIGN_XCARGS,\n            skip_package_ipa: true,\n            output_directory: 'build'\n        )\n    end\n\n    desc 'Verify iOS/iPadOS release build'\n    lane :build_release do\n        generate_project\n\n        gym(\n            scheme: SCHEME,\n            configuration: 'Release',\n            destination: 'generic/platform=iOS',\n            xcargs: NO_SIGN_XCARGS,\n            skip_package_ipa: true,\n            output_directory: 'build'\n        )\n    end\n\n    desc 'Generate/sync development and App Store provisioning profiles for iOS/iPadOS'\n    lane :sync_profiles do |options|\n        options = make_options(options)\n        readonly = options.fetch(:readonly, true)\n\n        match(\n            type: 'development',\n            platform: 'ios',\n            api_key: options[:api_key],\n            readonly: readonly\n        )\n\n        match(\n            type: 'appstore',\n            platform: 'ios',\n            api_key: options[:api_key],\n            readonly: readonly\n        )\n    end\n\n    desc 'Build and upload iOS/iPadOS release to App Store Connect'\n    lane :distribute do |options|\n        options = make_options(options)\n\n        setup_ci\n        match(\n            type: 'appstore',\n            platform: 'ios',\n            api_key: options[:api_key],\n            readonly: true\n        )\n\n        version = Versioning.latest_tag\n        UI.user_error!('No version tag found') unless version\n\n        build_number = release_build_number(platform: 'ios')\n\n        generate_project\n\n        set_info_plist_value(\n            path: INFO_PLIST,\n            key: 'CFBundleShortVersionString',\n            value: version\n        )\n\n        set_info_plist_value(\n            path: INFO_PLIST,\n            key: 'CFBundleVersion',\n            value: build_number\n        )\n\n        configure_manual_signing(\n            identity: APPLE_DISTRIBUTION_IDENTITY,\n            provisioning_profile: APP_STORE_PROFILE\n        )\n\n        gym(\n            scheme: SCHEME,\n            configuration: 'Release',\n            destination: 'generic/platform=iOS',\n            export_method: 'app-store',\n            export_options: manual_signing_export_options(\n                provisioning_profile: APP_STORE_PROFILE\n            )\n        )\n\n        upload_to_app_store(\n            api_key: options[:api_key],\n            submit_for_review: false,\n            automatic_release: false,\n            precheck_include_in_app_purchases: false,\n            skip_metadata: true,\n            skip_screenshots: true\n        )\n\n        distribution_tag = \"#{version}.#{build_number}+ios\"\n        add_git_tag(tag: distribution_tag)\n        push_git_tags(tag: distribution_tag)\n    end\n\n    desc 'Upload App Store metadata + iPhone/iPad screenshots'\n    lane :upload_metadata do |options|\n        options = make_options(options)\n        upload_app_store_metadata(platform: :ios, api_key: options[:api_key])\n    end\nend\n\nplatform :mac do\n    desc 'Generate the Xcode project using XcodeGen'\n    lane :generate_project do\n        sh('xcodegen generate --spec ../project.yml')\n    end\n\n    desc 'Verify macOS debug build'\n    lane :build_debug do\n        generate_project\n\n        gym(\n            scheme: SCHEME,\n            configuration: 'Debug',\n            destination: 'platform=macOS,variant=Mac Catalyst',\n            xcargs: NO_SIGN_XCARGS,\n            skip_package_ipa: true,\n            output_directory: 'build'\n        )\n    end\n\n    desc 'Verify macOS release build'\n    lane :build_release do\n        generate_project\n\n        gym(\n            scheme: SCHEME,\n            configuration: 'Release',\n            destination: 'platform=macOS,variant=Mac Catalyst',\n            xcargs: NO_SIGN_XCARGS,\n            skip_package_ipa: true,\n            output_directory: 'build'\n        )\n    end\n\n    desc 'Generate/sync development and App Store provisioning profiles for macOS (Mac Catalyst)'\n    lane :sync_profiles do |options|\n        options = make_options(options)\n        readonly = options.fetch(:readonly, true)\n        force = options.fetch(:force, false)\n\n        match(\n            type: 'development',\n            platform: 'catalyst',\n            api_key: options[:api_key],\n            readonly: readonly\n        )\n        match(\n            type: 'appstore',\n            platform: 'catalyst',\n            additional_cert_types: ['mac_installer_distribution'],\n            api_key: options[:api_key],\n            readonly: readonly\n        )\n    end\n\n    desc 'Build and upload macOS release to App Store Connect'\n    lane :distribute do |options|\n        options = make_options(options)\n\n        setup_ci\n        match(\n            type: 'appstore',\n            platform: 'catalyst',\n            additional_cert_types: ['mac_installer_distribution'],\n            api_key: options[:api_key],\n            readonly: true\n        )\n\n        version = Versioning.latest_tag\n        UI.user_error!('No version tag found') unless version\n\n        build_number = release_build_number(platform: 'osx')\n\n        generate_project\n\n        set_info_plist_value(\n            path: INFO_PLIST,\n            key: 'CFBundleShortVersionString',\n            value: version\n        )\n\n        set_info_plist_value(\n            path: INFO_PLIST,\n            key: 'CFBundleVersion',\n            value: build_number\n        )\n\n        configure_manual_signing(\n            identity: APPLE_DISTRIBUTION_IDENTITY,\n            provisioning_profile: CATALYST_APP_STORE_PROFILE\n        )\n\n        update_code_signing_settings(\n            use_automatic_signing: false,\n            path: 'Jottre.xcodeproj',\n            targets: ['AppKitPlugin'],\n            team_id: TEAM_ID,\n            code_sign_identity: APPLE_DISTRIBUTION_IDENTITY\n        )\n\n        pkg_path = gym(\n            scheme: SCHEME,\n            configuration: 'Release',\n            destination: 'platform=macOS,variant=Mac Catalyst',\n            catalyst_platform: 'macos',\n            export_method: 'app-store',\n            export_options: manual_signing_export_options(\n                provisioning_profile: CATALYST_APP_STORE_PROFILE\n            ),\n            output_directory: 'build'\n        )\n\n        UI.user_error!(\"Expected gym to export a .pkg, got #{pkg_path || 'nil'}\") unless pkg_path&.end_with?('.pkg')\n\n        upload_to_app_store(\n            api_key: options[:api_key],\n            pkg: pkg_path,\n            submit_for_review: false,\n            automatic_release: false,\n            precheck_include_in_app_purchases: false,\n            skip_metadata: true,\n            skip_screenshots: true\n        )\n\n        distribution_tag = \"#{version}.#{build_number}+catalyst\"\n        add_git_tag(tag: distribution_tag)\n        push_git_tags(tag: distribution_tag)\n    end\n\n    desc 'Upload App Store metadata + Mac screenshots'\n    lane :upload_metadata do |options|\n        options = make_options(options)\n        upload_app_store_metadata(platform: :mac, api_key: options[:api_key])\n    end\nend\n"
  },
  {
    "path": "fastlane/Matchfile",
    "content": "# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\ngit_url(\"https://github.com/antonlorani/apple-provisioning\")\nstorage_mode(\"git\")\n\nplatform(\"ios\")\napp_identifier([\"com.antonlorani.jottre\"])\n"
  },
  {
    "path": "fastlane/README.md",
    "content": "fastlane documentation\n----\n\n# Installation\n\nMake sure you have the latest version of the Xcode command line tools installed:\n\n```sh\nxcode-select --install\n```\n\nFor _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)\n\n# Available Actions\n\n### export_screenshots\n\n```sh\n[bundle exec] fastlane export_screenshots\n```\n\nExport App Store screenshots from a Sketch file\n\n### bump_version\n\n```sh\n[bundle exec] fastlane bump_version\n```\n\nBump version from merge commit and push tag\n\n----\n\n\n## iOS\n\n### ios generate_project\n\n```sh\n[bundle exec] fastlane ios generate_project\n```\n\nGenerate the Xcode project using XcodeGen\n\n### ios test\n\n```sh\n[bundle exec] fastlane ios test\n```\n\nRun unit tests\n\n### ios build_debug\n\n```sh\n[bundle exec] fastlane ios build_debug\n```\n\nVerify iOS/iPadOS debug build\n\n### ios build_release\n\n```sh\n[bundle exec] fastlane ios build_release\n```\n\nVerify iOS/iPadOS release build\n\n### ios sync_profiles\n\n```sh\n[bundle exec] fastlane ios sync_profiles\n```\n\nGenerate/sync development and App Store provisioning profiles for iOS/iPadOS\n\n### ios distribute\n\n```sh\n[bundle exec] fastlane ios distribute\n```\n\nBuild and upload iOS/iPadOS release to App Store Connect\n\n### ios upload_metadata\n\n```sh\n[bundle exec] fastlane ios upload_metadata\n```\n\nUpload App Store metadata + iPhone/iPad screenshots\n\n----\n\n\n## Mac\n\n### mac generate_project\n\n```sh\n[bundle exec] fastlane mac generate_project\n```\n\nGenerate the Xcode project using XcodeGen\n\n### mac build_debug\n\n```sh\n[bundle exec] fastlane mac build_debug\n```\n\nVerify macOS debug build\n\n### mac build_release\n\n```sh\n[bundle exec] fastlane mac build_release\n```\n\nVerify macOS release build\n\n### mac sync_profiles\n\n```sh\n[bundle exec] fastlane mac sync_profiles\n```\n\nGenerate/sync development and App Store provisioning profiles for macOS (Mac Catalyst)\n\n### mac distribute\n\n```sh\n[bundle exec] fastlane mac distribute\n```\n\nBuild and upload macOS release to App Store Connect\n\n### mac upload_metadata\n\n```sh\n[bundle exec] fastlane mac upload_metadata\n```\n\nUpload App Store metadata + Mac screenshots\n\n----\n\nThis README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.\n\nMore information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).\n\nThe documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).\n"
  },
  {
    "path": "fastlane/appstore_metadata.rb",
    "content": "# frozen_string_literal: true\n\n# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nrequire 'json'\nrequire 'fileutils'\n\nmodule AppStoreMetadata\n    ROOT = File.join(__dir__, 'appstoreconnect')\n    METADATA_FILE = File.join(ROOT, 'metadata.json')\n    SCREENSHOTS_ROOT = File.join(ROOT, 'screenshots')\n\n    ASC_LOCALES = {\n        'en' => %w[en-US en-AU en-GB en-CA],\n        'de' => %w[de-DE],\n        'es' => %w[es-ES es-MX],\n        'fr' => %w[fr-FR fr-CA],\n        'hi' => %w[hi],\n        'ko' => %w[ko]\n    }.freeze\n\n    TEXT_FIELDS = %w[\n        name subtitle description keywords promotional_text release_notes\n        marketing_url privacy_url support_url\n    ].freeze\n\n    def self.stage(platform:, output_dir:)\n        platform_key = platform.to_s\n        metadata = load_metadata\n\n        metadata_dir = File.join(output_dir, 'metadata')\n        screenshots_dir = File.join(output_dir, 'screenshots')\n\n        FileUtils.rm_rf(output_dir)\n        FileUtils.mkdir_p([metadata_dir, screenshots_dir])\n\n        ASC_LOCALES.each do |short, asc_locales|\n            locale_data = metadata[short] || {}\n            asc_locales.each do |asc|\n                write_metadata(locale_data, File.join(metadata_dir, asc))\n                copy_screenshots(short, platform_key, locale_data, File.join(screenshots_dir, asc))\n            end\n        end\n\n        [metadata_dir, screenshots_dir]\n    end\n\n    def self.load_metadata\n        raise \"Missing metadata file at #{METADATA_FILE}\" unless File.exist?(METADATA_FILE)\n\n        JSON.parse(File.read(METADATA_FILE))\n    end\n\n    def self.write_metadata(locale_data, dir)\n        FileUtils.mkdir_p(dir)\n        TEXT_FIELDS.each do |field|\n            value = locale_data[field]\n            next if value.nil? || value.to_s.strip.empty?\n\n            File.write(File.join(dir, \"#{field}.txt\"), value)\n        end\n    end\n\n    def self.copy_screenshots(short_locale, platform_key, locale_data, dir)\n        FileUtils.mkdir_p(dir)\n        platform_screenshots = locale_data.fetch('screenshots') do\n            raise \"Missing 'screenshots' for locale '#{short_locale}' in #{METADATA_FILE}\"\n        end\n        devices = platform_screenshots.fetch(platform_key) do\n            raise \"Missing screenshots for platform '#{platform_key}' in locale '#{short_locale}'\"\n        end\n\n        devices.each do |device, files|\n            files.each_with_index do |name, idx|\n                src = File.join(SCREENSHOTS_ROOT, short_locale, device, name)\n                raise \"Missing screenshot file: #{src}\" unless File.exist?(src)\n\n                base = File.basename(name, '.png')\n                dst = File.join(dir, format('%<device>s_%<idx>02d_%<name>s.png', device: device, idx: idx, name: base))\n                FileUtils.cp(src, dst)\n            end\n        end\n    end\nend\n"
  },
  {
    "path": "fastlane/appstoreconnect/metadata.json",
    "content": "{\n    \"en\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"Minimalistic handwriting\",\n        \"description\": \"Jottre is a simple canvas for handwritten notes and sketches. Write freely with Apple Pencil on iPad, or use your finger on iPhone. Notes sync automatically across your iPhone, iPad, and Mac with iCloud. When you're ready to share, export as PDF, JPG, or PNG.\",\n        \"keywords\": \"simple notes,jot,notepad,sketchpad,minimal,whiteboard,quick notes,diagram,canvas,jotter,paper,draw\",\n        \"promotional_text\": \"Simple and minimalistic jotting.\",\n        \"release_notes\": \"Jottre 2.0 builds on what worked well, with thoughtful improvements throughout.\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    },\n    \"de\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"Minimalistische Notizen\",\n        \"description\": \"Jottre ist ein freier Raum für handgeschriebene Notizen und Skizzen. Schreib mit dem Apple Pencil auf dem iPad oder mit dem Finger auf dem iPhone. Deine Notizen werden automatisch über iCloud auf iPhone, iPad und Mac synchronisiert. Wenn du bereit bist zu teilen, exportiere sie als PDF, JPG oder PNG.\",\n        \"keywords\": \"notizen,notizblock,skizzenblock,minimal,whiteboard,schnellnotizen,diagramm,notizheft,papier,zeichnen\",\n        \"promotional_text\": \"Einfach und minimalistische Notizen\",\n        \"release_notes\": \"Jottre 2.0 baut auf dem auf, was gut funktioniert hat – mit durchdachten Verbesserungen in allen Bereichen.\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    },\n    \"es\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"Escritura minimalista\",\n        \"description\": \"Jottre es un lienzo sencillo para notas y bocetos a mano alzada. Escribe con total libertad usando el Apple Pencil en el iPad, o con el dedo en el iPhone. Tus notas se sincronizan automáticamente entre iPhone, iPad y Mac mediante iCloud. Cuando quieras compartir, expórtalas en PDF, JPG o PNG.\",\n        \"keywords\": \"notas,apuntes,bloc,cuaderno,minimal,pizarra,boceto,dibujar,lienzo,papel,esquema,rápidas\",\n        \"promotional_text\": \"Apuntes sencillos y minimalistas.\",\n        \"release_notes\": \"Jottre 2.0 mantiene lo que ya funcionaba e incorpora mejoras pensadas con detalle.\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    },\n    \"fr\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"Écriture minimaliste\",\n        \"description\": \"Jottre, c'est une page blanche pensée pour les notes manuscrites et les croquis. Écrivez librement avec l'Apple Pencil sur iPad, ou du bout du doigt sur iPhone. Vos notes se synchronisent automatiquement entre iPhone, iPad et Mac via iCloud. Au moment de partager, exportez-les en PDF, JPG ou PNG.\",\n        \"keywords\": \"notes,carnet,bloc-notes,croquis,minimal,tableau blanc,prise de notes,schéma,dessin,papier,esquisse\",\n        \"promotional_text\": \"Des notes simples et épurées.\",\n        \"release_notes\": \"Jottre 2.0 conserve ce qui marchait et y ajoute des améliorations pensées avec soin.\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    },\n    \"hi\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"सहज हस्तलेखन\",\n        \"description\": \"Jottre हस्तलिखित नोट्स और स्केच के लिए एक सरल कैनवस है। iPad पर Apple Pencil से या iPhone पर उंगली से बेझिझक लिखें। आपके नोट्स iCloud के ज़रिए iPhone, iPad और Mac पर अपने आप सिंक होते हैं। साझा करना हो तो PDF, JPG या PNG के रूप में निर्यात करें।\",\n        \"keywords\": \"नोट्स,लेखन,स्केच,कैनवस,सरल,व्हाइटबोर्ड,त्वरित नोट्स,डायग्राम,कागज़,चित्र,हस्तलेखन,ड्राइंग,मिनिमल\",\n        \"promotional_text\": \"सरल और न्यूनतम लेखन।\",\n        \"release_notes\": \"Jottre 2.0 में वही बातें बरकरार हैं जो अच्छी थीं, साथ में सोच-समझकर किए गए सुधार।\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    },\n    \"ko\": {\n        \"name\": \"Jottre\",\n        \"subtitle\": \"미니멀한 손글씨\",\n        \"description\": \"Jottre는 손글씨 메모와 스케치를 위한 간결한 캔버스입니다. iPad에서는 Apple Pencil로, iPhone에서는 손끝으로 자유롭게 적어 보세요. 작성한 메모는 iCloud를 통해 iPhone, iPad, Mac에서 자동으로 동기화됩니다. 공유할 때는 PDF, JPG, PNG로 손쉽게 내보낼 수 있습니다.\",\n        \"keywords\": \"메모,손글씨,스케치,노트,미니멀,화이트보드,빠른메모,다이어그램,캔버스,그림,종이,글쓰기,필기,아이패드,애플펜슬,낙서,다이어리,스케치북\",\n        \"promotional_text\": \"간결하고 미니멀한 메모.\",\n        \"release_notes\": \"Jottre 2.0은 좋았던 점은 그대로 두고, 곳곳을 세심하게 다듬었습니다.\",\n        \"marketing_url\": \"https://github.com/antonlorani/jottre\",\n        \"privacy_url\": \"https://github.com/antonlorani/jottre/blob/master/PRIVACY_POLICY.md\",\n        \"support_url\": \"https://github.com/antonlorani/jottre/issues\",\n        \"screenshots\": {\n            \"ios\": {\n                \"iphone\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"],\n                \"ipad\": [\"jotting.png\", \"applepencil.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            },\n            \"mac\": {\n                \"mac\": [\"jotting.png\", \"icloud.png\", \"darkmode.png\", \"share.png\"]\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "fastlane/appstoreconnect/screenshots/.gitignore",
    "content": "*\n!.gitignore\n"
  },
  {
    "path": "fastlane/export_screenshots.rb",
    "content": "# frozen_string_literal: true\n\n# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nrequire 'fileutils'\n\n# Export artboards from a Sketch file and group by locale & platform.\n#\n# Artboards must be named: <platform>_<name>_<locale>\n# Example: iphone_jotting_de, iphone_quick_note_de\n# Output structure: <output_dir>/<locale>/<platform>/<name>.png\nmodule ExportScreenshots\n    LOCALES = %w[de en es fr hi ko].freeze\n\n    # Exports artboards from the given Sketch file into output_dir, grouped by\n    # locale and platform.\n    def self.export(sketch_file:, output_dir:)\n        ui = FastlaneCore::UI\n        ui.user_error!(\"Sketch file not found: #{sketch_file}\") unless File.exist?(sketch_file)\n\n        FileUtils.mkdir_p(output_dir)\n\n        ui.message(\"Exporting artboards from #{sketch_file}...\")\n        unless system('sketchtool', 'export', 'artboards', sketch_file, \"--output=#{output_dir}\")\n            ui.user_error!('sketchtool export failed (is sketchtool in your PATH?)')\n        end\n\n        files = Dir.glob(File.join(output_dir, '*.png'))\n        ui.user_error!(\"No PNG files found in #{output_dir}\") if files.empty?\n\n        ui.message(\"Grouping #{files.length} file(s)...\")\n        files.each { |file| group_file(file, output_dir: output_dir, ui: ui) }\n        ui.message('Done.')\n    end\n\n    def self.group_file(file, output_dir:, ui:)\n        source_name = File.basename(file)\n        platform, *rest = File.basename(file, '.png').split('_')\n        locale = rest.pop\n        name = rest.join('_')\n\n        if platform.nil? || locale.nil? || name.empty?\n            ui.message(\"  Skipping #{source_name} (doesn't match <platform>_<name>_<locale>)\")\n            return\n        end\n\n        unless LOCALES.include?(locale)\n            ui.message(\"  Skipping #{source_name} (unknown locale: #{locale})\")\n            return\n        end\n\n        destination = File.join(output_dir, locale, platform, \"#{name}.png\")\n        FileUtils.mkdir_p(File.dirname(destination))\n        FileUtils.mv(file, destination)\n        ui.message(\"  #{source_name} -> #{destination}\")\n    end\nend\n"
  },
  {
    "path": "fastlane/versioning.rb",
    "content": "# frozen_string_literal: true\n\n# Jottre: Minimalistic jotting for iPhone, iPad and Mac.\n# Copyright (C) 2021-2026 Anton Lorani\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nmodule Versioning\n    SEMVER_PATTERN = /\\A\\d+\\.\\d+\\.\\d+\\z/\n\n    # Returns the latest semver tag or nil if none exists.\n    def self.latest_tag\n        tags = `git tag --sort=-version:refname 2>/dev/null`.strip\n        tags.each_line do |line|\n            tag = line.strip\n            return tag if tag.match?(SEMVER_PATTERN)\n        end\n        nil\n    end\n\n    # Returns true if HEAD is already tagged.\n    def self.head_tagged?(tag)\n        `git describe --exact-match --tags HEAD 2>/dev/null || true`.strip == tag\n    end\n\n    # Returns the next version bump strategy suitable since the last tag, or\n    # nil if no version marker is present.\n    def self.bump_strategy(since_tag:)\n        range = since_tag ? \"#{since_tag}..HEAD\" : 'HEAD'\n        subjects = `git log #{range} --pretty=format:'%s'`.strip\n\n        strategy = nil\n        subjects.each_line do |line|\n            line = line.strip\n            next if line.empty?\n\n            if line.match?(/^major:/i)\n                strategy = 'major'\n                break\n            elsif line.match?(/^minor:/i) && strategy != 'major'\n                strategy = 'minor'\n            elsif line.match?(/^patch:/i) && strategy.nil?\n                strategy = 'patch'\n            end\n        end\n        strategy\n    end\n\n    # Performs a semver bump on a given semantic version.\n    def self.bump_version(current:, bump_strategy:)\n        parts = current.split('.').map(&:to_i)\n        parts << 0 while parts.length < 3\n        major, minor, patch = parts\n\n        case bump_strategy\n        when 'major' then \"#{major + 1}.0.0\"\n        when 'minor' then \"#{major}.#{minor + 1}.0\"\n        else              \"#{major}.#{minor}.#{patch + 1}\"\n        end\n    end\nend\n"
  },
  {
    "path": "hooks/install_hooks.sh",
    "content": "#!/bin/bash\n\nset -e\n\nhooks=(\"pre-commit\")\n\ntop_level_dir=$(git rev-parse --show-toplevel)\nsource_hooks_dir=\"$top_level_dir/hooks\"\ndestination_hooks_dir=\"$top_level_dir/.git/hooks\"\n\nif [ ! -d \"$destination_hooks_dir\" ]; then\n    echo \"Creating missing '$destination_hooks_dir' directory.\"\n    mkdir -p \"$destination_hooks_dir\"\nfi\n\nfor hook in \"${hooks[@]}\"; do\n    ln -sf \"$source_hooks_dir/$hook\" \"$destination_hooks_dir/$hook\"\n    echo \"Creating symbolic link for '$hook'.\"\ndone\n"
  },
  {
    "path": "hooks/pre-commit",
    "content": "#!/bin/bash\n\nSTAGED_RUBY_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\\.rb$')\nif [ -n \"$STAGED_RUBY_FILES\" ]; then\n  bundle exec rubocop --autocorrect-all $STAGED_RUBY_FILES\n\n  MODIFIED=$(git diff --name-only $STAGED_RUBY_FILES)\n  if [ -n \"$MODIFIED\" ]; then\n    echo -e \"\\033[0;31mFormatting applied. Restage affected files.\\033[0m\"\n    exit 1\n  fi\nfi\n\nSTAGED_SWIFT_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\\.swift$')\nif [ -n \"$STAGED_SWIFT_FILES\" ]; then\n  NEEDS_FORMATTING=0\n\n  for FILE in $STAGED_SWIFT_FILES; do\n    BEFORE=$(git show \":$FILE\")\n    AFTER=$(swift format - <<< \"$BEFORE\")\n\n    if ! diff -q <(echo \"$BEFORE\") <(echo \"$AFTER\") > /dev/null; then\n      NEEDS_FORMATTING=1\n    fi\n  done\n\n  if [ $NEEDS_FORMATTING -eq 1 ]; then\n    echo \"Running swift format...\"\n    swift format $STAGED_SWIFT_FILES --in-place --parallel\n    echo -e \"\\033[0;31mFormatting applied. Restage affected files.\\033[0m\"\n    exit 1\n  fi\nfi\n\nexit 0\n"
  },
  {
    "path": "project.yml",
    "content": "name: Jottre\noptions:\n  bundleIdPrefix: com.antonlorani\n  deploymentTarget:\n    iOS: \"15.0\"\n  knownRegions:\n    - en\n    - de\n    - af\n    - ar\n    - es\n    - fr\n    - hi\n    - id\n    - it\n    - ja\n    - ko\n    - ms\n    - nl\n    - pl\n    - pt-BR\n    - pt-PT\n    - ru\n    - sv\n    - th\n    - tr\n    - uk\n    - vi\n\nsettings:\n  base:\n    DEVELOPMENT_TEAM: Y78RPE9KK3\n\ntargets:\n  Jottre:\n    type: application\n    platform: iOS\n    deploymentTarget: \"15.0\"\n    sources:\n      - Sources\n      - path: Resources/Assets.xcassets\n      - path: Resources/Localizable.xcstrings\n      - path: Resources/PrivacyInfo.xcprivacy\n    info:\n      path: Resources/Info.plist\n      properties:\n        LSApplicationCategoryType: public.app-category.productivity\n        UILaunchScreen: {}\n        UISupportedInterfaceOrientations:\n          - UIInterfaceOrientationPortrait\n          - UIInterfaceOrientationPortraitUpsideDown\n          - UIInterfaceOrientationLandscapeLeft\n          - UIInterfaceOrientationLandscapeRight\n        UISupportedInterfaceOrientations~ipad:\n          - UIInterfaceOrientationPortrait\n          - UIInterfaceOrientationPortraitUpsideDown\n          - UIInterfaceOrientationLandscapeLeft\n          - UIInterfaceOrientationLandscapeRight\n        CFBundleDocumentTypes:\n          - CFBundleTypeName: Jottre Jot\n            CFBundleTypeRole: Editor\n            LSHandlerRank: Owner\n            LSItemContentTypes:\n              - com.antonlorani.jottre.jot\n        LSApplicationQueriesSchemes:\n          - shareddocuments\n        UTExportedTypeDeclarations:\n          - UTTypeIdentifier: com.antonlorani.jottre.jot\n            UTTypeDescription: Jottre Jot\n            UTTypeConformsTo:\n              - public.data\n            UTTypeTagSpecification:\n              public.filename-extension:\n                - jot\n        UIFileSharingEnabled: true\n        LSSupportsOpeningDocumentsInPlace: true\n        NSQuitAlwaysKeepsWindows: true\n        NSUserActivityTypes:\n          - com.antonlorani.jottre.openJot\n        UIApplicationSceneManifest:\n          UIApplicationSupportsMultipleScenes: true\n          UISceneConfigurations:\n            UIWindowSceneSessionRoleApplication:\n              - UISceneConfigurationName: \"Default Configuration\"\n                UISceneDelegateClassName: \"$(PRODUCT_MODULE_NAME).SceneDelegate\"\n        NSUbiquitousContainers:\n          iCloud.com.antonlorani.jottre:\n            NSUbiquitousContainerIsDocumentScopePublic: true\n            NSUbiquitousContainerSupportedFolderLevels: Any\n            NSUbiquitousContainerName: Jottre\n    entitlements:\n      path: Jottre.entitlements\n      properties:\n        com.apple.security.files.user-selected.read-write: true\n        com.apple.developer.icloud-container-identifiers:\n          - iCloud.com.antonlorani.jottre\n        com.apple.developer.icloud-services:\n          - CloudDocuments\n        com.apple.developer.ubiquity-container-identifiers:\n          - iCloud.com.antonlorani.jottre\n    settings:\n      base:\n        PRODUCT_BUNDLE_IDENTIFIER: com.antonlorani.jottre\n        PRODUCT_NAME: Jottre\n        SWIFT_VERSION: \"6.0\"\n        SWIFT_STRICT_CONCURRENCY: complete\n        ASSETCATALOG_COMPILER_APPICON_NAME: AppIcon\n        SUPPORTS_MACCATALYST: YES\n        MACCATALYST_UI_IDIOM: mac\n        DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER: NO\n        BUNDLE_IDENTIFIER_MACCATALYST: com.antonlorani.jottre\n        SWIFT_EMIT_LOC_STRINGS: YES\n        ENABLE_HARDENED_RUNTIME: YES\n        ENABLE_APP_SANDBOX: YES\n        ENABLE_USER_SCRIPT_SANDBOXING: YES\n        VALIDATE_PRODUCT: YES\n        EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*]: AppKitPlugin.bundle\n    dependencies:\n      - target: AppKitPlugin\n        embed: true\n        codeSign: true\n    packages: []\n\n  JottreTests:\n    type: bundle.unit-test\n    platform: iOS\n    deploymentTarget: \"15.0\"\n    sources:\n      - path: Tests\n        excludes:\n          - Resources/**\n      - path: Tests/Resources\n        buildPhase: resources\n    dependencies:\n      - target: Jottre\n    settings:\n      base:\n        PRODUCT_BUNDLE_IDENTIFIER: com.antonlorani.jottre.JottreTests\n        SWIFT_VERSION: \"6.0\"\n        SWIFT_STRICT_CONCURRENCY: complete\n        GENERATE_INFOPLIST_FILE: YES\n\n  AppKitPlugin:\n    type: bundle\n    platform: macOS\n    deploymentTarget: \"12.0\"\n    sources:\n      - AppKitPlugin\n    info:\n      path: AppKitPlugin/Info.plist\n      properties:\n        CFBundleName: AppKitPlugin\n        CFBundleIdentifier: com.antonlorani.jottre.AppKitPlugin\n        CFBundleVersion: 1\n        CFBundleShortVersionString: 1.0\n        CFBundlePackageType: BNDL\n        CFBundleExecutable: AppKitPlugin\n    settings:\n      base:\n        PRODUCT_BUNDLE_IDENTIFIER: com.antonlorani.jottre.AppKitPlugin\n        SWIFT_VERSION: \"6.0\"\n        CODE_SIGN_STYLE: Manual\n        CODE_SIGN_IDENTITY: \"-\"\n        MACH_O_TYPE: mh_bundle\n        ENABLE_HARDENED_RUNTIME: YES\n\nschemes:\n  Jottre:\n    build:\n      targets:\n        Jottre: all\n        AppKitPlugin: all\n    run:\n      config: Debug\n      executable: Jottre\n    test:\n      config: Debug\n      targets:\n        - name: JottreTests\n    archive:\n      config: Release\n    profile:\n      config: Release\n    analyze:\n      config: Debug\n\n  JottreTests:\n    build:\n      targets:\n        JottreTests: all\n        Jottre: all\n    test:\n      config: Debug\n      targets:\n        - name: JottreTests\n    analyze:\n      config: Debug\n\n  AppKitPlugin:\n    build:\n      targets:\n        AppKitPlugin: all\n    run:\n      config: Debug\n    archive:\n      config: Release\n    profile:\n      config: Release\n    analyze:\n      config: Debug\n"
  }
]