[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: kean\npatreon: # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: \"Align CI\"\n\non:\n  push:\n    branches:\n      - main\n  pull_request:\n    branches:\n      - '*'\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\njobs:\n  ios-latest:\n    name: Unit Tests (iOS 26.2, Xcode 26.2)\n    runs-on: macOS-26\n    timeout-minutes: 20\n    env:\n      DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer\n    steps:\n      - uses: actions/checkout@v4\n      - name: Boot simulator\n        run: |\n          xcrun simctl boot \"iPhone 17 Pro\"\n          xcrun simctl bootstatus \"iPhone 17 Pro\" -b\n      - name: Run Tests\n        run: xcodebuild test -scheme \"Align\" -destination \"OS=26.2,name=iPhone 17 Pro\" | xcbeautify\n  macos-latest:\n    name: Unit Tests (macOS, Xcode 26.2)\n    runs-on: macOS-26\n    timeout-minutes: 20\n    env:\n      DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer\n    steps:\n      - uses: actions/checkout@v4\n      - name: Run Tests\n        run: xcodebuild test -scheme \"Align\" -destination \"platform=macOS\" | xcbeautify\n  tvos-latest:\n    name: Unit Tests (tvOS 26.2, Xcode 26.2)\n    runs-on: macOS-26\n    timeout-minutes: 20\n    env:\n      DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer\n    steps:\n      - uses: actions/checkout@v4\n      - name: Boot simulator\n        run: |\n          xcrun simctl boot \"Apple TV\"\n          xcrun simctl bootstatus \"Apple TV\" -b\n      - name: Run Tests\n        run: xcodebuild test -scheme \"Align\" -destination \"OS=26.2,name=Apple TV\" | xcbeautify\n  macos-xcode-26-0:\n    name: Unit Tests (macOS, Xcode 26.0)\n    runs-on: macOS-26\n    timeout-minutes: 20\n    env:\n      DEVELOPER_DIR: /Applications/Xcode_26.0.app/Contents/Developer\n    steps:\n      - uses: actions/checkout@v4\n      - name: Run Tests\n        run: xcodebuild test -scheme \"Align\" -destination \"platform=macOS\" | xcbeautify\n  swift-build:\n    name: Swift Build (SPM)\n    runs-on: macOS-26\n    timeout-minutes: 20\n    env:\n      DEVELOPER_DIR: /Applications/Xcode_26.2.app/Contents/Developer\n    steps:\n      - uses: actions/checkout@v4\n      - name: Build\n        run: swift build\n"
  },
  {
    "path": ".gitignore",
    "content": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## Build generated\nbuild/\nDerivedData/\n.swiftpm/\n\n## Various settings\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata/\n\n## Other\n*.moved-aside\n*.xccheckout\n*.xcscmblueprint\n\n## Obj-C/Swift specific\n*.hmap\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n## Playgrounds\ntimeline.xctimeline\nplayground.xcworkspace\n\n# Swift Package Manager\n#\n# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.\n# Packages/\n# Package.pins\n.build/\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/#source-control\n\nfastlane/report.xml\nfastlane/Preview.html\nfastlane/screenshots\nfastlane/test_output\n"
  },
  {
    "path": ".scripts/build-docs.sh",
    "content": "#!/usr/bin/env bash\n#\n# Generates a static, self-hostable DocC site for the Align package.\n#\n# Output layout (default OUTPUT_DIR=.build/docs):\n#   .build/docs/index.html\n#   .build/docs/documentation/...\n#   .build/docs/data/, css/, js/, images/, ...\n#\n# Serve the directory from any static host. For GitHub Pages under a\n# project repo, the site is reachable at:\n#   https://<user>.github.io/<HOSTING_BASE_PATH>/documentation/align/\n#\n# Environment overrides:\n#   SCHEME             Xcode scheme to build (default: Align)\n#   DESTINATION        xcodebuild destination (default: generic/platform=iOS)\n#   HOSTING_BASE_PATH  URL path prefix for hosting (default: Align)\n#                      Use \"\" when serving from the domain root.\n#   OUTPUT_DIR         Final docs directory (default: .build/docs)\n#   DERIVED_DATA       Xcode derived data path (default: .build/docc-derived-data)\n\nset -euo pipefail\n\nSCHEME=\"${SCHEME:-Align}\"\nDESTINATION=\"${DESTINATION:-generic/platform=iOS}\"\nHOSTING_BASE_PATH=\"${HOSTING_BASE_PATH-Align}\"\nOUTPUT_DIR=\"${OUTPUT_DIR:-.build/docs}\"\nDERIVED_DATA=\"${DERIVED_DATA:-.build/docc-derived-data}\"\n\nif [ -n \"$HOSTING_BASE_PATH\" ]; then\n    DOCC_FLAGS=\"--transform-for-static-hosting --hosting-base-path $HOSTING_BASE_PATH\"\nelse\n    DOCC_FLAGS=\"--transform-for-static-hosting\"\nfi\n\necho \"==> Building DocC archive (scheme: $SCHEME, destination: $DESTINATION)\"\nxcodebuild docbuild \\\n    -scheme \"$SCHEME\" \\\n    -destination \"$DESTINATION\" \\\n    -derivedDataPath \"$DERIVED_DATA\" \\\n    OTHER_DOCC_FLAGS=\"$DOCC_FLAGS\"\n\nARCHIVE=$(find \"$DERIVED_DATA\" -type d -name \"${SCHEME}.doccarchive\" | head -n 1)\nif [ -z \"$ARCHIVE\" ]; then\n    echo \"Error: could not locate ${SCHEME}.doccarchive under $DERIVED_DATA\" >&2\n    exit 1\nfi\n\necho \"==> Extracting static site from $ARCHIVE\"\nrm -rf \"$OUTPUT_DIR\"\nmkdir -p \"$OUTPUT_DIR\"\ncp -R \"$ARCHIVE/\" \"$OUTPUT_DIR/\"\n\necho \"==> Done. Self-hostable docs at: $OUTPUT_DIR\"\nif [ -n \"$HOSTING_BASE_PATH\" ]; then\n    echo \"    Entry point: /$HOSTING_BASE_PATH/documentation/align/\"\nelse\n    echo \"    Entry point: /documentation/align/\"\nfi\n"
  },
  {
    "path": "Align.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 54;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t0C683A111FBA462D002ACEB9 /* AnchorCollectionEdgesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C683A0F1FBA4624002ACEB9 /* AnchorCollectionEdgesTests.swift */; };\n\t\t0C81ABB71C889C100036DFD4 /* Align.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C81ABB61C889C100036DFD4 /* Align.swift */; };\n\t\t0C8FD7791FB85E8B00A20E3D /* XCTestExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7781FB85E8B00A20E3D /* XCTestExtensions.swift */; };\n\t\t0C8FD77F1FB85EA500A20E3D /* Diff.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD77E1FB85EA500A20E3D /* Diff.swift */; };\n\t\t0C8FD7821FB85F5600A20E3D /* AnchorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7811FB85F5600A20E3D /* AnchorTests.swift */; };\n\t\t0C8FD7851FB8608E00A20E3D /* ConstraintsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7841FB8608E00A20E3D /* ConstraintsTests.swift */; };\n\t\t0C8FD78E1FB88B9B00A20E3D /* AnchorAlignmentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD78D1FB88B9B00A20E3D /* AnchorAlignmentTests.swift */; };\n\t\t0C8FD7911FB88BC300A20E3D /* AnchorEdgeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7901FB88BC300A20E3D /* AnchorEdgeTests.swift */; };\n\t\t0C8FD7941FB88BED00A20E3D /* AnchorCenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7931FB88BED00A20E3D /* AnchorCenterTests.swift */; };\n\t\t0C8FD7971FB88C0600A20E3D /* AnchorDimensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7961FB88C0600A20E3D /* AnchorDimensionTests.swift */; };\n\t\t0C8FD79A1FB88CE100A20E3D /* AnchorCollectionCenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD7991FB88CE100A20E3D /* AnchorCollectionCenterTests.swift */; };\n\t\t0C8FD79D1FB88D2100A20E3D /* AnchorCollectionSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0C8FD79C1FB88D2100A20E3D /* AnchorCollectionSizeTests.swift */; };\n\t\t0CBC06B8249E9F790055D1B1 /* AnchorPerformanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CBC06B7249E9F790055D1B1 /* AnchorPerformanceTests.swift */; };\n\t\t0CC3A06C1D7476A700754E59 /* Align.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CE361181C86077B00EA70CF /* Align.framework */; };\n\t\t0CCC2073287E3D26001FC3CE /* Align.docc in Sources */ = {isa = PBXBuildFile; fileRef = 0CCC2072287E3D26001FC3CE /* Align.docc */; };\n\t\t0CF93195249834DB00E1016A /* Align+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CF93193249834DB00E1016A /* Align+Extensions.swift */; };\n\t\t0CF931972499039500E1016A /* AnchorAPIsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CF931962499039500E1016A /* AnchorAPIsTests.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXContainerItemProxy section */\n\t\t0CC3A06D1D7476A700754E59 /* PBXContainerItemProxy */ = {\n\t\t\tisa = PBXContainerItemProxy;\n\t\t\tcontainerPortal = 0CE3610F1C86077B00EA70CF /* Project object */;\n\t\t\tproxyType = 1;\n\t\t\tremoteGlobalIDString = 0CE361171C86077B00EA70CF;\n\t\t\tremoteInfo = \"Arranged iOS\";\n\t\t};\n/* End PBXContainerItemProxy section */\n\n/* Begin PBXFileReference section */\n\t\t0C683A0F1FBA4624002ACEB9 /* AnchorCollectionEdgesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorCollectionEdgesTests.swift; sourceTree = \"<group>\"; };\n\t\t0C6C05D2287F102F009CFDE6 /* ci.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; name = ci.yml; path = .github/workflows/ci.yml; sourceTree = \"<group>\"; };\n\t\t0C81ABB61C889C100036DFD4 /* Align.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Align.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7781FB85E8B00A20E3D /* XCTestExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCTestExtensions.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD77E1FB85EA500A20E3D /* Diff.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Diff.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7811FB85F5600A20E3D /* AnchorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7841FB8608E00A20E3D /* ConstraintsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstraintsTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD78D1FB88B9B00A20E3D /* AnchorAlignmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorAlignmentTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7901FB88BC300A20E3D /* AnchorEdgeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorEdgeTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7931FB88BED00A20E3D /* AnchorCenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorCenterTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7961FB88C0600A20E3D /* AnchorDimensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorDimensionTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD7991FB88CE100A20E3D /* AnchorCollectionCenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorCollectionCenterTests.swift; sourceTree = \"<group>\"; };\n\t\t0C8FD79C1FB88D2100A20E3D /* AnchorCollectionSizeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorCollectionSizeTests.swift; sourceTree = \"<group>\"; };\n\t\t0CBC06B7249E9F790055D1B1 /* AnchorPerformanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorPerformanceTests.swift; sourceTree = \"<group>\"; };\n\t\t0CC3A0671D7476A700754E59 /* Align Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = \"Align Tests.xctest\"; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0CCC2072287E3D26001FC3CE /* Align.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Align.docc; sourceTree = \"<group>\"; };\n\t\t0CD220BF22BBED040095AD2A /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = \"<group>\"; };\n\t\t0CD220C022BBED0A0095AD2A /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = \"<group>\"; };\n\t\t0CD220C322BBED250095AD2A /* LICENSE */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE; sourceTree = \"<group>\"; };\n\t\t0CD220C422BBED2C0095AD2A /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = \"<group>\"; };\n\t\t0CE361181C86077B00EA70CF /* Align.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Align.framework; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t0CF93193249834DB00E1016A /* Align+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = \"Align+Extensions.swift\"; sourceTree = \"<group>\"; };\n\t\t0CF931962499039500E1016A /* AnchorAPIsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnchorAPIsTests.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t0CC3A0641D7476A700754E59 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0CC3A06C1D7476A700754E59 /* Align.framework in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0CE361141C86077B00EA70CF /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t0C8FD7771FB85E7A00A20E3D /* Extensions */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0C8FD7781FB85E8B00A20E3D /* XCTestExtensions.swift */,\n\t\t\t\t0C8FD77E1FB85EA500A20E3D /* Diff.swift */,\n\t\t\t\t0CF93193249834DB00E1016A /* Align+Extensions.swift */,\n\t\t\t);\n\t\t\tpath = Extensions;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CC3A0721D7476B300754E59 /* Tests */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0C8FD7811FB85F5600A20E3D /* AnchorTests.swift */,\n\t\t\t\t0CF931962499039500E1016A /* AnchorAPIsTests.swift */,\n\t\t\t\t0C8FD78D1FB88B9B00A20E3D /* AnchorAlignmentTests.swift */,\n\t\t\t\t0C8FD7901FB88BC300A20E3D /* AnchorEdgeTests.swift */,\n\t\t\t\t0C8FD7931FB88BED00A20E3D /* AnchorCenterTests.swift */,\n\t\t\t\t0C8FD7961FB88C0600A20E3D /* AnchorDimensionTests.swift */,\n\t\t\t\t0C683A0F1FBA4624002ACEB9 /* AnchorCollectionEdgesTests.swift */,\n\t\t\t\t0C8FD7991FB88CE100A20E3D /* AnchorCollectionCenterTests.swift */,\n\t\t\t\t0C8FD79C1FB88D2100A20E3D /* AnchorCollectionSizeTests.swift */,\n\t\t\t\t0CBC06B7249E9F790055D1B1 /* AnchorPerformanceTests.swift */,\n\t\t\t\t0C8FD7841FB8608E00A20E3D /* ConstraintsTests.swift */,\n\t\t\t\t0C8FD7771FB85E7A00A20E3D /* Extensions */,\n\t\t\t);\n\t\t\tpath = Tests;\n\t\t\tsourceTree = SOURCE_ROOT;\n\t\t};\n\t\t0CD220BB22BBECD70095AD2A /* Metadata */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CD220BF22BBED040095AD2A /* README.md */,\n\t\t\t\t0CD220C022BBED0A0095AD2A /* Package.swift */,\n\t\t\t\t0CD220C322BBED250095AD2A /* LICENSE */,\n\t\t\t\t0CD220C422BBED2C0095AD2A /* CHANGELOG.md */,\n\t\t\t\t0C6C05D2287F102F009CFDE6 /* ci.yml */,\n\t\t\t);\n\t\t\tname = Metadata;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CE3610E1C86077B00EA70CF = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CE361261C8607D600EA70CF /* Sources */,\n\t\t\t\t0CC3A0721D7476B300754E59 /* Tests */,\n\t\t\t\t0CD220BB22BBECD70095AD2A /* Metadata */,\n\t\t\t\t0CE361191C86077B00EA70CF /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CE361191C86077B00EA70CF /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0CE361181C86077B00EA70CF /* Align.framework */,\n\t\t\t\t0CC3A0671D7476A700754E59 /* Align Tests.xctest */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t0CE361261C8607D600EA70CF /* Sources */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t0C81ABB61C889C100036DFD4 /* Align.swift */,\n\t\t\t\t0CCC2072287E3D26001FC3CE /* Align.docc */,\n\t\t\t);\n\t\t\tpath = Sources;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXHeadersBuildPhase section */\n\t\t0CE361151C86077B00EA70CF /* Headers */ = {\n\t\t\tisa = PBXHeadersBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXHeadersBuildPhase section */\n\n/* Begin PBXNativeTarget section */\n\t\t0CC3A0661D7476A700754E59 /* Align Tests */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0CC3A06F1D7476A700754E59 /* Build configuration list for PBXNativeTarget \"Align Tests\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0CC3A0631D7476A700754E59 /* Sources */,\n\t\t\t\t0CC3A0641D7476A700754E59 /* Frameworks */,\n\t\t\t\t0CC3A0651D7476A700754E59 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t\t0CC3A06E1D7476A700754E59 /* PBXTargetDependency */,\n\t\t\t);\n\t\t\tname = \"Align Tests\";\n\t\t\tproductName = \"Arranged iOS Tests\";\n\t\t\tproductReference = 0CC3A0671D7476A700754E59 /* Align Tests.xctest */;\n\t\t\tproductType = \"com.apple.product-type.bundle.unit-test\";\n\t\t};\n\t\t0CE361171C86077B00EA70CF /* Align */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 0CE361201C86077B00EA70CF /* Build configuration list for PBXNativeTarget \"Align\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t0CE361131C86077B00EA70CF /* Sources */,\n\t\t\t\t0CE361141C86077B00EA70CF /* Frameworks */,\n\t\t\t\t0CE361151C86077B00EA70CF /* Headers */,\n\t\t\t\t0CE361161C86077B00EA70CF /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Align;\n\t\t\tproductName = Stack;\n\t\t\tproductReference = 0CE361181C86077B00EA70CF /* Align.framework */;\n\t\t\tproductType = \"com.apple.product-type.framework\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t0CE3610F1C86077B00EA70CF /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tBuildIndependentTargetsInParallel = YES;\n\t\t\t\tLastSwiftUpdateCheck = 0800;\n\t\t\t\tLastUpgradeCheck = 1600;\n\t\t\t\tORGANIZATIONNAME = \"Alexander Grebenyuk\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t0CC3A0661D7476A700754E59 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 8.0;\n\t\t\t\t\t\tDevelopmentTeam = NR8DLKJ7E6;\n\t\t\t\t\t\tLastSwiftMigration = 0910;\n\t\t\t\t\t\tProvisioningStyle = Automatic;\n\t\t\t\t\t};\n\t\t\t\t\t0CE361171C86077B00EA70CF = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.2.1;\n\t\t\t\t\t\tLastSwiftMigration = 0800;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 0CE361121C86077B00EA70CF /* Build configuration list for PBXProject \"Align\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 0CE3610E1C86077B00EA70CF;\n\t\t\tproductRefGroup = 0CE361191C86077B00EA70CF /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t0CE361171C86077B00EA70CF /* Align */,\n\t\t\t\t0CC3A0661D7476A700754E59 /* Align Tests */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t0CC3A0651D7476A700754E59 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0CE361161C86077B00EA70CF /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t0CC3A0631D7476A700754E59 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0C8FD79A1FB88CE100A20E3D /* AnchorCollectionCenterTests.swift in Sources */,\n\t\t\t\t0C8FD79D1FB88D2100A20E3D /* AnchorCollectionSizeTests.swift in Sources */,\n\t\t\t\t0C8FD7941FB88BED00A20E3D /* AnchorCenterTests.swift in Sources */,\n\t\t\t\t0CBC06B8249E9F790055D1B1 /* AnchorPerformanceTests.swift in Sources */,\n\t\t\t\t0C8FD77F1FB85EA500A20E3D /* Diff.swift in Sources */,\n\t\t\t\t0C683A111FBA462D002ACEB9 /* AnchorCollectionEdgesTests.swift in Sources */,\n\t\t\t\t0C8FD7791FB85E8B00A20E3D /* XCTestExtensions.swift in Sources */,\n\t\t\t\t0C8FD78E1FB88B9B00A20E3D /* AnchorAlignmentTests.swift in Sources */,\n\t\t\t\t0CF931972499039500E1016A /* AnchorAPIsTests.swift in Sources */,\n\t\t\t\t0CF93195249834DB00E1016A /* Align+Extensions.swift in Sources */,\n\t\t\t\t0C8FD7911FB88BC300A20E3D /* AnchorEdgeTests.swift in Sources */,\n\t\t\t\t0C8FD7821FB85F5600A20E3D /* AnchorTests.swift in Sources */,\n\t\t\t\t0C8FD7851FB8608E00A20E3D /* ConstraintsTests.swift in Sources */,\n\t\t\t\t0C8FD7971FB88C0600A20E3D /* AnchorDimensionTests.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n\t\t0CE361131C86077B00EA70CF /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t0CCC2073287E3D26001FC3CE /* Align.docc in Sources */,\n\t\t\t\t0C81ABB71C889C100036DFD4 /* Align.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXTargetDependency section */\n\t\t0CC3A06E1D7476A700754E59 /* PBXTargetDependency */ = {\n\t\t\tisa = PBXTargetDependency;\n\t\t\ttarget = 0CE361171C86077B00EA70CF /* Align */;\n\t\t\ttargetProxy = 0CC3A06D1D7476A700754E59 /* PBXContainerItemProxy */;\n\t\t};\n/* End PBXTargetDependency section */\n\n/* Begin XCBuildConfiguration section */\n\t\t0CC3A0701D7476A700754E59 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.github.kean.Align-iOS-Tests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0CC3A0711D7476A700754E59 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVES = YES;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"com.github.kean.Align-iOS-Tests\";\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0CE3611E1C86077B00EA70CF /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.6;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 11.5;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos appletvos iphonesimulator appletvsimulator macosx\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t\tSWIFT_STRICT_CONCURRENCY = complete;\n\t\t\t\tSWIFT_VERSION = 6.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 15.6;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0CE3611F1C86077B00EA70CF /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCURRENT_PROJECT_VERSION = 1;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.6;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 11.5;\n\t\t\t\tSUPPORTED_PLATFORMS = \"iphoneos appletvos iphonesimulator appletvsimulator macosx\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tSWIFT_STRICT_CONCURRENCY = complete;\n\t\t\t\tSWIFT_VERSION = 6.0;\n\t\t\t\tTVOS_DEPLOYMENT_TARGET = 15.6;\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t\tVERSION_INFO_PREFIX = \"\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t0CE361211C86077B00EA70CF /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tDOCC_HOSTING_BASE_PATH = /align/;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 4.0.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.kean.Align;\n\t\t\t\tPRODUCT_NAME = Align;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t0CE361221C86077B00EA70CF /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tAPPLICATION_EXTENSION_API_ONLY = YES;\n\t\t\t\tDOCC_HOSTING_BASE_PATH = /align/;\n\t\t\t\tDYLIB_COMPATIBILITY_VERSION = 1;\n\t\t\t\tDYLIB_CURRENT_VERSION = 1;\n\t\t\t\tDYLIB_INSTALL_NAME_BASE = \"@rpath\";\n\t\t\t\tINSTALL_PATH = \"$(LOCAL_LIBRARY_DIR)/Frameworks\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t\t\"@loader_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tMARKETING_VERSION = 4.0.0;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.github.kean.Align;\n\t\t\t\tPRODUCT_NAME = Align;\n\t\t\t\tSKIP_INSTALL = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t0CC3A06F1D7476A700754E59 /* Build configuration list for PBXNativeTarget \"Align Tests\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0CC3A0701D7476A700754E59 /* Debug */,\n\t\t\t\t0CC3A0711D7476A700754E59 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0CE361121C86077B00EA70CF /* Build configuration list for PBXProject \"Align\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0CE3611E1C86077B00EA70CF /* Debug */,\n\t\t\t\t0CE3611F1C86077B00EA70CF /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t0CE361201C86077B00EA70CF /* Build configuration list for PBXNativeTarget \"Align\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t0CE361211C86077B00EA70CF /* Debug */,\n\t\t\t\t0CE361221C86077B00EA70CF /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 0CE3610F1C86077B00EA70CF /* Project object */;\n}\n"
  },
  {
    "path": "Align.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:/Users/kean/Develop/Yalta/Align.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "Align.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.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>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "Align.xcodeproj/xcshareddata/xcschemes/Align.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1600\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"0CE361171C86077B00EA70CF\"\n               BuildableName = \"Align.framework\"\n               BlueprintName = \"Align\"\n               ReferencedContainer = \"container:Align.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"0CE361171C86077B00EA70CF\"\n            BuildableName = \"Align.framework\"\n            BlueprintName = \"Align\"\n            ReferencedContainer = \"container:Align.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <Testables>\n         <TestableReference\n            skipped = \"NO\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"0CC3A0661D7476A700754E59\"\n               BuildableName = \"Align Tests.xctest\"\n               BlueprintName = \"Align Tests\"\n               ReferencedContainer = \"container:Align.xcodeproj\">\n            </BuildableReference>\n         </TestableReference>\n      </Testables>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"0CE361171C86077B00EA70CF\"\n            BuildableName = \"Align.framework\"\n            BlueprintName = \"Align\"\n            ReferencedContainer = \"container:Align.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"0CE361171C86077B00EA70CF\"\n            BuildableName = \"Align.framework\"\n            BlueprintName = \"Align\"\n            ReferencedContainer = \"container:Align.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "[Changelog](https://github.com/kean/Align/releases) for all versions\n\n# Align 4\n\n## Align 4.0\n\n*Apr 25, 2026*\n\n### New APIs\n\n- Add an optional `priority:` parameter to all constraint-creating methods, allowing the priority to be set at creation time without needing to wrap the call in a `Constraints` group\n- Add a `LayoutPriority` typealias (`UILayoutPriority` on iOS/tvOS, `NSLayoutConstraint.Priority` on macOS)\n- Add an optional `relation:` parameter to the single-edge `pin(to:inset:relation:priority:)`, restoring symmetry with `spacing(_:to:relation:priority:)`\n- Add an optional `offset: CGPoint` parameter to `AnchorCollectionCenter.align(offset:priority:)`, restoring symmetry with the single-anchor `Anchor<AnchorType.Center, _>.align(offset:priority:)`\n- Add a `/` operator for `Anchor`, mirroring `*`, so dimensions can be written as `view.anchors.height / 2`\n- Upgrade `Constraints`'s `Collection` conformance to `RandomAccessCollection`, matching the underlying `[NSLayoutConstraint]` storage and giving callers O(1) indexing and `count`\n\n### API Changes & Deprecations\n\n- Fix typo in public API: rename `greaterThanOrEqul(_:)` to `greaterThanOrEqual(_:)` on `AnchorCollectionSize`\n- Convert `AnchorCollectionEdges.absolute()` from a method to a computed property `absolute`, since it takes no arguments and has no side effects. Call sites change from `view.anchors.edges.absolute().pin()` to `view.anchors.edges.absolute.pin()`\n- Replace the class hierarchies inside `AnchorAxis` and `AnchorType` with empty enums plus `@_marker` protocols (`AnchorKind`, `AlignmentAnchorKind`). The phantom types are now uninstantiable and inherently `Sendable`. `AnchorType.Alignment` is replaced by `AlignmentAnchorKind`\n- Replace the four hand-rolled `Constraints(for:)` arity overloads with a single variadic-generics initializer using Swift 5.9 parameter packs. Existing trailing-closure call sites (`Constraints(for: a, b) { a, b in ... }`) compile unchanged; non-trailing call sites must now pass the closure with the `closure:` label\n- Deprecated the Core API on `AnchorCollectionEdges` (`equal(_:insets:priority:)` and `lessThanOrEqual(_:insets:priority:)`, both `EdgeInsets` and `CGFloat` overloads), which duplicated the Semantic API. Use `pin(to:insets:priority:)` and `pin(to:insets:alignment:priority:)` (with `.center`) instead\n\n### Safety & Correctness\n\n- Replace `superview!` force-unwraps in `pin()` and `align()` with `precondition`s that report the offending view, instead of an opaque `Optional(\"nil\")` trap\n- Move `@MainActor` from the `Constraints` struct itself to just the members that touch UIKit/AppKit (`init`, `activate`, `deactivate`, `add`, `install`, and the static `stack`). The `Collection` conformance no longer needs `nonisolated` + `MainActor.assumeIsolated`, eliminating a runtime trap when a `Constraints` value was iterated off the main actor and turning that misuse into a compile-time error on the constraint-building entry points instead\n- Move `LayoutItem`'s `superview` requirement behind `@_spi(Align)` and add an SPI-only `_disableAutoresizingMask()` requirement, letting `Constraints.add` dispatch via the witness table instead of an `as?` cast on every constraint. The default public surface is unchanged; clients that need these (e.g. for custom `LayoutItem` conformances) can opt in with `@_spi(Align) import Align`\n\n### Performance\n\n- Make `Constraints` a struct to avoid an allocation cost\n- Mark hot-path `Anchor` accessors, operators, and `equal/greaterThanOrEqual/lessThanOrEqual` overloads `@inlinable` so callers in client modules can inline through them\n- Mark `Anchor.offsetting(by:)` and `Anchor.multiplied(by:)` as `consuming`, letting the compiler forward the existential's class reference into the returned anchor instead of retaining and releasing it\n- Mark the `+`, `-`, and `*` operators on `Anchor` as `consuming` their anchor operand so chains like `view.anchors.top + 10 + 4` collapse to zero extra retains\n- Inline the nested `constrain` helper in `AnchorCollectionEdges.pin` to eliminate per-call closure context allocation\n- Hoist calls to `_disableAutoresizingMask` in scenarios where it's called many times repeatedly like `edges.pin`\n\n### Housekeeping\n\n- Remove `Align.playground` in favor of an inline `#Preview` in `Sources/Align.swift`\n\n# Align 3\n\n## Align 3.3\n\n*Sep 13, 2024*\n\n- Add `Sendable` and `@MainActor` annotations\n- Add compatibility with Swift 6 and Xcode 16\n\n## Align 3.2\n\n*April 13, 2024*\n\n- Remove deprecated `.base` property\n- Increase the minimum supported Xcode version to 14.3\n- Increase the minimum supported platforms to iOS 13.0, tvOS 13.0, macOS 10.15\n\n## Align 3.1.0\n\n*July 22, 2023*\n\n- Use static linking by default\n- Fix warnings in Xcode 15\n\n## Align 3.0.0\n\n*July 13, 2022*\n\n- **Breaking Change**: The `Alignment` used in `pin()` method now works slightly differently by default for the pre-defined `.trailing`, `.leading`, `.bottom`, and `.top` alignments. Previously, `.leading` alignment would pin to the view to the `.leading` horizontal guide and `.fill` the view vertically. In Align 3.0, it centers the view vertically instead. The same logic is applied to other previously listed alignments.\n- Add new [documentation](https://kean-docs.github.io/align/documentation/align/) created using DocC\n- Increase the minimum required Xcode version to 13.3\n- Increase the minimum supported platforms to iOS 12.0 / tvOS 12.0 / macOS 10.14\n- Rename `LayoutAnchors/base` to `LayoutAnchors/item`\n- Move `Alignment` to `AnchorCollectionEdges/Alignment `\n- Fix typos\n\n# Align 2\n\n## Align 2.4.1\n\n*June 21, 2020*\n\n- Fix typo in `Alignment`\n\n## Align 2.4.0\n\n*June 21, 2020*\n\n- Add [Cheat Sheet](https://github.com/kean/Align/files/4809887/align-cheat-sheet.pdf)\n- Remove `anchors.margins` and `anchors.safeArea` APIs\n- Documentation improvements\n\n## Align 2.3.0\n\n*June 20, 2020*\n\n- `Constraints` type now conforms to `Collection` protocol (backed by `Array`)\n- Add `clamp(to limit: ClosedRange<CGFloat>)` API for dimension anchors\n- Add `Constraints` `activate()` and `deactivate()` methods\n- Add default `insets` argument for `AnchorCollectionEdges`  `equal` method\n- Replace the target parameter of `AnchorCollectionEdges` `equal` method with `LayoutItem`\n- Add `AnchorCollectionEdges` variant that works with `CGFloat`\n- Add `AnchorCollectionEdges`  `lessThatOrEqual()` method \n- Fix `AnchorCollectionCenter` `lessThatOrEqual()` method\n- Replace the target parameter of `AnchorCollectionCenter` Core APImethod with `LayoutItem`\n- Performance optimizations\n\n## Align 2.2.1\n\n*June 18, 2020*\n\n- Add a missing version of `pin()` that works with `CGFloat` as insets \n\n## Align 2.2.0\n\n*June 18, 2020*\n\n- Add missing Core APIs for collections \n\n## Align 2.1.0\n\n*June 17, 2020*\n\n> Use [Migration Guide](https://github.com/kean/Align/blob/master/Docs/MigrationGuide2.md) included in the repo to ease migration.\n\n- Remove all deprecated APIs. If you are migrating from the previous version, consider migrating to version 2.0.0 first. It is going to guide you through the migration.\n\n## Align 2.0.0\n\n*June 17, 2020*\n\n> Use [Migration Guide](https://github.com/kean/Align/blob/master/Docs/MigrationGuide2.md) included in the repo to ease migration.\n\n- Add `macOS support`\n- Add new low-level APIs: `equal`, `greaterThanOrEqual`, `lessThatOrEqual`\n- Add `spacing()` method for alignments\n- Rename `.al` to `.anchors`\n- Remove `.al` version accepting closure\n- Add `constraints` property to `Constraints` type to allow access to all of the constraints created using it\n- Add `activate` parameter to `Constraints` initiliazer to optionally disable automatic activation of constraints\n- Deprecated `func edges(_ edges: LayoutEdge...)`, use `pin(axis:)` instead\n- `pin()` methods now use `.leading` and `.trailing` anchors instead of absolute `.left` and `.right` anchors. To switch to absolute anchors, use `absolute()`: `view.anchors.edges.absolute()`\n- Remove `addSubview` family of APIs\n- Migrate to Swift 5.1\n- Increase minimum required platform versions\n\n# Align 1\n\n## Align 1.2.1\n\n- Add support for Swift Package Manager 5.0\n\n## Align 1.2\n\n- Rebrand\n\n## Align 1.1\n\n- Add Swift 5.0 support\n- Remove Swift 4.0 and Swift 4.1 support\n- Remove iOS 9, tvOS 9 support\n\n## Align 1.0\n\nUpdated to Swift 4.2 (required) and Xcode 10.\n\n## Align 0.6\n\nA minor update to make Align a bit more ergonomic.\n\n- Add iOS 9 and tvOS 9 compatibility (used to require iOS 10 and tvOS 10).\n- Add operators for setting multipliers: `subtitle.height.match(title.height * 2)`.\n- Deprecated `align(with:)` and `match(:)` method that had `offset` and `multiplier` parameters. Operators are the preferred way to set those (more compact and more obvious what they mean).\n- Move phantom types (e.g. `AnchorAxisVertical`) into namespaces to reduce clutter in a global namespace.\n\n## Align 0.5.1\n\n- Improve documentation\n- Improve some minor implementation details\n- Update project to Xcode 9.3 recommended settings\n\n## Align 0.5\n\n- Remove Stacks and Spacers ([gist](https://gist.github.com/kean/e77bac3625124b1de559a241a72d1e09))\n- Remove Insets\n\n## Align 0.4\n\n- `pinToSuperviewMargins` methods now use margin attributes (e.g. `.topMargin`) and not `layoutMarginsGuide` to workaround issues on iOS 10 where layout guides are unpredictable https://stackoverflow.com/questions/32694124/auto-layout-layoutmarginsguide\n- Add `pinToSafeArea(of:)` family of methods which use `safeAreaLayoutGuide` on iOS 11 and fall back to `topLayoutGuide` and `bottomLayoutGuide` on iOS 10\n- `addSubview` methods are no longer generic which allows for more extra flexibility when adding constraints (e.g. you can create and operate on an array of layout proxies)\n\n\n## Align 0.3.1\n\nSmall update that focuses on improving  `offsetting(by:)` method.\n\n- `offsetting(by:)` method now available for all anchors\n- Add an operator that wraps `offsetting(by:)` method (which wasn't very convenient by itself)\n- [Fix] Offsetting anchor which already has an offset now works correctly\n- Split the project into two files\n\n\n## Align 0.3\n\n-  With new `addSubview(_:constraints:)` method you define a view hierarchy and layout views at the same time. It encourages splitting layout code into logical blocks and prevents programmer errors (e.g. trying to add constraints to views not in view hierarchy).\n\n- Remove standalone `fillSuperview(..)` and `centerInSuperview()` family of functions. There were multiple cons of having them (e.g. more terminology to learn, hard to document and explain, inconsistent with `center` and `size` manipulations, were not allowing to pin in a corner).\n\nNow you can manipulate multiple edges at the same time instead:\n\n```swift\nview.addSubview(stack) {\n    $0.edges.pinToSuperview() // pins the edges to fill the superview\n    $0.edges.pinToSuperview(insets: Insets(10)) // with insets\n    $0.edges.pinToSuperviewMargins() // or margins\n\n    $0.edges(.left, .right).pinToSuperview() // fill along horizontal axis\n    $0.centerY.alignWithSuperview() // center along vertical axis\n}\n```\n\nThis is a much simpler model which removes entire layer of standalone methods available on `LayoutItems`. Now you always select either an `anchor` or `collections of anchors`, then use their methods to add constraints. Much simpler.\n\n- Make LayoutAnchors's `base` public to enable adding custom extensions on top of it.\n\n\n## Align 0.2\n\n- Redesigned Align API which now follow [Swift API Design Guidelines](https://swift.org/documentation/api-design-guidelines/). Although most of the APIs are compact, it is a *non-goal* to enable the most concise syntax possible. Instead Align provides a fluent APIs that form grammatical phrases.\n- Full test coverage\n- Add a new comprehensive overview, [full guide](https://github.com/kean/Align/blob/master/Docs/AlignGuide.md), and [installation guide](https://github.com/kean/Align/blob/master/Docs/InstallationGuide.md)\n\n\n## Align 0.1.1\n\n- Revert to original `Spacer` design\n\n\n## Align 0.1\n\n- Initial version\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2017-2026 Alexander Grebenyuk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": ".PHONY: help docs preview-docs clean-docs test\n\nhelp:\n\t@echo \"Targets:\"\n\t@echo \"  docs          Build self-hostable DocC site into .build/docs\"\n\t@echo \"  preview-docs  Serve docs locally with docc preview\"\n\t@echo \"  clean-docs    Remove generated docs and DocC derived data\"\n\t@echo \"  test          Run the test suite via swift test\"\n\t@echo \"\"\n\t@echo \"Overrides for 'docs' (env vars):\"\n\t@echo \"  HOSTING_BASE_PATH=Align    URL prefix; set to '' for domain root\"\n\t@echo \"  OUTPUT_DIR=.build/docs     Output directory\"\n\t@echo \"  DESTINATION='generic/platform=iOS'  xcodebuild destination\"\n\ndocs:\n\t@./.scripts/build-docs.sh\n\npreview-docs:\n\t@xcodebuild -scheme Align -destination 'generic/platform=iOS' \\\n\t\t-derivedDataPath .build/docc-derived-data \\\n\t\tdocbuild OTHER_DOCC_FLAGS=\"--preview\"\n\nclean-docs:\n\trm -rf .build/docs .build/docc-derived-data\n\ntest:\n\tswift test\n"
  },
  {
    "path": "Package.swift",
    "content": "// swift-tools-version:6.0\nimport PackageDescription\n\nlet package = Package(\n    name: \"Align\",\n    platforms: [\n        .iOS(.v15),\n        .tvOS(.v15),\n        .macOS(.v13),\n        .visionOS(.v1)\n    ],\n    products: [\n        .library(name: \"Align\", targets: [\"Align\"]),\n    ],\n    targets: [\n        .target(name: \"Align\",  path: \"Sources\"),\n        .testTarget(name: \"AlignTests\", dependencies: [\"Align\"], path: \"Tests\")\n    ]\n)\n"
  },
  {
    "path": "README.md",
    "content": "![logo](https://user-images.githubusercontent.com/1567433/178810472-8b5f687e-ed7f-491c-99ed-e86e563462ef.png)\n\n<p align=\"left\">\n<img src=\"https://img.shields.io/badge/Swift-5.10-orange.svg\">\n<img src=\"https://img.shields.io/badge/platforms-iOS%20%7C%20tvOS%20%7C%20macOS-lightgrey.svg?colorA=28a745\">\n<img src=\"https://img.shields.io/badge/SPM-supported-brightgreen.svg\">\n<img src=\"https://img.shields.io/badge/license-MIT-blue.svg\">\n</p>\n\nThe best way to create constraints in code.\n\n- **Semantic**. Align APIs focus on your goals, not the math behind Auto Layout constraints.  \n- **Powerful**. Create multiple constraints with a single line of code.  \n- **Type Safe**. Makes it impossible to create invalid constraints, at compile time.  \n- **Fluent**. Concise and clear API that follows [Swift API Design Guidelines](https://swift.org/documentation/api-design-guidelines/).  \n- **Simple**. Stop worrying about `translatesAutoresizingMaskIntoConstraints` and constraints activation.  \n\nThe same constraint, with and without Align:\n\n```swift\n// NSLayoutAnchor\nview.translatesAutoresizingMaskIntoConstraints = false\nNSLayoutConstraint.activate([\n    view.topAnchor.constraint(equalTo: superview.topAnchor, constant: 20),\n    view.leadingAnchor.constraint(equalTo: superview.leadingAnchor, constant: 20),\n    view.trailingAnchor.constraint(equalTo: superview.trailingAnchor, constant: -20),\n    view.bottomAnchor.constraint(equalTo: superview.bottomAnchor, constant: -20)\n])\n\n// Align\nview.anchors.edges.pin(insets: 20)\n```\n\nMore examples:\n\n```swift\n// Core API\nview.anchors.top.equal(superview.top)\nview.anchors.width.equal(view.anchors.height * 2)\n\n// Semantic API\nview.anchors.edges.pin(to: superview.safeAreaLayoutGuide, insets: 20)\nview.anchors.width.clamp(to: 10...40)\n```\n\nAnd here's something a bit more powerful:\n\n```swift\nview.anchors.edges.pin(insets: 20, alignment: .center)\n```\n\n<img src=\"https://user-images.githubusercontent.com/1567433/84931836-5cb7e400-b0a1-11ea-8342-ce76b151fcad.png\" alt=\"pin edges with center alignment\" width=\"331px\"/>\n\n## Tip: Avoid Repeating `import Align`\n\nTo make Align available throughout your module without writing `import Align` in every file, add a single file (e.g. `Align+Exported.swift`) containing:\n\n```swift\n@_exported import Align\n```\n\nAny file in the same module can then use Align's APIs directly. This is especially convenient in app targets that lean heavily on Auto Layout.\n\n## Documentation\n\nThe [**documentation**](https://kean-docs.github.io/align/documentation/align/) for Align is created using DocC and covers all of its APIs in a clear visual way. There is also a [**cheat sheet**](https://github.com/kean/Align/blob/master/Sources/Align.docc/Resources/align-cheat-sheet.pdf) available that lists all of the available APIs.\n\n<a href=\"https://kean-docs.github.io/align/documentation/align/\">\n<img alt=\"Screen Shot 2022-07-13 at 10 08 57 AM\" src=\"https://user-images.githubusercontent.com/1567433/178755429-9420d25e-dad1-4e61-9a22-04139c5746e6.png\"  width=\"858px\">\n</a>\n\n## Requirements\n\n| Align          | Swift       | Xcode             | Platforms                                  |\n|----------------|-------------|-------------------|--------------------------------------------|\n| Align 4.0      | Swift 6.0   | Xcode 26.0        | iOS 15, tvOS 15, macOS 13, visionOS 1      |\n| Align 3.3      | Swift 5.10  | Xcode 15.3        | iOS 14, tvOS 14, macOS 10.16               |\n\n## Why Align\n\nAlign strives for clarity and simplicity by following [Swift API Design Guidelines](https://swift.org/documentation/api-design-guidelines/). Although most of the APIs are compact, it is a *non-goal* to enable the most concise syntax possible.\n\nWhat you get with Align:\n\n- **Fluent, high-level API** for everyday Auto Layout\n- **Lightweight** – ~400 lines, zero dependencies\n- **Minimal surface area** – a single new property, `anchors`, on every view and layout guide\n- **Fast to compile** – built on `NSLayoutConstraint`, with no operator-overload soup\n- **No ceremony** – constraints are activated for you, and `translatesAutoresizingMaskIntoConstraints` is handled automatically\n"
  },
  {
    "path": "Sources/Align+Preview.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n#if DEBUG && (os(iOS) || os(tvOS))\nimport SwiftUI\n\n@available(iOS 17.0, tvOS 17.0, *)\n#Preview {\n    // A scrolling gallery of the highest-value Align layouts, one per titled card.\n    let cards = UIStackView()\n    cards.axis = .vertical\n    cards.spacing = 24\n    cards.layoutMargins = UIEdgeInsets(top: 24, left: 16, bottom: 24, right: 16)\n    cards.isLayoutMarginsRelativeArrangement = true\n\n    // The bread-and-butter Align idiom: fill the container with uniform insets.\n    cards.addArrangedSubview(demoCard(\"Pin edges with insets\") { canvas in\n        let box = UIView(); box.backgroundColor = .systemBlue\n        canvas.addSubview(box)\n\n        box.anchors.edges.pin(insets: 16)\n    })\n\n    // `pin` also accepts an `alignment` to anchor a fixed-size view to a corner.\n    cards.addArrangedSubview(demoCard(\"Pin to a corner\") { canvas in\n        let button = UIView(); button.backgroundColor = .systemIndigo\n        canvas.addSubview(button)\n\n        button.anchors.size.equal(CGSize(width: 96, height: 40))\n        button.anchors.edges.pin(insets: 16, alignment: .bottomTrailing)\n    })\n\n    // Center the view and give it an explicit size — a classic badge/dialog layout.\n    cards.addArrangedSubview(demoCard(\"Center with fixed size\") { canvas in\n        let box = UIView(); box.backgroundColor = .systemPink\n        canvas.addSubview(box)\n\n        box.anchors.center.align()\n        box.anchors.size.equal(CGSize(width: 120, height: 44))\n    })\n\n    // Anchor arithmetic: pin horizontally, then drive height from width for a 2:1 banner.\n    cards.addArrangedSubview(demoCard(\"Aspect ratio with arithmetic\") { canvas in\n        let banner = UIView(); banner.backgroundColor = .systemTeal\n        canvas.addSubview(banner)\n\n        banner.anchors.edges.pin(insets: 16, axis: .horizontal)\n        banner.anchors.centerY.align()\n        banner.anchors.height.equal(banner.anchors.width * 0.5)\n    })\n\n    let scroll = UIScrollView()\n    scroll.backgroundColor = .systemBackground\n    scroll.addSubview(cards)\n\n    // Match the content width to the scroll view so it scrolls vertically only.\n    cards.anchors.edges.pin()\n    cards.anchors.width.equal(scroll.anchors.width)\n    return scroll\n}\n\n@MainActor private func demoCard(_ title: String, _ build: (UIView) -> Void) -> UIView {\n    let label = UILabel()\n    label.font = .systemFont(ofSize: 13, weight: .semibold)\n    label.textColor = .secondaryLabel\n    label.text = title\n    let canvas = UIView()\n    canvas.backgroundColor = .secondarySystemBackground\n    canvas.anchors.height.equal(140)\n    build(canvas)\n    let stack = UIStackView(arrangedSubviews: [label, canvas])\n    stack.axis = .vertical; stack.spacing = 6\n    return stack\n}\n#endif\n"
  },
  {
    "path": "Sources/Align.docc/Align.md",
    "content": "# ``Align``\n\nThe best way to create constraints in code.\n\n![Logo](logo.png)\n\n- **Semantic**. Align APIs focus on your goals, not the math behind Auto Layout constraints.  \n- **Powerful**. Create multiple constraints with a single line of code.  \n- **Type Safe**. Makes it impossible to create invalid constraints, at compile time.  \n- **Fluent**. Concise and clear API that follows [Swift API Design Guidelines](https://swift.org/documentation/api-design-guidelines/).  \n- **Simple**. Stop worrying about `translatesAutoresizingMaskIntoConstraints` and constraints activation.  \n\nTo give you a taste of what the *semantic* APIs look like, here is an example:\n\n```swift\nview.anchors.edges.pin(insets: 20, alignment: .center)\n```\n\n![01](01.png)\n\n## Getting Started\n\nThe entire library fits in a single file with around 330 lines of code. The best way to install it is by using Swift Package Manager, but you can also simply drag-n-drop it into your app. If you install it as a package, you can avoid having to import it in every file by re-exposing its APIs in your app target:\n\n```swift\nimport Align\n\nextension LayoutItem {\n    var anchors: Align.LayoutAnchors<Self> { Align.LayoutAnchors(self) }\n}\n```\n\n## Overview\n\nThe Align APIs for creating constraints fall into two categories:\n\n![02](02.png)\n\n**Core API** lets you create constraints by setting relations between one or more anchors. These APIs are similar to what `NSLayoutAnchor` provides. **Semantic API** is a high-level API that focuses on your goals, such as pinning edges to the container, aligning the view, setting spacing between views, etc.\n\nBoth APIs are designed to be easily discoverable using Xcode code completions. There is also a [**cheat sheet**](https://github.com/kean/Align/blob/master/Sources/Align.docc/Resources/align-cheat-sheet.pdf) available listing all APIs in one place.\n\n## Requirements\n\n| Align          | Swift       | Xcode             | Platforms                                  |\n|----------------|-------------|-------------------|--------------------------------------------|\n| Align 4.0      | Swift 6.0   | Xcode 16          | iOS 15, tvOS 15, macOS 13, visionOS 1      |\n| Align 3.3      | Swift 5.10  | Xcode 15.3        | iOS 14, tvOS 14, macOS 10.16               |\n\n## Topics\n\n### Essentials\n\n- ``LayoutItem``\n- ``LayoutAnchors``\n- ``Anchor``\n\n### Manipulating Multiple Anchors\n\n- ``AnchorCollectionEdges``\n- ``AnchorCollectionCenter``\n- ``AnchorCollectionSize``\n\n### Managing Constraints\n\n- ``Constraints``\n"
  },
  {
    "path": "Sources/Align.docc/Alignment+Extension.md",
    "content": "# ``Align/AnchorCollectionEdges/Alignment``\n\n## Topics\n\n### Initializers\n\n- ``init(horizontal:vertical:)``\n\n### Predefined Alignments\n\n- ``fill``\n- ``center``\n- ``topLeading``\n- ``top``\n- ``topTrailing``\n- ``trailing``\n- ``bottomTrailing``\n- ``bottom``\n- ``bottomLeading``\n- ``leading``\n"
  },
  {
    "path": "Sources/Align.docc/Anchor+Extensions.md",
    "content": "# ``Align/Anchor``\n\n### Core Constraints\n\n```swift\n// Align two views along one of the edges\na.anchors.leading.equal(b.anchors.leading)\n\n// Other options are available:\n// a.anchors.leading.greaterThanOrEqual(b.anchors.leading)\n// a.anchors.leading.greaterThanOrEqual(b.anchors.leading, constant: 10)\n\n// Set height to the given value (CGFloat)\na.anchors.height.equal(30)\n```\n\n![03](03.png)\n\n> tip: Align automatically sets `translatesAutoresizingMaskIntoConstraints` to `false` for every view that you manipulate using it, so you no longer have to worry about it. \n \nAlign also allows you to offset, multiply, and divide anchors. This is a lightweight operation with no allocations involved.\n\n```swift\n// Offset one of the anchors, creating a \"virtual\" anchor\nb.anchors.leading.equal(a.anchors.trailing + 20)\n\n// Set aspect ratio for a view\nb.anchors.height.equal(a.anchors.width * 2)\n\n// Divide an anchor — equivalent to multiplying by the reciprocal\nb.anchors.height.equal(a.anchors.height / 2)\n```\n\n![04](04.png)\n\n### Semantic Constraints\n\n```swift\n// Set spacing between two views\na.anchors.bottom.spacing(20, to: b.anchors.top)\n\n// Pin an edge to the superview\na.anchors.trailing.pin(inset: 20)\n```\n\n\n![05](05.png)\n\n```swift\n// Clamps the dimension of a view to the given limiting range.\na.anchors.width.clamp(to: 40...100)\n```\n\n![06](06.png)\n\n### Setting a Priority\n\nEvery constraint-creating method accepts an optional `priority:` parameter. When `nil` (the default), the system's default priority is used.\n\n```swift\n// Set a required width, with a fallback maximum\na.anchors.width.equal(100, priority: .defaultHigh)\na.anchors.width.lessThanOrEqual(200)\n```\n\n## Topics\n\n### Core Constraints for Edges and Center\n\nThese constraints can be added between anchors that represent view edges and center, but only if they operate in the same axis.\n\n- ``equal(_:constant:priority:)-(Anchor<OtherType,Axis>,_,_)``\n- ``greaterThanOrEqual(_:constant:priority:)-(Anchor<OtherType,Axis>,_,_)``\n- ``lessThanOrEqual(_:constant:priority:)-(Anchor<OtherType,Axis>,_,_)``\n\n### Core Constraints for Dimensions\n\n- ``equal(_:priority:)``\n- ``greaterThanOrEqual(_:priority:)``\n- ``lessThanOrEqual(_:priority:)``\n\n- ``equal(_:constant:priority:)-(Anchor<OtherType,OtherAxis>,_,_)``\n- ``greaterThanOrEqual(_:constant:priority:)-(Anchor<OtherType,OtherAxis>,_,_)``\n- ``lessThanOrEqual(_:constant:priority:)-(Anchor<OtherType,OtherAxis>,_,_)``\n\n### Core Constraints\n\n- ``offsetting(by:)``\n- ``multiplied(by:)``\n\n### Semantic Constraints for Edges\n\n- ``pin(to:inset:relation:priority:)``\n- ``spacing(_:to:relation:priority:)``\n\n### Semantic Constraints for Dimensions\n\n- ``clamp(to:priority:)``\n\n### Semantic Constraints for Center\n\n- ``align(offset:priority:)``\n\n### Anchor Parameters\n\n- ``AnchorAxis``\n- ``AnchorType``\n"
  },
  {
    "path": "Sources/Align.docc/AnchorCollectionCenter+Extension.md",
    "content": "# ``Align/AnchorCollectionCenter``\n\n```swift\na.anchors.center.align()\n```\n\n![Center](center-01.png)\n\n## Topics\n\n### Core Constraints\n\n- ``equal(_:offset:priority:)``\n- ``lessThanOrEqual(_:offset:priority:)``\n- ``greaterThanOrEqual(_:offset:priority:)``\n\n### Semantic Constraints\n\n- ``align(offset:priority:)``\n- ``align(with:priority:)``\n"
  },
  {
    "path": "Sources/Align.docc/AnchorCollectionEdges+Extension.md",
    "content": "# ``Align/AnchorCollectionEdges``\n\n### Pin Edges\n\nThe main API available for edges is ``pin(to:insets:axis:alignment:priority:)-(_,EdgeInsets,_,_,_)`` that pins the edges to the container.\n\n```swift\n// A convenience method:\nview.anchors.edges.pin(insets: 20)\n\n// Same output as the following:\nview.anchors.edges.pin(\n    to: view.superview!,\n    insets: EdgeInsets(top: 20, left: 20, bottom: 20, right: 20),\n    alignment: .fill\n)\n```\n\n![Edges](edges-01.png)\n\nBy default, it pins the edges to the superview of the current view. However, you can select any view as a container or even a layout guide.\n\n```swift\n// Pin to superview\nview.anchors.edges.pin()\n\n// Pin to layout margins guide\nview.anchors.edges.pin(to: container.layoutMarginsGuide)\n\n// Pin to safe area\nview.anchors.edges.pin(to: container.safeAreaLayoutGuide)\n```\n\n### Pin with Alignment\n\nBy default, ``pin(to:insets:axis:alignment:priority:)-(_,EdgeInsets,_,_,_)`` uses alignment ``Alignment/fill``, but there are many other alignments available. For example, with ``Alignment/center``, the view is centered in the container and the edges are pinned with \"less than or equal\" constraints making sure it doesn't overflow the container.\n\n```swift\nview.anchors.edges.pin(insets: 20, alignment: .center)\n```\n\n![Edges](edges-02.png)\n\nAnother useful alignment is ``Alignment/topLeading`` that pins the view to the corner.\n\n```swift\nview.anchors.edges.pin(insets: 20, alignment: .topLeading)\n```\n\n![Edges](edges-04.png)\n\nIn addition to the predefined alignments such as ``Alignment/fill`` and ``Alignment/topLeading``, you can also create custom alignments by providing a vertical and horizontal component separately.\n\n```swift\nanchors.edges.pin(\n    insets: 20,\n    alignment: Alignment(vertical: .center, horizontal: .leading)\n)\n```\n\n![Edges](edges-05.png)\n\n### Constraints Along the Axis\n\nSometimes, you just need to create constraints along the given axis and you can do that using the `axis` parameter.\n\n```swift\nview.anchors.edges.pin(insets: 20, axis: .horizontal, alignment: .center)\n```\n\n![Edges](edges-03.png)\n\n\n## Topics\n\n### Semantic Constraints\n\n- ``pin(to:insets:axis:alignment:priority:)-(_,EdgeInsets,_,_,_)``\n- ``pin(to:insets:axis:alignment:priority:)-(_,CGFloat,_,_,_)``\n\n### Instance Properties\n\n- ``absolute``\n\n### Deprecated\n\n- ``equal(_:insets:priority:)-(_,EdgeInsets,_)``\n- ``equal(_:insets:priority:)-(_,CGFloat,_)``\n- ``lessThanOrEqual(_:insets:priority:)-(_,EdgeInsets,_)``\n- ``lessThanOrEqual(_:insets:priority:)-(_,CGFloat,_)``\n\n### Nested Types\n\n- ``Alignment``\n- ``Axis``\n"
  },
  {
    "path": "Sources/Align.docc/AnchorCollectionSize+Extension.md",
    "content": "# ``Align/AnchorCollectionSize``\n\n```swift\na.anchors.size.equal(CGSize(width: 120, height: 40))\n```\n\n![size](size-01.png)\n\n```swift\na.anchors.size.equal(b)\n```\n\n![size](size-02.png)\n\n## Topics\n\n### Core Constraints\n\n- ``equal(_:priority:)``\n- ``equal(_:insets:multiplier:priority:)``\n- ``lessThanOrEqual(_:priority:)``\n- ``lessThanOrEqual(_:insets:multiplier:priority:)``\n- ``greaterThanOrEqual(_:priority:)``\n- ``greaterThanOrEqual(_:insets:multiplier:priority:)``\n"
  },
  {
    "path": "Sources/Align.docc/Constraints+Extension.md",
    "content": "# ``Align/Constraints``\n\nBy default, Align automatically activates created constraints. Using `Constraints` API, constraints are activated all at the same time when you exit from the closure. It gives you a chance to change the `priority` of the constraints.\n\n```swift\nConstraints(for: title, subtitle) { title, subtitle in\n    // Align one anchor with another\n    subtitle.top.spacing(10, to: title.bottom + 10)\n\n    // Manipulate dimensions\n    title.width.equal(100)\n\n    // Change a priority of constraints inside a group:\n    subtitle.bottom.pin().priority = UILayoutPriority(999)\n}\n```\n\n> tip: Every constraint-creating method also accepts an optional `priority:` parameter, so the priority can be set inline without wrapping the call in a `Constraints` group:\n>\n> ```swift\n> subtitle.anchors.bottom.pin(priority: .init(999))\n> ```\n\n`Constraints` also give you easy access to Align anchors (notice, there is no `.anchors` call in the example). And if you want to not activate the constraints, there is an option for that:\n\n```swift\nConstraints(activate: false) {\n    // Create your constraints here\n}\n```\n\n## Topics\n\n### Initializers\n\n- ``init(activate:_:)``\n\n### Variadic Initializers\n\nThe following initializer provides convenient access to the views and their anchors. It uses Swift parameter packs, so it works for any number of items.\n\n- ``init(for:closure:)``\n\n### Accessing Underlying Constraints\n\n- ``constraints``\n- ``activate()``\n- ``deactivate()``\n\n### Collection Conformance\n\n- ``startIndex``\n- ``endIndex``\n- ``index(after:)``\n"
  },
  {
    "path": "Sources/Align.docc/LayoutAnchors+Extension.md",
    "content": "# ``Align/LayoutAnchors``\n\n## Topics\n\n### Edges\n\n- ``top``\n- ``bottom``\n- ``left``\n- ``right``\n- ``leading``\n- ``trailing``\n\n### Center\n\n- ``centerX``\n- ``centerY``\n\n### Baselines\n\n- ``firstBaseline``\n- ``lastBaseline``\n\n### Dimensions\n\n- ``width``\n- ``height``\n\n### Collections\n\n- ``edges``\n- ``center``\n- ``size``\n\n### Accessing Underlying View\n\n- ``item``\n"
  },
  {
    "path": "Sources/Anchor.swift",
    "content": "///// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// A type that represents a layout axis.\npublic enum AnchorAxis {\n    public enum Horizontal {}\n    public enum Vertical {}\n}\n\n/// A marker protocol identifying the kind of attribute an `Anchor` represents.\n@_marker public protocol AnchorKind {}\n\n/// A marker protocol for anchor kinds that can be aligned with one another\n/// (edges, centers, and baselines).\n@_marker public protocol AlignmentAnchorKind: AnchorKind {}\n\n/// Represents an anchor type.\npublic enum AnchorType {\n    public enum Edge: AlignmentAnchorKind {}\n    public enum Center: AlignmentAnchorKind {}\n    public enum Baseline: AlignmentAnchorKind {}\n    public enum Dimension: AnchorKind {}\n}\n\n/// An anchor represents one of the view's layout attributes.\n///\n/// Instead of creating `NSLayoutConstraint` objects directly, start with a `UIView`\n/// or `UILayoutGuide` and select one of its anchors. For example, `view.anchors.top`\n/// is represented by `Anchor<AnchorType.Edge, AnchorAxis.Vertical>`. Then use the\n/// anchor’s methods to construct your constraint.\n///\n/// ```swift\n/// // Align two views along one of the edges\n/// a.anchors.leading.equal(b.anchors.leading)\n/// ```\n///\n/// When you create constraints using `Anchor` APIs, the constraints are activated\n/// automatically and the target view has `translatesAutoresizingMaskIntoConstraints`\n/// set to `false`. If you want to activate all the constraints at the same time,\n/// or create them without activation, use `Constraints` type.\n///\n/// - tip: `UIView` does not provide anchor properties for the layout margin attributes.\n/// Instead, call `view.layoutMarginsGuide.anchors`.\n@MainActor public struct Anchor<Type, Axis> { // type and axis are phantom types\n    @usableFromInline let item: LayoutItem\n    @usableFromInline let attribute: NSLayoutConstraint.Attribute\n    @usableFromInline let offset: CGFloat\n    @usableFromInline let multiplier: CGFloat\n\n    @inlinable init(_ item: LayoutItem, _ attribute: NSLayoutConstraint.Attribute, offset: CGFloat = 0, multiplier: CGFloat = 1) {\n        self.item = item; self.attribute = attribute; self.offset = offset; self.multiplier = multiplier\n    }\n\n    /// Returns a new anchor offset by a given amount.\n    ///\n    /// - tip: Consider using a convenience operator instead: `view.anchors.top + 10`.\n    @inlinable public consuming func offsetting(by offset: CGFloat) -> Anchor {\n        Anchor(item, attribute, offset: self.offset + offset, multiplier: self.multiplier)\n    }\n\n    /// Returns a new anchor with a constant multiplied by the given amount.\n    ///\n    /// - tip: Consider using a convenience operator instead: `view.anchors.height * 2`.\n    @inlinable public consuming func multiplied(by multiplier: CGFloat) -> Anchor {\n        Anchor(item, attribute, offset: self.offset * multiplier, multiplier: self.multiplier * multiplier)\n    }\n}\n\n/// Returns a new anchor offset by a given amount.\n@MainActor @inlinable public func + <Type, Axis>(anchor: consuming Anchor<Type, Axis>, offset: CGFloat) -> Anchor<Type, Axis> {\n    anchor.offsetting(by: offset)\n}\n\n/// Returns a new anchor offset by a given amount.\n@MainActor @inlinable public func - <Type, Axis>(anchor: consuming Anchor<Type, Axis>, offset: CGFloat) -> Anchor<Type, Axis> {\n    anchor.offsetting(by: -offset)\n}\n\n/// Returns a new anchor with a constant multiplied by the given amount.\n@MainActor @inlinable public func * <Type, Axis>(anchor: consuming Anchor<Type, Axis>, multiplier: CGFloat) -> Anchor<Type, Axis> {\n    anchor.multiplied(by: multiplier)\n}\n\n/// Returns a new anchor with a constant divided by the given amount.\n@MainActor @inlinable public func / <Type, Axis>(anchor: consuming Anchor<Type, Axis>, divisor: CGFloat) -> Anchor<Type, Axis> {\n    anchor.multiplied(by: 1 / divisor)\n}\n\n// MARK: - Anchors (AlignmentAnchorKind)\n\n@MainActor public extension Anchor where Type: AlignmentAnchorKind {\n    @inlinable @discardableResult consuming func equal<OtherType: AlignmentAnchorKind>(_ anchor: consuming Anchor<OtherType, Axis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .equal, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func greaterThanOrEqual<OtherType: AlignmentAnchorKind>(_ anchor: consuming Anchor<OtherType, Axis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .greaterThanOrEqual, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func lessThanOrEqual<OtherType: AlignmentAnchorKind>(_ anchor: consuming Anchor<OtherType, Axis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .lessThanOrEqual, priority: priority)\n    }\n}\n\n// MARK: - Anchors (AnchorType.Dimension)\n\n@MainActor public extension Anchor where Type == AnchorType.Dimension {\n    @inlinable @discardableResult consuming func equal<OtherAxis>(_ anchor: consuming Anchor<AnchorType.Dimension, OtherAxis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .equal, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func greaterThanOrEqual<OtherAxis>(_ anchor: consuming Anchor<AnchorType.Dimension, OtherAxis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .greaterThanOrEqual, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func lessThanOrEqual<OtherAxis>(_ anchor: consuming Anchor<AnchorType.Dimension, OtherAxis>, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, anchor, constant: constant, relation: .lessThanOrEqual, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func equal(_ constant: CGFloat, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(item: item, attribute: attribute, relatedBy: .equal, constant: constant, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func greaterThanOrEqual(_ constant: CGFloat, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(item: item, attribute: attribute, relatedBy: .greaterThanOrEqual, constant: constant, priority: priority)\n    }\n\n    @inlinable @discardableResult consuming func lessThanOrEqual(_ constant: CGFloat, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(item: item, attribute: attribute, relatedBy: .lessThanOrEqual, constant: constant, priority: priority)\n    }\n\n    /// Clamps the dimension of a view to the given limiting range.\n    @inlinable @discardableResult consuming func clamp(to limits: ClosedRange<CGFloat>, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [(copy self).greaterThanOrEqual(limits.lowerBound, priority: priority), lessThanOrEqual(limits.upperBound, priority: priority)]\n    }\n}\n\n// MARK: - Anchors (AnchorType.Edge)\n\n// Public surface below is `@inlinable` so anchor expressions can be optimized\n// across module boundaries. SPI access (`superview`, `_disableAutoresizingMask`)\n// is funneled through `@usableFromInline` helpers (`_requireSuperview`,\n// `Constraints.add/install`) whose bodies stay inside the framework.\n\n@MainActor public extension Anchor where Type == AnchorType.Edge {\n    /// Pins the edge to the respected edges of the given container.\n    @inlinable @discardableResult consuming func pin(to container: LayoutItem? = nil, inset: CGFloat = 0, relation: NSLayoutConstraint.Relation = .equal, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        let isInverted: Bool = switch attribute {\n        case .trailing, .right, .bottom: true\n        default: false\n        }\n        let target = container ?? item._requireSuperview()\n        return Constraints.add(self, toItem: target, attribute: attribute, constant: (isInverted ? -inset : inset), relation: isInverted ? relation.inverted : relation, priority: priority)\n    }\n\n    /// Adds spacing between the current anchors.\n    @inlinable @discardableResult consuming func spacing(_ spacing: CGFloat, to anchor: consuming Anchor<AnchorType.Edge, Axis>, relation: NSLayoutConstraint.Relation = .equal, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        let isInverted = (attribute == .bottom && anchor.attribute == .top) ||\n        (attribute == .right && anchor.attribute == .left) ||\n        (attribute == .trailing && anchor.attribute == .leading)\n        return Constraints.add(self, anchor, constant: isInverted ? -spacing : spacing, relation: isInverted ? relation.inverted : relation, priority: priority)\n    }\n}\n\n// MARK: - Anchors (AnchorType.Center)\n\n@MainActor public extension Anchor where Type == AnchorType.Center {\n    /// Aligns the axis with a superview axis.\n    @inlinable @discardableResult consuming func align(offset: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        Constraints.add(self, toItem: item._requireSuperview(), attribute: attribute, constant: offset, priority: priority)\n    }\n}\n"
  },
  {
    "path": "Sources/AnchorCollectionCenter.swift",
    "content": "///// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// Create multiple constraints at once by using both `centerX` and `centerY` anchors.\n@MainActor public struct AnchorCollectionCenter {\n    @usableFromInline let x: Anchor<AnchorType.Center, AnchorAxis.Horizontal>\n    @usableFromInline let y: Anchor<AnchorType.Center, AnchorAxis.Vertical>\n\n    @usableFromInline init(x: Anchor<AnchorType.Center, AnchorAxis.Horizontal>, y: Anchor<AnchorType.Center, AnchorAxis.Vertical>) {\n        self.x = x\n        self.y = y\n    }\n\n    // MARK: Core API\n\n    @inlinable @discardableResult public func equal<Item: LayoutItem>(_ item2: Item, offset: CGPoint = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [x.equal(item2.anchors.centerX, constant: offset.x, priority: priority), y.equal(item2.anchors.centerY, constant: offset.y, priority: priority)]\n    }\n\n    @inlinable @discardableResult public func greaterThanOrEqual<Item: LayoutItem>(_ item2: Item, offset: CGPoint = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [x.greaterThanOrEqual(item2.anchors.centerX, constant: offset.x, priority: priority), y.greaterThanOrEqual(item2.anchors.centerY, constant: offset.y, priority: priority)]\n    }\n\n    @inlinable @discardableResult public func lessThanOrEqual<Item: LayoutItem>(_ item2: Item, offset: CGPoint = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [x.lessThanOrEqual(item2.anchors.centerX, constant: offset.x, priority: priority), y.lessThanOrEqual(item2.anchors.centerY, constant: offset.y, priority: priority)]\n    }\n\n    // MARK: Semantic API\n\n    /// Centers the view in the superview.\n    @inlinable @discardableResult public func align(offset: CGPoint = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [x.align(offset: offset.x, priority: priority), y.align(offset: offset.y, priority: priority)]\n    }\n\n    /// Makes the axes equal to the other collection of axes.\n    @inlinable @discardableResult public func align<Item: LayoutItem>(with item: Item, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [x.equal(item.anchors.centerX, priority: priority), y.equal(item.anchors.centerY, priority: priority)]\n    }\n}\n"
  },
  {
    "path": "Sources/AnchorCollectionEdges.swift",
    "content": "///// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// Create multiple constraints at once by operating more than one edge at once.\n@MainActor public struct AnchorCollectionEdges {\n    @usableFromInline let item: LayoutItem\n    @usableFromInline var isAbsolute = false\n\n    @usableFromInline init(item: LayoutItem, isAbsolute: Bool = false) {\n        self.item = item\n        self.isAbsolute = isAbsolute\n    }\n\n    /// Use `left` and `right` edges instead of `leading` and `trailing`.\n    @inlinable public var absolute: AnchorCollectionEdges {\n        AnchorCollectionEdges(item: item, isAbsolute: true)\n    }\n\n#if os(iOS) || os(tvOS)\n    public typealias Axis = NSLayoutConstraint.Axis\n#else\n    public typealias Axis = NSLayoutConstraint.Orientation\n#endif\n\n    // MARK: Core API (Deprecated)\n\n    @available(*, deprecated, message: \"Use pin(to:insets:priority:) instead\")\n    @inlinable @discardableResult public func equal(_ item2: LayoutItem, insets: EdgeInsets = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        pin(to: item2, insets: insets, priority: priority)\n    }\n\n    @available(*, deprecated, message: \"Use pin(to:insets:alignment:priority:) with alignment .center instead\")\n    @inlinable @discardableResult public func lessThanOrEqual(_ item2: LayoutItem, insets: EdgeInsets = .zero, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        _pin(to: item2, insets: insets, axis: nil, alignment: .center, isCenteringEnabled: false, priority: priority)\n    }\n\n    @available(*, deprecated, message: \"Use pin(to:insets:priority:) instead\")\n    @inlinable @discardableResult public func equal(_ item2: LayoutItem, insets: CGFloat, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        pin(to: item2, insets: EdgeInsets(top: insets, left: insets, bottom: insets, right: insets), priority: priority)\n    }\n\n    @available(*, deprecated, message: \"Use pin(to:insets:alignment:priority:) with alignment .center instead\")\n    @inlinable @discardableResult public func lessThanOrEqual(_ item2: LayoutItem, insets: CGFloat, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        _pin(to: item2, insets: EdgeInsets(top: insets, left: insets, bottom: insets, right: insets), axis: nil, alignment: .center, isCenteringEnabled: false, priority: priority)\n    }\n\n    // MARK: Semantic API\n\n    /// Pins the edges to the edges of the given item. By default, pins the edges\n    /// to the superview.\n    ///\n    /// - parameter item2: The target view, by default, uses the superview.\n    /// - parameter insets: Insets the receiver's edges by the given insets.\n    /// - parameter axis: If provided, creates constraints only along the given\n    /// axis. For example, if you pass axis `.horizontal`, only the `.leading`,\n    /// `.trailing` (and `.centerX` if needed) attributes are used. `nil` by default\n    /// - parameter alignment: `.fill` by default, see `Alignment` for a list of\n    /// the available options.\n    /// - parameter priority: The priority of the created constraints. Uses the\n    /// system's default priority when `nil`.\n    @inlinable @discardableResult public func pin(to item2: LayoutItem? = nil, insets: CGFloat, axis: Axis? = nil, alignment: Alignment = .fill, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        pin(to: item2, insets: EdgeInsets(top: insets, left: insets, bottom: insets, right: insets), axis: axis, alignment: alignment, priority: priority)\n    }\n\n    /// Pins the edges to the edges of the given item. By default, pins the edges\n    /// to the superview.\n    ///\n    /// - parameter item2: The target view, by default, uses the superview.\n    /// - parameter insets: Insets the receiver's edges by the given insets.\n    /// - parameter axis: If provided, creates constraints only along the given\n    /// axis. For example, if you pass axis `.horizontal`, only the `.leading`,\n    /// `.trailing` (and `.centerX` if needed) attributes are used. `nil` by default\n    /// - parameter alignment: `.fill` by default, see `Alignment` for a list of\n    /// the available options.\n    /// - parameter priority: The priority of the created constraints. Uses the\n    /// system's default priority when `nil`.\n    @inlinable @discardableResult public func pin(to item2: LayoutItem? = nil, insets: EdgeInsets = .zero, axis: Axis? = nil, alignment: Alignment = .fill, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        _pin(to: item2, insets: insets, axis: axis, alignment: alignment, isCenteringEnabled: true, priority: priority)\n    }\n\n    @usableFromInline func _pin(to item2: LayoutItem?, insets: EdgeInsets, axis: Axis?, alignment: Alignment, isCenteringEnabled: Bool, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        let item2 = item2 ?? item._requireSuperview()\n        item._disableAutoresizingMask()\n        let left: NSLayoutConstraint.Attribute = isAbsolute ? .left : .leading\n        let right: NSLayoutConstraint.Attribute = isAbsolute ? .right : .trailing\n        var constraints = [NSLayoutConstraint]()\n\n        func constrain(attribute: NSLayoutConstraint.Attribute, relation: NSLayoutConstraint.Relation, constant: CGFloat) {\n            let constraint = NSLayoutConstraint(item: item, attribute: attribute, relatedBy: relation, toItem: item2, attribute: attribute, multiplier: 1, constant: constant)\n            Constraints.install(constraint, priority: priority)\n            constraints.append(constraint)\n        }\n\n        if axis == nil || axis == .horizontal {\n            constrain(attribute: left, relation: alignment.horizontal == .fill || alignment.horizontal == .leading ? .equal : .greaterThanOrEqual, constant: insets.left)\n            constrain(attribute: right, relation: alignment.horizontal == .fill || alignment.horizontal == .trailing ? .equal : .lessThanOrEqual, constant: -insets.right)\n            if alignment.horizontal == .center && isCenteringEnabled {\n                constrain(attribute: .centerX, relation: .equal, constant: 0)\n            }\n        }\n        if axis == nil || axis == .vertical {\n            constrain(attribute: .top, relation: alignment.vertical == .fill || alignment.vertical == .top ? .equal : .greaterThanOrEqual, constant: insets.top)\n            constrain(attribute: .bottom, relation: alignment.vertical == .fill || alignment.vertical == .bottom ? .equal : .lessThanOrEqual, constant: -insets.bottom)\n            if alignment.vertical == .center && isCenteringEnabled {\n                constrain(attribute: .centerY, relation: .equal, constant: 0)\n            }\n        }\n        return constraints\n    }\n\n    public struct Alignment: Sendable {\n\n        /// The alignment along the horizontal axis.\n        public enum Horizontal: Sendable {\n            /// Pin both leading and trailing edges to the superview.\n            case fill\n            /// Center the view in the container along the horizontal axis.\n            case center\n            /// Pin the leading edge to the superview and prevent the view from\n            /// overflowing the container by pinning the trailing edge using\n            /// \"less than or equal\" constraint.\n            case leading\n            /// Pin the trailing edge to the superview and prevent the view from\n            /// overflowing the container by pinning the leading edge using\n            /// \"less than or equal\" constraint.\n            case trailing\n        }\n\n        /// The alignment along the vertical axis.\n        public enum Vertical: Sendable {\n            /// Pin both top and bottom edges to the superview.\n            case fill\n            /// Center the view in the container along the vertical axis.\n            case center\n            /// Pin the top edge to the superview and prevent the view from\n            /// overflowing the container by pinning the bottom edge using\n            /// \"less than or equal\" constraint.\n            case top\n            /// Pin the bottom edge to the superview and prevent the view from\n            /// overflowing the container by pinning the top edge using\n            /// \"less than or equal\" constraint.\n            case bottom\n        }\n        /// The alignment along the horizontal axis.\n        public let horizontal: Horizontal\n        /// The alignment along the vertical axis.\n        public let vertical: Vertical\n\n        /// Initializes the alignment.\n        public init(horizontal: Horizontal, vertical: Vertical) {\n            (self.horizontal, self.vertical) = (horizontal, vertical)\n        }\n\n        /// The edges are pinned to the matching edges of the container with the\n        /// given edge insets.\n        public static let fill = Alignment(horizontal: .fill, vertical: .fill)\n        /// The view is centered in the container and the edges are pinned using\n        /// \"less than or equal\" constraints making sure it doesn't overflow the container.\n        public static let center = Alignment(horizontal: .center, vertical: .center)\n        /// The view is pinned to the top-leading corner of the container with the\n        /// given edge insets and the remaining edges are pinned using \"less than or\n        /// equal\" constraints making sure the view doesn't overflow the container.\n        public static let topLeading = Alignment(horizontal: .leading, vertical: .top)\n        /// The view is pinned to the top edge with the inset while the bottom\n        /// edge is pinned using \"less than or equal\" constraint making sure the view\n        /// doesn't overflow the container. The view is also centered horizontally.\n        public static let top = Alignment(horizontal: .center, vertical: .top)\n        /// The view is pinned to the top-trailing corner of the container with the\n        /// given edge insets and the remaining edges are pinned using \"less than or\n        /// equal\" constraints making sure the view doesn't overflow the container.\n        public static let topTrailing = Alignment(horizontal: .trailing, vertical: .top)\n        /// The view is pinned to the trailing edge with the inset while the leading\n        /// edge is pinned using \"less than or equal\" constraint making sure the view\n        /// doesn't overflow the container. The view is also centered vertically.\n        public static let trailing = Alignment(horizontal: .trailing, vertical: .center)\n        /// The view is pinned to the bottom-trailing corner of the container with the\n        /// given edge insets and the remaining edges are pinned using \"less than or\n        /// equal\" constraints making sure the view doesn't overflow the container.\n        public static let bottomTrailing = Alignment(horizontal: .trailing, vertical: .bottom)\n        /// The view is pinned to the bottom edge with the inset while the top\n        /// edge is pinned using \"less than or equal\" constraint making sure the view\n        /// doesn't overflow the container. The view is also centered horizontally.\n        public static let bottom = Alignment(horizontal: .center, vertical: .bottom)\n        /// The view is pinned to the bottom-leading corner of the container with the\n        /// given edge insets and the remaining edges are pinned using \"less than or\n        /// equal\" constraints making sure the view doesn't overflow the container.\n        public static let bottomLeading = Alignment(horizontal: .leading, vertical: .bottom)\n        /// The view is pinned to the leading edge with the inset while the trailing\n        /// edge is pinned using \"less than or equal\" constraint making sure the view\n        /// doesn't overflow the container. The view is also centered vertically.\n        public static let leading = Alignment(horizontal: .leading, vertical: .center)\n    }\n}\n"
  },
  {
    "path": "Sources/AnchorCollectionSize.swift",
    "content": "///// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// Create multiple constraints at once by using both `width` and `height` anchors.\n@MainActor public struct AnchorCollectionSize {\n    @usableFromInline let width: Anchor<AnchorType.Dimension, AnchorAxis.Horizontal>\n    @usableFromInline let height: Anchor<AnchorType.Dimension, AnchorAxis.Vertical>\n\n    @usableFromInline init(width: Anchor<AnchorType.Dimension, AnchorAxis.Horizontal>, height: Anchor<AnchorType.Dimension, AnchorAxis.Vertical>) {\n        self.width = width\n        self.height = height\n    }\n\n    // MARK: Core API\n\n    /// Set the size of item.\n    @inlinable @discardableResult public func equal(_ size: CGSize, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.equal(size.width, priority: priority), height.equal(size.height, priority: priority)]\n    }\n\n    /// Set the size of item.\n    @inlinable @discardableResult public func greaterThanOrEqual(_ size: CGSize, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.greaterThanOrEqual(size.width, priority: priority), height.greaterThanOrEqual(size.height, priority: priority)]\n    }\n\n    /// Set the size of item.\n    @inlinable @discardableResult public func lessThanOrEqual(_ size: CGSize, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.lessThanOrEqual(size.width, priority: priority), height.lessThanOrEqual(size.height, priority: priority)]\n    }\n\n    /// Makes the size of the item equal to the size of the other item.\n    @inlinable @discardableResult public func equal<Item: LayoutItem>(_ item: Item, insets: CGSize = .zero, multiplier: CGFloat = 1, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.equal(item.anchors.width * multiplier - insets.width, priority: priority), height.equal(item.anchors.height * multiplier - insets.height, priority: priority)]\n    }\n\n    @inlinable @discardableResult public func greaterThanOrEqual<Item: LayoutItem>(_ item: Item, insets: CGSize = .zero, multiplier: CGFloat = 1, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.greaterThanOrEqual(item.anchors.width * multiplier - insets.width, priority: priority), height.greaterThanOrEqual(item.anchors.height * multiplier - insets.height, priority: priority)]\n    }\n\n    @inlinable @discardableResult public func lessThanOrEqual<Item: LayoutItem>(_ item: Item, insets: CGSize = .zero, multiplier: CGFloat = 1, priority: LayoutPriority? = nil) -> [NSLayoutConstraint] {\n        [width.lessThanOrEqual(item.anchors.width * multiplier - insets.width, priority: priority), height.lessThanOrEqual(item.anchors.height * multiplier - insets.height, priority: priority)]\n    }\n}\n"
  },
  {
    "path": "Sources/Constraints.swift",
    "content": "/////// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// Allows you to access the underlying constraints.\n///\n/// By default, Align automatically activates created constraints. Using\n/// ``Constraints`` API, constraints are activated all of the same time when you\n/// exit from the closure. It gives you a chance to change the `priority` of\n/// the created constraints.\n///\n/// ```swift\n/// Constraints(for: title, subtitle) { title, subtitle in\n///     // Align one anchor with another\n///     subtitle.top.spacing(10, to: title.bottom + 10)\n///\n///     // Manipulate dimensions\n///     title.width.equal(100)\n///\n///     // Change a priority of constraints inside a group:\n///     subtitle.bottom.pin().priority = UILayoutPriority(999)\n/// }\n/// ```\n///\n/// ``Constraints`` also give you easy access to Align anchors (notice, there\n/// is no `.anchors` call in the example). And if you want to not activate the\n/// constraints, there is an option for that:\n///\n/// ```swift\n/// Constraints(activate: false) {\n///     // Create your constraints here\n/// }\n/// ```\n///\n/// Nesting is supported: each constraint is collected by the innermost group,\n/// and each group honors its own `activate:` flag independently.\npublic struct Constraints: RandomAccessCollection {\n    public typealias Element = NSLayoutConstraint\n    public typealias Index = Int\n\n    public subscript(position: Int) -> NSLayoutConstraint { constraints[position] }\n    public var startIndex: Int { constraints.startIndex }\n    public var endIndex: Int { constraints.endIndex }\n    public func index(after i: Int) -> Int { i + 1 }\n\n    /// Returns all of the created constraints.\n    public private(set) var constraints: [NSLayoutConstraint]\n\n    /// All of the constraints created in the given closure are automatically\n    /// activated at the same time. This is more efficient than installing them\n    /// one-by-one. More importantly, it allows to make changes to the constraints\n    /// before they are installed (e.g. change `priority`).\n    ///\n    /// - parameter activate: Set to `false` to disable automatic activation of\n    /// constraints.\n    /// - parameter closure: A closure in which constraints are created. The\n    /// constraints are collected and activated together when the closure returns.\n    @MainActor @discardableResult public init(activate: Bool = true, _ closure: () -> Void) {\n        Constraints.stack.append([])\n        closure() // create constraints\n        self.constraints = Constraints.stack.removeLast()\n        if activate { NSLayoutConstraint.activate(constraints) }\n    }\n\n    // MARK: Activate\n\n    /// Activates each constraint in the receiver.\n    @MainActor public func activate() {\n        NSLayoutConstraint.activate(constraints)\n    }\n\n    /// Deactivates each constraint in the receiver.\n    @MainActor public func deactivate() {\n        NSLayoutConstraint.deactivate(constraints)\n    }\n\n    // MARK: Adding Constraints\n\n    /// Creates and automatically installs a constraint.\n    @MainActor @usableFromInline static func add(item item1: LayoutItem, attribute attr1: NSLayoutConstraint.Attribute, relatedBy relation: NSLayoutConstraint.Relation = .equal, toItem item2: LayoutItem? = nil, attribute attr2: NSLayoutConstraint.Attribute? = nil, multiplier: CGFloat = 1, constant: CGFloat = 0, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        item1._disableAutoresizingMask()\n        let constraint = NSLayoutConstraint(item: item1, attribute: attr1, relatedBy: relation, toItem: item2, attribute: attr2 ?? .notAnAttribute, multiplier: multiplier, constant: constant)\n        install(constraint, priority: priority)\n        return constraint\n    }\n\n    /// Creates and automatically installs a constraint between two anchors.\n    @MainActor @usableFromInline static func add<T1, A1, T2, A2>(_ lhs: consuming Anchor<T1, A1>, _ rhs: consuming Anchor<T2, A2>, constant: CGFloat = 0, multiplier: CGFloat = 1, relation: NSLayoutConstraint.Relation = .equal, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        add(item: lhs.item, attribute: lhs.attribute, relatedBy: relation, toItem: rhs.item, attribute: rhs.attribute, multiplier: (multiplier / lhs.multiplier) * rhs.multiplier, constant: constant - lhs.offset + rhs.offset, priority: priority)\n    }\n\n    /// Creates and automatically installs a constraint between an anchor and\n    /// a given item.\n    @MainActor @usableFromInline static func add<T1, A1>(_ lhs: consuming Anchor<T1, A1>, toItem item2: LayoutItem?, attribute attr2: NSLayoutConstraint.Attribute?, constant: CGFloat = 0, multiplier: CGFloat = 1, relation: NSLayoutConstraint.Relation = .equal, priority: LayoutPriority? = nil) -> NSLayoutConstraint {\n        add(item: lhs.item, attribute: lhs.attribute, relatedBy: relation, toItem: item2, attribute: attr2, multiplier: multiplier / lhs.multiplier, constant: constant - lhs.offset, priority: priority)\n    }\n\n    @MainActor static var stack: [[NSLayoutConstraint]] = [] // this is what enables constraint auto-installing\n\n    @MainActor @usableFromInline static func install(_ constraint: NSLayoutConstraint, priority: LayoutPriority? = nil) {\n        if let priority { constraint.priority = priority }\n        if !stack.isEmpty {\n            stack[stack.count - 1].append(constraint)\n        } else {\n            constraint.isActive = true\n        }\n    }\n}\n\nextension Constraints {\n    @MainActor @discardableResult\n    public init<each Item: LayoutItem>(for item: repeat each Item, closure: (repeat LayoutAnchors<each Item>) -> Void) {\n        self.init { closure(repeat (each item).anchors) }\n    }\n}\n"
  },
  {
    "path": "Sources/LayoutAnchors.swift",
    "content": "/// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// Provides access to the layout anchors and anchor collections.\n@MainActor public struct LayoutAnchors<T: LayoutItem> {\n    /// The underlying item.\n    public let item: T\n\n    @inlinable public init(_ item: T) { self.item = item }\n\n    // MARK: Anchors\n\n    @inlinable public var top: Anchor<AnchorType.Edge, AnchorAxis.Vertical> { Anchor(item, .top) }\n    @inlinable public var bottom: Anchor<AnchorType.Edge, AnchorAxis.Vertical> { Anchor(item, .bottom) }\n    @inlinable public var left: Anchor<AnchorType.Edge, AnchorAxis.Horizontal> { Anchor(item, .left) }\n    @inlinable public var right: Anchor<AnchorType.Edge, AnchorAxis.Horizontal> { Anchor(item, .right) }\n    @inlinable public var leading: Anchor<AnchorType.Edge, AnchorAxis.Horizontal> { Anchor(item, .leading) }\n    @inlinable public var trailing: Anchor<AnchorType.Edge, AnchorAxis.Horizontal> { Anchor(item, .trailing) }\n\n    @inlinable public var centerX: Anchor<AnchorType.Center, AnchorAxis.Horizontal> { Anchor(item, .centerX) }\n    @inlinable public var centerY: Anchor<AnchorType.Center, AnchorAxis.Vertical> { Anchor(item, .centerY) }\n\n    @inlinable public var firstBaseline: Anchor<AnchorType.Baseline, AnchorAxis.Vertical> { Anchor(item, .firstBaseline) }\n    @inlinable public var lastBaseline: Anchor<AnchorType.Baseline, AnchorAxis.Vertical> { Anchor(item, .lastBaseline) }\n\n    @inlinable public var width: Anchor<AnchorType.Dimension, AnchorAxis.Horizontal> { Anchor(item, .width) }\n    @inlinable public var height: Anchor<AnchorType.Dimension, AnchorAxis.Vertical> { Anchor(item, .height) }\n\n    // MARK: Anchor Collections\n\n    @inlinable public var edges: AnchorCollectionEdges { AnchorCollectionEdges(item: item) }\n    @inlinable public var center: AnchorCollectionCenter { AnchorCollectionCenter(x: centerX, y: centerY) }\n    @inlinable public var size: AnchorCollectionSize { AnchorCollectionSize(width: width, height: height) }\n}\n"
  },
  {
    "path": "Sources/LayoutItem.swift",
    "content": "/// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\n/// A type that has layout anchors: either a view or a layout guide.\n@MainActor public protocol LayoutItem {\n#if os(iOS) || os(tvOS)\n    @_spi(Align) var superview: UIView? { get }\n#else\n    @_spi(Align) var superview: NSView? { get }\n#endif\n\n    @_spi(Align) func _disableAutoresizingMask()\n}\n\nextension LayoutItem {\n    @_spi(Align) public func _disableAutoresizingMask() {}\n\n    /// Wraps the SPI `superview` lookup so callers in `@inlinable` bodies don't\n    /// have to reach for SPI directly. The body stays in the framework (this is\n    /// `@usableFromInline`, not `@inlinable`), so the SPI access stays private.\n    @usableFromInline func _requireSuperview() -> LayoutItem {\n        guard let superview = superview else {\n            preconditionFailure(\"Align: \\(self) has no superview; pass an explicit container\")\n        }\n        return superview\n    }\n}\n\n#if os(iOS) || os(tvOS)\nextension UIView: LayoutItem {\n    @_spi(Align) public func _disableAutoresizingMask() {\n        guard translatesAutoresizingMaskIntoConstraints else { return }\n        translatesAutoresizingMaskIntoConstraints = false\n    }\n}\nextension UILayoutGuide: LayoutItem {\n    @_spi(Align) public var superview: UIView? { owningView }\n}\n#elseif os(macOS)\nextension NSView: LayoutItem {\n    @_spi(Align) public func _disableAutoresizingMask() {\n        guard translatesAutoresizingMaskIntoConstraints else { return }\n        translatesAutoresizingMaskIntoConstraints = false\n    }\n}\nextension NSLayoutGuide: LayoutItem {\n    @_spi(Align) public var superview: NSView? { owningView }\n}\n#endif\n\nextension LayoutItem { // Align methods are available via `LayoutAnchors`\n    /// Provides access to the layout anchors and anchor collections.\n    @nonobjc @inlinable public var anchors: LayoutAnchors<Self> { LayoutAnchors(self) }\n}\n\n#if os(iOS) || os(tvOS)\npublic typealias EdgeInsets = UIEdgeInsets\npublic typealias LayoutPriority = UILayoutPriority\n#elseif os(macOS)\npublic typealias EdgeInsets = NSEdgeInsets\npublic typealias LayoutPriority = NSLayoutConstraint.Priority\n\npublic extension NSEdgeInsets {\n    static let zero = NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)\n}\n#endif\n\nextension NSLayoutConstraint.Relation {\n    @usableFromInline var inverted: NSLayoutConstraint.Relation {\n        switch self {\n        case .greaterThanOrEqual: return .lessThanOrEqual\n        case .lessThanOrEqual: return .greaterThanOrEqual\n        case .equal: return self\n        @unknown default: return self\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorAPIsTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Foundation\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorAPITests {\n    let view = View()\n    let container = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func aPIs() {\n        // Alignment\n        view.anchors.left.equal(container.anchors.left)\n        view.anchors.left.equal(container.anchors.left + 10)\n        view.anchors.left.lessThanOrEqual(container.anchors.left)\n\n        // Edge\n        view.anchors.left.pin()\n        view.anchors.left.pin(inset: 10)\n        view.anchors.left.pin(to: container)\n\n        // Center\n        view.anchors.centerX.align()\n\n        // Dimension\n        view.anchors.width.equal(10)\n        view.anchors.width.greaterThanOrEqual(10)\n        view.anchors.width.equal(container.anchors.width)\n\n        // AnchorCollectionEdges (Core API)\n        view.anchors.edges.equal(container)\n        view.anchors.edges.equal(container, insets: 20)\n        view.anchors.edges.equal(container, insets: EdgeInsets(top: 10, left: 20, bottom: 10, right: 20))\n        view.anchors.edges.lessThanOrEqual(container, insets: EdgeInsets(top: 10, left: 20, bottom: 10, right: 20))\n\n        // AnchorCollectionEdges (Semantic API)\n        view.anchors.edges.pin()\n        view.anchors.edges.pin(insets: 20)\n        view.anchors.edges.pin(insets: EdgeInsets(top: 10, left: 20, bottom: 10, right: 20))\n        view.anchors.edges.pin(to: container)\n        view.anchors.edges.pin(axis: .horizontal)\n        view.anchors.edges.pin(to: container, insets: 20, axis: .horizontal, alignment: .center)\n\n        // AnchorCollectionCenter (Core API)\n        view.anchors.center.equal(container)\n\n        // AnchorCollectionCenter (Semantic API)\n        view.anchors.center.align()\n        view.anchors.center.align(with: container)\n\n        // AnchorCollectionSize\n        view.anchors.size.equal(container)\n        view.anchors.size.greaterThanOrEqual(container)\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorAlignmentTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n/// Everything that applies for both edges and center\n@MainActor\n@Suite struct AnchorAlignmentTests {\n    let container = View()\n    let view = View()\n    let a = View()\n    let b = View()\n\n    init() {\n        container.addSubview(view)\n        container.addSubview(a)\n        container.addSubview(b)\n    }\n\n    // MARK: Alignments\n\n    @Test func topAlignWith() {\n        test(\"align top with the same edge\") {\n            let c = view.anchors.top.equal(container.anchors.top)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top))\n        }\n\n        test(\"align top with the other edge\") {\n            let c = view.anchors.top.equal(container.anchors.bottom)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .bottom))\n        }\n\n        test(\"align top with the center\") {\n            let c = view.anchors.top.equal(container.anchors.centerY)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .centerY))\n        }\n\n        test(\"align top with offset, relation, multiplier\") {\n            let c = view.anchors.top.greaterThanOrEqual(container.anchors.top * 2 + 10)\n            expectEqualConstraints(c, NSLayoutConstraint(\n                item: view,\n                attribute: .top,\n                relatedBy: .greaterThanOrEqual,\n                toItem: container,\n                attribute: .top,\n                multiplier: 2,\n                constant: 10\n            ))\n        }\n    }\n\n    @Test func alignDifferentAnchors() {\n        test(\"align bottom\") {\n            let c = view.anchors.bottom.equal(container.anchors.bottom)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom))\n        }\n\n        test(\"align leading\") {\n            let c = view.anchors.leading.equal(container.anchors.leading)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .leading, toItem: container, attribute: .leading))\n        }\n\n        test(\"align trailing\") {\n            let c = view.anchors.trailing.equal(container.anchors.trailing)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .trailing, toItem: container, attribute: .trailing))\n        }\n\n        test(\"align left with left\") {\n            let c = view.anchors.left.equal(container.anchors.left)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .left, toItem: container, attribute: .left))\n        }\n\n        test(\"align right with left\") {\n            let c = view.anchors.right.equal(container.anchors.left)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .right, toItem: container, attribute: .left))\n        }\n\n        test(\"align firstBaseline with firstBaseline\") {\n            expectEqualConstraints(\n                view.anchors.firstBaseline.equal(container.anchors.firstBaseline),\n                NSLayoutConstraint(item: view, attribute: .firstBaseline, toItem: container, attribute: .firstBaseline)\n            )\n        }\n\n        test(\"align lastBaseline with top\") {\n            expectEqualConstraints(\n                view.anchors.lastBaseline.equal(container.anchors.top),\n                NSLayoutConstraint(item: view, attribute: .lastBaseline, toItem: container, attribute: .top)\n            )\n        }\n    }\n\n    @Test func spacing() {\n        test(\"bottom to top\") {\n            expectEqualConstraints(\n                a.anchors.bottom.spacing(10, to: b.anchors.top),\n                NSLayoutConstraint(item: a, attribute: .bottom, toItem: b, attribute: .top, constant: -10)\n            )\n            expectEqualConstraints(\n                a.anchors.bottom.spacing(10, to: b.anchors.top, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: a, attribute: .bottom, relation: .lessThanOrEqual, toItem: b, attribute: .top, constant: -10)\n            )\n            expectEqualConstraints(\n                b.anchors.top.spacing(10, to: a.anchors.bottom),\n                NSLayoutConstraint(item: b, attribute: .top, toItem: a, attribute: .bottom, constant: 10)\n            )\n            expectEqualConstraints(\n                b.anchors.top.spacing(10, to: a.anchors.bottom, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: b, attribute: .top, relation: .greaterThanOrEqual, toItem: a, attribute: .bottom, constant: 10)\n            )\n        }\n\n        test(\"top to top\") {\n            expectEqualConstraints(\n                a.anchors.top.spacing(10, to: b.anchors.top),\n                NSLayoutConstraint(item: a, attribute: .top, toItem: b, attribute: .top, constant: 10)\n            )\n            expectEqualConstraints(\n                a.anchors.top.spacing(10, to: b.anchors.top, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: a, attribute: .top, relation: .greaterThanOrEqual, toItem: b, attribute: .top, constant: 10)\n            )\n            expectEqualConstraints(\n                b.anchors.top.spacing(10, to: a.anchors.top),\n                NSLayoutConstraint(item: b, attribute: .top, toItem: a, attribute: .top, constant: 10)\n            )\n            expectEqualConstraints(\n                b.anchors.top.spacing(10, to: a.anchors.top, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: b, attribute: .top, relation: .greaterThanOrEqual, toItem: a, attribute: .top, constant: 10)\n            )\n        }\n\n        // [a] [b]\n        test(\"right to left\") {\n            expectEqualConstraints(\n                a.anchors.right.spacing(10, to: b.anchors.left),\n                NSLayoutConstraint(item: a, attribute: .right, toItem: b, attribute: .left, constant: -10)\n            )\n            expectEqualConstraints(\n                a.anchors.right.spacing(10, to: b.anchors.left, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: a, attribute: .right, relation: .lessThanOrEqual, toItem: b, attribute: .left, constant: -10)\n            )\n            expectEqualConstraints(\n                a.anchors.right.spacing(10, to: b.anchors.left, relation: .lessThanOrEqual),\n                NSLayoutConstraint(item: a, attribute: .right, relation: .greaterThanOrEqual, toItem: b, attribute: .left, constant: -10)\n            )\n            expectEqualConstraints(\n                b.anchors.left.spacing(10, to: a.anchors.right),\n                NSLayoutConstraint(item: b, attribute: .left, toItem: a, attribute: .right, constant: 10)\n            )\n            expectEqualConstraints(\n                b.anchors.left.spacing(10, to: a.anchors.right, relation: .greaterThanOrEqual),\n                NSLayoutConstraint(item: b, attribute: .left, relation: .greaterThanOrEqual, toItem: a, attribute: .right, constant: 10)\n            )\n            expectEqualConstraints(\n                b.anchors.left.spacing(10, to: a.anchors.right, relation: .lessThanOrEqual),\n                NSLayoutConstraint(item: b, attribute: .left, relation: .lessThanOrEqual, toItem: a, attribute: .right, constant: 10)\n            )\n        }\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorCenterTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorCenterTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    // MARK: Align With Superview\n\n    @Test func alignWithSuperview() {\n        expectEqualConstraints(\n            view.anchors.centerX.align(),\n            NSLayoutConstraint(item: view, attribute: .centerX, toItem: container, attribute: .centerX)\n        )\n        expectEqualConstraints(\n            view.anchors.centerY.align(),\n            NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY)\n        )\n        expectEqualConstraints(\n            view.anchors.centerY.align(offset: -10),\n            NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY, constant: -10)\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorCollectionCenterTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorCollectionCenterTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func core() {\n        expectEqualConstraints(\n            view.anchors.center.equal(container),\n            [NSLayoutConstraint(item: view, attribute: .centerX, toItem: container, attribute: .centerX),\n            NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY)]\n        )\n\n        expectEqualConstraints(\n            view.anchors.center.equal(container, offset: CGPoint(x: 10, y: 20)),\n            [NSLayoutConstraint(item: view, attribute: .centerX, toItem: container, attribute: .centerX, constant: 10),\n            NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY, constant: 20)]\n        )\n\n        expectEqualConstraints(\n            view.anchors.center.greaterThanOrEqual(container),\n            [NSLayoutConstraint(item: view, attribute: .centerX, relation: .greaterThanOrEqual, toItem: container, attribute: .centerX),\n            NSLayoutConstraint(item: view, attribute: .centerY, relation: .greaterThanOrEqual, toItem: container, attribute: .centerY)]\n        )\n\n        expectEqualConstraints(\n            view.anchors.center.lessThanOrEqual(container),\n            [NSLayoutConstraint(item: view, attribute: .centerX, relation: .lessThanOrEqual, toItem: container, attribute: .centerX),\n            NSLayoutConstraint(item: view, attribute: .centerY, relation: .lessThanOrEqual, toItem: container, attribute: .centerY)]\n        )\n    }\n\n    @Test func align() {\n        expectEqualConstraints(\n            view.anchors.center.align(with: container),\n            [NSLayoutConstraint(item: view, attribute: .centerX, toItem: container, attribute: .centerX),\n             NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY)]\n        )\n    }\n\n    @Test func alignWithSuperview() {\n        expectEqualConstraints(\n            view.anchors.center.align(),\n            [NSLayoutConstraint(item: view, attribute: .centerX, toItem: container, attribute: .centerX),\n             NSLayoutConstraint(item: view, attribute: .centerY, toItem: container, attribute: .centerY)]\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorCollectionEdgesTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorCollectionEdgesTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    // MARK: - Core API\n\n    @Test func equal() {\n        expectEqualConstraints(\n            view.anchors.edges.equal(container),\n            [NSLayoutConstraint(item: view, attribute: .top, relation: .equal, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .leading, relation: .equal,toItem: container, attribute: .leading),\n             NSLayoutConstraint(item: view, attribute: .bottom, relation: .equal, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .trailing, relation: .equal, toItem: container, attribute: .trailing)]\n        )\n    }\n\n    @Test func equalAbsolute() {\n        expectEqualConstraints(\n            view.anchors.edges.absolute.equal(container),\n            [NSLayoutConstraint(item: view, attribute: .top, relation: .equal, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .left, relation: .equal,toItem: container, attribute: .left),\n             NSLayoutConstraint(item: view, attribute: .bottom, relation: .equal, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .right, relation: .equal, toItem: container, attribute: .right)]\n        )\n    }\n\n    @Test func equalWithInsets() {\n        expectEqualConstraints(\n            view.anchors.edges.equal(container, insets: 20),\n            [NSLayoutConstraint(item: view, attribute: .top, relation: .equal, toItem: container, attribute: .top, constant: 20),\n             NSLayoutConstraint(item: view, attribute: .leading, relation: .equal,toItem: container, attribute: .leading, constant: 20),\n             NSLayoutConstraint(item: view, attribute: .bottom, relation: .equal, toItem: container, attribute: .bottom, constant: -20),\n             NSLayoutConstraint(item: view, attribute: .trailing, relation: .equal, toItem: container, attribute: .trailing, constant: -20)]\n        )\n    }\n\n    @Test func pinToSuperviewLessThanOrEqual() {\n        expectEqualConstraints(\n            view.anchors.edges.lessThanOrEqual(container),\n            [NSLayoutConstraint(item: view, attribute: .top, relation: .greaterThanOrEqual, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .leading, relation: .greaterThanOrEqual,toItem: container, attribute: .leading),\n             NSLayoutConstraint(item: view, attribute: .bottom, relation: .lessThanOrEqual, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .trailing, relation: .lessThanOrEqual, toItem: container, attribute: .trailing)]\n        )\n    }\n\n    // MARK: - Semantic API\n\n    @Test func pinToSuperview() {\n        expectEqualConstraints(\n            view.anchors.edges.pin(),\n            [NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .leading, toItem: container, attribute: .leading),\n             NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .trailing, toItem: container, attribute: .trailing)]\n        )\n    }\n\n    @Test func pinToSuperviewAbsolute() {\n        expectEqualConstraints(\n            view.anchors.edges.absolute.pin(),\n            [NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .left, toItem: container, attribute: .left),\n             NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .right, toItem: container, attribute: .right)]\n        )\n    }\n\n    @Test func pinToSuperviewWithInsets() {\n        let insets = EdgeInsets(top: 1, left: 2, bottom: 3, right: 4)\n        expectEqualConstraints(\n            view.anchors.edges.pin(insets: insets),\n            [NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 1),\n             NSLayoutConstraint(item: view, attribute: .leading, toItem: container, attribute: .leading, constant: 2),\n             NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom, constant: -3),\n             NSLayoutConstraint(item: view, attribute: .trailing, toItem: container, attribute: .trailing, constant: -4)]\n        )\n    }\n\n    @Test func pinToSuperviewLessThanOrEqualAlignmentCenter() {\n        expectEqualConstraints(\n            view.anchors.edges.pin(alignment: .center),\n            [NSLayoutConstraint(item: view, attribute: .top, relation: .greaterThanOrEqual, toItem: container, attribute: .top),\n             NSLayoutConstraint(item: view, attribute: .leading, relation: .greaterThanOrEqual,toItem: container, attribute: .leading),\n             NSLayoutConstraint(item: view, attribute: .bottom, relation: .lessThanOrEqual, toItem: container, attribute: .bottom),\n             NSLayoutConstraint(item: view, attribute: .trailing, relation: .lessThanOrEqual, toItem: container, attribute: .trailing),\n             NSLayoutConstraint(item: view, attribute: .centerX, relation: .equal, toItem: container, attribute: .centerX),\n             NSLayoutConstraint(item: view, attribute: .centerY, relation: .equal, toItem: container, attribute: .centerY)]\n        )\n    }\n\n    @Test func pinToSuperviewAlongAxis() {\n         expectEqualConstraints(\n            view.anchors.edges.pin(axis: .vertical),\n             [NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top),\n              NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom)]\n         )\n         expectEqualConstraints(\n             view.anchors.edges.pin(axis: .horizontal),\n             [NSLayoutConstraint(item: view, attribute: .leading, toItem: container, attribute: .leading),\n              NSLayoutConstraint(item: view, attribute: .trailing, toItem: container, attribute: .trailing)]\n         )\n     }\n}\n"
  },
  {
    "path": "Tests/AnchorCollectionSizeTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorCollectionSizeTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func setSize() {\n        expectEqualConstraints(\n            view.anchors.size.equal(CGSize(width: 5, height: 10)),\n            [NSLayoutConstraint(item: view, attribute: .width, constant: 5),\n             NSLayoutConstraint(item: view, attribute: .height, constant: 10)]\n        )\n    }\n\n    @Test func matchSize() {\n        expectEqualConstraints(\n            view.anchors.size.equal(container),\n            [NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width),\n             NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .height)]\n        )\n    }\n\n    @Test func matchSizeWithInsets() {\n        expectEqualConstraints(\n            view.anchors.size.equal(container, insets: CGSize(width: 10, height: 20)),\n            [NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, constant: -10),\n             NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .height, constant: -20)]\n        )\n    }\n\n    @Test func matchSizeMultiplier() {\n        expectEqualConstraints(\n            view.anchors.size.equal(container, multiplier: 2),\n            [NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 2),\n             NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .height, multiplier: 2)]\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorDimensionTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorDimensionTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func setWidth() {\n        expectEqualConstraints(\n            view.anchors.width.equal(10),\n            NSLayoutConstraint(item: view, attribute: .width, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.width.greaterThanOrEqual(10),\n            NSLayoutConstraint(item: view, attribute: .width, relation: .greaterThanOrEqual, constant: 10)\n        )\n    }\n\n    @Test func setHeight() {\n        expectEqualConstraints(\n            view.anchors.height.equal(10),\n            NSLayoutConstraint(item: view, attribute: .height, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.height.greaterThanOrEqual(10),\n            NSLayoutConstraint(item: view, attribute: .height, relation: .greaterThanOrEqual, constant: 10)\n        )\n    }\n\n    @Test func matchWidth() {\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width)\n        )\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.height), // can mix and match\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .height)\n        )\n    }\n\n    @Test func clamp() {\n        expectEqualConstraints(\n            view.anchors.height.clamp(to: 10...20),\n            [NSLayoutConstraint(item: view, attribute: .height, relation: .greaterThanOrEqual, constant: 10),\n             NSLayoutConstraint(item: view, attribute: .height, relation: .lessThanOrEqual, constant: 20)]\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorEdgeTests.swift",
    "content": "//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorEdgeTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    // MARK: Pinning\n\n    @Test func pinToSuperview() {\n        test(\"pin top to superview\") {\n            let c = view.anchors.top.pin()\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top))\n        }\n\n        test(\"pin top to superview with inset\") {\n            let c = view.anchors.top.pin(inset: 10)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 10))\n        }\n        test(\"pin bottom to superview with inset\") {\n            let c = view.anchors.bottom.pin(inset: 10)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom, constant: -10))\n        }\n        test(\"pin left to superview with inset\") {\n            let c = view.anchors.left.pin(inset: 10)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .left, toItem: container, attribute: .left, constant: 10))\n        }\n        test(\"pin right to superview with inset\") {\n            let c = view.anchors.right.pin(inset: 10)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .right, toItem: container, attribute: .right, constant: -10))\n        }\n    }\n\n#if os(iOS) || os(tvOS)\n    @Test func pinToSuperviewMargin() {\n        test(\"pin top to superview margin\") {\n            let c = view.anchors.top.pin(to: container.layoutMarginsGuide)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container.layoutMarginsGuide, attribute: .top))\n        }\n\n        test(\"pin top to superview margin with inset\") {\n            let c = view.anchors.top.pin(to: container.layoutMarginsGuide, inset: 10)\n            expectEqualConstraints(c, NSLayoutConstraint(item: view, attribute: .top, toItem: container.layoutMarginsGuide, attribute: .top, constant: 10))\n        }\n    }\n#endif\n}\n"
  },
  {
    "path": "Tests/AnchorPerformanceTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n// WARNING: Don't forget to compile for Release mode!\n@MainActor\n@Suite struct AnchorPerformanceTests {\n    @available(iOS 16, tvOS 16, macOS 13, watchOS 9, *)\n    @Test func pin() {\n        let view = View()\n        let container = View()\n        container.addSubview(view)\n\n        let clock = ContinuousClock()\n        let elapsed = clock.measure {\n            for _ in 0...10_000 {\n                view.anchors.edges.pin(alignment: .center)\n            }\n        }\n        print(\"testPin: \\(format(elapsed))\")\n    }\n\n    @available(iOS 16, tvOS 16, macOS 13, watchOS 9, *)\n    @Test func batchedPin() {\n        let view = View()\n        let container = View()\n        container.addSubview(view)\n\n        let clock = ContinuousClock()\n        let elapsed = clock.measure {\n            for _ in 0...10_000 {\n                Constraints {\n                    view.anchors.edges.pin(alignment: .center)\n                }\n            }\n        }\n        print(\"batchedPin: \\(format(elapsed))\")\n    }\n\n    @available(iOS 16, tvOS 16, macOS 13, watchOS 9, *)\n    @Test func constraintsPin() {\n        let view = View()\n        let container = View()\n        container.addSubview(view)\n\n        Constraints(for: view, container) { view, container in\n            view.top.equal(container.top)\n        }\n\n        let clock = ContinuousClock()\n        let elapsed = clock.measure {\n            Constraints {\n                for _ in 0...10_000 {\n                    view.anchors.width.equal(view.anchors.height)\n                }\n            }\n        }\n        print(\"testConstraintsPin: \\(format(elapsed))\")\n    }\n\n    @available(iOS 16, tvOS 16, macOS 13, watchOS 9, *)\n    private func format(_ duration: Duration) -> String {\n        let ms = Double(duration.components.seconds) * 1_000 + Double(duration.components.attoseconds) / 1e15\n        return String(format: \"%.3f ms\", ms)\n    }\n}\n"
  },
  {
    "path": "Tests/AnchorTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct AnchorTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func constraintsCreatedByAnchorsAreInstalledAutomatically() {\n        let constraint = view.anchors.top.equal(container.anchors.top)\n        #expect(constraint.isActive == true)\n    }\n\n    @Test func firstViewSetToTranslatesAutoresizingMaskIntoConstraints() {\n        // make sure that the precondition is always true\n        view.translatesAutoresizingMaskIntoConstraints = true\n        container.translatesAutoresizingMaskIntoConstraints = true\n        #expect(view.translatesAutoresizingMaskIntoConstraints)\n        #expect(container.translatesAutoresizingMaskIntoConstraints)\n\n        view.anchors.top.equal(container.anchors.top)\n\n        #expect(!view.translatesAutoresizingMaskIntoConstraints)\n        #expect(container.translatesAutoresizingMaskIntoConstraints)\n\n        view.translatesAutoresizingMaskIntoConstraints = true\n        container.anchors.top.equal(view.anchors.top)\n\n        #expect(view.translatesAutoresizingMaskIntoConstraints)\n        #expect(!container.translatesAutoresizingMaskIntoConstraints)\n    }\n\n    // MARK: Offsetting\n\n    @Test func offsettingTopAnchor() {\n        let anchor = container.anchors.top + 10\n        expectEqualConstraints(\n            view.anchors.top.equal(anchor),\n            NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.top.equal(anchor + 10),\n            NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 20)\n        )\n        expectEqualConstraints( // test that works both ways\n            anchor.equal(view.anchors.top),\n            NSLayoutConstraint(item: container, attribute: .top, toItem: view, attribute: .top, constant: -10)\n        )\n    }\n\n    @Test func offsettingUsingOperators() {\n        expectEqualConstraints(\n            view.anchors.top.equal(container.anchors.top + 10),\n            NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.top.equal(container.anchors.top - 10),\n            NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: -10)\n        )\n    }\n\n    @Test func offsettingRightAnchor() {\n        let anchor = container.anchors.right - 10\n        expectEqualConstraints(\n            view.anchors.right.equal(anchor),\n            NSLayoutConstraint(item: view, attribute: .right, toItem: container, attribute: .right, constant: -10)\n        )\n        expectEqualConstraints( // test that works both ways\n            anchor.equal(view.anchors.right),\n            NSLayoutConstraint(item: container, attribute: .right, toItem: view, attribute: .right, constant: 10)\n        )\n    }\n\n    @Test func aligningTwoOffsetAnchors() {\n        let containerTop = container.anchors.top + 10\n        let viewTop = view.anchors.top + 10\n        expectEqualConstraints(\n            viewTop.equal(containerTop), // nobody's going to do that, but it's nice it's their\n            NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top, constant: 0)\n        )\n    }\n\n    @Test func offsettingWidth() {\n        expectEqualConstraints(\n            view.anchors.height.equal(container.anchors.width + 10),\n            NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .width, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.height.equal(container.anchors.width - 10),\n            NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .width, constant: -10)\n        )\n    }\n\n    @Test func offsetingMultipleTimes() {\n        expectEqualConstraints(\n            view.anchors.height.equal((container.anchors.width + 10) + 10),\n            NSLayoutConstraint(item: view, attribute: .height, toItem: container, attribute: .width, constant: 20)\n        )\n    }\n\n    // MARK: Multiplying\n\n    @Test func multiplyingWidth() {\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width * 0.5),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5)\n        )\n        expectEqualConstraints(\n            (view.anchors.width * 2).equal(container.anchors.width),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5)\n        )\n    }\n\n    @Test func multiplyingMultipleTimes() {\n        expectEqualConstraints(\n            view.anchors.width.equal((container.anchors.width * 0.5) * 0.5),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.25)\n        )\n        expectEqualConstraints(\n            ((view.anchors.width * 2) * 2).equal(container.anchors.width),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.25)\n        )\n    }\n\n    @Test func multiplyingBothAnchors() {\n        expectEqualConstraints(\n            (view.anchors.width * 0.5).equal(container.anchors.width * 0.5),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 1)\n        )\n    }\n\n    // MARK: Dividing\n\n    @Test func dividingWidth() {\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width / 2),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5)\n        )\n        expectEqualConstraints(\n            (view.anchors.width / 2).equal(container.anchors.width),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 2)\n        )\n    }\n\n    @Test func dividingMatchesMultiplyingByReciprocal() {\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width / 4),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.25)\n        )\n    }\n\n    // MARK: Mixing Multiplier and Offset\n\n    @Test func mixingMultiplierAndOffset() {\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width * 0.5 + 10),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5, constant: 10)\n        )\n        expectEqualConstraints(\n            view.anchors.width.equal((container.anchors.width + 10) * 0.5),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5, constant: 5)\n        )\n        expectEqualConstraints(\n            view.anchors.width.equal((container.anchors.width + 10) * 0.5 + 7),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 0.5, constant: 12)\n        )\n        expectEqualConstraints(\n            view.anchors.width.equal(((container.anchors.width + 10) * 0.5 + 7) * 2),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 1, constant: 24)\n        )\n\n        expectEqualConstraints(\n            view.anchors.width.equal(container.anchors.width + 10 * 0.5),\n            NSLayoutConstraint(item: view, attribute: .width, toItem: container, attribute: .width, multiplier: 1, constant: 5)\n        )\n    }\n}\n"
  },
  {
    "path": "Tests/ConstraintsTests.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\nimport Align\n\n@MainActor\n@Suite struct ConstraintsTests {\n    let container = View()\n    let view = View()\n\n    init() {\n        container.addSubview(view)\n    }\n\n    @Test func canChangePriorityInsideInit() {\n        Constraints {\n            let c = view.anchors.top.pin()\n            #expect(c.priority.rawValue == 1000)\n            c.priority = LayoutPriority(999)\n            #expect(c.priority.rawValue == 999)\n        }\n    }\n\n    // MARK: Nesting\n\n    @Test func callsCanBeNested() { // no arguments\n        Constraints() {\n            expectEqualConstraints(\n                view.anchors.top.pin(),\n                NSLayoutConstraint(item: view, attribute: .top, toItem: container, attribute: .top)\n            )\n            Constraints() {\n                expectEqualConstraints(\n                    view.anchors.bottom.pin(),\n                    NSLayoutConstraint(item: view, attribute: .bottom, toItem: container, attribute: .bottom)\n                )\n            }\n        }\n    }\n}\n\n@MainActor\n@Suite struct ConstraintsArityTests {\n    let container = View()\n    let a = View()\n    let b = View()\n    let c = View()\n    let d = View()\n\n    init() {\n        container.addSubview(a)\n        container.addSubview(b)\n        container.addSubview(c)\n        container.addSubview(d)\n    }\n\n    // MARK: Test That Behaves Like Standard Init\n\n    @Test func arity() {\n        Constraints(for: a, b) { a, b in\n            let constraint = a.top.equal(b.top)\n            expectEqualConstraints(constraint, NSLayoutConstraint(\n                item: self.a,\n                attribute: .top,\n                relation: .equal,\n                toItem: self.b,\n                attribute: .top\n            ))\n        }\n    }\n\n    @Test func canChangePriorityInsideInit() {\n        Constraints(for: a) {\n            let cons = $0.top.pin()\n            #expect(cons.priority.rawValue == 1000)\n            cons.priority = LayoutPriority(999)\n            #expect(cons.priority.rawValue == 999)\n        }\n    }\n\n    @Test func callsCanBeNested() {\n        Constraints(for: a) {\n            expectEqualConstraints(\n                $0.top.pin(),\n                NSLayoutConstraint(item: a, attribute: .top, toItem: container, attribute: .top)\n            )\n            Constraints(for: a) {\n                expectEqualConstraints(\n                    $0.bottom.pin(),\n                    NSLayoutConstraint(item: a, attribute: .bottom, toItem: container, attribute: .bottom)\n                )\n            }\n        }\n    }\n\n    @Test func collection() {\n        let constraints = Constraints {\n            a.anchors.top.pin()\n            a.anchors.bottom.pin()\n        }\n\n        expectEqualConstraints(constraints.constraints, [\n            NSLayoutConstraint(item: a, attribute: .top, toItem: container, attribute: .top),\n            NSLayoutConstraint(item: a, attribute: .bottom, toItem: container, attribute: .bottom)\n        ])\n\n        expectEqualConstraints(\n            constraints.constraints[0],\n            NSLayoutConstraint(item: a, attribute: .top, toItem: container, attribute: .top)\n        )\n\n        expectEqualConstraints(\n            constraints.constraints[1],\n            NSLayoutConstraint(item: a, attribute: .bottom, toItem: container, attribute: .bottom)\n        )\n    }\n\n    // MARK: Multiple Arguments\n\n    @Test func one() {\n        Constraints(for: a) {\n            #expect($0.item === a)\n            return\n        }\n    }\n\n    @Test func two() {\n        Constraints(for: a, b) {\n            #expect($0.item === a)\n            #expect($1.item === b)\n        }\n    }\n\n    @Test func three() {\n        Constraints(for: a, b, c) {\n            #expect($0.item === a)\n            #expect($1.item === b)\n            #expect($2.item === c)\n        }\n    }\n\n    @Test func four() {\n        Constraints(for: a, b, c, d) {\n            #expect($0.item === a)\n            #expect($1.item === b)\n            #expect($2.item === c)\n            #expect($3.item === d)\n        }\n    }\n}\n\n#if os(iOS) || os(tvOS)\n@MainActor\n@Suite struct AddingSubviewsTests {\n    let container = View()\n    let a = View()\n    let b = View()\n    let c = View()\n    let d = View()\n\n    @Test func one() {\n        container.addSubview(a) {\n            #expect($0.item.superview === container)\n            #expect($0.item === a)\n            return\n        }\n    }\n\n    @Test func two() {\n        container.addSubview(a, b) {\n            #expect($0.item.superview === container)\n            #expect($1.item.superview === container)\n            #expect($0.item === a)\n            #expect($1.item === b)\n        }\n    }\n\n    @Test func three() {\n        container.addSubview(a, b, c) {\n            #expect($0.item.superview === container)\n            #expect($1.item.superview === container)\n            #expect($2.item.superview === container)\n            #expect($0.item === a)\n            #expect($1.item === b)\n            #expect($2.item === c)\n        }\n    }\n\n    @Test func four() {\n        container.addSubview(a, b, c, d) {\n            #expect($0.item.superview === container)\n            #expect($1.item.superview === container)\n            #expect($2.item.superview === container)\n            #expect($3.item.superview === container)\n            #expect($0.item === a)\n            #expect($1.item === b)\n            #expect($2.item === c)\n            #expect($3.item === d)\n        }\n    }\n}\n#endif\n"
  },
  {
    "path": "Tests/Extensions/Align+Extensions.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\n#if os(iOS) || os(tvOS)\n\nimport Align\nimport UIKit\n\n// MARK: - UIView + Constraints\n\npublic extension UIView {\n    @discardableResult @nonobjc func addSubview<each Item: UIView>(\n        _ item: repeat each Item,\n        constraints: (repeat LayoutAnchors<each Item>) -> Void\n    ) -> Constraints {\n        _ = (repeat addSubview(each item))\n        return Constraints(for: repeat each item, closure: constraints)\n    }\n}\n\n#endif\n"
  },
  {
    "path": "Tests/Extensions/Diff.swift",
    "content": "//\n//  Difference.swift\n//  Difference\n//\n//  Created by Krzysztof Zablocki on 18.10.2017\n//  Copyright © 2017 Krzysztof Zablocki. All rights reserved.\n//\n\nimport Foundation\n\nfileprivate extension String {\n    init<T>(dumping object: T) {\n        self.init()\n        dump(object, to: &self)\n    }\n}\n\n/// Compares 2 objects and iterates over their differences\n///\n/// - Parameters:\n///   - lhs: expected object\n///   - rhs: received object\n///   - closure: iteration closure\nfileprivate func diff<T>(_ expected: T, _ received: T, level: Int = 0, closure: (_ description: String) -> Void) {\n    let lhsMirror = Mirror(reflecting: expected)\n    let rhsMirror = Mirror(reflecting: received)\n\n    guard lhsMirror.children.count != 0 else {\n        if String(dumping: received) != String(dumping: expected) {\n            closure(\"received: \\\"\\(received)\\\" expected: \\\"\\(expected)\\\"\\n\")\n        }\n        return\n    }\n\n    let zipped = zip(lhsMirror.children, rhsMirror.children)\n    zipped.forEach { (lhs, rhs) in\n        let leftDump = String(dumping: lhs.value)\n        if leftDump != String(dumping: rhs.value) {\n            if let notPrimitive = Mirror(reflecting: lhs.value).displayStyle, notPrimitive != .tuple {\n                var results = [String]()\n                diff(lhs.value, rhs.value, level: level + 1) { diff in\n                    results.append(diff)\n                }\n                if !results.isEmpty {\n                    closure(\"child \\(lhs.label ?? \"\"):\\n\\((0..<level).reduce(\"\") { acc, _ in acc + \"\\t\" })\" + results.joined())\n                }\n            } else {\n                closure(\"\\(lhs.label ?? \"\") received: \\\"\\(rhs.value)\\\" expected: \\\"\\(lhs.value)\\\"\\n\")\n            }\n        }\n    }\n}\n\n\n/// Builds list of differences between 2 objects\n///\n/// - Parameters:\n///   - expected: Expected value\n///   - received: Received value\n/// - Returns: List of differences\npublic func diff<T>(_ expected: T, _ received: T) -> [String] {\n    var all = [String]()\n    diff(expected, received) { all.append($0) }\n    return all\n}\n\n/// Prints list of differences between 2 objects\n///\n/// - Parameters:\n///   - expected: Expected value\n///   - received: Received value\npublic func dumpDiff<T: Equatable>(_ expected: T, _ received: T) {\n    // skip equal\n    guard expected != received else {\n        return\n    }\n\n    diff(expected, received).forEach { print($0) }\n}\n\n/// Prints list of differences between 2 objects\n///\n/// - Parameters:\n///   - expected: Expected value\n///   - received: Received value\npublic func dumpDiff<T>(_ expected: T, _ received: T) {\n    diff(expected, received).forEach { print($0) }\n}\n\n"
  },
  {
    "path": "Tests/Extensions/XCTestExtensions.swift",
    "content": "// The MIT License (MIT)\n//\n// Copyright (c) 2017-2026 Alexander Grebenyuk (github.com/kean).\n\nimport Testing\n#if os(iOS) || os(tvOS)\nimport UIKit\n#elseif os(macOS)\nimport AppKit\n#endif\n\nfunc test(_ title: String? = nil, _ closure: () -> Void) {\n    closure()\n}\n\nfunc test<T>(_ title: String? = nil, with element: T, _ closure: (T) -> Void) {\n    closure(element)\n}\n\n// MARK: Asserts\n\n@MainActor\npublic func expectEqualConstraints(_ expected: [NSLayoutConstraint], _ received: [NSLayoutConstraint], sourceLocation: SourceLocation = #_sourceLocation) {\n    #expect(expected.count == received.count, sourceLocation: sourceLocation)\n\n    var received = received\n    for c in expected {\n        let idx = received.firstIndex(where: {\n            Constraint($0) == Constraint(c)\n        })\n        #expect(idx != nil, \"Failed to find constraints: \\(c)\\n\\nExpected: \\(expected)\\n\\nReceived: \\(received)\", sourceLocation: sourceLocation)\n        if let idx = idx {\n            received.remove(at: idx)\n        }\n    }\n}\n\n@MainActor\npublic func expectEqualConstraints(_ expected: NSLayoutConstraint, _ received: NSLayoutConstraint, sourceLocation: SourceLocation = #_sourceLocation) {\n    expectEqualConstraints(Constraint(expected), Constraint(received), sourceLocation: sourceLocation)\n}\n\n@MainActor\nprivate func expectEqualConstraints<T: Equatable>(_ expected: T, _ received: T, sourceLocation: SourceLocation = #_sourceLocation) {\n    print(diff(expected, received))\n    #expect(expected == received, \"Found difference for \\(diff(expected, received).joined(separator: \", \"))\", sourceLocation: sourceLocation)\n}\n\n// MARK: Constraints\n\nextension NSLayoutConstraint {\n    @nonobjc convenience init(item item1: Any, attribute attr1: NSLayoutConstraint.Attribute, relation: NSLayoutConstraint.Relation = .equal, toItem item2: Any? = nil, attribute attr2: NSLayoutConstraint.Attribute? = nil, multiplier: CGFloat = 1, constant: CGFloat = 0, priority: Float? = nil, id: String? = nil) {\n        self.init(item: item1, attribute: attr1, relatedBy: relation, toItem: item2, attribute: attr2 ?? .notAnAttribute, multiplier: multiplier, constant: constant)\n        if let priority = priority { self.priority = LayoutPriority(priority) }\n        if let id = id { self.identifier = id }\n    }\n}\n\n@MainActor\nprivate struct Constraint {\n    let firstItem: AnyObject?\n    let firstAttribute: String\n    let secondItem: AnyObject?\n    let secondAttribute: String\n    let relation: NSLayoutConstraint.Relation.RawValue\n    let multiplier: CGFloat\n    let constant: CGFloat\n    let priority: LayoutPriority.RawValue\n    let identifier: String?\n\n    init(_ c: NSLayoutConstraint) {\n        firstItem = c.firstItem\n        firstAttribute = c.firstAttribute.toString\n        secondItem = c.secondItem\n        secondAttribute = c.secondAttribute.toString\n        relation = c.relation.rawValue\n        multiplier = c.multiplier\n        constant = c.constant\n        priority = c.priority.rawValue\n        identifier = c.identifier\n    }\n}\n\n#if swift(>=6.0)\nextension Constraint: @preconcurrency Equatable {\n    static func ==(lhs: Constraint, rhs: Constraint) -> Bool {\n        return lhs.firstItem === rhs.firstItem &&\n            lhs.firstAttribute == rhs.firstAttribute &&\n            lhs.relation == rhs.relation &&\n            lhs.secondItem === rhs.secondItem &&\n            lhs.secondAttribute == rhs.secondAttribute &&\n            lhs.multiplier == rhs.multiplier &&\n            lhs.constant == rhs.constant &&\n            lhs.priority == rhs.priority &&\n            lhs.identifier == rhs.identifier\n    }\n}\n#else\nextension Constraint: Equatable {\n    static func ==(lhs: Constraint, rhs: Constraint) -> Bool {\n        return lhs.firstItem === rhs.firstItem &&\n            lhs.firstAttribute == rhs.firstAttribute &&\n            lhs.relation == rhs.relation &&\n            lhs.secondItem === rhs.secondItem &&\n            lhs.secondAttribute == rhs.secondAttribute &&\n            lhs.multiplier == rhs.multiplier &&\n            lhs.constant == rhs.constant &&\n            lhs.priority == rhs.priority &&\n            lhs.identifier == rhs.identifier\n    }\n}\n#endif\n\n// MARK: Helpers\n\nextension NSLayoutConstraint.Attribute {\n    var toString: String {\n        switch self {\n        case .width: return \"width\"\n        case .height: return \"height\"\n        case .bottom: return \"bottom\"\n        case .top: return \"top\"\n        case .left: return \"left\"\n        case .right: return \"right\"\n        case .leading: return \"leading\"\n        case .trailing: return \"trailing\"\n        case .centerX: return \"centerX\"\n        case .centerY: return \"centerY\"\n        case .lastBaseline: return \"lastBaseline\"\n        case .firstBaseline: return \"firstBaseline\"\n        case .notAnAttribute: return \"notAnAttribute\"\n#if os(iOS) || os(tvOS)\n        case .bottomMargin: return \"bottomMargin\"\n        case .topMargin: return \"topMargin\"\n        case .leftMargin: return \"leftMargin\"\n        case .rightMargin: return \"rightMargin\"\n        case .leadingMargin: return \"leadingMargin\"\n        case .trailingMargin: return \"trailingMargin\"\n        case .centerXWithinMargins: return \"centerXWithinMargins\"\n        case .centerYWithinMargins: return \"centerYWithinMargins\"\n#endif\n        @unknown default: return \"unexpected\"\n        }\n    }\n}\n\n#if os(iOS) || os(tvOS)\ntypealias View = UIView\ntypealias LayoutPriority = UILayoutPriority\n#elseif os(macOS)\ntypealias View = NSView\ntypealias LayoutPriority = NSLayoutConstraint.Priority\n#endif\n"
  }
]